Re: HABTM and associations and loading

2009-01-05 Thread Troy Schmidt

Yes I think it is HABTM on HABTM that causes the problem.  But no one
has any comment on the performance hit seen by bindModel?  If there is
any.

On Jan 4, 8:48 pm, Webweave  wrote:
> What do you mean "never runs" ? Do you mean it times out, or dies, or
> what ?
>
> On Jan 4, 4:32 pm, Troy Schmidt  wrote:
>
> > I have a database of 20 tables and several belongsTo, hasMany, and
> > HABTM relationships.  When I have all my relationships loaded into the
> > models and turned on the program never runs.  When I take out two of
> > the HABTM that I will rarely use or can write a custom bindModel to
> > run, then the application runs, but on viewing one page loads all the
> > models into memory (or at least it seems as such since it caches all
> > the tables).
>
> > Now I went through and aggressively took out any associations that I
> > didn't think would be used often.  The remainder I plan on using
> > bindModel as needed to load them.  My question is does anyone know
> > what the performance ramifications are to this model?  Should I let it
> > load all of them and keep the associations loading essentially the
> > entire application?  What kind of performance hit is there on
> > bindModel versus setting it in the model?  And also does bindModel
> > offer any caching to it or does it build it all from scratch every
> > time?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



HABTM and associations and loading

2009-01-04 Thread Troy Schmidt

I have a database of 20 tables and several belongsTo, hasMany, and
HABTM relationships.  When I have all my relationships loaded into the
models and turned on the program never runs.  When I take out two of
the HABTM that I will rarely use or can write a custom bindModel to
run, then the application runs, but on viewing one page loads all the
models into memory (or at least it seems as such since it caches all
the tables).

Now I went through and aggressively took out any associations that I
didn't think would be used often.  The remainder I plan on using
bindModel as needed to load them.  My question is does anyone know
what the performance ramifications are to this model?  Should I let it
load all of them and keep the associations loading essentially the
entire application?  What kind of performance hit is there on
bindModel versus setting it in the model?  And also does bindModel
offer any caching to it or does it build it all from scratch every
time?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Small problem passing variables

2008-12-28 Thread Troy Schmidt

$this->User->getInsertID();

I don't know about the Auth component as i haven't used it alot.  But
that would get the last inserted ID.  I would just set that variable
and include it in the view for the future steps.

Otherwise it looks like 'user_id' isn't set yet for user

