$html input can't escape?

2008-10-11 Thread rocket

hey im on cake1.1 with a weird problem.
when i save to the db eveyrthing saves fine, but when i use $html-
>input and it autopopulates from the $data var, it can't seem to
escape the "-" and always produces "&" instead.

Any idea how to fix this?

thanks
rocket
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



xmlwriter

2008-10-11 Thread .
has anybody worked with xmlwriter (or similar) with cakephp? thanks

--~--~-~--~~~---~--~~
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: One controller for multiple models - Or any better design?

2008-10-11 Thread Jimmy Bourassa

It was indeed a very good idea.

I created a Calendar controller and a Results controller to hande both
events/games and results of these events/games.
In each controller, I created the proper action to generate the
elements that are included in the home page.

Now I need to do the entire page for events/games and results. I
*would like* to use the same controllers I made, but I am totally
clueless on how to paginate different models within a controller.

Or would it be easier (if possible at all) have a custom SQL query
that will fetch both games and events ordered by date, even if games
and events dont have the same data at all (except for date).

Thanks a ton =)


On 30 sep, 21:01, Adam Royle <[EMAIL PROTECTED]> wrote:
> I've used this before and it works well, with the ability to cache the
> element easily as well.
>
> http://bakery.cakephp.org/articles/view/creating-reusable-elements-wi...
>
> However, many people advise against using (abusing?) requestAction as
> it executes a whole new page request.
>
> If you cache the output however, it can be a good technique.
>
> Cheers,
> Adam
>
> On Oct 1, 9:59 am, Jimmy Bourassa <[EMAIL PROTECTED]> wrote:
>
> > I've been thinking about how to do this cakelike and so far I haven't
> > found anything that is not messy (and mostly because I am fairly new
> > to cake should I say)
>
> > Heres what I would like to do. I have Games and Events. On my
> > homepage, I want a "Coming up" section to show, let's say, the next
> > five event/games ordered by date.
>
> > So basically I need to gather information from two different models in
> > one single view (or element I think it'll be). And I need to be able
> > to order the whole lot by date.
>
> > Should I create a controller that uses ($var uses) Games and Events?
>
> > Thanks.
--~--~-~--~~~---~--~~
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: tilted table headers in cake...

2008-10-11 Thread xavierunited

Hell Naw lol lmao thanks dude i need that answer and laugh.

On 10/11/2008, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> On Sat, Oct 11, 2008 at 9:24 PM, soldier.coder
> <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> On Oct 11, 3:06 pm, "Xavier Mathews" <[EMAIL PROTECTED]> wrote:
>>> What kinda question is this???
>>
>> Cake is a framework.  As such, it trys to solve problems that a whole
>> lot of peeps have in creating PHP database driven sites.  So I just
>> asked myself, is it really possible that I am the *only person* who
>> has ever wanted tilted text in a table??  And when I answered "no", I
>> wondered if there was some cake helper that helped out.
>>
>
> Here is the simple answer.
>
> There ain't one.
>
> have a nice day
>
> >
>


-- 
Xavier A. Mathews
Student/Developer/Web-Master
GG Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]
"Fear of a name, only increases fear of the thing itself."

--~--~-~--~~~---~--~~
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: tilted table headers in cake...

2008-10-11 Thread Samuel DeVore

On Sat, Oct 11, 2008 at 9:24 PM, soldier.coder
<[EMAIL PROTECTED]> wrote:
>
>
>
> On Oct 11, 3:06 pm, "Xavier Mathews" <[EMAIL PROTECTED]> wrote:
>> What kinda question is this???
>
> Cake is a framework.  As such, it trys to solve problems that a whole
> lot of peeps have in creating PHP database driven sites.  So I just
> asked myself, is it really possible that I am the *only person* who
> has ever wanted tilted text in a table??  And when I answered "no", I
> wondered if there was some cake helper that helped out.
>

Here is the simple answer.

There ain't one.

have a nice day

--~--~-~--~~~---~--~~
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: tilted table headers in cake...

2008-10-11 Thread xavierunited

I am very sorry but i do not kno the answer. I will have someone look
at this for you.

On 10/11/2008, soldier.coder <[EMAIL PROTECTED]> wrote:
>
>
>
> On Oct 11, 3:06 pm, "Xavier Mathews" <[EMAIL PROTECTED]> wrote:
>> What kinda question is this???
>
> Cake is a framework.  As such, it trys to solve problems that a whole
> lot of peeps have in creating PHP database driven sites.  So I just
> asked myself, is it really possible that I am the *only person* who
> has ever wanted tilted text in a table??  And when I answered "no", I
> wondered if there was some cake helper that helped out.
>
> So please, could you just answer the question, if you know?  I've
> already looked on google, thanks.
>
>
>
> This is CakePHP so the question that you
>> asked is accepted here! As far as the code you may wanna check out this
>> like
>> or go to google search codes!
>>
>>  http://www.phpfreaks.com/
>>
>> Xavier A. Mathews
>> Student/Developer/Web-Master
>> GG Client Based Tech Support Specialist
>> Hazel Crest Illinois
>> [EMAIL PROTECTED]
>> "Fear of a name, only increases fear of the thing itself."
>>
>> On Sat, Oct 11, 2008 at 12:56 PM, Ed Drain
>> <[EMAIL PROTECTED]
>>
>>
>>
>> > wrote:
>> > Ok, I am not even sure this is as much a cake question as it is a
>> > php/html
>> > question
>>
>> > I'm writing this app that keeps track of grades and one of the things
>> > I'd
>> > like to do is have one overarching header that describes what category
>> > of
>> > grades is below it in a table, and then (here comes the question)
>> > underneath
>> > the category name I would like to have the dates tilted 45 degrees and
>> > have
>> > grades for each person under the dates they were due.
>>
>> > is there any cake code out there that lets you set up tables like that?
>>
>> > or php code that does?
>>
>> > I know you can create graphics on the fly that can be tilted to any
>> > degree
>> > measurement you want, but I haven't figured out how to have the tilted
>> > column lines on either side of a due date line up with the straight
>> > vertical  column lines
>> > of the rest of the table
>>
>> > Any help is appreciated.
>>
>> > thanks- Hide quoted text -
>>
>> - Show quoted text -
> >
>


-- 
Xavier A. Mathews
Student/Developer/Web-Master
GG Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]
"Fear of a name, only increases fear of the thing itself."

--~--~-~--~~~---~--~~
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: tilted table headers in cake...

2008-10-11 Thread soldier.coder



On Oct 11, 3:06 pm, "Xavier Mathews" <[EMAIL PROTECTED]> wrote:
> What kinda question is this???

Cake is a framework.  As such, it trys to solve problems that a whole
lot of peeps have in creating PHP database driven sites.  So I just
asked myself, is it really possible that I am the *only person* who
has ever wanted tilted text in a table??  And when I answered "no", I
wondered if there was some cake helper that helped out.

So please, could you just answer the question, if you know?  I've
already looked on google, thanks.



This is CakePHP so the question that you
> asked is accepted here! As far as the code you may wanna check out this like
> or go to google search codes!
>
>  http://www.phpfreaks.com/
>
> Xavier A. Mathews
> Student/Developer/Web-Master
> GG Client Based Tech Support Specialist
> Hazel Crest Illinois
> [EMAIL PROTECTED]
> "Fear of a name, only increases fear of the thing itself."
>
> On Sat, Oct 11, 2008 at 12:56 PM, Ed Drain <[EMAIL PROTECTED]
>
>
>
> > wrote:
> > Ok, I am not even sure this is as much a cake question as it is a php/html
> > question
>
> > I'm writing this app that keeps track of grades and one of the things I'd
> > like to do is have one overarching header that describes what category of
> > grades is below it in a table, and then (here comes the question) underneath
> > the category name I would like to have the dates tilted 45 degrees and have
> > grades for each person under the dates they were due.
>
> > is there any cake code out there that lets you set up tables like that?
>
> > or php code that does?
>
> > I know you can create graphics on the fly that can be tilted to any degree
> > measurement you want, but I haven't figured out how to have the tilted
> > column lines on either side of a due date line up with the straight
> > vertical  column lines
> > of the rest of the table
>
> > Any help is appreciated.
>
> > thanks- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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: In controller using too many models hit the performance?

2008-10-11 Thread David C. Zentgraf

Yes, the more models you use, the more overhead there is. Not only in  
terms of database hits, but simply the fact that an additional class  
needs to be included and loaded. So design your database and models  
wisely from the start.

Having said that, this overhead is often negligible, except for truly  
performance hungry apps. If you have such a performance hungry app,  
think about conditionally loading models with App::import.
Also, as soon as you go to debug mode 0, the models will be cached and  
not DESCRIBED every single time. (What Larry said.)

On 12 Oct 2008, at 11:42, [EMAIL PROTECTED] wrote:

>
> Hi there,
>
> My controller includes eight models as follows,
> var $uses = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H');
>
> When loading a view for the controller, it always DESCRIBE the above
> eight TABLES (models) even the action (view) has nothing to do with
> these tables. From the cakephp log on view, it is a big performance
> hit for me.
>
> Q:
> 1. is this by design?
> 2. how to reduce these queries?
>
> I didn't get much helpful info from internet and cakephp official
> site. I'd appreciate it if any help (or article link).
>
> Thanks,
> Bo
> >


--~--~-~--~~~---~--~~
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: In controller using too many models hit the performance?

2008-10-11 Thread Larry E. Masters aka PhpNut
Should have added, refresh your page within 10 seconds and you should see
the caching does work.

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Sat, Oct 11, 2008 at 9:42 PM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:

>
> Hi there,
>
> My controller includes eight models as follows,
> var $uses = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H');
>
> When loading a view for the controller, it always DESCRIBE the above
> eight TABLES (models) even the action (view) has nothing to do with
> these tables. From the cakephp log on view, it is a big performance
> hit for me.
>
> Q:
> 1. is this by design?
> 2. how to reduce these queries?
>
> I didn't get much helpful info from internet and cakephp official
> site. I'd appreciate it if any help (or article link).
>
> Thanks,
> Bo
> >
>


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

--~--~-~--~~~---~--~~
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: In controller using too many models hit the performance?

2008-10-11 Thread Larry E. Masters aka PhpNut
http://groups.google.com/group/cake-php/browse_thread/thread/93560397e44819e6/e69f61828e527664


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Sat, Oct 11, 2008 at 9:42 PM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:

>
> Hi there,
>
> My controller includes eight models as follows,
> var $uses = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H');
>
> When loading a view for the controller, it always DESCRIBE the above
> eight TABLES (models) even the action (view) has nothing to do with
> these tables. From the cakephp log on view, it is a big performance
> hit for me.
>
> Q:
> 1. is this by design?
> 2. how to reduce these queries?
>
> I didn't get much helpful info from internet and cakephp official
> site. I'd appreciate it if any help (or article link).
>
> Thanks,
> Bo
> >

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



In controller using too many models hit the performance?

2008-10-11 Thread [EMAIL PROTECTED]

Hi there,

My controller includes eight models as follows,
var $uses = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H');

When loading a view for the controller, it always DESCRIBE the above
eight TABLES (models) even the action (view) has nothing to do with
these tables. From the cakephp log on view, it is a big performance
hit for me.

Q:
1. is this by design?
2. how to reduce these queries?

I didn't get much helpful info from internet and cakephp official
site. I'd appreciate it if any help (or article link).

Thanks,
Bo
--~--~-~--~~~---~--~~
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: HABTM & Belongs_To Together?

2008-10-11 Thread Larry E. Masters aka PhpNut
Keith,
Bin you models and send the link to the bin in your email, I will show you
how to fix it.
http://bin.cakephp.org/add/Keith

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Sat, Oct 11, 2008 at 8:45 PM, Keith <[EMAIL PROTECTED]> wrote:

