Re: How to use several languages in cakePHP?
http://book.cakephp.org/view/161/localization-internationalizat On May 22, 2:42 am, Margarittka [EMAIL PROTECTED] wrote: Hello! I need to write site with support of 3 languages. Differences of parts are only in files with constants. How can i realize this in optimum way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Including images within plugins?
Is it possible to provide images (and other files, such as CSS stylesheets) with a plugin, such that they are accessible via a URL in HTML (such as an IMG tag)? I'm working on a forum plugin, and I'd like it to be as easy to distribute as possible. Since I use some forum-specific images and stylesheets, I'd like to package these up in the plugin, but I'm not sure if it's possible. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Including images within plugins?
On Thu, May 22, 2008 at 12:41 PM, Matt Huggins [EMAIL PROTECTED] wrote: Is it possible to provide images (and other files, such as CSS stylesheets) with a plugin, such that they are accessible via a URL in HTML (such as an IMG tag)? I'm working on a forum plugin, and I'd like it to be as easy to distribute as possible. Since I use some forum-specific images and stylesheets, I'd like to package these up in the plugin, but I'm not sure if it's possible. Images - not possible CSS and JS - put in the vendor of plugin Tarique -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Component and models
Hi, I know this has been discussed before, but I just want it to be clarified. From within a component I like to access a Model, what would be the correct approach? App::import(Model, Modelname); $modelname = new Modelname(); maybe? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Saving NOW() in model
I use the same way as Stephen Because what if MySQL is hosted on another server than Apache/PHP ? You'll save Apache/PHP time which can be different of MySQL time (no the same meridian for instance). Of course, it's a very specific case. And my servers are time synchronised together, but some time differences appeared once or twice a year. On 22 mai, 07:47, Stephen Orr [EMAIL PROTECTED] wrote: I believe I used this method: 'last_login' = '!-NOW()' Which makes Cake stop trying to quote it. But I'm pretty sure the latest SVN revision recognises NOW() and doesn't quote it anyway. Maybe I'm confused. Steve On May 22, 2:12 am, Alex Ciobanu [EMAIL PROTECTED] wrote: Zifnab wrote: I'm trying to figure out how to implicitly make a mysql NOW() call when doing a model save...here's an example of the code: $aUserData = array( 'User' = array( 'id' = 4, 'last_login' = 'NOW()' ) ); $this-User-save( $aUserData, false, array( 'last_login' ) ); Naturally the save doesn't work, because NOW() saves as a string NOW() instead of as a mysql function NOW()How do I get it to save as a mysql function? $aUserData['User']['last_login'] = date(Y-m-d H:i:s); $this-User-save($aUserData); Not using NOW(), but does the trick. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Extra newline at beginning of files?
Check all of your models, controllers, components, helpers, behaviours, bootstrap, config for whitespace outside of the ?php ? tags. It could be at the start or end of any of those files. Make sure you don't have echo \n; jotted down somewhere. (jokes) Adam On May 22, 6:59 am, Siebren Bakker [EMAIL PROTECTED] wrote: I was trying to make an RSS feed for my site, and it kept erroring out. I've narrowed it down to the fact that for some reason, Cake is inserting a newline at the beginning of *ALL* of the files on my site, which I can see by viewing the source. I've checked both of my layouts, and neither of them have newlines in them, I've checked individual views, etc. It's inserting a newline just before my Doctype declaration, which is at the very beginning of line 1 of both of my layouts. Does anyone know what could cause this? I can post more information if that is necessary. -- In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Appending data in Session
Hello, I'm trying to save multiple data in a session (kind of like a shopping cart). The process is a user select an item using a checkbox, and then he/she submits the form. The function will write a session (called product_id). However, if I try to search for another item, and then I submit the form again, the session only holds the newest data. Can't I just do this with $this-Session-write('products', $this- data['Products']['id']); ? Is there any way I could make the products to be an array, so that I can append data to that session? Thanks for your help. Reza Muhammad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Appending data in Session
On Thu, May 22, 2008 at 3:16 PM, Reza Muhammad [EMAIL PROTECTED] wrote: Hello, I'm trying to save multiple data in a session (kind of like a shopping cart). The process is a user select an item using a checkbox, and then he/she submits the form. The function will write a session (called product_id). However, if I try to search for another item, and then I submit the form again, the session only holds the newest data. Can't I just do this with $this-Session-write('products', $this- data['Products']['id']); ? - You need to do session read and array merge for this, like $this-Session-write('products', am($this-Session-read('products'), array($this-data['Products']['id']))); Also check if products are in session before doing array merge, like if ($this-Session-check('products')) { $this-Session-write('products', am($this-Session-read('products'), array($this-data['Products']['id']))); } else { $this-Session-write('products', array($this-data['Products']['id'])); } -- Amit http://amitrb.wordpress.com/ http://coppermine-gallery.net/ http://cheesecake-photoblog.org/ http://www.sanisoft.com/blog/author/amitbadkas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What is the best way to interact with MS Access db?
I meant move the Access backend to MySql and use the existing Access applications to connect via ODBC. Pretty much what you're saying. We have tested that now, and it looks like the way to go - provided the client can wear a slight performance hit on the office systems (resulting from connecting to a remotely hosted DB) . On 21 Maig, 20:03, BrendonKoz [EMAIL PROTECTED] wrote: I'm not sure what you mean by Migrate the Access db to MySql and front that in the office with the Access clients/apps. Don't know if they'll work over the outernet.. However, using Microsoft ODBC connection, you can use Access to maintain a MySQL database. So, you could test out converting the database to MySQL and then use ODBC to connect the Access file to your MySQL server. On May 21, 10:47 am, leo [EMAIL PROTECTED] wrote: I'm just starting a new, 'simple' project. It must permit a degree of CRUD with an existing Access database, heavily endowed with expensive office apps, while offering a public internet front end. Having just finished one large project with cake (univerd.com), and also being halfway through another hosted on a stick, I'd quite like to continue the theme. I spent all morning reading up on XML SOAP and then turned up this statement: (google the sentence and you'll find the page) SOAP and WSDL are going the way of the dodo, fortunately. The enterprisey world is buzzing with REST Now I'm beginning to wonder if I'm approaching this right. At the moment we have two possible approaches...maybe three. preferred: Run the whole www show from MySql, synchronising with the Access db on a 12 or 24 hour cron. The Access db would be retained for office use. soapy: Maintain a live link between the two dbs using SOAP or other Web Services technology outside chance - depends on 3rd party cooperation: Migrate the Access db to MySql and front that in the office with the Access clients/apps. Don't know if they'll work over the outernet. Anybody have any ideas on this? A few years ago I worked on a similar project aiming to keep two dissimilar systems (a CAD and a GIS) in sync. Disaster. Walking away is not an option. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
SSL requestSecure gives blank page
Hi there, anyone know what I am doing wrong? I have SSL set up on my server, and without using the Security component, everything works fine. I can see both these URLs: http://www.carbonretirement.com/baskets/directPayment https://www.carbonretirement.com/baskets/directPayment (You won't be able to see them at the moment because the site is password protected but I could give you a password if it would help. You can in fact have a look at the certificate if it is any help by going to https//www.carbonretirement.com (it redirects to the log in page - anyway...)). I presume that to require this page is served as https://;, I have to add the following to my controller: var $components = array('Security'); function beforeFilter() { $this-Security-requireSecure('directPayment'); } But when I do, that page comes up blank (without any handy error messages). All I get is some describe queries. Have tried to strip it down to bare minimum but without luck, which makes me think i am doing something wrong. Any ideas before I carry on pullling it apart? Thanks! Michael PS. My first CakePHP site should be up pretty soon - has been cool to use cake. Cheers! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can any body help me please for tiny MCE editor issue
how do you load tiny_mce.js file? do you use JavascriptHelper like that? echo $javascript-link('tiny_mce'); I saw several questions from you these days, and many can be answered by the use of core helpers You should know that CakePHP manipulates URL (to make them pretty), and that change the way to load files/images/css/... On 22 mai, 13:52, vishal [EMAIL PROTECTED] wrote: Hi Friend, I am facing a very difficult problem, if you have any suggestion for me then plz guide me what i will do ?? actually I have placed a tiny MCE editor to add the page content for my cms. these pages shown on front end handled by admin. ther are 5 -6 pages so I have stored it in the database. when i edit the page with Id the TinyMCE editor is not shown, while in case of add it works fine. when i click on edit link this link shown in URL:http://192.168.0.60/vishal/cake_1.2.0.6311-beta/app/cmts/edit/6 the contents are shown in form of textarea not in the editor The main problem is the id...but it is mandatory for me. while in case of this URL,http://192.168.0.60/vishal/cake_1.2.0.6311-beta/app/cmts/edit it shows me the editor but not the content , what i will do the code is below for edit : script type=text/javascript tinyMCE.init({ theme : advanced, mode : textareas, plugins : safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template, // Theme options theme_advanced_buttons1 : save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect, theme_advanced_buttons2 : cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor, theme_advanced_buttons3 : tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen, theme_advanced_buttons4 : insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak, theme_advanced_toolbar_location : top, theme_advanced_toolbar_align : left, theme_advanced_statusbar_location : bottom, theme_advanced_resizing : true, convert_urls : true }); /script h1Edit Page/h1 ?php echo $form-create('Cmt', array('action' ='edit')); ? table width=90% cellpadding=0 cellspacing=0 align=center border=0 tr td width='8%' valign='top' labelPageName:/label/tdtd align='left'? echo $form-input('name',array('label'='')); ? /td /tr tr td valign='top' labelTitle:/label/tdtd ? echo $form-input('title',array('label'='')); ? /td /tr tr td valign='top' label Content:/label/td td ? echo $form-input('content', array('rows' = '15','cols'='35','label'='')); ? /td /tr tr td valign='top'label Date:/label/tdtd style='padding-left: 15px;'? echo $form-dateTime('dateadded', $dateFormat = 'DMY', $selected = null, $attributes = array(), $showEmpty = true ) ; ? /td /tr tr /table ? echo $form-end('Save Page'); ? : I am waiting for anybody replies thanks vishal --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Saving NOW() in model
It doesn't really matter whether or not you obtain the date from Apache/PHP or MySQL; as long as you are consistent. On May 22, 4:01 am, djiize [EMAIL PROTECTED] wrote: I use the same way as Stephen Because what if MySQL is hosted on another server than Apache/PHP ? You'll save Apache/PHP time which can be different of MySQL time (no the same meridian for instance). Of course, it's a very specific case. And my servers are time synchronised together, but some time differences appeared once or twice a year. On 22 mai, 07:47, Stephen Orr [EMAIL PROTECTED] wrote: I believe I used this method: 'last_login' = '!-NOW()' Which makes Cake stop trying to quote it. But I'm pretty sure the latest SVN revision recognises NOW() and doesn't quote it anyway. Maybe I'm confused. Steve On May 22, 2:12 am, Alex Ciobanu [EMAIL PROTECTED] wrote: Zifnab wrote: I'm trying to figure out how to implicitly make a mysql NOW() call when doing a model save...here's an example of the code: $aUserData = array( 'User' = array( 'id' = 4, 'last_login' = 'NOW()' ) ); $this-User-save( $aUserData, false, array( 'last_login' ) ); Naturally the save doesn't work, because NOW() saves as a string NOW() instead of as a mysql function NOW()How do I get it to save as a mysql function? $aUserData['User']['last_login'] = date(Y-m-d H:i:s); $this-User-save($aUserData); Not using NOW(), but does the trick. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: HTML Helper webroot not correct
It's documented since a long time ago: CakePHP 1.2: http://book.cakephp.org/view/32/installation CakePHP 1.1: http://manual.cakephp.org/view/308/installing-cakephp On Wed, May 21, 2008 at 10:34 AM, Joel Perras [EMAIL PROTECTED] wrote: Add the line: RewriteBase /~user/ to the .htaccess files that already exist in your cake installation. They should be found in app/.htaccess and app/webroot/.htaccess (this last one may be redundant). Assuming you haven't changed the location of any Cake folders and files, this should solve your problem. If you want to know why this is needed, you can check out http://preview.tinyurl.com/5t32yg . -Joel. On May 21, 4:26 am, Tobes [EMAIL PROTECTED] wrote: Joel, Thanks for the advice, but I am not sure what to set it to. The site is currently in folder on URLhttp://localhost/~user/cakephptest/... The images that the default layout includes are referencing tohttp://localhost/imgrather thanhttp://localhost/~user/cakephptest/img Can you advise what I need to put in the htaccess file? Thanks, Toby On May 21, 4:19 am, Joel Perras [EMAIL PROTECTED] wrote: Set a RewriteBase condition in your .htaccess files in app/.htaccess and app/webroot/.htaccess. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Saving NOW() in model
yes you're right! I care about that because we have 1 MySQL central server and several servers that request it. And we have not always full control of theses servers (apps can be coded by others teams/companies). On 22 mai, 14:16, Joel Perras [EMAIL PROTECTED] wrote: It doesn't really matter whether or not you obtain the date from Apache/PHP or MySQL; as long as you are consistent. On May 22, 4:01 am, djiize [EMAIL PROTECTED] wrote: I use the same way as Stephen Because what if MySQL is hosted on another server than Apache/PHP ? You'll save Apache/PHP time which can be different of MySQL time (no the same meridian for instance). Of course, it's a very specific case. And my servers are time synchronised together, but some time differences appeared once or twice a year. On 22 mai, 07:47, Stephen Orr [EMAIL PROTECTED] wrote: I believe I used this method: 'last_login' = '!-NOW()' Which makes Cake stop trying to quote it. But I'm pretty sure the latest SVN revision recognises NOW() and doesn't quote it anyway. Maybe I'm confused. Steve On May 22, 2:12 am, Alex Ciobanu [EMAIL PROTECTED] wrote: Zifnab wrote: I'm trying to figure out how to implicitly make a mysql NOW() call when doing a model save...here's an example of the code: $aUserData = array( 'User' = array( 'id' = 4, 'last_login' = 'NOW()' ) ); $this-User-save( $aUserData, false, array( 'last_login' ) ); Naturally the save doesn't work, because NOW() saves as a string NOW() instead of as a mysql function NOW()How do I get it to save as a mysql function? $aUserData['User']['last_login'] = date(Y-m-d H:i:s); $this-User-save($aUserData); Not using NOW(), but does the trick. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
CakePHP and Microsoft Access: Automatically create an MS Access Relationship Diagram from a CakePHP Schema
I've just posted a Microsoft Access function on our corporate blog that automatically builds the relationship diagram for linked (ODBC) CakePHP tables. I'm posting a link here in case anyone finds it useful... http://blog.futurate.com/2008/05/cakephp-and-access-sitting-in-tree.html (If linking to corporate blogs is against the posting rules for this group, please accept my apologies and delete this post) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Warnings notices with file cache - frames website
I get the following messages when using the File caching engine: Warning (2): unlink(F:\htdocs\furv08\app\tmp\cache\persistent \cake_core_object_map) [function.unlink]: No such file or directory [CORE\cake\libs\file.php, line 276] Warning (2): fopen(F:\htdocs\furv08\app\tmp\cache\persistent \cake_core_object_map) [function.fopen]: failed to open stream: No such file or directory [CORE\cake\libs\file.php, line 144] Notice (8): unserialize() [function.unserialize]: Error at offset 0 of 657 bytes [CORE\cake\libs\cache\file.php, line 179] Warning (2): touch() [function.touch]: Utime failed: No such file or directory [CORE\cake\libs\file.php, line 121] I've tried deleting the all files in the cache dir per suggestion by Chris Hartjes. After I had recreated the directories and empty files (!), it started caching again with the same errors. However the file: cake_core_object_map doesn't exist (and didn't before the delete). I've tried creating a blank cake_core_object_map, but Cake just deletes it then complains (again) that it isn't there. Aside from this, caching has speeded up the site 500%. I've had to use frames for the site (there _really_ is a good reason) and this seemed to really hit the performance. A non-framed page was loaded 3-4 times faster. The website is to be delivered on a memory stick using Server2go and for some reason all of the cake app is running slower than I would expect. phpMyAdmin loads almost instantly as do test db queries. Can anybody help with these warnings or should I just turn off debug and forget about them? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can any body help me please for tiny MCE editor issue
I found that in some cases, when using TinyMCE, Cake actually writes a fieldtype other than a textarea. I got around the problem by writing the html myself. Or you can try forcing Cake's hand by saying 'type'='textarea'. Also check what the browser says the page sourcecode is and check the js path. Leo On 22 Maig, 13:52, vishal [EMAIL PROTECTED] wrote: Hi Friend, I am facing a very difficult problem, if you have any suggestion for me then plz guide me what i will do ?? actually I have placed a tiny MCE editor to add the page content for my cms. these pages shown on front end handled by admin. ther are 5 -6 pages so I have stored it in the database. when i edit the page with Id the TinyMCE editor is not shown, while in case of add it works fine. when i click on edit link this link shown in URL:http://192.168.0.60/vishal/cake_1.2.0.6311-beta/app/cmts/edit/6 the contents are shown in form of textarea not in the editor The main problem is the id...but it is mandatory for me. while in case of this URL,http://192.168.0.60/vishal/cake_1.2.0.6311-beta/app/cmts/edit it shows me the editor but not the content , what i will do the code is below for edit : script type=text/javascript tinyMCE.init({ theme : advanced, mode : textareas, plugins : safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template, // Theme options theme_advanced_buttons1 : save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect, theme_advanced_buttons2 : cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor, theme_advanced_buttons3 : tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen, theme_advanced_buttons4 : insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak, theme_advanced_toolbar_location : top, theme_advanced_toolbar_align : left, theme_advanced_statusbar_location : bottom, theme_advanced_resizing : true, convert_urls : true }); /script h1Edit Page/h1 ?php echo $form-create('Cmt', array('action' ='edit')); ? table width=90% cellpadding=0 cellspacing=0 align=center border=0 tr td width='8%' valign='top' labelPageName:/label/tdtd align='left'? echo $form-input('name',array('label'='')); ? /td /tr tr td valign='top' labelTitle:/label/tdtd ? echo $form-input('title',array('label'='')); ? /td /tr tr td valign='top' label Content:/label/td td ? echo $form-input('content', array('rows' = '15','cols'='35','label'='')); ? /td /tr tr td valign='top'label Date:/label/tdtd style='padding-left: 15px;'? echo $form-dateTime('dateadded', $dateFormat = 'DMY', $selected = null, $attributes = array(), $showEmpty = true ) ; ? /td /tr tr /table ? echo $form-end('Save Page'); ? : I am waiting for anybody replies thanks vishal --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Component and models
While you wait for a more authoritive reply, I'll chip in to say that that's what I've done where I needed to. But I think it depends on the model's association with the controller that loads the component. On Thu, May 22, 2008 at 3:55 AM, laeffe [EMAIL PROTECTED] wrote: Hi, I know this has been discussed before, but I just want it to be clarified. From within a component I like to access a Model, what would be the correct approach? App::import(Model, Modelname); $modelname = new Modelname(); maybe? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to use several languages in cakePHP?
try this - it helped me. a href=http://www.google.es/url?sa=tct=rescd=5url=http%3A%2F %2Fbakery.cakephp.org%2Farticles%2Fview%2Fp28n-the-top-to-bottom- persistent-internationalization- tutorialei=vHg1SL3zPIeA7gX9l_m3DQusg=AFQjCNHEqzUMKdMgmzqt- KVDJ7Rxy2iDfAsig2=pWvuTbQ60TcbeGPsgMwpYg p28n, the top to bottom persistent internationalization tutorial/a On 22 Maig, 08:42, Margarittka [EMAIL PROTECTED] wrote: Hello! I need to write site with support of 3 languages. Differences of parts are only in files with constants. How can i realize this in optimum way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Can any body help me please for tiny MCE editor issue
try this - it helped me. A lot. http://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persistent-internationalization-tutorial On 22 Maig, 13:52, vishal [EMAIL PROTECTED] wrote: Hi Friend, I am facing a very difficult problem, if you have any suggestion for me then plz guide me what i will do ?? actually I have placed a tiny MCE editor to add the page content for my cms. these pages shown on front end handled by admin. ther are 5 -6 pages so I have stored it in the database. when i edit the page with Id the TinyMCE editor is not shown, while in case of add it works fine. when i click on edit link this link shown in URL:http://192.168.0.60/vishal/cake_1.2.0.6311-beta/app/cmts/edit/6 the contents are shown in form of textarea not in the editor The main problem is the id...but it is mandatory for me. while in case of this URL,http://192.168.0.60/vishal/cake_1.2.0.6311-beta/app/cmts/edit it shows me the editor but not the content , what i will do the code is below for edit : script type=text/javascript tinyMCE.init({ theme : advanced, mode : textareas, plugins : safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template, // Theme options theme_advanced_buttons1 : save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect, theme_advanced_buttons2 : cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor, theme_advanced_buttons3 : tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen, theme_advanced_buttons4 : insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak, theme_advanced_toolbar_location : top, theme_advanced_toolbar_align : left, theme_advanced_statusbar_location : bottom, theme_advanced_resizing : true, convert_urls : true }); /script h1Edit Page/h1 ?php echo $form-create('Cmt', array('action' ='edit')); ? table width=90% cellpadding=0 cellspacing=0 align=center border=0 tr td width='8%' valign='top' labelPageName:/label/tdtd align='left'? echo $form-input('name',array('label'='')); ? /td /tr tr td valign='top' labelTitle:/label/tdtd ? echo $form-input('title',array('label'='')); ? /td /tr tr td valign='top' label Content:/label/td td ? echo $form-input('content', array('rows' = '15','cols'='35','label'='')); ? /td /tr tr td valign='top'label Date:/label/tdtd style='padding-left: 15px;'? echo $form-dateTime('dateadded', $dateFormat = 'DMY', $selected = null, $attributes = array(), $showEmpty = true ) ; ? /td /tr tr /table ? echo $form-end('Save Page'); ? : I am waiting for anybody replies thanks vishal --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to use several languages in cakePHP?
Try this it helped me. a lot. http://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persistent-internationalization-tutorial Leo (Apologies if I have made multiple posts here. Usenet is not the most modern technology.) On 22 Maig, 08:42, Margarittka [EMAIL PROTECTED] wrote: Hello! I need to write site with support of 3 languages. Differences of parts are only in files with constants. How can i realize this in optimum way? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why CakePHP always uses var?
Thanks for the tip! :) - Original Message From: keymaster [EMAIL PROTECTED] To: CakePHP cake-php@googlegroups.com Sent: Thursday, May 22, 2008 10:01:19 AM Subject: Re: Why CakePHP always uses var? For symptomatic relief in Zend Studio: - right click in the debug messages window, - choose: Debug Message Filters - unselect: Strict Messages. On May 22, 8:19 am, José Lorenzo [EMAIL PROTECTED] wrote: It's a real pain, because Zend Studio reports all the usages of var is a compile warning. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Html Helper link onclick option question
Hi, can anybody help me with this problem, I am creating a simple link in one of my views and I am having a problem giving an onClick option/ attribute for the link, as it seems cake is escaping/encoding the javascript function special characters like this: echo $html-link(foo, '#', array('onClick'=myObj.select(document.getElementById('. $element.')); return false;)); prints out something like: a href=# onClick=myObj.select(document.getElementById(#039;element0#039;)); return false;foo/a On the view, I have specified to use ISO-8859-1 encoding, is this the problem? meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 / --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
phpcake Error handlling when debug = 0
I wana have my custom error handller for cake application. In that I need to have mail notification and showing the user page with some message. I have done it but the problem is that if debug=0 it wont work as I think it wont call the debug call of cakephp which calls our custom error handller. if you have any idea how to make it happen my requirement is : if debug 0 it will behave as normal cake does. but in production when debug = 0 I want if any error or warring or fatal error etc occur it will take show user a message Please try again and if problem persist please contact admin some thing like this and at same time a mail sud be sent to admin. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
session garbage when savehandler = cake
Hello, when will old session data be deleted when I use cake as sessionhandler (Configure::write('Session.save', 'cake');) ? I set that config in the core.php yesterday and I looked today in the CakePHP's /tmp directory and there are a lot of files from yesterday. Thanks Oliver --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Difference cake bake controller User scaffold or without scaffold, need explanation
I'm newbie. I'm using cake bake console . Then the problem is when using command *cake bake controller Types* then the output : ?php class TypesController extends AppController { var $name = 'Types'; var $scaffold; } ? but if using command *cake bake controller Types scaffold* then the output generate add(), edit() , etc ?php class TypesController extends AppController { var $name = 'Types'; var $helpers = array('Html', 'Form'); function index() { $this-Type-recursive = 0; $this-set('types', $this-paginate()); } . I'm using CakePHP 1.2 Night 21 may 2008. Anybody can say what happen? I'm get chat in #cakePHP, then somebody say it backward. I'm confuse with it. Which one good for using? thanks -- yodiaditya http://yodi.web.id http://re.web.id --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Routing - Many Slashes - One Parm
i got: $Route-connect('/thumb/:link', array('controller' = 'obrazki', 'action' = 'skaluj'), array('link' = '(.)*')); www.asd.com/thumb/imgs/asd/dsa/dsa.jpg and i want to link=imgs/asd/dsa/dsa.jpg but i doesn't work :/ any ideas ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
session garbage savehandler = cake
Hello, when will old session data be deleted when I use cake as sessionhandler (Configure::write('Session.save', 'cake');) ? I set that config in the core.php yesterday and I looked today in the CakePHP's /tmp directory and there are a lot of files from yesterday. Thanks Oliver --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
167+ MB memory size fatal error in .../cake/libs/model/datasources/
We are trying to update a working application from cake1.1 to cake_1.2.0.6311-beta. After fixing all of the bugs we ran into a memory error which can not be fixed via increasing the memory size in PHP.ini: Fatal error: Allowed memory size of 167772160 bytes exhausted (tried to allocate 136 bytes) in /var/www/html/laboratree2/cake/libs/model/ datasources/datasource.php on line 360 Normally this means that there is an infinite loop somewhere but I'm not sure how to track it down since our code isn't being linked to in the Fatal Error page. Any advice? Thanks in advance, Jon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 167+ MB memory size fatal error in .../cake/libs/model/datasources/
Check your model associations. I've ran into this when my associations were returning a huge array. If it's a page where you are listing items and your not using their associations, temporarily remove those associations for that instance of grabbing the list. I think the function is something like unbind http://www.google.com/search?q=cakephp+unbind On May 22, 9:42 am, BioResearch [EMAIL PROTECTED] wrote: We are trying to update a working application from cake1.1 to cake_1.2.0.6311-beta. After fixing all of the bugs we ran into a memory error which can not be fixed via increasing the memory size in PHP.ini: Fatal error: Allowed memory size of 167772160 bytes exhausted (tried to allocate 136 bytes) in /var/www/html/laboratree2/cake/libs/model/ datasources/datasource.php on line 360 Normally this means that there is an infinite loop somewhere but I'm not sure how to track it down since our code isn't being linked to in the Fatal Error page. Any advice? Thanks in advance, Jon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Static Page
I suspect that Phaedo--like myself--has a flash() method in AppController that runs the redirect. Note the second param given. I see a few things not quite right with the example. Are you certain that the databas is being updated? There's no version given but, if using 1.2: $this-Sorrow-id = $id; This is superfluous. Better to just use read(). if (empty($this-data)) { $this-set('sorrow', $this-Sorrow-read()); $this-data = $this-Sorrow-read(); Speaking of unnecessary, why do this twice? What are you doing in the view with $sorrow that can't be done with the anonymous (and, perhaps, less glamorous ;-) data array? Anyway, it should be $this-Sorrow-read(null, $id); } else { if ($this-Sorrow-save($this-data['Sorrow'])) { That should be ...save($this-data), AFAICT. $this-flash('Your post has been updated.','/sorrows'); Difficult to say without seeing your flash() method. On Wed, May 21, 2008 at 9:34 PM, Joel Perras [EMAIL PROTECTED] wrote: $this-redirect('name_of_action_you_are_redirecting_to'); Boom-shacka-lacka-boom. -Joel. On May 21, 9:00 pm, phaedo5 [EMAIL PROTECTED] wrote: I have this Edit view in my controller. function edit($id = null) { $this-Sorrow-id = $id; if (empty($this-data)) { $this-set('sorrow', $this-Sorrow-read()); $this-data = $this-Sorrow-read(); } else { if ($this-Sorrow-save($this-data['Sorrow'])) { $this-flash('Your post has been updated.','/sorrows'); } } } I was hoping that it would update the database, which it does, and then redirect to the index view. Am I missing something? Obviously I am, the question is - what am I missing? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: session garbage savehandler = cake
By default cakephp uses php to manage sessions so check out the session settings in php.ini check this out http://www.mail-archive.com/cake-php@googlegroups.com/msg17723.html On May 22, 7:54 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, when will old session data be deleted when I use cake as sessionhandler (Configure::write('Session.save', 'cake');) ? I set that config in the core.php yesterday and I looked today in the CakePHP's /tmp directory and there are a lot of files from yesterday. Thanks Oliver --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Routing - Many Slashes - One Parm
try $Route-connect('/thumb/:link', array('controller' = 'obrazki', 'action' = 'skaluj')); then in your skaluj action in your controller, take a look at debug($this-params); It should have the info you need and you should be able to do a join(), etc. On May 22, 9:26 am, ar2oor [EMAIL PROTECTED] wrote: i got: $Route-connect('/thumb/:link', array('controller' = 'obrazki', 'action' = 'skaluj'), array('link' = '(.)*')); www.asd.com/thumb/imgs/asd/dsa/dsa.jpg and i want to link=imgs/asd/dsa/dsa.jpg but i doesn't work :/ any ideas ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Appending data in Session
Additionally, if it were my app, I'd save the product name also so that a list for the current cart can be easily displayed at any time. So, instead of pushing an ID onto the array I'd first grab all of the products from session, add a new array with both ID name of latest product, then both save the products array back to the session as well as make it available to the view with set(). Just my $0.02 On Thu, May 22, 2008 at 6:46 AM, Amit Badkas [EMAIL PROTECTED] wrote: On Thu, May 22, 2008 at 3:16 PM, Reza Muhammad [EMAIL PROTECTED] wrote: Hello, I'm trying to save multiple data in a session (kind of like a shopping cart). The process is a user select an item using a checkbox, and then he/she submits the form. The function will write a session (called product_id). However, if I try to search for another item, and then I submit the form again, the session only holds the newest data. Can't I just do this with $this-Session-write('products', $this- data['Products']['id']); ? - You need to do session read and array merge for this, like $this-Session-write('products', am($this-Session-read('products'), array($this-data['Products']['id']))); Also check if products are in session before doing array merge, like if ($this-Session-check('products')) { $this-Session-write('products', am($this-Session-read('products'), array($this-data['Products']['id']))); } else { $this-Session-write('products', array($this-data['Products']['id'])); } -- Amit http://amitrb.wordpress.com/ http://coppermine-gallery.net/ http://cheesecake-photoblog.org/ http://www.sanisoft.com/blog/author/amitbadkas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Why CakePHP always uses var?
For symptomatic relief in Zend Studio: - right click in the debug messages window, - choose: Debug Message Filters - unselect: Strict Messages. On May 22, 8:19 am, José Lorenzo [EMAIL PROTECTED] wrote: It's a real pain, because Zend Studio reports all the usages of var is a compile warning. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Static Page
Wow, I should really start taking the time to actually read the snippets posted. On the other hand, if people stop imagining that others can read their minds and start formulating questions that actually address their problem at hand, then they'd probably get more precise answers. -J. On May 22, 10:15 am, b logica [EMAIL PROTECTED] wrote: I suspect that Phaedo--like myself--has a flash() method in AppController that runs the redirect. Note the second param given. I see a few things not quite right with the example. Are you certain that the databas is being updated? There's no version given but, if using 1.2: $this-Sorrow-id = $id; This is superfluous. Better to just use read(). if (empty($this-data)) { $this-set('sorrow', $this-Sorrow-read()); $this-data = $this-Sorrow-read(); Speaking of unnecessary, why do this twice? What are you doing in the view with $sorrow that can't be done with the anonymous (and, perhaps, less glamorous ;-) data array? Anyway, it should be $this-Sorrow-read(null, $id); } else { if ($this-Sorrow-save($this-data['Sorrow'])) { That should be ...save($this-data), AFAICT. $this-flash('Your post has been updated.','/sorrows'); Difficult to say without seeing your flash() method. On Wed, May 21, 2008 at 9:34 PM, Joel Perras [EMAIL PROTECTED] wrote: $this-redirect('name_of_action_you_are_redirecting_to'); Boom-shacka-lacka-boom. -Joel. On May 21, 9:00 pm, phaedo5 [EMAIL PROTECTED] wrote: I have this Edit view in my controller. function edit($id = null) { $this-Sorrow-id = $id; if (empty($this-data)) { $this-set('sorrow', $this-Sorrow-read()); $this-data = $this-Sorrow-read(); } else { if ($this-Sorrow-save($this-data['Sorrow'])) { $this-flash('Your post has been updated.','/sorrows'); } } } I was hoping that it would update the database, which it does, and then redirect to the index view. Am I missing something? Obviously I am, the question is - what am I missing? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Including images within plugins?
If your forum images are displayed using only your CSS (ie. background-image) then you're good to go. Just put store them within an images dir inside the CSS dir and set all the URLs without any leading slash and they'll be fetched from there. In fact, you'd be half way toward making the forum more easily skinnable. On Thu, May 22, 2008 at 3:15 AM, Dr. Tarique Sani [EMAIL PROTECTED] wrote: On Thu, May 22, 2008 at 12:41 PM, Matt Huggins [EMAIL PROTECTED] wrote: Is it possible to provide images (and other files, such as CSS stylesheets) with a plugin, such that they are accessible via a URL in HTML (such as an IMG tag)? I'm working on a forum plugin, and I'd like it to be as easy to distribute as possible. Since I use some forum-specific images and stylesheets, I'd like to package these up in the plugin, but I'm not sure if it's possible. Images - not possible CSS and JS - put in the vendor of plugin Tarique -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Saving NOW() in model
Ok, well for consistency's sake, do you know if cakePHP's automatic filling of 'created', 'updated', and 'modified' fields uses PHP's time or MYSQL's time? Thanks for all the quick responses everyone :) On May 22, 7:11 am, djiize [EMAIL PROTECTED] wrote: yes you're right! I care about that because we have 1 MySQL central server and several servers that request it. And we have not always full control of theses servers (apps can be coded by others teams/companies). On 22 mai, 14:16, Joel Perras [EMAIL PROTECTED] wrote: It doesn't really matter whether or not you obtain the date from Apache/PHP or MySQL; as long as you are consistent. On May 22, 4:01 am, djiize [EMAIL PROTECTED] wrote: I use the same way as Stephen Because what if MySQL is hosted on another server than Apache/PHP ? You'll save Apache/PHP time which can be different of MySQL time (no the same meridian for instance). Of course, it's a very specific case. And my servers are time synchronised together, but some time differences appeared once or twice a year. On 22 mai, 07:47, Stephen Orr [EMAIL PROTECTED] wrote: I believe I used this method: 'last_login' = '!-NOW()' Which makes Cake stop trying to quote it. But I'm pretty sure the latest SVN revision recognises NOW() and doesn't quote it anyway. Maybe I'm confused. Steve On May 22, 2:12 am, Alex Ciobanu [EMAIL PROTECTED] wrote: Zifnab wrote: I'm trying to figure out how to implicitly make a mysql NOW() call when doing a model save...here's an example of the code: $aUserData = array( 'User' = array( 'id' = 4, 'last_login' = 'NOW()' ) ); $this-User-save( $aUserData, false, array( 'last_login' ) ); Naturally the save doesn't work, because NOW() saves as a string NOW() instead of as a mysql function NOW()How do I get it to save as a mysql function? $aUserData['User']['last_login'] = date(Y-m-d H:i:s); $this-User-save($aUserData); Not using NOW(), but does the trick. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 167+ MB memory size fatal error in .../cake/libs/model/datasources/
Or just set $this-YourModelName-recursive = [-1|0]; I'd say it's very likely to be your associations that are the problem and that Cake is attempting to basically slurp up your entire database n times. On Thu, May 22, 2008 at 10:14 AM, fr3nch13 [EMAIL PROTECTED] wrote: Check your model associations. I've ran into this when my associations were returning a huge array. If it's a page where you are listing items and your not using their associations, temporarily remove those associations for that instance of grabbing the list. I think the function is something like unbind http://www.google.com/search?q=cakephp+unbind On May 22, 9:42 am, BioResearch [EMAIL PROTECTED] wrote: We are trying to update a working application from cake1.1 to cake_1.2.0.6311-beta. After fixing all of the bugs we ran into a memory error which can not be fixed via increasing the memory size in PHP.ini: Fatal error: Allowed memory size of 167772160 bytes exhausted (tried to allocate 136 bytes) in /var/www/html/laboratree2/cake/libs/model/ datasources/datasource.php on line 360 Normally this means that there is an infinite loop somewhere but I'm not sure how to track it down since our code isn't being linked to in the Fatal Error page. Any advice? Thanks in advance, Jon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Html Helper link onclick option question
You have to turn off the escaping in the link functions, it auto escapes. Check out: http://www.donutczar.com/blog/?p=4 http://api.cakephp.org/1.2/class_html_helper.html On May 22, 4:56 am, jimbo [EMAIL PROTECTED] wrote: Hi, can anybody help me with this problem, I am creating a simple link in one of my views and I am having a problem giving an onClick option/ attribute for the link, as it seems cake is escaping/encoding the javascript function special characters like this: echo $html-link(foo, '#', array('onClick'=myObj.select(document.getElementById('. $element.')); return false;)); prints out something like: a href=# onClick=myObj.select(document.getElementById(#039;element0#039;)); return false;foo/a On the view, I have specified to use ISO-8859-1 encoding, is this the problem? meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 / --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Saving NOW() in model
Most likely uses php's time (didn't check), but a good reason for this is to allow supporting of multiple databases (or even flat files) instead of db specific functions. On May 22, 10:25 am, Zifnab [EMAIL PROTECTED] wrote: Ok, well for consistency's sake, do you know if cakePHP's automatic filling of 'created', 'updated', and 'modified' fields uses PHP's time or MYSQL's time? Thanks for all the quick responses everyone :) On May 22, 7:11 am, djiize [EMAIL PROTECTED] wrote: yes you're right! I care about that because we have 1 MySQL central server and several servers that request it. And we have not always full control of theses servers (apps can be coded by others teams/companies). On 22 mai, 14:16, Joel Perras [EMAIL PROTECTED] wrote: It doesn't really matter whether or not you obtain the date from Apache/PHP or MySQL; as long as you are consistent. On May 22, 4:01 am, djiize [EMAIL PROTECTED] wrote: I use the same way as Stephen Because what if MySQL is hosted on another server than Apache/PHP ? You'll save Apache/PHP time which can be different of MySQL time (no the same meridian for instance). Of course, it's a very specific case. And my servers are time synchronised together, but some time differences appeared once or twice a year. On 22 mai, 07:47, Stephen Orr [EMAIL PROTECTED] wrote: I believe I used this method: 'last_login' = '!-NOW()' Which makes Cake stop trying to quote it. But I'm pretty sure the latest SVN revision recognises NOW() and doesn't quote it anyway. Maybe I'm confused. Steve On May 22, 2:12 am, Alex Ciobanu [EMAIL PROTECTED] wrote: Zifnab wrote: I'm trying to figure out how to implicitly make a mysql NOW() call when doing a model save...here's an example of the code: $aUserData = array( 'User' = array( 'id' = 4, 'last_login' = 'NOW()' ) ); $this-User-save( $aUserData, false, array( 'last_login' ) ); Naturally the save doesn't work, because NOW() saves as a string NOW() instead of as a mysql function NOW()How do I get it to save as a mysql function? $aUserData['User']['last_login'] = date(Y-m-d H:i:s); $this-User-save($aUserData); Not using NOW(), but does the trick. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Appending data in Session
to add onto b logics, you can use the id as the key in an associative array as the sessions use the period as it's delim: writing: $this-Session-write('product.'.$id, $name); reading $products = $this-Session-read('product); On May 22, 10:26 am, b logica [EMAIL PROTECTED] wrote: Additionally, if it were my app, I'd save the product name also so that a list for the current cart can be easily displayed at any time. So, instead of pushing an ID onto the array I'd first grab all of the products from session, add a new array with both ID name of latest product, then both save the products array back to the session as well as make it available to the view with set(). Just my $0.02 On Thu, May 22, 2008 at 6:46 AM, Amit Badkas [EMAIL PROTECTED] wrote: On Thu, May 22, 2008 at 3:16 PM, Reza Muhammad [EMAIL PROTECTED] wrote: Hello, I'm trying to save multiple data in a session (kind of like a shopping cart). The process is a user select an item using a checkbox, and then he/she submits the form. The function will write a session (called product_id). However, if I try to search for another item, and then I submit the form again, the session only holds the newest data. Can't I just do this with $this-Session-write('products', $this- data['Products']['id']); ? - You need to do session read and array merge for this, like $this-Session-write('products', am($this-Session-read('products'), array($this-data['Products']['id']))); Also check if products are in session before doing array merge, like if ($this-Session-check('products')) { $this-Session-write('products', am($this-Session-read('products'), array($this-data['Products']['id']))); } else { $this-Session-write('products', array($this-data['Products']['id'])); } -- Amit http://amitrb.wordpress.com/ http://coppermine-gallery.net/ http://cheesecake-photoblog.org/ http://www.sanisoft.com/blog/author/amitbadkas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Appending data in Session
forgot, this also eliminates the need to check to see if it's there first. On May 22, 10:38 am, fr3nch13 [EMAIL PROTECTED] wrote: to add onto b logics, you can use the id as the key in an associative array as the sessions use the period as it's delim: writing: $this-Session-write('product.'.$id, $name); reading $products = $this-Session-read('product); On May 22, 10:26 am, b logica [EMAIL PROTECTED] wrote: Additionally, if it were my app, I'd save the product name also so that a list for the current cart can be easily displayed at any time. So, instead of pushing an ID onto the array I'd first grab all of the products from session, add a new array with both ID name of latest product, then both save the products array back to the session as well as make it available to the view with set(). Just my $0.02 On Thu, May 22, 2008 at 6:46 AM, Amit Badkas [EMAIL PROTECTED] wrote: On Thu, May 22, 2008 at 3:16 PM, Reza Muhammad [EMAIL PROTECTED] wrote: Hello, I'm trying to save multiple data in a session (kind of like a shopping cart). The process is a user select an item using a checkbox, and then he/she submits the form. The function will write a session (called product_id). However, if I try to search for another item, and then I submit the form again, the session only holds the newest data. Can't I just do this with $this-Session-write('products', $this- data['Products']['id']); ? - You need to do session read and array merge for this, like $this-Session-write('products', am($this-Session-read('products'), array($this-data['Products']['id']))); Also check if products are in session before doing array merge, like if ($this-Session-check('products')) { $this-Session-write('products', am($this-Session-read('products'), array($this-data['Products']['id']))); } else { $this-Session-write('products', array($this-data['Products']['id'])); } -- Amit http://amitrb.wordpress.com/ http://coppermine-gallery.net/ http://cheesecake-photoblog.org/ http://www.sanisoft.com/blog/author/amitbadkas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Bake error
I also have the same problem with my cake project Fatal error: Cannot redeclare class overloadable in C:\xampp\htdocs \cake\libs\ov erloadable_php5.php on line 61 Any solution yet? On Apr 22, 6:13 pm, [EMAIL PROTECTED] wrote: I am getting the following error when I try to institutebakefrom a command line Fatal error:Cannotredeclareclassoverloadablein c:\xampp\htdocs \todo\cake\libs\overloadable_php4.php on line 39 The particulars in and arround line 39 for the error is --Code SnippetclassOverloadableextends Object { /** * Constructor. * * @access private */ function __construct() { $this-overload(); parent::__construct(); } --- /code snippet any suggestions --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $this-Auth-user() cached? - Cake 1.2
I don't understand what you're trying to do here. Are you trying to refresh the $user variable or the data in the session? I'm trying to find an easy way to refresh the data held in $this-Auth- user() -- is that just pointing to the User value in the session? I'm not sure how the Auth object maps to the values in the Session. -Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Bake error
What are the steps to reproduce the error? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Upgrading Cake
So as a new (prospective) user, I've been looking at the framework versions and tutorials and I started wondering what the upgrade path looked like. From what I can tell, the user code and framework code is intermingled (albeit in a very predictable way). Given that, how are upgrades performed? A simple zip file extraction may leave old files and, conceivably, may overwrite user files of the same name. Would love to know if there's a baked in upgrade path or, if not, what strategy experienced users employ. Thanks. Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Upgrading Cake
On Thu, May 22, 2008 at 11:56 AM, Rob Wilkerson [EMAIL PROTECTED] wrote: Would love to know if there's a baked in upgrade path or, if not, what strategy experienced users employ. Thanks. Rob Well, I keep my Cake core files out of the web path (no snooping, thanks!) and my app directories are in the web path. So, when I upgrade the core, nothing in my app gets overwritten. Best way, if you ask me. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling snakes... @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Upgrading Cake
On May 22, 5:56 pm, Rob Wilkerson [EMAIL PROTECTED] wrote: So as a new (prospective) user, I've been looking at the framework versions and tutorials and I started wondering what the upgrade path looked like. From what I can tell, the user code and framework code is intermingled (albeit in a very predictable way). Given that, how are upgrades performed? A simple zip file extraction may leave old files and, conceivably, may overwrite user files of the same name. Would love to know if there's a baked in upgrade path or, if not, what strategy experienced users employ. Thanks. Rob usually it's as simple as updating your cake folder. don't think I agree with intermingled - although some config files change as new features are built in. for info: http://book.cakephp.org/view/411/migrating-from-cakephp-1-1-to- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Using CakePHP to update a wordpress rss feed
As a project to learn CakePHP, I have been recreating my wordpress blog. My issue now is that I want to keep the same rss feed that was set up by wordpress and have my new site update that. I have no idea how to get started on this, I was hoping for a push in the right direction. Thanks for your time, 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Appending data in Session
Thanks. Amit's solution was what I was looking for. I do realize that by separating product id into different fields might be beneficial, but appending data into the same array looks more appealing to me. Anyway, this actually pretty easy to tackle, I just never thought of it like this. Heh. Thanks alot for your help. Appreciate it. On May 22, 2008, at 9:39 PM, fr3nch13 wrote: forgot, this also eliminates the need to check to see if it's there first. On May 22, 10:38 am, fr3nch13 [EMAIL PROTECTED] wrote: to add onto b logics, you can use the id as the key in an associative array as the sessions use the period as it's delim: writing: $this-Session-write('product.'.$id, $name); reading $products = $this-Session-read('product); On May 22, 10:26 am, b logica [EMAIL PROTECTED] wrote: Additionally, if it were my app, I'd save the product name also so that a list for the current cart can be easily displayed at any time. So, instead of pushing an ID onto the array I'd first grab all of the products from session, add a new array with both ID name of latest product, then both save the products array back to the session as well as make it available to the view with set(). Just my $0.02 On Thu, May 22, 2008 at 6:46 AM, Amit Badkas [EMAIL PROTECTED] wrote: On Thu, May 22, 2008 at 3:16 PM, Reza Muhammad [EMAIL PROTECTED] wrote: Hello, I'm trying to save multiple data in a session (kind of like a shopping cart). The process is a user select an item using a checkbox, and then he/she submits the form. The function will write a session (called product_id). However, if I try to search for another item, and then I submit the form again, the session only holds the newest data. Can't I just do this with $this-Session-write('products', $this- data['Products']['id']); ? - You need to do session read and array merge for this, like $this-Session-write('products', am($this-Session- read('products'), array($this-data['Products']['id']))); Also check if products are in session before doing array merge, like if ($this-Session-check('products')) { $this-Session-write('products', am($this-Session- read('products'), array($this-data['Products']['id']))); } else { $this-Session-write('products', array($this-data['Products'] ['id'])); } -- Amit http://amitrb.wordpress.com/ http://coppermine-gallery.net/ http://cheesecake-photoblog.org/ http://www.sanisoft.com/blog/author/amitbadkas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using CakePHP to update a wordpress rss feed
On May 22, 12:14 pm, Chez17 [EMAIL PROTECTED] wrote: As a project to learn CakePHP, I have been recreating my wordpress blog. My issue now is that I want to keep the same rss feed that was set up by wordpress and have my new site update that. I have no idea how to get started on this, I was hoping for a push in the right direction. Thanks for your time, Dave Are you using the dynamically generated WordPress RSS feed or something like FeedBurner? If it's dynamically generated, you can't add to it, but you can easily create a feed through CakePHP that has the same information. And if it's through FeedBurner, you would still create a feed through CakePHP and then just change FeedBurner to point to it instead of the WordPress feed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Making Paginator first sort direction DESC
It's not implemented yet. But you can do the following: copy the paginator helper to app/views/helpers. Then edit line 223: instead of $dir = 'asc'; write this: $dir = 'asc'; if(isset($options['direction'])){ $dir = $options['direction']; } Now in your view: $paginator- sort('description','fieldname',array('direction'='desc')); Donnerbeil On 21 Mai, 22:03, donnerbeil [EMAIL PROTECTED] wrote: Actually you can do this in your view: $paginator-sort('Name','name',array('direction'='desc')); At least the API says that. But I tried and it didn't work. Maybe it's not yet implemented in the current 1.2beta. Or my syntax is not correct. Anyone any idea? Donnerbeil On 20 Mai, 11:09, Tim W [EMAIL PROTECTED] wrote: In the end my solution was to copy the paginator helper class to my application helpers directory, then in the sort method swap every instance of asc and desc. It's not a great solution, but it works. I'd love to hear about better solutions to get the initial sort direction to be desc instead of asc. On May 8, 12:35 am, Tim W [EMAIL PROTECTED] wrote: Thanks Marcin. I don't think i've been entirely clear. I can easily set the sort order programmatically, but when the user first clicks on a link to sort a column it automatically sorts ASC. I'd like to change that behavior to default first to DESC. I can do it by hacking around with the cake source, or doing it myself, I just wondered if there was a way built in, since it'd probably be a pretty common thing to try to do. If not i'll add it and see if I can work out how to submit a change request. Cheers Tim On May 7, 10:33 pm, Marcin Domanski [EMAIL PROTECTED] wrote: 'order' = 'Model.column DESC' On Wed, May 7, 2008 at 11:26 AM,TimW[EMAIL PROTECTED] wrote: Thanks for the suggestion, but unfortunately it didn't work for me. SQL Error: 1054: Unknown column 'DESC' in 'order clause' I'll spend some time to work this out at some point, i'll post when I do, unless someone's worked it out already and can tell me. Thanks Tim On May 7, 8:11 pm, Andras Kende [EMAIL PROTECTED] wrote: Hello, try this in your controller: var $paginate = array('limit' = 100, 'page' = 1, 'order' = 'DESC'); Andras Kende http://www.kende.com -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf OfTimW Sent: Tuesday, May 06, 2008 9:26 AM To: CakePHP Subject: Making Paginator first sort direction DESC Hi all, Paginator's great, like the rest of Cake, but there's one little thing I haven't been able to work out. By default when you click on a column to sort it will sort ASC (ascending), but i'd like the first sort to be DESC (descending). The options suggest this might be possible, but I haven't worked it out. Does anyone know if this is possible? Thanks TIm -- Marcin Domanskihttp://kabturek.info --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using CakePHP to update a wordpress rss feed
I am using they dynamically generated feed. Does that mean there is no way to get the new site to work with the old rss feed? Are you using the dynamically generated WordPress RSS feed or something like FeedBurner? If it's dynamically generated, you can't add to it, but you can easily create a feed through CakePHP that has the same information. And if it's through FeedBurner, you would still create a feed through CakePHP and then just change FeedBurner to point to it instead of the WordPress feed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $this-Auth-user() cached? - Cake 1.2
On Thu, May 22, 2008 at 11:28 AM, theandystratton [EMAIL PROTECTED] wrote: I don't understand what you're trying to do here. Are you trying to refresh the $user variable or the data in the session? I'm trying to find an easy way to refresh the data held in $this-Auth- user() But you're assigning *from* Auth, not *to* it. is that just pointing to the User value in the session? I'm not sure how the Auth object maps to the values in the Session. Yes, Look at the source for Auth::user(). It's grabbing it from the session. Strangely though, I'm suddenly seeing an eerily similar problem in my own app :-/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
hasOne association
I am stumped with a problem when using model associations. For the some reason the findAll generates an incorrect join query. Will great appreciate any help. Both my models and controllers along with the MySql output is shown below. class Playerstat extends AppModel { var $name = 'Playerstat'; var $belongsTo = array('Player' = array( 'className' = 'Player', 'foreignKey' = 'player_id')); } class Player extends AppModel { var $name = 'Player'; var $hasOne = array('Playerstat' = array( 'className' = 'Playerstat', 'foreignKey' = 'player_id', 'dependent' = true)); } Each Player record has a corresponding Playerstat record. player_id is the primary key in table players and player_id is the foreign key in playerstat. I have the following code in one of my controller function $status = PLAYER_ACTIVE; $results = $this-Player-findAll(Player.active = $status AND Player.level = 'A', array(Player.fname, Player.lname, Playerstat.wins, Playerstat.loss, Playerstat.points, Playerstat.last_played), 'Playerstat.points DESC'); I get the following result from MySql Query: SELECT `Player`.`fname`, `Player`.`lname`, `Playerstat`.`wins`, `Playerstat`.`loss`, `Playerstat`.`points`, `Playerstat`.`last_played` FROM `players` AS `Player` LEFT JOIN `playerstats` AS `Playerstat` ON (`Playerstat`.`player_id` = `Player`.`id`) WHERE `Player`.`active` = 1 AND `Player`.`level` = 'A' ORDER BY `Playerstat`.`points` DESC Warning (512): SQL Error: 1054: Unknown column 'Player.id' in 'on clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 440] The players table does not have an id field it is suppose to be player_id. What I am doing wrong? How can I make id into player_id. Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: 167+ MB memory size fatal error in .../cake/libs/model/datasources/
Re: If it's a page where you are listing items and your not using their associations, temporarily remove those associations for that instance of grabbing the list. It's the front page (index.php) that is crashing and not some association rich page. The front page has a login box, search box and some images. That's it. On May 22, 10:14 am, fr3nch13 [EMAIL PROTECTED] wrote: Check your model associations. I've ran into this when my associations were returning a huge array. If it's a page where you are listing items and your not using their associations, temporarily remove those associations for that instance of grabbing the list. I think the function is something like unbind http://www.google.com/search?q=cakephp+unbind On May 22, 9:42 am, BioResearch [EMAIL PROTECTED] wrote: We are trying to update a working application from cake1.1 to cake_1.2.0.6311-beta. After fixing all of the bugs we ran into a memory error which can not be fixed via increasing the memory size in PHP.ini: Fatal error: Allowed memory size of 167772160 bytes exhausted (tried to allocate 136 bytes) in /var/www/html/laboratree2/cake/libs/model/ datasources/datasource.php on line 360 Normally this means that there is an infinite loop somewhere but I'm not sure how to track it down since our code isn't being linked to in the Fatal Error page. Any advice? Thanks in advance, Jon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ajax form validation
hey, can someone explain me howto validate a form using ajax? submission works fine but ive no clue how to validate the form correctly before saving the data oli --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Auth heisenbug
Suddenly, authentication for my app hasbecome completely unhinged. This was working perfectly yesterday but now I'm (almost) always redirected back to the login page. The only thing I've changed has to do with $loginRedirect, but I can't see how that would cause Auth to forget that I'm authenticated. My login() looks like (in part): /* I have 3 types of users who might log in. I need to create model for each, rather than use roles, because * their needs are quite different. So, I grab the model name from the users table */ $model_name = $user['User']['model']; $this-User-bindModel(array('hasOne'=array($model_name=array(; /* This allows me to save a bit of personal info and set the default redirect page if there's * no referer. */ switch($model_name) { case 'Admin': $name = $this-User-Admin-getName($user['User']['foreign_key']); $user['User']['name'] = $name['name']; $alt_redirect = '/admin'; break; case 'Member': $name_and_slug = $this-User-Member-getNameAndSlug($user['User']['foreign_key']); $user['User']['name'] = $name_and_slug['name']; $user['User']['slug'] = $name_and_slug['slug']; $alt_redirect = '/'; break; case 'Artist': $name_and_slug = $this-User-Artist-getNameAndSlug($user['User']['foreign_key']); $user['User']['name'] = $name_and_slug['name']; $user['User']['slug'] = $name_and_slug['slug']; $alt_redirect = '/'; break; } /* This is the only change made since yesterday. I added the $alt_redirect so that admins will be sent * to their dashboard page if there's no referer */ $this-Session-write('User', $user['User']); $this-Auth-loginRedirect = Controller::referer($alt_redirect, true); $this-redirect($this-Auth-redirect()); AppController::isAuthorised(): function isAuthorized() { if (isset($this-params[Configure::read('Routing.admin')])) { if ($this-Auth-user('model') != 'Admin') { $this-log('not ok: '.$this-Auth-user('model')); return false; } } $this-log('ok'); return true; } I put the log statements in just now to try to figure out what's going wrong. So, if I browse to: /admin/artists/edit/58 I'm correctly redirected to the login page: /admin/users/login and, in turn, redirected to the edit form and the log says, ok. When I hit submit, sometimes it works, and sometimes I'm sent back to the login page. In the latter case, I never see the not ok: Admin in the log. So, if the problem does not lie with isAuthorised() how/why am I being redirected? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Cross Database Joins with conditions in 1.2.0.6311
I have a model with many belongsTo associations which have simple conditions. Some of the models I'm associating with are in a different database than the default. When I do a findAll, any association I have that belongs to a model in another db and has conditions in the association shows up empty in the array. I have found that specifying a condition is where things go wrong. Each of these models have $useDbConfig specified. In the conditions, I'm using Modelname.Fieldname but I'm wondering if I need to specify the connection here and how to do that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP and Subscription Based Billing
On May 22, 12:28 pm, mydesignbuddy [EMAIL PROTECTED] wrote: PCI compliance is a must nowadays, its the law. Don't store or transmit your customers cc data unless you are compliant with PCI guidelines. The easiest recurring billing gateway service that I've used was Paypal's Payflow (pro or link). I'm sure they're other opinions out there but I don't know any off the top of my head. Do some research and here are some things to keep it mind when choosing a cc processor: do they have a good API, will their API work in PHP, how much is the initial setup cost, monthly cost, and per transaction cost. Authorize.net also makes recurring billing easy, but I haven't actually had to use it (just read over the APIs). I just wrote PayFlow classes in PHP and Python. Amazingly they only had built-in support for .NET and Java, everything else goes over HTTPS and they provide no code to get started. Not a tough thing to write, but it seemed pretty odd considering all the tools Authorize.net gives out. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using CakePHP to update a wordpress rss feed
On May 22, 12:50 pm, Chez17 [EMAIL PROTECTED] wrote: I am using they dynamically generated feed. Does that mean there is no way to get the new site to work with the old rss feed? I'm not sure exactly what you mean about getting the new site to work with old feed. Are you going to continue using WordPress? The RSS feed for WP is just an XML template for the last X posts in the WordPress database. There is nothing to add a post to other than the database. You can easily duplicate the template in CakePHP and any RSS subscribers will never notice the difference. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ajax form validation
On May 22, 1:34 pm, Oli [EMAIL PROTECTED] wrote: hey, can someone explain me howto validate a form using ajax? submission works fine but ive no clue how to validate the form correctly before saving the data Validation occurs just the same as a normal request. I don't use the AJAX helpers (mixing JS and HTML is a deal breaker for me), but it might just be that you're not seeing the error messages. If your controller is programmed properly you don't need to know if it's an AJAX request or not--it's all HTTP POST. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP and Subscription Based Billing
PCI compliance is a must nowadays, its the law. Don't store or transmit your customers cc data unless you are compliant with PCI guidelines. The easiest recurring billing gateway service that I've used was Paypal's Payflow (pro or link). I'm sure they're other opinions out there but I don't know any off the top of my head. Do some research and here are some things to keep it mind when choosing a cc processor: do they have a good API, will their API work in PHP, how much is the initial setup cost, monthly cost, and per transaction cost. we are about to do this using ProTx and an official 'Continuous Authority merchant number' obtained by our client from their aquiring bank - which is probably not the easiest thing to get hold of! No need to store card details, or even take them on your own server if you don't want to. jb -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ajax form validation
Ajax or not does not change anything (unless you want to do something special in the form). Usually you would put your form in a div (in the ajax call you should set this div' id's as parameter for update), when submitting and trying to save, if it fails just render the same form. This one (with the error set) is goinf to replace the content of the first div ... hth On May 22, 8:10 pm, jonknee [EMAIL PROTECTED] wrote: On May 22, 1:34 pm, Oli [EMAIL PROTECTED] wrote: hey, can someone explain me howto validate a form using ajax? submission works fine but ive no clue how to validate the form correctly before saving the data Validation occurs just the same as a normal request. I don't use the AJAX helpers (mixing JS and HTML is a deal breaker for me), but it might just be that you're not seeing the error messages. If your controller is programmed properly you don't need to know if it's an AJAX request or not--it's all HTTP POST. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Saving NOW() in model
I use date(DATE_ATOM) for date / timestamp fields, one could argue that there might be different time-zone between the web-server and the db server :-) If you really need the DB timestamp, better using '!- NOW()' as Stephen mentionned. On May 22, 4:35 pm, fr3nch13 [EMAIL PROTECTED] wrote: Most likely uses php's time (didn't check), but a good reason for this is to allow supporting of multiple databases (or even flat files) instead of db specific functions. On May 22, 10:25 am, Zifnab [EMAIL PROTECTED] wrote: Ok, well for consistency's sake, do you know if cakePHP's automatic filling of 'created', 'updated', and 'modified' fields uses PHP's time or MYSQL's time? Thanks for all the quick responses everyone :) On May 22, 7:11 am, djiize [EMAIL PROTECTED] wrote: yes you're right! I care about that because we have 1 MySQL central server and several servers that request it. And we have not always full control of theses servers (apps can be coded by others teams/companies). On 22 mai, 14:16, Joel Perras [EMAIL PROTECTED] wrote: It doesn't really matter whether or not you obtain the date from Apache/PHP or MySQL; as long as you are consistent. On May 22, 4:01 am, djiize [EMAIL PROTECTED] wrote: I use the same way as Stephen Because what if MySQL is hosted on another server than Apache/PHP ? You'll save Apache/PHP time which can be different of MySQL time (no the same meridian for instance). Of course, it's a very specific case. And my servers are time synchronised together, but some time differences appeared once or twice a year. On 22 mai, 07:47, Stephen Orr [EMAIL PROTECTED] wrote: I believe I used this method: 'last_login' = '!-NOW()' Which makes Cake stop trying to quote it. But I'm pretty sure the latest SVN revision recognises NOW() and doesn't quote it anyway. Maybe I'm confused. Steve On May 22, 2:12 am, Alex Ciobanu [EMAIL PROTECTED] wrote: Zifnab wrote: I'm trying to figure out how to implicitly make a mysql NOW() call when doing a model save...here's an example of the code: $aUserData = array( 'User' = array( 'id' = 4, 'last_login' = 'NOW()' ) ); $this-User-save( $aUserData, false, array( 'last_login' ) ); Naturally the save doesn't work, because NOW() saves as a string NOW() instead of as a mysql function NOW()How do I get it to save as a mysql function? $aUserData['User']['last_login'] = date(Y-m-d H:i:s); $this-User-save($aUserData); Not using NOW(), but does the trick. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: CakePHP and Subscription Based Billing
jonknee wrote: I just wrote PayFlow classes in PHP and Python. Amazingly they only had built-in support for .NET and Java, everything else goes over HTTPS and they provide no code to get started. Not a tough thing to write, but it seemed pretty odd considering all the tools Authorize.net gives out. The old Verisign PayFlow version had good examples. They seem to still be migrating the PayFlow side as the other PayPal API's have good coverage. Here is a link to the example by the forum moderator; http://www.paypaldeveloper.com/pdn/board/message?board.id=payflowthread.id=1008 - J -- View this message in context: http://www.nabble.com/CakePHP-and-Subscription-Based-Billing-tp17375977p17410311.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Restricting Login Attempts with Auth Component
I am trying to figure out the most reliable way of restricting login attempts while using the Auth Component. Here is my best stab at the problem thus far: http://cakeforge.org/snippet/detail.php?type=snippetid=220 I'd love to hear what other people have done, or what they think of the method I am using in the code snipped I've linked to. -Aran --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth heisenbug
Try debugging env('HTTP_REFERER') in addition to what Controller::referer($alt_redirect, true) gives you; your headers might be getting mangled for some reason or other. Also, is there a specific reason you are statically accessing the Controller::referer() method instead of using $this-referer() ? -Joel. On May 22, 1:45 pm, b logica [EMAIL PROTECTED] wrote: Suddenly, authentication for my app hasbecome completely unhinged. This was working perfectly yesterday but now I'm (almost) always redirected back to the login page. The only thing I've changed has to do with $loginRedirect, but I can't see how that would cause Auth to forget that I'm authenticated. My login() looks like (in part): /* I have 3 types of users who might log in. I need to create model for each, rather than use roles, because * their needs are quite different. So, I grab the model name from the users table */ $model_name = $user['User']['model']; $this-User-bindModel(array('hasOne'=array($model_name=array(; /* This allows me to save a bit of personal info and set the default redirect page if there's * no referer. */ switch($model_name) { case 'Admin': $name = $this-User-Admin-getName($user['User']['foreign_key']); $user['User']['name'] = $name['name']; $alt_redirect = '/admin'; break; case 'Member': $name_and_slug = $this-User-Member-getNameAndSlug($user['User']['foreign_key']); $user['User']['name'] = $name_and_slug['name']; $user['User']['slug'] = $name_and_slug['slug']; $alt_redirect = '/'; break; case 'Artist': $name_and_slug = $this-User-Artist-getNameAndSlug($user['User']['foreign_key']); $user['User']['name'] = $name_and_slug['name']; $user['User']['slug'] = $name_and_slug['slug']; $alt_redirect = '/'; break; } /* This is the only change made since yesterday. I added the $alt_redirect so that admins will be sent * to their dashboard page if there's no referer */ $this-Session-write('User', $user['User']); $this-Auth-loginRedirect = Controller::referer($alt_redirect, true); $this-redirect($this-Auth-redirect()); AppController::isAuthorised(): function isAuthorized() { if (isset($this-params[Configure::read('Routing.admin')])) { if ($this-Auth-user('model') != 'Admin') { $this-log('not ok: '.$this-Auth-user('model')); return false; } } $this-log('ok'); return true; } I put the log statements in just now to try to figure out what's going wrong. So, if I browse to: /admin/artists/edit/58 I'm correctly redirected to the login page: /admin/users/login and, in turn, redirected to the edit form and the log says, ok. When I hit submit, sometimes it works, and sometimes I'm sent back to the login page. In the latter case, I never see the not ok: Admin in the log. So, if the problem does not lie with isAuthorised() how/why am I being redirected? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Restricting Login Attempts with Auth Component
Assuming that your blocking their IP, because you think a hacking attempt is taking place. Usually, hacking attempts are performed by robots, and it wouldn't be hard to have the robot retry every 5 minutes. I think storing the IP address in the session isn't useful. If they fail to login after the number of tries, then this IP should be stored in a black list database. The IP address can have a TTL value that expires in say 30 days. What's important is the IP address attacking the website. A robot could attack all the known users for a domain. Where the user name is shown a robot can just process all the account looking for someone stupid enough to use a commonly known password. This would be a strict approach. - Original Message From: aranworld [EMAIL PROTECTED] To: CakePHP cake-php@googlegroups.com Sent: Thursday, May 22, 2008 3:13:57 PM Subject: Restricting Login Attempts with Auth Component I am trying to figure out the most reliable way of restricting login attempts while using the Auth Component. Here is my best stab at the problem thus far: http://cakeforge.org/snippet/detail.php?type=snippetid=220 I'd love to hear what other people have done, or what they think of the method I am using in the code snipped I've linked to. -Aran --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Restricting Login Attempts with Auth Component
There's a brute force protection behavior available over at the bakery: http://bakery.cakephp.org/articles/view/brute-force-protection It may need some changes to make it work with 1.2 but I think it's simple and does it's job. On May 22, 9:13 pm, aranworld [EMAIL PROTECTED] wrote: I am trying to figure out the most reliable way of restricting login attempts while using the Auth Component. Here is my best stab at the problem thus far: http://cakeforge.org/snippet/detail.php?type=snippetid=220 I'd love to hear what other people have done, or what they think of the method I am using in the code snipped I've linked to. -Aran --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: hasOne association
In your Player model: class Player extends AppModel { var $name = 'Player'; var $primaryKey = 'player_id';// -- Without this, Cake assumes that the primary key of your model is named 'id'. var $hasOne = array('Playerstat' = array( 'className' ='Playerstat', 'foreignKey' ='player_id', 'dependent' = true )); } On May 22, 1:30 pm, cooked [EMAIL PROTECTED] wrote: I am stumped with a problem when using model associations. For the some reason the findAll generates an incorrect join query. Will great appreciate any help. Both my models and controllers along with the MySql output is shown below. class Playerstat extends AppModel { var $name = 'Playerstat'; var $belongsTo = array('Player' = array( 'className' = 'Player', 'foreignKey' = 'player_id')); } class Player extends AppModel { var $name = 'Player'; var $hasOne = array('Playerstat' = array( 'className' = 'Playerstat', 'foreignKey' = 'player_id', 'dependent' = true)); } Each Player record has a corresponding Playerstat record. player_id is the primary key in table players and player_id is the foreign key in playerstat. I have the following code in one of my controller function $status = PLAYER_ACTIVE; $results = $this-Player-findAll(Player.active = $status AND Player.level = 'A', array(Player.fname, Player.lname, Playerstat.wins, Playerstat.loss, Playerstat.points, Playerstat.last_played), 'Playerstat.points DESC'); I get the following result from MySql Query: SELECT `Player`.`fname`, `Player`.`lname`, `Playerstat`.`wins`, `Playerstat`.`loss`, `Playerstat`.`points`, `Playerstat`.`last_played` FROM `players` AS `Player` LEFT JOIN `playerstats` AS `Playerstat` ON (`Playerstat`.`player_id` = `Player`.`id`) WHERE `Player`.`active` = 1 AND `Player`.`level` = 'A' ORDER BY `Playerstat`.`points` DESC Warning (512): SQL Error: 1054: Unknown column 'Player.id' in 'on clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 440] The players table does not have an id field it is suppose to be player_id. What I am doing wrong? How can I make id into player_id. Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Restricting Login Attempts with Auth Component
Thanks for the feedback. I will add some database functionality to it as well. One problem I am coming across is that many of my users are all in the same office with identical IP addresses. So if one user makes 5 unsuccessful attempts, I run the risk of locking out everyone else in the office. I'm thinking that I can have a session based lockout set at 5, but then make a database lockout with a much higher limit to compensate for the fact that many users could all enter wrong passwords within a week's time. Even if the limit is as high as 100, I still think that is very likely to combat brute force methods, which usually require 10s of thousands of entries to have any hopes of success. On May 22, 12:58 pm, davidpersson [EMAIL PROTECTED] wrote: There's a brute force protection behavior available over at the bakery:http://bakery.cakephp.org/articles/view/brute-force-protection It may need some changes to make it work with 1.2 but I think it's simple and does it's job. On May 22, 9:13 pm, aranworld [EMAIL PROTECTED] wrote: I am trying to figure out the most reliable way of restricting login attempts while using the Auth Component. Here is my best stab at the problem thus far: http://cakeforge.org/snippet/detail.php?type=snippetid=220 I'd love to hear what other people have done, or what they think of the method I am using in the code snipped I've linked to. -Aran --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using CakePHP to update a wordpress rss feed
Thats what I'm getting at. I want to make sure when I switch my site over from wordpress to CakePHP, I want all the readers who subscribe to my current wordpress rss feed to be automatically subscribed to the new CakePHP generated rss feed. I was wondering how I would do that. When you say 'duplicate the template', what do you mean by that. Isn't an rss feed a specific url? Wouldn't I need to get CakePHP to produce the same file at the same URL? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using CakePHP to update a wordpress rss feed
On May 22, 4:29 pm, Chez17 [EMAIL PROTECTED] wrote: Thats what I'm getting at. I want to make sure when I switch my site over from wordpress to CakePHP, I want all the readers who subscribe to my current wordpress rss feed to be automatically subscribed to the new CakePHP generated rss feed. I was wondering how I would do that. When you say 'duplicate the template', what do you mean by that. Isn't an rss feed a specific url? Wouldn't I need to get CakePHP to produce the same file at the same URL? So either make a route that mirrors the WordPress feed address (so the URL doesn't change) or put a redirect in place. A route is preferable. Routes are covered well in the manual. By duplicating the template, I just mean making an RSS feed with CakePHP that is the same format that is being generated by WordPress. There are several flavors of RSS/Atom, so to keep things simple you can just use whatever is already in 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: $this-Auth-user() cached? - Cake 1.2
Basically, it looks like the Auth data is not refreshed on each page load. I can understand why you wouldn't want to do this - performance notwithstanding - but I've run into a few issues with it myself (primarily dealing with having an online store where the customer could change their email address, etc - all stored in the session, so it didn't actually update when they saved the changes). There's probably an alternate solution, I'm thinking somewhere along the lines of forcing a fresh check against the database every time the page is loaded. Maybe from AppController::beforeFilter(), for example. No idea what form that would take yet though. On May 22, 5:55 pm, b logica [EMAIL PROTECTED] wrote: On Thu, May 22, 2008 at 11:28 AM, theandystratton [EMAIL PROTECTED] wrote: I don't understand what you're trying to do here. Are you trying to refresh the $user variable or the data in the session? I'm trying to find an easy way to refresh the data held in $this-Auth- user() But you're assigning *from* Auth, not *to* it. is that just pointing to the User value in the session? I'm not sure how the Auth object maps to the values in the Session. Yes, Look at the source for Auth::user(). It's grabbing it from the session. Strangely though, I'm suddenly seeing an eerily similar problem in my own app :-/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth heisenbug
On Thu, May 22, 2008 at 3:21 PM, Joel Perras [EMAIL PROTECTED] wrote: Try debugging env('HTTP_REFERER') in addition to what Controller::referer($alt_redirect, true) gives you; your headers might be getting mangled for some reason or other. I just can't imagine how that would affect things though, as these requests are coming after the login request. Cake authorises me, then forgets it for the next request (and sometimes for up to the next 3 or 4 requests). Also, is there a specific reason you are statically accessing the Controller::referer() method instead of using $this-referer() ? No. I have no idea why i wrote it like that. Hadn't noticed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Static Page
Yeah. I hate when newbs have trouble asking questions. It's like they are new to this or something. Thanks for your help b logica. I appreciate it. On May 22, 9:27 am, Joel Perras [EMAIL PROTECTED] wrote: Wow, I should really start taking the time to actually read the snippets posted. On the other hand, if people stop imagining that others can read their minds and start formulating questions that actually address their problem at hand, then they'd probably get more precise answers. -J. On May 22, 10:15 am, b logica [EMAIL PROTECTED] wrote: I suspect that Phaedo--like myself--has a flash() method in AppController that runs the redirect. Note the second param given. I see a few things not quite right with the example. Are you certain that the databas is being updated? There's no version given but, if using 1.2: $this-Sorrow-id = $id; This is superfluous. Better to just use read(). if (empty($this-data)) { $this-set('sorrow', $this-Sorrow-read()); $this-data = $this-Sorrow-read(); Speaking of unnecessary, why do this twice? What are you doing in the view with $sorrow that can't be done with the anonymous (and, perhaps, less glamorous ;-) data array? Anyway, it should be $this-Sorrow-read(null, $id); } else { if ($this-Sorrow-save($this-data['Sorrow'])) { That should be ...save($this-data), AFAICT. $this-flash('Your post has been updated.','/sorrows'); Difficult to say without seeing your flash() method. On Wed, May 21, 2008 at 9:34 PM, Joel Perras [EMAIL PROTECTED] wrote: $this-redirect('name_of_action_you_are_redirecting_to'); Boom-shacka-lacka-boom. -Joel. On May 21, 9:00 pm, phaedo5 [EMAIL PROTECTED] wrote: I have this Edit view in my controller. function edit($id = null) { $this-Sorrow-id = $id; if (empty($this-data)) { $this-set('sorrow', $this-Sorrow-read()); $this-data = $this-Sorrow-read(); } else { if ($this-Sorrow-save($this-data['Sorrow'])) { $this-flash('Your post has been updated.','/sorrows'); } } } I was hoping that it would update the database, which it does, and then redirect to the index view. Am I missing something? Obviously I am, the question is - what am I missing? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Restricting Login Attempts with Auth Component
If you're worried about using just the IP, why not store a browser fingerprint in the database and use that as the mechanism for identifying an identical user? A simple browser fingerprint would be the IP and UserAgent string concatenated toghether, and then hashed (MD5 for instance). Although this technically could lead to duplication eventually, the chances that you'd have multiple hits on the same IP would be greater. You can find more about browser fingerprinting with a simple web search (and find better methods). On May 22, 4:29 pm, aranworld [EMAIL PROTECTED] wrote: Thanks for the feedback. I will add some database functionality to it as well. One problem I am coming across is that many of my users are all in the same office with identical IP addresses. So if one user makes 5 unsuccessful attempts, I run the risk of locking out everyone else in the office. I'm thinking that I can have a session based lockout set at 5, but then make a database lockout with a much higher limit to compensate for the fact that many users could all enter wrong passwords within a week's time. Even if the limit is as high as 100, I still think that is very likely to combat brute force methods, which usually require 10s of thousands of entries to have any hopes of success. On May 22, 12:58 pm, davidpersson [EMAIL PROTECTED] wrote: There's a brute force protection behavior available over at the bakery:http://bakery.cakephp.org/articles/view/brute-force-protection It may need some changes to make it work with 1.2 but I think it's simple and does it's job. On May 22, 9:13 pm, aranworld [EMAIL PROTECTED] wrote: I am trying to figure out the most reliable way of restricting login attempts while using the Auth Component. Here is my best stab at the problem thus far: http://cakeforge.org/snippet/detail.php?type=snippetid=220 I'd love to hear what other people have done, or what they think of the method I am using in the code snipped I've linked to. -Aran --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Auth + AclBehavior and saving an ARO/ACO `alias`
As I've only been using CakePHP for about a week now, I certainly did jump head first in to what seems like one of the harder areas to understand: ACL in version 1.2. From what I can tell, I am beginning to understand how it works, and slowly getting accustomed to the CakePHP way. According to the following mailing list archive: http://groups.google.com/group/cake-php/browse_thread/thread/6262436a44dc38ec/c0fe68290689a938?lnk=gstq=acl+behavior+alias#c0fe68290689a938 ... in order to update the alias field in my ARO/ACO models, I should be using an afterSave method in the model of the instance that was just created (I kind of figured that anyway). However...as I am new, I'm not really sure how I can go about doing this. Once I get to the afterSave() method, printing out the value of $this only shows the newly saved instance's data (and any related models' data). Do I need to run a direct database query on the ARO/ACO table, or is there an object within Cake that I can use to modify pre-saved data within the ARO / ACO tables? Running a direct query to the database just seems like it's not the Cake way... Also...why does the AclBehavior not offer a way to specify the alias upon save if the alias is necessary for most of the Auth/ACL functionality? Is there any reasoning behind it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: I can not solve Session - losing value after redirect problem after I read all previous posts.
I'm having the same problem!!! It simply won't save sessions for me. On Apr 14, 1:49 pm, columbus [EMAIL PROTECTED] wrote: Hi, I am a beginner in both php andcakePHP. I have met the same problem as many previous posts. However, I have tried most of the solutions and it is still not working. I was just following the IBM Tutorial Cook up Web sites fast withCakePHP to learn how to write the script for login. However, after seccessfully login, thesessioninformation such as $_SESSION['user'] were not saved if I use the redirect() function. To sovle the problem, I modified my code so that it will redirect to the same login page and echosessionvariables andsessionid. After redirection, thesessionvariables are missing and thesession id is always the same. If I comment these two lines $this-redirect('/users/login'); $this-exit(); I can see the correctsessionvariables and the samesessionid. That means they were saved. My question is that is it possible to keep thesessionvariables after redirect to other pages without configurate Apache server since it is in the university. The code is as following, and my system is WinXP +Apache2.0.59+MySQL5.0.45+PHP4.4.7+cakePHP1.1.19.6305. Here are the methods I have already tried and did not work. 1.set the security level in core.php to low. 2.apply function exit(); 3.I tried to comment out the lines as Grant Cox mentioned in thesession.php. In users_controller.php function login() { $this-set('error', false); if ($this-data) { $results = $this-User-findByUsername($this-data['User'] ['username']); if ($results $results['User']['password'] ==md5($this-data['User']['password'])) { $this-Session-write('username',$this-data['User'] ['username']); $results['User']['last_login'] = date(Y-m-d H:i:s); $this-Session-write('last_login',$results['User'] ['last_login']); $this-redirect('/users/login'); $this-exit(); } else { $this-set('error', true); } } } In login.thtml ?php var_dump($_SESSION); echo (brsessionid is .session_id()); if ($error) { e('InvalidLogin.br'); } ? Please log in. /p ?php echo $html-formTag('/users/login')? labelUsername:/label ?php echo $html-inputTag('User/username', array('size' = '40')) ? labelPassword:/label ?php echo $html-password('User/password', array('size' = '20')) ? ?php echo $html-submitTag('Login') ? /form ?php echo $html-link('register', '/users/register') ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth + AclBehavior and saving an ARO/ACO `alias`
On 23 May 2008, at 09:51, BrendonKoz wrote: Also...why does the AclBehavior not offer a way to specify the alias upon save if the alias is necessary for most of the Auth/ACL functionality? Is there any reasoning behind it? I would be very interested to hear that as well. The only reason I have ever seen is here: https://trac.cakephp.org/ticket/2942#comment:8 I'm doing this in my controller after a user has been registered successfully: $aroRecord = $this-User-Aro-findByForeignKey($this-User- getLastInsertID()); $aroRecord['Aro']['alias'] = $this-data['User']['username']; $this-User-Aro-save($aroRecord); Guess I could move that to some afterSave() callback, but it works okay. Chrs, Dav --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Including images within plugins?
Hmm, I created main.css within /app/plugins/myplugin/vendors/css. Within index.ctp, which is located within the associated controller's view for the plugin, I call the css() method of the HTML helper as per the following: ?php $html-css('main', 'stylesheet', array('media'='all'), false); ? Instead of attempting to load /myplugin/css/main.css, the function loads /css/main.css. Any idea how I can resolve this? Thanks! :) On May 22, 9:00 am, b logica [EMAIL PROTECTED] wrote: If your forum images are displayed using only your CSS (ie. background-image) then you're good to go. Just put store them within an images dir inside the CSS dir and set all the URLs without any leading slash and they'll be fetched from there. In fact, you'd be half way toward making the forum more easily skinnable. On Thu, May 22, 2008 at 3:15 AM, Dr. Tarique Sani [EMAIL PROTECTED] wrote: On Thu, May 22, 2008 at 12:41 PM, Matt Huggins [EMAIL PROTECTED] wrote: Is it possible to provide images (and other files, such as CSS stylesheets) with a plugin, such that they are accessible via a URL in HTML (such as an IMG tag)? I'm working on a forum plugin, and I'd like it to be as easy to distribute as possible. Since I use some forum-specific images and stylesheets, I'd like to package these up in the plugin, but I'm not sure if it's possible. Images - not possible CSS and JS - put in the vendor of plugin Tarique -- = Cheesecake-Photoblog:http://cheesecake-photoblog.org PHP for E-Biz:http://sanisoft.com = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
how not to clear cache?
Right now I have a shopping_cart_product model. it belows to product model , below is the model code I caching all product view page, but everytime someone add an product, the ShoppingCartProduct, gets update and all my cached product view is deleted, is there anyway I can stop the clearing of cache view when this ShoppingCartProduct is changed. Thank you ? class ShoppingCartProduct extends AppModel { var $name = 'ShoppingCartProduct'; var $belongsTo = array('ShoppingCart', 'Product', 'Subproduct'); } ? www.generics.ws www.genericsmed.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: I can not solve Session - losing value after redirect problem after I read all previous posts.
Try to set SESSION_SECURITY to medium or low in config. Should help. On 23 май, 11:25, Ozzy OG Kush [EMAIL PROTECTED] wrote: I'm having the same problem!!! It simply won't save sessions for me. On Apr 14, 1:49 pm, columbus [EMAIL PROTECTED] wrote: Hi, I am a beginner in both php andcakePHP. I have met the same problem as many previous posts. However, I have tried most of the solutions and it is still not working. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Solving the Mobile / Web Crossover issues - call for Beta testers
Hi CakePHP'ers We have just launched a new service in Beta mode and i was hoping for some help to find some beta testers out there to trial the service. (its free to use). Browse your way over to: http://www.handsetdetection.com/ It is the first step in solving the mobile and web crossover issues which website owners / developers face when someone views their website from any device other than a normal computer (I-phone / mobile phone / PDA etc). For anyone who wants to take part in the beta trial, just clip the code supplied at our site into the website. Then, when someone visits your site, a live request is sent to us, and we return a result back to you on a live basis with details of the device, screen size, GEO IP, make, model and many other fields of information. From that point, you can do one of two things: 1. Depending on the result returned, you can then display an appropriate view for the consumer i.e. A website that will fit their device’s screen size and UI which is controlled by the way in which they are browsing (i-phones suit touch screen menus, N95’s suit joystick controls and so on...) 2. If option 1 is too much of a first leap, after you add the code into your website, you can just login to our online reporting system and view your traffic results based on device make, model, country, city etc... This would be a great first step in understanding whether you are getting traffic to your site from non traditional browsing devices. As I mentioned, we are in Beta stage, so we would value your feedback on this. Hope you get a chance to check it out. Also, if you know of anyone else who may be interested in participating in this Beta stage, I would be grateful if you could pass this message on... Regards, David Manjra skype: dmanjra --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Is creating a digg clone hard for you? How hard?
Take a look at the source code and the number of files of phpdug. click choose download at http://www.kubelabs.com/phpdug/ and select 1.4.2 How much time and money is needed to create a phpdug? Take a look at the index page of phpdug. http://demos.kubelabs.com/PHPDug/ Did you imagine that phpdug would need so many lines of code? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---