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

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 opt

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

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 co

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.

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

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 render

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? > > He

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 :: Wide

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

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

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

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' => t

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

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 th

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

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

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 bac

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/1

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, '

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, b

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 t

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 i

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

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

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 t

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

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/

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 t

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 i

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

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.ne

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.co

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

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: > > > clas

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:

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/6e5fa3

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 bac

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

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 progressiv

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.

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

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 yo

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] =>

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, Catego

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

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

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 th

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

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

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'] === 'd

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 field

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

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

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

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

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 cak

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"

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

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 c

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 unsubscri

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

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 It

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

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 l

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

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 lo

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-

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 dude

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 si

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 ItemsOr