>
> So then...
>
> Does that mean that my problem is that I need to make my user_id in
> the projects table something like owner_id so that it won't get
> grouped in with the traditional habtm relationship that already exists
> with the user model?
>
> Thanks for the assistance.
>
> - Keith
>
> On Oct 11, 9:17 pm, "Larry E. Masters aka PhpNut" <[EMAIL PROTECTED]>
> wrote:
> > Helps to read the manual:
> >
> > http://manual.cakephp.org/view/79/Relationship-Types
> > "...however, aliases must be unique both within a single model and on
> both
> > sides of a belongsTo/hasMany or a belongTo/hasOne relationship. Choosing
> > non-unique names for model aliases can cause unexpected behavior."
> >
> > --
> > /**
> > * @author Larry E. Masters
> > * @var string $userName
> > * @param string $realName
> > * @returns string aka PhpNut
> > * @access  public
> > */
> >
> > On Sat, Oct 11, 2008 at 6:59 PM, <[EMAIL PROTECTED]> wrote:
> >
> > > Ok yea i am not sure abt the first part but David was right the
> > > debuging is impossible.
> >
> > > On 10/11/2008, David C. Zentgraf <[EMAIL PROTECTED]> wrote:
> >
> > > > A HABTM relationship will fetch data differently then a belongsTo
> > > > relationship.
> > > > HABTM will get you an array with multiple results, belongsTo just a
> > > > "flat" array.
> > > > $habtm = array(
> > > >   [0] => array(['id'] =>, ...),
> > > >   [1] => array(['id'] =>, ...)
> > > > )
> > > > $belongsTo = array(['id'] =>, ...)
> >
> > > > When you specify multiple associations, you'll have to specify unique
> > > > names for them.
> > > > var $belongsTo = array(
> > > >   'Owner' => array(...)
> > > > );
> > > > var $hasAndBelongsToMany = array(
> > > >   'Users' => array(...)
> > > > );
> >
> > > > You shouldn't/can't mix different associations under the same name.
> > > > Your output is screwed up because you're mixing the "flat" array with
> > > > the "multi" array. You can either fix that manually (also see Set
> > > > Class) or just keep it simple and name your associations properly.
> > > > BTW, your debug output is virtually impossible to read, use
> > > > debug($array) or pr($array) to spot these kinda things a lot easier.
> >
> > > > On 11 Oct 2008, at 23:58, Keith wrote:
> >
> > > >> Hi Villas,
> >
> > > >> I tried clearing out the cache and that didn't fix it unfortunately.
> >
> > > >> I have the max debug level set.  The code appears to be operating as
> > > >> programmed.
> >
> > > >> I tried a simple habtm with belongs_to in a scenario where I only
> had
> > > >> those two models and still got the same results.
> >
> > > >> I think it's a problem with how CakePHP is creating the array.  The
> > > >> first element in the array has no numeric identifier.  If you look
> > > >> back at the screenshot in the initial post you'll see that the first
> > > >> entry in the array is not [0] but rather is called [id] as it would
> be
> > > >> when there is a belongs_to and not a HABTM as well.
> >
> > > >> Unless I can figure something out I'm going to go ahead and just
> > > >> report it to cakePHP as a bug because there are legit reasons, like
> > > >> the one I'm building, where you'd want a habtm with a belongs_to in
> > > >> the same model.
> >
> > > >> - Keith
> >
> > > >> On Oct 11, 8:14 am, villas <[EMAIL PROTECTED]> wrote:
> > > >>> Hi Keith
> >
> > > >>> Thanks for the extra info although it still isn't very clear to me
> > > >>> from that what's going on.  However,  I would mention:
> > > >>> 1. Are you clearing your cache?  You might have old data hanging
> > > >>> around.
> > > >>> 2. Did you try to set a higher debug level to get more info?
> > > >>> 3. Did you try to experiment with Bake?  You can try different
> > > >>> scenarios which you should be able to get working without too much
> > > >>> sweat.
> >
> > > >>> Best regards.
> >
> > > >>> On Oct 11, 6:31 am, Keith <[EMAIL PROTECTED]> wrote:
> >
> > >  Just as a clarification on why I have it set up this way...
> >
> > >  The belongs_to is there because the users that creates the project
> > >  becomes the owner.
> > >  The has_and_belongs_to_many is there so that if a user wants
> someone
> > >  outside their department to access it they can manually add them.
> >
> > >  The problem looks like it's stemming from how cakePHP is handling
> > >  the
> > >  array...
> >
> > >  for the belongs_to the array keys are based on field names like
> > >  [id] &
> > >  [first_name], etc.
> > >  for the HABTM array the array keys are sequential as the "related
> > >  users" foreach loop expects.
> >
> > >  - Keith
> >
> > >  On Oct 11

Re: HABTM & Belongs_To Together?

2008-10-11 Thread Keith

So then...

Does that mean that my problem is that I need to make my user_id in
the projects table something like owner_id so that it won't get
grouped in with the traditional habtm relationship that already exists
with the user model?

Thanks for the assistance.

- Keith

On Oct 11, 9:17 pm, "Larry E. Masters aka PhpNut" <[EMAIL PROTECTED]>
wrote:
> Helps to read the manual:
>
> http://manual.cakephp.org/view/79/Relationship-Types
> "...however, aliases must be unique both within a single model and on both
> sides of a belongsTo/hasMany or a belongTo/hasOne relationship. Choosing
> non-unique names for model aliases can cause unexpected behavior."
>
> --
> /**
> * @author Larry E. Masters
> * @var string $userName
> * @param string $realName
> * @returns string aka PhpNut
> * @access  public
> */
>
> On Sat, Oct 11, 2008 at 6:59 PM, <[EMAIL PROTECTED]> wrote:
>
> > Ok yea i am not sure abt the first part but David was right the
> > debuging is impossible.
>
> > On 10/11/2008, David C. Zentgraf <[EMAIL PROTECTED]> wrote:
>
> > > A HABTM relationship will fetch data differently then a belongsTo
> > > relationship.
> > > HABTM will get you an array with multiple results, belongsTo just a
> > > "flat" array.
> > > $habtm = array(
> > >       [0] => array(['id'] =>, ...),
> > >       [1] => array(['id'] =>, ...)
> > > )
> > > $belongsTo = array(['id'] =>, ...)
>
> > > When you specify multiple associations, you'll have to specify unique
> > > names for them.
> > > var $belongsTo = array(
> > >       'Owner' => array(...)
> > > );
> > > var $hasAndBelongsToMany = array(
> > >       'Users' => array(...)
> > > );
>
> > > You shouldn't/can't mix different associations under the same name.
> > > Your output is screwed up because you're mixing the "flat" array with
> > > the "multi" array. You can either fix that manually (also see Set
> > > Class) or just keep it simple and name your associations properly.
> > > BTW, your debug output is virtually impossible to read, use
> > > debug($array) or pr($array) to spot these kinda things a lot easier.
>
> > > On 11 Oct 2008, at 23:58, Keith wrote:
>
> > >> Hi Villas,
>
> > >> I tried clearing out the cache and that didn't fix it unfortunately.
>
> > >> I have the max debug level set.  The code appears to be operating as
> > >> programmed.
>
> > >> I tried a simple habtm with belongs_to in a scenario where I only had
> > >> those two models and still got the same results.
>
> > >> I think it's a problem with how CakePHP is creating the array.  The
> > >> first element in the array has no numeric identifier.  If you look
> > >> back at the screenshot in the initial post you'll see that the first
> > >> entry in the array is not [0] but rather is called [id] as it would be
> > >> when there is a belongs_to and not a HABTM as well.
>
> > >> Unless I can figure something out I'm going to go ahead and just
> > >> report it to cakePHP as a bug because there are legit reasons, like
> > >> the one I'm building, where you'd want a habtm with a belongs_to in
> > >> the same model.
>
> > >> - Keith
>
> > >> On Oct 11, 8:14 am, villas <[EMAIL PROTECTED]> wrote:
> > >>> Hi Keith
>
> > >>> Thanks for the extra info although it still isn't very clear to me
> > >>> from that what's going on.  However,  I would mention:
> > >>> 1. Are you clearing your cache?  You might have old data hanging
> > >>> around.
> > >>> 2. Did you try to set a higher debug level to get more info?
> > >>> 3. Did you try to experiment with Bake?  You can try different
> > >>> scenarios which you should be able to get working without too much
> > >>> sweat.
>
> > >>> Best regards.
>
> > >>> On Oct 11, 6:31 am, Keith <[EMAIL PROTECTED]> wrote:
>
> >  Just as a clarification on why I have it set up this way...
>
> >  The belongs_to is there because the users that creates the project
> >  becomes the owner.
> >  The has_and_belongs_to_many is there so that if a user wants someone
> >  outside their department to access it they can manually add them.
>
> >  The problem looks like it's stemming from how cakePHP is handling
> >  the
> >  array...
>
> >  for the belongs_to the array keys are based on field names like
> >  [id] &
> >  [first_name], etc.
> >  for the HABTM array the array keys are sequential as the "related
> >  users" foreach loop expects.
>
> >  - Keith
>
> >  On Oct 11, 1:18 am, Keith <[EMAIL PROTECTED]> wrote:
>
> > > It looks to me like this is what is happening, but it's very
> > > strange...
>
> > > Even when no users are associated I'm getting 8 blank associated
> > > users
> > > which is exactly how many elements are in the array...
>
> > > So...
>
> > > It looks like it's taking the first character from each part of the
> > > first entry in the array and putting it there...
> > > K = Keith = First Name
> > > M = Medlin = Last Name
> > > etc. for each of the fields.
>
> > > So...I'm totall

Re: HABTM & Belongs_To Together?

2008-10-11 Thread Larry E. Masters aka PhpNut
Helps to read the manual:

http://manual.cakephp.org/view/79/Relationship-Types
"...however, aliases must be unique both within a single model and on both
sides of a belongsTo/hasMany or a belongTo/hasOne relationship. Choosing
non-unique names for model aliases can cause unexpected behavior."

-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Sat, Oct 11, 2008 at 6:59 PM, <[EMAIL PROTECTED]> wrote:

