Re: Dynamic form creation?

2008-01-27 Thread R. Rajesh Jeba Anbiah

On Jan 23, 3:20 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> Store fields name and type in db, and use $form->inputs( $arrayOfFields );
   

   As far as I have seen this, it's not that easy. Similar idea would
work with PEAR QuickForm, but cake's validations are tied up with
model and input field type creations are tied up with view helpers.

   So, for now, I'm thinking of writing a dynamic validation behavior
and another form helper inheriting core's form helper. Not still sure
that it gonna help.

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



Re: Pagination and search.

2008-01-27 Thread R. Rajesh Jeba Anbiah

On Jan 28, 10:56 am, bhushan A <[EMAIL PROTECTED]> wrote:
>  I have achieved 'pagination' and 'search' differently. Means when i
> am putting my search criteria in text field then records are getting
> displayed as per search criteria but but pagination is not as per
> search criteria. How to achieve it?  Do i need to change controller?
> If yes then what to change? Please help me.

  See http://groups.google.com/group/cake-php/web/frequent-discussions

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



Re: Making RSS feeds with CakePHP

2008-01-27 Thread R. Rajesh Jeba Anbiah

On Jan 28, 4:21 am, MonkeyGirl <[EMAIL PROTECTED]> wrote:
> I'm trying to set up some RSS feeds using CakePHP.
   

  FWIW, http://groups.google.com/group/cake-php/web/frequent-discussions

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



Re: Can't get my head to spot it right, complex ACL

2008-01-27 Thread R. Rajesh Jeba Anbiah

On Jan 26, 10:38 pm, francky06l <[EMAIL PROTECTED]> wrote:
> I have got a problem, I can't, after examining few solutions, find the
> right ACL solution for the following.
   

Not an answer.. I don't know/haven't looked closely at ACL. But, I
think, othAuth can satisfy your conditions. Is there any particular
reason for adopting ACL than othAuth?

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



Re: Pagination and search.

2008-01-27 Thread rtconner

http://bakery.cakephp.org/articles/view/advanced-pagination-1-2



On Jan 27, 10:56 pm, bhushan A <[EMAIL PROTECTED]> wrote:
>  Hi all
>  I have achieved 'pagination' and 'search' differently. Means when i
> am putting my search criteria in text field then records are getting
> displayed as per search criteria but but pagination is not as per
> search criteria. How to achieve it?  Do i need to change controller?
> If yes then what to change? Please help me.
>
> Bhushan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Pagination and search.

2008-01-27 Thread bhushan A

 Hi all
 I have achieved 'pagination' and 'search' differently. Means when i
am putting my search criteria in text field then records are getting
displayed as per search criteria but but pagination is not as per
search criteria. How to achieve it?  Do i need to change controller?
If yes then what to change? Please help me.

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



Re: How do I bake?

2008-01-27 Thread Neil

Thanks for the help,

I now get some output when i type "cake bake" but it does not
recognize my current project.
it gives the following output:
"App: system32
Path: C:\windows\system32"
It then goes on to saying my database configuration was not found and
tries to walk me through creating a new one.

my controal path in the advanced system variables is now:
"%SystemRoot%
\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files
\QuickTime\QTSystem;C:\server\php;C:\server\htdocs\cake\cake
\console"

On Jan 27, 3:27 pm, mishu <[EMAIL PROTECTED]> wrote:
> Hi,
> You need to open comand prompt (start->run->cmd) and  navigate to the
> directory where bake.php is to be found (\cake\scripts\). Then you
> have to locate where php.exe is located on your machine and use a
> command similar to this (you just have to modify the paths):
>
> E:\apps\xampp\php\php.exe bake.php
>
> where E:\apps\xampp\php\php.exe is where php is installed on my
> system.
>
> Then just follow the q/a test :)
>
> Hope this helps.
>
> On Jan 27, 8:33 am, Neil <[EMAIL PROTECTED]> wrote:
>
> > Sorry, I do not follow...From what I understand all I need to so is go
> > to the command prompt and type in "cake bake". However this does not
> > work. I even followed the screencast on this subject over at the
> > cakephp web site but I did not understand what we were doing and it
> > did not solve my problem of getting cake to work.
>
> > On Jan 26, 8:24 pm, rtconner <[EMAIL PROTECTED]> wrote:> tutorial is a bit 
> > old.
>
> > > As far as I know.. now (with 1.2) you have to add /cake/console to
> > > your operating systems global path. Then anywhere on your system you
> > > can just type >cake bake to bring up the console and bake the app of
> > > whatever folder you are in.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



best practices: dev and production environments

2008-01-27 Thread Andres Monroy-Hernandez

Hi everyone,

I'd like to know how you manage to have multiple people coding on a
webapp that drives a production website. I have some issues with my
"system" and it would be great to know what you do.

This is what I do:

1. I am using svn to control the source code in the app directory.

2. My production and dev environment are running on the same server
using the same webserver (Apache) but each one lives on a different
directories in the server's disk as separate Apache virtual hosts.

3. Developers work the dev environment. Frequent svn commits and
updates occur there.

4. When changes are tested on the dev environment then I do an svn
update on the production environment bringing it up to date.

Question: How do you do your testing?

I should be doing unit testing but I haven't had time to read more
about how to do it in CakePHP. So I have been testing by simply trying
(clicking) different features on the website. I know ideally unit
testing should be part of the development cycle but at this point my
app has grown so much that I am not sure what the best approach is.
The problem is that when testing manually I often miss something and a
bug gets released. Any suggestions?

5. Both my production and dev environment point to the same database.
The advantage is when a new field or table is added due to a new
feature, the changes done automatically but I often fear I shouldn't
be touching the production environment until the changes are done.

Question: how do you manage and deploy DB changes?

Please share your insights.

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



Re: Making RSS feeds with CakePHP

2008-01-27 Thread nate

Oh, it gets better: http://cake.insertdesignhere.com/posts/view/8

