Re: Having trouble getting cake bake to work

2011-03-15 Thread cakebaker

try this way: /var/www/cake/app (cake is the application name)
cake bake -app /var/www/cake/app
set the project that way..and retry...!!
On Mar 15, 8:23 am, Mark Murphy  wrote:
> I've installed the latest version of CakePHP on a Ubuntu 10.10
> machine. I was able to run through a beginner tutorial just fine so I
> think my configuration is close to being correct. I can't get cake
> bake to completely work though. Below is my session. Things that look
> like anomolies are marked with '***'. I think I must have one or more
> small errors in my configuration that are manifesting when running the
> bake shell. I should mention the cake bake is replacing previous
> models, controllers and views in the app directory. Thanks!
>
> ubu...@myserver.com:~$ cd /var/www/app
> ubu...@myserver.com:/var/www/app$ ../cake/console/cake bake -app /var/
> www/app
> ***Failed loading /usr/lib/php5/20090626.so: /usr/lib/
> php5/20090626.so: cannot open shared object
>
> file: No such file or directory
>
> Welcome to CakePHP v1.3.2 Console
>
> App : app
> Path: /var/www/app
>
> Interactive Bake Shell
>
> [D]atabase Configuration
> [M]odel
> [V]iew
> [C]ontroller
> [P]roject
> [F]ixture
> [T]est case
> [Q]uit
> What would you like to Bake? (D/M/V/C/P/F/T/Q)
>
> P
> What is the full path for this app including the app directory name?
> Example:/var/www/app/myapp
> [/var/www/app/myapp] > /var/www/app
> Bake Project
> Skel Directory: /usr/share/php/cake/console/templates/skel
> Will be copied to: /var/www/app
>
> Look okay? (y/n/q)
> [y] > y
> Do you want verbose output? (y/n)
> [n] > y
>
> Created: app in /var/www/app
>
> /usr/share/php/cake/console/templates/skel/app_controller.php copied
> to
>
> /var/www/app/app_controller.php
> /usr/share/php/cake/console/templates/skel/app_model.php copied to
> /var/www/app/app_model.php
> /usr/share/php/cake/console/templates/skel/index.php copied to /var/
> www/app/index.php
> /usr/share/php/cake/console/templates/skel/.htaccess copied to /var/
> www/app/.htaccess
> /usr/share/php/cake/console/templates/skel/app_helper.php copied to /
> var/www/app/app_helper.php
>
> Creating file /var/www/app/views/pages/home.ctp
> File /var/www/app/views/pages/home.ctp exists, overwrite? (y/n/q)
> [n] > y
> Wrote /var/www/app/views/pages/home.ctp
> Welcome page created
> Random hash key created for 'Security.salt'
> Random seed created for 'Security.cipherSeed'
> ***Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in /var/
> www/app/webroot/index.php
> ***Could not set permissions on /var/www/app//tmp
> ***chmod -R 0777 /var/www/app//tmp
>
> Interactive Bake Shell
>
> [D]atabase Configuration
> [M]odel
> [V]iew
> [C]ontroller
> [P]roject
> [F]ixture
> [T]est case
> [Q]uit
>
> What would you like to Bake? (D/M/V/C/P/F/T/Q)
>
> q
> ubu...@myserver.com:/var/www/app$

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


cakephp find

2011-03-15 Thread cakebaker
I am trying to run cakephp find query for the following sql query:
$sql=select  * from books where book_username='this->$username'";

$this->Book->find('all',array('conditions'=>
array('User.username'=>'myName'),'fields'=>'Book.name','order'=>
'Book.id ASC','limit'=>10,'recursive'=>0));

what is wrong with my code?? I put this code in BookController?? Am I
right?
please suggest me
TIA

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: login page Redirection...

2010-10-20 Thread cakebaker
But how can i retrieve the results based on the user log in..
For example if A is login he must be redirected to a landing page
where he can see his own posts. not others
I can write a sql query select * fromwhere table.username =
'$username' but I am not sure how can i write this...
I am like a newbie in cake...
would you please help me..