>
> Ok yea i am not sure abt the first part but David was right the
> debuging is impossible.
>
> On 10/11/2008, David C. Zentgraf <[EMAIL PROTECTED]> wrote:
> >
> > A HABTM relationship will fetch data differently then a belongsTo
> > relationship.
> > HABTM will get you an array with multiple results, belongsTo just a
> > "flat" array.
> > $habtm = array(
> >   [0] => array(['id'] =>, ...),
> >   [1] => array(['id'] =>, ...)
> > )
> > $belongsTo = array(['id'] =>, ...)
> >
> > When you specify multiple associations, you'll have to specify unique
> > names for them.
> > var $belongsTo = array(
> >   'Owner' => array(...)
> > );
> > var $hasAndBelongsToMany = array(
> >   'Users' => array(...)
> > );
> >
> > You shouldn't/can't mix different associations under the same name.
> > Your output is screwed up because you're mixing the "flat" array with
> > the "multi" array. You can either fix that manually (also see Set
> > Class) or just keep it simple and name your associations properly.
> > BTW, your debug output is virtually impossible to read, use
> > debug($array) or pr($array) to spot these kinda things a lot easier.
> >
> > On 11 Oct 2008, at 23:58, Keith wrote:
> >
> >>
> >> Hi Villas,
> >>
> >> I tried clearing out the cache and that didn't fix it unfortunately.
> >>
> >> I have the max debug level set.  The code appears to be operating as
> >> programmed.
> >>
> >> I tried a simple habtm with belongs_to in a scenario where I only had
> >> those two models and still got the same results.
> >>
> >> I think it's a problem with how CakePHP is creating the array.  The
> >> first element in the array has no numeric identifier.  If you look
> >> back at the screenshot in the initial post you'll see that the first
> >> entry in the array is not [0] but rather is called [id] as it would be
> >> when there is a belongs_to and not a HABTM as well.
> >>
> >> Unless I can figure something out I'm going to go ahead and just
> >> report it to cakePHP as a bug because there are legit reasons, like
> >> the one I'm building, where you'd want a habtm with a belongs_to in
> >> the same model.
> >>
> >> - Keith
> >>
> >> On Oct 11, 8:14 am, villas <[EMAIL PROTECTED]> wrote:
> >>> Hi Keith
> >>>
> >>> Thanks for the extra info although it still isn't very clear to me
> >>> from that what's going on.  However,  I would mention:
> >>> 1. Are you clearing your cache?  You might have old data hanging
> >>> around.
> >>> 2. Did you try to set a higher debug level to get more info?
> >>> 3. Did you try to experiment with Bake?  You can try different
> >>> scenarios which you should be able to get working without too much
> >>> sweat.
> >>>
> >>> Best regards.
> >>>
> >>> On Oct 11, 6:31 am, Keith <[EMAIL PROTECTED]> wrote:
> >>>
>  Just as a clarification on why I have it set up this way...
> >>>
>  The belongs_to is there because the users that creates the project
>  becomes the owner.
>  The has_and_belongs_to_many is there so that if a user wants someone
>  outside their department to access it they can manually add them.
> >>>
>  The problem looks like it's stemming from how cakePHP is handling
>  the
>  array...
> >>>
>  for the belongs_to the array keys are based on field names like
>  [id] &
>  [first_name], etc.
>  for the HABTM array the array keys are sequential as the "related
>  users" foreach loop expects.
> >>>
>  - Keith
> >>>
>  On Oct 11, 1:18 am, Keith <[EMAIL PROTECTED]> wrote:
> >>>
> > It looks to me like this is what is happening, but it's very
> > strange...
> >>>
> > Even when no users are associated I'm getting 8 blank associated
> > users
> > which is exactly how many elements are in the array...
> >>>
> > So...
> >>>
> > It looks like it's taking the first character from each part of the
> > first entry in the array and putting it there...
> > K = Keith = First Name
> > M = Medlin = Last Name
> > etc. for each of the fields.
> >>>
> > So...I'm totally confused why the following code would produce
> > that:
> >>>
> > SQL Query:
> > SELECT `User`.`id`, `User`.`first_name`, `User`.`last_name`,
> > `User`.`email`, `User`.`date_created`, `User`.`last_login`,
> > `User`.`username`, `User`.`password`, `ProjectsUser`.`user_id`,
> > `ProjectsUser`.`project_id` FROM `users` AS `User` JOIN
> > `projects_users` AS `ProjectsUser` ON
> > (`ProjectsUser`.`project_id` = 1
> 

Re: Problem using phpThumb

2008-10-11 Thread djXternal

I figured out the problem... The App:import line you provided me with
was needed, but I also had to check exactly which directory phpThumb
was trying to save the files to... the /app/tmp/thumbs dir as stated
in the article was wrong, it was trying to save in: /app/tmp/cache/
thumbs

So if anyone else has this problem, try echoing the $phpThumb-
>cache_filename to determine where it is trying to save

On Oct 11, 5:32 pm, Adam Royle <[EMAIL PROTECTED]> wrote:
> Try this
>
> App::import('Vendor', 'phpThumb', array('file' => 'phpThumb/
> phpthumb.class.php'));
>
> On Oct 12, 7:54 am, djXternal <[EMAIL PROTECTED]> wrote:
>
> > I am trying to set up phpThumb to generate thumbnails for me as seen
> > in:http://bakery.cakephp.org/articles/view/thumbnails-generation-with-ph...
>
> > I set everything up just as the article says, the only modification I
> > have made was to the line:
>
> > $sourceFilename = WWW_ROOT.$_GET['src'];
> > changed to:
> > $sourceFilename = WWW_ROOT.DS.'img'.$_GET['src'];
>
> > AND
>
> > vendor("phpthumb".DS."phpthumb.class");
> > changed to:
> > App::import('vendor', "phpthumb".DS."phpthumb.class");
>
> > The line with 'vendor()' gave me an error say it was an unknown
> > function.
>
> > Now the error I get is a Fatal error saying it cannot locate the
> > phpThumb() class and I am not sure why, it seems the vendor file
> > should loaded properly and it should see it...
>
> > Below is the entire ThumbsController
>
> >  > class ThumbsController extends AppController
> > {
> >     var $name = 'Thumbs';
> >     var $uses = null;
> >     var $layout = null;
> >     var $autoRender = false;
>
> >     function index()
> >         {
> >             if(empty($_GET['src'])){
> >                 die("No source image");
> >             }
>
> >             //width
> >             $width = (!isset($_GET['w'])) ? 100 : $_GET['w'];
> >             //height
> >             $height = (!isset($_GET['h'])) ? 150 : $_GET['h'];
> >             //quality
> >             $quality = (!isset($_GET['q'])) ? 75 : $_GET['q'];
>
> >             $sourceFilename = WWW_ROOT.DS.'img'.$_GET['src'];
>
> >             if(is_readable($sourceFilename)){
> >                 App::import('vendor',
> > "phpthumb".DS."phpthumb.class");
> >                 $phpThumb = new phpThumb();
>
> >                 $phpThumb->src = $sourceFilename;
> >                 $phpThumb->w = $width;
> >                 $phpThumb->h = $height;
> >                 $phpThumb->q = $quality;
> >                 $phpThumb->config_imagemagick_path = '/usr/bin/
> > convert';
> >                 $phpThumb->config_prefer_imagemagick = true;
> >                 $phpThumb->config_output_format = 'jpg';
> >                 $phpThumb->config_error_die_on_error = true;
> >                 $phpThumb->config_document_root = '';
> >                 $phpThumb->config_temp_directory = APP . 'tmp';
> >                 $phpThumb->config_cache_directory =
> > CACHE.'thumbs'.DS;
> >                 $phpThumb->config_cache_disable_warning = true;
>
> >                 $cacheFilename = md5($_SERVER['REQUEST_URI']);
>
> >                 $phpThumb->cache_filename = $phpThumb-
>
> > >config_cache_directory.$cacheFilename;
>
> >                 //Thanks to Kim Biesbjerg for his fix about cached
> > thumbnails being regeneratd
> >                 if(!is_file($phpThumb->cache_filename)){ // Check if
> > image is already cached.
> >                     if ($phpThumb->GenerateThumbnail()) {
> >                         $phpThumb->RenderToFile($phpThumb->cache_filename);
>
> >                     } else {
> >                         die('Failed: '.$phpThumb->error);
> >                     }
> >                 }
>
> >             if(is_file($phpThumb->cache_filename)){ // If thumb was
> > already generated we want to use cached version
> >                 $cachedImage = getimagesize($phpThumb->cache_filename);
>
> >                 header('Content-Type: '.$cachedImage['mime']);
> >                 readfile($phpThumb->cache_filename);
> >                 exit;
> >             }
>
> >             } else { // Can't read source
> >                 die("Couldn't read source image ".$sourceFilename);
> >             }
> >         }}
>
> > ?>
--~--~-~--~~~---~--~~
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: Problem using phpThumb

2008-10-11 Thread djXternal

Well, that got rid of my error, but now when I run the controller with
proper input, the output is nothing, just a blank page

On Oct 11, 5:32 pm, Adam Royle <[EMAIL PROTECTED]> wrote:
> Try this
>
> App::import('Vendor', 'phpThumb', array('file' => 'phpThumb/
> phpthumb.class.php'));
>
> On Oct 12, 7:54 am, djXternal <[EMAIL PROTECTED]> wrote:
>
> > I am trying to set up phpThumb to generate thumbnails for me as seen
> > in:http://bakery.cakephp.org/articles/view/thumbnails-generation-with-ph...
>
> > I set everything up just as the article says, the only modification I
> > have made was to the line:
>
> > $sourceFilename = WWW_ROOT.$_GET['src'];
> > changed to:
> > $sourceFilename = WWW_ROOT.DS.'img'.$_GET['src'];
>
> > AND
>
> > vendor("phpthumb".DS."phpthumb.class");
> > changed to:
> > App::import('vendor', "phpthumb".DS."phpthumb.class");
>
> > The line with 'vendor()' gave me an error say it was an unknown
> > function.
>
> > Now the error I get is a Fatal error saying it cannot locate the
> > phpThumb() class and I am not sure why, it seems the vendor file
> > should loaded properly and it should see it...
>
> > Below is the entire ThumbsController
>
> >  > class ThumbsController extends AppController
> > {
> >     var $name = 'Thumbs';
> >     var $uses = null;
> >     var $layout = null;
> >     var $autoRender = false;
>
> >     function index()
> >         {
> >             if(empty($_GET['src'])){
> >                 die("No source image");
> >             }
>
> >             //width
> >             $width = (!isset($_GET['w'])) ? 100 : $_GET['w'];
> >             //height
> >             $height = (!isset($_GET['h'])) ? 150 : $_GET['h'];
> >             //quality
> >             $quality = (!isset($_GET['q'])) ? 75 : $_GET['q'];
>
> >             $sourceFilename = WWW_ROOT.DS.'img'.$_GET['src'];
>
> >             if(is_readable($sourceFilename)){
> >                 App::import('vendor',
> > "phpthumb".DS."phpthumb.class");
> >                 $phpThumb = new phpThumb();
>
> >                 $phpThumb->src = $sourceFilename;
> >                 $phpThumb->w = $width;
> >                 $phpThumb->h = $height;
> >                 $phpThumb->q = $quality;
> >                 $phpThumb->config_imagemagick_path = '/usr/bin/
> > convert';
> >                 $phpThumb->config_prefer_imagemagick = true;
> >                 $phpThumb->config_output_format = 'jpg';
> >                 $phpThumb->config_error_die_on_error = true;
> >                 $phpThumb->config_document_root = '';
> >                 $phpThumb->config_temp_directory = APP . 'tmp';
> >                 $phpThumb->config_cache_directory =
> > CACHE.'thumbs'.DS;
> >                 $phpThumb->config_cache_disable_warning = true;
>
> >                 $cacheFilename = md5($_SERVER['REQUEST_URI']);
>
> >                 $phpThumb->cache_filename = $phpThumb-
>
> > >config_cache_directory.$cacheFilename;
>
> >                 //Thanks to Kim Biesbjerg for his fix about cached
> > thumbnails being regeneratd
> >                 if(!is_file($phpThumb->cache_filename)){ // Check if
> > image is already cached.
> >                     if ($phpThumb->GenerateThumbnail()) {
> >                         $phpThumb->RenderToFile($phpThumb->cache_filename);
>
> >                     } else {
> >                         die('Failed: '.$phpThumb->error);
> >                     }
> >                 }
>
> >             if(is_file($phpThumb->cache_filename)){ // If thumb was
> > already generated we want to use cached version
> >                 $cachedImage = getimagesize($phpThumb->cache_filename);
>
> >                 header('Content-Type: '.$cachedImage['mime']);
> >                 readfile($phpThumb->cache_filename);
> >                 exit;
> >             }
>
> >             } else { // Can't read source
> >                 die("Couldn't read source image ".$sourceFilename);
> >             }
> >         }}
>
> > ?>
--~--~-~--~~~---~--~~
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: HABTM & Belongs_To Together?

2008-10-11 Thread xavierunited

Ok yea i am not sure abt the first part but David was right the
debuging is impossible.

On 10/11/2008, David C. Zentgraf <[EMAIL PROTECTED]> wrote:
>
> A HABTM relationship will fetch data differently then a belongsTo
> relationship.
> HABTM will get you an array with multiple results, belongsTo just a
> "flat" array.
> $habtm = array(
>   [0] => array(['id'] =>, ...),
>   [1] => array(['id'] =>, ...)
> )
> $belongsTo = array(['id'] =>, ...)
>
> When you specify multiple associations, you'll have to specify unique
> names for them.
> var $belongsTo = array(
>   'Owner' => array(...)
> );
> var $hasAndBelongsToMany = array(
>   'Users' => array(...)
> );
>
> You shouldn't/can't mix different associations under the same name.
> Your output is screwed up because you're mixing the "flat" array with
> the "multi" array. You can either fix that manually (also see Set
> Class) or just keep it simple and name your associations properly.
> BTW, your debug output is virtually impossible to read, use
> debug($array) or pr($array) to spot these kinda things a lot easier.
>
> On 11 Oct 2008, at 23:58, Keith wrote:
>
>>
>> Hi Villas,
>>
>> I tried clearing out the cache and that didn't fix it unfortunately.
>>
>> I have the max debug level set.  The code appears to be operating as
>> programmed.
>>
>> I tried a simple habtm with belongs_to in a scenario where I only had
>> those two models and still got the same results.
>>
>> I think it's a problem with how CakePHP is creating the array.  The
>> first element in the array has no numeric identifier.  If you look
>> back at the screenshot in the initial post you'll see that the first
>> entry in the array is not [0] but rather is called [id] as it would be
>> when there is a belongs_to and not a HABTM as well.
>>
>> Unless I can figure something out I'm going to go ahead and just
>> report it to cakePHP as a bug because there are legit reasons, like
>> the one I'm building, where you'd want a habtm with a belongs_to in
>> the same model.
>>
>> - Keith
>>
>> On Oct 11, 8:14 am, villas <[EMAIL PROTECTED]> wrote:
>>> Hi Keith
>>>
>>> Thanks for the extra info although it still isn't very clear to me
>>> from that what's going on.  However,  I would mention:
>>> 1. Are you clearing your cache?  You might have old data hanging
>>> around.
>>> 2. Did you try to set a higher debug level to get more info?
>>> 3. Did you try to experiment with Bake?  You can try different
>>> scenarios which you should be able to get working without too much
>>> sweat.
>>>
>>> Best regards.
>>>
>>> On Oct 11, 6:31 am, Keith <[EMAIL PROTECTED]> wrote:
>>>
 Just as a clarification on why I have it set up this way...
>>>
 The belongs_to is there because the users that creates the project
 becomes the owner.
 The has_and_belongs_to_many is there so that if a user wants someone
 outside their department to access it they can manually add them.
>>>
 The problem looks like it's stemming from how cakePHP is handling
 the
 array...
>>>
 for the belongs_to the array keys are based on field names like
 [id] &
 [first_name], etc.
 for the HABTM array the array keys are sequential as the "related
 users" foreach loop expects.
>>>
 - Keith
>>>
 On Oct 11, 1:18 am, Keith <[EMAIL PROTECTED]> wrote:
>>>
> It looks to me like this is what is happening, but it's very
> strange...
>>>
> Even when no users are associated I'm getting 8 blank associated
> users
> which is exactly how many elements are in the array...
>>>
> So...
>>>
> It looks like it's taking the first character from each part of the
> first entry in the array and putting it there...
> K = Keith = First Name
> M = Medlin = Last Name
> etc. for each of the fields.
>>>
> So...I'm totally confused why the following code would produce
> that:
>>>
> SQL Query:
> SELECT `User`.`id`, `User`.`first_name`, `User`.`last_name`,
> `User`.`email`, `User`.`date_created`, `User`.`last_login`,
> `User`.`username`, `User`.`password`, `ProjectsUser`.`user_id`,
> `ProjectsUser`.`project_id` FROM `users` AS `User` JOIN
> `projects_users` AS `ProjectsUser` ON
> (`ProjectsUser`.`project_id` = 1
> AND `ProjectsUser`.`user_id` = `User`.`id`) WHERE 1 = 1
>>>
> Which returns a normal looking data set in SQL...
>>>
> Relevant View Code:
>  $i = 0;
> foreach ($project['User'] as $user):
> $class = null;
> if ($i++ % 2 == 0) {
> $class = ' class="altrow"';
> }
> ?>
> >
> 
> 
> 
> 
>  td>
> 
> 
>  

Re: HABTM & Belongs_To Together?

2008-10-11 Thread David C. Zentgraf

A HABTM relationship will fetch data differently then a belongsTo  
relationship.
HABTM will get you an array with multiple results, belongsTo just a  
"flat" array.
$habtm = array(
[0] => array(['id'] =>, ...),
[1] => array(['id'] =>, ...)
)
$belongsTo = array(['id'] =>, ...)

When you specify multiple associations, you'll have to specify unique  
names for them.
var $belongsTo = array(
'Owner' => array(...)
);
var $hasAndBelongsToMany = array(
'Users' => array(...)
);

You shouldn't/can't mix different associations under the same name.  
Your output is screwed up because you're mixing the "flat" array with  
the "multi" array. You can either fix that manually (also see Set  
Class) or just keep it simple and name your associations properly.
BTW, your debug output is virtually impossible to read, use  
debug($array) or pr($array) to spot these kinda things a lot easier.

On 11 Oct 2008, at 23:58, Keith wrote:

>
> Hi Villas,
>
> I tried clearing out the cache and that didn't fix it unfortunately.
>
> I have the max debug level set.  The code appears to be operating as
> programmed.
>
> I tried a simple habtm with belongs_to in a scenario where I only had
> those two models and still got the same results.
>
> I think it's a problem with how CakePHP is creating the array.  The
> first element in the array has no numeric identifier.  If you look
> back at the screenshot in the initial post you'll see that the first
> entry in the array is not [0] but rather is called [id] as it would be
> when there is a belongs_to and not a HABTM as well.
>
> Unless I can figure something out I'm going to go ahead and just
> report it to cakePHP as a bug because there are legit reasons, like
> the one I'm building, where you'd want a habtm with a belongs_to in
> the same model.
>
> - Keith
>
> On Oct 11, 8:14 am, villas <[EMAIL PROTECTED]> wrote:
>> Hi Keith
>>
>> Thanks for the extra info although it still isn't very clear to me
>> from that what's going on.  However,  I would mention:
>> 1. Are you clearing your cache?  You might have old data hanging
>> around.
>> 2. Did you try to set a higher debug level to get more info?
>> 3. Did you try to experiment with Bake?  You can try different
>> scenarios which you should be able to get working without too much
>> sweat.
>>
>> Best regards.
>>
>> On Oct 11, 6:31 am, Keith <[EMAIL PROTECTED]> wrote:
>>
>>> Just as a clarification on why I have it set up this way...
>>
>>> The belongs_to is there because the users that creates the project
>>> becomes the owner.
>>> The has_and_belongs_to_many is there so that if a user wants someone
>>> outside their department to access it they can manually add them.
>>
>>> The problem looks like it's stemming from how cakePHP is handling  
>>> the
>>> array...
>>
>>> for the belongs_to the array keys are based on field names like  
>>> [id] &
>>> [first_name], etc.
>>> for the HABTM array the array keys are sequential as the "related
>>> users" foreach loop expects.
>>
>>> - Keith
>>
>>> On Oct 11, 1:18 am, Keith <[EMAIL PROTECTED]> wrote:
>>
 It looks to me like this is what is happening, but it's very
 strange...
>>
 Even when no users are associated I'm getting 8 blank associated  
 users
 which is exactly how many elements are in the array...
>>
 So...
>>
 It looks like it's taking the first character from each part of the
 first entry in the array and putting it there...
 K = Keith = First Name
 M = Medlin = Last Name
 etc. for each of the fields.
>>
 So...I'm totally confused why the following code would produce  
 that:
>>
 SQL Query:
 SELECT `User`.`id`, `User`.`first_name`, `User`.`last_name`,
 `User`.`email`, `User`.`date_created`, `User`.`last_login`,
 `User`.`username`, `User`.`password`, `ProjectsUser`.`user_id`,
 `ProjectsUser`.`project_id` FROM `users` AS `User` JOIN
 `projects_users` AS `ProjectsUser` ON  
 (`ProjectsUser`.`project_id` = 1
 AND `ProjectsUser`.`user_id` = `User`.`id`) WHERE 1 = 1
>>
 Which returns a normal looking data set in SQL...
>>
 Relevant View Code:
 >>> $i = 0;
 foreach ($project['User'] as $user):
 $class = null;
 if ($i++ % 2 == 0) {
 $class = ' class="altrow"';
 }
 ?>
 >
 
 
 
 
 >>> td>
 
 
 
>>
 project['User'] is what you see dumped above the related users  
 table
 so you can see that the array doesn't look strange in any way.  Is
 this possibly a bug that needs reporting to the CakePHP trac?
>>
 - Keith
>>
 On Oct 10, 11:58 pm, Keit

Re: Tree reorder method won't work if other model methods are called first

2008-10-11 Thread Corie

I finally tracked down the problem. The reorder method calls children
to get the nodes of the root level first, but children has the
following condition:

if ($id === null && $model->id) {
$id = $model->id;
} elseif (!$id) {
$id = null;
}

So if you were saving things to the model beforehand, the $model->id
is probably still set. Do unset() or $model->id = null; before calling
reorder and everything works.

Is there some sort of cleanup or reset method for the model?

-Corie

On Oct 9, 3:07 pm, Corie <[EMAIL PROTECTED]> wrote:
> I'm having a strange issue with theTreebehavior method, reorder().
>
> If I do this it works:
>
> function order() {
>         $this->Page->reorder(array('field' => 'Page.order', 'order' =>
> 'ASC'));
>
> }
>
> But if I do this, it won't reorder thetree:
>
> function order() {
>         $this->data = array();
>         foreach($this->params['form']['rows_list'] as $order => $id) {
>                 $this->data[] = array('id' => $id, 'order' => $order);
>         }
>         $this->Page->saveAll($this->data);
>
>         $this->Page->reorder(array('field' => 'Page.order', 'order' =>
> 'ASC'));
>
> }
>
> I know the saving of my order fields is working because I can do the
> saveAll, edit the function putting the reorder() call first, then call
> the function again and it will reorder it properly. The order()
> function here is being called by Ajax. Anyone have a clue?
--~--~-~--~~~---~--~~
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: Problem using phpThumb

2008-10-11 Thread Adam Royle

Try this

App::import('Vendor', 'phpThumb', array('file' => 'phpThumb/
phpthumb.class.php'));

On Oct 12, 7:54 am, djXternal <[EMAIL PROTECTED]> wrote:
> I am trying to set up phpThumb to generate thumbnails for me as seen
> in:http://bakery.cakephp.org/articles/view/thumbnails-generation-with-ph...
>
> I set everything up just as the article says, the only modification I
> have made was to the line:
>
> $sourceFilename = WWW_ROOT.$_GET['src'];
> changed to:
> $sourceFilename = WWW_ROOT.DS.'img'.$_GET['src'];
>
> AND
>
> vendor("phpthumb".DS."phpthumb.class");
> changed to:
> App::import('vendor', "phpthumb".DS."phpthumb.class");
>
> The line with 'vendor()' gave me an error say it was an unknown
> function.
>
> Now the error I get is a Fatal error saying it cannot locate the
> phpThumb() class and I am not sure why, it seems the vendor file
> should loaded properly and it should see it...
>
> Below is the entire ThumbsController
>
>  class ThumbsController extends AppController
> {
>     var $name = 'Thumbs';
>     var $uses = null;
>     var $layout = null;
>     var $autoRender = false;
>
>     function index()
>         {
>             if(empty($_GET['src'])){
>                 die("No source image");
>             }
>
>             //width
>             $width = (!isset($_GET['w'])) ? 100 : $_GET['w'];
>             //height
>             $height = (!isset($_GET['h'])) ? 150 : $_GET['h'];
>             //quality
>             $quality = (!isset($_GET['q'])) ? 75 : $_GET['q'];
>
>             $sourceFilename = WWW_ROOT.DS.'img'.$_GET['src'];
>
>             if(is_readable($sourceFilename)){
>                 App::import('vendor',
> "phpthumb".DS."phpthumb.class");
>                 $phpThumb = new phpThumb();
>
>                 $phpThumb->src = $sourceFilename;
>                 $phpThumb->w = $width;
>                 $phpThumb->h = $height;
>                 $phpThumb->q = $quality;
>                 $phpThumb->config_imagemagick_path = '/usr/bin/
> convert';
>                 $phpThumb->config_prefer_imagemagick = true;
>                 $phpThumb->config_output_format = 'jpg';
>                 $phpThumb->config_error_die_on_error = true;
>                 $phpThumb->config_document_root = '';
>                 $phpThumb->config_temp_directory = APP . 'tmp';
>                 $phpThumb->config_cache_directory =
> CACHE.'thumbs'.DS;
>                 $phpThumb->config_cache_disable_warning = true;
>
>                 $cacheFilename = md5($_SERVER['REQUEST_URI']);
>
>                 $phpThumb->cache_filename = $phpThumb-
>
> >config_cache_directory.$cacheFilename;
>
>                 //Thanks to Kim Biesbjerg for his fix about cached
> thumbnails being regeneratd
>                 if(!is_file($phpThumb->cache_filename)){ // Check if
> image is already cached.
>                     if ($phpThumb->GenerateThumbnail()) {
>                         $phpThumb->RenderToFile($phpThumb->cache_filename);
>
>                     } else {
>                         die('Failed: '.$phpThumb->error);
>                     }
>                 }
>
>             if(is_file($phpThumb->cache_filename)){ // If thumb was
> already generated we want to use cached version
>                 $cachedImage = getimagesize($phpThumb->cache_filename);
>
>                 header('Content-Type: '.$cachedImage['mime']);
>                 readfile($phpThumb->cache_filename);
>                 exit;
>             }
>
>             } else { // Can't read source
>                 die("Couldn't read source image ".$sourceFilename);
>             }
>         }}
>
> ?>
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Problem using phpThumb

2008-10-11 Thread djXternal

I am trying to set up phpThumb to generate thumbnails for me as seen
in: http://bakery.cakephp.org/articles/view/thumbnails-generation-with-phpthumb

I set everything up just as the article says, the only modification I
have made was to the line:

$sourceFilename = WWW_ROOT.$_GET['src'];
changed to:
$sourceFilename = WWW_ROOT.DS.'img'.$_GET['src'];

AND

vendor("phpthumb".DS."phpthumb.class");
changed to:
App::import('vendor', "phpthumb".DS."phpthumb.class");

The line with 'vendor()' gave me an error say it was an unknown
function.

Now the error I get is a Fatal error saying it cannot locate the
phpThumb() class and I am not sure why, it seems the vendor file
should loaded properly and it should see it...

Below is the entire ThumbsController

src = $sourceFilename;
$phpThumb->w = $width;
$phpThumb->h = $height;
$phpThumb->q = $quality;
$phpThumb->config_imagemagick_path = '/usr/bin/
convert';
$phpThumb->config_prefer_imagemagick = true;
$phpThumb->config_output_format = 'jpg';
$phpThumb->config_error_die_on_error = true;
$phpThumb->config_document_root = '';
$phpThumb->config_temp_directory = APP . 'tmp';
$phpThumb->config_cache_directory =
CACHE.'thumbs'.DS;
$phpThumb->config_cache_disable_warning = true;

$cacheFilename = md5($_SERVER['REQUEST_URI']);

$phpThumb->cache_filename = $phpThumb-
>config_cache_directory.$cacheFilename;

//Thanks to Kim Biesbjerg for his fix about cached
thumbnails being regeneratd
if(!is_file($phpThumb->cache_filename)){ // Check if
image is already cached.
if ($phpThumb->GenerateThumbnail()) {
$phpThumb->RenderToFile($phpThumb-
>cache_filename);
} else {
die('Failed: '.$phpThumb->error);
}
}

if(is_file($phpThumb->cache_filename)){ // If thumb was
already generated we want to use cached version
$cachedImage = getimagesize($phpThumb-
>cache_filename);
header('Content-Type: '.$cachedImage['mime']);
readfile($phpThumb->cache_filename);
exit;
}


} else { // Can't read source
die("Couldn't read source image ".$sourceFilename);
}
}
}
?>

--~--~-~--~~~---~--~~
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: HABTM goodness: searching!!

2008-10-11 Thread Brenton B

Out of frustration: hate to say it, but Cake is quickly dropping on my
list of "usable frameworks" due to it's inability to efficiently
handle joins.

On Oct 8, 1:24 pm, Brenton B <[EMAIL PROTECTED]> wrote:
> I feel like I'm spinning my wheels searching for something that I
> woulda figured was already coded, but no such luck ... I'm looking for
> something that helps with searching on any possible association setup
> for a Model. So of the stuff I've come across are:
>
> http://nik.chankov.net/2008/03/01/filtering-component-for-your-tables/http://teknoid.wordpress.com/2008/08/06/habtm-and-join-trickery-with-...http://bakery.cakephp.org/articles/view/advanced-pagination-1-2
> ("Search" portion)
> Items in the Google Group FAQ.
>
> But so far nothing the encompasses it all, the "Containable" behaviour
> doesn't even quite do it - close, but not constraining enough.
> Furthermore, some of the solutions involve having to do it over again
> for each Model/Controller that requires, or have "trickery" or
> "hackery" - not that that's necessarily "bad", just having to do a
> "work around" is indicative of an underlying fault or missing feature.
>
> So my question is: does anyone have a nifty little component that
> handles this all?
>
> I'll probably just write my own, but worth checking before re-
> inventing the wheel.
--~--~-~--~~~---~--~~
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: Confusion with $uniqueIds in dbo_source.php

2008-10-11 Thread Brenton B

You're missing the point. Don't worry.

On Oct 11, 6:55 am, villas <[EMAIL PROTECTED]> wrote:
> Hi Brenton
>
> I think we need help from a HABTM expert  :-)
>
> From what I understand,  storing extra info in the join table is
> commonly done.  However,  I think storing multiple join table rows for
> the same join so that you can store even more data is going beyond the
> existing HABTM design.
>
> Technically speaking,  I guess you ought to create an extra table and
> then make a three-way join which I've heard some people call
> 'ternary'.
>
> I believe you would make extra models and associations depending on
> how you need to manage the data.  This thread may 
> help:http://groups.google.com/group/cake-php/browse_frm/thread/7ee52fa005d...
>
> Best wishes
>
> On Oct 11, 10:21 am, Brenton B <[EMAIL PROTECTED]> wrote:
>
> > Hey villas,
>
> > Thanks for that.
> > I had read through a bunch of those and I have put in the ID field and
> > experimented with the 'unique' functionality but was still confused
> > why the core is restricting potentially useful rows. The logic in that
> > chunk of code doesn't seem to fit. I mean if the result from the query
> > is the reason for looping through it and stripping out duplicates,
> > then obviously there's something faulty with returning duplicates.
> > It's quite inefficient as well, regardless if we're talking about
> > fractions of seconds, inefficiency is inefficiency.
> > I'm just saying at first glance it seems like a band-aid solution to a
> > (currently unknown) problem.
>
> > On Oct 10, 3:29 pm, villas <[EMAIL PROTECTED]> wrote:
>
> > > Hi Brenton,
>
> > > Saving extra fields in the join table has been discussed a few times
> > > in the group.
>
> > > From what I understand,  it seems you should add an ID field to the
> > > join table and then start accessing the join table through models in
> > > other ways than simply relying on the basic HABTM functionality.
> > > Reading these links might help:
>
> > >http://groups.google.com/group/cake-php/browse_thread/thread/bf91d27a..
> > > See Mariano's article:  tinyurl.com/4kbe9q
>
> > > I also notice you are using the default 'unique' => true in your
> > > setup.  Maybe you should also consider experimenting with that because
> > > it overwrites previous entries but I'm not sure if it's relevant to
> > > your situation.  For ease of reference,  the book section describing
> > > this is here:http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM
>
> > > Hope this helps a little.
>
> > > On Oct 10, 10:26 pm, Brenton B <[EMAIL PROTECTED]> wrote:
>
> > > > Basically, on a HABTM relationship, it's not returning all rows
> > > > because it's filtering out for unique ids ... why?!?!
>
> > > > In my mind, it's not logical to eliminate valid rows when returning
> > > > them, there's no comments explaining why this is being done so I'm
> > > > asking here.
> > > > I ran into an issue where I want rows because that's what HABTM is
> > > > supposed to do, but it's not ...
>
> > > > Not sure how else i can explain it ...
>
> > > > PS. See link to original discussion.
>
> > > > On Oct 10, 2:01 pm, Gwoo <[EMAIL PROTECTED]> wrote:
>
> > > > > You have not provided enough information for anyone to help. You need
> > > > > to say what you are expecting, show the results of that. Pasting core
> > > > > code is not of any help without that information.
--~--~-~--~~~---~--~~
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: HABTM & Belongs_To Together?

2008-10-11 Thread Xavier Mathews
Ok first the link that you gave us is looping meaning that it loads and
never stops! Next b/c there are many users do you see any options that allow
you to set privacy or something like that?

Xavier A. Mathews
Student/Developer/Web-Master
GG Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]
"Fear of a name, only increases fear of the thing itself."







On Sat, Oct 11, 2008 at 3:07 PM, Xavier Mathews <[EMAIL PROTECTED]>wrote:

> Hello Keith i am sorry that this is still a problem for you. Maybe i can
> assist you.
>
> First i need to know if you are getting any error messages?
>
> Then i would like to refer you to this site to see if there is anything
> there that will help you!
> http://www.phpfreaks.com/
>
> As far as your problem i will run a few test and search and work with you
> on that and then i should be able to provide you with some results.
>
> I am sorry that non-of the Tech were able to get to your post sooner. We
> are a little busy.
>
> Xavier A. Mathews
> Student/Developer/Web-Master
> GG Client Based Tech Support Specialist
> Hazel Crest Illinois
> [EMAIL PROTECTED]
> "Fear of a name, only increases fear of the thing itself."
>
>
>
>
>
>
>
>
> On Sat, Oct 11, 2008 at 9:58 AM, Keith <[EMAIL PROTECTED]> wrote:
>
>>
>> Hi Villas,
>>
>> I tried clearing out the cache and that didn't fix it unfortunately.
>>
>> I have the max debug level set.  The code appears to be operating as
>> programmed.
>>
>> I tried a simple habtm with belongs_to in a scenario where I only had
>> those two models and still got the same results.
>>
>> I think it's a problem with how CakePHP is creating the array.  The
>> first element in the array has no numeric identifier.  If you look
>> back at the screenshot in the initial post you'll see that the first
>> entry in the array is not [0] but rather is called [id] as it would be
>> when there is a belongs_to and not a HABTM as well.
>>
>> Unless I can figure something out I'm going to go ahead and just
>> report it to cakePHP as a bug because there are legit reasons, like
>> the one I'm building, where you'd want a habtm with a belongs_to in
>> the same model.
>>
>> - Keith
>>
>> On Oct 11, 8:14 am, villas <[EMAIL PROTECTED]> wrote:
>> > Hi Keith
>> >
>> > Thanks for the extra info although it still isn't very clear to me
>> > from that what's going on.  However,  I would mention:
>> > 1. Are you clearing your cache?  You might have old data hanging
>> > around.
>> > 2. Did you try to set a higher debug level to get more info?
>> > 3. Did you try to experiment with Bake?  You can try different
>> > scenarios which you should be able to get working without too much
>> > sweat.
>> >
>> > Best regards.
>> >
>> > On Oct 11, 6:31 am, Keith <[EMAIL PROTECTED]> wrote:
>> >
>> > > Just as a clarification on why I have it set up this way...
>> >
>> > > The belongs_to is there because the users that creates the project
>> > > becomes the owner.
>> > > The has_and_belongs_to_many is there so that if a user wants someone
>> > > outside their department to access it they can manually add them.
>> >
>> > > The problem looks like it's stemming from how cakePHP is handling the
>> > > array...
>> >
>> > > for the belongs_to the array keys are based on field names like [id] &
>> > > [first_name], etc.
>> > > for the HABTM array the array keys are sequential as the "related
>> > > users" foreach loop expects.
>> >
>> > > - Keith
>> >
>> > > On Oct 11, 1:18 am, Keith <[EMAIL PROTECTED]> wrote:
>> >
>> > > > It looks to me like this is what is happening, but it's very
>> > > > strange...
>> >
>> > > > Even when no users are associated I'm getting 8 blank associated
>> users
>> > > > which is exactly how many elements are in the array...
>> >
>> > > > So...
>> >
>> > > > It looks like it's taking the first character from each part of the
>> > > > first entry in the array and putting it there...
>> > > > K = Keith = First Name
>> > > > M = Medlin = Last Name
>> > > > etc. for each of the fields.
>> >
>> > > > So...I'm totally confused why the following code would produce that:
>> >
>> > > > SQL Query:
>> > > > SELECT `User`.`id`, `User`.`first_name`, `User`.`last_name`,
>> > > > `User`.`email`, `User`.`date_created`, `User`.`last_login`,
>> > > > `User`.`username`, `User`.`password`, `ProjectsUser`.`user_id`,
>> > > > `ProjectsUser`.`project_id` FROM `users` AS `User` JOIN
>> > > > `projects_users` AS `ProjectsUser` ON (`ProjectsUser`.`project_id` =
>> 1
>> > > > AND `ProjectsUser`.`user_id` = `User`.`id`) WHERE 1 = 1
>> >
>> > > > Which returns a normal looking data set in SQL...
>> >
>> > > > Relevant View Code:
>> > > > > > > > $i = 0;
>> > > > foreach ($project['User'] as $user):
>> > > > $class = null;
>> > > > if ($i++ % 2 == 0) {
>> > > > $class = ' class="altrow"';
>> > > > }
>> > > > ?>
>> > > >   

Re: HABTM & Belongs_To Together?

2008-10-11 Thread Xavier Mathews
Hello Keith i am sorry that this is still a problem for you. Maybe i can
assist you.

First i need to know if you are getting any error messages?

Then i would like to refer you to this site to see if there is anything
there that will help you!
http://www.phpfreaks.com/

As far as your problem i will run a few test and search and work with you on
that and then i should be able to provide you with some results.

I am sorry that non-of the Tech were able to get to your post sooner. We are
a little busy.

Xavier A. Mathews
Student/Developer/Web-Master
GG Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]
"Fear of a name, only increases fear of the thing itself."







On Sat, Oct 11, 2008 at 9:58 AM, Keith <[EMAIL PROTECTED]> wrote:

>
> Hi Villas,
>
> I tried clearing out the cache and that didn't fix it unfortunately.
>
> I have the max debug level set.  The code appears to be operating as
> programmed.
>
> I tried a simple habtm with belongs_to in a scenario where I only had
> those two models and still got the same results.
>
> I think it's a problem with how CakePHP is creating the array.  The
> first element in the array has no numeric identifier.  If you look
> back at the screenshot in the initial post you'll see that the first
> entry in the array is not [0] but rather is called [id] as it would be
> when there is a belongs_to and not a HABTM as well.
>
> Unless I can figure something out I'm going to go ahead and just
> report it to cakePHP as a bug because there are legit reasons, like
> the one I'm building, where you'd want a habtm with a belongs_to in
> the same model.
>
> - Keith
>
> On Oct 11, 8:14 am, villas <[EMAIL PROTECTED]> wrote:
> > Hi Keith
> >
> > Thanks for the extra info although it still isn't very clear to me
> > from that what's going on.  However,  I would mention:
> > 1. Are you clearing your cache?  You might have old data hanging
> > around.
> > 2. Did you try to set a higher debug level to get more info?
> > 3. Did you try to experiment with Bake?  You can try different
> > scenarios which you should be able to get working without too much
> > sweat.
> >
> > Best regards.
> >
> > On Oct 11, 6:31 am, Keith <[EMAIL PROTECTED]> wrote:
> >
> > > Just as a clarification on why I have it set up this way...
> >
> > > The belongs_to is there because the users that creates the project
> > > becomes the owner.
> > > The has_and_belongs_to_many is there so that if a user wants someone
> > > outside their department to access it they can manually add them.
> >
> > > The problem looks like it's stemming from how cakePHP is handling the
> > > array...
> >
> > > for the belongs_to the array keys are based on field names like [id] &
> > > [first_name], etc.
> > > for the HABTM array the array keys are sequential as the "related
> > > users" foreach loop expects.
> >
> > > - Keith
> >
> > > On Oct 11, 1:18 am, Keith <[EMAIL PROTECTED]> wrote:
> >
> > > > It looks to me like this is what is happening, but it's very
> > > > strange...
> >
> > > > Even when no users are associated I'm getting 8 blank associated
> users
> > > > which is exactly how many elements are in the array...
> >
> > > > So...
> >
> > > > It looks like it's taking the first character from each part of the
> > > > first entry in the array and putting it there...
> > > > K = Keith = First Name
> > > > M = Medlin = Last Name
> > > > etc. for each of the fields.
> >
> > > > So...I'm totally confused why the following code would produce that:
> >
> > > > SQL Query:
> > > > SELECT `User`.`id`, `User`.`first_name`, `User`.`last_name`,
> > > > `User`.`email`, `User`.`date_created`, `User`.`last_login`,
> > > > `User`.`username`, `User`.`password`, `ProjectsUser`.`user_id`,
> > > > `ProjectsUser`.`project_id` FROM `users` AS `User` JOIN
> > > > `projects_users` AS `ProjectsUser` ON (`ProjectsUser`.`project_id` =
> 1
> > > > AND `ProjectsUser`.`user_id` = `User`.`id`) WHERE 1 = 1
> >
> > > > Which returns a normal looking data set in SQL...
> >
> > > > Relevant View Code:
> > > >  > > > $i = 0;
> > > > foreach ($project['User'] as $user):
> > > > $class = null;
> > > > if ($i++ % 2 == 0) {
> > > > $class = ' class="altrow"';
> > > > }
> > > > ?>
> > > > >
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> >
> > > > project['User'] is what you see dumped above the related users table
> > > > so you can see that the array doesn't look strange in any way.  Is
> > > > this possibly a bug that needs reporting to the CakePHP trac?
> >
> > > > - Keith
> >
> > > > On Oct 10, 11:58 pm, Keith <[EMAIL PROTECTED]> wrote:
> >
> > > > > Thanks f

Re: 500 Internal Server Error - GoDaddy

2008-10-11 Thread Xavier Mathews
Are they even compatiable?

Xavier A. Mathews
Student/Developer/Web-Master
GG Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]
"Fear of a name, only increases fear of the thing itself."







