RE: Check Valid

2009-10-15 Thread Dave Maharaj :: WidePixels.com

Very right!

Will give the  getNumRows() a try andsee how it goes.

Thanks again.

Dave

-Original Message-
From: John Andersen [mailto:j.andersen...@gmail.com] 
Sent: October-16-09 3:43 AM
To: CakePHP
Subject: Re: Check Valid


That may be, but it seems to me that you then are performing two queries for
each need to retrieve a record, first to ask if there is any records, and
then to ask for the records! (Maybe I am wrong
here!!)

I think that querying for the records, checking for the number retrieved,
should be the optimal way :) Then always pass the number to the view, and
let the view show some message for the user to stop messing around :D or
some kinder message like "No information found".

Enjoy,
   John

On Oct 16, 9:03 am, "Dave Maharaj :: WidePixels.com"
 wrote:
> There is another that I found.
>
> Model::hasAny
>
> Returns true if a record that meets given conditions exists.
>
> function hasAny($conditions = null) {
> return ($this->find('count', array('conditions' => $conditions,
'recursive'
> => -1)) != false);
>
> }
>
> Which I guess is pretty much the same as my validPost($id) except cleaner.
>
> public function validPost($id)
>       {
>           $valid = false;
>           $params = array(
>                         'contain' => false,
>                         'conditions' => array(
>                                 'Post.id' => $id),
>                         'fields' => array(
>                                 'Post.id'));
>
>           $q = $this->find('first', $params);
>
>           if (!empty($q)) {
>               $valid = true;
>           }
>           return $valid;
>       }
>
> Dave
>
> -Original Message-
> From: John Andersen [mailto:j.andersen...@gmail.com]
> Sent: October-16-09 2:57 AM
> To: CakePHP
> Subject: Re: Check Valid
>
> I think you can use the models method getNumRows() which returns the 
> number of rows returned in the last query!
> Enjoy,
>    John
>
> On Oct 16, 12:19 am, "Dave Maharaj :: WidePixels.com"
>  wrote:
> > If you have posts 1, 2, and 3 for example and you type in view/4 and 
> > there is no 4 the page still renders but it has no data. How can you 
> > prevent this ?
>
> > I have
>
> > if ($this->Post->validPost($id) == true) {
>
> > which checks the DB for that id if found then do as normal
>
> > } else {
>
> > return them back to index
>
> > }
>
> > Is there an easier way to do that that i over looked?
>
> > Thanks,
>
> > Dave



--~--~-~--~~~---~--~~
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: Check Valid

2009-10-15 Thread John Andersen

That may be, but it seems to me that you then are performing two
queries for each need to retrieve a record, first to ask if there is
any records, and then to ask for the records! (Maybe I am wrong
here!!)

I think that querying for the records, checking for the number
retrieved, should be the optimal way :) Then always pass the number to
the view, and let the view show some message for the user to stop
messing around :D or some kinder message like "No information found".

Enjoy,
   John

On Oct 16, 9:03 am, "Dave Maharaj :: WidePixels.com"
 wrote:
> There is another that I found.
>
> Model::hasAny
>
> Returns true if a record that meets given conditions exists.
>
> function hasAny($conditions = null) {
> return ($this->find('count', array('conditions' => $conditions, 'recursive'
> => -1)) != false);
>
> }
>
> Which I guess is pretty much the same as my validPost($id) except cleaner.
>
> public function validPost($id)
>       {
>           $valid = false;
>           $params = array(
>                         'contain' => false,
>                         'conditions' => array(
>                                 'Post.id' => $id),
>                         'fields' => array(
>                                 'Post.id'));
>
>           $q = $this->find('first', $params);
>
>           if (!empty($q)) {
>               $valid = true;
>           }
>           return $valid;
>       }
>
> Dave
>
> -Original Message-
> From: John Andersen [mailto:j.andersen...@gmail.com]
> Sent: October-16-09 2:57 AM
> To: CakePHP
> Subject: Re: Check Valid
>
> I think you can use the models method getNumRows() which returns the number
> of rows returned in the last query!
> Enjoy,
>    John
>
> On Oct 16, 12:19 am, "Dave Maharaj :: WidePixels.com"
>  wrote:
> > If you have posts 1, 2, and 3 for example and you type in view/4 and
> > there is no 4 the page still renders but it has no data. How can you
> > prevent this ?
>
> > I have
>
> > if ($this->Post->validPost($id) == true) {
>
> > which checks the DB for that id if found then do as normal
>
> > } else {
>
> > return them back to index
>
> > }
>
> > Is there an easier way to do that that i over looked?
>
> > Thanks,
>
> > Dave
--~--~-~--~~~---~--~~
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: Check Valid

2009-10-15 Thread Dave Maharaj :: WidePixels.com

There is another that I found.

Model::hasAny

Returns true if a record that meets given conditions exists.

function hasAny($conditions = null) {
return ($this->find('count', array('conditions' => $conditions, 'recursive'
=> -1)) != false);
}

Which I guess is pretty much the same as my validPost($id) except cleaner.

public function validPost($id)
  {
  $valid = false;
  $params = array(
'contain' => false,
'conditions' => array(
'Post.id' => $id),
'fields' => array(
'Post.id'));

  $q = $this->find('first', $params);

  if (!empty($q)) {
  $valid = true;
  }
  return $valid;
  }

Dave

-Original Message-
From: John Andersen [mailto:j.andersen...@gmail.com] 
Sent: October-16-09 2:57 AM
To: CakePHP
Subject: Re: Check Valid


I think you can use the models method getNumRows() which returns the number
of rows returned in the last query!
Enjoy,
   John

On Oct 16, 12:19 am, "Dave Maharaj :: WidePixels.com"
 wrote:
> If you have posts 1, 2, and 3 for example and you type in view/4 and 
> there is no 4 the page still renders but it has no data. How can you 
> prevent this ?
>
> I have
>
> if ($this->Post->validPost($id) == true) {
>
> which checks the DB for that id if found then do as normal
>
> } else {
>
> return them back to index
>
> }
>
> Is there an easier way to do that that i over looked?
>
> Thanks,
>
> Dave



--~--~-~--~~~---~--~~
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: RequestHandler component thinks Google Chromium isAjax

2009-10-15 Thread robustsolution

Dear Dave,

Let me tell you that I am convinced that isAjax() is something fake
and falsified (it is just a client side input) and it is not a
standard yet, I am talking about the 'X-Requested-With' header.

I would create a custom controller for the ajax requests or a custm
action in a certain controller, and without cheking I use it as
ajax ... layout ajax etc...

This is my approach for the moment

On Oct 16, 2:03 am, Dave  wrote:
> Hi everyone,
>
>     I am just seeing if anyone else has run into this problem before
> attempting to report it as a bug.
>
>     Basically when I navigate to my site which uses the Request
> Handler
> component to switch to a blank layout for ajax requests
> (automagically),
> using the Google Chromium version 4.0.220.0 browser, I receive a blank
> layout.  I assume this is because the RequestHandler is
> misinterpreting
> the user-agent string, but I really don't know I am pretty new to
> this.
>
> Thanks everyone,
>
> Dave
>
> ps.  In case people aren't familiar Google Chromium is a linux build
> of Google Chrome,http://code.google.com/chromium/
--~--~-~--~~~---~--~~
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: beforeRender / filter

2009-10-15 Thread Dave Maharaj :: WidePixels.com

Thanks for the info guys.

Basically the idea is a User has a preference represented by a field in the
table 'display' and they can select it as an option so in the site to either
display or not display their information. Its only used in 1 controller but
will try them out and see what works best.

Thanks,

Dave  

-Original Message-
From: O.J. Tibi [mailto:ojt...@gmail.com] 
Sent: October-16-09 3:20 AM
To: CakePHP
Subject: Re: beforeRender / filter


On that point, may what you want to do is declare $display as a class member
(just inside your controller class, not inside a method/action/
callback) like so:

var $_display;

and when you need to set it:

$this->_display = $this->Auth->user('display');

Take note I used the Auth component as it is more concise and fits the
purpose of the code.
Now, if you want to get or test its value:

if ($this->_display) {
// do something here
}

Cheers,
OJ

On Oct 16, 12:55 pm, Miles J  wrote:
> You cant set a variable within a function and expect it to be usable 
> again somewhere else. Variables defined in functions are restricted to 
> the functions scope. You have to set it to the object.
>
> $this->display = $this->Session->read('Auth.User.display');
>
> On Oct 15, 8:20 pm, "Dave Maharaj :: WidePixels.com"
>
>  wrote:
> > How can i access session data in beforeRender  or before Filter?
>
> > i have $display = $this->Session->read('Auth.User.display');
>
> > and i have that all over the controller. Is there a way i can define 
> > that in a before function and access it from there instead of that 
> > long snip allover?
>
> > I tried
>
> > function beforeRender() {
>
> >    $display = $this->Session->read('Auth.User.display');
>
> >       }
>
> > or
>
> > function beforeFilter() {
>
> >    $display = $this->Session->read('Auth.User.display');
>
> >       }
>
> > and in the controller $display comes up invalid variable
>
> > Dave


--~--~-~--~~~---~--~~
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: beforeRender / filter

2009-10-15 Thread O.J. Tibi

On that point, may what you want to do is declare $display as a class
member (just inside your controller class, not inside a method/action/
callback) like so:

var $_display;

and when you need to set it:

$this->_display = $this->Auth->user('display');

Take note I used the Auth component as it is more concise and fits the
purpose of the code.
Now, if you want to get or test its value:

if ($this->_display) {
// do something here
}

Cheers,
OJ

On Oct 16, 12:55 pm, Miles J  wrote:
> You cant set a variable within a function and expect it to be usable
> again somewhere else. Variables defined in functions are restricted to
> the functions scope. You have to set it to the object.
>
> $this->display = $this->Session->read('Auth.User.display');
>
> On Oct 15, 8:20 pm, "Dave Maharaj :: WidePixels.com"
>
>  wrote:
> > How can i access session data in beforeRender  or before Filter?
>
> > i have $display = $this->Session->read('Auth.User.display');
>
> > and i have that all over the controller. Is there a way i can define that in
> > a before function and access it from there instead of that long snip
> > allover?
>
> > I tried
>
> > function beforeRender() {
>
> >    $display = $this->Session->read('Auth.User.display');
>
> >       }
>
> > or
>
> > function beforeFilter() {
>
> >    $display = $this->Session->read('Auth.User.display');
>
> >       }
>
> > and in the controller $display comes up invalid variable
>
> > Dave
--~--~-~--~~~---~--~~
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: Check Valid

2009-10-15 Thread John Andersen

I think you can use the models method getNumRows() which returns the
number of rows returned in the last query!
Enjoy,
   John

On Oct 16, 12:19 am, "Dave Maharaj :: WidePixels.com"
 wrote:
> If you have posts 1, 2, and 3 for example and you type in view/4 and there
> is no 4 the page still renders but it has no data. How can you prevent this
> ?
>
> I have  
>
> if ($this->Post->validPost($id) == true) {
>
> which checks the DB for that id if found then do as normal
>
> } else {
>
> return them back to index
>
> }
>
> Is there an easier way to do that that i over looked?
>
> Thanks,
>
> Dave
--~--~-~--~~~---~--~~
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: Help - Can't write the SQL query in CakePHP style

2009-10-15 Thread Bert Van den Brande
Don't know if it helps but you map two sums to the same column alias
'amount' , I think you should make them unique ...

On Thu, Oct 15, 2009 at 3:13 PM, logout  wrote:

>
> Guys,
>
> I have a problem. I tried to write one SQL query useing the CakePHP
> style, but I failed. Can someone help?
>
> Here are the tree models:
>
> 1. "Currency" with fields:
>id
>name
>
> 2. "Invoice" with fields
>id
>amount
>currency_id (the FK)
>... some other fields
>
> 3. "Writedown" with fields
>id
>amount
>invoice_id (the FK)
>... some other fields
>
> The relations between these models are:
>
> Currency  hasMany   Invoice
> Invoice   hasMany   Writedown
> Invoice   belongsTo Currency
> Writedown belongsTo Invoice
>
> Now I want to get the sums of the amounts of all invoices and all
> writedowns and grouping them by the currency
>
> In the "Invoices" controller I use this query to do the job:
>
> $sums = $this->Invoice->query(
>'SELECT `Currency`.`name`, `Currency`.`id`,
> SUM(`Invoice`.`amount`)
> as amount, SUM(`Writedown`.`amount`) as wd_amount
> FROM `currencies` as `Currency`, `invoices` as
> `Invoice`,
> `writedowns` as `Writedown`
> WHERE `Invoice`.`id` = `Writedown`.`invoice_id` AND
> `Invoice`.`currency_id` = `Currency`.`id` GROUP BY `Currency`.`id`'
>);
>
> So I get this result:
>
> Array
> (
>[0] => Array
>(
>[Currency] => Array
>(
>[name] => EUR
>[id] => 1
>)
>
>[0] => Array
>(
>[amount] => 1000
>[wd_amount] => 0
>)
>
>)
>
>[1] => Array
>(
>[Currency] => Array
>(
>[name] => USD
>[id] => 2
>)
>
>[0] => Array
>(
>[amount] => 1500
>[wd_amount] => 300
>)
>
>)
>
> )
>
> and it is exactly what I want.
>
> I tried to use the find('All') function:
>
>$sums = $this->Invoice->find('all', array(
>'conditions' => $invoiceConditions,
>'fields'=>array('Currency.name',
> 'SUM(Invoice.amount) as amount',
> 'SUM(Writedown.amount) as amount'),
>'group' => array('Currency.id'),
>'order' => array('Currency.id')
>)
>);
>
> (The $invoiceConditions contains some conditions for period and other
> stuff)
>
> but without any success. The error is "SQL Error: 1054: Unknown column
> 'Writedown.amount' in 'field list'"
>
> Whatever I try, it doesn't work. I can live with the query(), but I
> want to know how can I write it in the CakePHP style.
>
> I also looked at the resulting query and found that it left joins only
> the Currency model and it doesn't do anything about the Writedown
> model.
>
> If I remove the 'SUM(Writedown.amount) as amount' field, I get this
> result:
>
> Array
> (
>[0] => Array
>(
>[Currency] => Array
>(
>[name] => EUR
>[id] => 1
>)
>
>[0] => Array
>(
>[amount] => 1000
>)
>
>)
>
>[1] => Array
>(
>[Currency] => Array
>(
>[name] => USD
>[id] => 2
>)
>
>[0] => Array
>(
>[amount] => 1500
>)
>
>)
>
> )
>
> just to show you that it works at some point.
> >
>

--~--~-~--~~~---~--~~
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: beforeRender / filter

2009-10-15 Thread Miles J

You cant set a variable within a function and expect it to be usable
again somewhere else. Variables defined in functions are restricted to
the functions scope. You have to set it to the object.

$this->display = $this->Session->read('Auth.User.display');

On Oct 15, 8:20 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
> How can i access session data in beforeRender  or before Filter?
>
> i have $display = $this->Session->read('Auth.User.display');
>
> and i have that all over the controller. Is there a way i can define that in
> a before function and access it from there instead of that long snip
> allover?
>
> I tried
>
> function beforeRender() {
>
>    $display = $this->Session->read('Auth.User.display');
>
>       }
>
> or
>
> function beforeFilter() {
>
>    $display = $this->Session->read('Auth.User.display');
>
>       }
>
> and in the controller $display comes up invalid variable
>
> Dave
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



beforeRender / filter

2009-10-15 Thread Dave Maharaj :: WidePixels.com

How can i access session data in beforeRender  or before Filter?
 
i have $display = $this->Session->read('Auth.User.display');
 
and i have that all over the controller. Is there a way i can define that in
a before function and access it from there instead of that long snip
allover?
 
I tried 
 
function beforeRender() {
  
   
   $display = $this->Session->read('Auth.User.display');
   
   
  }
 
or 
 
function beforeFilter() {
  
   
   $display = $this->Session->read('Auth.User.display');
   
   
  }
 
and in the controller $display comes up invalid variable
 
 
 
Dave 


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



Can I use CakePHP ORM by itself?

2009-10-15 Thread Jon

I'm currently using symfony in many large applications but I've tried
Cake on other projects and I've loved the ORM. In this case though I'm
really interested in Cake's custom data sources because I'm using many
REST API feeds in my application. Right now all of my model work is
done on a one-off basis and I'm looking for a way to create a standard
interface to the API feeds.

Can I easily use Cake's ORM by itself as part of my symfony
application? If so, how and will that cause any issues?

Also, if Doctrine can do this or you know of another good solution,
please let me know.

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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RequestHandler component thinks Google Chromium isAjax

2009-10-15 Thread Dave

Hi everyone,

I am just seeing if anyone else has run into this problem before
attempting to report it as a bug.

Basically when I navigate to my site which uses the Request
Handler
component to switch to a blank layout for ajax requests
(automagically),
using the Google Chromium version 4.0.220.0 browser, I receive a blank
layout.  I assume this is because the RequestHandler is
misinterpreting
the user-agent string, but I really don't know I am pretty new to
this.

Thanks everyone,

Dave

ps.  In case people aren't familiar Google Chromium is a linux build
of Google Chrome, http://code.google.com/chromium/

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



Custom Router Test fails [language and named params]

2009-10-15 Thread unapersona

hi!
i'm working with language urls and everything works fine until
starting to use named params

i'd prepared this test and it fails when named params are added
http://bin.cakephp.org/saved/51531

