Overriding IMAGES and IMAGES_URL
Hi, I am on shared web hosting and I have a directory setup like so: app/ - Frontend application admin/ - Backend application cake/ - Cake core I have an add item page inside admin, which uploads images to admin/ webroot/img and I want to be able to access these from the frontend directory with the $html->image() method, but this will by default look inside app/webroot/img. I can't make a symbolic link there as I am on shared hosting, is there any other way? Regards, WR --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cakePHP and ecommerce security reisks
What your talking about is security through obfuscation and it never works against a persistent hacker. There is no security risk in publishing the DB tables and fields, the risk is in the strength of the passwords for connecting to the DB and the level of access given to particular users - this has nothing to do with cake. winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: A bit of a problem with forms and JavaScript
Use the ID, so if you have a textarea with ID of ModelField, then access using: document.getElementById('ModelField').value = 'whatever value you wish to assign'; Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: database design
I would go with an id field that is an auto-increment and a code field for storing your code numbers. Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Updating a via ajax, although getLastInsertId() or $this->Comment->id does not retrieve the last inserted record.. why?
The last insert id should be set straight after the call to save. What is the SQL output from the call to save? Is the data getting saved correctly? Try assigning it first before using it in the find query like so (shouldn't matter): $last_id = $this->Comment->getLastInsertId(); $this->set('comment', $this->Comment->findAll('id ='.$last_id); Regards, Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Struggling with creating a function and search an array then outputting data based upon results...
You could write a component for checking if the user_id is contained in the data array. So something like: I haven't tested the above! Include this in your controller and then call as $this->voteinfo->userVoted($data, 74); It would be easy to extend this to check if a user responsed to a particular story. Also you have an error in the following: should be Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: save 'modified' field doesn't update
Have you turned on debugging and checked what the generated SQL looks like, does it have the correct value? If not, then print out what data array before the save and check that its set. Failing that, post your code here. Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Oracle and Cake 1.2 on IIS
Answering my own question here, but this problem is due to a bug in cake\libs\model\datasources\dbo\dbo_oracle.php for cake_1.2.0.5146alpha The problem lies in the value function I had to change default: $data2 = str_replace("'", "''", $data); return "'".$data2."'"; break; to default: $data2 = str_replace("'", "''", $data); if (is_numeric($data)) { return $data2; } else {return "'".$data2."'";} break; Hope that helps someone, Bug added Ticket #2813 Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Which editor you use for views ?
notepad++ Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Oracle and Cake 1.2 on IIS
Hi, Just ported my app to work on IIS, Oracle and cake_1.2.0.5146alpha. After some teething problems everything is pretty much working except one small problem. In my controller I have the following function index() { $data = $this->Sitepage->read(); $this->set('data', $data); } Which issues the following warning when viewing index.ctp Warning (2): ociexecute() [function.ociexecute]: ORA-00907: missing right parenthesis [/usr/local/lib/cake/cake_1.2.0.5146alpha/cake/libs/ model/datasources/dbo/dbo_oracle.php, line 291] The SQL query which is the cause of this error is (as output when DEBUG set to 3): SELECT Link.id, Link.url, Link.title, Link.info, Link.sitepage_id, Link.keywords, Link.enabled, Link.submitted_by, Link.display_order, Link.timestamp, Link.filename, Link.filesize, Link.orgfile, Link.mime, Link.link_broken FROM links Link WHERE Link.sitepage_id IN (''1'') ORDER BY display_order ASC As far as I can see, double quotes are being placed around the sitepage ID, so Oracle throws a wobbler. Any ideas? Cheers, Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ajax link call very slow
I have an app which creates over 1500 ajax links, displays about 1000 images on one screen. It takes 7.5 seconds to load. I have ran the xdebug output through WinCacheGrind with some interesting results. HtmlHelper->image is called 1345 times and takes about 0.5 seconds. Creating the image tags myself cuts the time down to under 0.1 seconds. HtmlHelper->link is called 1486 times and takes 0.8 seconds. Creating the links myself cuts the time down to 0.1 seconds. Between the AjaxHelper->remoteFunction, AjaxHelper->link and AjaxHelper->__optionsForAjax calls, Cake takes over 23% of its time, so that equates to about 2 seconds. Creating those links myself results in time under 0.2 seconds, so I'm wondering what the hell its doing behind the scenes. I know it's not often that you will need so many links on a page, but it does make me question what exactly is taking so long to process. Just thought I'd pass on this info in case someone needs to create a large number of links on a page. My advice would be to create the links yourself and steer clear of Cakes inbuilt functions. Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Error: Saving Form to Database
"my boss wants a Confirmation Data page before saving." - would you not have a confirmation page after saving? You can set the data array in kanri_new() like $this->set('data', $this->params); so kanri_cnew() will have the param data. winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Filtering/Searching/Sorting
Sorting: Use the AjaxHelper::sortable helper Think this uses the scriptaculous sortable library?? Filtering - not too sure what you mean by this, but maybe NeatArray::filter, which filters data from an array Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: multiple select
>From the API: selectTag ( $fieldName, $ optionElements, $ selected = null, $ selectAttr = array(), $ optionAttr = null, $ showEmpty = true, $ return = false ) so, 'Choose Value', '1' => 'Automobile'); // selected can be an array of values $selected = $whatever_your_value(s)_is; // Change the size to whatever number of options you want displayed in the dropdown echo $html->selectTag('News/sector', $optionElements, $selected, array('class' => 'category_sector', 'multiple' => 'true', 'size' => '5'), null, true); Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Adding "action" buttons
Check your css file for the 'actions' style, theres probably something thats stopping it from displaying. Try removing the div around the two buttons, if both display, then its the style sheet. Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: model::query different output with different version of php - a bug or?
I always make it a habit of explicitly stating the alias in all my queries like so: SELECT `Chassis`.`a.equipment_id` FROM (select `Chassis`.`equipment_id` from chassis as `Chassis` group by `Chassis`.`equipment_id` LIMIT 3); Which should give you an array like no matter which mysql/PHP version you use: Array ( [0] => Array ( [Chassis] => Array ( [equipment_id] => 1 ) ) ) Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Block field using find()
Thanks very much for this Mariano, a very nice solution. Regards, Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Block field using find()
Hi, I've got a large table (large in regards the number of columns) 'applications' with 40 columns. One of those columns is a BLOB, which holds the contents of a file (held in the database as there are two sides to the application, an internal and external - both of which use the same DB, but not on the same server). Anyway, I want to grab all the application data, minus the BLOB field, but don't wat to have to list every column name in my query. Is there anyway I can do this? Thanks, Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---