On Sat, Oct 11, 2008 at 12:37 AM, Keith <[EMAIL PROTECTED]> wrote:

>
> There are a ton of great hosting services out there.
>
> I have been on Westhost for about 5 years now and have loved working
> with them.  I've got 3 clients on Westhost and they too have loved
> them.  I had 2 clients train me on how to do their site updates and
> they have been working directly with Westhost as a non-techie group
> and they have called me up to thank me for having them hosted with
> them.
>
> I have heard good things about other hosts like site5, etc.
>
> Honestly, the best thing you can do is find someone locally who has
> had a great experience hosting and just talk to them and get them to
> log in and let you play around navigating the control panel, get into
> the shell and play around, and call the hosting services sales / tech
> support lines and talk to them one on one.
>
> On Oct 10, 10:41 pm, djXternal <[EMAIL PROTECTED]> wrote:
> > I e-mailed them twice now and the only response I can get from them it
> > "we do not offer technical support for third-party applications" I
> > asked if they could get me the logs relevant to my site for me to do
> > the troubleshooting.  So instead of trying to setup cake on godaddy,
> > which from what I've been reading seems to be difficult.  I am looking
> > for a new hosting service.  If anyone knows of a good hosting service
> > that cake will work on please let me know.
> >
> > On Oct 9, 1:54 pm, "3lancer.eu" <[EMAIL PROTECTED]> wrote:
> >
> > > Hi,
> >
> > > > I don't have access to the Apache logs, and I have spent a few days
> > > > looking for a solution to the this problem and have had no luck
> >
> > > Personally, I'd suggest you spent 5 minutes on e-mailing GoDaddy
> > > instead. If you don't even have the Apache logs there are just too
> > > many possibilities...
> >
> > > Regards,
> > > Piotr
> >
>