try to make something with Router::connectNamed like
Router::connectNamed(false, array('default' => true)); or
Router::connectNamed(false);
but no solution found :(

anyone knows why?
should i create a ticket?

thanks


http://bin.cakephp.org/saved/51531

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



Authorize.net relay response

2009-10-15 Thread CoDe

Hi everyone I am doing an gateway payment  authorize.net sim method I
am getting an error on relay response url that seem an auth problem
that is not redirecting to mi site someone worked it please I hope
your help

Regards,
Jorge

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



Uploadify and lost session

2009-10-15 Thread bondo

I really hope someone can help me. I've been struggling with this
problem for a long time and can't seem to figure it out.

I'm using Uploadify to handle file uploads and while it works well,
after the file is uploaded, the session is lost. I've read all about
restarting the session and passing the session id in the scriptData
parameter but none of it has worked. As soon as I get to the
beforeFilter method in my controller, I try to restart the session but
none of the data is there. I've tried to display values using $this-
>Auth->user('id') but there isn't anything.

I've also set the security to medium and turned off the userAgent
check. I've tried every suggestion I can find and yet it won't work.
I'm using the Auth component as it is necessary to be logged in using
authentication before uploads are allowed.

Has anyone else run into this before and if so, were you able to
resolve it and how?

Thanks.
Bondo.
--~--~-~--~~~---~--~~
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: need some help with routes...

2009-10-15 Thread gimperdan...@gmail.com

Ok, this is what I have now.. and it works.. can someone just tell me
if it's the right way to do it?

Router::connect('/artist/*/album/*', array('controller' => 'albums',
'action' => 'view'));

On Oct 15, 6:20 pm, "gimperdan...@gmail.com" 
wrote:
> I am learning about routes now, I used to write my own routes on mod
> rewrites before i came to Cake, so I just need some small guidance
> since I already have some knowledge...
>
> Here's what I need to accomplish:
>
> www.myswebsite.com/artist/ARTISTNAME/album/ALBUMNAME
>
> On mod rewrite I just had to sub ARTISTNAME & ALBUNAME for two
> variables and get the values through GET... I just need to accomplish
> the same using the Router.
>
> Both ARTISTNAME and ALBUMNAME are UNIQUE fields in two separate tables.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



need some help with routes...

2009-10-15 Thread gimperdan...@gmail.com

I am learning about routes now, I used to write my own routes on mod
rewrites before i came to Cake, so I just need some small guidance
since I already have some knowledge...

Here's what I need to accomplish:

www.myswebsite.com/artist/ARTISTNAME/album/ALBUMNAME

On mod rewrite I just had to sub ARTISTNAME & ALBUNAME for two
variables and get the values through GET... I just need to accomplish
the same using the Router.

Both ARTISTNAME and ALBUMNAME are UNIQUE fields in two separate tables.
--~--~-~--~~~---~--~~
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 Valid

2009-10-15 Thread Dave Maharaj :: WidePixels.com
If you have posts 1, 2, and 3 for example and you type in view/4 and there
is no 4 the page still renders but it has no data. How can you prevent this
?
 
I have  
 
if ($this->Post->validPost($id) == true) {
 
which checks the DB for that id if found then do as normal 
 
} else {
 
return them back to index
 
}
 
Is there an easier way to do that that i over looked?
 
Thanks,
 
Dave

--~--~-~--~~~---~--~~
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: model relations: Problems to run local functions over Model relations

2009-10-15 Thread Obelix

Thanks a lot!

That's was the Problem. I had looked at it as well. But I have not
seen the difference.
Sorry.

Regards Uwe


On 15 Okt., 22:36, Miles J  wrote:
> You need to edit all your plugin models and change the associations to
> use the correct plugin name.
>
> http://book.cakephp.org/view/117/Plugin-Models
>
> Basically the last example on that page.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Question mark in named param

2009-10-15 Thread Jesus Angel

Hi!

I need to pass a question mark in a named param value:

http://mysite/resources/search/a:0/q:art%3Fculo

%3F is the result of urlencode('?)

In the dispacher:

$_GET['url'] = resources/search/a:0/q:art?culo

But in the line 419 in router.php

function parse($url) {
...
#418 if (strpos($url, '?') !== false) {
#419$url = substr($url, 0, strpos($url, '?'));
#420 }
...
}

So after this line the url is: /resources/search/a=0/q:art

It continues parsing that url to extract named params:

$params['named']['q'] = art

¿How can I pass a question mark in a named param value?

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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: jquery substitute for ajax->observeField

2009-10-15 Thread hahmadi82


You were right.  It didn't even cross my mind to look for a user written
helper.  Found one, and it works! Thanks!


Marcelo Andrade wrote:
> 
> 
> On Tue, Oct 13, 2009 at 4:28 PM, hahmadi82  wrote:
>>
>> If anyone could help with this it would be much appreciated.
> 
> I'm not a jQuery expert, but it's not so hard do accompplish that.
> I guess making the appropriate ajax call from a .onchange() event
> should do the trick.
> 
> If I'm not wrong, there's some user-made versions of ajax-helper
> to Cake1.2 that resembles the prototype to jquery.
> 
> Best regards.
> 
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105
> 
> > 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/jquery-substitute-for-ajax-%3EobserveField-tp25862887p25915771.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
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: model relations: Problems to run local functions over Model relations

2009-10-15 Thread Miles J

You need to edit all your plugin models and change the associations to
use the correct plugin name.

http://book.cakephp.org/view/117/Plugin-Models

Basically the last example on that page.
--~--~-~--~~~---~--~~
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: New to CakePHP issue loggin IP

2009-10-15 Thread Miles J

Make sure your form paths are posting to the right action.

On Oct 15, 1:05 pm, Patrick Talmadge  wrote:
> Once I added the call to the add method in the controller everything
> started working as expected. Does my register method end up calling
> the add method when saving? I ask because if the input validation
> fails the user is redirects from the register page to the add page.
>
> I was planning to remove the add method and page, will this break everything?
>
> Patrick
>
> On Wed, Oct 14, 2009 at 8:07 PM, Brett Wilton  wrote:
>
> > I haven't tried getClientIP() but I'd check that you have the field
> > name correct etc, try putting something known in.  As an alternative
> > I've used  $_SERVER['REMOTE_ADDR'] in the past which does work.
>
> > 
> >http://wiltonsoftware.com
--~--~-~--~~~---~--~~
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: gwoo Leaving CakePHP??

2009-10-15 Thread Brett Wilton

Yes thanks gwoo, thanks for your time and effort, you've made CakePHP
a better place.

--~--~-~--~~~---~--~~
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: Belongs to join table associations issue...

2009-10-15 Thread TimG

That put me on the right path.

Thanks! Good Karma for you John!
--~--~-~--~~~---~--~~
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: New to CakePHP issue loggin IP

2009-10-15 Thread Patrick Talmadge

Once I added the call to the add method in the controller everything
started working as expected. Does my register method end up calling
the add method when saving? I ask because if the input validation
fails the user is redirects from the register page to the add page.

I was planning to remove the add method and page, will this break everything?

Patrick

On Wed, Oct 14, 2009 at 8:07 PM, Brett Wilton  wrote:
>
> I haven't tried getClientIP() but I'd check that you have the field
> name correct etc, try putting something known in.  As an alternative
> I've used  $_SERVER['REMOTE_ADDR'] in the past which does work.
>
> 
> http://wiltonsoftware.com
>
> >
>

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



Failed to install GDCHART in Ubuntu 9.04

2009-10-15 Thread Abdul Rahman Riza
Dear All,

I've downloading GDChart 2.0 and extracted it. I make ./confure and make
but it seems the module can not be loaded due to following reason.

*
r...@ariza-laptop:/home/ariza/Desktop/gdchart-0.2.0/gdchart-0.2.0# make test

Build complete.
Don't forget to run 'make test'.

PHP Warning:  PHP Startup: Unable to load dynamic library
'/usr/lib/php5/20060613+lfs/gdchart.so' -
/usr/lib/php5/20060613+lfs/gdchart.so: undefined symbol: gdFontTiny in
Unknown on line 0
bogus test name tests/
r...@ariza-laptop:/home/ariza/Desktop/gdchart-0.2.0/gdchart-0.2.0#
*

Can anybody tell me what went wrong?

Tiza

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

2009-10-15 Thread Simon

yep you understood me thats i would like to try but i dont want to
restore the emails into database
is there anyway to do that



On Oct 15, 10:32 am, number9  wrote:
> Hi,
>
> I'm not sure if I have understood you correctly, but you want to share
> a post with somebody, and when you go to /posts/sharethis/22 it wont
> let you fill in the form first?
>
> Looking at your code, the E-mail will always send first because it
> appears before the code for the form. If you wanted to use the same
> action to retrieve the form details and then send the data you would
> need to use conditional statements (E.g. if the form isn't empty -
> send the E-mail).
>
> I would have one action to retrieve the details from the form and
> store them, then redirect to the sharethis action which sends out the
> E-mail from the variables given in the form.
>
> Sorry if I have misunderstood what you was trying to acheive.
>
> On Oct 15, 3:56 pm, Simon  wrote:
>
>
>
> > hi i'm creating mailto with cakephp email components to share the post
> > how do i do this with the form the have to fill out
>
> > form:
> > to:
> > comment:
>
> > then submit send that post id and the content of post  this is i did
> > so far  when i go to posts/sharethis/22 it sends email but wont let me
> > fill the form first
>
> > function sharethis($id) {
> >     $this->layout = null;
> >     $Post = $this->Post->read(null,$id);
> >     $this->Email->to =  $this->data['Post']['to'],;
> >     $this->Email->bcc = array('sec...@example.com');
> >     $this->Email->subject = 'Welcome to our really cool thing';
> >     $this->Email->replyTo = 'supp...@example.com';
> >     $this->Email->from = $this->data['Post']['from'],;
> >     $this->Email->template = 'Post'; // note no '.ctp'
> >     //Send as 'html', 'text' or 'both' (default is 'text')
> >     $this->Email->sendAs = 'html';
>
> >      $this->set('post', $this->Post->read(null, $id));
>
> >  if ( $this->Email->send() ) {
>
> >                     $this->redirect('/thankyou');
> >                         } else {
> >                                 $this->Session->setFlash(__('this could not 
> > be saved. Please, try
> > again.', true));
> >                         }
> >  }
>
> >  >                 echo $form->create('post', array('action' =>
> > 'sharethis'));
> >                 echo $form->inputs(array('legend' => false,
> >                                          'fieldset' => false,
> >                                          'from',
> >                                          'to',
> >                                          'comments' => array('row' =>
> > 10,
> >                                                              'cols' =>
> > 45,
> >                                                              ),
> >                                          ));
>
> >                                 echo $form->submit('/img/submit.gif', 
> > array('alt' =>
> > 'Submit','class' => 'image'));
> >                                 echo $form->end();
> >             ?>- 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Email

2009-10-15 Thread number9

Hi,

I'm not sure if I have understood you correctly, but you want to share
a post with somebody, and when you go to /posts/sharethis/22 it wont
let you fill in the form first?

Looking at your code, the E-mail will always send first because it
appears before the code for the form. If you wanted to use the same
action to retrieve the form details and then send the data you would
need to use conditional statements (E.g. if the form isn't empty -
send the E-mail).

I would have one action to retrieve the details from the form and
store them, then redirect to the sharethis action which sends out the
E-mail from the variables given in the form.

Sorry if I have misunderstood what you was trying to acheive.

On Oct 15, 3:56 pm, Simon  wrote:
> hi i'm creating mailto with cakephp email components to share the post
> how do i do this with the form the have to fill out
>
> form:
> to:
> comment:
>
> then submit send that post id and the content of post  this is i did
> so far  when i go to posts/sharethis/22 it sends email but wont let me
> fill the form first
>
> function sharethis($id) {
>     $this->layout = null;
>     $Post = $this->Post->read(null,$id);
>     $this->Email->to =  $this->data['Post']['to'],;
>     $this->Email->bcc = array('sec...@example.com');
>     $this->Email->subject = 'Welcome to our really cool thing';
>     $this->Email->replyTo = 'supp...@example.com';
>     $this->Email->from = $this->data['Post']['from'],;
>     $this->Email->template = 'Post'; // note no '.ctp'
>     //Send as 'html', 'text' or 'both' (default is 'text')
>     $this->Email->sendAs = 'html';
>
>      $this->set('post', $this->Post->read(null, $id));
>
>  if ( $this->Email->send() ) {
>
>                     $this->redirect('/thankyou');
>                         } else {
>                                 $this->Session->setFlash(__('this could not 
> be saved. Please, try
> again.', true));
>                         }
>  }
>
>                  echo $form->create('post', array('action' =>
> 'sharethis'));
>                 echo $form->inputs(array('legend' => false,
>                                          'fieldset' => false,
>                                          'from',
>                                          'to',
>                                          'comments' => array('row' =>
> 10,
>                                                              'cols' =>
> 45,
>                                                              ),
>                                          ));
>
>                                 echo $form->submit('/img/submit.gif', 
> array('alt' =>
> 'Submit','class' => 'image'));
>                                 echo $form->end();
>             ?>
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Webroot / .htaccess issue

2009-10-15 Thread number9

I have setup a cakephp installation so that the app, cake and webroot
folders have been moved from their default location. I have updated
the values in the /webroot/index.php and the application is working
fine, except that the webroot is not being recognised as the
public_html root.

Instead of images being displayed as www.domain.com/img/img-name.jpg,
they need a path from the public_html.

How can I set the webroot as the site root without interfering with
everything else (which is working fine). I suspect it is a mod rewrite
issue... but I'm not sure.

Here is the layout and .htaccess files:

/etc/app (contains APP folder)

/etc/app/.htaccess


RewriteEngine on
RewriteRule^$webroot/[L]
RewriteRule(.*) webroot/$1[L]
 

/etc/cake (contains CAKE folder)

/etc/cake/.htaccess


   RewriteEngine on
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]


/public_html/app/webroot (contains WEBROOT folder)

/public_html/.htaccess


RewriteEngine On
RewriteBase /~sitebase/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]


/public_html/app/webroot/.htaccess


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]



Do the .htaccess files look right? Or is this more likely to be
something to do with the webroot/index.php file?

Thanks in advance for any help - I've tried changing various things
with no joy.
--~--~-~--~~~---~--~~
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: model relations: Problems to run local functions over Model relations

2009-10-15 Thread Obelix

Hello,
in Step 9 ist the Answer for Brian's ask. CmsAppModel is generate with
'CakeBuilder'. This class is emty. Below is the complete definition
provided.  The model's were created for a plugin (CMS). The Plugin is
also generate with 'CakeBuilder' (cake bake plugin cms model)


class CmsAppModel extends AppModel {
}

class CmsFolder extends CmsAppModel {

  var $name   = 'CmsFolder';
  var $actsAs = array('Tree');
  var $displayField  = 'folder';
  var $hasMany  = array('CmsContent','CmsFile');

  function getLocalTest() {
return 'www';
  }

.


Best Regards
Uwe

On 15 Okt., 18:38, John Andersen  wrote:
> As Brian asked, does your CmsFolder model inherit from AppModel or
> something else?
> Please show the code, not write it from "faulty" memory! :)
>
> Also show the other model, if CmsFolder does not inherits from
> AppModel!
> Enjoy,
>    John
>
> On Oct 15, 7:31 pm, Obelix  wrote:
>
> > someone has another idea ?
>
> > On 14 Okt., 18:57, Obelix  wrote:
>
> > > It's a model in a plugin. The name from the plugin is CMS.  The class
> > > is defined as follows
>
> > > class CmsFolder extends CmsAppModel {
>
> > > On 14 Okt., 18:30, brian  wrote:
>
> > > > How does the model class look? It should be:
>
> > > > class CmsFolder extends AppModel {
>
> > > > Is that correct?
>
> > > > On Wed, Oct 14, 2009 at 4:55 AM, Obelix  wrote:
>
> > > > > Yes i have seen it. But i dont't know what is the Problem with the
> > > > > name Standard.
>
> > > > > I have generate the model and the Controller with 'Cake builder'. Cake
> > > > > has recognized the table and also the models and controllers. At the
> > > > > next Step i have test the naming Standard with
>
> > > > > - debug(Inflector::classify('cms_folders'));
>
> > > > > Cake tell me it's all correct (CmsFolder). How can i test the name
> > > > > definition before i create model and controller.
>
> > > > > On 14 Okt., 10:15, "Dr. Loboto"  wrote:
> > > > >> "AppModel Object" - cake did not find your model file and created
> > > > >> AppModel as Miles and Brian both already said.
>
> > > > >> On Oct 14, 2:57 am, Obelix  wrote:
>
> > > > >> > Hello,
> > > > >> > i have test if Model available and it's look like good. The
> > > > >> > Programcode
>
> > > > >> > - debug($this->CmsFile->CmsFolder);
>
> > > > >> > gives me Information about the Model 'CmsFolder'.
>
> > > > >> > AppModel Object
> > > > >> > (
> > > > >> >     [useDbConfig] => default
> > > > >> >     [useTable] => cms_folders
> > > > >> >     [displayField] => id
> > > > >> >     [id] =>
> > > > >> >     [data] => Array
> > > > >> >         (
> > > > >> >         )
>
> > > > >> >     [table] => cms_folders
> > > > >> >     [primaryKey] => id
> > > > >> >     [_schema] => Array
> > > > >> >         (
> > > > >> >       ..
>
> > > > >> > What it could be even more ?
>
> > > > >> > Regards Uwe
>
> > > > >> > On 13 Okt., 18:56, brian  wrote:
>
> > > > >> > > If Cake doesn't find the model, it uses AppModel. The latter 
> > > > >> > > does not
> > > > >> > > have a method getLocalTest().
>
> > > > >> > > On Tue, Oct 13, 2009 at 5:34 AM, Obelix  
> > > > >> > > wrote:
>
> > > > >> > > > Thanks for your Answer.
>
> > > > >> > > > I will test it in the evening.
>
> > > > >> > > > So that does not happen i generate the plugin(cms), model and
> > > > >> > > > controller with 'Cake Code Generation'.
>
> > > > >> > > > I am also surprised that the following code works
>
> > > > >> > > >  - $cmsFolders = $this->CmsFile->CmsFolder->find('list');
>
> > > > >> > > > and the other code dont works.
>
> > > > >> > > > - debug($this->CmsFile->CmsFolder->getLocalTest());
>
> > > > >> > > > In both lines, we referenced the Model (CmsFolder)
>
> > > > >> > > > Regards Uwe
>
> > > > >> > > > On 13 Okt., 01:34, Miles J  wrote:
> > > > >> > > >> That means that your model is not getting loaded, hence the 
> > > > >> > > >> custom
> > > > >> > > >> method does not exist.
>
> > > > >> > > >> Try printing out the parent object to see if the association 
> > > > >> > > >> is
> > > > >> > > >> loaded, if it is not your naming conventions are wrong.
>
> > > > >> > > >> On Oct 12, 3:47 pm, Obelix  wrote:
>
> > > > >> > > >> > Hi,
> > > > >> > > >> > if i run a local function in a other model, cake display a 
> > > > >> > > >> > Error
> > > > >> > > >> > Message:
>
> > > > >> > > >> > Warning (512): 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 'getLocalTest' at line 1 
> > > > >> > > >> > [CORE/cake/libs/
> > > > >> > > >> > model/datasources/dbo_source.php, line 525]
>
> > > > >> > > >> > The environment looks like this:
>
> > > > >> > > >> > Definition Table:
> > > > >> > > >> >   - cms_folders
> > > > >> > > >> >   - cms_files
>
> > > > >> > > >> > Definition Model:
> > > > >> > > >> >  - CmsFolder      -> hasMan

Re: gwoo Leaving CakePHP??

2009-10-15 Thread Jon Bennett

> Thanks Garett for all the good Cake. May you find joy in your life's
> new direction.

Yes, thanks Garrett for all the time and effort you put in - back when
I started with Cakephp, you were more than helpful (RdAuth + RdImage
FTW!).

All the best in the future.

j

-- 
jon bennett - www.jben.net - blog.jben.net

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



Auth component + extra variables

2009-10-15 Thread jakobjp

Hello

I have a login procedure that requires more information than just the
username and password.

Controller: "employees"
Action: "login"

Databasefields needed for login: email, password, group (because it is
possible to have the same email for different groups).

Login URL: http://mydomain.com/login/group1

When someone makes a failed login attempt, he is redirected to
http://mydomain.com/login instead of http://mydomain.com/login/group1.

How can I make the Auth component redirect the user to .../login/
group1? ("group1" is a variable, it could be anything, which is
checked against the DB)


--~--~-~--~~~---~--~~
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: model relations: Problems to run local functions over Model relations

2009-10-15 Thread John Andersen

As Brian asked, does your CmsFolder model inherit from AppModel or
something else?
Please show the code, not write it from "faulty" memory! :)

Also show the other model, if CmsFolder does not inherits from
AppModel!
Enjoy,
   John

On Oct 15, 7:31 pm, Obelix  wrote:
> someone has another idea ?
>
> On 14 Okt., 18:57, Obelix  wrote:
>
> > It's a model in a plugin. The name from the plugin is CMS.  The class
> > is defined as follows
>
> > class CmsFolder extends CmsAppModel {
>
> > On 14 Okt., 18:30, brian  wrote:
>
> > > How does the model class look? It should be:
>
> > > class CmsFolder extends AppModel {
>
> > > Is that correct?
>
> > > On Wed, Oct 14, 2009 at 4:55 AM, Obelix  wrote:
>
> > > > Yes i have seen it. But i dont't know what is the Problem with the
> > > > name Standard.
>
> > > > I have generate the model and the Controller with 'Cake builder'. Cake
> > > > has recognized the table and also the models and controllers. At the
> > > > next Step i have test the naming Standard with
>
> > > > - debug(Inflector::classify('cms_folders'));
>
> > > > Cake tell me it's all correct (CmsFolder). How can i test the name
> > > > definition before i create model and controller.
>
> > > > On 14 Okt., 10:15, "Dr. Loboto"  wrote:
> > > >> "AppModel Object" - cake did not find your model file and created
> > > >> AppModel as Miles and Brian both already said.
>
> > > >> On Oct 14, 2:57 am, Obelix  wrote:
>
> > > >> > Hello,
> > > >> > i have test if Model available and it's look like good. The
> > > >> > Programcode
>
> > > >> > - debug($this->CmsFile->CmsFolder);
>
> > > >> > gives me Information about the Model 'CmsFolder'.
>
> > > >> > AppModel Object
> > > >> > (
> > > >> >     [useDbConfig] => default
> > > >> >     [useTable] => cms_folders
> > > >> >     [displayField] => id
> > > >> >     [id] =>
> > > >> >     [data] => Array
> > > >> >         (
> > > >> >         )
>
> > > >> >     [table] => cms_folders
> > > >> >     [primaryKey] => id
> > > >> >     [_schema] => Array
> > > >> >         (
> > > >> >       ..
>
> > > >> > What it could be even more ?
>
> > > >> > Regards Uwe
>
> > > >> > On 13 Okt., 18:56, brian  wrote:
>
> > > >> > > If Cake doesn't find the model, it uses AppModel. The latter does 
> > > >> > > not
> > > >> > > have a method getLocalTest().
>
> > > >> > > On Tue, Oct 13, 2009 at 5:34 AM, Obelix  wrote:
>
> > > >> > > > Thanks for your Answer.
>
> > > >> > > > I will test it in the evening.
>
> > > >> > > > So that does not happen i generate the plugin(cms), model and
> > > >> > > > controller with 'Cake Code Generation'.
>
> > > >> > > > I am also surprised that the following code works
>
> > > >> > > >  - $cmsFolders = $this->CmsFile->CmsFolder->find('list');
>
> > > >> > > > and the other code dont works.
>
> > > >> > > > - debug($this->CmsFile->CmsFolder->getLocalTest());
>
> > > >> > > > In both lines, we referenced the Model (CmsFolder)
>
> > > >> > > > Regards Uwe
>
> > > >> > > > On 13 Okt., 01:34, Miles J  wrote:
> > > >> > > >> That means that your model is not getting loaded, hence the 
> > > >> > > >> custom
> > > >> > > >> method does not exist.
>
> > > >> > > >> Try printing out the parent object to see if the association is
> > > >> > > >> loaded, if it is not your naming conventions are wrong.
>
> > > >> > > >> On Oct 12, 3:47 pm, Obelix  wrote:
>
> > > >> > > >> > Hi,
> > > >> > > >> > if i run a local function in a other model, cake display a 
> > > >> > > >> > Error
> > > >> > > >> > Message:
>
> > > >> > > >> > Warning (512): 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 'getLocalTest' at line 1 
> > > >> > > >> > [CORE/cake/libs/
> > > >> > > >> > model/datasources/dbo_source.php, line 525]
>
> > > >> > > >> > The environment looks like this:
>
> > > >> > > >> > Definition Table:
> > > >> > > >> >   - cms_folders
> > > >> > > >> >   - cms_files
>
> > > >> > > >> > Definition Model:
> > > >> > > >> >  - CmsFolder      -> hasMany   (CmsFile)        the Filename 
> > > >> > > >> > is
> > > >> > > >> > 'cms_folder.php'
> > > >> > > >> >  - CmsFile           -> belongsTo (CmsFolder)   the Filename 
> > > >> > > >> > is
> > > >> > > >> > 'cms_file.php'
>
> > > >> > > >> > Definition Controller:
> > > >> > > >> >  - CmsFolders                                                 
> > > >> > > >> > the
> > > >> > > >> > Filename is 'cms_folders_controller.php'
> > > >> > > >> >  - CmsFiles                                                   
> > > >> > > >> >    the
> > > >> > > >> > Filename is 'cms_files_controller.php'
>
> > > >> > > >> > In the Model 'CmsFolder' i define a dummy function:
>
> > > >> > > >> >   function getLocalTest() {
> > > >> > > >> >     return 'www';
> > > >> > > >> >   }
>
> > > >> > > >> > I want run the function 'getLocalTest()' in the action 'add' 
> > > >> >

Re: model relations: Problems to run local functions over Model relations

2009-10-15 Thread Obelix

someone has another idea ?

On 14 Okt., 18:57, Obelix  wrote:
> It's a model in a plugin. The name from the plugin is CMS.  The class
> is defined as follows
>
> class CmsFolder extends CmsAppModel {
>
> On 14 Okt., 18:30, brian  wrote:
>
> > How does the model class look? It should be:
>
> > class CmsFolder extends AppModel {
>
> > Is that correct?
>
> > On Wed, Oct 14, 2009 at 4:55 AM, Obelix  wrote:
>
> > > Yes i have seen it. But i dont't know what is the Problem with the
> > > name Standard.
>
> > > I have generate the model and the Controller with 'Cake builder'. Cake
> > > has recognized the table and also the models and controllers. At the
> > > next Step i have test the naming Standard with
>
> > > - debug(Inflector::classify('cms_folders'));
>
> > > Cake tell me it's all correct (CmsFolder). How can i test the name
> > > definition before i create model and controller.
>
> > > On 14 Okt., 10:15, "Dr. Loboto"  wrote:
> > >> "AppModel Object" - cake did not find your model file and created
> > >> AppModel as Miles and Brian both already said.
>
> > >> On Oct 14, 2:57 am, Obelix  wrote:
>
> > >> > Hello,
> > >> > i have test if Model available and it's look like good. The
> > >> > Programcode
>
> > >> > - debug($this->CmsFile->CmsFolder);
>
> > >> > gives me Information about the Model 'CmsFolder'.
>
> > >> > AppModel Object
> > >> > (
> > >> >     [useDbConfig] => default
> > >> >     [useTable] => cms_folders
> > >> >     [displayField] => id
> > >> >     [id] =>
> > >> >     [data] => Array
> > >> >         (
> > >> >         )
>
> > >> >     [table] => cms_folders
> > >> >     [primaryKey] => id
> > >> >     [_schema] => Array
> > >> >         (
> > >> >       ..
>
> > >> > What it could be even more ?
>
> > >> > Regards Uwe
>
> > >> > On 13 Okt., 18:56, brian  wrote:
>
> > >> > > If Cake doesn't find the model, it uses AppModel. The latter does not
> > >> > > have a method getLocalTest().
>
> > >> > > On Tue, Oct 13, 2009 at 5:34 AM, Obelix  wrote:
>
> > >> > > > Thanks for your Answer.
>
> > >> > > > I will test it in the evening.
>
> > >> > > > So that does not happen i generate the plugin(cms), model and
> > >> > > > controller with 'Cake Code Generation'.
>
> > >> > > > I am also surprised that the following code works
>
> > >> > > >  - $cmsFolders = $this->CmsFile->CmsFolder->find('list');
>
> > >> > > > and the other code dont works.
>
> > >> > > > - debug($this->CmsFile->CmsFolder->getLocalTest());
>
> > >> > > > In both lines, we referenced the Model (CmsFolder)
>
> > >> > > > Regards Uwe
>
> > >> > > > On 13 Okt., 01:34, Miles J  wrote:
> > >> > > >> That means that your model is not getting loaded, hence the custom
> > >> > > >> method does not exist.
>
> > >> > > >> Try printing out the parent object to see if the association is
> > >> > > >> loaded, if it is not your naming conventions are wrong.
>
> > >> > > >> On Oct 12, 3:47 pm, Obelix  wrote:
>
> > >> > > >> > Hi,
> > >> > > >> > if i run a local function in a other model, cake display a Error
> > >> > > >> > Message:
>
> > >> > > >> > Warning (512): 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 'getLocalTest' at line 1 
> > >> > > >> > [CORE/cake/libs/
> > >> > > >> > model/datasources/dbo_source.php, line 525]
>
> > >> > > >> > The environment looks like this:
>
> > >> > > >> > Definition Table:
> > >> > > >> >   - cms_folders
> > >> > > >> >   - cms_files
>
> > >> > > >> > Definition Model:
> > >> > > >> >  - CmsFolder      -> hasMany   (CmsFile)        the Filename is
> > >> > > >> > 'cms_folder.php'
> > >> > > >> >  - CmsFile           -> belongsTo (CmsFolder)   the Filename is
> > >> > > >> > 'cms_file.php'
>
> > >> > > >> > Definition Controller:
> > >> > > >> >  - CmsFolders                                                 
> > >> > > >> > the
> > >> > > >> > Filename is 'cms_folders_controller.php'
> > >> > > >> >  - CmsFiles                                                     
> > >> > > >> >  the
> > >> > > >> > Filename is 'cms_files_controller.php'
>
> > >> > > >> > In the Model 'CmsFolder' i define a dummy function:
>
> > >> > > >> >   function getLocalTest() {
> > >> > > >> >     return 'www';
> > >> > > >> >   }
>
> > >> > > >> > I want run the function 'getLocalTest()' in the action 'add' in 
> > >> > > >> > the
> > >> > > >> > controller 'CmsFilesController'. The Code looks like this.
>
> > >> > > >> > - debug($this->CmsFile->CmsFolder->getLocalTest());
>
> > >> > > >> > If this line is running, the error message is displayed. But 
> > >> > > >> > when i
> > >> > > >> > run the following function, its all ok.
>
> > >> > > >> > - $cmsFolders = $this->CmsFile->CmsFolder->find('list');
>
> > >> > > >> > I do not know what the problem is and hope for their help.
>
> > >> > > >> > Regards Uwe
--~--~-~--~~~---~--~

Re: DESCRIBE Question

2009-10-15 Thread Miles J

DESCRIBE is only used in debug mode. Once the site goes live the
DESCRIBE results are cached.

On Oct 15, 5:34 am, John Andersen  wrote:
> If I remember correctly, just turn off debug, then the describe
> information will not be shown!
> Enjoy,
>    John
>
> On Oct 15, 2:51 pm, SuMiT KuMaR  wrote:
>
> > I have many models used in the admin. Even for the login screen it
> > describes all the models/tables. I want to restrict the DESCRIBE
> > statement on certain pages.
>
> > Can this be done?
>
> > Something like below:
> > [code]
> > (default) 38 queries took 58 ms Nr      Query   Error   Affected        
> > Num. rows       Took
> > (ms)
> > 1       DESCRIBE `admins`               9       9       3
> > 2       DESCRIBE `admin_types`          3       3       1
> > 3       DESCRIBE `sections`             4       4       1
> > 4       DESCRIBE `admins_sections`              3       3       1
> > 5       DESCRIBE `pages`                7       7       1
> > [/code]
>
> > Thanks
> > Sumit
--~--~-~--~~~---~--~~
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: Server has broken links

2009-10-15 Thread Michael Gaiser
That would be great. I am using digitalspace.net as my host if anyone else
has had luck with getting Cake to run on them.

On Thu, Oct 15, 2009 at 6:43 AM, FrederickD wrote:

>
> Same exact thing happening to me on this thread:
>
> http://groups.google.com/group/cake-php/browse_thread/thread/6e5fa3a941dce149
> .
>
> Debug is set to '2'. In my case it is not Cake that is generating the
> 404, it is goDaddy.com the shared hosting server. Nothing in the Cake
> logs. In the goDaddy.com logs it only shows the incorrect URL.
>
> A support ticket to goDaddy.com was less than helpful. Since they
> don't support CakePHP they said it was my problem. I suggested they
> consider supporting Cake to tap into the great developer community,
> instead of getting bad press. They replied with basically, 'So what.'
>
> [sigh]
>
> I will need to experiment some more today. It seems that a lot of
> traffic on this group has to do with basically the same issues when
> deploying. The articles on the Cook Book are not helping in all cases.
> I made the suggestion on my thread that a central document, perhaps on
> the pages portion of this site, be created with suggested deployment
> instructions for various shared hosting sites. If scenarios for
> directory structures were included that may help.
>
> When I get this working (not if!) I will do what I can to initiate
> that. Everyone could then contribute for their shared hosting site and
> what is working. Thoughts?
>
> On Oct 14, 8:52 am, Michael Gaiser  wrote:
> > Nope. Already went though that page and everything was set right.
> >
> > On Tue, Oct 13, 2009 at 11:30 PM, AD7six  wrote:
> >
> > > On 14 oct, 08:09, Michael Gaiser  wrote:
> > > > When I uncomment "Configure::write('App.baseUrl',
> env('SCRIPT_NAME'));"
> > > in
> > > > my core.php it seems to work but feels like a cheat. Any reason
> > > mod_rewrite
> > > > isnt working with the default setup? when I did a php info, it shows
> > > > rewrite_mod loaded.
> >
> > > Probably reason 1
> > >http://book.cakephp.org/view/37/Apache-and-mod_rewrite-and-htaccess
> >
> > > hth,
> >
> > > AD
> >
> >
> >
>

--~--~-~--~~~---~--~~
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: gwoo Leaving CakePHP??

2009-10-15 Thread Nate

Thanks to those of you who actually acknowledged Garrett's efforts.  I
can tell you that he very much appreciates all of it.

On Oct 14, 11:50 pm, "Larry E. Masters aka PhpNut" 
wrote:
> Adam,
>
> Since being informed by gwoo that he was leaving the project a couple weeks
> ago, I have stepped back into a more active role in the project.
> At this time I have not selected a new project manager but you can be
> assured the project will go on. The lead developers are as active as ever on
> the current codebase, and work on it is increasing rapidly. A change in the
> project manager position for the CakePHP project at this juncture will allow
> us to realign the team to the development roadmap, and better achieve our
> goals in terms of development and release moving forward.
>
> Look forward to what is in store with the 1.3 and 2.0 releases, more to be
> announced on these later :).
>
> --
> /**
> * @author Larry E. Masters
> * @var string $userName
> * @param string $realName
> * @returns string aka PhpNut
> * @access  public
> */
>
>
>
> On Wed, Oct 14, 2009 at 5:18 PM, Adam  wrote:
>
> > "[gwoo] resigned from the Cake Software Foundation and cakephp
> > project. Thank you all for 4 great years. Best of luck to the team and
> > community."
>
> >https://www.ohloh.net/accounts/gwoo/messages
>
> > Is this true? Any reason behind this decision? Who will step up and
> > manage this great project?
>
> > In the event it is true, Garrett you did a fantastic job! I love
> > CakePHP and thank you for your time and dedication.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Email

2009-10-15 Thread Simon

hi i'm creating mailto with cakephp email components to share the post
how do i do this with the form the have to fill out

form:
to:
comment:

then submit send that post id and the content of post  this is i did
so far  when i go to posts/sharethis/22 it sends email but wont let me
fill the form first




function sharethis($id) {
$this->layout = null;
$Post = $this->Post->read(null,$id);
$this->Email->to =  $this->data['Post']['to'],;
$this->Email->bcc = array('sec...@example.com');
$this->Email->subject = 'Welcome to our really cool thing';
$this->Email->replyTo = 'supp...@example.com';
$this->Email->from = $this->data['Post']['from'],;
$this->Email->template = 'Post'; // note no '.ctp'
//Send as 'html', 'text' or 'both' (default is 'text')
$this->Email->sendAs = 'html';

 $this->set('post', $this->Post->read(null, $id));

 if ( $this->Email->send() ) {

$this->redirect('/thankyou');
} else {
$this->Session->setFlash(__('this could not be 
saved. Please, try
again.', true));
}
 }

create('post', array('action' =>
'sharethis'));
echo $form->inputs(array('legend' => false,
 'fieldset' => false,
 'from',
 'to',
 'comments' => array('row' =>
10,
 'cols' =>
45,
 ),
 ));


echo $form->submit('/img/submit.gif', 
array('alt' =>
'Submit','class' => 'image'));
echo $form->end();
?>
--~--~-~--~~~---~--~~
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: Grouping query

2009-10-15 Thread Bryan Paddock
argh gmail hotkeys irritate me...
continuing mail...



Im trying to leave as much up to the sql server as possible and reduce the
number of separate queries I run. I could probably accomplish all of these
reports with 100's of queries all handled in the controller but that would
get progressively slower should the db fill up...

thanks!

On Thu, Oct 15, 2009 at 4:54 PM, Bryan Paddock wrote:

> Basically I'm just looking for a little finger pointing in the right
> direction...
> output of a submission - http://pastebin.com/f221f94c1
>
> I'm trying to do some reporting based on a few related model fields
>
> eg by school, by country, by category etc. each must also be grouped by all
> the years too.
>
> I'm dreading the submissions by week report...
>
> Any pointers would be great... I'm trying to leave as much up to the sq
>
>
> On Thu, Oct 15, 2009 at 4:18 PM, Bryan Paddock wrote:
>
>> Hey guys,
>> I'm trying to figure out how best to go about doing reports for my current
>> project.
>>
>> It's a website where artists upload their work and then judges make rate +
>> comment etc. My query is in the reporting section.
>>
>> The main model is the Submission model.
>>
>> Submission belongsTo Student, Category, Competition
>> Student belongsTo User, Country
>>
>> I'm trying to find out how to group by school (Student.school field). Each
>> submission is tied to the student row by a Submission.student_id field.
>>
>> ie show each unique school and how many submissions there are for that
>> school.
>>
>> Thanks,
>> Bryan
>>
>
>

--~--~-~--~~~---~--~~
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: Grouping query

2009-10-15 Thread Bryan Paddock
Basically I'm just looking for a little finger pointing in the right
direction...
output of a submission - http://pastebin.com/f221f94c1

I'm trying to do some reporting based on a few related model fields

eg by school, by country, by category etc. each must also be grouped by all
the years too.

I'm dreading the submissions by week report...

Any pointers would be great... I'm trying to leave as much up to the sq


On Thu, Oct 15, 2009 at 4:18 PM, Bryan Paddock wrote:

> Hey guys,
> I'm trying to figure out how best to go about doing reports for my current
> project.
>
> It's a website where artists upload their work and then judges make rate +
> comment etc. My query is in the reporting section.
>
> The main model is the Submission model.
>
> Submission belongsTo Student, Category, Competition
> Student belongsTo User, Country
>
> I'm trying to find out how to group by school (Student.school field). Each
> submission is tied to the student row by a Submission.student_id field.
>
> ie show each unique school and how many submissions there are for that
> school.
>
> Thanks,
> Bryan
>

--~--~-~--~~~---~--~~
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: retrieve online status of a user while logged in

2009-10-15 Thread robustsolution

remember that this issue should be on demand not every period of time.

it is better to do it usin javascript/ajax

John Andersen said the truth... the last activity time... but the 5
minutes is something too long... heheh
I do like the way
On Oct 15, 12:22 am, DigitalDude  wrote:
> Hey,
>
> that sounds nice, I think I'll give it a try and make an example of
> this.
> I think most apps use a separate Javascript-Client for these purposes,
> but
> I have to look for infos about that a little longer the next few
> weeks...
>
> Regards,
>
> DD
>
> On 13 Okt., 07:39, John Andersen  wrote:
>
>
>
> > Add a last activity time field, and update it whenever the user does
> > something on the site.
> > If the user has not done anything for 5 min, show the usersonlinestatusas 
> > away.
> > If the user has not done anything for 10 min, show the usersonlinestatusas 
> > offline.
>
> > If a user has a contact (friend) relationship with another user, and
> > the other user logs in, then using the contact relationship, add a
> > note to the user, that the other user has logged in and delete the
> > note when it has been presented.
>
> > Best wishes,
> >    John
>
> > On Oct 12, 4:07 am, DigitalDude  wrote:
>
> > > Hey,
>
> > > I need to figure out a solution for a problem. Let's say I have an app
> > > which is controlled beiAuthand ACL, so the user can log in into a
> > > system and do stuff.
>
> > > Everyone knows from several social networks or chat clients that when
> > > a user is logged in, and one or more friends areonline, too, the
> > >statusof these users is shown.
>
> > > The question is, how could I do such a thing in Cake? Is there any
> > > chance to retriebe thestatusof a user, and "flag" it so another user
> > > (which is his/her friend or so) can see that he's actually "online"?
>
> > > I think I could use a flag in the user's table like "online" with 1 or
> > > 0 as flag, and set the "online"-statusto 1 as a user logs in. But if
> > > a user does not log out, maybe because he just closes the browser,
> > > there is no way to set thestatusback to 0 so an indicator could show
> > > the user as "offline" (which means, that the field "online" would be
> > > set back to 0).
>
> > > I'm very interested in solutions for such problems, so if you have any
> > > suggestions, please let me know.
>
> > > Regards,
>
> > > DD- 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Possible bug relative to use of memcache

2009-10-15 Thread marco.rizze...@gmail.com

I have read that a method to share the session is exactly using
memcache like session_handler.
And I have to share Cake session with other web application.


On 7 Ott, 16:44, jperras  wrote:
> Memcache being used as a cache configuration and Sessions have pretty
> much nothing in common, unless you've set your session save handler
> (in app/core.php) to be cache-based, which is usually not a good idea
> unless you know what you're doing.
>
> -j.
In app/core.php I have set the session handler like php and in php.ini
I have set session_handler like memcache and in this situation I get
all problems
that I have described.


Marco



>
> On Oct 6, 5:19 pm, "marco.rizze...@gmail.com"
>
>  wrote:
> > Hi
> > I have installed memcache on my system.
> > I have setted CakePHP to use memcache.
> > I have setted the       Configure::write('Security.level', 'medium');
> > All seems to work but sometimes I lost the session. In particular I
> > note this when I do a sequence of ajax call.
> > A simple example to show this error is:
>
> > /*My Controller*/
>
> > ..
> >         function test($show=0){
> >                 if ($show==1){
> >                         $this->layout='ajax';
> >                         echo "";
> >                         
> > print_r($this->Session->read($this->Auth->sessionKey));
> >                         echo "";
> >                         die();
> >                 }
> >         }
> > ...
>
> > /*My Test View*/
> >  > echo $ajax->link(
> >     'test',
> >     array( 'controller' => 'my_controller', 'action' => 'test','1'),
> >     array(
> >         'update' => 'test_1',
> >         'after' => $ajax->remoteFunction(
> >                 array(
> >                    'url' => array(
> >                        'controller' => 'my_controller', 'action' =>
> > 'test','1'),
> >                        'update' => 'test_2',
> >                    )
> >                ),
> >         ),
> >     null,false
> > );
> > ?>
> > 
> > 
>
> > I hope someone can help me about this.
> > Many 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Sorting and grouping data is associated models

2009-10-15 Thread jburns

I have a user model, which hasMany user_profiles, each of which
belongsTo a user_data_type which belongs to a user_data_type_category.
So the array of data would look like this:

Array
(
[User] => Array
(
[id] => 1
[username] => 
[first_name] => John
[last_name] => Smith
)

[UserProfile] => Array
(
[0] => Array
(
[id] => 1
[profile_data] => 0208 123 4567
[user_data_type_id] => 1
[user_id] => 1
[UserDataType] => Array
(
[name] => Home
[user_data_type_category_id] => 1
[UserDataTypeCategory] => Array
(
[name] => Phone numbers
)
)
)
[1] => Array
(
[id] => 3
[profile_data] => some...@somewhere.co.uk
[user_data_type_id] => 2
[user_id] => 1
[UserDataType] => Array
(
[name] => Personal
[user_data_type_category_id] => 2
[UserDataTypeCategory] => Array
(
[name] => Email addresses
)
)
)
[2] => Array
(
[id] => 4
[profile_data] => 07970 123 4567
[user_data_type_id] => 3
[user_id] => 1
[UserDataType] => Array
(
[name] => Mobile
[user_data_type_category_id] => 1
[UserDataTypeCategory] => Array
(
[name] => Phone numbers
)
)
)
)
)

I want to present this on a user form, with one panel showing the name
and core stuff, and then another with the user details - effectively
their contact details. I want to group the contact details by
user_data_type_category and then order it by user_data_type. So the
output would look a little like this:

Email Addresses
-Personal
---some...@somewhere.com
Phone numbers
-Mobile
---07970 123 4567
-Home
---0208 123 4567

I am using Containable to limit the data returned, and I know I can
order within the containable model but that doesn't seem to give me
what I want as you can see from the results in the array above. The
phone numbers are separted.

How can I produce this output (effectively grouping the whole result
set by a leaf in the array), or do I have to do some looping thorugh
the results in the view?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Grouping query

2009-10-15 Thread Bryan Paddock
Hey guys,
I'm trying to figure out how best to go about doing reports for my current
project.

It's a website where artists upload their work and then judges make rate +
comment etc. My query is in the reporting section.

The main model is the Submission model.

Submission belongsTo Student, Category, Competition
Student belongsTo User, Country

I'm trying to find out how to group by school (Student.school field). Each
submission is tied to the student row by a Submission.student_id field.

ie show each unique school and how many submissions there are for that
school.

Thanks,
Bryan

--~--~-~--~~~---~--~~
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: Server has broken links

2009-10-15 Thread FrederickD

Same exact thing happening to me on this thread:
http://groups.google.com/group/cake-php/browse_thread/thread/6e5fa3a941dce149.

Debug is set to '2'. In my case it is not Cake that is generating the
404, it is goDaddy.com the shared hosting server. Nothing in the Cake
logs. In the goDaddy.com logs it only shows the incorrect URL.

A support ticket to goDaddy.com was less than helpful. Since they
don't support CakePHP they said it was my problem. I suggested they
consider supporting Cake to tap into the great developer community,
instead of getting bad press. They replied with basically, 'So what.'

[sigh]

I will need to experiment some more today. It seems that a lot of
traffic on this group has to do with basically the same issues when
deploying. The articles on the Cook Book are not helping in all cases.
I made the suggestion on my thread that a central document, perhaps on
the pages portion of this site, be created with suggested deployment
instructions for various shared hosting sites. If scenarios for
directory structures were included that may help.

When I get this working (not if!) I will do what I can to initiate
that. Everyone could then contribute for their shared hosting site and
what is working. Thoughts?

On Oct 14, 8:52 am, Michael Gaiser  wrote:
> Nope. Already went though that page and everything was set right.
>
> On Tue, Oct 13, 2009 at 11:30 PM, AD7six  wrote:
>
> > On 14 oct, 08:09, Michael Gaiser  wrote:
> > > When I uncomment "Configure::write('App.baseUrl', env('SCRIPT_NAME'));"
> > in
> > > my core.php it seems to work but feels like a cheat. Any reason
> > mod_rewrite
> > > isnt working with the default setup? when I did a php info, it shows
> > > rewrite_mod loaded.
>
> > Probably reason 1
> >http://book.cakephp.org/view/37/Apache-and-mod_rewrite-and-htaccess
>
> > hth,
>
> > AD
>
>
--~--~-~--~~~---~--~~
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: shopping cart

2009-10-15 Thread Bastian

You can also check out phpshop or bakesale to see how you could create
shops with cakephp

On 15 Okt., 09:01, aravind raj  wrote:
> am a new to cakephp
> can any one help to have shopping cart in my project...
>
> --
> Aravind "Think Global Act Local"
--~--~-~--~~~---~--~~
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: can someone explain me why this was changed?

2009-10-15 Thread Gonzalo Servat
On Fri, Oct 16, 2009 at 12:19 AM, Martin Radosta wrote:

>
> Check this mark-story commit:
>
>
> http://code.cakephp.org/commits/view/332f6add6a97bdf738f8d1d71106834c82a46dc7#highlight
>
> specialy this line (710):
> if (in_array($options['type'], array('date', 'datetime'))) {
>
> was changed by this line (710):
> if ($options['type'] === 'date' || $options['type'] === 'datetime') {
>

[..snip..]

Perhaps Mark made the change to check on the type? Then again, this can be
achieved by specifying 'true' as the third argument to in_array() so yeah,
not sure why the change was made (unless he didn't know about the optional
third argument to in_array())

- GS

--~--~-~--~~~---~--~~
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 do I set session.save_path?

2009-10-15 Thread number9

Thankyou very much for your reply.

I hadn't done step number 3 in the config file (it was the default php
setting) - I don't have a dedicated server so the "cake" option was
what I wanted. As soon as I changed the core file, and updated the
cache the errors disappeared

I've done some reading and learnt something new about how sessions
actually work, so it's all good!

On Oct 15, 8:55 am, "Dr. Loboto"  wrote:
> http://book.cakephp.org/view/44/CakePHP-Core-Configuration-Variables
>
> For file based session you have 3 options:
> 1. Set permissions to /tmp folder that is default
> 2. Change php.ini to point to dir you have access instead of /tmp
> 3. Set Configure::write('Session.save', 'cake') and have them in cake
> app/tmp where you can manage permissions definitely.
>
> On Oct 15, 8:12 am, number9  wrote:
>
>
>
> > OK - I have managed to find this value, but I have no idea what to set
> > it to.
>
> > I have moved the TMP folder into the webroot - but "WEBROOT . TMP /
> > settings/" doesn't seem to be working?
>
> > On Oct 15, 1:58 am, number9  wrote:
>
> > > Hi,
>
> > > I've setup an install so the cake and app folder are in the /etc/
> > > folder and the webroot/tmp/config folders are in the webroot (so many
> > > sites can share the same codebase).
>
> > > I'm getting the following errors however:
>
> > > Warning (2): session_start() [function.session-start]: open(/tmp/
> > > sess_0da65f3698c6c25541f21b127669dccc, O_RDWR) failed: Permission
> > > denied (13) [CORE/cake/libs/session.php, line 539]
>
> > > Warning (2): session_start() [function.session-start]: Cannot send
> > > session cache limiter - headers already sent (output started at /home/
> > > site/etc/cake/basics.php:111) [CORE/cake/libs/session.php, line 539]
>
> > > Warning (2): Unknown: open(/tmp/sess_0da65f3698c6c25541f21b127669dccc,
> > > O_RDWR) failed: Permission denied (13) [Unknown, line ??]
>
> > > Warning (2): Unknown: Failed to write session data (files). Please
> > > verify that the current setting of session.save_path is correct ()
> > > [Unknown, line ??]
>
> > > I'm guessing to fix it I need to adjust the session.save_path so that
> > > it points to the new tmp folder? Where can I update this?
>
> > > If not, can anybody suggest a fix? The sessions folder is set to 755
> > > so it should be writeable (I also tried 777). I have searched but
> > > nothing has worked.
>
> > > Thanks in advance
--~--~-~--~~~---~--~~
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: shopping cart

2009-10-15 Thread Céryl

As it turns out, just today I'm working on a shopping cart!

It's far from finished and rather specific for my needs, no payment or
anything, people just press "add to cart" in a list of products and
can check their cart in another view. There they get an ordernumber
and the account number and get the delivery when money is transferred
via regular bank transfer.

In general I added an addtocart($id) function to my
products_controller, which stores info on the product with id $id from
the database in a Cookie (which lasts for an hour), and increments a
counter so you can keep adding products. An added view called viewcart
gets all the products-info out of the cart (Cookie) with a for-loop
and displays it. From that view people can send the list via e-mail to
me and get payment info, This screen also holds a "clear Cart" button
that destroys the cookie.

I plan to add the orders to my database too for reference at a later
date.

I know you're new and this probably makes no sense now, but hopefully
at a later state it can help. Anybody else reading this, is this a
good way of going about is, or are there better ideas?




On 15 okt, 09:01, aravind raj  wrote:
> am a new to cakephp
> can any one help to have shopping cart in my project...
>
> --
> Aravind "Think Global Act Local"
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



can someone explain me why this was changed?

2009-10-15 Thread Martin Radosta

Check this mark-story commit:

http://code.cakephp.org/commits/view/332f6add6a97bdf738f8d1d71106834c82a46dc7#highlight

specialy this line (710):
if (in_array($options['type'], array('date', 'datetime'))) {

was changed by this line (710):
if ($options['type'] === 'date' || $options['type'] === 'datetime') {


I can remember a post (nate's post I think, but not sure) recommending 
the use of in_array because of code maintainability and readability, 
which make sence to me.

The only argument (I can imagine) against this approach is performance. 
But the Micro-optimization kind ( 
http://code.cakephp.org/tickets/view/170#c428 )

Is there any other reason?

Thanks

MARTIN






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



Help - Can't write the SQL query in CakePHP style

2009-10-15 Thread logout

Guys,

I have a problem. I tried to write one SQL query useing the CakePHP
style, but I failed. Can someone help?

Here are the tree models:

1. "Currency" with fields:
id
name

2. "Invoice" with fields
id
amount
currency_id (the FK)
... some other fields

3. "Writedown" with fields
id
amount
invoice_id (the FK)
... some other fields

The relations between these models are:

Currency  hasMany   Invoice
Invoice   hasMany   Writedown
Invoice   belongsTo Currency
Writedown belongsTo Invoice

Now I want to get the sums of the amounts of all invoices and all
writedowns and grouping them by the currency

In the "Invoices" controller I use this query to do the job:

$sums = $this->Invoice->query(
'SELECT `Currency`.`name`, `Currency`.`id`, 
SUM(`Invoice`.`amount`)
as amount, SUM(`Writedown`.`amount`) as wd_amount
 FROM `currencies` as `Currency`, `invoices` as 
`Invoice`,
`writedowns` as `Writedown`
 WHERE `Invoice`.`id` = `Writedown`.`invoice_id` AND
`Invoice`.`currency_id` = `Currency`.`id` GROUP BY `Currency`.`id`'
);

So I get this result:

Array
(
[0] => Array
(
[Currency] => Array
(
[name] => EUR
[id] => 1
)

[0] => Array
(
[amount] => 1000
[wd_amount] => 0
)

)

[1] => Array
(
[Currency] => Array
(
[name] => USD
[id] => 2
)

[0] => Array
(
[amount] => 1500
[wd_amount] => 300
)

)

)

and it is exactly what I want.

I tried to use the find('All') function:

$sums = $this->Invoice->find('all', array(
'conditions' => $invoiceConditions,
'fields'=>array('Currency.name', 'SUM(Invoice.amount) 
as amount',
'SUM(Writedown.amount) as amount'),
'group' => array('Currency.id'),
'order' => array('Currency.id')
)
);

(The $invoiceConditions contains some conditions for period and other
stuff)

but without any success. The error is "SQL Error: 1054: Unknown column
'Writedown.amount' in 'field list'"

Whatever I try, it doesn't work. I can live with the query(), but I
want to know how can I write it in the CakePHP style.

I also looked at the resulting query and found that it left joins only
the Currency model and it doesn't do anything about the Writedown
model.

If I remove the 'SUM(Writedown.amount) as amount' field, I get this
result:

Array
(
[0] => Array
(
[Currency] => Array
(
[name] => EUR
[id] => 1
)

[0] => Array
(
[amount] => 1000
)

)

[1] => Array
(
[Currency] => Array
(
[name] => USD
[id] => 2
)

[0] => Array
(
[amount] => 1500
)

)

)

just to show you that it works at some point.
--~--~-~--~~~---~--~~
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: DESCRIBE Question

2009-10-15 Thread John Andersen

If I remember correctly, just turn off debug, then the describe
information will not be shown!
Enjoy,
   John

On Oct 15, 2:51 pm, SuMiT KuMaR  wrote:
> I have many models used in the admin. Even for the login screen it
> describes all the models/tables. I want to restrict the DESCRIBE
> statement on certain pages.
>
> Can this be done?
>
> Something like below:
> [code]
> (default) 38 queries took 58 ms Nr      Query   Error   Affected        Num. 
> rows       Took
> (ms)
> 1       DESCRIBE `admins`               9       9       3
> 2       DESCRIBE `admin_types`          3       3       1
> 3       DESCRIBE `sections`             4       4       1
> 4       DESCRIBE `admins_sections`              3       3       1
> 5       DESCRIBE `pages`                7       7       1
> [/code]
>
> Thanks
> Sumit
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



DESCRIBE Question

2009-10-15 Thread SuMiT KuMaR

I have many models used in the admin. Even for the login screen it
describes all the models/tables. I want to restrict the DESCRIBE
statement on certain pages.

Can this be done?

Something like below:
[code]
(default) 38 queries took 58 ms Nr  Query   Error   AffectedNum. 
rows   Took
(ms)
1   DESCRIBE `admins`   9   9   3
2   DESCRIBE `admin_types`  3   3   1
3   DESCRIBE `sections` 4   4   1
4   DESCRIBE `admins_sections`  3   3   1
5   DESCRIBE `pages`7   7   1
[/code]

Thanks
Sumit

--~--~-~--~~~---~--~~
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 I can integrate cakephp into Joomla.

2009-10-15 Thread keymaster

> Please tell what the benefit of this is?

A better benefit might be to build a bridging component to the
hundreds of Joomla templates (without using the Joomla CMS codebase).

Other than the great looking templates, once I got involved with cake,
I didn't see much benefit to Joomla anymore. Very few of the Joomla
extensions are really of commercial value to a developer.



--~--~-~--~~~---~--~~
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: about cake php layout

2009-10-15 Thread robustsolution

Dear Lan
Always think like this on the client side

HTML/layout in for structuring
CSS is for styling/representing
Javascript is for behaving

cake comes with a default layout for html/php pages it is called
default.ctp and it is located in the cakefolder\cake\libs\view\layouts
the first thing you have to do is to copy it to your cakefolder\app
\views\layouts and edit it.

whay it is called 'default', because cake autodetects it, if cake
dosent find it in the cakefolder\app\libs\view\layoutsit will try to
detect it in the cakefolder\cake\libs\view\layouts

In general we stick to this convention 'default.ctp', but at any time
you can create a new layout in the cakefolder\app\views\layouts called
for example 'default2.ctp', but cake will not autodetect it as it did
with default.ctp layout, so you have to do it explicitly from the
controller by doing like this
$this->layout='default2';

I general (but not always) one page layout has one and only one css
stylesheet, stick to this convention also, the conventions of cake are
exactly what should every one of us think.

this was an intro, for more info, read the cookbook


On Oct 15, 11:26 am, lan  wrote:
> Sir i want  add my own style to cake php.So please give an idea about
> this.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



what is the tentative availability date roadmap of CakePHP 1.3 ?

2009-10-15 Thread Jiru

Hai, Developers ,

What is the tentative availability date roadmap of CakePHP 1.3 ?

regards,
 jiru
--~--~-~--~~~---~--~~
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 create a gettext-catalogue on Windows??

2009-10-15 Thread Kau-Boy

You can use the cake shell but as you are using Poedit, there's a very
easy solution only using Poedit.

- Open Poedit and choose File -> New catalog...
- Give some project infos "Project Info" Tab.
- Choose a language you want to translate to
- Choose the right "Charset" and "Source code charset"
- Define a plural form e.g. for German use "nplurals=2; plural=(n !=
1)" (more plural forms can be found here: 
http://translate.sourceforge.net/wiki/l10n/pluralforms)
- Go to the "Paths" Tab and click on the "New Item" Icon (second item
from left in the lower section)
- As the new Part enter "." (only a dot)
- In the "Base Path" enter the path to your source code files e.g. "C:
\xampp\htdocs\cakephp\app"
- In the "Keywords" Tab you can define custom gettext functions. Add
the commom function names "__", "__n", "__d", "__dn", "__dcn" and
"__c" (all with two leading underscores)
- Save the settings with a click on "OK"
- Choose Catalog -> Update from sources

Now Poedit will parse all files and extracts the found strings.
Everytime you change something inside your sources that needs to
update the .po file, just open Poedit and "Update from sources" again.
Choosing Catalog -> Settings allows you to change the settings to
the .po file.

Regards,
Kau-Boy



On 14 Okt., 23:31, DigitalDude  wrote:
> Hey,
>
> I'm using the gettext-method in my app to make it multilingual. For
> the catalogue, I installed PoEdit on my Windows XP machine. That's not
> such a big problem, as I can open a catalogue file and edit it.
>
> But how can I let cake build up a catalogue on my XP machine? There is
> a way, I know that because a friend of mine did this all the time, but
> he's gone for a long time and I cannot communicate with him, so I hope
> someone here has a simple and easy to use solution for me :)
>
> Regards,
>
> DD
--~--~-~--~~~---~--~~
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: Still no answer on how to do this...

2009-10-15 Thread robustsolution

Dear Kyte

sorry for the delay, I forgot!

Solution

just add this code in the beginning of the app\config\routes.php file
$singleton_router =& Router::getInstance();
if(!in_array('q',$singleton_router->named['default']))
$singleton_router->named['default'][]='q';

the problem is that the default named parameters in CakePHP routing
are
'page', 'fields', 'order', 'limit', 'recursive', 'sort', 'direction',
'step'

that's why we need to add this 'q' named parameter otherwise cakePHP
will not detect the route you have defined

have a nice baking day

On Oct 11, 12:34 am, Kyle Decot  wrote:
> I'm using $html->link() not $html->url(); I don't know why I typed
> that.
>
> I don't know what you mean by the first part of your response
>
> On Oct 10, 5:29 pm, robust solution  wrote:
>
>
>
> > Dear Kyle Decot
>
> > I think whenever you define a route in the routes.php you should not
> > repeat the route parameters in every url you want to show... the
> > shortcut is enough
>
> > this is first...
>
> > secondly
>
> > ->url is for url
>
> > for hyperlink use ->link
>
> > On Oct 10, 11:21 pm, Kyle Decot  wrote:
>
> > > Can someone please help me with this? I've tried posting on here and
> > > on the IRC channel and no one can seem to figure this out...it this
> > > just not possible with cake? All I am trying to do is creating a link
> > > using reverse routing and having named params in the URL.
>
> > > On Oct 9, 10:38 pm, Kyle Decot  wrote:
>
> > > > I want to set up my website so I can have urls like:
>
> > > > sample.com/search/
> > > > sample.com/search/q:search+terms/
> > > > sample.com/search/country:us/region:oh/
> > > > ..etc..
>
> > > > I also want to be able to do reverse routing w/ my links. I have my
> > > > routes.php set up like:
>
> > > > Router::connect('/search/*', array('controller' => 'model', 'action'
> > > > => 'index'));
>
> > > > and then I print a link like:
>
> > > > echo $html->url("search",array
> > > > ("controller"=>"model","action"=>"index","q"=>"search terms go
> > > > here"));
>
> > > > but the link comes out as:
>
> > > > /model/index/q:search/
>
> > > > What am I doing wrong? I have tried to get an answer to this question
> > > > before but nobody can seem to tell me the correct way of doing this.
> > > > Any help you can give me is EXTREMELY appreciated!- Hide quoted text -
>
> > > - Show quoted text -- 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



shopping cart

2009-10-15 Thread aravind raj
am a new to cakephp
can any one help to have shopping cart in my project...

-- 
Aravind "Think Global Act Local"

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



about cake php layout

2009-10-15 Thread lan

Sir i want  add my own style to cake php.So please give an idea about
this.

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



plugins

2009-10-15 Thread aravind raj
how can a add plugins for paypal and shopping cart


-- 
Aravind "Think Global Act Local"

--~--~-~--~~~---~--~~
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: Belongs to join table associations issue...

2009-10-15 Thread John Andersen

Add the following associations:
Item hasMany ItemOrder
ItemOrder hasMany Variation
ItemOrder belongsTo Item

Enjoy,
   John

On Oct 15, 10:39 am, TimG  wrote:
> Here is what I have:
>
> Models:
> Order (HABTM with Item)
> Item (HABTM with Order)
> ItemsOrder (join table)
> Variation (belongs to ItemsOrder)
>
> Here is my issue: I can get to the Variation model through the
> ItemsOrder model if I start at the ItemsOrder model. But if I start at
> Order and go to the ItemsOrder model through the HABTM it won't
> recurse any further to the Variation model.
>
> Here is something I was trying to make work but the last condition is
> not valid:
>
> 
> ---
> 
> $this->Order->Behaviors->attach('Containable');
>
> $this->set('order', $this->Order->find('first', array(
>       'conditions' => array('Order.id' => $orderId),
>       'contain'=>array(
>             'Item' => array('fields' => array('id','title'),
>                   'ItemsOrder' => array('conditions' => array
> ('ItemsOrder.order_id' => $orderId),
>                         'Variation' => array(
>                               'conditions' => array('Variation.id' =>
> 'ItemsOrder.variation.id')
> )));
> 
> ---
> 
>
> Any ideas on how I can get these associations to work through the join
> table?
--~--~-~--~~~---~--~~
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 do I set session.save_path?

2009-10-15 Thread Dr. Loboto

http://book.cakephp.org/view/44/CakePHP-Core-Configuration-Variables

For file based session you have 3 options:
1. Set permissions to /tmp folder that is default
2. Change php.ini to point to dir you have access instead of /tmp
3. Set Configure::write('Session.save', 'cake') and have them in cake
app/tmp where you can manage permissions definitely.

On Oct 15, 8:12 am, number9  wrote:
> OK - I have managed to find this value, but I have no idea what to set
> it to.
>
> I have moved the TMP folder into the webroot - but "WEBROOT . TMP /
> settings/" doesn't seem to be working?
>
> On Oct 15, 1:58 am, number9  wrote:
>
>
>
> > Hi,
>
> > I've setup an install so the cake and app folder are in the /etc/
> > folder and the webroot/tmp/config folders are in the webroot (so many
> > sites can share the same codebase).
>
> > I'm getting the following errors however:
>
> > Warning (2): session_start() [function.session-start]: open(/tmp/
> > sess_0da65f3698c6c25541f21b127669dccc, O_RDWR) failed: Permission
> > denied (13) [CORE/cake/libs/session.php, line 539]
>
> > Warning (2): session_start() [function.session-start]: Cannot send
> > session cache limiter - headers already sent (output started at /home/
> > site/etc/cake/basics.php:111) [CORE/cake/libs/session.php, line 539]
>
> > Warning (2): Unknown: open(/tmp/sess_0da65f3698c6c25541f21b127669dccc,
> > O_RDWR) failed: Permission denied (13) [Unknown, line ??]
>
> > Warning (2): Unknown: Failed to write session data (files). Please
> > verify that the current setting of session.save_path is correct ()
> > [Unknown, line ??]
>
> > I'm guessing to fix it I need to adjust the session.save_path so that
> > it points to the new tmp folder? Where can I update this?
>
> > If not, can anybody suggest a fix? The sessions folder is set to 755
> > so it should be writeable (I also tried 777). I have searched but
> > nothing has worked.
>
> > Thanks in advance
--~--~-~--~~~---~--~~
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: Fatal error: BehaviorCollection::trigger()

2009-10-15 Thread majna

$persistModel ?

On Oct 14, 5:44 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
> Anyone seen this?
>
> The script tried to execute a method or access a property of an incomplete
> object. Please ensure that the class definition 'ValidationBehavior' of the
> object you are trying to operate on was loaded _before_ unserialize() gets
> called or provide a __autoload() function to load the class definition
>
> It suddenly appears and not sure whats causing it?
> Controller? Model? Javascript?
>
> Any ideas where to start looking
>
> Dave
--~--~-~--~~~---~--~~
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 implement multiple pagination with SAME model on a single view?

2009-10-15 Thread majna

maybe this can hlp
http://debuggable.com/posts/how-to-have-multiple-paginated-widgets-on-the-same-page-with-cakephp:48ad241e-b018-4532-a748-0ec74834cda3

On Oct 14, 1:30 pm, doze  wrote:
> Hello,
>
> Is there a way to do multiple pagination with same model on a single
> view?
>
> I know about the $options['model'] in pagination to do multiple
> paginations in single view with different models, but what about
> multiple paginations with same model.
>
> The model contains a datetime column and I'm trying to do two
> different paginated lists in the view, past events and future events.
> I cannot find a way to tell the paginator how to separate the two
> different lists.
>
> Please help!
--~--~-~--~~~---~--~~
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: Refresh page on login / out

2009-10-15 Thread robustsolution

Dear Dave,
The logoutredirect deletes the session key of the auth component not
the other session keys...

Let the logout() method delete all the session keys that you create
since you have logged in

have a nice baking day
On Oct 15, 7:58 am, "Dave Maharaj :: WidePixels.com"
 wrote:
> I have a login module on the side of each page if not logged in.
> Problem is when a user logs in or out from the home page which is the
> $this->Auth->loginRedirect and $this->Auth->logoutRedirect it still shows
> logged in or login. How can i refresh the page or something so the page
> updates correctly? If i manually refresh the page the correct look is there
> but that's not going to work in a live environment.
>
> Ideas how to fix this?
>
> Dave

On Oct 15, 7:58 am, "Dave Maharaj :: WidePixels.com"
 wrote:
> I have a login module on the side of each page if not logged in.
> Problem is when a user logs in or out from the home page which is the
> $this->Auth->loginRedirect and $this->Auth->logoutRedirect it still shows
> logged in or login. How can i refresh the page or something so the page
> updates correctly? If i manually refresh the page the correct look is there
> but that's not going to work in a live environment.
>
> Ideas how to fix this?
>
> Dave
--~--~-~--~~~---~--~~
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: Refresh page on login / out

2009-10-15 Thread Dr. Loboto

Set $this->disableCache() when referrer is login/logout?

On Oct 15, 11:58 am, "Dave Maharaj :: WidePixels.com"
 wrote:
> I have a login module on the side of each page if not logged in.
> Problem is when a user logs in or out from the home page which is the
> $this->Auth->loginRedirect and $this->Auth->logoutRedirect it still shows
> logged in or login. How can i refresh the page or something so the page
> updates correctly? If i manually refresh the page the correct look is there
> but that's not going to work in a live environment.
>
> Ideas how to fix this?
>
> Dave
--~--~-~--~~~---~--~~
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: Problem to select right value on $form->input (select) with text index

2009-10-15 Thread Dr. Loboto

You can pass fields names to find directly:

$clientes = $this->Cliente->find(
'list',
array(
'fields' => array('Cliente.codigo', 'Cliente.razaoSocial'),
'order' => array('Cliente.razaoSocial ASC')
)
);

On Oct 15, 3:41 am, "Leonardo \"Hackin\" Freire" 
wrote:
> Hi dudes,
> I'm getting a little problem when populate a select through the
> $form->input.
>
> In my controller "Contato", where i save the client_id field, I populate an
> variable calling "clientes" with this line:
>
> $clientes = $this->Cliente->find('list', array('order' =>
> array('Cliente.razaoSocial ASC')));
>
> In my view, I uses:
> input('cliente_id', array('options' => $clientes, 'label'
> => '', 'empty' => 'selecione um cliente', 'class' => 'campoform')); ?>
>
> In my "Cliente" model, I set the primayKey as "codigo" and displayName as
> "razaoSocial". The codigo field is a text field with letters and numbers.
> The variable populates ok and, in my insert action of Contato controller,
> everything is ok: the data is saved and the input field too.
>
> But, in my update action, the $form->input, that renders in a form of
> select, don't select the right value. =/
>
> Ex.: I'm saved a client_id value "J51", and in my update view this not
> select;
> Ex.: I'm saved a client_id value "290-1", and in my update view this select
> more than one single value;
>
> Somebody helps me or this is a bug/limitation from Cake ?
>
> Hug.
>
> Leonardo C. Freire
> Diretor Executivo
> +55 27 97230015
> leonardo.fre...@giran.com.brhttp://www.leohackin.com.br
>
> Giran Soluções e Ensinohttp://www.giran.com.br
--~--~-~--~~~---~--~~
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: Ajax update div, cakephp 1.2

2009-10-15 Thread Dr. Loboto

http://book.cakephp.org/view/625/link

On Oct 15, 4:13 am, hahmadi82  wrote:
> I'd like to know the same thing... How do you add something or remove
> something from a div via ajax
>
> Laburno wrote:
>
> > Hi all!
> > Could someone explain to a total noob like me, what is the best method
> > to simply update a div with ajax, using cake 1.2?
> > I wish to have a link that call a search function and update a div
> > with the results.
>
> > Thank you
>
> --
> View this message in 
> context:http://www.nabble.com/Ajax-update-div%2C-cakephp-1.2-tp11687387p25899...
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Belongs to join table associations issue...

2009-10-15 Thread TimG

Here is what I have:

Models:
Order (HABTM with Item)
Item (HABTM with Order)
ItemsOrder (join table)
Variation (belongs to ItemsOrder)

Here is my issue: I can get to the Variation model through the
ItemsOrder model if I start at the ItemsOrder model. But if I start at
Order and go to the ItemsOrder model through the HABTM it won't
recurse any further to the Variation model.

Here is something I was trying to make work but the last condition is
not valid:


---

$this->Order->Behaviors->attach('Containable');

$this->set('order', $this->Order->find('first', array(
  'conditions' => array('Order.id' => $orderId),
  'contain'=>array(
'Item' => array('fields' => array('id','title'),
  'ItemsOrder' => array('conditions' => array
('ItemsOrder.order_id' => $orderId),
'Variation' => array(
  'conditions' => array('Variation.id' =>
'ItemsOrder.variation.id')
)));

---


Any ideas on how I can get these associations to work through the join
table?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---