On Oct 19, 11:32 am, Tilen Majerle  wrote:
> no, just make method in users controller called idk  eg "users_login" and
> use this for users login, and admin_login for admin logins with different
> redirection after successfull login :D
> --
> Tilen Majerlehttp://majerle.eu
>
> 2010/10/19 cakebaker 
>
> > Hi Tilen
> > Thanks for reply...
> > But Do NOT i need to have  a table called users_posts? and
> > controller,model,views for users_posts??
> > Where do i need to put users_posts?? posts model or controller??
> > thanks for help
>
> > On Oct 19, 6:34 am, Tilen Majerle  wrote:
> > > hmmmmake new method in posts section called idk users_posts($userid =
> > > null)
>
> > > and then get posts from user id
> > > --
> > > Tilen Majerlehttp://majerle.eu
>
> > > 2010/10/18 cakebaker 
>
> > > > I am trying to learn and work on cakephp FW.
> > > > I have a DB with Posts blog.
> > > > I have implemented the ACL.
> > > > I have Admin and User groups.
> > > > When an Admin (some one belongs 2 admin grp) log in he needs to be
> > > > redirected to a page where he can see all posts(belongs to all people)
> > > > This is working
> > > > I have implemented this with the following command in
> > > > users_controller.php:
> > > > function login() {
> > > > if($this->Auth->user('role')=='admin')
> > > > {
> > > > $this->redirect(array('controller'=>'posts','action' => 'index'));
> > > > }
> > > > BUT When a user (some 1 belongs to user grp - NOT ADMIN) log in he
> > > > needs to be redirected to see ( or redirect to posts page where he can
> > > > see only his posts) ONLY his posts not others..
> > > > How can I implement this>???
>
> > > > Thanks
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > others
> > > > with their CakePHP related questions.
>
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "CakePHP" group.
> > > > To post to this group, send email to cake-php@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > cake-php+unsubscr...@googlegroups.com
> > >For
> > more options, visit this group at
> > > >http://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: login page Redirection...

2010-10-19 Thread cakebaker
Hi Tilen
Thanks for reply...
But Do NOT i need to have  a table called users_posts? and
controller,model,views for users_posts??
Where do i need to put users_posts?? posts model or controller??
thanks for help

On Oct 19, 6:34 am, Tilen Majerle  wrote:
> hmmmmake new method in posts section called idk users_posts($userid =
> null)
>
> and then get posts from user id
> --
> Tilen Majerlehttp://majerle.eu
>
> 2010/10/18 cakebaker 
>
> > I am trying to learn and work on cakephp FW.
> > I have a DB with Posts blog.
> > I have implemented the ACL.
> > I have Admin and User groups.
> > When an Admin (some one belongs 2 admin grp) log in he needs to be
> > redirected to a page where he can see all posts(belongs to all people)
> > This is working
> > I have implemented this with the following command in
> > users_controller.php:
> > function login() {
> > if($this->Auth->user('role')=='admin')
> > {
> > $this->redirect(array('controller'=>'posts','action' => 'index'));
> > }
> > BUT When a user (some 1 belongs to user grp - NOT ADMIN) log in he
> > needs to be redirected to see ( or redirect to posts page where he can
> > see only his posts) ONLY his posts not others..
> > How can I implement this>???
>
> > Thanks
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


login page Redirection...

2010-10-19 Thread cakebaker
I am trying to learn and work on cakephp FW.
I have a DB with Posts blog.
I have implemented the ACL.
I have Admin and User groups.
When an Admin (some one belongs 2 admin grp) log in he needs to be
redirected to a page where he can see all posts(belongs to all people)
This is working
I have implemented this with the following command in
users_controller.php:
function login() {
if($this->Auth->user('role')=='admin')
{
$this->redirect(array('controller'=>'posts','action' => 'index'));
}
BUT When a user (some 1 belongs to user grp - NOT ADMIN) log in he
needs to be redirected to see ( or redirect to posts page where he can
see only his posts) ONLY his posts not others..
How can I implement this>???

Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: how to get last inserted ids from saveall

2010-10-14 Thread cakebaker
I am also looking for this solution. Someone post if you find it, or
i'll keep looking.
This is not for related data right? its just when inserting multiple
rows using cakephp saveAll into the same time, to return the insert_id
or primary ids of all of the rows.

On Sep 1, 6:07 am, RJ  wrote:
> I am doing a saveall to insert multiple row at once. Is there any way
> by which i can get the primary ids of all the rows inserted.
> $this->Model->getlastinsertedid() returns the id of the latest row..
>
> Any ideas?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Multiple SUM in query

2009-12-01 Thread cakebaker
Figured out what the problem was for me. I had inserted this afterFind
() function in the app Model

http://teknoid.wordpress.com/2008/09/29/dealing-with-calculated-fields-in-cakephps-find/

so that the calculated fields show up in the appropriate models when
returned, and not in an ambiguous array. However it was causing this
SUM problem if there were more than one, so i found later when reading
the comments, one of the posters had made a modification to it so that
it would return multiples:

http://teknoid.wordpress.com/2008/09/29/dealing-with-calculated-fields-in-cakephps-find/#comment-921

Solved my problem perfectly. Hope that helps someone, maybe the OP.

On Nov 30, 9:23 pm, "Dr. Loboto"  wrote:
> Just checked on cakes 1.2.5 and 1.2.4 - all fine.
>
> Query:
> $this->Test->find(
>         'all',
>         array (
>                 'fields' => array ('field3', 'SUM(field1) AS Sum1', 
> 'SUM(field2) AS
> Sum2'),
>                 'group'  => array ('field3')
>         )
> );
>
> Generated SQL:
> SELECT `Test`.`field3`, SUM(field1) AS Sum1, SUM(field2) AS Sum2 FROM
> `test` AS `Test` WHERE 1 = 1 GROUP BY field3
>
> Result:
> Array
> (
>     [0] => Array
>         (
>             [Test] => Array
>                 (
>                     [field3] => test 1
>                 )
>
>             [0] => Array
>                 (
>                     [Sum1] => 4
>                     [Sum2] => 6
>                 )
>
>         )
>
>     [1] => Array
>         (
>             [Test] => Array
>                 (
>                     [field3] => test 2
>                 )
>
>             [0] => Array
>                 (
>                     [Sum1] => 5
>                     [Sum2] => 6
>                 )
>
>         )
> )
>
> Source data:
> id      field1  field2  field3
> 1       1       2       test 1
> 2       3       4       test 1
> 3       5       6       test 2
>
> On Nov 30, 7:47 am, cakebaker  wrote:
>
> > I have this same problem happening right now. You can put other fields
> > in that are not sums and they are returned just fine, but of all the
> > SUMs you put it it only returns the first occuring one. It is bizzarr.
> > It is generating the appropriate SQL statement, because when i take
> > the SQL statement it creates from  the debugger, and run it in
> > phpmyadmin manually, it returns exactly what i need, with all the
> > appropriate sums. But for some reason it isnt returning it in cakephp.
> > Any help on this would be great.
>
> > On Nov 28, 6:48 am, Robin Marx  wrote:
>
> > > Since I can't seem to find the answer on google, nor in the docs, I
> > > hope someone here can help me.
>
> > > Whenever I try to do a query with more then 1 SUM-field in it, it will
> > > only return the first SUM-field, not the other ones in its results.
>
> > > So for instance :
>
> > > SUM( amount1 ) as amountOne, SUM( amount2 ) as amountTwo  +   group on
> > > year
>
> > > will only return amountOne as result.
>
> > > When I do :
>
> > > SUM( amount2 ) as amountTwo,  SUM( amount1 ) as amountOne  +   group
> > > on year
>
> > > it will only return amountTwo.
>
> > > Anyone got an idea why this behaviour occurs and how to fix it?
>
> > > We would be most grateful because it's quite urgent for a school
> > > project.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Multiple SUM in query

2009-11-29 Thread cakebaker
I have this same problem happening right now. You can put other fields
in that are not sums and they are returned just fine, but of all the
SUMs you put it it only returns the first occuring one. It is bizzarr.
It is generating the appropriate SQL statement, because when i take
the SQL statement it creates from  the debugger, and run it in
phpmyadmin manually, it returns exactly what i need, with all the
appropriate sums. But for some reason it isnt returning it in cakephp.
Any help on this would be great.

On Nov 28, 6:48 am, Robin Marx  wrote:
> Since I can't seem to find the answer on google, nor in the docs, I
> hope someone here can help me.
>
> Whenever I try to do a query with more then 1 SUM-field in it, it will
> only return the first SUM-field, not the other ones in its results.
>
> So for instance :
>
> SUM( amount1 ) as amountOne, SUM( amount2 ) as amountTwo  +   group on
> year
>
> will only return amountOne as result.
>
> When I do :
>
> SUM( amount2 ) as amountTwo,  SUM( amount1 ) as amountOne  +   group
> on year
>
> it will only return amountTwo.
>
> Anyone got an idea why this behaviour occurs and how to fix it?
>
> We would be most grateful because it's quite urgent for a school
> project.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Change the default fonts

2008-02-11 Thread cakeBaker

Hi I am new to cake PHP. I am trying to change the default fonts of
the texts, but I cannot find how. Can anybody help me please.

thank you in advance

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