CRUD behavior
Hi. I have set up the cake ACL component (as per the book tutorial) and it works 100% when individual permissions are not set. Example: ARO = User/username (User = ARO group, username = ARO user) ACO = controllers/Users/index (controllers = ACO global controller, Users = Users controller, index = function or action) Permission for above in aros_acos table 1,1,1,1 and -1,-1,-1,-1 works. Allows or denys access to index via that user correctly. (inheriting from thier parents working properly aswell) If I set the permissions for index for the user (or group) to 1,1,1,-1 (allow all accept delete or any other combination) the ACL fails and it works exactly the same as deny all (-1,-1,-1,-1). my beforeFilter in apps controller looks like the following below function beforeFilter() { //Configure AuthComponent $this->Auth->userModel = 'emailuser'; $this->Auth->authorize = 'actions'; $this->Auth->loginAction = array('controller' => 'emailusers', 'action' => 'login'); $this->Auth->logoutRedirect = array('controller' => 'emailusers', 'action' => 'login'); $this->Auth->loginRedirect = array('controller' => 'emailusers', 'action' => 'index'); $this->Auth->allowedActions = array('display','register','ajax_register', 'login', 'logout', 'group'); $this->Auth->actionPath = 'controllers/'; } Anyone got any suggestions? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
ACL delete
Question is simple : I need to be able to delete a row (ARO ACO relationship) using the ACL component. Note : I do not mean setting permissions for CRUD to -1-1-1-1 The row needs to be physically removed. CRUD of -1-1-1-1 DOES NOT have the same effect as the row not being there at all. Reason : I have made a ACL interface and need users to inherit permissions from there parent or group. Thanks Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Accessing a directory
I have tried RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/livehelp/(.*)$ RewriteRule ^.*$ - [L] RewriteEngine on RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] but this didnt work either. any suggestions? On Jan 12, 4:07 pm, Unite wrote: > > RewriteEngine on > RewriteRule ^$ app/webroot/ [L] > RewriteRule (.*) app/webroot/$1 [L] > > > thats my .htaccess. so how would I do it? Dont know much > about .htaccess. Thanks > > On Jan 12, 4:00 pm, Kappa wrote: > > > Why not configuring properly the .htaccess ? put a rule before the > > cake routing, > > in that way it will not be remapped in /app/webroot > > > Bye, > > Andrea > > > On Jan 12, 2:33 pm, Unite wrote: > > > > On my servers WWW directory I have cakephp installed and it works. My > > > problem is I want to now add a comercial product to my site that gets > > > accessed usingwww.mydomain.com/livehelp(livehelpisthe commercial > > > package). How or where would I put the livehelp folder so it has the > > > affect ofwww.mydomain.com/livehelp. As far as cakephp goes i know its > > > trying to interpret /livehelp as a controller. So where do i put live > > > help so I can have the desired effect. thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Accessing a directory
RewriteEngine on RewriteRule^$ app/webroot/[L] RewriteRule(.*) app/webroot/$1 [L] thats my .htaccess. so how would I do it? Dont know much about .htaccess. Thanks On Jan 12, 4:00 pm, Kappa wrote: > Why not configuring properly the .htaccess ? put a rule before the > cake routing, > in that way it will not be remapped in /app/webroot > > Bye, > Andrea > > On Jan 12, 2:33 pm, Unite wrote: > > > On my servers WWW directory I have cakephp installed and it works. My > > problem is I want to now add a comercial product to my site that gets > > accessed usingwww.mydomain.com/livehelp(livehelpis the commercial > > package). How or where would I put the livehelp folder so it has the > > affect ofwww.mydomain.com/livehelp. As far as cakephp goes i know its > > trying to interpret /livehelp as a controller. So where do i put live > > help so I can have the desired effect. thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Accessing a directory
On my servers WWW directory I have cakephp installed and it works. My problem is I want to now add a comercial product to my site that gets accessed using www.mydomain.com/livehelp (livehelp is the commercial package). How or where would I put the livehelp folder so it has the affect of www.mydomain.com/livehelp. As far as cakephp goes i know its trying to interpret /livehelp as a controller. So where do i put live help so I can have the desired effect. thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Download location
Hi. Where or how can I make a download location within the cakePHP structure where users can download a file via http? Tried /app/webroot/files/download/file.zip but it doesnt work. 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: Cakephp and Zip
Argh got it. It was the period in the extractTo. thxs On May 16, 4:08 pm, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> wrote: > Well, I have never *ever* worked with ZipArchive, but it seems to me > that extractTo needs to have that first param not empty. Obviously, > only the second param is optional. > > Ref:http://www.php.net/manual/en/function.ziparchive-extractto.php > > Maybe you should try something in the line of $zip->extractTo('.'); ? > > Does this make any sense? > > On May 16, 3:36 pm, Unite <[EMAIL PROTECTED]> wrote: > > > OS = winXP > > WAMP = ver 2; > > > I have the following in my cakephp code > > > $zipPath = realpath(".zip"); > > $zip = new ZipArchive; > > $zip->open($zipPath); > > $zip->extractTo(""); > > $zip->close(); > > > open returns a ZipArchive object; > > extractTo returns no errors > > close returns true > > > From the above you can say that the file has been unzipped because > > close returns true but it hasnt. Nothing has been written to the > > directory or any directory. I know extractTo is running because if i > > pass a directory that directory is created in the correct place. > > Nothing returns and errors and no zip contents has been created. > > I have enabled extension=php_zip.dll in php.ini > > Has anyone ever had this error before. Is php_zip.dll not included > > somewhere its ment to? --~--~-~--~~~---~--~~ 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 Zip
OS = winXP WAMP = ver 2; I have the following in my cakephp code $zipPath = realpath(".zip"); $zip = new ZipArchive; $zip->open($zipPath); $zip->extractTo(""); $zip->close(); open returns a ZipArchive object; extractTo returns no errors close returns true >From the above you can say that the file has been unzipped because close returns true but it hasnt. Nothing has been written to the directory or any directory. I know extractTo is running because if i pass a directory that directory is created in the correct place. Nothing returns and errors and no zip contents has been created. I have enabled extension=php_zip.dll in php.ini Has anyone ever had this error before. Is php_zip.dll not included somewhere its ment to? --~--~-~--~~~---~--~~ 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: Database wont update fast enough
Sorted it out. DONT USE QUERY! Rather use execute if you can. On May 7, 1:18 pm, Unite <[EMAIL PROTECTED]> wrote: > Have now tried using > > $this->User->cacheQueries = false; > > Doesnt work :( > > On May 7, 1:09 pm, Unite <[EMAIL PROTECTED]> wrote: > > > Whats not cakephp except the INSERT INTO. Yes i would use save but i > > was trying everything to see if i can get it to work. And most of it > > isnt the actual code just something i made up so i can illustrate the > > problem. > > > How do you stop cake caching the queries? > > > On May 7, 1:05 pm, "Marcin Domanski" <[EMAIL PROTECTED]> wrote: > > > > > foreach($file_list as $file) { > > > >//read file contents > > > >//search to see if record exists > > > > $user_id = $this->User->query("SELECT id FROM users WHERE > > > > emailaddress = '[EMAIL PROTECTED]'"); > > > >//if record does not exist write record to db > > > > $this->User->query("INSERT INTO users (emailaddress) VALUES > > > > ('[EMAIL PROTECTED]')"); > > > >//get last record inserted > > > > $temp = $this->User->query("SELECT last_insert_id()"); > > > > } > > > > Are you kidding ? this is not even close to cakephp i would be ashamed > > > to show such code on this group. > > > > > On the first loop everything works 100%. > > > > On the second loop even though the email address has been inserted and > > > > is in the DB (supposedly) $user_id still returns empty as if nothing > > > > is there. I put in the sleep command to see if maybe php is running > > > > faster than the database is updating but this has no effect. What can > > > > I do to make sure that all query processes have been completed before > > > > it starts the next loop? > > > > maybe cake is caching the queries ? > > > > -- > > > 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: Database wont update fast enough
Have now tried using $this->User->cacheQueries = false; Doesnt work :( On May 7, 1:09 pm, Unite <[EMAIL PROTECTED]> wrote: > Whats not cakephp except the INSERT INTO. Yes i would use save but i > was trying everything to see if i can get it to work. And most of it > isnt the actual code just something i made up so i can illustrate the > problem. > > How do you stop cake caching the queries? > > On May 7, 1:05 pm, "Marcin Domanski" <[EMAIL PROTECTED]> wrote: > > > > foreach($file_list as $file) { > > >//read file contents > > >//search to see if record exists > > > $user_id = $this->User->query("SELECT id FROM users WHERE > > > emailaddress = '[EMAIL PROTECTED]'"); > > >//if record does not exist write record to db > > > $this->User->query("INSERT INTO users (emailaddress) VALUES > > > ('[EMAIL PROTECTED]')"); > > >//get last record inserted > > > $temp = $this->User->query("SELECT last_insert_id()"); > > > } > > > Are you kidding ? this is not even close to cakephp i would be ashamed > > to show such code on this group. > > > > On the first loop everything works 100%. > > > On the second loop even though the email address has been inserted and > > > is in the DB (supposedly) $user_id still returns empty as if nothing > > > is there. I put in the sleep command to see if maybe php is running > > > faster than the database is updating but this has no effect. What can > > > I do to make sure that all query processes have been completed before > > > it starts the next loop? > > > maybe cake is caching the queries ? > > > -- > > 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: Database wont update fast enough
Whats not cakephp except the INSERT INTO. Yes i would use save but i was trying everything to see if i can get it to work. And most of it isnt the actual code just something i made up so i can illustrate the problem. How do you stop cake caching the queries? On May 7, 1:05 pm, "Marcin Domanski" <[EMAIL PROTECTED]> wrote: > > foreach($file_list as $file) { > >//read file contents > >//search to see if record exists > > $user_id = $this->User->query("SELECT id FROM users WHERE > > emailaddress = '[EMAIL PROTECTED]'"); > >//if record does not exist write record to db > > $this->User->query("INSERT INTO users (emailaddress) VALUES > > ('[EMAIL PROTECTED]')"); > >//get last record inserted > > $temp = $this->User->query("SELECT last_insert_id()"); > > } > > Are you kidding ? this is not even close to cakephp i would be ashamed > to show such code on this group. > > > On the first loop everything works 100%. > > On the second loop even though the email address has been inserted and > > is in the DB (supposedly) $user_id still returns empty as if nothing > > is there. I put in the sleep command to see if maybe php is running > > faster than the database is updating but this has no effect. What can > > I do to make sure that all query processes have been completed before > > it starts the next loop? > > maybe cake is caching the queries ? > > -- > 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 -~--~~~~--~~--~--~---
Database wont update fast enough
I have a function which reads a file from the HDD (works), retrieves information from the file (works), and then writes this information to the database(works). Now my problem comes in when I try loop the function to do the above with multiple files. Everything works except when I query the database the fields haven't been updated from the previous save. example foreach($file_list as $file) { //read file contents //search to see if record exists $user_id = $this->User->query("SELECT id FROM users WHERE emailaddress = '[EMAIL PROTECTED]'"); //if record does not exist write record to db $this->User->query("INSERT INTO users (emailaddress) VALUES ('[EMAIL PROTECTED]')"); //get last record inserted $temp = $this->User->query("SELECT last_insert_id()"); } On the first loop everything works 100%. On the second loop even though the email address has been inserted and is in the DB (supposedly) $user_id still returns empty as if nothing is there. I put in the sleep command to see if maybe php is running faster than the database is updating but this has no effect. What can I do to make sure that all query processes have been completed before it starts the next loop? --~--~-~--~~~---~--~~ 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: Connecting to pervasive.sql database
Sorry also wanted to know if cake-php can connect to the client machine at all, so connect to the clients DB and pull information like that or is it only basically localhost? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Connecting to pervasive.sql database
What would my DB file look like if i wanted to connect to a pervasive (Pastel) database? var $default = array('driver' => 'mysql', 'connect' => 'mysql_connect', 'host' => 'localhost', 'login' => '', 'password' => '', 'database' => 'DEMODATA', 'prefix' => ''); --~--~-~--~~~---~--~~ 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: echo within a echo
Well here is what im trying to do. I have set up a layout in cakephp that will be global. I have a admin section where people can update the contents of the "$content_for_layout" (not really but a contents within $content_for_layout) by using a text area to hard input html/php code into the database. So in a nut shell. The user inputs there html/php into a textbox in the admin section which then gets saved to the DB. When the specific page is loaded it looks in the DB for the code that was input in admin and displays it. I can do this by using html tags for "inputs" but want to keep to the cake format of echo $html->input(""). I have seen the mention of using eval() but that only evaluates php. Hopefully the problem is better understood now. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
echo within a echo
Hey, was wondering if anyone can help me. I have code from a database that uses mixed PHP and HTML. When I try to output it (echo) it doesnt display the page correctly as theres a echo within the DB code. Example Saved in DB : checkbox("User/news"); ?> (Tick for yes) Output on screen: Recieve Specials and Discount Alerts : checkbox("User/news"); ?> (Tick for yes) Saved on webpage: //saved in Hex in the DB So basically I want it to display the check box instead of checkbox("User/news"); ?> Any help much appreciated --~--~-~--~~~---~--~~ 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: echo $content_for_layout;
bump On Jan 9, 1:28 pm, Unite <[EMAIL PROTECTED]> wrote: > Can someone direct me to code that will always put this statement in a > ajax type format so that the whole page doesnt refresh but only the > $content_for_layoutand if JS is disabled loads the interface > normally. Thanks --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
echo $content_for_layout;
Can someone direct me to code that will always put this statement in a ajax type format so that the whole page doesnt refresh but only the $content_for_layout and if JS is disabled loads the interface normally. Thanks --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Problem with html helper
Fatal error: Call to undefined function ife() in /*/public_html/cake/ libs/view/helpers/html.php on line 1020 I get this error. I am using PHP ver 5. Any suggestions as to what can be wrong? Thanks Wade --~--~-~--~~~---~--~~ 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: Only able to view home page
Also noticed cake adds ?CAKEPHP=6b06903f63183a73272e85a4393902b6 to my menu options aswell... any ideas? On Dec 12, 10:40 am, Unite <[EMAIL PROTECTED]> wrote: > www.adslgamer.co.zaif you go here you will see the page loads > perfectly. If you try click on one of the menu links the corresponding > page does not show but I get this error. > > The requested URL /pages/about was not found on this server. > > Additionally, a 404 Not Found error was encountered while trying to > use an ErrorDocument to handle the request. > > The page does exist and works on my local machine but not this server > hosted in another country. Have I set anything wrong in cakephp? If > you need anymore information etc just let me know. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Only able to view home page
www.adslgamer.co.za if you go here you will see the page loads perfectly. If you try click on one of the menu links the corresponding page does not show but I get this error. The requested URL /pages/about was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. The page does exist and works on my local machine but not this server hosted in another country. Have I set anything wrong in cakephp? If you need anymore information etc just let me know. --~--~-~--~~~---~--~~ 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: Inject PHP code into another PHP file.
Thanks a bunch --~--~-~--~~~---~--~~ 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: Inject PHP code into another PHP file.
Ok but is there a way to include a variable string (a blog) instead of a file. (include only works on files)? Looking through the manual now. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Inject PHP code into another PHP file.
Heres the problem I have file 1 with PHP code : File1.php File2.php echo "Wade"; /**/ So out put when you load file1.php looks like this hello how are you wade on this fine day if this can be done instead of file 2 ill have a blog from a db code that just gets inserted. so can this be done and how? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Replacing data in database
Hi. Heres the problem. I have a form which returns values and stores them in a database. When a person presses submit on the form I want the ID to stay the same but the rest of the data in the table to be replaced. What it is doing at the current moment is only replacing the data that has changed. I dont want this. What i want to do is blank all fields in the table then add the new data. Heres the code and will give you a better idea of what im trying to do. Notes id is of type integer and is the primary key and set to auto_increment. $databaseData = $this->Template->query("SELECT * FROM templates WHERE sender_id = ".$sender_id); if(!empty($this->data)) { $this->data['template']['sender_id'] = $sender_id; //putting sender_id into the array if(empty($databaseData)) { $this->Template->id=null; //no template table for this sender so create 1 $this->Template->save($this->data); //save the data (this part works 100%) } else { $this->Template->del($databaseData[0]['templates']['id']); // delete that row to make it "blank/empty" $this->Template->id=$databaseData[0]['templates']['id']; //Go to that ID that was deleted $this->Template->save($this->data); // Save the data to the row with the id that was deleted } } what it does is it keeps increasing the id instead of using the old one. This happens due to auto_increment pointer . Is there any way to bypass this like delete data from the row except the id? Any help would be greatly appreciated. --~--~-~--~~~---~--~~ 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: $html->checkboxTag
function enableField() { alert("hello"); } checkboxTag("customer/ f_name",array("id"=>"f_name","onclick"=>"enableField()")); ?> This onclick isnt even calling the javascript function. plz help! --~--~-~--~~~---~--~~ 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: $html->checkboxTag
Just a bit of further information after testing looks like "onclick"=>"enableField()" doesnt call enableField so onclick isnt working :( --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
$html->checkboxTag
Hi. What I basically want is to when a checkbox is ticked a input field becomes enabled. Its working if i use a button onclick routine but has no effect when i onclick the checkbox. Any help greatly appreciated. function enableField() { if (document.forms['customer'].f_name.checked=true) document.forms['customer'].f_name_rename.disabled=false; if (document.forms['customer'].f_name.checked=false) document.forms['customer'].f_name_rename.disabled=true; } formTag('/invoicetemps/ setup/','post',array('name'=>'customer', 'id'=>'customer'));?> checkboxTag("customer/ f_name",array("id"=>"f_name","onclick"=>"enableField()")); ?> input("customer/f_name_rename",array("value"=>"First Names","disabled"=>"disabled","id"=>"f_name_rename")); ?> --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Maths
I know this isnt really a CakePHP problem but I need help in my logic mathematically and since most of you reading this are Maths geniuses heres the question. I have a array and want to make each set have the highest value in the set. (sets are seperated by 0's) Array ( [0] => 0 [1] => 57.81 [2] => 73.906 [3] => 97.26 [4] => 0 [5] => 32.79 [6] => 77.81 [7] => 28.912 [8] => 0 [9] => 0 [10] => 0 [11] => 0 [12] => 0 [13] => 0 [14] => 27.12 ) becomes Array ( [0] => 0 [1] => 97.26 [2] => 97.26 [3] => 97.26 [4] => 0 [5] => 77.81 [6] => 77.81 [7] => 77.81 [8] => 0 [9] => 0 [10] => 0 [11] => 0 [12] => 0 [13] => 0 [14] => 27.12 ) any help will be greatly appreciated. --~--~-~--~~~---~--~~ 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: $this->setColor for PDF helper
I went to the origonal fpdf site and saw wasn't updated since 2004! Ill have a look through this and see how it goes. Just a couple questions 1) Can it support RGB from 0,0,0 to 255,255,255 2) Can I effectivly draw things to the PDF ( eg - putPixel(x,y) ) 3) Is there documentation with all the functions it can perform on PDF (eg - $this->SetTextColor() with a description of what it does and what the fields mean?) Thanks --~--~-~--~~~---~--~~ 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: $this->setColor for PDF helper
Found out the problem. Helper only seems to know certain colours and if it doesnt know the colour makes it white. It is like it only knows 6 colours. Time to find a new PDF helper. Any advice? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
$this->setColor for PDF helper
Dunno if anyone knows here but there proberbaly are lots of people who do know or used it before. My problem is that $this->setColor function from a pdf helper isnt doing what its ment to do. Sometimes it will give the "graphics" a colour other times will ignore it and remain white. Heres a snipit of the code $this->html2rgb works and has been tested returning 3 values for R G and B from a HTML hash value. even when I say $this->setColor(100,100,100,1); the colour doesnt change. Basically is there something to reset or iniate the pallete or setColour that I am supposed to call? function ezDrawBox($x,$y,$xx,$yy, $data = array(), $values = array()) { $size=10; $height = $this->getFontHeight($size); $width = 0; $y=800-$y; if(!empty($data['bg_colour'])) { $rgb = $this->html2rgb($data['bg_colour']); $this->setColor($rgb[0],$rgb[1],$rgb[2],1); $this->filledRectangle($x,$y+$height,$xx,-$yy-$height); } if(!empty($data['box_name'])) { $rgb = $this->html2rgb($data['border_colour']); $this->setColor($rgb[0],$rgb[1],$rgb[2],1); $width = $this->getTextWidth($size+1,$data['box_name']); $this->addText($x+5,$y+9,$size+1,$data['box_name']); } if($data['hasborder'] == "Yes") { $rgb = $this->html2rgb($data['border_colour']); $this->setStrokeColor($rgb[0],$rgb[1],$rgb[2]); $this->line($x,$y+$height,$x, $y-$yy); $this->line($x,$y+$height,$x+5,$y+$height); $this->line($x+5+$width,$y+$height,$x+$xx,$y+$height); $this->line($x+$xx,$y+$height,$x+$xx, $y-$yy); $this->line($x,$y-$yy,$x+$xx,$y-$yy); } $rgb = $this->html2rgb($data['font_colour']); $this->setColor($rgb[0],$rgb[1],$rgb[2],1); for($i=0;$i<$data['amt_fields'];$i++) if(!empty($data['field'.$i])) $this->addText($x+2,($y-5)-($i*9), $size,$data['field'.$i]); } --~--~-~--~~~---~--~~ 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: Saving to database
Fixed it. Needed a $this->Box->id= null; in if(!empty($temp)) { //incase user skipped that box $this->Box->save($temp); //Writes over old data and pointer doesnt move } On Jul 25, 12:43 pm, Unite <[EMAIL PROTECTED]> wrote: > Heres the problem. I am filling in forms and saving them to a session. > These forms are repeats of themselves so basically in the session a > array of how ever many forms the user made is saved to the session. > Simple terms a session gets saved as a array of a forms data eg: > array(box1,box2,box3.). Now the problem I am having is that if I > try save these forms to a table (exact fields) using a foreach loop > only the last "box" is recorded. It seems to me that the $this->Table->save() > method is just replacing the old data with the new data > > instead of incrementing the id (primary key) so the pointer isnt > moving onto the next record. Is there a way to force this behaviour? > > $templatedata = $this->Session->read('templatedata'); //This is the > array of box's > foreach($templatedata as $temp) { > if(!empty($temp)) { //incase user skipped that box > $this->Box->save($temp); //Writes over old data and pointer > doesnt > move > } > > } > > ** > example of output > ** > Array //if a pr($temp) was in the if statement > ( > [sender_id] => 8 > [index_id] => 2 > [amt_fields] => 2 > [box_name] => j > [bg_colour] => j > [hasborder] => No > [border_colour] => j > [font_colour] => j > [font_style] => j > [field0] => j > [field1] => j > ) > > Array //if a pr($temp) was in the if statement > ( > [sender_id] => 8 > [index_id] => 4 > [amt_fields] => 1 > [box_name] => 5 > [bg_colour] => 5 > [hasborder] => Yes > [border_colour] => 5 > [font_colour] => 5 > [font_style] => 5 > [field0] => 5 > ) > > Array //if a pr($this->Box->findAll()); was at end of function > ( > [0] => Array > ( > [box] => Array > ( > [id] => 1 > [sender_id] => 8 > [index_id] => 4 > [amt_fields] => 1 > [box_name] => 5 > [logo] => > [field0] => 5 > [field1] => j //not ment to be here left over from > first record > [field2] => > [field3] => > [field4] => > [field5] => > [field6] => > [field7] => > [field8] => > [field9] => > [bg_colour] => 5 > [font_colour] => 5 > [font_style] => 5 > [hasborder] => Yes > [border_colour] => 5 > ) > > ) > > } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Saving to database
Heres the problem. I am filling in forms and saving them to a session. These forms are repeats of themselves so basically in the session a array of how ever many forms the user made is saved to the session. Simple terms a session gets saved as a array of a forms data eg: array(box1,box2,box3.). Now the problem I am having is that if I try save these forms to a table (exact fields) using a foreach loop only the last "box" is recorded. It seems to me that the $this->Table- >save() method is just replacing the old data with the new data instead of incrementing the id (primary key) so the pointer isnt moving onto the next record. Is there a way to force this behaviour? $templatedata = $this->Session->read('templatedata'); //This is the array of box's foreach($templatedata as $temp) { if(!empty($temp)) { //incase user skipped that box $this->Box->save($temp); //Writes over old data and pointer doesnt move } } ** example of output ** Array //if a pr($temp) was in the if statement ( [sender_id] => 8 [index_id] => 2 [amt_fields] => 2 [box_name] => j [bg_colour] => j [hasborder] => No [border_colour] => j [font_colour] => j [font_style] => j [field0] => j [field1] => j ) Array //if a pr($temp) was in the if statement ( [sender_id] => 8 [index_id] => 4 [amt_fields] => 1 [box_name] => 5 [bg_colour] => 5 [hasborder] => Yes [border_colour] => 5 [font_colour] => 5 [font_style] => 5 [field0] => 5 ) Array //if a pr($this->Box->findAll()); was at end of function ( [0] => Array ( [box] => Array ( [id] => 1 [sender_id] => 8 [index_id] => 4 [amt_fields] => 1 [box_name] => 5 [logo] => [field0] => 5 [field1] => j //not ment to be here left over from first record [field2] => [field3] => [field4] => [field5] => [field6] => [field7] => [field8] => [field9] => [bg_colour] => 5 [font_colour] => 5 [font_style] => 5 [hasborder] => Yes [border_colour] => 5 ) ) } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Putting a "table" in a scrollable box so to speak
What I want to do is put a row of data in a scrollable box. Any Ideas? Example Company Name Contact Name Contact Tel Random Name 12345678 Company Name, Contact Name and Contact Tel are headings which wont be in the scrollable box and just part of the PHP Page. So all the data must be put into a scrollable box with the correct starting positions always. Just like a list box but with more than 1 set of Data in it and say if theres more than 20 companys it becomes scrollable instead of extending the pages length. If possible also to have a light "seperator" line for the 3 data fields. Is this at all possible? Basically put the below information taken from a database into a scrollable box so it looks like it does here. www.adslgamer.co.za/example.jpg --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How do I?
Below is my controller. What I want to do is post the data from page2 to page3 using a $this->redirect(); Is this possible? Shown in BOLD in the code is where the redirect is. Page 2 has to post to itself for error checking but page 3 needs the post details of 2 when no errors. Is there anyway around it without the use of sessions for example $this->redirect(tests/page3,$this->data);? Thanks Session->write('firstname',$this- >data); $this->set('myname',$this->data); $error=false; if(strlen($this->data['test']['surname'])==0) $error=true; $this->set('error',$error); if((!$error)&&(strlen($this->data['test'] ['surname'])>2)) $this->redirect('tests/page3'); //PASS $this->data to page 3 } function page3() { $myfullname = $this->data['test']['name'] ." " .$this->data['test']['surname']; //values passed from page2 when no errors as if page2 posted directly here instead of to itself. $this->set('fullname',$myfullname); } } ?> My pages Page1 formTag('/tests/page2','post'); echo "Name : "; echo $html->input('test/name'); echo $html->hidden('test/surname',array('value'=>' ')); // Hidden field from page2, has to be here else page 2 will throw up undefined varible errors echo $html->submit("Next",array('class'=>'btn')); ?> Page2 formTag('/tests/page2','post'); echo "Hello " .$myname['test']['name'] .". What is ur surname?"; echo $html->input('test/surname',array('value'=>'')); echo $html->hidden('test/name'); //Hidden field from page1, has to be here else throw up undefined varible errors echo $html->submit("Finish",array('class'=>'btn')); ?> Page3 --~--~-~--~~~---~--~~ 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 button to check if user name exists in database.
Hi. Im new to PHP and Cake PHP but a fast learner and learn by example. Heres the scenario. I am making a sign in system with the option to register. Everything is working 100% on both the sign in and register part. What I would like to do is add a button on the register page that when clicked displays a message if the user name exists or is available in a div tag. My current framework Model : models/user.php Controller : controllers/users_controller.php // minus code So now how would I get that div to update when I press the button? Any help would be really appreciated. Thanks Wade --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---