--~--~-~--~~~---~--~~
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: tilted table headers in cake...

2008-10-11 Thread Xavier Mathews
What kinda question is this??? This is CakePHP so the question that you
asked is accepted here! As far as the code you may wanna check out this like
or go to google search codes!

 http://www.phpfreaks.com/

Xavier A. Mathews
Student/Developer/Web-Master
GG Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]
"Fear of a name, only increases fear of the thing itself."







On Sat, Oct 11, 2008 at 12:56 PM, Ed Drain <[EMAIL PROTECTED]
> wrote:

> Ok, I am not even sure this is as much a cake question as it is a php/html
> question
>
> I'm writing this app that keeps track of grades and one of the things I'd
> like to do is have one overarching header that describes what category of
> grades is below it in a table, and then (here comes the question) underneath
> the category name I would like to have the dates tilted 45 degrees and have
> grades for each person under the dates they were due.
>
> is there any cake code out there that lets you set up tables like that?
>
> or php code that does?
>
> I know you can create graphics on the fly that can be tilted to any degree
> measurement you want, but I haven't figured out how to have the tilted
> column lines on either side of a due date line up with the straight
> vertical  column lines
> of the rest of the table
>
> Any help is appreciated.
>
> thanks
>
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



tilted table headers in cake...

2008-10-11 Thread Ed Drain
Ok, I am not even sure this is as much a cake question as it is a php/html
question