On Jan 27, 6:21 pm, MonkeyGirl <[EMAIL PROTECTED]> wrote:
> Hi again!
>
> I'm trying to set up some RSS feeds using CakePHP. I'm very impressed
> at how easy and automated this process is, it's great! After a lot of
> searching, this backup of someone explaining how they did it was a
> great help:
>
> http://web.archive.org/web/20070601202250/jirikupiainen.com/2007/05/3...
>
> I based my code on this, and for the most part, it just works without
> having to change much. I just have two questions though:
>
> 1. How can I tell if someone's requesting the RSS version of a page or
> the regular HTML version? At the moment, I've got this in my
> controller:
>
>   if ($this->RequestHandler->__renderType == 'rss')
>
> It seems to work, but looks like it may not be the way I'm supposed to
> do it, and I'm eager to learn the correct way to do things.
>
> 2. The RSS feed doesn't know about all the helpers I specify in my
> app_controller.php file. How can I tell it about them?
>
> Thank you very much,
> Zoe.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Making RSS feeds with CakePHP

2008-01-27 Thread Dardo Sordi Bogado

http://manual.cakephp.org/chapter/request_handler

On Jan 27, 2008 9:21 PM, MonkeyGirl <[EMAIL PROTECTED]> wrote:
>
> Hi again!
>
> I'm trying to set up some RSS feeds using CakePHP. I'm very impressed
> at how easy and automated this process is, it's great! After a lot of
> searching, this backup of someone explaining how they did it was a
> great help:
>
> http://web.archive.org/web/20070601202250/jirikupiainen.com/2007/05/30/creating-rss-feeds-with-cakephp-12/
>
> I based my code on this, and for the most part, it just works without
> having to change much. I just have two questions though:
>
> 1. How can I tell if someone's requesting the RSS version of a page or
> the regular HTML version? At the moment, I've got this in my
> controller:
>
>   if ($this->RequestHandler->__renderType == 'rss')
>
> It seems to work, but looks like it may not be the way I'm supposed to
> do it, and I'm eager to learn the correct way to do things.
>
> 2. The RSS feed doesn't know about all the helpers I specify in my
> app_controller.php file. How can I tell it about them?
>
> Thank you very much,
> Zoe.
> >
>

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



Making RSS feeds with CakePHP

2008-01-27 Thread MonkeyGirl

Hi again!

I'm trying to set up some RSS feeds using CakePHP. I'm very impressed
at how easy and automated this process is, it's great! After a lot of
searching, this backup of someone explaining how they did it was a
great help:

http://web.archive.org/web/20070601202250/jirikupiainen.com/2007/05/30/creating-rss-feeds-with-cakephp-12/

I based my code on this, and for the most part, it just works without
having to change much. I just have two questions though:

1. How can I tell if someone's requesting the RSS version of a page or
the regular HTML version? At the moment, I've got this in my
controller:

  if ($this->RequestHandler->__renderType == 'rss')

It seems to work, but looks like it may not be the way I'm supposed to
do it, and I'm eager to learn the correct way to do things.

2. The RSS feed doesn't know about all the helpers I specify in my
app_controller.php file. How can I tell it about them?

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



Re: How do I bake?

2008-01-27 Thread mishu

Hi,
You need to open comand prompt (start->run->cmd) and  navigate to the
directory where bake.php is to be found (\cake\scripts\). Then you
have to locate where php.exe is located on your machine and use a
command similar to this (you just have to modify the paths):

E:\apps\xampp\php\php.exe bake.php

where E:\apps\xampp\php\php.exe is where php is installed on my
system.

Then just follow the q/a test :)

Hope this helps.


On Jan 27, 8:33 am, Neil <[EMAIL PROTECTED]> wrote:
> Sorry, I do not follow...From what I understand all I need to so is go
> to the command prompt and type in "cake bake". However this does not
> work. I even followed the screencast on this subject over at the
> cakephp web site but I did not understand what we were doing and it
> did not solve my problem of getting cake to work.
>
> On Jan 26, 8:24 pm, rtconner <[EMAIL PROTECTED]> wrote:> tutorial is a bit 
> old.
>
> > As far as I know.. now (with 1.2) you have to add /cake/console to
> > your operating systems global path. Then anywhere on your system you
> > can just type >cake bake to bring up the console and bake the app of
> > whatever folder you are in.

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



Re: getting syntax error with execute

2008-01-27 Thread Samuel DeVore

On Jan 27, 2008 1:14 PM, matches <[EMAIL PROTECTED]> wrote:
>
> Yeah, I get the same error as above with single quotes and the
> following error with double quotes around my string variables (that's
> what you meant right).

like this