On Dec 28, 11:11 am, Steppio  wrote:
> Hello everybody, i am totally new to Cake and am finding it quite
> difficult to understand all the different parts of it. At the moment
> i'm trying to make a three part user registration process, firstly
> with the username and password fields, then onto details about the
> user, then on to duties they wish to undertake on the site. The only
> problem i am having is once the username and password are created it
> creates an ID in the users tables, referenced to my other tables as
> 'user_id'. What i cannot quite figure out is how, once a user is
> created, would i get that user_id into the duties view? What i am
> doing at the moment is shown below:
>
>         function add() {
>                 if (!empty($this->data)) {
>                         $this->User->create();
>                         if ($this->User->saveAll($this->data)) {
>                                 $this->Session->setFlash(__('Your Username 
> and Password have been
> saved', true));
>                                 $cookie = array();
>                                 $cookie['user_id'] = 
> $this->Auth->user('user_id');
>                                 $this->Session->write('Auth.User', $cookie);
>                                 
> $this->redirect(array('controller'=>'details','action'=>'add'));
>                         } else {
>                                 $this->Session->setFlash(__('Your Username 
> and Password could not
> be saved. Please, try again.', true));
>                         }
>                 }
>         }
>
> ^users_ controller^
>
> I then call this in the 'duties/add' view with:
>
>                 $user_id = $session->read('User_id');
>
>                 echo $form->input('user_id',array('value' => $user_id ));
>
> The only problem with this is Cake returns a select box populated with
> all of the id's in the user tables. All i want is the ID that has just
> been created.
>
> This is probably a very simple problem but i've been reading alot on
> the internet and just cannot understand how to do it. Any help and
> advice would be greatly appreciated!!
>
> Yours hopefully,
> Steppio
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: the Gift of 1.2 Final

2008-12-28 Thread Troy Schmidt

Has anyone had a chance to reproduce the tests to confirm the new
speed for CakePHP 1.2 final?  This would be something good to combat
Rasmus's old test results on RC2.  I am getting tired of seeing that
mentioned in blog postings still, but am not proficient enough to
generate new test results.

On Dec 25, 7:51 pm, Gwoo  wrote:
> //Warning: this message is long and full of goodies.
>
> History does not happen, it is made.
>
> Today, the history of the CakePHP grows stronger. December 25, 2008
> will be remembered as one of the most important points in this
> history. After exactly 2 yrs from the first development release, we
> can happily say we have the most stable and powerful web framework
> available. Please enjoy our big present to you, CakePHP 1.2 stable
> [1]. For this release, we have removed the test files from the build,
> and created a tag in SVN.
>
> Through the last two years, we have been blessed by a dedicated,
> talented, and opinionated community[2]. We have shared disagreements
> [3] and triumphs. We have won popularity contests[4] and been hated
> on. We have seen CakePHP grow into a truly international community[5].
> All of these events have generated an immense amount of passion for
> CakePHP.
>
> No one is more passionate about CakePHP than the developers[6] who
> close tickets and fix bugs.  We started out two years ago with a small
> team that dedicated countless hours to implementing new features into
> 1.2 and maintaining 1.1 stable. This team ensured the integrity of
> code and vision of the project. When we needed to grow, we found
> members of the community who showed the same amount of dedication and
> passion for CakePHP.  And with the launch of CakeBOOK, 
> onhttp://book.cakephp.org,
> we have seen the dedication and passion further extend to all the
> contributors and translators[7] of the fantastic documentation that
> makes learning about the power of CakePHP a bit easier.
>
> We have seen CakePHP adopted by large projects[8] and the growth of
> dedicated service companies[9]. We have held a workshop[10] to spread
> the knowledge and passion of CakePHP. And ultimately, we implemented a
> huge list of features...
>
>         - Tests!
>                 - All classes are test-covered, with good code coverage
>                 - Test suite now integrated into the framework
>                 - test generation
>                 - support for coverage analysis
>         - Command-line infrastructure
>                 - with more shell scripts and ability to write custom ones 
> easily
>         - Plugin architecture
>                 - Plugins are now distributable as packaged collections of 
> files
>                 - Can be loaded from your main app with a dot syntax
>         - Internationalization and Localization support
>                 - i18n and l10n classes
>                 - Support for unicode strings
>         - Auth component
>                 - automatically handles sessions for authenticated users
>                 - ties into ACL for automatic denial of protected content or 
> actions
>         - Email component
>                 - for generation of text and html email
>         - Security component
>                 - HTTP auth support, great for web services
>                 - CSRF protection
>         - Cookie component
>                 -  for secure cookie handling
>         - Custom model finders
>                 - simplified syntax
>                 - powerful and extensible
>         - Join models
>                 - for modeling and accessing HABTM join tables
>         - Behaviors, new way to extend models
>                 - Supports "mixing in" new functionality
>         - Containable behavior
>                 -  simplified query optimization
>         - Validation system extended
>                 -  with new Validation class, lots of rules
>                 - multiple rules and messages
>         - Database drivers
>                 - support for many more databases including DB2 and Oracle
>         - Caching
>                 - Adapter-driven caching, with support for APC/XCache/Memcache
>         - Set class,
>                 - for magical array hacking
>         - Socket and HttpSocket classes
>                 -  for dealing with remote data and services
>         - Debugger class, for detailed introspection of errors
>                 - Get stack traces anywhere in your code
>                 - Introspected help on errors, with context information
>         - Pagination
>                 - one of the first additions to the new version
>                 - one of the simplest systems known
>         - Proper Routing
>                 - mapResources() method for exposing controllers via REST
>                 - Reverse routing support
>                 - Named arguments
>                 - Magic variables for common regexes
>                 - Support for file extensions with custom content type 
> mappings
>         - View stuff
>    

Re: FAQs page hacked?

2008-06-15 Thread Troy Schmidt

Works fine for me.  Maybe your computer is hacked.

On Jun 15, 9:00 am, cakeFreak <[EMAIL PROTECTED]> wrote:
> Hey guys has the FAQs page got hacked?
>
> http://groups.google.com/group/cake-php/web/faq
>
> Every entry points to a movie site!!!
>
> Dan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: A gift for all to enjoy

2006-12-27 Thread Troy Schmidt


Always awesome!  Hard to believe I have been eating Cake for over a
year now.  My how does time fly.  Well seeing it from pre-beta releases
to playing with 1.2 dev is really exciting.  CakePHP has really kept
true to it's mission, kept it's development chugging along with useful
features being added.  It has been a wonderful year and I look forward
to what next year will bring.

On Dec 26, 7:35 am, "sawa" <[EMAIL PROTECTED]> wrote:

Thanks to cakePHP team for making my life easier!!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Caching not working

2006-11-08 Thread Troy Schmidt

So is your caching set for the view that is calling the img src or the
view that is called by img src?

Also, since you are getting the results out of database shouldn't you
be using query caching to achieve your result?

I am no view caching expert.

On Nov 7, 12:39 pm, "Kesher" <[EMAIL PROTECTED]> wrote:
> I don't know why, but my images (stored in mysql) aren't cached at all.
> I have followed all the steps pointed at the manual (I am pretty sure),
> caching "display" action inside "images" controller. So loading an
> image is something like:
> 
> img src="/imagenes/display/34"
> 
> What else should I do?


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: No mod_rewrite on *nix host

2006-11-08 Thread Troy Schmidt

Depends on what kind of host you have.  Some of them that isn't enough
and you have to also delete the .htaccess files (since it reads them
just doesn't honor).  Also, I have one (netfirms) where I have to
explicitly tell it the BASE_URL since it runs PHP in some weird CGI
mode that doesn't report the base_url properly.  There I have to put
define('BASE_URL', '/clients/index.php').

Also, are you sure that mod_rewrite isn't installed?  I have had to put
in RewriteBase / or RewriteBase /clients on some hosts to get them to
work.

So, make sure you are playing around with everything you need to.  I
install my app to the clients directory in the examples above.

On Nov 7, 6:38 pm, "Mike" <[EMAIL PROTECTED]> wrote:
> Can someone link me or explain how to handle a web server host that
> doesnt have mod_rewrite installed?  I tried uncommenting the
>
> //define ('BASE_URL', $_SERVER['SCRIPT_NAME']);
>
> Line, however nothing seemed to change.  Any thoughts?  Everything else
> works fine in my local env.
> 
> Thanks,


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Slow Site Load time Question

2006-10-30 Thread Troy Schmidt

My understanding was 24 hours for model caching.

If the site will be quite large then I would recommend looking into
view caching.  Just make sure you do all your homework and understand
about requestionactions, query execution, and how to exclude view
caching or will just create more headaches for yourself just diving in
to it without reading up on it first.

On Oct 29, 9:42 pm, "bibek" <[EMAIL PROTECTED]> wrote:
> how long does temporary caching last in debug mode?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Select tag with optgroup

2006-10-27 Thread Troy Schmidt

Maybe I will have to live on the cutting edge again and get 1.2 this is
the third time it has done something that v1 doesn't do.  Makes me want
it badly!!

On Oct 26, 5:54 pm, "nate" <[EMAIL PROTECTED]> wrote:
> FormHelper::select in Cake 1.2 supports optgroup tags, but the code
> posted above is definitely not it.  To my knowledge, no one has used
> this helper.  If you think it might be of help to you, by all means,
> try it out.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Select tag with optgroup

2006-10-26 Thread Troy Schmidt

So no one knows about this??

On Oct 25, 11:12 am, "Troy Schmidt" <[EMAIL PROTECTED]> wrote:
> Okay just trying to keep with the same thread.  Has anyone used this
> helper?  Is this something included now in the Cake core?
>
> -- Forwarded message --
> From: "zis" <[EMAIL PROTECTED]>
> Date: Apr 11, 4:38 am
> Subject: Select tag with optgroup
> To: Cake PHP
>
> Hi i would like to share with you a helper function to print a select
> tag with optgroups.
>
> Actually it's just a small mod the the existing selecttag function.
>
> To have optgroups, make the $optionElements parameter a two dimensional
> array. With the key for the sub array the name of the subgroup.. for
> example
>
> array(
> 'Fruits' => array(
> 'banana' => 'Bananas',
> 'apl' => 'Apples'
> ),
> 'Animals' => array(
> 'horse' => 'Horse',
> 'donley' => 'Donkey'
> ),
> 'car'=>'Car'
> )
>
> Note that car in the example will be outputed as a regular option
> element..
>
> Here's the helper.
>
> class MorehtmlHelper extends Helper {
>
> var $helpers = array('Html');
>
> /**
>  * Returns a SELECT element,
>  *
>  * @param string $fieldName Name attribute of the SELECT
>  * @param array $optionElements Array of the OPTION elements (as
> 'value'=>'Text' pairs) to be used in the SELECT element. Can be a
> 2dimensional array.
>  * @param boolean $show_empty Show/hide the empty select option
>  * @param array $selectAttr Array of HTML options for the opening
> SELECT element
>  * @param array $optionAttr Array of HTML options for the enclosed
> OPTION elements
>  * @return string Formatted SELECT element
>  */
> function selectOptTag($fieldName, $optionElements, $selected=null,
> $selectAttr=null, $optionAttr=null, $showEmpty=true)
> {
> $this->Html->setFormTag($fieldName);
> if ($this->Html->tagIsInvalid($this->Html->model,
> $this->Html->field))
> {
> if (isset($selectAttr['class']) &&
> trim($selectAttr['class']) != "")
> {
> $selectAttr['class'] .= ' form_error';
> }
> else
> {
> $selectAttr['class'] = 'form_error';
> }
> }
> // do not display the select tag if no option elements are
> avaible
> if (!is_array($optionElements) || count($optionElements) == 0)
> {
> return null;
> }
>
> if(!isset($selected))
> {
> $selected = $this->Html->tagValue($fieldName);
> }
>
> if( isset($selectAttr) && array_key_exists( "multiple",
> $selectAttr) )
> {
> $select[] =
> sprintf($this->Html->tags['selectmultiplestart'], $this->Html->model,
> $this->Html->field, $this->Html->parseHtmlOptions($selectAttr));
> }
> else
> {
> $select[] = sprintf($this->Html->tags['selectstart'],
> $this->Html->model, $this->Html->field,
> $this->Html->parseHtmlOptions($selectAttr));
> }
>
> if($showEmpty == true)
> {
> $select[] = sprintf($this->Html->tags['selectempty'],
> $this->Html->parseHtmlOptions($optionAttr));
> }
>
> foreach ($optionElements as $name => $title)
> {
> if (is_array($title)) {
> $select[] = '';
> foreach ($title as $subname => $subtitle)
> {
> $optionsHere = $optionAttr;
> if (($selected !== null) && ($selected ==
> $subname))
> {
> $optionsHere['selected'] = 'selected';
> } else if ( is_array($selected) &&
> array_key_exists($subname, $selected) )
> {
> $optionsHere['selected'] = 'selected';
> }
> $select[] =
> sprintf($this->Html->tags['selectoption'],
> $subname, $this->Html->parseHtmlOptions($optionsHere), $subtitle);
>
> }
>   

Select tag with optgroup

2006-10-25 Thread Troy Schmidt

Okay just trying to keep with the same thread.  Has anyone used this
helper?  Is this something included now in the Cake core?


-- Forwarded message --
From: "zis" <[EMAIL PROTECTED]>
Date: Apr 11, 4:38 am
Subject: Select tag with optgroup
To: Cake PHP


Hi i would like to share with you a helper function to print a select
tag with optgroups.

Actually it's just a small mod the the existing selecttag function.

To have optgroups, make the $optionElements parameter a two dimensional
array. With the key for the sub array the name of the subgroup.. for
example

array(
'Fruits' => array(
'banana' => 'Bananas',
'apl' => 'Apples'
),
'Animals' => array(
'horse' => 'Horse',
'donley' => 'Donkey'
),
'car'=>'Car'
)

Note that car in the example will be outputed as a regular option
element..

Here's the helper.

class MorehtmlHelper extends Helper {

var $helpers = array('Html');

/**
 * Returns a SELECT element,
 *
 * @param string $fieldName Name attribute of the SELECT
 * @param array $optionElements Array of the OPTION elements (as
'value'=>'Text' pairs) to be used in the SELECT element. Can be a
2dimensional array.
 * @param boolean $show_empty Show/hide the empty select option
 * @param array $selectAttr Array of HTML options for the opening
SELECT element
 * @param array $optionAttr Array of HTML options for the enclosed
OPTION elements
 * @return string Formatted SELECT element
 */
function selectOptTag($fieldName, $optionElements, $selected=null,
$selectAttr=null, $optionAttr=null, $showEmpty=true)
{
$this->Html->setFormTag($fieldName);
if ($this->Html->tagIsInvalid($this->Html->model,
$this->Html->field))
{
if (isset($selectAttr['class']) &&
trim($selectAttr['class']) != "")
{
$selectAttr['class'] .= ' form_error';
}
else
{
$selectAttr['class'] = 'form_error';
}
}
// do not display the select tag if no option elements are
avaible
if (!is_array($optionElements) || count($optionElements) == 0)
{
return null;
}

if(!isset($selected))
{
$selected = $this->Html->tagValue($fieldName);
}

if( isset($selectAttr) && array_key_exists( "multiple",
$selectAttr) )
{
$select[] =
sprintf($this->Html->tags['selectmultiplestart'], $this->Html->model,
$this->Html->field, $this->Html->parseHtmlOptions($selectAttr));
}
else
{
$select[] = sprintf($this->Html->tags['selectstart'],
$this->Html->model, $this->Html->field,
$this->Html->parseHtmlOptions($selectAttr));
}

if($showEmpty == true)
{
$select[] = sprintf($this->Html->tags['selectempty'],
$this->Html->parseHtmlOptions($optionAttr));
}

foreach ($optionElements as $name => $title)
{
if (is_array($title)) {
$select[] = '';
foreach ($title as $subname => $subtitle)
{
$optionsHere = $optionAttr;
if (($selected !== null) && ($selected ==
$subname))
{
$optionsHere['selected'] = 'selected';
} else if ( is_array($selected) &&
array_key_exists($subname, $selected) )
{
$optionsHere['selected'] = 'selected';
}
$select[] =
sprintf($this->Html->tags['selectoption'],
$subname, $this->Html->parseHtmlOptions($optionsHere), $subtitle);

}
$select[] = '';

}
else {
$optionsHere = $optionAttr;
if (($selected !== null) && ($selected == $name))
{
$optionsHere['selected'] = 'selected';
} else if ( is_array($selected) &&
array_key_exists($name,
$selected) )
{
$optionsHere['selected'] = 'selected';
}
$select[] =
sprintf($this->Html->tags['selectoption'],
$name, $this->Html->parseHtmlOptions($optionsHere), $title);
}
}

$select[] = sprintf($this->Html->tags['selectend']);

return implode("\n", $select);
}

}


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: About rendering.... again....

2006-10-11 Thread Troy Schmidt

Agreed I don't quite understand what you are trying to do?!?!

If you are doing it for ajax then call the requestaction in the view.

On Oct 11, 12:43 pm, clemos <[EMAIL PROTECTED]> wrote:
> hi again temm
>
> I'm still not sure to really get the point.
> I still think your method is way too complex and obfuscating, and you
> should try to stick a bit more to the MVC techniques, and use the
> standard features of Cake.
>
> why "pre-rendering" your data in your controller ?
> Why don't you just transmit the $data directly to your view, and let
> it render it ?
>
> 
> clemos
>
> On 10/11/06, temm <[EMAIL PROTECTED]> wrote:
>
>
>
> > thanks for help!!
> > clemos, the main goal of this staf  -  i made class MyAppControler
> > extends AppController with function
> > function parseObjByData($data){
> > $showrule = $this->showrule;
> > $this->set('res', $data);
> > ob_start();
> > $this->render($showrule->getPattern(),'empty');
> > $res = ob_get_contents();
> > ob_end_clean();
> > return $res;
> > }
>
> > and
> > function parseObjByDataArr($data){
> > $showrule = $this->showrule;
> > $res=array();
> > for($i=0;$i > $res[] = $this->parseObjByData($data[$i]);
> > }
> > return $res;
> > }
> > so for example in news controler i can say something like this
>
> > class NewsController extends MyAppController
> > {
> > .
> > function showNewsAll($page=1){
> > ..
> > $this->set('res',$this->parseObjByDataArr($data);
> > ..
> > }
> > .
> > }
> > and all parsing i do this way...


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: strange behaviour of save() in a model

2006-10-10 Thread Troy Schmidt

Without more of your code no.  Post more of your controller and views
in Cakebin.  www.cakephp.org/pastes

On Oct 10, 9:05 am, "taised" <[EMAIL PROTECTED]> wrote:
> Update: it seems that the problem happens only with firefox! Using
> explorer it's all ok... does anyone know how this can happen?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: When to use query() over findAll() | Is this such a case?

2006-10-09 Thread Troy Schmidt

Okay they can be done with CakePHP.  The first thing you need to do is
make the "virtual fields" of average_rating and CameraCount using
afterFind in your model.

Then, when using FindAll you can pass the order of Category.cameraCount
ASC etc.  Keep in mind that you can also sort on associated fields by
calling them out explicility.  $this->ModelName->findAll(null, null,
AssociatedModel.fieldname ASC);

On Oct 8, 8:42 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi there,
>
> I'm writing an application in CakePHP and everything's going well so
> far.
>
> I've got a slight problem though in trying to order my results when the
> order condition is not straightforward.
>
> I have a list of Categories and a list of Cameras.  These are joined by
> a hasAndBelongsTo relationship.
> The schema is all good and everything works just fine.
>
> I have a list of categories on my site and display stats such as the
> number of cameras in the category
> and the average user rating for each of these cameras.
>
> I want to be able to offer various sorting options on the list of
> categories:
>
> 1) Sort by name (easy using findAll()!)
> 2) Sort by number of cameras in category.
> 3) Sort by average rating of all cameras in a category.
>
> The first one is a doddle using a findAll().
>
> As far as I can see, I can't use Cake's built-in ActiveRecord-like
> functions to do 2) and 3).  Am I missing something here??
>
> My options for them would seem to be to use query() or to sort the
> array in php in the view.  The latter option just seems wrong to me as
> I believe on getting the DB to do as much of my work for me as I
> can
>
> Here are the straight SQL statements to get me what I want.  Can this
> be translated into cake's database functions or am I best to stick with
> the straight SQL?
>
> Any thoughts would be much appreciated,
>
> Euan.
>
> For case 2:
>
> $sql = "SELECT Category.*, COUNT(cameras_categories.camera_id) AS cnt
> FROM categories Category
> LEFT JOIN cameras_categories ON
> (Category.id=cameras_categories.category_id)
> GROUP BY Category.id
> ORDER BY cnt DESC";
>
> For case 3:
> $sql = "SELECT Category.*, AVG(Rating.value) AS avg
> FROM categories Category
> LEFT JOIN cameras_categories ON
> (Category.id=cameras_categories.category_id)
> LEFT JOIN cameras Camera ON
> (cameras_categories.camera_id=Camera.id)
> LEFT JOIN ratings Rating ON (Camera.id=Rating.camera_id)
> GROUP BY Category.id
> ORDER BY avg DESC";
>
> Schema for the relevant tables:
>
> ql> describe categories;describe cameras;describe camerast_categories;
> +---+--+--+-+-++
> | Field | Type | Null | Key | Default | Extra
>|
> +---+--+--+-+-++
> | id| int(10) unsigned |  | PRI | NULL|
> auto_increment |
> | category_name | varchar(50)  |  | UNI | |
>|
> | category_desc | text | YES  | | NULL|
>|
> | category_keywords | text | YES  | | NULL|
>|
> | sort_order| int(4)   | YES  | | 0   |
>|
> | created   | datetime | YES  | | NULL|
>|
> | modified  | datetime | YES  | | NULL|
>|
> +---+--+--+-+-++
> 7 rows in set (0.00 sec)
>
> +---+--+--+-+---++
> | Field | Type | Null | Key | Default   | Extra
>  |
> +---+--+--+-+---++
> | id| int(10) unsigned |  | PRI | NULL  |
> auto_increment |
> | url_name  | varchar(40)  |  | UNI |   |
>  |
> | title | varchar(40)  |  | |   |
>  |
> | img_path  | varchar(150) |  | |   |
>  |
> | short_desc| varchar(150) | YES  | | NULL  |
>  |
> | long_desc | text | YES  | | NULL  |
>  |
> | longitude | decimal(12,7)|  | | 0.000 |
>  |
> | latitude  | decimal(12,7)|  | | 0.000 |
>  |
> | is_ptz| tinyint(1)   | YES  | | NULL  |
>  |
> | is_relay  | tinyint(1)   | YES  | | NULL  |
>  |
> | status| tinyint(1)   | YES  | | NULL  |
>  |
> | width | int(4)   | YES  | | NULL  |
>  |
> | height| int(4)   | YES  | | NULL  |
>  |
> | client_name   | varchar(75)  | YES  | | NULL  |
>  |
> | client_url| varchar(150) | YES  | | NULL  |
>  |
> | client_web| varchar(150) | YES  | | NULL  |
>  |
> | created  

Re: problems with save() and saveField()

2006-10-09 Thread Troy Schmidt

Can you do a quick example Nate?  I am not following.  This is
something I would have done in coding as well.

On Oct 8, 10:46 am, "nate" <[EMAIL PROTECTED]> wrote:
> Also, why are you passing parameters to RequestHandler->isPost?  All it
> does is return true or false if the request method of the current
> request is POST.
>
> If you're looking to require a post request for a given set of actions,
> you need the Security component.  You can do the following in your
> controller:
>
> function beforeFilter() {
> $this->Security->requirePost('action', 'action', 'action');
>
> }Also, it looks like you're doing a lot of unnecessary validation in
> your controller.  What you can do is add an alternate set of validation
> rules in your model, then add a separate model method to change the
> password, and use that to switch the validation rules to use the
> alternate.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Still Prb with Ajax and Uft8

2006-10-09 Thread Troy Schmidt

OH!  Didn't know you were using $ajax->div.  See I do my own div'ing so
I hadn't encountered that problem.

On Oct 8, 8:35 pm, "francky06l" <[EMAIL PROTECTED]> wrote:
> Thanks, I manage to make modifications in the ajax.php but I will have
> a look into the 1.2 files
> 
> Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: How to distinguish empty recordset from error in findAll()

2006-10-09 Thread Troy Schmidt

All this talk of Cake 1.2  makes me want to try it out!

On Oct 9, 10:01 am, "nate" <[EMAIL PROTECTED]> wrote:
> If there was no error but no results, it returns an empty array.  If
> there was an error, it returns false.  Also, as of Cake 1.2, the
> onError model callback is triggered.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Still Prb with Ajax and Uft8

2006-10-07 Thread Troy Schmidt

Are you using the RequestHandler component?  I had problems in IE with
AJAX and once I used the RequestHandler it automagically did the
necessary things to make it work correctly.

Also, why so many posts about this today?

On Oct 7, 5:25 pm, "francky06l" <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I have made a very simple system (wihout DB) to test and evaluate my
> problems of Ajax and UtF8. Basically I use a default.thtml minimum, I
> have a method that output an HTML and I update one of the div using
> Ajax call...
> The HTML oupout correctly the UTF-8 the Ajax call does not ... the 2
> HTML are saved in UTF-8 wihtout BOM, when I look to the Ajax
> HttpRequest, it seems fine only the browser does not seem to
> "interpret" the UTF-8.
> I have also used the same sample using the utf8_decode php call and
> that's ok.
>
> I can drop the code (quite simple) to the cake bin, if someone can have
> a look and tell me what I made wrong (maybe my PHP settings ?). I am
> using Apache 1.33,  PHP 5, and the last release "Stable" of cakePhp..
> 
> I just do not know the URL of the cake bin :-)
> 
> Thanks
> Franck


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: AJAX not woking in IE

2006-10-07 Thread Troy Schmidt

Use the RequestHandler component.  Last problem with IE was that it
required UTF-8 and the header for that.  The RequestHandler places that
in there automatically.  You are probably having problems with
submitting forms and them not working, right?  And links that update
divs will work, eh?

This is in addition to what Sam mentioned above, but this was my big
problem was the UTF-8.

On Oct 7, 4:37 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> here are somethings that have caused me problems with ie and scripta/prototype
>
> stuff in tables
> nested forms (never a good idea anyway)
> lack of unique id's on contained elements
>
> load order of scripts and other js code
>
> HTH
> Sam D
>
> On 10/7/06, Brian Wisti <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On 10/7/06, ski.nalicio.us <[EMAIL PROTECTED]> wrote:
>
> > > I have been playing with AJAX/scriptaculous in cakePHP and havent had
> > > any problems with IE or FireFox.
>
> > > Have you tried the script you are working on in another browser (e.g.
> > > FireFox)? If you have and it worked in the other browser, check that
> > > your installation of IE has Javascript enabled.
>
> > Yep, it's always a good idea to double-check in another browser. It's
> > also good to show the code that's not working. If you can't (because
> > you'd be compromising national security or whatever), at least let
> > folks know what you're trying to do and what AjaxHelper methods you're
> > trying to use. That's assuming you're using the AjaxHelper, but for
> > all we know you're handwriting code on little pieces of paper and
> > taping it to the monitor.
>
> > This is sounding *much* snarkier than I intended. Rest assured, I've
> > asked questions the same way many times in the past in a number of
> > public forums, and been told pretty much the same thing: give us code,
> > and give us a detailed description.
>
> > Kind Regards,
>
> > Brian Wisti
> >http://coolnamehere.com/--
> ==
> S. DeVore
> (the old fart) the advice is free, the lack of crankiness will cost you


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: response encoding in ajax forms

2006-10-07 Thread Troy Schmidt

Checkout Firebug for Firefox it will actually allow you to see the
XMLHTTPRequest, and the headers for them.  So, you can stop guessing.
But I know IE chokes with AJAX on some calls if you aren't making the
charset UTF-8.  If you use the RequestHandler component it places that
header in there for you automagically.

On Oct 7, 4:43 am, "geobaev" <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I have the following problem:
>
> I need to work with the bulgarian language.
>
> I properly configured the communication with MySQL server by sending
> 'SET NAMES UTF-8' in the begining of each request.
> I am sure that the data is properly saved and properly retrieved.
>
> The problem is that when the data must be displayed in the same form
> fields for edition it is displayed incorrectly. The php command
> 'print_r($data)' in the controller shows that same data correctly.
>
> I think that the problem is due to the the fact that actually this is
> ajax form response and no header data could be interpeted by the
> browser.
>
> I tried
>
> 
>
> on the top of the view, trying to inform the browser that data in this
> encoding comes next...
>
> I use the CJX snippet.
>
> I don't have any idea what could be the problem.
> 
> Please help
> 
> Thanks in advance


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Prb UTF-8 and Ajax

2006-10-07 Thread Troy Schmidt

You need to put that header in your ajax.thtml layout.  That is the
layout used with ajax calls.  Although I seem to remember that the
RequestHandler Component when used will put that header in there for
you since without the UTF8 IE would choke on certain AJAX calls.

On Oct 7, 6:31 am, "francky06l" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have checked the previous post into the group, but I have a problem
> of UTF-8 and ajax calls. We are making a site that should handle
> Bulgarian language.
> We have a form that saves correctly the data in UTF-8  (using SET NAMES
> UTF-8) into the construct of the app_model.php file.
> The problem appears when we view and input field initialized with the
> data from the DB, it does not show the correct characters. We verified
> that the ouput of the DB is correct, but it seems that because the
> "form" view comes from an AJax request, the browser (FireFox) does not
> translate the current UTF-8 Data.
> We have the correct charset into the default.thtml :
> ,
> but there is no header sent with an Ajax request, maybe the browser
> does not interpret it?
>
> We are using the last snippet CJS (2.1.1) but really get stuck now. I
> was woundering about the !DOCTYPE declaration and the  xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
> declaration ... but not sure this is the good direction to go..
> 
> Any help would be great
> Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: relative links

2006-10-06 Thread Troy Schmidt

If you have to use anything absolute I have found that FULL_BASE_URL .
$this->base . "/controller/action"

This works with subdomains as well which is why I throw the $this->base
in there.

On Oct 6, 1:54 pm, "MicroAngelo" <[EMAIL PROTECTED]> wrote:
> James Booker wrote:
> > use the HtmlHelper->link and HtmlHelper->image functions to get
> > everything working as you expectFor JavaScript use the 
> > JavascriptHelper->link function
> For CSS use the HtmlHelper->css function


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Pagination based on conditions across hasAndBelongsToMany association

2006-10-05 Thread Troy Schmidt

WHAT?!?!?!  You can pass an array for queries to execute and get the
data??  How come I am just learning of this??  So, can you tell me how
the subSQL[] array renders SQL code?  This is amazing new information.

On Oct 5, 6:17 am, "nnichols" <[EMAIL PROTECTED]> wrote:
> Thank you so much for your help.  Just the suggestion I needed.  I'm
> just slightly disappointed that I couldn't figure that out for myself
> ;-)
> 
> Cheers
> 
> Nick


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: How to Update a Div with an AJAX Form Submit

2006-10-05 Thread Troy Schmidt

Very good example.  The only thing I have a problem with is the
$this->controller call in the view.  In the next version of Cake the
accessibility of the models will be removed from the views so that will
break then.  And that kind of logic (since parameters could customize
the criteria, limit, pagination helper, etc) should be in the
controller to set 'params' to be passed to the view.

On Oct 5, 8:01 am, "Reine" <[EMAIL PROTECTED]> wrote:
> BlenderStyle wrote:
> > => 'posts_div')) to update the div. How does the add method come into
> > play when updating the div? Does the add view end up being used to
> > update posts_div? Do I have to render a partial. (I'm not really sure
> > what render a partial means, but I'm willing to learn if it's
> > necessary.)Here's how I do it: make the add view update the index list. 
> > When you
> say "render a partial", it may mean rendering an element inside a view.
> Below are sample codes:
>
> INSIDE views/posts
>
> ***index.thtml***
> 
> Posts
> 
> 
>  $pagination->setPaging($paging);
> echo $this->renderElement('posts/ajax_post_list', $params);
> echo $javascript->codeBlock('initDrag();');
> echo $this->renderElement('pagination',$paging);
> ?>
> 
>  onclick="javascript:new Effect.Appear('add_post');"> $html->image('add.gif', array('alt'=>'Add A Post', 'border'=>'0',
> 'width'=>'6', 'height'=>'6')); ?> Add A Post
> 
>
> 
> 
>  $arr = array(
>   'post' => array(
> 'title'=>'',
> 'body'=>''
>   )
> );
> $params = array('act'=>'add', 'controller'=>'posts', 'data'=>$arr);
> echo $this->renderElement('posts/ajax_post_edit', $params);
> ?>
> 
>
> ***add.thtml***
>  $data = $this->controller->Post->findAll(null, null, 'id');
> $params = array('controller'=>'posts', 'data'=>$data);
> echo $this->renderElement('posts/ajax_post_list', $params);
> ?>
>
> INSIDE views/elements/posts
>
> ***ajax_post_list.thtml***
> 
> Here is a list of the posts.
> 
> 
>   
>  $Post = $row['Post'];
> ?>
> 
>?>
> 
> 
>   
> 
> 
> 
>
> ***ajax_post_edit.thtml***
> 
> 
> 
>Post
> 
>   hidden('Post/id'); ?>
>   
>   
> Title
> input('Post/title', array("size"=>30,
> "maxlength"=>255, "id"=>$act.'Title')); ?>
> Message
> input('Post/body', array("size"=>30,
> "maxlength"=>255, "id"=>$act.'Body')); ?>
>   
>  if ($actText == "Add") {
>   ?>
>   
> submit('Save',
> array('url' => 'add', 'update' => 'post_list', 'complete' => 'new
> Effect.Fade(\'add_post\');stripe();initDrag();')); ?>
>  value="Clear">
>   
>  } else { ?>
>   
> submit('Save',
> array('url' => 'edit', 'update' => 'post_list', 'complete' => 'new
> Effect.Fade(\'edit_post\');stripe();initDrag();')); ?>
>   
>  }
>   ?>
>   
> 
> [  href="javascript:new Effect.Fade(' ?>_post');void(0);">Hide ]
> 
> 
>
> Note: This element handles both the add and edit functions but let's
> concentrate on the add function only.
>
> Here's what happens:
> 1. When the index view is loaded, it initially displays a list of post
> titles.
> 2. When the add link is clicked, the ajax-ed add form (add element) is
> shown (it was hidden from initial view).
> 3. When the user clicks on the Save button, the controller saves the
> data and renders the add view that updates the ajax-ed index list (list
> element). Hence, the list was updated without page refresh.
> 
> I hope these helps.
> 
> Regards,
> Reine


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: How to Update a Div with an AJAX Form Submit

2006-10-05 Thread Troy Schmidt

You could always try the good old fashioned search feature to the
group.  As this has been discussed at length.  Especially if the only
problem is you don't know how.

BUT, I will advise for you not to use $ajax->form.  First, it uses the
deprecated $html->formTag.  Second, I have had it not work on some
computer configurations especially my friend IE.  Making the form as
normal and using $ajax->submit() has worked much more globally on
browsers for me.  Plus, it doesn't use anything deprecated.

On Oct 5, 4:43 am, "carlosrg" <[EMAIL PROTECTED]> wrote:
> With the ajax->form you are writting an ajax call. You can pass some
> parameters, but the most important are the function "Post/add" and the
> div to update.
>
> In the add action you have to save the new data, to do a new query to
> get the new data and then render an ajax view ($this->layout = 'ajax';)
>
> The ajax view could be like:
>
> div('div_id'); ?>
>   
> 
> 
> 
>   
> link('View','/admin/serial_numbers/view/' .
> $row['SerialNumber']['id'])?>
>  $html->link('Edit','/admin/serial_numbers/edit/' .
> $row['SerialNumber']['id'])?>
>  $html->link('Delete','/admin/serial_numbers/delete/' .
> $row['SerialNumber']['id'])?>
> 
> 
>   
> divEnd('div_id'); ?>


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Is this normal behaviour?

2006-10-04 Thread Troy Schmidt

I just confirmed that since upgraded to latest 1.1.8 it now has the
same problem regardless of PHP version or my development environments.
So, I am most certain it is a bug and have submitted to trac.  Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: OT: AJAX help

2006-10-04 Thread Troy Schmidt

You will call a function that will then run an AJAX call, get the
result, and manipulate it.  Based on the result you will create
childNodes no innerHTML or replacing.  Actual DOM methods.  It is
probably programming level advanced, which is below expert.  Personally
I would recommend using jQuery if you aren't too deep in Rico.  Easier
to write custom code with jQuery.  The difference is like coding PHP in
CakePHP versus doing it in raw PHP.

So, search for add table row script and you should find one that
doesn't use innerHTML or cloneNode.

var tblBody = document.getElementById(tblId).tBodies[0];
  var newNode = tblBody.rows[0].cloneNode(true);
  tblBody.appendChild(newNode);

So, instead of using the cloneNode you would have a whole drawn out
process to manually create the node based on your AJAX results.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



jQuery users

2006-10-03 Thread Troy Schmidt

Okay.  I am eating my big old bowl of crow right now.  I believe I may
be a jQuery convert.  I am doing a project right now where I will be
working with BakeSale which use jQuery.  Also, I found tweenbox for
jQuery which automatically resizes the "lightbox" with animation which
is perfect for my peGallery.

I wanted to know who in CakePHP land uses jQuery.  Also, has anyone
come up with a solution to make RequestHandler component work
automagically with jQuery as well.  Perhaps by passing a specific
parameter in the jQuery AJAX call?

Also, how interested is anyone in making an ajax helper for jQuery in
CakePHP?

I just looked and decided a Volkswagen Rabbit works well for me.  Sure
the Ford Mustang Shelby looks cooler, but it does so much more than
what I NEED.

So speak up jQuery and CakePHP users where are you and what have you
done to make jQuery play nicer with CakePHP.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Is this normal behaviour?

2006-10-03 Thread Troy Schmidt

Sorry what I was getting at is whether or not that is the way it always
has been.  i.e. is this a bug or not?

Like I said I have no helpers defined on a controller and calls to html
helper and javascript in the layout and view and they work fine locally
on my WAMP5 configuration.  When I load the same code up to the shared
host on PHP4 it screams in the layout about javascript being an
undefined object.  Now, all I have to do is define the $helpers array
in the controller to anything (html) and boom the javascript call works
fine even though I still don't have javascript listed (the offending
helper the first time around).

I am pretty sure it is a bug.  Or a "feature" of PHP4 only.  I just
upgraded to 1.1.8 so I was wondering if it was introduced in the
upgrade and if anyone has seen similar behaviour.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Pagination and Show selection

2006-10-03 Thread Troy Schmidt

I might end up modifying the pagination component to handle that like
you said.  Right now it isn't something that I do alot of so that is
why I didn't want to mess with the component.

I had a brain fart this morning and couldn't find what method in PHP
you are supposed to use to do that.  I kept thinking array_remove.  I
get so used to doing CakePHP programming I forget the simple PHP.

Thanks!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Is this normal behaviour?

2006-10-03 Thread Troy Schmidt

I thought that javascript and html helpers were loaded by default in
CakePHP.  It seems that with the latest release (1.1.8) that if I don't
have the $helpers array defined they aren't loaded.  But as soon as I
define anything for the $helpers array they are loaded by default.

I am running PHP4 shared.  On PHP5 (local) I want to say that they are
loaded by default regardless.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Pagination and Show selection

2006-10-03 Thread Troy Schmidt

One more thing

http://cakephp.org/pastes/show/67299e89330579310fb8b676975ed5c1

Is there a more elegant solution for me to persist the current state of
pagination for an action?  They may go to different actions and when
they come back to this one I want it to pick back up where they left
off.

I just thought the array_shifts and setting the options was a little
less elegant than it could be.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problem with cake

2006-10-03 Thread Troy Schmidt

That line is number 393 in my Cake.  What version of CakePHP you
running?

With Debug on what does your MySQL statements look like?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Pagination and Show selection

2006-10-03 Thread Troy Schmidt

Chalk it up to me being a dorkus.  I didn't realize how automagical the
new pagination really was.  I was grabbing the posted data, explicitly
setting the show with the options parameter.  Took out me and it works
fine now.

The only thing is that on subdomains CakePHP adds in a /webroot/ for
the kind of setup I have going on a shared server.  So, I had to wrap
the $pagination->_generateUrl() in an $html->url() to make it work for
me.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Pagination and Show selection

2006-10-03 Thread Troy Schmidt

Okay yours is working so I have to figure out what I am doing
differently.  See I know there is that part that it checks your
pagination values versus the defaults and if different appends them to
the querystring.  Well my show should be different than the default,
but it isn't getting appended.  So, you can select 10, but when you
click next page it goes right back to 5.

Anyway, I will take a look at your example and find out what I am doing
wrong.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Pagination and Show selection

2006-10-02 Thread Troy Schmidt

Okay the wiki example doesn't include how to use the select dropbox for
how many records to show per page.  I have been able to make it work.
The only problem is that everyway I do it it changes show all over the
place, including the Default.  So, none of the paged links get the show
variable appended to their querystring and thus the drop box doesn't
work on the next pages.

So, what is the correct way to process the Pagination's
resultsPerPageSelect() to the controller to make sure that only the
show variable gets manipulated and not the default one so that links
work?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Stats

2006-09-23 Thread Troy Schmidt
I LOVE my Google Analytics account.  It is wonderful for me.But, I just came across this for up to the minute statistics like you are wanting.http://www.curve2.com/trackpro.php
On 9/22/06, Brian French <[EMAIL PROTECTED]> wrote:



  


i believe google uses urchin. I think there is an open-source one out
there too that is also based on urchin.

John David Anderson (_psychic_) wrote:

  On Sep 21, 2006, at 7:48 AM, [EMAIL PROTECTED] wrote:  
  
Hello, i looking for some code that would help me to1) display "realtime" stats on my cake website (like number of hits inthe last xx minutes, of which how many guests and how many registered.
including the usernames of the registered ones) probably very usefullto know that i use othauth for authentication.
  
  $this->log() inside of the AppController's constructor (or in  beforeFilters) could probably handle most of this.  
  
2) calculate reports of the number of visitors, where they come from,what their referrer was, etc etc.  There are several 3rd party thingsthat can do this (eg google analytics)  but i probably can't use these
vendor apps for 1).  (eg google updates its stats every 3-6 hours  iirc).
  
  There are many apache log statistics programs. I've used AWSTATS  before, but you could probably google up others.-- John  









--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: php4 losing ID on update

2006-04-28 Thread Troy Schmidt
I think the official word is CakePHP only supports PHP > 4.3.11, but I could be mistaken.And I did report an enhancement to finding the last insert id using MySQL SQL command rather than the PHP mysql_insertid method.  So, maybe that enhancement would apply here?
On 4/28/06, Eric Banford <[EMAIL PROTECTED]> wrote:
I'm seeing a production issue with PHP4.3.2 where after an update of arecord the last insert ID gets lost. I have PHP4.4.1-pl1 on my machine,and it works just fine. My suspicion is it has something to do with the
logic branches in cake\libs\model\model_php4.php, but I'm not sure where.Does anyone know if this is a known issue with PHP4. Thanks for anydirection on this.Thanks,Eric
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---