I'm writing this app that keeps track of grades and one of the things I'd
like to do is have one overarching header that describes what category of
grades is below it in a table, and then (here comes the question) underneath
the category name I would like to have the dates tilted 45 degrees and have
grades for each person under the dates they were due.

is there any cake code out there that lets you set up tables like that?

or php code that does?

I know you can create graphics on the fly that can be tilted to any degree
measurement you want, but I haven't figured out how to have the tilted
column lines on either side of a due date line up with the straight
vertical  column lines
of the rest of the table

Any help is appreciated.

thanks

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Date format in Grid

2008-10-11 Thread Fernando Mendonça

Hi again guys,

I'm with another problem.

I need to change de date format that appears in my grid. I was reading
the manual and I try to use the TimeHelper but it didn't work. Look
please my view Reserve, page index.ctp:


format($format = 'd-m-Y', $reserve['Reserve']
['reserve_date']); ?>





I´ve just wrote this...

Anybody can help me?

Thanks again
--~--~-~--~~~---~--~~
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: Date in another language

2008-10-11 Thread Fernando Mendonça

Thank you very much.
This problem was solved. ;)

Thanks again

On 9 out, 10:45, Simonas Juodelis <[EMAIL PROTECTED]> wrote:
> I don't know if this have changed in recent vesions (I use older one -
> 1663), but when I need to translate some application to another language
> I do this way ( for example for my (lithuanian) language):
>
> create directory cake/app/locale/lit/LC_MESSAGES/
> put here file "default.po"
> contents of this file should be like this:
>
> msgid "January"
> msgstr "Sausis"
>
> msgid "February"
> msgstr "Vasaris"
>
> .. and so on.  This works for me.
> Hope this helps.
>
> br,
> Simonas.
>
> Fernando Mendonça wrote:
> > Hi,
>
> > I didn't define translation of months. How can I do that?
>
> > I've just created the two directories: cake\myappdir\locale\pt_br
>
> > I don't know what I have to write in this file (default.po).
>
> > On 9 out, 09:41, Simonas Juodelis <[EMAIL PROTECTED]> wrote:
>
> >> I see that months are defined in forms helper, on line 01658
> >> (http://api.cakephp.org/1.2/form_8php-source.html#l01658) and it should
> >> be translated.
>
> >>  Have you defined translation of months in your language translation
> >> (*.po) files?
>
> >> br,
> >> Simonas,
>
> >> Fernando Mendonça wrote:
>
> >>> Hello
>
> >>> I'm using cakephp cake_1.2.0.7296-rc2
>
> >>> This version is not the newest?
>
> >>> Thanks
>
> >>> On 9 out, 08:27, Simonas Juodelis <[EMAIL PROTECTED]> wrote:
>
>  Hi,
>
>  what version on CakePHP you are using? I'm asking, because months were
>  translated into other languages only in recent versions.  Probably you
>  are using old version. Please try downloading newest version of CakePHP.
>
>  br,
>  Simonas.
>
>  Fernando Mendonça wrote:
>
> > Hello everybody,
>
> > I'm trying to change the values of my date´s SELECT but it's not
> > working. I need the values like "January", "February" appears in
> > Portuguese in to SELECT. I already put "setlocale(LC_ALL,
> > "pt_BR.utf-8"); " in my "bootstrasp.php" in the application directory
> > (myapplication/config/bootstrap.php) but it´s not working yet.
>
> > Help me friends...
>
> > Thanks!
> > :o)
--~--~-~--~~~---~--~~
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: IP to GEO

2008-10-11 Thread Pablo Viojo
I'm using this[1] on 1.2rc3 (and rc2) it looks similar
Regards,

Pablo Viojo
[EMAIL PROTECTED]
http://needish.com
http://pviojo.net

[1] http://bakery.cakephp.org/articles/view/geoip-component


On Sat, Oct 11, 2008 at 12:22 PM, Louie Miranda <[EMAIL PROTECTED]> wrote:

>
> http://bakery.cakephp.org/articles/view/quickly-translate-ip-to-geo-coordinates
>
> Guys, anyone tried to work on this on 1.2.x?
>
> --
> Louie Miranda ([EMAIL PROTECTED])
> http://louiemiranda.axishift.com
>
> Security Is A Series Of Well-Defined Steps
> chmod -R 0 / ; and smile :)
>
> >
>

--~--~-~--~~~---~--~~
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: Controller/Model Question

2008-10-11 Thread [EMAIL PROTECTED]

Hi,
I'm posting my question here, because jfgreco wanted to do almost the
same thing I was thinking about. This question mainly askes if what I
am thinking is possibly, reasonable, and allowed in the MVC Pattern.

On Oct 11, 4:51 am, jfgreco <[EMAIL PROTECTED]> wrote:
> David thank you for your reply.
>
> I guess my other question is, should I be creating other controllers
> one for  each type that extend post? that way I can have different
> forms but the same underlying work.
>

If I where to consolidate data into one table to reduce duplicate
table structures for essentially the same type of item.

But "essentially meaning" not really the same of type of item does it
break MVC or Cake wenn I extend that core Modell ???

As an example so you see of what I am thinking:
A table posts (staying in jfgreco's example)

Post extends AppModel (making the normal modell for the table)

News extends Post (adding logic and associations just for News)

I know that this is normal for OO, and is used by AppModel in Cake for
site wide stuff, but can I also use it for making cleaner Modells and
Controllers by consolidated talbes, or will cake break ???

This would offcourse be extreme helpfull for holding Modells/
Controllers clean, since I would also just extend PostsController.

That way what I call adding logic and associations is done more
ressourceful and cleaner.
Because if I want News to go to an archives table, after they
outdated, and only add that table for querying when I want (searches),
I just put that extended logic in News.
And I only would have a association of hasOne "EventHandler" if the
Post was really an Event. (Else I'd have to create and destroy
associations like this no stop on the fly)

The end result would logically be one MEGA Post and PostsController
and tons of "dynamic" inserting of elements ...

Oliver

PS: This is really a question of interest I have not tryed this, but
an answer would be great bevor I give it a shot (that might be doomed
to fail, or a ton of extra work)

On Oct 11, 4:51 am, jfgreco <[EMAIL PROTECTED]> wrote:
> David thank you for your reply.
>
> I guess my other question is, should I be creating other controllers
> one for  each type that extend post? that way I can have different
> forms but the same underlying work.
>
> On Oct 10, 10:15 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
>
> > All you need to do is insert the post_type into the data array before
> > saving it to the database.
> > Either insert a hidden field into the form that you use to create the
> > post, or insert it in the controller.
>
> > $this->data['Post']['post_type'] = 'news';
> > $this->Post->save($this->data);
>
> > On 11 Oct 2008, at 10:50, jfgreco wrote:
>
> > > I am designing a CMS system and am new to CakePHP. I am porting
> > > everything to Cake from a legacy system, so I have a defined database
> > > already.
>
> > > I have a table of posts and in that table I have a column called
> > > post_type which I populate with News, Page, Event or Admin. I don't
> > > want the user to have to choose the type when posting. I want them to
> > > click a link like Post News or Post A New Page. Is there a good way to
> > > use a single base controller to build off of? I created the
> > > PostController and it works for a good base, but what is the best way
> > > to build out from there? Any ideas will be helpful.
>
> > > I consolidated into one table to reduce duplicate table structures for
> > > essentially the same type of item.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Can someone with Bakery admin rights help me out?

2008-10-11 Thread benjam

I apologize in advance for using the group for this, but I can't seem
to log into the bakery.

I tried resetting my password, I also tried creating a new account,
both to no avail.

I would like for someone with admin rights to the bakery to get into
there and get me my original login data, and possibly delete the
second account that I created for me.

If this is possible, please contact me via email as I'd rather not
discuss account details on the group.

Thanks.

If this is not possible, could someone point me in the right direction
to get in contact with a Bakery admin?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



IP to GEO

2008-10-11 Thread Louie Miranda
http://bakery.cakephp.org/articles/view/quickly-translate-ip-to-geo-coordinates

Guys, anyone tried to work on this on 1.2.x?

-- 
Louie Miranda ([EMAIL PROTECTED])
http://louiemiranda.axishift.com

Security Is A Series Of Well-Defined Steps
chmod -R 0 / ; and smile :)

--~--~-~--~~~---~--~~
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: jquery validation

2008-10-11 Thread Lamonte(Scheols/Demonic)
Oops..

var validator = $("#UserSignupForm").validate({
   rules: {
   firstname: "required",
   lastname: "required",
   data[User][username]: {
   required: true,
   minlength: 2,
   remote: "users.php"
   }}
});

Fixed..

On Sat, Oct 11, 2008 at 9:59 AM, Lamonte(Scheols/Demonic) <[EMAIL PROTECTED]
> wrote:

