Re: Creating PDF with cakePHP and TCPDF
I would like to ask to clarify my understanding of the topic of these postings. Generated pdf meaning to convert files into a pdf or just making a file view-able and downloadable as a PDF? On Saturday, September 27, 2014 12:46:05 AM UTC-5, Dakota wrote: I would highly recommend using the Cake PDF plugin from Friends of Cake. It makes PDF generation very easy. You can get It from https://github.com/friendsofcake/cakepdf -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Facebook authentication
I'm new to all of this, php/cakephp/facebook. I'm trying to create a facebook app but ran into a problem with authentication that I can't figure out. I'm using the facebook php-sdk, after I send the user to the facebook loginurl they come back to the page but I still can't get the fb user. If I set the loginurl redirect_uri to a different page like users/home then I can get the fb user and everything works fine, however I want them to come back to the same page. This will not get a user: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = 'http://localhost/app/ users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; This will: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = 'http://localhost/app/ users/home')); echo script type='text/javascript'top.location.href = '$login_url';/script; -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Facebook authentication
It won't load the actual index page because there is no user, it just keeps sending it back to facebook. function index() { $this-set('user_id', $this-facebook-getUser()); if ($this-user_id == 0) { $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = 'http://localhost/to_do_list/users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; } } If I put a link to the login_url on the index page instead of trying to do it automatically it will get the user. On Oct 12, 2:07 pm, Ed Propsner crotchf...@gmail.com wrote: Out of curiosity when Facebook redirects back to http:://localhost/app/users/index if you refresh the page at that point is $this-facebook-getUser() now available? On Wed, Oct 12, 2011 at 1:12 PM, Kyle kyleschr...@gmail.com wrote: I'm new to all of this, php/cakephp/facebook. I'm trying to create a facebook app but ran into a problem with authentication that I can't figure out. I'm using the facebook php-sdk, after I send the user to the facebook loginurl they come back to the page but I still can't get the fb user. If I set the loginurl redirect_uri to a different page like users/home then I can get the fb user and everything works fine, however I want them to come back to the same page. This will not get a user: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/app/ users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; This will: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/app/ users/home')); echo script type='text/javascript'top.location.href = '$login_url';/script; -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Re: Facebook authentication
Thank you, it appears to be working now after changing the following code $this-set('user_id', $this-facebook-getUser()); if ($this-user_id == 0) { to if (!$this-facebook-getUser()) { I had tried otherways of saving facebook-getUser and different if statements but never got it to work. On Oct 12, 4:14 pm, Ed Propsner crotchf...@gmail.com wrote: Be sure to use the newest PHP SDK v3.1.1 and if incorporating social plugins to your site also be sure to use the Javascript SDK in conjunction with the PHP SDK. Try moving your code into the beforeFilter() of your controller: function beforeFilter(){ parent::beforeFilter(); if (!$this-facebook-getUser()){ $loginUrl = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'fbconnect' = 0, 'next' ='http://localhost/to_do_list/users/index'http://localhost/to_do_list/users/index') , 'cancel' = // Cancel url 'canvas' = 1 ) ); echo script type='text/javascript'top.location.href = '$loginUrl';/script; } } On Wed, Oct 12, 2011 at 3:34 PM, Kyle kyleschr...@gmail.com wrote: It won't load the actual index page because there is no user, it just keeps sending it back to facebook. function index() { $this-set('user_id', $this-facebook-getUser()); if ($this-user_id == 0) { $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/to_do_list/users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; } } If I put a link to the login_url on the index page instead of trying to do it automatically it will get the user. On Oct 12, 2:07 pm, Ed Propsner crotchf...@gmail.com wrote: Out of curiosity when Facebook redirects back to http:://localhost/app/users/index if you refresh the page at that point is $this-facebook-getUser() now available? On Wed, Oct 12, 2011 at 1:12 PM, Kyle kyleschr...@gmail.com wrote: I'm new to all of this, php/cakephp/facebook. I'm trying to create a facebook app but ran into a problem with authentication that I can't figure out. I'm using the facebook php-sdk, after I send the user to the facebook loginurl they come back to the page but I still can't get the fb user. If I set the loginurl redirect_uri to a different page like users/home then I can get the fb user and everything works fine, however I want them to come back to the same page. This will not get a user: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/app/ users/index')); echo script type='text/javascript'top.location.href = '$login_url';/script; This will: $login_url = $this-facebook-getLoginUrl(array( 'scope' = 'publish_stream', 'redirect_uri' = ' http://localhost/app/ users/home')); echo script type='text/javascript'top.location.href = '$login_url';/script; -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. 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
Helper in appcontroller making error for form
I made my own helper to check if a user is logged in. When I add the helper to the appcontroller rather than to each individual controller it throws back: Notice (8): Undefined property: View::$Form [APP\views\users \login.ctp, line 3] Fatal error: Call to a member function create() on a non-object in C: \wamp\www\cl\app\views\users\login.ctp on line 3 My login.ctp file is this: h2Login/h2 ?php echo $this-Form-create('User', array('url' = array('controller' = 'users', 'action' ='login'))); echo $this-Form-input('User.username'); echo $this-Form-input('User.password'); echo $this-Form-end('Login'); ? What is causing this? 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: Complex Images Route
Probably but then wouldn't that kind of defeat the purpose of using Cake? On Sep 23, 1:34 am, Vivi Vivi vivianbog...@gmail.com wrote: Maybe can be done within htaccess with rewrite rule. On Thu, Sep 23, 2010 at 8:28 AM, Kyle Decot kyle.de...@gmail.com wrote: I've tried the following w/ no success Router::connect('/:model/:size\_:filename.:extension', array('controller' = 'images', 'action' = 'server'),array( 'model'='(blog|event|users)+', 'size'='(t|m|l|o){1,1}', 'filename'='[a-zA-Z0-9]+', 'extension'='.(gif|png|jpg){3,3}', )); Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.comcake-php%2bunsubscr...@googlegroups.c omFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Vivihttp://photos.vr-3d.net 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
Complex Images Route
I am attempting to make a route that will handle the generation of all of my images. Basically I want it to be something similar to Flickr. For example: http://images.example.com/[models]/[sizes]_[filename].[extension] [models] = (blog|event|user) [sizes] = (t|s|l|o) [filename] = example [extension] = (png|gif|jpg) I don't know how to write the route for this however. I've tried a couple of different ways but I can't seem to get it to work. I'm by no stretch of the imagination an expert of regex. Anyone willing to help me out? 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: Complex Images Route
Anyone? I know this is possible. I've been trying off and on all day today with no success. 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: Complex Images Route
I've tried the following w/ no success Router::connect('/:model/:size\_:filename.:extension', array('controller' = 'images', 'action' = 'server'),array( 'model'='(blog|event|users)+', 'size'='(t|m|l|o){1,1}', 'filename'='[a-zA-Z0-9]+', 'extension'='.(gif|png|jpg){3,3}', )); 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
.manifest File
I created a .manifest file in my webroot folder and I've linked to it in my layout's html tag. The problem is I think that it isn't returning w/ the text/cache-manifest type that is required. How do I go about fixing this? 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
Array to XML
I need to take an array that I have and turn it into something similar to: items perpage = 20 total = 223 page = 1 item created = ... modified = ... textsdfsdfkdsjfdsfljdsflkjdsfkldsjf/text somethingelse thing = foobar / /item /items Is it possible to do this without knowing the exact structure of the array I'm providing. I want to be able to pass it pretty much anything as this will be used in a bunch of methods. Thanks for any help you can provide me with. 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
BeforeFind not being called but AfterFind is
I have two different models, Skatepark and Weather. I am calling $this- Skatepark-read(). The Weather's beforeFind() never gets called but it's afterFind() does. Any ideas why this is happening? 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 To unsubscribe, reply using remove me as the subject.
Re: Subdomain Auth Problem
Since I've done all of your suggestions an I'm still having no success perhaps it's the way that I'm doing my subdomains. Here's how I'm doing it. Let me know what you think. In my routes.php I have: $subdomain = substr(env(HTTP_HOST), 0, strpos(env(HTTP_HOST), .)); if ($subdomain == 'api') { } else if( Then in my hosting cpanel, I go to the subdomains tab and add a new subdomain, and set my cake app directory as the path for the subdomain. Is this an acceptable way of doing this or could this be the cause of my problems. On Mar 8, 5:28 pm, Kyle Decot kdec...@gmail.com wrote: I inserted that but still when I go to blog.mysite.com and do $this-Session-read(); in my app_controller.php's beforeRender() It doesn't contain my user information. Any other ideas or suggestions? On Mar 8, 3:05 pm, Bernardo Vieira bvieira.li...@gmail.com wrote: I have it in my beforeFilter callback in app_controller: $this-Cookie-domain = '.mydomain.tld'; Note that the '.' before your domain name is what tells the browser that the cookie is valid for *.mydomain.tld. On Mon, Mar 8, 2010 at 4:50 PM, Kyle Decot kdec...@gmail.com wrote: Where do I set the realm for the session cookie? The security level in my core.php file is set to low. On Mar 8, 6:47 am, Bernardo Vieira bvieira.li...@gmail.com wrote: You also need to set the realm of the session cookie to your domain (it defaults to the hostname) and set the security level of the security component below 2 On 3/8/10, Kyle Decot kdec...@gmail.com wrote: Well my sessions.save is set to database in my core.php file. Also, I did $session-read() on my www page and I get all of my auth info, however if I do the same thing on, blog.mysite.com then auth is now empty. Any ideas on next steps to take towards solving this? Thanks guy. On Mar 7, 8:36 pm, Nabil Alsharif bli...@gmail.com wrote: My first guess would be that you lost session data when you went to the subdomain. Maybe because the session cookies weren't sent with the requests going to the subdomain or maybe something else, I'm can't see whats happening on your servers The point is it's easy to check if the session was lost, that wold be the first thing I'd look at. Good luck. On Sun, 2010-03-07 at 15:25 -0800, Kyle Decot wrote: Yep. It's all one Cake App. Any ideas? On Mar 7, 11:43 am, cricket zijn.digi...@gmail.com wrote: A subdomain is usually a completely separate site. Do you already have the same Cake app serving all of your subdomains? On Mar 6, 5:34 pm, Kyle Decot kdec...@gmail.com wrote: I have a couple different subdomains on my site but I am having some problems w/ the Auth Component. I login fine under the standard www subdomain but then if I go to a different subdomain, then I am no longer logged in. How do I make sure that my Auth login persists across all of my subdomains? Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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.comcake-php%2bunsubscr...@googlegroups.c omFor more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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.comcake-php%2bunsubscr...@googlegroups.c omFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Sent from my mobile device Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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.comcake-php%2bunsubscr...@googlegroups.c omFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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
Re: Subdomain Auth Problem
Where do I set the realm for the session cookie? The security level in my core.php file is set to low. On Mar 8, 6:47 am, Bernardo Vieira bvieira.li...@gmail.com wrote: You also need to set the realm of the session cookie to your domain (it defaults to the hostname) and set the security level of the security component below 2 On 3/8/10, Kyle Decot kdec...@gmail.com wrote: Well my sessions.save is set to database in my core.php file. Also, I did $session-read() on my www page and I get all of my auth info, however if I do the same thing on, blog.mysite.com then auth is now empty. Any ideas on next steps to take towards solving this? Thanks guy. On Mar 7, 8:36 pm, Nabil Alsharif bli...@gmail.com wrote: My first guess would be that you lost session data when you went to the subdomain. Maybe because the session cookies weren't sent with the requests going to the subdomain or maybe something else, I'm can't see whats happening on your servers The point is it's easy to check if the session was lost, that wold be the first thing I'd look at. Good luck. On Sun, 2010-03-07 at 15:25 -0800, Kyle Decot wrote: Yep. It's all one Cake App. Any ideas? On Mar 7, 11:43 am, cricket zijn.digi...@gmail.com wrote: A subdomain is usually a completely separate site. Do you already have the same Cake app serving all of your subdomains? On Mar 6, 5:34 pm, Kyle Decot kdec...@gmail.com wrote: I have a couple different subdomains on my site but I am having some problems w/ the Auth Component. I login fine under the standard www subdomain but then if I go to a different subdomain, then I am no longer logged in. How do I make sure that my Auth login persists across all of my subdomains? Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 -- Sent from my mobile device 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: Subdomain Auth Problem
I inserted that but still when I go to blog.mysite.com and do $this- Session-read(); in my app_controller.php's beforeRender() It doesn't contain my user information. Any other ideas or suggestions? On Mar 8, 3:05 pm, Bernardo Vieira bvieira.li...@gmail.com wrote: I have it in my beforeFilter callback in app_controller: $this-Cookie-domain = '.mydomain.tld'; Note that the '.' before your domain name is what tells the browser that the cookie is valid for *.mydomain.tld. On Mon, Mar 8, 2010 at 4:50 PM, Kyle Decot kdec...@gmail.com wrote: Where do I set the realm for the session cookie? The security level in my core.php file is set to low. On Mar 8, 6:47 am, Bernardo Vieira bvieira.li...@gmail.com wrote: You also need to set the realm of the session cookie to your domain (it defaults to the hostname) and set the security level of the security component below 2 On 3/8/10, Kyle Decot kdec...@gmail.com wrote: Well my sessions.save is set to database in my core.php file. Also, I did $session-read() on my www page and I get all of my auth info, however if I do the same thing on, blog.mysite.com then auth is now empty. Any ideas on next steps to take towards solving this? Thanks guy. On Mar 7, 8:36 pm, Nabil Alsharif bli...@gmail.com wrote: My first guess would be that you lost session data when you went to the subdomain. Maybe because the session cookies weren't sent with the requests going to the subdomain or maybe something else, I'm can't see whats happening on your servers The point is it's easy to check if the session was lost, that wold be the first thing I'd look at. Good luck. On Sun, 2010-03-07 at 15:25 -0800, Kyle Decot wrote: Yep. It's all one Cake App. Any ideas? On Mar 7, 11:43 am, cricket zijn.digi...@gmail.com wrote: A subdomain is usually a completely separate site. Do you already have the same Cake app serving all of your subdomains? On Mar 6, 5:34 pm, Kyle Decot kdec...@gmail.com wrote: I have a couple different subdomains on my site but I am having some problems w/ the Auth Component. I login fine under the standard www subdomain but then if I go to a different subdomain, then I am no longer logged in. How do I make sure that my Auth login persists across all of my subdomains? Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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.comcake-php%2bunsubscr...@googlegroups.c omFor more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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.comcake-php%2bunsubscr...@googlegroups.c omFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- Sent from my mobile device Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.comcake-php%2bunsubscr...@googlegroups.c omFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en 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: Subdomain Auth Problems
Yep. It's all one Cake App. Any ideas? On Mar 7, 11:43 am, cricket zijn.digi...@gmail.com wrote: A subdomain is usually a completely separate site. Do you already have the same Cake app serving all of your subdomains? On Mar 6, 5:34 pm, Kyle Decot kdec...@gmail.com wrote: I have a couple different subdomains on my site but I am having some problems w/ the Auth Component. I login fine under the standard www subdomain but then if I go to a different subdomain, then I am no longer logged in. How do I make sure that my Auth login persists across all of my subdomains? 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: Subdomain Auth Problem
Well my sessions.save is set to database in my core.php file. Also, I did $session-read() on my www page and I get all of my auth info, however if I do the same thing on, blog.mysite.com then auth is now empty. Any ideas on next steps to take towards solving this? Thanks guy. On Mar 7, 8:36 pm, Nabil Alsharif bli...@gmail.com wrote: My first guess would be that you lost session data when you went to the subdomain. Maybe because the session cookies weren't sent with the requests going to the subdomain or maybe something else, I'm can't see whats happening on your servers The point is it's easy to check if the session was lost, that wold be the first thing I'd look at. Good luck. On Sun, 2010-03-07 at 15:25 -0800, Kyle Decot wrote: Yep. It's all one Cake App. Any ideas? On Mar 7, 11:43 am, cricket zijn.digi...@gmail.com wrote: A subdomain is usually a completely separate site. Do you already have the same Cake app serving all of your subdomains? On Mar 6, 5:34 pm, Kyle Decot kdec...@gmail.com wrote: I have a couple different subdomains on my site but I am having some problems w/ the Auth Component. I login fine under the standard www subdomain but then if I go to a different subdomain, then I am no longer logged in. How do I make sure that my Auth login persists across all of my subdomains? Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 athttp://groups.google.com/group/cake-php?hl=en 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
Subdomain Auth Problems
I have a couple different subdomains on my site but I am having some problems w/ the Auth Component. I login fine under the standard www subdomain but then if I go to a different subdomain, then I am no longer logged in. How do I make sure that my Auth login persists across all of my subdomains? 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
Building API - Problems w/ Passwords
Hey guys. I have an interesting problem that I don't know how to solve. I'm building an API for my site and some of my methods require a api_token which is basically md5(username . md5(password)). The problem is how to do I verify that this is valid when I don't know the original password. All my passwords are hashed w/ $this-Auth- password(). Any suggestions on how to go about this? 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: Help w/ Pagination
My client wants it that way. Not my choice but they're paying the bill. Any ideas how I can do this? On Mar 4, 1:36 am, Walther waltherl...@gmail.com wrote: Why do you want to use those dog ugly query parameters? They are bad for users and bad for SEO. Rather use the CakePHP named parameters (Which the build in pagination does automatically). If you need some help in getting the 'search' term to stay persistent in your pagination come ask on the irc channel (freenode.net #cakephp) On Mar 3, 9:04 pm, Kyle Decot kdec...@gmail.com wrote: I need my page: parameter to appear in my url like /model/index/? page=2search=something How can I get all my parameters to appear in my paging links? 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
Help w/ Pagination
I need my page: parameter to appear in my url like /model/index/? page=2search=something How can I get all my parameters to appear in my paging links? 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
How to dynamically create validation rules
I am creating an API for my website and I want to create validation rules for my various methods based on some rows in my api_arguments table. How should I go about doing this? Thanks for any help. 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: How to Handle images w/ a Route
The original is an image that someone is uploading. I don't want to have to create the 75x75 version when they do the upload. I would like to generate it on the fly when someone tries to access it. I would also like to keep the path similar to the original so I don't have to create something like /images/index/?filename=blahblahblah On Feb 8, 2:48 am, Miles J mileswjohn...@gmail.com wrote: Quick question, why are you routing it to a controller, if the path is basically the same? On Feb 7, 7:19 pm, Kyle Decot kdec...@gmail.com wrote: I store all of my full size images at something like /img/photos/ filename_goes_here.jpg I would like to be able to add a route so that if I visit /img/photos/75x75_filename_goes_here.jpg it will be handled by my images controller. I've tried adding: Router::connect('/img/photos/75x75_*', array('controller' = 'images', 'action' = 'index')); However I get the error: Error: ImgController could not be found. Why is cake trying to connect this to ImgController? How can I fix this so that it will route to images_controller 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
How to Handle images w/ a Route
I store all of my full size images at something like /img/photos/ filename_goes_here.jpg I would like to be able to add a route so that if I visit /img/photos/75x75_filename_goes_here.jpg it will be handled by my images controller. I've tried adding: Router::connect('/img/photos/75x75_*', array('controller' = 'images', 'action' = 'index')); However I get the error: Error: ImgController could not be found. Why is cake trying to connect this to ImgController? How can I fix this so that it will route to images_controller 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
how to setup 3 distinct Layouts: Public / UserLoggedIn / AdminLoggedin ?
Im new to cakephp but I love the concept thus far. I understand how to create views and change the default layout but its unclear to me how to make different layouts with different images and css. My question is... I want to build an application that is designed like the following... LAYOUT1: (public no auth required): Homepage + BlogArticles + Login LAYOUT2: (user logged into system): User Homepage + Links to the parts of the backend System LAYOUT3: (admin user): Admin Homepage + Links to edit and manage all aspects of system Each layout has its own template / views / css /images / etc How do you do this in cakePHP? How do you separate the layouts or define which layout to use in your code? 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
Creating a REST API w/ CakePHP
I am creating an API for my CakePHP site and I am wondering how I should go about authentication? I will be mainly using my API for my iPhone app but would also like to eventually open it up to anyone that would be interested in using it. Any recommendations, or approaches you would suggest would be appreciated. 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: Span Tag
echo li . $html-link(spanLink Text/span,/some/link/,array (),false,false) . /li; On Nov 28, 6:48 pm, Dave make.cake.b...@gmail.com wrote: Any ideas how to accomplish this output code in Cake? lia href=/some/linkspanLink Text/span/a/li I have tried using the $html-link and $html-tag('span', 'Link Text');? in various ways but all I get is lispana href=/some/linkLink Text/a/span/li with the span outside the a Thanks, Dave 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: CakeFest IV - America - Help us pick a location!
Columbus, OH! 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
Subdomain for Controller
How would I go about making my ApiController link to api.example.com/? Thanks for any insight you can provide -- You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-...@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=.
Re: how to get weekdays in drop down, with a default day selected.
echo $form-input('Weekday', array('options' = array ('Monday'='Monday','Tuesday'='Tuesday','Wednesday'='Wednesday','Thursday'='Thursday', 'Friday'='Friday','Saturday'='Saturday', 'Sunday'='Sunday'))); On Nov 10, 1:04 am, cake dhanya@gmail.com wrote: Hi all, I want the weekdays to be displayed in a drop down, with a default day selected. My code is as follows echo $form-input('Weekday', array('options' = array ('Monday','Tuesday','Wednesday','Thursday', 'Friday','Saturday', 'Sunday'))); When I do like this it stores 0 value in database instead of day name. Also I want to set a default selected weekday . Please help!!! Thanking you.. --~--~-~--~~~---~--~~ 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: Sanitize:: clean help
Try echo $form-input(description,array(value=html_entity_decode(@ $this-data[Model][description]))); On Oct 31, 5:29 pm, Dave make.cake.b...@gmail.com wrote: Can someone help me out with this fairly simple question. I am doing: $clean = new Sanitize(); $this-data = $clean-clean($this-data); Now if a user enters quotes brackets or what not it gets converted to lt;scriptgt; which is fine for saving to the db I suppose. But when they go back to edit the entry the input is lt;scriptgt; how can i convert it back to what it was before? So it is readable. I want the data to be safe for the db but also be able to be editable by the end user. I tried echo $form-input(html_entity_decode('description'));but still comes out all mangled Thanks Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Still no answer on how to do this...
Can someone please help me with this? I've tried posting on here and on the IRC channel and no one can seem to figure this out...it this just not possible with cake? All I am trying to do is creating a link using reverse routing and having named params in the URL. On Oct 9, 10:38 pm, Kyle Decot kdec...@gmail.com wrote: I want to set up my website so I can have urls like: sample.com/search/ sample.com/search/q:search+terms/ sample.com/search/country:us/region:oh/ ..etc.. I also want to be able to do reverse routing w/ my links. I have my routes.php set up like: Router::connect('/search/*', array('controller' = 'model', 'action' = 'index')); and then I print a link like: echo $html-url(search,array (controller=model,action=index,q=search terms go here)); but the link comes out as: /model/index/q:search/ What am I doing wrong? I have tried to get an answer to this question before but nobody can seem to tell me the correct way of doing this. Any help you can give me is EXTREMELY appreciated! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Still no answer on how to do this...
I'm using $html-link() not $html-url(); I don't know why I typed that. I don't know what you mean by the first part of your response On Oct 10, 5:29 pm, robust solution i...@robustsolution.net wrote: Dear Kyle Decot I think whenever you define a route in the routes.php you should not repeat the route parameters in every url you want to show... the shortcut is enough this is first... secondly -url is for url for hyperlink use -link On Oct 10, 11:21 pm, Kyle Decot kdec...@gmail.com wrote: Can someone please help me with this? I've tried posting on here and on the IRC channel and no one can seem to figure this out...it this just not possible with cake? All I am trying to do is creating a link using reverse routing and having named params in the URL. On Oct 9, 10:38 pm, Kyle Decot kdec...@gmail.com wrote: I want to set up my website so I can have urls like: sample.com/search/ sample.com/search/q:search+terms/ sample.com/search/country:us/region:oh/ ..etc.. I also want to be able to do reverse routing w/ my links. I have my routes.php set up like: Router::connect('/search/*', array('controller' = 'model', 'action' = 'index')); and then I print a link like: echo $html-url(search,array (controller=model,action=index,q=search terms go here)); but the link comes out as: /model/index/q:search/ What am I doing wrong? I have tried to get an answer to this question before but nobody can seem to tell me the correct way of doing this. Any help you can give me is EXTREMELY appreciated!- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Question about Reverse Routing
Anyone know how to do this? I've yet to figure it out...I'm really stumped On Sep 17, 1:29 pm, Kyle Decot kdec...@gmail.com wrote: Anyone have any other suggestions? I could hardcode the urls, but I would rather use reverse routing if possible. Thanks. On Sep 16, 9:57 pm, Kyle Decot kdec...@gmail.com wrote: Thanks for the reply but I'm not always going to have just the q parameter. For instance, sometimes I have something like: /search/q:search+terms/country:us/region:oh/ /search/country:us/region:oh/city:columbus/ /search/country:us/page:2/ I don't really want to use pass to send it to the controller, I would like to just get them w/ $this-params['named']. On Sep 16, 6:48 pm, brian bally.z...@gmail.com wrote: Try this: Router::connect( '/search/:q', array( 'controller' = 'skateparks', 'action' = 'index' ), array( 'q' = '[\+a-zA-Z]+', 'pass' = array('q') ) ); function index($q = null) { ... } But, personally, I think you should create a search() method and leave index() for listing *all* of your skateparks. On Wed, Sep 16, 2009 at 11:46 AM, Kyle Decot kdec...@gmail.com wrote: Thanks for the reply but I'm still getting the same results. Any other suggestions? On Sep 16, 7:15 am, Martin Westin martin.westin...@gmail.com wrote: I think you can drop the wildcard and it will work. Router::connect('/search', array('controller' = 'skateparks', 'action' = 'index')); /Martin On Sep 16, 4:38 am, Kyle Decot kdec...@gmail.com wrote: I am having a little bit of trouble w/ my reverse routing. In my routes.php file I have: Router::connect('/search/*', array('controller' = 'skateparks', 'action' = 'index')); Then in my view I do something like: $html-link(Search for Something,array (controller=skateparks,action=index,q=search+terms)); I want to get something like: http://localhost/search/q:search+terms/ but instead I get: http://localhost/skateparks/index/q:search+terms/ What is it that I am doing wrong? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Still no answer on how to do this...
I want to set up my website so I can have urls like: sample.com/search/ sample.com/search/q:search+terms/ sample.com/search/country:us/region:oh/ ..etc.. I also want to be able to do reverse routing w/ my links. I have my routes.php set up like: Router::connect('/search/*', array('controller' = 'model', 'action' = 'index')); and then I print a link like: echo $html-url(search,array (controller=model,action=index,q=search terms go here)); but the link comes out as: /model/index/q:search/ What am I doing wrong? I have tried to get an answer to this question before but nobody can seem to tell me the correct way of doing this. Any help you can give me is EXTREMELY appreciated! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
$this-paginate[fields]
I want to append a dynamically created field to my paginated results but when I do $this-paginate['fields'] = Model.first_name as example; It only pulls in that field when what I really want is all the fields it would normally get, plus this one. Is there a way to do this? 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 -~--~~~~--~~--~--~---
Geocoding, Distance, Paginate...
I am paginating some results and if the user provides a address, then I am geocoding the address and doing a radius search. I would like to order those results by distance though. How do I add a dynamically created field (distance) to my paginated results? --~--~-~--~~~---~--~~ 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: Geocoding, Distance, Paginate...
Thanks. That's exactly what I want but with pagination. I also want to order the results by distance. Any idea how to apply this to pagination? On Oct 1, 3:24 pm, Andras Kende and...@kende.com wrote: Hello, This works for me ( not paginating ) $points = $this-find('all', array( 'order' = ' distance ASC, 'fields' = Table.*, (3958 *3.1415926* SQRT(({$y2} - {$y}) * ({$y2} - {$y}) + COS ({$y2} / 57.29578) * COS({$y} / 57.29578) * ({$x2} - {$x}) * ({$x2} - {$x})) / 180) AS distance, 'conditions' = 1=1 HAVING distance = {$distance} )); Andras On Oct 1, 2009, at 2:54 PM, Kyle Decot wrote: I am paginating some results and if the user provides a address, then I am geocoding the address and doing a radius search. I would like to order those results by distance though. How do I add a dynamically created field (distance) to my paginated results? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Generating KML pages
I am attempting to create KML pages for my site but I'm not having any luck. In my routes.php I have: Router::parseExtensions('kml'); I have also created a KML layout at /app/layouts/kml/default.ctp When I go to localhost/my_controller/index.kml though the default layout is being used. How can I fix this? Thank you for any help you can provide. --~--~-~--~~~---~--~~ 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: Question about Reverse Routing
Anyone have any other suggestions? I could hardcode the urls, but I would rather use reverse routing if possible. Thanks. On Sep 16, 9:57 pm, Kyle Decot kdec...@gmail.com wrote: Thanks for the reply but I'm not always going to have just the q parameter. For instance, sometimes I have something like: /search/q:search+terms/country:us/region:oh/ /search/country:us/region:oh/city:columbus/ /search/country:us/page:2/ I don't really want to use pass to send it to the controller, I would like to just get them w/ $this-params['named']. On Sep 16, 6:48 pm, brian bally.z...@gmail.com wrote: Try this: Router::connect( '/search/:q', array( 'controller' = 'skateparks', 'action' = 'index' ), array( 'q' = '[\+a-zA-Z]+', 'pass' = array('q') ) ); function index($q = null) { ... } But, personally, I think you should create a search() method and leave index() for listing *all* of your skateparks. On Wed, Sep 16, 2009 at 11:46 AM, Kyle Decot kdec...@gmail.com wrote: Thanks for the reply but I'm still getting the same results. Any other suggestions? On Sep 16, 7:15 am, Martin Westin martin.westin...@gmail.com wrote: I think you can drop the wildcard and it will work. Router::connect('/search', array('controller' = 'skateparks', 'action' = 'index')); /Martin On Sep 16, 4:38 am, Kyle Decot kdec...@gmail.com wrote: I am having a little bit of trouble w/ my reverse routing. In my routes.php file I have: Router::connect('/search/*', array('controller' = 'skateparks', 'action' = 'index')); Then in my view I do something like: $html-link(Search for Something,array (controller=skateparks,action=index,q=search+terms)); I want to get something like: http://localhost/search/q:search+terms/ but instead I get: http://localhost/skateparks/index/q:search+terms/ What is it that I am doing wrong? --~--~-~--~~~---~--~~ 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: Question about Reverse Routing
Thanks for the reply but I'm still getting the same results. Any other suggestions? On Sep 16, 7:15 am, Martin Westin martin.westin...@gmail.com wrote: I think you can drop the wildcard and it will work. Router::connect('/search', array('controller' = 'skateparks', 'action' = 'index')); /Martin On Sep 16, 4:38 am, Kyle Decot kdec...@gmail.com wrote: I am having a little bit of trouble w/ my reverse routing. In my routes.php file I have: Router::connect('/search/*', array('controller' = 'skateparks', 'action' = 'index')); Then in my view I do something like: $html-link(Search for Something,array (controller=skateparks,action=index,q=search+terms)); I want to get something like: http://localhost/search/q:search+terms/ but instead I get: http://localhost/skateparks/index/q:search+terms/ What is it that I am doing wrong? --~--~-~--~~~---~--~~ 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: Question about Reverse Routing
Thanks for the reply but I'm not always going to have just the q parameter. For instance, sometimes I have something like: /search/q:search+terms/country:us/region:oh/ /search/country:us/region:oh/city:columbus/ /search/country:us/page:2/ I don't really want to use pass to send it to the controller, I would like to just get them w/ $this-params['named']. On Sep 16, 6:48 pm, brian bally.z...@gmail.com wrote: Try this: Router::connect( '/search/:q', array( 'controller' = 'skateparks', 'action' = 'index' ), array( 'q' = '[\+a-zA-Z]+', 'pass' = array('q') ) ); function index($q = null) { ... } But, personally, I think you should create a search() method and leave index() for listing *all* of your skateparks. On Wed, Sep 16, 2009 at 11:46 AM, Kyle Decot kdec...@gmail.com wrote: Thanks for the reply but I'm still getting the same results. Any other suggestions? On Sep 16, 7:15 am, Martin Westin martin.westin...@gmail.com wrote: I think you can drop the wildcard and it will work. Router::connect('/search', array('controller' = 'skateparks', 'action' = 'index')); /Martin On Sep 16, 4:38 am, Kyle Decot kdec...@gmail.com wrote: I am having a little bit of trouble w/ my reverse routing. In my routes.php file I have: Router::connect('/search/*', array('controller' = 'skateparks', 'action' = 'index')); Then in my view I do something like: $html-link(Search for Something,array (controller=skateparks,action=index,q=search+terms)); I want to get something like: http://localhost/search/q:search+terms/ but instead I get: http://localhost/skateparks/index/q:search+terms/ What is it that I am doing wrong? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Detecting an Address inside of a string
When my users enter something like something near 123 Main St, I'd like to be able to detect that and Geocode my results. How would I detect this? Some other examples I'd like to work w/ are: something within 40 miles of 43112 Thanks for any help you can provide --~--~-~--~~~---~--~~ 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: Detecting an Address inside of a string
I can't always geocode the results though because sometimes the users just search for something like free or outdoor. I know it would be impossible to catch ALL of the addresses but I would just like to do the most common ones that I've seen people search for on my website. Perhaps I could have a series of regex's that it goes, though and if a match is found, the geocode is performed, and if not then a full text search or something occurs. I am a novice when it comes to regular expressions so I was hoping someone could give me some examples or their thoughts on the subject. On Sep 15, 6:20 pm, euromark (munich) dereurom...@googlemail.com wrote: which so many possible human formats, this is close to unachievable you could just geocode it anyway which google api etc and maybe they have some smart algorithms the zip, city and adress string itself is not the main problem this can be achieved with only few mistakes by using regex etc. but something like close to, within must be really difficult On 15 Sep., 21:08, Kyle Decot kdec...@gmail.com wrote: When my users enter something like something near 123 Main St, I'd like to be able to detect that and Geocode my results. How would I detect this? Some other examples I'd like to work w/ are: something within 40 miles of 43112 Thanks for any help you can provide --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Question about Reverse Routing
I am having a little bit of trouble w/ my reverse routing. In my routes.php file I have: Router::connect('/search/*', array('controller' = 'skateparks', 'action' = 'index')); Then in my view I do something like: $html-link(Search for Something,array (controller=skateparks,action=index,q=search+terms)); I want to get something like: http://localhost/search/q:search+terms/ but instead I get: http://localhost/skateparks/index/q:search+terms/ What is it that I am doing wrong? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Question about $this-data
I am having a little bit of trouble w/ my $this-data. When someone submits the form, in my beforeValidate() method, I create two new variables inside of $this-data ($this-data['Model']['lat'] $this- data['Model']['lng'])...I I then want to pass those back to the view if the validation of the rest of the form fails but when I pr($this- data) in my view, lat and lng are not there. How do I make sure those values are passed back? Thank you for any help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Question about $this-data
My reasoning behind me wanting to do it this way is because I have an address,city, region, and country fields on my form, and then in my beforeValidate(), I am taking those values and using the Google Map API and if it's a real address w/ a accuracy level of 8, then I add in the lat, lng, and accuracy level variables to my $this-data. So there no way to pass those values back to the view? On Sep 2, 8:50 pm, brian bally.z...@gmail.com wrote: beforeValidate() is a model method. Model has it's own $data. But the $this-data you're thinking of (I think) is handed from the controller to the view. You would have to modify the controller's array, IOW. Perhaps you'd be better off adding those 2 values in Model::beforeSave(). On Wed, Sep 2, 2009 at 3:15 PM, Kyle Decotkdec...@gmail.com wrote: I am having a little bit of trouble w/ my $this-data. When someone submits the form, in my beforeValidate() method, I create two new variables inside of $this-data ($this-data['Model']['lat'] $this- data['Model']['lng'])...I I then want to pass those back to the view if the validation of the rest of the form fails but when I pr($this- data) in my view, lat and lng are not there. How do I make sure those values are passed back? Thank you for any help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Question about $this-data
Here is a little clearer explanation of what I'm doing and what's going wrong: function beforeValidate() { $this-data['Model']['new_var'] = my new variable; } then in my view I do: pr($this-data); My new_var variable is not present. Anyone know what's going on? On Sep 2, 3:15 pm, Kyle Decot kdec...@gmail.com wrote: I am having a little bit of trouble w/ my $this-data. When someone submits the form, in my beforeValidate() method, I create two new variables inside of $this-data ($this-data['Model']['lat'] $this-data['Model']['lng'])...I I then want to pass those back to the view if the validation of the rest of the form fails but when I pr($this-data) in my view, lat and lng are not there. How do I make sure those values are passed back? Thank you for any help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Send Simple Mail With CakePHP !
That's about as easy as you're going to get. The Email Component is pretty straightforward. If you're looking for a really easy way to send simple emails, just use the PHP mail() function. http://www.php.net/manual/en/function.mail.php On Jul 30, 1:27 pm, Abraham Boray abrahambo...@gmail.com wrote: Well that doesn't help me out , i'm new in CakePHP . And I'd like to see a very very simple example to start with =) I searched the web ,but without getting the point HOW TO SEND MAIL WITH CAKEPHP' Hope u undestand me guys Regards Abraham On Jul 30, 3:10 pm, brian bally.z...@gmail.com wrote: Have a look at thishttp://bakery.cakephp.org/articles/view/brief-overview-of-the-new-ema... On Thu, Jul 30, 2009 at 10:43 AM, Abraham Borayabrahambo...@gmail.com wrote: Hey Guys I have a Contact form Like this : form action=comments/UserMailToME method=post name=ContactMeBoard id=ContactMeBoard label for=textfieldname/label input type=text name=textfield id=textfield / label for=textfield2e-mail/label input type=text name=textfield2 id=textfield2 / label for=a_urlsubject/label input type=text name=textfield3 id=textfield3 / label for=textareacomment/label textarea name=textarea id=textarea rows=5/textarea label for=textareanbsp;/label input name=input2 type=submit class=button value=Send / input name=input type=reset value=Reset class=button / /form In which i have this text boxes:: +Name +E-Mail +Subject +Content / *** / And I want the code 4 simple e-mail sending in My UserMailToME action . Regards Abraham --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
YUI Uploader w/ CakePHP
I know this isn't specifically a CakePHP question but I tried posting something about it on the Yahoo Groups page an never received a response. I'm trying to implement the YUI Uploader into my app and everything is going good except when I return the data to the uploader. I am echoing something like this in my images_controller if there is an error: [type:error, message: image is too small]; The problem is that the javascript is reading this as just raw text and not an array. How would I go about having my javascript read this as an array? Thank you for any insight you can provide me with. --~--~-~--~~~---~--~~ 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: Problems w/ Commentia Behavior
Certainly. My tables is just called comments. Here is my Comment Model: ?php class Comment extends AppModel { var $name = 'Comment'; var $actsAs = array('Commentia'); } ? My table structure looks almost identical to the one on your blog but I did add some extra fields (IP address, model). On Jul 5, 5:34 am, Miles J mileswjohn...@gmail.com wrote: May I see your $actsAs? And what are the names of your comments table and the model you are attaching this 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems w/ Commentia Behavior
It's attached to quick a few models (Blog, Skatepark, Event, etc). I'm calling the save from within my comments_controller add() method though. I have it set up a little unusual. In my routes I have: Router::connect(/:m/:slug/comment/,array (controller=comments,action=add),array(pass=array (m,slug))); and then in my comments_controller.php I have: function add($m, $slug) { if($this-RequestHandler-isPost() !empty($this-data)) { $result = (... get the related event, blog post's id by using the $m model and find using the $slug...) $this-data['Comment']['text'] = $this-__sanitizeText($this-data ['Comment']['text']); $this-data['Comment']['model'] = $m; $this-data['Comment']['association_key'] = $result[$m][id']; if($this-Comment-save($this-data)) { } // $this-redirect($this-referer()); } else { $this-render(); } $this-set(comments,$this-Comment-find(all,array (conditions=array(; } On Jul 5, 4:28 pm, Miles J mileswjohn...@gmail.com wrote: Ok but what model are comments attached to? Entry? On Jul 5, 8:06 am, Kyle Decot kdec...@gmail.com wrote: Certainly. My tables is just called comments. Here is my Comment Model: ?php class Comment extends AppModel { var $name = 'Comment'; var $actsAs = array('Commentia'); } ? My table structure looks almost identical to the one on your blog but I did add some extra fields (IP address, model). On Jul 5, 5:34 am, Miles J mileswjohn...@gmail.com wrote: May I see your $actsAs? And what are the names of your comments table and the model you are attaching this 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problems w/ Commentia Behavior
I'm attempting to implement the Commentia Behavior into my website but I'm having some problems. When I submit/save a comment, the comment is saved to the comments table and then it precedes to insert blank rows until it runs out of memory. Any ideas of why this is happening? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
I don't understand this at all
Alright. I have a form and when I submit the form using an image based submit button like ?php echo $form-submit(submit.png); ? two values (x and y) get added to my submitted data so the URL ends up being something like sample.com/?x=40y=30. Each time the x and y values are different. I have no Idea where these values are coming from. If I use a normal submit button like ?php echo $form-submit (submit); ? then the values do not appear. I am baffled by this. Anyone have any idea of what's going on? --~--~-~--~~~---~--~~ 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: I don't understand this at all
Oh okay. Well I don't really want or need those so how do I make it so those values aren't included? On Jun 25, 6:17 pm, Miles J mileswjohn...@gmail.com wrote: They x and y are the coordinates where you clicked your mouse on the image. On Jun 25, 3:04 pm, Kyle Decot kdec...@gmail.com wrote: Alright. I have a form and when I submit the form using an image based submit button like ?php echo $form-submit(submit.png); ? two values (x and y) get added to my submitted data so the URL ends up being something like sample.com/?x=40y=30. Each time the x and y values are different. I have no Idea where these values are coming from. If I use a normal submit button like ?php echo $form-submit (submit); ? then the values do not appear. I am baffled by this. Anyone have any idea of what's going on? --~--~-~--~~~---~--~~ 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: I don't understand this at all
Interesting. I don't know why you would ever need the coordinates of where you clicked the submit button. I decided to just add a method to my AppController to unset those values if they're present. Thanks for the help/info On Jun 25, 6:38 pm, Miles J mileswjohn...@gmail.com wrote: I dont think you can, thats part of HTML not Cake. On Jun 25, 3:20 pm, Kyle Decot kdec...@gmail.com wrote: Oh okay. Well I don't really want or need those so how do I make it so those values aren't included? On Jun 25, 6:17 pm, Miles J mileswjohn...@gmail.com wrote: They x and y are the coordinates where you clicked your mouse on the image. On Jun 25, 3:04 pm, Kyle Decot kdec...@gmail.com wrote: Alright. I have a form and when I submit the form using an image based submit button like ?php echo $form-submit(submit.png); ? two values (x and y) get added to my submitted data so the URL ends up being something like sample.com/?x=40y=30. Each time the x and y values are different. I have no Idea where these values are coming from. If I use a normal submit button like ?php echo $form-submit (submit); ? then the values do not appear. I am baffled by this. Anyone have any idea of what's going on? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to paginate w/ a hasMany condition
I am building a search form and I want the user to be able to select a checkbox to only show results that has photos. My model uses a hasMany = (Photo); How do I write my conditions array? I've tried the following but get an Invalid use of group function. $conditions [] = COUNT(Photo) 0; $this-paginate(MyModel,$conditions); --~--~-~--~~~---~--~~ 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: conditional index
in your controller you could do something like: if($this-Auth-user()) { $this-render(index_logged_in); } else { $this-render(index_logged_out); } On May 25, 9:24 pm, kai k3ho...@gmail.com wrote: For the sake of a better user experience I'd like to change the index page of my website depending on whether someone is logged in or not. If someone isn't logged in it should go to pages/home.ctp. If someone is logged in it should go to listings/search.ctp. What is a way that I can conditionally change the index page? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Getting Tidy
I'm trying to implement HTML Tidy into my project using the code at: http://bakery.cakephp.org/articles/view/getting-tidy I had to modify it a little to get it to work with 1.2 but I'm now having a new problem. The problem is that when a JSON page is requested on my site, Tidy is wrapping the JSON data in basic HTML page tags. How would I go about not having it do this? All I would really like Tidy to do is properly indent my source. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Searchable Behavior w/ Strings less then 3 characters
I am using the Searchable Behavior on my website but I've noticed that if someone types something that is 3 characters or shorter, then nothing is returned. I understand that this is because FullText search is set up this way. Is there any way to change this? I get an awful lot of people that search for things like VA or OH instead of Virginia or Ohio and they get no results returned. Thanks for any help you can provide. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Detecting if a link is to an image
I am building a forum and I want to make it so that if someone enters some text w/ a link to an image in it, my script will take out the link and replace it w/ the image. Anyone know how I would do this? I would also like to do the same thing w/ youtube and vimeo links in the future. Thanks for any insight or help you can provide. --~--~-~--~~~---~--~~ 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: Detecting if a link is to an image
I would prefer not allowing the users to use a WYSIWYG editor. I would rather they use a simple textarea, and if they happen to include a URL in their post, then change that into a link, somewhat like $text- autoLink() but instead of creating links, create img /'s On May 20, 8:46 pm, JamesF usaexportexpe...@gmail.com wrote: you might want to check out the jquery fck editor plugin. i use this in conjunction with jquery to turn my text area inputs into a wysiwyg editor and it saves html to the database. (make sure you sanitize first). so if you were to go this route you first need to get jquery working in its most basic form on your site, than get the fck editor plugin for jquery, then install fck to your vendors folder. explaining in detail would be a bit lengthy but i hope it gives you some ideas. On May 20, 3:10 am, Kyle Decot kdec...@gmail.com wrote: I am building a forum and I want to make it so that if someone enters some text w/ a link to an image in it, my script will take out the link and replace it w/ the image. Anyone know how I would do this? I would also like to do the same thing w/ youtube and vimeo links in the future. Thanks for any insight or help you can provide. --~--~-~--~~~---~--~~ 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: Detecting if a link is to an image
Awesome! It's definetly a step in the right direction. I've already added it here: http://www.theskateparkdirectory.com/forums/industry-news/clear-odyssey-pegs/ I'll probably end up modifying it as there are some other things I would like it to do. Perhaps when it's done, We can post it on the bakery! Thanks! On May 20, 11:03 pm, Andrew McCafferty andrew.mccaffe...@gmail.com wrote: Hi Kyle, I've hacked together a helper based on the TextHelper methods that should do what you're looking for... http://bin.cakephp.org/view/1261676226 Save it to app/views/helpers/autolink.php and include it in your helpers array: var $helpers = array('Html', 'Form', 'Autolink'); And in your view: ?php echo $autolink-images($post['Post']['content']); ? Not very well tested I'm afraid but it should give you some ideas... On 21 May, 02:00, Kyle Decot kdec...@gmail.com wrote: I would prefer not allowing the users to use a WYSIWYG editor. I would rather they use a simple textarea, and if they happen to include a URL in their post, then change that into a link, somewhat like $text- autoLink() but instead of creating links, create img /'s On May 20, 8:46 pm, JamesF usaexportexpe...@gmail.com wrote: you might want to check out the jquery fck editor plugin. i use this in conjunction with jquery to turn my text area inputs into a wysiwyg editor and it saves html to the database. (make sure you sanitize first). so if you were to go this route you first need to get jquery working in its most basic form on your site, than get the fck editor plugin for jquery, then install fck to your vendors folder. explaining in detail would be a bit lengthy but i hope it gives you some ideas. On May 20, 3:10 am, Kyle Decot kdec...@gmail.com wrote: I am building a forum and I want to make it so that if someone enters some text w/ a link to an image in it, my script will take out the link and replace it w/ the image. Anyone know how I would do this? I would also like to do the same thing w/ youtube and vimeo links in the future. Thanks for any insight or help you can provide. --~--~-~--~~~---~--~~ 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: Detecting if a link is to an image
I might look into those. I quickly ran into a problem because I tried to do $text-autoLink($autolink-images($text)); and the autoLink does not have a considerHtml option. Any ideas? On May 20, 11:53 pm, Andrew McCafferty andrew.mccaffe...@gmail.com wrote: Glad it works... You might be better trying out the Textile or BBCode helpers though if you need more flexibility: http://cakeforge.org/projects/textilehelper/http://bakery.cakephp.org/articles/view/bbcode-helper-1 On 21 May, 04:15, Kyle Decot kdec...@gmail.com wrote: Awesome! It's definetly a step in the right direction. I've already added it here: http://www.theskateparkdirectory.com/forums/industry-news/clear-odyss... I'll probably end up modifying it as there are some other things I would like it to do. Perhaps when it's done, We can post it on the bakery! Thanks! On May 20, 11:03 pm, Andrew McCafferty andrew.mccaffe...@gmail.com wrote: Hi Kyle, I've hacked together a helper based on the TextHelper methods that should do what you're looking for... http://bin.cakephp.org/view/1261676226 Save it to app/views/helpers/autolink.php and include it in your helpers array: var $helpers = array('Html', 'Form', 'Autolink'); And in your view: ?php echo $autolink-images($post['Post']['content']); ? Not very well tested I'm afraid but it should give you some ideas... On 21 May, 02:00, Kyle Decot kdec...@gmail.com wrote: I would prefer not allowing the users to use a WYSIWYG editor. I would rather they use a simple textarea, and if they happen to include a URL in their post, then change that into a link, somewhat like $text- autoLink() but instead of creating links, create img /'s On May 20, 8:46 pm, JamesF usaexportexpe...@gmail.com wrote: you might want to check out the jquery fck editor plugin. i use this in conjunction with jquery to turn my text area inputs into a wysiwyg editor and it saves html to the database. (make sure you sanitize first). so if you were to go this route you first need to get jquery working in its most basic form on your site, than get the fck editor plugin for jquery, then install fck to your vendors folder. explaining in detail would be a bit lengthy but i hope it gives you some ideas. On May 20, 3:10 am, Kyle Decot kdec...@gmail.com wrote: I am building a forum and I want to make it so that if someone enters some text w/ a link to an image in it, my script will take out the link and replace it w/ the image. Anyone know how I would do this? I would also like to do the same thing w/ youtube and vimeo links in the future. Thanks for any insight or help you can provide. --~--~-~--~~~---~--~~ 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: adding file upload to existing form
How about if you show us your form code. On May 17, 10:55 pm, mike mwu...@gmail.com wrote: hmm... but if I add the input type file, when I call the save method in the action, it tries to persist the object to the database and I get a sql error On May 8, 10:52 pm, Trevor Fitzgerald fitzt...@gmail.com wrote: You can do it by properly setting the encoding type of the form, then creating an input with type of file. On the action page, print_r $_FILES to see if it's working correctly. It should have uploaded the file to /tmp. Then use PHP's move_uploaded_file to put it where you want it. Save the new path and filename in the database. There are quite a few tutorials around for file uploads but hopefully that will point you in the right direction. You won't need to create a separate model or anything. On Fri, May 8, 2009 at 10:26 PM, mike mwu...@gmail.com wrote: I want to add a file upload to an existing form. I want to save the file somewhere in the file system, and maybe save a reference to it in the database. seems simple enough, but all the examples I've found aren't exactly what I want. I don't want to create a whole different model for the file upload. Can someone point me in the right direction. 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: Safari 4 Keeps Logging Me Out....
I'm using Mac 10.5.7 I can't remember my app logging me out like this in the past. It just started doing this about a month ago. I'm afraid it's something that I modified, added or deleted from my code but I've changed so much stuff lately, I'm not sure where to begin looking. Any ideas on what I can do to diagnose the problem? On May 17, 10:15 pm, ChicagoPlanesTrains myronhay...@gmail.com wrote: Which platform? I've been using Safari 4 on Mac OS X (10.4.11) for a month or two now with no issues. I'm using database sessions for both development and production and have yet to be logged out unexpectedly. Which browsers/versions do you have working? On May 17, 2:05 am, Kyle Decot kdec...@gmail.com wrote: I'm not sure if anyone else is experiencing this problem but Safari 4 keeps logging me out. Sometimes it won't do it for almost 10 minutes and then other times it will do it immediately after logging in. Any ideas on how to fix this? I'm using DB for sessions by the way but have tried PHP and cake and am getting the same results. --~--~-~--~~~---~--~~ 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: Safari 4 Keeps Logging Me Out....
Oh, I didn't see that you had asked which browsers I had working. I've tested it on the following w/ no problems: Firefox 3 (mac) Camino 1.6 (mac) Safari 3 (mac) On May 18, 2:14 am, Kyle Decot kdec...@gmail.com wrote: I'm using Mac 10.5.7 I can't remember my app logging me out like this in the past. It just started doing this about a month ago. I'm afraid it's something that I modified, added or deleted from my code but I've changed so much stuff lately, I'm not sure where to begin looking. Any ideas on what I can do to diagnose the problem? On May 17, 10:15 pm, ChicagoPlanesTrains myronhay...@gmail.com wrote: Which platform? I've been using Safari 4 on Mac OS X (10.4.11) for a month or two now with no issues. I'm using database sessions for both development and production and have yet to be logged out unexpectedly. Which browsers/versions do you have working? On May 17, 2:05 am, Kyle Decot kdec...@gmail.com wrote: I'm not sure if anyone else is experiencing this problem but Safari 4 keeps logging me out. Sometimes it won't do it for almost 10 minutes and then other times it will do it immediately after logging in. Any ideas on how to fix this? I'm using DB for sessions by the way but have tried PHP and cake and am getting the same results. --~--~-~--~~~---~--~~ 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: Safari 4 Keeps Logging Me Out....
Awesome! I set it to false an it fixed the problem. Thanks so much! On May 18, 11:03 am, ChicagoPlanesTrains myronhay...@gmail.com wrote: What is Session.checkAgent set to in your app/config/core.php? If it's true, try setting it to false. I believe this has helped with random log-out. Not sure if these were browser specific, but it might just do the trick. Good luck! Any ideas on what I can do to diagnose the problem? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Constructing my $conditions array
I am attempting to construct my array but am having some problems w/ the $conditions array. I am doing something like: $conditions = array(Model.approved=1); if($something == $something_else) $conditions['Model.something'] = 1; if(!empty($search)) { $criteria[MATCH(SearchIndex.data) ] = AGAINST( . $this-params ['named']['search'] . ') IN BOOLEAN MODE); } This is not making a valid mysql query. It's putting an equals sign right before the AGAINST part. How should I do this? 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: Constructing my $conditions array
Oh, my bad. I must have typed it incorrectly. They should all be $conditions; I'd rather do it in an array because I have a lot of different conditions/fields that can go into the array. Is it possible to do MATCHES in an array? On May 13, 7:20 pm, brian bally.z...@gmail.com wrote: You mention both $conditions $criteria so it's a bit difficult to say for sure. But that last bit would probably work better as one complete string. 'MATCH(SearchIndex.data) AGAINST(\'' . $this-params['named']['search'] . '\') IN BOOLEAN MODE)'; On Wed, May 13, 2009 at 6:37 PM, Kyle Decot kdec...@gmail.com wrote: I am attempting to construct my array but am having some problems w/ the $conditions array. I am doing something like: $conditions = array(Model.approved=1); if($something == $something_else) $conditions['Model.something'] = 1; if(!empty($search)) { $criteria[MATCH(SearchIndex.data) ] = AGAINST( . $this-params ['named']['search'] . ') IN BOOLEAN MODE); } This is not making a valid mysql query. It's putting an equals sign right before the AGAINST part. How should I do this? 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: Constructing my $conditions array
Awesome! I thought when you used an array, you had to provide a key. Thanks Brian! On May 13, 7:41 pm, brian bally.z...@gmail.com wrote: I meant that you can add it to the array, though as a string (ie. no key). $conditions[] = 'MATCH(SearchIndex.data) AGAINST(\'' . $this-params['named']['search'] . '\') IN BOOLEAN MODE)'; On Wed, May 13, 2009 at 7:24 PM, Kyle Decot kdec...@gmail.com wrote: Oh, my bad. I must have typed it incorrectly. They should all be $conditions; I'd rather do it in an array because I have a lot of different conditions/fields that can go into the array. Is it possible to do MATCHES in an array? On May 13, 7:20 pm, brian bally.z...@gmail.com wrote: You mention both $conditions $criteria so it's a bit difficult to say for sure. But that last bit would probably work better as one complete string. 'MATCH(SearchIndex.data) AGAINST(\'' . $this-params['named']['search'] . '\') IN BOOLEAN MODE)'; On Wed, May 13, 2009 at 6:37 PM, Kyle Decot kdec...@gmail.com wrote: I am attempting to construct my array but am having some problems w/ the $conditions array. I am doing something like: $conditions = array(Model.approved=1); if($something == $something_else) $conditions['Model.something'] = 1; if(!empty($search)) { $criteria[MATCH(SearchIndex.data) ] = AGAINST( . $this-params ['named']['search'] . ') IN BOOLEAN MODE); } This is not making a valid mysql query. It's putting an equals sign right before the AGAINST part. How should I do this? 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: confirm message
Try this: echo $html-link($html-image(delete.png,array (alt=Delete,title=Delete)),$html-url(array (controller=users,action=delete)),array(),Are you sure to delete user?,false); On May 10, 2:09 pm, paulos nikolo paulitosthe...@gmail.com wrote: I tried to use html-link as you said but i can't make it work.I wonder what is the solution. 2009/5/10 Enrique enrique.jaco...@gmail.com The url array is only that: an URL array, i.e. there is no confirm parameter here. What I would do is putting the image in a $html-link() and use it's confirm parameter and disable the HTML escape (to output the image tag correctly). Maybe there is another way, looking at the cake HTML helper source code often helps (how the parameters are passed through) ;-) On 10 Mai, 14:13, Paulos23 paulitosthe...@gmail.com wrote: Hi peeps, Well i am creating some nice crud functionality and i use some images.All working perfect but i have problem with the delete action coz i want a confirm message to appear when user tries to delete.What am i doing wrong?Here is my example code: ?php echo $html-image(delete.png, array(alt = Delete,title=Delete,'url' = array('controller' = 'users', 'action' = 'delete',$user['User']['id'],array(),Are you sure to delete user? )));? The action works fine but no message displayed! Any help would be nice. Ty in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: user preferences on a social site
I agree w/ Brian. On my site, I have all my user preferences stored in my profiles table. On May 10, 1:57 pm, brian bally.z...@gmail.com wrote: On Sun, May 10, 2009 at 1:33 PM, park park@gmail.com wrote: On an social site, users may change preferences on whether their profiles are open for strangers, or whether their actions are posted to the newsfeed section. In cake, what's the best practice for implementing this functionality? Will ACL work well on this? Or is there any other solutions? I don't think this would be a good use of ACL. If a user's profile is either open to all or to none, it'd be simpler to set a flag in the model (thus, table). And the newsfeed pref doesn't really square with ACL at all. Again, just set a flag in the User (or Profile) table. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: I Keep getting logged out
I've tried setting Session.save to cake and database but am still having the issue. It's hard to track as it is unpredictable and happens randomly. Any other suggestions? Thanks! On Apr 20, 4:35 am, Dr. Loboto drlob...@gmail.com wrote: If Session.save = 'php' it may be caused by other sites on same server that use short sessions. In this case Session.save = 'cake' will help. On Apr 20, 2:26 pm, Kyle Decot kdec...@gmail.com wrote: I've started to get logged out of my website every couple of minutes and I'm not really sure why. I set the Security level to low but that didn't help any. It doesn't really happen on any particular part of my site, just kind of random. Any ideas on how I can determine what's causing this? Thank you as always --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
What's Wrong w/ This Loop?
I am attempting to make a loop that goes through all the tags a user has provided(comma seperated) and then if it's not already in the tags table, save it then add it to the event they just added. I can't seem to get it to work because $tag_id is always the same for all the tags so only the last tag is saved. Any thoughts? function __saveTags($tags=array(),$event_id=) { if(!empty($tags)) { foreach($tags as $t) { if($this-Event-Tag-find('count',array(conditions=array (Tag.type=Event,Tag.name=$t))) == 0) { $this-data = array(Tag=array(type=Event,name=$t)); $this-Event-Tag-save($this-data); $tag_id = $this-Event-Tag-getLastInsertID(); $this-Event-query(INSERT INTO events_tags (tag_id,event_id) VALUES(' . $tag_id . ',' . $event_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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What's Wrong w/ This Loop?
Thanks, the create() fixed everything and I didn't know there was a Tag Behavior, I'll look into that! On May 3, 7:28 pm, brian bally.z...@gmail.com wrote: It's likely because you're not calling create() before each save. In any case, that code is a bit unweildy. You can save yourself a lot of trouble by using TagBehavior: http://bakery.cakephp.org/articles/view/simple-tagging-behavior No muss, no fuss. Ain't the Bakery grand? On Sun, May 3, 2009 at 7:11 PM, Kyle Decot kdec...@gmail.com wrote: I am attempting to make a loop that goes through all the tags a user has provided(comma seperated) and then if it's not already in the tags table, save it then add it to the event they just added. I can't seem to get it to work because $tag_id is always the same for all the tags so only the last tag is saved. Any thoughts? function __saveTags($tags=array(),$event_id=) { if(!empty($tags)) { foreach($tags as $t) { if($this-Event-Tag-find('count',array(conditions=array (Tag.type=Event,Tag.name=$t))) == 0) { $this-data = array(Tag=array(type=Event,name=$t)); $this-Event-Tag-save($this-data); $tag_id = $this-Event-Tag-getLastInsertID(); $this-Event-query(INSERT INTO events_tags (tag_id,event_id) VALUES(' . $tag_id . ',' . $event_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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Question about Buildin an API
I am creating a API for my website and I had a couple of questions. How do I keep track of who is accessing the API? How would I implement something where they needed at key to have access? I am also planning on making an iPhone app to go along w/ my website. How do I make it so that my app is the only thing that can have access to that part of the API? 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 -~--~~~~--~~--~--~---
Getting a specific URL out of a string
I know this isn't specifically a CakePHP question but I thought I would see any any of you could help me out anyways. I am getting a feed of Twitter updates and I want to check each one to see if it has a http://twitpic.com URL in it. How would I go about getting the TwitPic URL out of it? I know it will be some sort of regex but I am no good at them so I was hoping someone could help me out. Thanks as always for any help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Getting a specific URL out of a string
What does PREG_SET_ORDER do exactly? When I use it I get a Invalid flags specified error. Thank Ideas? On Apr 28, 12:11 pm, brian bally.z...@gmail.com wrote: This should match the URL followed by anything other than whitespace or double quote. $pattern = '/(http:\/\/twitpic\.com[^\s\]+)/'; preg_match($pattern, $str, $matches, PREG_SET_ORDER); debug($matches); On Tue, Apr 28, 2009 at 7:54 AM, Kyle Decot kdec...@gmail.com wrote: I know this isn't specifically a CakePHP question but I thought I would see any any of you could help me out anyways. I am getting a feed of Twitter updates and I want to check each one to see if it has ahttp://twitpic.com URL in it. How would I go about getting the TwitPic URL out of it? I know it will be some sort of regex but I am no good at them so I was hoping someone could help me out. Thanks as always for any help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
I Keep getting logged out
I've started to get logged out of my website every couple of minutes and I'm not really sure why. I set the Security level to low but that didn't help any. It doesn't really happen on any particular part of my site, just kind of random. Any ideas on how I can determine what's causing this? Thank you as always --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Question about building a forum
I want to build a forum for my website but I have a question about the URL structure. I want it to be something like: example.com/forum/top-category/sub-category-1/sub-category-2/.. (etc).../thread-name/ How would I do this in the routes file? Any thoughts? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Can't get Geocoded Behavior to work correctly.
I am trying to create a search by distance feature using the Geocoded behavior but I am having an odd problem. Whenever I search for something, no results are returned unless I change the radius to something incredibly high like 6000 miles. I looked at the query that it is creating and it is saying that all my locations are anywhere from 5000 miles to 9000 miles away! Here is the query I used to find how far away everything is from my location. It's just a simplified version of what the geocoded behavior is making. SELECT (3958 * 3.1415926 * SQRT((`Skatepark`.`lat` - -82.713132) * (`Skatepark`.`lat` - -82.713132) + COS(`Skatepark`.`lat` / 57.29578) * COS(-82.713132 / 57.29578) * (`Skatepark`.`lon` - 39.8141202) * (`Skatepark`.`lon` - 39.8141202)) / 180) AS distance,Skatepark.id FROM skateparks as Skatepark ORDER BY Distance ASC I'm not sure why this is happening. Any thoughts? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: JQuery UI on cake
I have my jquery stuff set up like: webroot |_ js |_ jquery |_ jquery.js |_ ui |_ core.js |_ accordion.js Then in my view I do: ?php echo $javascript-link(array(jquery/jquery.js,jquery/ui/ core.js,jquery/ui/accordion.js),false); ? div id = accordion !-- Put your accordion stuff here -- /div script type = text/javascript $(function () { $(#accordion).accordion({ // options go here }); }); /script On Feb 27, 2:40 pm, BrendonKoz brendon...@hotmail.com wrote: Is it possible to be even a bit more specific? Is jQuery being successfully loaded in to your CakePHP page? Is the jQuery UI script successfully loaded? Are you having problems loading the two scripts in to your layout, or afterward? You can check the source of your rendered page to see if the path to your scripts are being loaded properly. Do you have a web-accessible version of this page to see what may be the problem? jQuery is meant to be unobtrusive, meaning you don't have to do anything special with CakePHP to get it to work (once all the scripts are included). So, it's hard to say what the problem is. You do not need scriptaculous or prototype to work with jQuery. Think of scriptaculous as the effects (UI) library for the Prototype JS library. On Feb 27, 2:27 pm, Stu greenmushroo...@gmail.com wrote: To be a bit more specific, I want to implement this guy:http://docs.jquery.com/UI/Accordion I tried it out in a simple html and it worked fine, but Cake on the other hand does a good job at refuting my JQuery codes. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Can't get JSON to work!
I'm attempting to integrate a YUI Chart into the admin side of my application but I'm having no success. If I directly go to the json page that I want via the browser, then everything works fine, however when the chart attempts to pull in the json page, I am getting a 404. I have tried this in both Firefox 3 and Safari 3. Any ideas? I'm stumped! --~--~-~--~~~---~--~~ 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: ORDER BY Rating
Anyone have any ideas? I'm under somewhat of a time constraint. Thank you for your help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ORDER BY Rating
Surely. It basically looks like what is below. I have removed some validation code though to make it more readable. ?php class Skatepark extends AppModel { var $name = 'Skatepark'; var $belongsTo = array(State,PadRequirement,User); var $hasOne = array(SearchIndex); var $hasAndBelongsToMany = array(Sport,Surface,Tag); var $actsAs = array ('Searchable'); var $hasMany = array('Rating',Comment','Photo',Event); } ? On Feb 17, 4:53 am, Miles J mileswjohn...@gmail.com wrote: Can I see your Skatepark model. --~--~-~--~~~---~--~~ 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: ORDER BY Rating
I tried both ways that you suggested. I'm still getting a undefined column for Rating.score On Feb 17, 2:27 am, Kyle Decot kdec...@gmail.com wrote: It still doesn't seem to be working. After looking at the query it is generating, it doesn't seem to be including any of my hasMany items. Any thoughts? On Feb 17, 2:14 am, Miles J mileswjohn...@gmail.com wrote: Well if your trying to get the score from the Skatepark model: $this-Skatepark-find('all', array( 'order' = 'AVG(Rating.score)', 'limit' = 10, 'contain' = array('Rating') )); You would need the containable behavior OR remove the contain and make the recursive higher. $this-Skatepark-find('all', array( 'order' = 'AVG(Rating.score)', 'limit' = 10, 'recursive' = 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ORDER BY Rating
I am trying to create a top 10 list for my website but I'm having some trouble getting my find query to work. Currently I have something like: $top = $this-Model-find('all',array('order'=AVG (Rating.score),limit=10)); When I do this however I'm getting the following error: Unknown column 'Rating.score' in 'order clause' Any ideas on how to fix this or a better approach to use? 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: ORDER BY Rating
That doesn't work. It doesn't seem to be including my Rating table along with my main model. On Feb 16, 11:42 pm, Miles J mileswjohn...@gmail.com wrote: Try 'order' = 'COUNT(*) DESC' --~--~-~--~~~---~--~~ 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: ORDER BY Rating
Sorry for the confusion. I have a Skatepark modal and a Rating Model. In my Skatepark model, I have: $hasMany = array(Rating); In my rating table, I have a column called score. I'm trying to get the 10 highest averages of the skateparks. Hope this cleans up what I'm trying to accomplish. On Feb 17, 1:41 am, Miles J mileswjohn...@gmail.com wrote: I misread your post. Its saying that the score column does not exist in the Rating (ratings) table. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ORDER BY Rating
It still doesn't seem to be working. After looking at the query it is generating, it doesn't seem to be including any of my hasMany items. Any thoughts? On Feb 17, 2:14 am, Miles J mileswjohn...@gmail.com wrote: Well if your trying to get the score from the Skatepark model: $this-Skatepark-find('all', array( 'order' = 'AVG(Rating.score)', 'limit' = 10, 'contain' = array('Rating') )); You would need the containable behavior OR remove the contain and make the recursive higher. $this-Skatepark-find('all', array( 'order' = 'AVG(Rating.score)', 'limit' = 10, 'recursive' = 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problem w/ Shells
I'm trying to create a shell but I'm running into some problems. If I add $uses = array(User); to my shell then I get: Error: Missing Database Connection. Try 'cake bake' Any ideas? I'm new to shells so I have no clue. Any help is, as always, appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem w/ Shells
Anyone have 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem w/ Shells
I figured out what the problem was. I was incorrectly specifying the path to my 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cron Job Hostgator
I've put what you suggested into my Cron Manager on my HostGator admin panel but I am receiving an email that says: TERM environment variable not set. 1 Any ideas? Thank you as always! On Jan 21, 2:53 am, Martin Westin martin.westin...@gmail.com wrote: You type (paste) something like this into a terminal window: /path/to/cake/console/cake -app /path/to/cake/app you then add the name of theshellyou want to run. My cron task is called hourly as in my previous post. When running this as a cron job (= automatically) I have found the return from theshellcauses problems so I add / dev/null 21 at the end which swallows any output. On your Mac you might not want to run it as a cron. But if you do there are applications to download that give you a graphical tool to set cron jobs (or Apple's replacement as the case may be). The actual cron tools are aparently now seen av deprecated by Apple (sigh) but they are still there. /Martin On Jan 20, 2:57 pm,KyleDecotkdec...@gmail.com wrote: I'm really confused aboutshelltasks. How would I invoke the task? I know that I would use terminal (I'm on a mac) but how would I do this? Second, how do you automate this process so that it would run every hour? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
For anyone that is attempting the same thing as me, I solved the problem by doing: App::import(Component,Email); $this-Email = new EmailComponent(); $this-Email-startup($this); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
Well if I remove the App::import(... and load the Email Component via the components var, then everything goes smoothly. I would like to avoid this however since this function is used across a large number of controllers but I'd really like to load it only when needed, as my app is already beginning to run slow. Any ideas? On Feb 9, 11:43 am, brian bally.z...@gmail.com wrote: Well, I'm certainly no expert, so you might well benefit from someone else jumping in here. ;-) Try removing these lines: App::import(Component,Email); $this-Email = new EmailComponent(); ... as well as the inititlaize line I suggested. Then, add this line to the top of AppController: public $components = array('Email'); (replace public with var if you're stuck with PHP4.x) See if that works. I have a feeling the problem stems from the fact that you're importing a component into AppController, rather than loading it in the normal fashion. If you don't send email from many controllers, this may not be the most efficient way, but you'll at least be a bit closer to figuring out why it's failing for you. The crux of it is that the component isn't getting a handle to the controller for some reason. On Mon, Feb 9, 2009 at 2:29 AM, Kyle Decot kdec...@gmail.com wrote: When trying to use the initialize method, I get a undefined method error: Fatal error: Call to undefined method EmailComponent::initialize() in / home/affinit3/public_html/theskateparkdirectory/app/app_controller.php on line 60 Any ideas? On Feb 9, 2:22 am, brian bally.z...@gmail.com wrote: change the method name to _sendEmailNotification (single underscore) to make it protected, rather than private $this-Email = new EmailComponent(); $this-Email-initialize($this); Those are the only things that I can think of. I've never imported a component inside of an AppController method - private, protected, or public. Maybe that's the problem? On Mon, Feb 9, 2009 at 1:57 AM, Kyle Decot kdec...@gmail.com wrote: Ah, stupid mistake but I've updated the set to be body instead of email_body and am still getting the same results. Any other ideas? On Feb 9, 1:55 am, brian bally.z...@gmail.com wrote: sorry, I should have unquoted that. This should be clearer. $this-set(email_body,$body); Notice (8): Undefined variable: body [APP/views/elements/email/html/ email_notification.ctp, line 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
I tried changing the method to be public but the problems still persist. Any other suggestions? I'm really stumped on this! On Feb 9, 1:51 pm, brian bally.z...@gmail.com wrote: Well, you're closer to a solution, at least. AFAIK, you shouldn't need to do anything special with the component after loading with App::import(). But, the component is obviously missing a handle to the controller. So, the problem might be a combination of the fact that you're doing this in AppController and that the method is private/protected. You could try making it a public method. That last bit is not much better than a wild guess, though. On Mon, Feb 9, 2009 at 1:27 PM, Kyle Decot kdec...@gmail.com wrote: Well if I remove the App::import(... and load the Email Component via the components var, then everything goes smoothly. I would like to avoid this however since this function is used across a large number of controllers but I'd really like to load it only when needed, as my app is already beginning to run slow. Any ideas? On Feb 9, 11:43 am, brian bally.z...@gmail.com wrote: Well, I'm certainly no expert, so you might well benefit from someone else jumping in here. ;-) Try removing these lines: App::import(Component,Email); $this-Email = new EmailComponent(); ... as well as the inititlaize line I suggested. Then, add this line to the top of AppController: public $components = array('Email'); (replace public with var if you're stuck with PHP4.x) See if that works. I have a feeling the problem stems from the fact that you're importing a component into AppController, rather than loading it in the normal fashion. If you don't send email from many controllers, this may not be the most efficient way, but you'll at least be a bit closer to figuring out why it's failing for you. The crux of it is that the component isn't getting a handle to the controller for some reason. On Mon, Feb 9, 2009 at 2:29 AM, Kyle Decot kdec...@gmail.com wrote: When trying to use the initialize method, I get a undefined method error: Fatal error: Call to undefined method EmailComponent::initialize() in / home/affinit3/public_html/theskateparkdirectory/app/app_controller.php on line 60 Any ideas? On Feb 9, 2:22 am, brian bally.z...@gmail.com wrote: change the method name to _sendEmailNotification (single underscore) to make it protected, rather than private $this-Email = new EmailComponent(); $this-Email-initialize($this); Those are the only things that I can think of. I've never imported a component inside of an AppController method - private, protected, or public. Maybe that's the problem? On Mon, Feb 9, 2009 at 1:57 AM, Kyle Decot kdec...@gmail.com wrote: Ah, stupid mistake but I've updated the set to be body instead of email_body and am still getting the same results. Any other ideas? On Feb 9, 1:55 am, brian bally.z...@gmail.com wrote: sorry, I should have unquoted that. This should be clearer. $this-set(email_body,$body); Notice (8): Undefined variable: body [APP/views/elements/email/html/ email_notification.ctp, line 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
Thanks for all your help but I'm still getting an undefined function for init as well as the other errors. Does anyone else have any ideas? Brian and myself are all out of them! On Feb 9, 6:56 pm, brian bally.z...@gmail.com wrote: Actually, yes, I think I have one more idea. When I suggested calling $this-Email-initialize($this) I think that I should have said $this-Email-init($this) So, go back to what you had initially (heh): App::import(Component,Email); $this-Email = new EmailComponent(); $this-Email-init($this); If that doesn't work, I'm afraid you'll need to consult an expert. On Mon, Feb 9, 2009 at 6:28 PM, Kyle Decot kdec...@gmail.com wrote: I tried changing the method to be public but the problems still persist. Any other suggestions? I'm really stumped on this! On Feb 9, 1:51 pm, brian bally.z...@gmail.com wrote: Well, you're closer to a solution, at least. AFAIK, you shouldn't need to do anything special with the component after loading with App::import(). But, the component is obviously missing a handle to the controller. So, the problem might be a combination of the fact that you're doing this in AppController and that the method is private/protected. You could try making it a public method. That last bit is not much better than a wild guess, though. On Mon, Feb 9, 2009 at 1:27 PM, Kyle Decot kdec...@gmail.com wrote: Well if I remove the App::import(... and load the Email Component via the components var, then everything goes smoothly. I would like to avoid this however since this function is used across a large number of controllers but I'd really like to load it only when needed, as my app is already beginning to run slow. Any ideas? On Feb 9, 11:43 am, brian bally.z...@gmail.com wrote: Well, I'm certainly no expert, so you might well benefit from someone else jumping in here. ;-) Try removing these lines: App::import(Component,Email); $this-Email = new EmailComponent(); ... as well as the inititlaize line I suggested. Then, add this line to the top of AppController: public $components = array('Email'); (replace public with var if you're stuck with PHP4.x) See if that works. I have a feeling the problem stems from the fact that you're importing a component into AppController, rather than loading it in the normal fashion. If you don't send email from many controllers, this may not be the most efficient way, but you'll at least be a bit closer to figuring out why it's failing for you. The crux of it is that the component isn't getting a handle to the controller for some reason. On Mon, Feb 9, 2009 at 2:29 AM, Kyle Decot kdec...@gmail.com wrote: When trying to use the initialize method, I get a undefined method error: Fatal error: Call to undefined method EmailComponent::initialize() in / home/affinit3/public_html/theskateparkdirectory/app/app_controller.php on line 60 Any ideas? On Feb 9, 2:22 am, brian bally.z...@gmail.com wrote: change the method name to _sendEmailNotification (single underscore) to make it protected, rather than private $this-Email = new EmailComponent(); $this-Email-initialize($this); Those are the only things that I can think of. I've never imported a component inside of an AppController method - private, protected, or public. Maybe that's the problem? On Mon, Feb 9, 2009 at 1:57 AM, Kyle Decot kdec...@gmail.com wrote: Ah, stupid mistake but I've updated the set to be body instead of email_body and am still getting the same results. Any other ideas? On Feb 9, 1:55 am, brian bally.z...@gmail.com wrote: sorry, I should have unquoted that. This should be clearer. $this-set(email_body,$body); Notice (8): Undefined variable: body [APP/views/elements/email/html/ email_notification.ctp, line 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
I'm using 1.2.1. Any thoughts? On Feb 9, 10:43 pm, mscdex msc...@gmail.com wrote: Just out of curiousity, what version of CakePHP are you using? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---