$this->User->execute("UPDATE 'users' WHERE 'username' = \"$username\" SET
'friends_list' = concat(friends_list, \"$friendName\")");

mysql wants strings around the strings you are using in your search
arguments  have you tried this query directly in mysql?

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



Re: getting syntax error with execute

2008-01-27 Thread matches

Yeah, I get the same error as above with single quotes and the
following error with double quotes around my string variables (that's
what you meant right).

Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs
\konimo\app\controllers\users_controller.php on line 111

Also, I noticed that the docs say execute() should be _execute() but
that does not seem to work at all. Do you know what that's about? I
have found mixed examples.

On Jan 27, 12:00 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> probably need to wrap your strings in quotes (single or double)
>
> Sam D
>
> On Jan 27, 2008 12:48 PM, matches <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hello,
>
> > I am getting a sql syntax error when I try the execute function. I
> > errors when I try to use what I think to be the right syntax any other
> > kind of experimental syntax ;)  Anyway, this is what I have:
>
> > $this->User->execute("UPDATE users WHERE username = $username SET
> > friends_list = concat(friends_list, $friendName)");
>
> > I have also tried this:
>
> > $this->User->execute("UPDATE 'users' WHERE 'username' = $username SET
> > 'friends_list' = concat(friends_list, $friendName)");
>
> > Here is the error:
>
> > Query: UPDATE users WHERE username = joe SET friends_list =
> > concat(friends_list, Albert2640)
> > Warning: SQL Error: 1064: You have an error in your SQL syntax; check
> > the manual that corresponds to your MySQL server version for the right
> > syntax to use near 'WHERE username = joe SET friends_list =
> > concat(friends_list, Albert2640)' at line 1 in C:\xampp\htdocs\konimo
> > \cake\libs\model\datasources\dbo_source.php on line 440
>
> > Thanks for any help
>
> --
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/http://blog.samdevore.com/cakephp-pages/i-cant-bake/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: getting syntax error with execute

2008-01-27 Thread Samuel DeVore

probably need to wrap your strings in quotes (single or double)

Sam D

On Jan 27, 2008 12:48 PM, matches <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I am getting a sql syntax error when I try the execute function. I
> errors when I try to use what I think to be the right syntax any other
> kind of experimental syntax ;)  Anyway, this is what I have:
>
> $this->User->execute("UPDATE users WHERE username = $username SET
> friends_list = concat(friends_list, $friendName)");
>
> I have also tried this:
>
> $this->User->execute("UPDATE 'users' WHERE 'username' = $username SET
> 'friends_list' = concat(friends_list, $friendName)");
>
> Here is the error:
>
> Query: UPDATE users WHERE username = joe SET friends_list =
> concat(friends_list, Albert2640)
> Warning: SQL Error: 1064: You have an error in your SQL syntax; check
> the manual that corresponds to your MySQL server version for the right
> syntax to use near 'WHERE username = joe SET friends_list =
> concat(friends_list, Albert2640)' at line 1 in C:\xampp\htdocs\konimo
> \cake\libs\model\datasources\dbo_source.php on line 440
>
> Thanks for any help
>
>
> >
>



-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

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



getting syntax error with execute

2008-01-27 Thread matches

Hello,

I am getting a sql syntax error when I try the execute function. I
errors when I try to use what I think to be the right syntax any other
kind of experimental syntax ;)  Anyway, this is what I have:

$this->User->execute("UPDATE users WHERE username = $username SET
friends_list = concat(friends_list, $friendName)");

I have also tried this:

$this->User->execute("UPDATE 'users' WHERE 'username' = $username SET
'friends_list' = concat(friends_list, $friendName)");

Here is the error:

Query: UPDATE users WHERE username = joe SET friends_list =
concat(friends_list, Albert2640)
Warning: SQL Error: 1064: You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'WHERE username = joe SET friends_list =
concat(friends_list, Albert2640)' at line 1 in C:\xampp\htdocs\konimo
\cake\libs\model\datasources\dbo_source.php on line 440

Thanks for any help


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



output custom tag as ajax link(resolved)

2008-01-27 Thread Novice Programmer
Got this one, the last parameter to ajax->link must be false(which indicates
that the title should not be html escaped) if some one has to insert some
html stuff in the $title variable of the ajax->link.

Thanks.


On 1/27/08, Novice Programmer <[EMAIL PROTECTED]> wrote:
>
> Hello guys,
>
> I am using following code to output custom tag in $ajax->link. The output
> is not exactly waht i want:
>
> link($html->tag("area", array('shape'=>"rect", 'coords'
> => "67,12,134,28")), '/main_tabs/index/random', array('onclick' =>
> 'changeImagemap(\'ran\');return true;', 'update' => 'ajaxtabloader',
> 'loading' => 'new Effect.Highlight(\'ajaxtabloader\')', 'complete' => 'new
> Effect.Appear(\'ajaxtabloader\')'))); ?>
>
> It produces:
> * shape="rect" coords="67,12,134,28" />* type="text/javascript">Event.observe('link1982745748', 'click',
> function(event) { new Ajax.Updater('ajaxtabloader','/main_tabs/index/random',
> {asynchronous:true, evalScripts:true, onLoading:function(request) {new
> Effect.Highlight('ajaxtabloader')}, onComplete:function(request) {new
> Effect.Appear('ajaxtabloader')}, requestHeaders:['X-Update',
> 'ajaxtabloader']}) }, false);
>
>
> I want the highlighted code to appear as tag rather than normal html
> content. Any help is appreciated.
>
> --
> Thanks & Regards,
> Novice (http://ishuonweb.wordpress.com/).
>



-- 
Thanks & Regards,
Novice (http://ishuonweb.wordpress.com/).

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



Database design(Resolved)

2008-01-27 Thread Novice Programmer
Hello Richard,

Yes, this is how AD also approached the solution. I think i would
investigate the performance of the solutions being posted by AD and
Shiono(the solution of maintaning a seperate table of links for the valid
images).

@AD:
This is not about knowing/not knowing MySQL. its about how databases
operate. I always prefer searching by a primary key because only in that
case database performs O(1) search. In case you search by some other keys,
then B+ Trees come into picture and may hit performance which i want to
avoid.

Any ways thanks for all the thoughts. For now i will change the subject of
the query to resolved.

Thanks.


On 1/27/08, RichardAtHome <[EMAIL PROTECTED]> wrote:
>
>
> How do you determine if an image is invalid?
>
> You may be able to apply this criteria to your SELECT statement
> without any additional fields.
>
> On Jan 27, 2:50 pm, Takuo SHIONO <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > If you do not want to keep unnecessary fields for almost 50% of images,
> > you can use image_link table, which contains 3 fields(image_id, next_id,
> > previous_id). You maintain this table in afterSave function only when
> > you edit or add valid images.
> >
> > You can define the HASONE relationship between image model and
> > image_link model. I think this makes your code smart like below:
> >
> > // Controller
> > $image = $this->Image->findById($id);
> > $this->set('image', $image);
> >
> > // View
> > link('next', '/images/view/'.
> > $image['ImageLink']['next_index']); ?>
> >
> > Best Wishes,
> >
> > Takuo Shiono
> >
> > Novice Programmer wrote:
> > > Hello Shiono,
> >
> > > When i tried to add the two fields, it seemed like an overhead to me
> because
> > > almost 50% of the images would be invalid, so adding two fields to
> database
> > > design will lead to addition of these fields in these invalid images
> as well
> > > and hence occupy more space in database. I want to avoid that if
> possible.
> >
> > > Thanks.
> >
> > > On 1/27/08, Takuo SHIONO <[EMAIL PROTECTED]> wrote:
> >
> > >> Hello,
> >
> > >> I often use solution 1. I think this solution can be applied in
> almost
> > >> all cases. However I have another solution. How about this:
> >
> > >> 1. add 2 fields (prev_valid_index and next_valid_index) in table.
> > >> 2. update these fields in afterSave function.
> > >> 3. show image with the next/previous link according to the fields.
> >
> > >> Best Wishes,
> >
> > >> Takuo Shiono
> >
> > >> Novice Programmer wrote:
> > >>> Though this is less of a database question. but i am still posting
> it
> > >> here
> > >>> since I think we can discuss the design as well.. :).
> >
> > >>> I am maintaining a adresses of images stored on my filesystem in a
> > >> database.
> > >>> I have designed a system to show those images to the user. This
> > >> interface
> > >>> has the next and previous button as well. When user clicks on next
> he
> > >> goes
> > >>> to the *next valid image*. Note the difference here. I have to show
> only
> > >>> valid images. This means that all the images in the database are not
> to
> > >> be
> > >>> shown. Lets consider an example. Say that my database consists of
> > >> following
> > >>> images:
> >
> > >>> 1. Image1(Valid)
> > >>> 2. Image2(InValid)
> > >>> 3 Image3(Invalid)
> > >>> 4. Image4(Valid)
> >
> > >>> so when user is viewing image 1 and clicks on next he goes to image4
> > >>> directly even though image2 is stored in the next index on the
> database.
> > >> I
> > >>> have thought of following solutions but none of them are appealing
> me:
> >
> > >>> 1. Maintain a variable which tells the index of next valid image.
> > >> Maintain a
> > >>> variable which tells me the index of last valid image and when next
> > >> valid
> > >>> image comes, update the index of the last valid image with this new
> > >> image.
> > >>> Similarly maintain the previous variable.
> > >>> 2. I am storing time stamp along with the images. On clicking next,
> I
> > >> load
> > >>> the image having the most recent time stamp after this image. but
> still
> > >> I
> > >>> dont like this query as this may be slow.
> >
> > >>> Please help.
> >
>


-- 
Thanks & Regards,
Novice (http://ishuonweb.wordpress.com/).

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



Re: enum

2008-01-27 Thread RichardAtHome

This has been asked before, and the 'official' answer is: Cake doesn't
support enums because they are database vendor specific.

MonkeyGirl's suggestion is the way to go :-)


On Jan 27, 1:59 pm, "Ronald Chaplin" <[EMAIL PROTECTED]> wrote:
> The only caveat that I have run into with this is that the very latest
> beta release of 1.2 does not recognize the enum column type when you
> try to use bake. I did have this working in 1.2.5XXX however. Just so
> that you are aware. Other than that, it works great.
>
> On 1/26/08, MonkeyGirl <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > > How would you get the enum values from the model or controller?
>
> > By far the easiest way is to go to
> >http://cakeforge.org/snippet/detail.php?type=snippet&id=112
> > and copy and paste the code that's there into app_model.php, then you
> > can just use lines like the following in your code:
>
> > $types = $this->Album->getEnumValues('type');
>
> > In this example, 'type' is the name of the enum column, Album is the
> > model it's in, and 'types' is the variable that will automatically be
> > picked up by this line in the view (assuming you're using Cake 1.2
> > with its form helper):
>
> > echo $form->input('type');
>
> > This will give you a dropdown, just like the one you get for foreign
> > keys.
>
> > Hope that helps,
> > Zoe.
>
> --
> Thanks,
> Ron Chaplin
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> T73 Software & Designwww.t73-softdesign.com
> We'll make all of your wildest
> e-Commerce dreams come true!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do I bake?

2008-01-27 Thread RichardAtHome

What pav said, although I find it easier to copy the path out of the
tiny edit box that Microsoft provide and paste it into notepad.

You might need to add a trailing \ to the word console. That's what it
looks like on mine and works fine.

Make sure you close down any open DOS windows before you edit the
path.

Oh, PHP needs to be in your path too!

Once you can type cake bake and get something meaningful back,
navigate (in the dos window) to your application directory (\cake_root
\app) and type cake bake again.

Follow the on screen menus and start by baking your database
connection
Then the models
Then the controllers
Then the views


On Jan 27, 4:38 pm, pavbaker <[EMAIL PROTECTED]> wrote:
> Neil, Hi
>
> It certainly appears that the path is suspect, no wonder your baking
> fails
> This piece appears crook
> C:\server\htdocs\cake\1.2.x.x\cake\console
>
> I suspect it should read something like
> C:\server\htdocs\cake\1.2.0.6311-beta\cake\console
>
> Where to change it?
> Control panel/system/advanced/system variables/path/edit
>
> Watch it when you first enter edit mode - the whole path string is
> highlighted - if you start typing you will ditch what is there already
> and may find other programs may not work.  Use your mouse carefully
> and left-right keys to get to the piece you need to change.
>
> As long as you enter the correct path here as sytem variable,
> you should be able to call cake from any command prompt  folder
>
> HTH
> pavbaker  http://pavbaker.wordpress.com/
>
> On Jan 28, 3:44 am, Neil <[EMAIL PROTECTED]> wrote:
>
> > It does not find cake.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Database design

2008-01-27 Thread RichardAtHome

How do you determine if an image is invalid?

You may be able to apply this criteria to your SELECT statement
without any additional fields.

On Jan 27, 2:50 pm, Takuo SHIONO <[EMAIL PROTECTED]> wrote:
> Hello,
>
> If you do not want to keep unnecessary fields for almost 50% of images,
> you can use image_link table, which contains 3 fields(image_id, next_id,
> previous_id). You maintain this table in afterSave function only when
> you edit or add valid images.
>
> You can define the HASONE relationship between image model and
> image_link model. I think this makes your code smart like below:
>
> // Controller
> $image = $this->Image->findById($id);
> $this->set('image', $image);
>
> // View
> link('next', '/images/view/'.
> $image['ImageLink']['next_index']); ?>
>
> Best Wishes,
>
> Takuo Shiono
>
> Novice Programmer wrote:
> > Hello Shiono,
>
> > When i tried to add the two fields, it seemed like an overhead to me because
> > almost 50% of the images would be invalid, so adding two fields to database
> > design will lead to addition of these fields in these invalid images as well
> > and hence occupy more space in database. I want to avoid that if possible.
>
> > Thanks.
>
> > On 1/27/08, Takuo SHIONO <[EMAIL PROTECTED]> wrote:
>
> >> Hello,
>
> >> I often use solution 1. I think this solution can be applied in almost
> >> all cases. However I have another solution. How about this:
>
> >> 1. add 2 fields (prev_valid_index and next_valid_index) in table.
> >> 2. update these fields in afterSave function.
> >> 3. show image with the next/previous link according to the fields.
>
> >> Best Wishes,
>
> >> Takuo Shiono
>
> >> Novice Programmer wrote:
> >>> Though this is less of a database question. but i am still posting it
> >> here
> >>> since I think we can discuss the design as well.. :).
>
> >>> I am maintaining a adresses of images stored on my filesystem in a
> >> database.
> >>> I have designed a system to show those images to the user. This
> >> interface
> >>> has the next and previous button as well. When user clicks on next he
> >> goes
> >>> to the *next valid image*. Note the difference here. I have to show only
> >>> valid images. This means that all the images in the database are not to
> >> be
> >>> shown. Lets consider an example. Say that my database consists of
> >> following
> >>> images:
>
> >>> 1. Image1(Valid)
> >>> 2. Image2(InValid)
> >>> 3 Image3(Invalid)
> >>> 4. Image4(Valid)
>
> >>> so when user is viewing image 1 and clicks on next he goes to image4
> >>> directly even though image2 is stored in the next index on the database.
> >> I
> >>> have thought of following solutions but none of them are appealing me:
>
> >>> 1. Maintain a variable which tells the index of next valid image.
> >> Maintain a
> >>> variable which tells me the index of last valid image and when next
> >> valid
> >>> image comes, update the index of the last valid image with this new
> >> image.
> >>> Similarly maintain the previous variable.
> >>> 2. I am storing time stamp along with the images. On clicking next, I
> >> load
> >>> the image having the most recent time stamp after this image. but still
> >> I
> >>> dont like this query as this may be slow.
>
> >>> Please help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Developers required

2008-01-27 Thread coolschooluk

To all coders / bakers

We are a Solihull (Birmingham) based business looking to recruit two
cakephp developers. Experience level is not too important as long as
you are resourceful. The successful candidate(s) will demostrate the
ability to find answers to problems using relevant resources to get
the job done.

Guidance will be on hand and you will be expected to adhere to coding
guidelines and best pratices. This does not however subtract from the
creative side the development. The challenges set will be varied and
provide excellent grounds for learning. Experience in other languages,
and other skillsets will be taken into consideration when selecting
applicants so please tell us what you can do!

Please email [EMAIL PROTECTED] to express your interest, closing
date for applications is 15 Feb 2008.

Regards

Dan Hawkins

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



ClassRegistry bug?

2008-01-27 Thread Ivan

I just found a problem with the way ClassRegistry handles aliases for
associations. I wonder why nobody else has reported it, so it may be
my fault.

I have two models:

class FirstObject extends AppModel {
public $belongsTo = array(
'Parent' => array(
'className' => 'FirstObject',
'foreignKey' => 'parent_id',
)
);
public $hasMany = array(
'Children' => array(
'className' => 'FirstObject',
'foreignKey' => 'parent_id'
),
'SecondObject'
);
}

class SecondObject extends AppModel {
public $belongsTo = array(
'Parent' => array(
'className' => 'SecondObject',
'foreignKey' => 'parent_id',
),
'FirstObject'
);
public $hasMany = array(
'Children' => array(
'className' => 'SecondObject',
'foreignKey' => 'parent_id'
)
);
}

A simple FirstObject->findAll() results in a blank page caused by an
endless loop inside ClassRegistry. It seems this is because
ClassRegistry uses the alias of the association as a key.

Is something wrong with my setup or is indeed a bug with ClassRegistry
if you use the same aliases for different classes?

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



Re: How do I bake?

2008-01-27 Thread pavbaker

Neil, Hi

It certainly appears that the path is suspect, no wonder your baking
fails
This piece appears crook
C:\server\htdocs\cake\1.2.x.x\cake\console

I suspect it should read something like
C:\server\htdocs\cake\1.2.0.6311-beta\cake\console

Where to change it?
Control panel/system/advanced/system variables/path/edit

Watch it when you first enter edit mode - the whole path string is
highlighted - if you start typing you will ditch what is there already
and may find other programs may not work.  Use your mouse carefully
and left-right keys to get to the piece you need to change.

As long as you enter the correct path here as sytem variable,
you should be able to call cake from any command prompt  folder

HTH
pavbaker  http://pavbaker.wordpress.com/

On Jan 28, 3:44 am, Neil <[EMAIL PROTECTED]> wrote:
> It does not find cake.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do I bake?

2008-01-27 Thread Neil

It does not find cake. When I put in path I get this: "%SystemRoot%
\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files
\QuickTime\QTSystem;C:\server\php;C:\server\htdocs\cake\1.2.x.x\cake
\console"
I guess this is not right... This is the path I used from the
screencast but I changed a few things because my setup was different
then in the tutorial (ex: I use server instead of wamp)

On Jan 27, 4:04 am, pavbaker <[EMAIL PROTECTED]> wrote:
> Neil, Hi
>
> If the 'cake bake' command is not working when you press the Enter
> button, I suspect there is no path to where cake.bat resides.
>
> Can you confirm that when you get to the command prompt that you have
> set the path variable to include the \cake\console folder?
> If you type in just 'cake', press Enter - get any action?  No - check
> the path.
> (type path, hit enter at the command prompt to check)
> If the file cake.bat cannot be located from the command prompt folder
> where you are currently, bake.php will also not be found as it resides
> in \cake\console\libs
>
> HTH
> pavbakerhttp://pavbaker.wordpress.com/
>
> On Jan 27, 7:33 pm, Neil <[EMAIL PROTECTED]> wrote:
>
> > Sorry, I do not follow...From what I understand all I need to so is go
> > to the command prompt and type in "cake bake". However this does not
> > work.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Database design

2008-01-27 Thread Takuo SHIONO

Hello,

If you do not want to keep unnecessary fields for almost 50% of images, 
you can use image_link table, which contains 3 fields(image_id, next_id, 
previous_id). You maintain this table in afterSave function only when 
you edit or add valid images.

You can define the HASONE relationship between image model and 
image_link model. I think this makes your code smart like below:

// Controller
$image = $this->Image->findById($id);
$this->set('image', $image);

// View
link('next', '/images/view/'. 
$image['ImageLink']['next_index']); ?>


Best Wishes,

Takuo Shiono

Novice Programmer wrote:
> Hello Shiono,
> 
> When i tried to add the two fields, it seemed like an overhead to me because
> almost 50% of the images would be invalid, so adding two fields to database
> design will lead to addition of these fields in these invalid images as well
> and hence occupy more space in database. I want to avoid that if possible.
> 
> Thanks.
> 
> 
> On 1/27/08, Takuo SHIONO <[EMAIL PROTECTED]> wrote:
>>
>> Hello,
>>
>> I often use solution 1. I think this solution can be applied in almost
>> all cases. However I have another solution. How about this:
>>
>> 1. add 2 fields (prev_valid_index and next_valid_index) in table.
>> 2. update these fields in afterSave function.
>> 3. show image with the next/previous link according to the fields.
>>
>>
>> Best Wishes,
>>
>> Takuo Shiono
>>
>> Novice Programmer wrote:
>>> Though this is less of a database question. but i am still posting it
>> here
>>> since I think we can discuss the design as well.. :).
>>>
>>> I am maintaining a adresses of images stored on my filesystem in a
>> database.
>>> I have designed a system to show those images to the user. This
>> interface
>>> has the next and previous button as well. When user clicks on next he
>> goes
>>> to the *next valid image*. Note the difference here. I have to show only
>>> valid images. This means that all the images in the database are not to
>> be
>>> shown. Lets consider an example. Say that my database consists of
>> following
>>> images:
>>>
>>> 1. Image1(Valid)
>>> 2. Image2(InValid)
>>> 3 Image3(Invalid)
>>> 4. Image4(Valid)
>>>
>>> so when user is viewing image 1 and clicks on next he goes to image4
>>> directly even though image2 is stored in the next index on the database.
>> I
>>> have thought of following solutions but none of them are appealing me:
>>>
>>> 1. Maintain a variable which tells the index of next valid image.
>> Maintain a
>>> variable which tells me the index of last valid image and when next
>> valid
>>> image comes, update the index of the last valid image with this new
>> image.
>>> Similarly maintain the previous variable.
>>> 2. I am storing time stamp along with the images. On clicking next, I
>> load
>>> the image having the most recent time stamp after this image. but still
>> I
>>> dont like this query as this may be slow.
>>>
>>> Please help.
>>>
>>
> 
> 


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



Re: enum

2008-01-27 Thread Ronald Chaplin

The only caveat that I have run into with this is that the very latest
beta release of 1.2 does not recognize the enum column type when you
try to use bake. I did have this working in 1.2.5XXX however. Just so
that you are aware. Other than that, it works great.

On 1/26/08, MonkeyGirl <[EMAIL PROTECTED]> wrote:
>
> > How would you get the enum values from the model or controller?
>
> By far the easiest way is to go to
> http://cakeforge.org/snippet/detail.php?type=snippet&id=112
> and copy and paste the code that's there into app_model.php, then you
> can just use lines like the following in your code:
>
> $types = $this->Album->getEnumValues('type');
>
> In this example, 'type' is the name of the enum column, Album is the
> model it's in, and 'types' is the variable that will automatically be
> picked up by this line in the view (assuming you're using Cake 1.2
> with its form helper):
>
> echo $form->input('type');
>
> This will give you a dropdown, just like the one you get for foreign
> keys.
>
> Hope that helps,
> Zoe.
> >
>


-- 
Thanks,
Ron Chaplin
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
T73 Software & Design
www.t73-softdesign.com
We'll make all of your wildest
e-Commerce dreams come true!

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



Change layout depending on the type of user in OthAuth

2008-01-27 Thread dandreta

Hi!!
I have applied Othauth component to define the user groups and their
permissions following Bakery's article.
I want that when a user logs in the aplication, it shows the principal
screen with a different layout depending on the group of the user.
Do you know how can I do it?
any suggestion or link about this?

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



Re: Boston Cake bakers?

2008-01-27 Thread Dr. Tarique Sani

Am not from anywhere near where you want to hear a 'Hi" from but your
signature has the URL of something I absolutely love - Scratch

so FWIW "Hi"

Tarique

On Jan 27, 2008 12:03 PM, Andres Monroy-Hernandez
<[EMAIL PROTECTED]> wrote:
>
> Hi everyone,
>
> I am wondering if there are other developers using CakePHP in the
> Boston area. It would be great to get together and share experiences.
> Sometimes it feels like it would be great to bounce ideas in person
> with other developers. Please say "hi".
>
> Best regards,
> Andres
>
> ---
> MIT Media Lab
> http://scratch.mit.edu ...powered by CakePHP
> >
>



-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

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



Re: CakePhp and Extjs tree

2008-01-27 Thread Paolo

I created a small guide here: 
http://www.small-software-utilities.com/cakephp/94/cakephp-and-extjs-tree/

On 27 Gen, 01:12, Adam Royle <[EMAIL PROTECTED]> wrote:
> This is something that I'm going to have to tackle today or tomorrow,
> so it would be great if you could paste your code temporarily
> somewhere before you get the tutorial happening. Shouldn't need any
> explanation of what the code does, so don't worry about making it
> pretty.
>
> Cheers,
> Adam
>
> On Jan 25, 12:19 am, Paolo <[EMAIL PROTECTED]> wrote:
>
> > Hi! Thanks for your answer, I tried using a function that loads all
> > the children of the tree and puts them, formatted in a particular way,
> > in a textbox. I can read that textbox and parse it to add all the
> > relevant stuff to the db. I'll post a tutorial soon.
>
> > Thanks
>
> > On 23 Gen, 19:39, hydra12 <[EMAIL PROTECTED]> wrote:
>
> > > I haven't tried this yet.  You might look here for some basic
> > > information:  
> > > http://extjs.com/learn/Tutorial:Ext20_Tree_TreeLoader_PHP_MySQL
>
> > > The main problem I see with doing this with cake is getting your data
> > > in the correct format.  I have some other extjs tutorials; maybe I can
> > > get atreetutorial up sometime.  You can find my other stuff 
> > > here:http://www.ntatd.org/mark.  Maybe some of it will help, since the
> > > datagrids do cover outputting data in json format.
>
> > > hydra12
>
> > > On Jan 22, 8:14 am, Paolo <[EMAIL PROTECTED]> wrote:
>
> > > > Hi all!
> > > > Hasanyone tried to integrate cake with extjstree? I qould like the
> > > > used to edit the structure of a menu using extjs drag and drop tools
> > > > on atree, and then get the values (for ezample, a sequence of root ->
> > > > node 1, node 2-> node 3 -> node 4
> > > > and then update the parent in the db fields.
> > > > Any idea?
> > > > thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



output custom tag as ajax link

2008-01-27 Thread Novice Programmer
Hello guys,

I am using following code to output custom tag in $ajax->link. The output is
not exactly waht i want:

link($html->tag("area", array('shape'=>"rect", 'coords' =>
"67,12,134,28")), '/main_tabs/index/random', array('onclick' =>
'changeImagemap(\'ran\');return true;', 'update' => 'ajaxtabloader',
'loading' => 'new Effect.Highlight(\'ajaxtabloader\')', 'complete' => 'new
Effect.Appear(\'ajaxtabloader\')'))); ?>

It produces:
**Event.observe('link1982745748', 'click',
function(event) { new Ajax.Updater('ajaxtabloader','/main_tabs/index/random',
{asynchronous:true, evalScripts:true, onLoading:function(request) {new
Effect.Highlight('ajaxtabloader')}, onComplete:function(request) {new
Effect.Appear('ajaxtabloader')}, requestHeaders:['X-Update',
'ajaxtabloader']}) }, false);


I want the highlighted code to appear as tag rather than normal html
content. Any help is appreciated.

-- 
Thanks & Regards,
Novice (http://ishuonweb.wordpress.com/).

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



Re: Xampp + CakePHP = FAILURE

2008-01-27 Thread Mandy

Hi Hyperfreak24,

1. Did you run setup_xampp.bat script after installing xampp?

2. Once you ran the script, did you try visiting http://localhost/ to
make sure a page comes up?

3. Then did you put the cake folder tree (app, webroot, cake) etc into
the root folder of your installation?

4. Did you open config/database.php and try entering your db name,
username, password?
Typically for xampp installation username is 'root' and password is
blank (empty string, ie '')

5. But, before that did you create an empty database in mysql using
phpmyadmin (that also gets installed with xampp)?

You might also need to enable mod_rewrite in apache config of your
xampp installation (it might not be enabled by default).

Hope this helps!

Thanks,
Mandy.

On Jan 27, 4:20 pm, AD7six <[EMAIL PROTECTED]> wrote:
> On Jan 27, 3:00 am, hyperfreak24 <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi,
> > My 2 newbish warnings:
>
> > Warning (2): mysql_connect() [function.mysql-connect]: Access denied
> > for user 'user'@'localhost' (using password: YES) [CORE\cake\libs\model
> > \datasources\dbo\dbo_mysql.php, line 100]
> > Warning: implode() [function.implode]: Invalid arguments passed in
>
> > Warning (2): mysql_select_db(): supplied argument is not a valid MySQL-
> > Link resource [CORE\cake\libs\model\datasources\dbo\dbo_mysql.php,
> > line 105]
>
> > The Facts:
> > -XAMPP 1.65
> > -MySql, not as a service.
> > -Windows Vista
> > -MySql Login: user Password: password
>
> > This is only a dev computer (so I don't need to know about how I
> > should switch to Linux). I'm really new to databases, frameworks, and
> > PHP, let alone CakePHP so I think I just wasn't able to configure it
> > properly (I do Photoshop and Flash). I look forward to any help
> > that'll get me baking.
>
> It says your password isn't correct- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Database design

2008-01-27 Thread AD7six



On Jan 27, 11:33 am, "Novice Programmer" <[EMAIL PROTECTED]>
wrote:
> Hello AD,
>
> Wont this query be slow?

No.

> Lets say that i have first valid image at index 1
> and the next one at the index 1000. How would this query perform?

SELECT * from images WHERE status = 1 AND id > $thisOne ORDER BY id
asc LIMIT 1

If you think that's going to be slow it's time to pick up a book on
sql.
If in your case that is slow you are missing an index, have a lot more
than 1000 rows and probably have some kind of serious DB problem ;)

hth,

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



Re: Xampp + CakePHP = FAILURE

2008-01-27 Thread AD7six



On Jan 27, 3:00 am, hyperfreak24 <[EMAIL PROTECTED]> wrote:
> Hi,
> My 2 newbish warnings:
>
> Warning (2): mysql_connect() [function.mysql-connect]: Access denied
> for user 'user'@'localhost' (using password: YES) [CORE\cake\libs\model
> \datasources\dbo\dbo_mysql.php, line 100]
> Warning: implode() [function.implode]: Invalid arguments passed in
>
> Warning (2): mysql_select_db(): supplied argument is not a valid MySQL-
> Link resource [CORE\cake\libs\model\datasources\dbo\dbo_mysql.php,
> line 105]
>
> The Facts:
> -XAMPP 1.65
> -MySql, not as a service.
> -Windows Vista
> -MySql Login: user Password: password
>
> This is only a dev computer (so I don't need to know about how I
> should switch to Linux). I'm really new to databases, frameworks, and
> PHP, let alone CakePHP so I think I just wasn't able to configure it
> properly (I do Photoshop and Flash). I look forward to any help
> that'll get me baking.

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



Re: Database design

2008-01-27 Thread Novice Programmer
Hello Shiono,

When i tried to add the two fields, it seemed like an overhead to me because
almost 50% of the images would be invalid, so adding two fields to database
design will lead to addition of these fields in these invalid images as well
and hence occupy more space in database. I want to avoid that if possible.

Thanks.


On 1/27/08, Takuo SHIONO <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
>
> I often use solution 1. I think this solution can be applied in almost
> all cases. However I have another solution. How about this:
>
> 1. add 2 fields (prev_valid_index and next_valid_index) in table.
> 2. update these fields in afterSave function.
> 3. show image with the next/previous link according to the fields.
>
>
> Best Wishes,
>
> Takuo Shiono
>
> Novice Programmer wrote:
> > Though this is less of a database question. but i am still posting it
> here
> > since I think we can discuss the design as well.. :).
> >
> > I am maintaining a adresses of images stored on my filesystem in a
> database.
> > I have designed a system to show those images to the user. This
> interface
> > has the next and previous button as well. When user clicks on next he
> goes
> > to the *next valid image*. Note the difference here. I have to show only
> > valid images. This means that all the images in the database are not to
> be
> > shown. Lets consider an example. Say that my database consists of
> following
> > images:
> >
> > 1. Image1(Valid)
> > 2. Image2(InValid)
> > 3 Image3(Invalid)
> > 4. Image4(Valid)
> >
> > so when user is viewing image 1 and clicks on next he goes to image4
> > directly even though image2 is stored in the next index on the database.
> I
> > have thought of following solutions but none of them are appealing me:
> >
> > 1. Maintain a variable which tells the index of next valid image.
> Maintain a
> > variable which tells me the index of last valid image and when next
> valid
> > image comes, update the index of the last valid image with this new
> image.
> > Similarly maintain the previous variable.
> > 2. I am storing time stamp along with the images. On clicking next, I
> load
> > the image having the most recent time stamp after this image. but still
> I
> > dont like this query as this may be slow.
> >
> > Please help.
> >
>
>
> >
>


-- 
Thanks & Regards,
Novice (http://ishuonweb.wordpress.com/).

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



Re: Database design

2008-01-27 Thread Novice Programmer
Hello AD,

Wont this query be slow? Lets say that i have first valid image at index 1
and the next one at the index 1000. How would this query perform?

Thanks.


On 1/27/08, AD7six <[EMAIL PROTECTED]> wrote:
>
>
>
>
> On Jan 26, 8:33 pm, "Novice Programmer" <[EMAIL PROTECTED]>
> wrote:
> > Though this is less of a database question. but i am still posting it
> here
> > since I think we can discuss the design as well.. :).
> >
> > I am maintaining a adresses of images stored on my filesystem in a
> database.
> > I have designed a system to show those images to the user. This
> interface
> > has the next and previous button as well. When user clicks on next he
> goes
> > to the *next valid image*. Note the difference here. I have to show only
> > valid images. This means that all the images in the database are not to
> be
> > shown. Lets consider an example. Say that my database consists of
> following
> > images:
> >
> > 1. Image1(Valid)
> > 2. Image2(InValid)
> > 3 Image3(Invalid)
> > 4. Image4(Valid)
> >
> > so when user is viewing image 1 and clicks on next he goes to image4
> > directly even though image2 is stored in the next index on the database.
> I
> > have thought of following solutions but none of them are appealing me:
> >
> > 1. Maintain a variable which tells the index of next valid image.
> Maintain a
> > variable which tells me the index of last valid image and when next
> valid
> > image comes, update the index of the last valid image with this new
> image.
> > Similarly maintain the previous variable.
> > 2. I am storing time stamp along with the images. On clicking next, I
> load
> > the image having the most recent time stamp after this image. but still
> I
> > dont like this query as this may be slow.
>
> Why don't you add a status field on your image table and set it to
> true if the image is valid when you add it? Then just look in the db
> for the next/previous valid image. Incidentally that's just pagination
> with a "show" of 1.
>
> AD
> >
>


-- 
Thanks & Regards,
Novice (http://ishuonweb.wordpress.com/).

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



Re: How do I bake?

2008-01-27 Thread AD7six



On Jan 27, 2:16 am, Neil <[EMAIL PROTECTED]> wrote:
> I'm running cakePHP 1.2 and I want to do a little baking. The manual
> says this:
> "To use Bake, access it via the CakePHP Console, run from the app
> folder of your CakePHP application:
> $ cd /path/to/app
> $ cake bake
> "
> And The tutorial I am following that uses bake says this:
> "To use Bake, cd into the /webroot/app directory and launch the Cake
> Console:
> ../cake/console/cake bake."
>
> I have no idea what these either of these brief explinations mean. Can
> someone please elaborate on them.

There are a couple of screencasts on running the console; check them
out and all becomes clear (probably): http://cakephp.org/screencasts

hth,

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



Re: Database design

2008-01-27 Thread AD7six



On Jan 26, 8:33 pm, "Novice Programmer" <[EMAIL PROTECTED]>
wrote:
> Though this is less of a database question. but i am still posting it here
> since I think we can discuss the design as well.. :).
>
> I am maintaining a adresses of images stored on my filesystem in a database.
> I have designed a system to show those images to the user. This interface
> has the next and previous button as well. When user clicks on next he goes
> to the *next valid image*. Note the difference here. I have to show only
> valid images. This means that all the images in the database are not to be
> shown. Lets consider an example. Say that my database consists of following
> images:
>
> 1. Image1(Valid)
> 2. Image2(InValid)
> 3 Image3(Invalid)
> 4. Image4(Valid)
>
> so when user is viewing image 1 and clicks on next he goes to image4
> directly even though image2 is stored in the next index on the database. I
> have thought of following solutions but none of them are appealing me:
>
> 1. Maintain a variable which tells the index of next valid image. Maintain a
> variable which tells me the index of last valid image and when next valid
> image comes, update the index of the last valid image with this new image.
> Similarly maintain the previous variable.
> 2. I am storing time stamp along with the images. On clicking next, I load
> the image having the most recent time stamp after this image. but still I
> dont like this query as this may be slow.

Why don't you add a status field on your image table and set it to
true if the image is valid when you add it? Then just look in the db
for the next/previous valid image. Incidentally that's just pagination
with a "show" of 1.

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



Re: How do I bake?

2008-01-27 Thread pavbaker

Neil, Hi

If the 'cake bake' command is not working when you press the Enter
button, I suspect there is no path to where cake.bat resides.

Can you confirm that when you get to the command prompt that you have
set the path variable to include the \cake\console folder?
If you type in just 'cake', press Enter - get any action?  No - check
the path.
(type path, hit enter at the command prompt to check)
If the file cake.bat cannot be located from the command prompt folder
where you are currently, bake.php will also not be found as it resides
in \cake\console\libs

HTH
pavbaker http://pavbaker.wordpress.com/


On Jan 27, 7:33 pm, Neil <[EMAIL PROTECTED]> wrote:
> Sorry, I do not follow...From what I understand all I need to so is go
> to the command prompt and type in "cake bake". However this does not
> work.

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



Re: Database design

2008-01-27 Thread Takuo SHIONO

Hello,

I often use solution 1. I think this solution can be applied in almost 
all cases. However I have another solution. How about this:

1. add 2 fields (prev_valid_index and next_valid_index) in table.
2. update these fields in afterSave function.
3. show image with the next/previous link according to the fields.


Best Wishes,

Takuo Shiono

Novice Programmer wrote:
> Though this is less of a database question. but i am still posting it here
> since I think we can discuss the design as well.. :).
> 
> I am maintaining a adresses of images stored on my filesystem in a database.
> I have designed a system to show those images to the user. This interface
> has the next and previous button as well. When user clicks on next he goes
> to the *next valid image*. Note the difference here. I have to show only
> valid images. This means that all the images in the database are not to be
> shown. Lets consider an example. Say that my database consists of following
> images:
> 
> 1. Image1(Valid)
> 2. Image2(InValid)
> 3 Image3(Invalid)
> 4. Image4(Valid)
> 
> so when user is viewing image 1 and clicks on next he goes to image4
> directly even though image2 is stored in the next index on the database. I
> have thought of following solutions but none of them are appealing me:
> 
> 1. Maintain a variable which tells the index of next valid image. Maintain a
> variable which tells me the index of last valid image and when next valid
> image comes, update the index of the last valid image with this new image.
> Similarly maintain the previous variable.
> 2. I am storing time stamp along with the images. On clicking next, I load
> the image having the most recent time stamp after this image. but still I
> dont like this query as this may be slow.
> 
> Please help.
> 


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