> Ever tried the Error Console in FireFox?
>
> var validator = $("#UserSignupForm").validate({
>rules: {
>firstname: "required",
>lastname: "required",
>data[User][username]: {
>required: true,
>minlength: 2,
>remote: "users.php"
>}}
> }
>
> Make sure you close your braces correctly when making inline objects.
>
>
> On Sat, Oct 11, 2008 at 8:20 AM, bookme <[EMAIL PROTECTED]> wrote:
>
>>
>> Hi,
>>
>> I am using jquery validation for signup form. But facing problem when
>> I am using CakePHP helper class.
>>
>> if I used > maxlength="50" /> instead of
>>
>> text('username')); ?>  that's generate "> name="data[User][username]" value="" id="UserUsername" type="text"> "
>> it's working fine.
>>
>> Jquery validation code is
>>
>> var validator = $("#UserSignupForm").validate({
>>rules: {
>>firstname: "required",
>>lastname: "required",
>>data[User][username]: {
>>required: true,
>>minlength: 2,
>>remote: "users.php"
>>},
>>
>>
>> I could not replace data[User][username] because it's need in form
>> submission. so what should I changed either in
>>  text('username')); ?> or jquery function .
>>
>> I think problem is creating from data[User][username].
>>
>> Please help me
>>
>> Thanks
>>
>>
>>
>>
>>
>>
>> >>
>>
>
>
> --
> Join cleanscript.com Come here for professional PHP coding.
>



-- 
Join cleanscript.com Come here for professional PHP coding.

--~--~-~--~~~---~--~~
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: jquery validation

2008-10-11 Thread Lamonte(Scheols/Demonic)
Ever tried the Error Console in FireFox?

var validator = $("#UserSignupForm").validate({
   rules: {
   firstname: "required",
   lastname: "required",
   data[User][username]: {
   required: true,
   minlength: 2,
   remote: "users.php"
   }}
}

Make sure you close your braces correctly when making inline objects.


On Sat, Oct 11, 2008 at 8:20 AM, bookme <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I am using jquery validation for signup form. But facing problem when
> I am using CakePHP helper class.
>
> if I used  maxlength="50" /> instead of
>
> text('username')); ?>  that's generate " name="data[User][username]" value="" id="UserUsername" type="text"> "
> it's working fine.
>
> Jquery validation code is
>
> var validator = $("#UserSignupForm").validate({
>rules: {
>firstname: "required",
>lastname: "required",
>data[User][username]: {
>required: true,
>minlength: 2,
>remote: "users.php"
>},
>
>
> I could not replace data[User][username] because it's need in form
> submission. so what should I changed either in
>  text('username')); ?> or jquery function .
>
> I think problem is creating from data[User][username].
>
> Please help me
>
> Thanks
>
>
>
>
>
>
> >
>


-- 
Join cleanscript.com Come here for professional PHP coding.

--~--~-~--~~~---~--~~
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: How to Create Subdomains on your localhost - host multiple projects at once

2008-10-11 Thread Alit Atmaja
Hi Mathew,

I'm following your way.
It's work for me now. I was looking for a long time to do this thing.
With your post, less than 5 minutes changing the configuration files.

Thanks for bring this here.
Thanks for Eddie for throwing the topic here.

You guys rocks!

Cheers,
ketut

On Sat, Oct 11, 2008 at 6:52 AM, Mathew <[EMAIL PROTECTED]> wrote:

>
> I think I do this differently.
>
> I add the virtual server to Apache as so.
>
> 
>ServerName www.yourdomain.local
>DocumentRoot "C:/work/project1/www"
> 
>
> 
>ServerName project2.yourdomain.local
>DocumentRoot "C:/work/project2/www"
> 
>
> Then I add the line in my hosts file c:/windows/system32/drivers/etc/
> hosts
>
> 127.0.0.1 www.yourdomain.local
> 127.0.0.1 project2.yourdomain.local
>
> Now, when I access http://www.yourdomain.com I know I'm accessing the
> external domain, but when I access http://www.yourdomain.local I know
> I'm internal. The same with http://project2.yourdomain.com is
> external, and http://project2.yourdomain.local is internal.
>
> This is handy, because I have 5 registered domains that I'm working on
> at once. I also have a beta server that is access at
> http://www.yourdomain.beta
> by mapping it to an internal IP as 192.168.1.10 in the hosts file.
>
> DNS is cool! :)
> >
>

--~--~-~--~~~---~--~~
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: HABTM & Belongs_To Together?

2008-10-11 Thread Keith

Hi Villas,

I tried clearing out the cache and that didn't fix it unfortunately.

I have the max debug level set.  The code appears to be operating as
programmed.

I tried a simple habtm with belongs_to in a scenario where I only had
those two models and still got the same results.

I think it's a problem with how CakePHP is creating the array.  The
first element in the array has no numeric identifier.  If you look
back at the screenshot in the initial post you'll see that the first
entry in the array is not [0] but rather is called [id] as it would be
when there is a belongs_to and not a HABTM as well.

Unless I can figure something out I'm going to go ahead and just
report it to cakePHP as a bug because there are legit reasons, like
the one I'm building, where you'd want a habtm with a belongs_to in
the same model.

- Keith

On Oct 11, 8:14 am, villas <[EMAIL PROTECTED]> wrote:
> Hi Keith
>
> Thanks for the extra info although it still isn't very clear to me
> from that what's going on.  However,  I would mention:
> 1. Are you clearing your cache?  You might have old data hanging
> around.
> 2. Did you try to set a higher debug level to get more info?
> 3. Did you try to experiment with Bake?  You can try different
> scenarios which you should be able to get working without too much
> sweat.
>
> Best regards.
>
> On Oct 11, 6:31 am, Keith <[EMAIL PROTECTED]> wrote:
>
> > Just as a clarification on why I have it set up this way...
>
> > The belongs_to is there because the users that creates the project
> > becomes the owner.
> > The has_and_belongs_to_many is there so that if a user wants someone
> > outside their department to access it they can manually add them.
>
> > The problem looks like it's stemming from how cakePHP is handling the
> > array...
>
> > for the belongs_to the array keys are based on field names like [id] &
> > [first_name], etc.
> > for the HABTM array the array keys are sequential as the "related
> > users" foreach loop expects.
>
> > - Keith
>
> > On Oct 11, 1:18 am, Keith <[EMAIL PROTECTED]> wrote:
>
> > > It looks to me like this is what is happening, but it's very
> > > strange...
>
> > > Even when no users are associated I'm getting 8 blank associated users
> > > which is exactly how many elements are in the array...
>
> > > So...
>
> > > It looks like it's taking the first character from each part of the
> > > first entry in the array and putting it there...
> > > K = Keith = First Name
> > > M = Medlin = Last Name
> > > etc. for each of the fields.
>
> > > So...I'm totally confused why the following code would produce that:
>
> > > SQL Query:
> > > SELECT `User`.`id`, `User`.`first_name`, `User`.`last_name`,
> > > `User`.`email`, `User`.`date_created`, `User`.`last_login`,
> > > `User`.`username`, `User`.`password`, `ProjectsUser`.`user_id`,
> > > `ProjectsUser`.`project_id` FROM `users` AS `User` JOIN
> > > `projects_users` AS `ProjectsUser` ON (`ProjectsUser`.`project_id` = 1
> > > AND `ProjectsUser`.`user_id` = `User`.`id`) WHERE 1 = 1
>
> > > Which returns a normal looking data set in SQL...
>
> > > Relevant View Code:
> > >  > >                 $i = 0;
> > >                 foreach ($project['User'] as $user):
> > >                         $class = null;
> > >                         if ($i++ % 2 == 0) {
> > >                                 $class = ' class="altrow"';
> > >                         }
> > >                 ?>
> > >                 >
> > >                         
> > >                         
> > >                         
> > >                         
> > >                         
> > >                         
> > >                         
> > >                         
>
> > > project['User'] is what you see dumped above the related users table
> > > so you can see that the array doesn't look strange in any way.  Is
> > > this possibly a bug that needs reporting to the CakePHP trac?
>
> > > - Keith
>
> > > On Oct 10, 11:58 pm, Keith <[EMAIL PROTECTED]> wrote:
>
> > > > Thanks for the response.
>
> > > > The documents table exists but I'm not having any issues with that
> > > > relationship as it's a simple has_many and belongs_to with my user
> > > > model.
>
> > > > The real issue is why, what appears to be a valid array is rendering
> > > > the way it is in the related users table on the view for the projects
> > > > page.
>
> > > > To get the array that's there I just did a print_r on the $users array
> > > > that is automatically generated by CakePHP.  As you can see there are
> > > > no missing keys and the hash lines up correctly with the data.
>
> > > > The thing I cannot figure out is why I have those garbage rows in the
> > > > table.  My database is clean.  It has 3 users with normal looking
> > > > data.  The projects_users join table is clean with:
>
> > > > user_id | project_id
> > > > 3 | 1
> > > > 2 | 1
>
> > > > The user_id associated with the table has a corresponding user as you
> > > > can see in the array.  So I'm not sure why 

Re: Automagic JavaScript Validation Helper - Beta integration problem

2008-10-11 Thread bookme

Same problem I am facing?
Ant body have any solution?

On Aug 21, 10:52 am, Pascal Messana <[EMAIL PROTECTED]> wrote:
> I am facing the same problem.
> I just posted on the author page 
> :http://www.pseudocoder.com/archives/2008/02/17/automagic-javascript-v...
>
> If you solved this problem, can you post the solution then ?
>
> Thx
>
> kaushik a écrit :
>
> > I am facing problem to integrate 'Automagic JavaScriptValidation
> > Helper' in my formvalidation.
>
> > Here is my model:
>
> >  var $name = 'Category';
> >  var $primaryKey = 'categoryId';
> >  var $displayField = 'categoryName';
>
> >  var $validate = array(
> > 'categoryName' => array(
> > 'too_short' => array('rule' => array('minLength',
> > 1),'message'=>'Category Name cannot be empty'),
> > 'unique' => array('rule' => array('isUnique'),
> > 'message'=>'That Category Name is not available'),
> > 'must' => array('rule' => array('minLength', 4),
> > 'required' =>true, 'message'=>'Category Name is required'),
> > ),
> >);
>
> > Here is my view:
>
> > link(array('jquery', 'validation'), false);?>
> >  >$options = array('inline' => 'false','messageId' => 'message');
> > ?>
> > rules('Category');?>
>
> > create('Category',array('type'=>'file')); ?>
> > > align="center" class="border"
> > cellpadding="5" cellspacing="2">
> > > class="TDHEAD" bgcolor="#799BE1" style="color:#ff">
> > > colspan="3">Add Category
> >
> >
> > > colspan="3">
> >
> >
> > > align="right" valign="top" class="tbllogin">Category
> > Name
> > > align="center" valign="top" class="tbllogin">:
> >
> >  > size="40" value="" id="categoryName" class="inplogin"> > >error("Category.categoryName",array('wrap'=>'div'));?>
> >
>
> >
> > > colspan="2"> 
> >
> >     
> >  > onClick="javascript:window.location='../categories';">
> >
> >
> >end(); ?>
>
> > After html, it is giving-
>
> >  http://www.w3.org/1999/xhtml";>
> > 
> > Test Control Panel
> > 
> > 
> > 
> > > head>
>
> >  > marginheight="0" marginwidth="0">
> > .
> > 
> > $(document).ready(function(){ $
> > ('form').submit( function() { return validateForm(this,
> > rules); }); });
> > var rules = eval({"CategoryCategoryName":[{"rule":"\/^.{1,}$
> > \/","message":"Category Name cannot be empty"},{"rule":"\/^.{4,}$
> > \/","message":"Category Name is required"}]});
> > 
> > .
> > 
> >  > action="/admin/categories/add">
> >  > value="POST" />
> > 
> >  > value="" id="categoryName" class="inplogin">
> > ...
> > 
> > 
> > 
> > 
>
> > It doesn't showing any error although the field is blank but required.
> > It is also not showing any javascript error also. Moreover for valid
> > or invalid entry, the form submission is not occurring.
>
> > Can anyone help me. Where is the bug in my code?
--~--~-~--~~~---~--~~
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: Confusion with $uniqueIds in dbo_source.php

2008-10-11 Thread villas

Hi Brenton

I think we need help from a HABTM expert  :-)

>From what I understand,  storing extra info in the join table is
commonly done.  However,  I think storing multiple join table rows for
the same join so that you can store even more data is going beyond the
existing HABTM design.

Technically speaking,  I guess you ought to create an extra table and
then make a three-way join which I've heard some people call
'ternary'.

I believe you would make extra models and associations depending on
how you need to manage the data.  This thread may help:
http://groups.google.com/group/cake-php/browse_frm/thread/7ee52fa005dd4f49

Best wishes


On Oct 11, 10:21 am, Brenton B <[EMAIL PROTECTED]> wrote:
> Hey villas,
>
> Thanks for that.
> I had read through a bunch of those and I have put in the ID field and
> experimented with the 'unique' functionality but was still confused
> why the core is restricting potentially useful rows. The logic in that
> chunk of code doesn't seem to fit. I mean if the result from the query
> is the reason for looping through it and stripping out duplicates,
> then obviously there's something faulty with returning duplicates.
> It's quite inefficient as well, regardless if we're talking about
> fractions of seconds, inefficiency is inefficiency.
> I'm just saying at first glance it seems like a band-aid solution to a
> (currently unknown) problem.
>
> On Oct 10, 3:29 pm, villas <[EMAIL PROTECTED]> wrote:
>
> > Hi Brenton,
>
> > Saving extra fields in the join table has been discussed a few times
> > in the group.
>
> > From what I understand,  it seems you should add an ID field to the
> > join table and then start accessing the join table through models in
> > other ways than simply relying on the basic HABTM functionality.
> > Reading these links might help:
>
> >http://groups.google.com/group/cake-php/browse_thread/thread/bf91d27a..
> > See Mariano's article:  tinyurl.com/4kbe9q
>
> > I also notice you are using the default 'unique' => true in your
> > setup.  Maybe you should also consider experimenting with that because
> > it overwrites previous entries but I'm not sure if it's relevant to
> > your situation.  For ease of reference,  the book section describing
> > this is here:http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM
>
> > Hope this helps a little.
>
> > On Oct 10, 10:26 pm, Brenton B <[EMAIL PROTECTED]> wrote:
>
> > > Basically, on a HABTM relationship, it's not returning all rows
> > > because it's filtering out for unique ids ... why?!?!
>
> > > In my mind, it's not logical to eliminate valid rows when returning
> > > them, there's no comments explaining why this is being done so I'm
> > > asking here.
> > > I ran into an issue where I want rows because that's what HABTM is
> > > supposed to do, but it's not ...
>
> > > Not sure how else i can explain it ...
>
> > > PS. See link to original discussion.
>
> > > On Oct 10, 2:01 pm, Gwoo <[EMAIL PROTECTED]> wrote:
>
> > > > You have not provided enough information for anyone to help. You need
> > > > to say what you are expecting, show the results of that. Pasting core
> > > > code is not of any help without that information.
--~--~-~--~~~---~--~~
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: Sanitize problem with writing negative numbers into db

2008-10-11 Thread Dardo Sordi Bogado

Cake will escape your data before saving it to the database if you are
using Model::save(), your model should validate the data so it's
conforming to your application input requirements and cake helpers
(form/html) will escape it when displaying and you can use the h()
function for outputting data that can have bad html, so: Why are you
using Sanitize ?

On Fri, Oct 10, 2008 at 10:37 AM, stefanski <[EMAIL PROTECTED]> wrote:
>
> Hi folks, I want to clean up user input before saving into the
> database, but when I Sanitize::clean($this->data) it changes negative
> integer values like -10 into -10 and I get a database (Postgres)
> error because - obviously - it's not an integer anymore.
>
> I want to avoid manually cleaning avery text field and wonder, what
> other people - like you! - do ??
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Error when including prototype and scriptaculous in layout template

2008-10-11 Thread ORCC

I have a layout template that includes the prototype and scriptaculous
scripts that are placed in webroot/js directory.

The template looks like:


http://www.w3.org/1999/xhtml";>

charset(); ?>





meta('icon');
echo $html->css('gmg_frontend');
echo $javascript->link('swfobject');
//include prototype scriptaculous and lightbox scripts
echo $javascript->link('prototype');
echo $javascript->link('scriptaculous');
echo $javascript->link('lightbox');
//personal scripts
echo $html->css('lightbox');
echo $javascript->link('gmg');
echo $javascript->link('menubar');

   ?>

 ... (More stuff)...

The page seems to load correctly, altough the Firefox's error console
issues the following errors:

Error: syntax error
Source File: http://MY_DOMAIN/gmg/js/sound.js
Línea: 1
Código fuente:


The code is a missing_controller page generate by cake in the
scriptaculous loading, because the "JS" controller is missing. (This
is the globlal object in scriptaculous that loads some scripts like
sound, dragdrop and others)

What is the solution for this trouble?
--~--~-~--~~~---~--~~
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: CakePHP Install Problem

2008-10-11 Thread darwin2kx

/cake/app/webroot/>
is where the redirect goes.

On Oct 10, 3:13 pm, "3lancer.eu" <[EMAIL PROTECTED]> wrote:
> Hallo again,
>
> Sorry, I don't have time to really help you today, but the 1st thing
> I'd suggest to do, is to change cake .htaccesses so they do the
> explicit redirect, ie. change [L] in rewrite-rules to [R,L] and then
> see where the redirect is taking you, and maybe you'll find why the
> hell it makes an infinite loop.
>
> Personally, I find it a good habit to define a virtual host for each
> cake application. I don't remember how to do that in Windows, but it's
> well documented on the WWW for sure (should be a matter of adding the
> domain to some Windows config file so it points to 127.0.0.1 + adding
> apache vhost configs).
>
> Anyway, FollowSymLinks is not necessary in your case.
>
> Regards,
> Piotr
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



jquery validation

2008-10-11 Thread bookme

Hi,

I am using jquery validation for signup form. But facing problem when
I am using CakePHP helper class.

if I used  instead of

text('username')); ?>  that's generate " "
it's working fine.

Jquery validation code is

var validator = $("#UserSignupForm").validate({
rules: {
firstname: "required",
lastname: "required",
data[User][username]: {
required: true,
minlength: 2,
remote: "users.php"
},


I could not replace data[User][username] because it's need in form
submission. so what should I changed either in
 text('username')); ?> or jquery function .

I think problem is creating from data[User][username].

Please help me

Thanks






--~--~-~--~~~---~--~~
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: HABTM & Belongs_To Together?

2008-10-11 Thread villas

Hi Keith

Thanks for the extra info although it still isn't very clear to me
from that what's going on.  However,  I would mention:
1. Are you clearing your cache?  You might have old data hanging
around.
2. Did you try to set a higher debug level to get more info?
3. Did you try to experiment with Bake?  You can try different
scenarios which you should be able to get working without too much
sweat.

Best regards.


On Oct 11, 6:31 am, Keith <[EMAIL PROTECTED]> wrote:
> Just as a clarification on why I have it set up this way...
>
> The belongs_to is there because the users that creates the project
> becomes the owner.
> The has_and_belongs_to_many is there so that if a user wants someone
> outside their department to access it they can manually add them.
>
> The problem looks like it's stemming from how cakePHP is handling the
> array...
>
> for the belongs_to the array keys are based on field names like [id] &
> [first_name], etc.
> for the HABTM array the array keys are sequential as the "related
> users" foreach loop expects.
>
> - Keith
>
> On Oct 11, 1:18 am, Keith <[EMAIL PROTECTED]> wrote:
>
> > It looks to me like this is what is happening, but it's very
> > strange...
>
> > Even when no users are associated I'm getting 8 blank associated users
> > which is exactly how many elements are in the array...
>
> > So...
>
> > It looks like it's taking the first character from each part of the
> > first entry in the array and putting it there...
> > K = Keith = First Name
> > M = Medlin = Last Name
> > etc. for each of the fields.
>
> > So...I'm totally confused why the following code would produce that:
>
> > SQL Query:
> > SELECT `User`.`id`, `User`.`first_name`, `User`.`last_name`,
> > `User`.`email`, `User`.`date_created`, `User`.`last_login`,
> > `User`.`username`, `User`.`password`, `ProjectsUser`.`user_id`,
> > `ProjectsUser`.`project_id` FROM `users` AS `User` JOIN
> > `projects_users` AS `ProjectsUser` ON (`ProjectsUser`.`project_id` = 1
> > AND `ProjectsUser`.`user_id` = `User`.`id`) WHERE 1 = 1
>
> > Which returns a normal looking data set in SQL...
>
> > Relevant View Code:
> >  >                 $i = 0;
> >                 foreach ($project['User'] as $user):
> >                         $class = null;
> >                         if ($i++ % 2 == 0) {
> >                                 $class = ' class="altrow"';
> >                         }
> >                 ?>
> >                 >
> >                         
> >                         
> >                         
> >                         
> >                         
> >                         
> >                         
> >                         
>
> > project['User'] is what you see dumped above the related users table
> > so you can see that the array doesn't look strange in any way.  Is
> > this possibly a bug that needs reporting to the CakePHP trac?
>
> > - Keith
>
> > On Oct 10, 11:58 pm, Keith <[EMAIL PROTECTED]> wrote:
>
> > > Thanks for the response.
>
> > > The documents table exists but I'm not having any issues with that
> > > relationship as it's a simple has_many and belongs_to with my user
> > > model.
>
> > > The real issue is why, what appears to be a valid array is rendering
> > > the way it is in the related users table on the view for the projects
> > > page.
>
> > > To get the array that's there I just did a print_r on the $users array
> > > that is automatically generated by CakePHP.  As you can see there are
> > > no missing keys and the hash lines up correctly with the data.
>
> > > The thing I cannot figure out is why I have those garbage rows in the
> > > table.  My database is clean.  It has 3 users with normal looking
> > > data.  The projects_users join table is clean with:
>
> > > user_id | project_id
> > > 3 | 1
> > > 2 | 1
>
> > > The user_id associated with the table has a corresponding user as you
> > > can see in the array.  So I'm not sure why it's chunking up data that
> > > way it is in the related users table.
>
> > > Any ideas?  Or can you think of anything specifically I should check
> > > on outside of running the queries directly in SQL which I've done and
> > > they return the correct data.  I think the problem is in the view or
> > > how the users array is being interpreted possibly.
>
> > > - Keith
>
> > > On Oct 10, 6:48 pm, villas <[EMAIL PROTECTED]> wrote:
>
> > > > Hi Keith
>
> > > > Not sure you've provided enough info here,  and what we see looks a
> > > > bit confusing.
> > > > Is there also a 'documents' table?
> > > > Did you set up a join table for the HABTM?
> > > > What is the logic of having a Project belonging to a User in addition
> > > > to using a join table so that many Projects may belong to a User?
> > > > Maybe what you have written makes more sense to others,  but it
> > > > suggests to me that you probably didn't read the book.cakephp.org
> > > > carefully enough.  Have a good look again at the Models section and
> > > > then post a followup question,  bea

Yet another site powered by Cakephp

2008-10-11 Thread Sayhello

Hello all,

Just wanted to introduce yet another site built with CakePHP 1.2 RC3 -
www.sayhello.me. Sayhello is a new classified ads site to help you buy
and sell. We are initially launching in the Los Angeles market. Check
it out. Any suggestions and feedback are welcome.

Thank you!
www.sayhello.me

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



OIDs on cakephp

2008-10-11 Thread Zureño

Hi everybody

I need put a image from my database over a view but I cant find how
can use the lo_import in cakephp, I find in the api all the functions

pg_ lo_ create
pg_ lo_ export
pg_ lo_ import
pg_ lo_ open
pg_ lo_ read_ all
pg_ lo_ read
pg_ lo_ seek
pg_ lo_ tell
pg_ lo_ unlink
pg_ lo_ write

but really I dont understand how can use it-- because is cakephp how
connect over the database and in natural php this is the normal use of
the last functions

 
user=
password="

$conn = pg_connect($dbConnStr);

if (!$conn) {
exit;
}else{

// el browser pensará que este archivo es una imagen PNG
header('Content-type: image/png');

// el uso de pg_lo_open debe estar dentro de una 
transacción, asi
que la iniciamos
pg_query ($conn, 'begin');

// abre el BLOB
$loid = pg_lo_open($conn, 
$administrador['Administrador']['foto'],
'r');

// lee todo el contenido del blob (que es el contenido 
de la
imagen) y se lo tira al browser
pg_lo_read_all ($loid);

// cierra el objeto
pg_lo_close ($loid);

// cierra la transacción
pg_query ($conn, "commit");

// cierra la conexión
pg_close();
}
?>


Someone know hoe can map the last code to code in cakephp



Thanks

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Yet another site powered by Cakephp

2008-10-11 Thread Sayhello

Hello all,

Just wanted to introduce yet another site built with CakePHP 1.2 RC3 -
www.sayhello.me. Sayhello is a new classified ads site to help you buy
and sell. We are initially launching in the Los Angeles market. Check
it out. Any suggestions and feedback are welcome.

Thank you!
www.sayhello.me

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Security question: AuthComponent and passwords

2008-10-11 Thread Bernhard J. M. Grün
Hi!

Is it correct that the passwords created with the help of the AuthComponent
are not public hashed (i.e. only secret hashed)? At least in my test app it
seems to be like that.
If so this is a major security hole.
Example:
User Alice has password "test": 2dd357c503a6812e276096a306cca02852cc1e4f
User Bob has the same password: 2dd357c503a6812e276096a306cca02852cc1e4f
Now hacker Charlie becomes access to the database. He sees that both
passwords are identical. So it is much easier for him to break in. If user
Alice for example uses her password for other websites and hacker Charlie
gets that password also user Bob's account is lost.
IMHO there is a reason why Unix, *BSD, Linux, OSX, ... uses a public salt
for their passwords. Maybe CakePHP should do the same.
So the correct way for passwords is:
crypt(crypt('password', 'secretsalt'), 'publicsalt') where publicsalt is
concatenated at front of the crypted password.


-- Bernhard J. M. Grün

--~--~-~--~~~---~--~~
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: Confusion with $uniqueIds in dbo_source.php

2008-10-11 Thread Brenton B

Hey villas,

Thanks for that.
I had read through a bunch of those and I have put in the ID field and
experimented with the 'unique' functionality but was still confused
why the core is restricting potentially useful rows. The logic in that
chunk of code doesn't seem to fit. I mean if the result from the query
is the reason for looping through it and stripping out duplicates,
then obviously there's something faulty with returning duplicates.
It's quite inefficient as well, regardless if we're talking about
fractions of seconds, inefficiency is inefficiency.
I'm just saying at first glance it seems like a band-aid solution to a
(currently unknown) problem.

On Oct 10, 3:29 pm, villas <[EMAIL PROTECTED]> wrote:
> Hi Brenton,
>
> Saving extra fields in the join table has been discussed a few times
> in the group.
>
> From what I understand,  it seems you should add an ID field to the
> join table and then start accessing the join table through models in
> other ways than simply relying on the basic HABTM functionality.
> Reading these links might help:
>
> http://groups.google.com/group/cake-php/browse_thread/thread/bf91d27a...http://groups.google.com/group/cake-php/browse_thread/thread/4505a4ca...
> See Mariano's article:  tinyurl.com/4kbe9q
>
> I also notice you are using the default 'unique' => true in your
> setup.  Maybe you should also consider experimenting with that because
> it overwrites previous entries but I'm not sure if it's relevant to
> your situation.  For ease of reference,  the book section describing
> this is here:http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM
>
> Hope this helps a little.
>
> On Oct 10, 10:26 pm, Brenton B <[EMAIL PROTECTED]> wrote:
>
> > Basically, on a HABTM relationship, it's not returning all rows
> > because it's filtering out for unique ids ... why?!?!
>
> > In my mind, it's not logical to eliminate valid rows when returning
> > them, there's no comments explaining why this is being done so I'm
> > asking here.
> > I ran into an issue where I want rows because that's what HABTM is
> > supposed to do, but it's not ...
>
> > Not sure how else i can explain it ...
>
> > PS. See link to original discussion.
>
> > On Oct 10, 2:01 pm, Gwoo <[EMAIL PROTECTED]> wrote:
>
> > > You have not provided enough information for anyone to help. You need
> > > to say what you are expecting, show the results of that. Pasting core
> > > code is not of any help without that information.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



security component newbie

2008-10-11 Thread .
i have multiple forms in one page. when I add var
$components=array('Security'); component (without doing anything else), it
does not work. i notice that it only adds the security token to the first
form on the page. How do I get it on all of the forms?

thanks

--~--~-~--~~~---~--~~
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: Validation won't work on tutorial at 1.2 RC3

2008-10-11 Thread Huen

I found a manual page which seems to be related my problem.
http://jp.php.net/manual/en/regexp.reference.php

According to the description,
the \p, \P and \X are available when UTF-8 mode is selected.

The preg functions use PCRE.

I ran the pcretest by terminal, and set the regex of
Varidation::alphaNumeric
(/cake/libs/validation.php line 169). The followings are the result.
-
$ pcretest
PCRE version 6.6 06-Feb-2006

  re> /^[\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}]+$/mu
** Unknown option 'u'
-

http://www.pcre.org/pcre.txt says:
 "The  current  implementation of PCRE (release 7.x) corresponds
approxi-
  mately with Perl 5.10, including support for UTF-8 encoded strings
and
  Unicode general category properties. However, UTF-8 and Unicode
support
  has to be explicitly enabled; it is not the default."

So, I guess that the reason why the validation won't work is
because I installed PHP (and PCRE) using RPM (by yum), and
the PCRE was compiled with default setting.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---