Re: slug of choice
No, Actually what i was saying is that i generate slug with the Title of the post. Now say i have another page from where i will redirect user to the post action page by taking the name of the user. How can i make the name as the Uid of the post and title remains unchanged as in above example it remains beautiful life. Thanks. On Jun 22, 12:08 pm, Fran Iglesias wrote: > El 22/06/2009, a las 9:03, aman batra escribió: > > > What should be the approach over this.. I m using the sluggable > > behavior to generate the slug for the post. > > Perhaps... > > - make the slug field editable in the ass/edit actions > > - If the slug field is left blank by the user, create the slug > programatically, and/or... > - Populate the slug file with the "slugged" title, if slug field is > empty, using a javascript function > > hth --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
slug of choice
Hello, I am using the title of any post to act as a slug for the post but now I want to add a functionality that user can use anything he likes as the slug of his post without changing the title of the post For example :- www.abcd.com/beautiful-life is the slug which gets generated now and "beautiful life" is the title of the post. I want to change it in the sense that the title of the post remains "beautiful life" but the slug let's say i want it to be "aman-batra" say on my name i.e www.abcd.com/aman-batra for that post. What should be the approach over this.. I m using the sluggable behavior to generate the slug for the post. Thanks & Regards, Aman Batra --~--~-~--~~~---~--~~ 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 make a record update and increae no. of visits while handling in beforeSave?
I want to save data to my database and the structure is such that if the rest record is same i just want to increase the no of visits but if the whole info is new then create a new data. I am handling much of the code in my beforeSave. How to make an Update and set query work from beforeSave as i can not call UpdateAll in this case into my beforeSave?? so basically there are two things :- 1. if record is old one i just need to update and increae no of views by 1 2. if new then i would like to create a fresh record. and to handle this thing in BeforeSave. thanx. --~--~-~--~~~---~--~~ 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 map enums with strings
i have set them as $s = array('Google'=>'G','Yahoo'=>'Y','MSN'=>'M'); and its working gud.. thanx everyone..:) /i belive that i will solve somebody's problem one day.. On Mar 29, 10:38 pm, brian wrote: > Why don't you simply set the enum values to Google, Yahoo, etc? > > On Sun, Mar 29, 2009 at 12:09 PM, aman batra wrote: > > > actually i wanted something which could map the things and what i have > > done is that i created an array which is describing what i want > > like :- > > $s = array('Google'=>'G','Yahoo'=>'Y','MSN'=>'M'); > > > On Mar 29, 8:38 pm, "Dr. Loboto" wrote: > >> From point of SQL queries enum values are strings. So you will retrive > >> 'G', 'Y' and 'M' as well as should save 'G', 'Y' and 'M'. Anywhere you > >> want to display 'Google', 'Yahoo' and 'MSN' instead of actual values > >> you should change then manually. Cake do not provide anything for it. > > >> On Mar 29, 5:35 pm, aman batra wrote: > > >> > Hello, > >> > I have in my Db table a column agent which takes the value as enum > >> > ('G','Y','M') and where > >> > G = google > >> > Y = yahoo > >> > M = msn > >> > How should i map the strings google, yahoo, etc which will be the > >> > output of my function to map as G,Y,etc so that my Db query recognise > >> > it and saves it to the database. > > --~--~-~--~~~---~--~~ 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 map enums with strings
actually i wanted something which could map the things and what i have done is that i created an array which is describing what i want like :- $s = array('Google'=>'G','Yahoo'=>'Y','MSN'=>'M'); On Mar 29, 8:38 pm, "Dr. Loboto" wrote: > From point of SQL queries enum values are strings. So you will retrive > 'G', 'Y' and 'M' as well as should save 'G', 'Y' and 'M'. Anywhere you > want to display 'Google', 'Yahoo' and 'MSN' instead of actual values > you should change then manually. Cake do not provide anything for it. > > On Mar 29, 5:35 pm, aman batra wrote: > > > Hello, > > I have in my Db table a column agent which takes the value as enum > > ('G','Y','M') and where > > G = google > > Y = yahoo > > M = msn > > How should i map the strings google, yahoo, etc which will be the > > output of my function to map as G,Y,etc so that my Db query recognise > > it and saves it to the database. > > --~--~-~--~~~---~--~~ 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 map enums with strings
how to map the enum with strings then?? On Mar 29, 3:48 pm, mscdex wrote: > On Mar 29, 6:35 am, aman batra wrote: > > > Hello, > > I have in my Db table a column agent which takes the value as enum > > ('G','Y','M') and where > > G = google > > Y = yahoo > > M = msn > > How should i map the strings google, yahoo, etc which will be the > > output of my function to map as G,Y,etc so that my Db query recognise > > it and saves it to the database. > > CakePHP doesn't support the Enum DB column type. --~--~-~--~~~---~--~~ 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 map enums with strings
Hello, I have in my Db table a column agent which takes the value as enum ('G','Y','M') and where G = google Y = yahoo M = msn How should i map the strings google, yahoo, etc which will be the output of my function to map as G,Y,etc so that my Db query recognise it and saves it to the database. --~--~-~--~~~---~--~~ 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: Release: 1.2.2.8120
Thanks To Team CakePHP Regards, /Terrific On Mar 20, 8:32 pm, Martin Westin wrote: > Thanks for this update. And thanks for the public git repo. No more > "git svn rebase" for me :) --~--~-~--~~~---~--~~ 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: to change the decoration of active link
actually the link above just highlights the link where I take the mouse over..but my prob is that if I click on some link and when the next page is loaded then the link I had clicked gets highlighted (which I want to be as text-decoration:none). On Mar 23, 1:09 pm, kai wrote: > Someone else may have better advice but I use > this:http://www.solitechit.com/2008/06/06/menu-highlighting-with-cakephp-12/ > > On Mar 23, 12:11 am, aman batra wrote: > > > but actually the problem is that i have many links as isaid before > > like Today Tomorrow week month year and i want that if i click on week > > then week remains undecorated and the rest as underlined. But if i add > > a new class in css say a.nodec{text-decoration:none} and then to my > > link whick is like > > echo $html->link > > ('Today', > > array> ('controller'=>'entities', 'action'=>'popular'),array > > > ('class'=>'greenFont')); > > > How should i integrate nodec with this so that only on clicking the > > link becomes nondecorated but remains as underlined if not > > clicked..??? > > > are you getting the point or should i elaborate it more?? > > > On Mar 23, 11:17 am, brian wrote: > > > > It should work. But, by 'active', are you referring to the current > > > page? With CSS, 'active' refers to a link as it's being clicked. If > > > you want to style the 'current' link, you will need to add a class. > > > > On Mon, Mar 23, 2009 at 1:31 AM, aman batra > > > wrote: > > > > > actually that :active is not serving the work for me.. and yes i keep > > > > the thinkgs in mind brian.. thanx for the valueable advice.. > > > > > On Mar 23, 10:08 am, brian wrote: > > > >> On Mon, Mar 23, 2009 at 12:34 AM,amanbatra > > > >> wrote: > > > > >> > how can i change the decoration of an active link?? i have the lin ks > > > >> > underlined by default and i want to make the decoration to none when > > > >> > a > > > >> > particular link is clicked and rest of the links to be as before > > > >> > underlined.. how can i do that??? > > > > >> > will in css a.class:active{text-decoration:none} work??? > > > > >> Wouldn't it have been easier to try that? This isn't even related to > > > >> Cake, nor even PHP. I'm not ranting; I actually find this a bit funny. > > > > >> > initially i have a colourfont class applied on to the link. how to > > > >> > apply two classes on active link and just a colour font class on the > > > >> > inactive link..?? > > > >> > my link as of now is something like.. > > > > >> > echo $html->link('Today', > > > >> > > > > >> > array > > > >> > ('controller'=>'entities', 'action'=>'popular'),array > > > >> > ('class'=>'greenFont')); > > > > >> > echo $html->link('Tommorow', > > > >> > > > > >> > array > > > >> > ('controller'=>'entities', 'action'=>'popular'),array > > > >> > ('class'=>'greenFont')); > > > > >> a.class:active should suffice. > > > > >> A bit of advice, though: don't name your CSS classes in terms of the > > > >> style. What's green today may well be red tomorrow. A better classname > > > >> might be 'Popular', for instance. > > --~--~-~--~~~---~--~~ 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: MVC best practice advice needed
I think it is a good practice to have a function in User model that should serve the required purpose than any other approach. On Mar 22, 2:22 pm, mattalexx wrote: > Thank you. > > On Mar 21, 11:51 pm, mscdex wrote: > > > Sorry, I half-misread your situation. > > In my opinion, I would probably add a deactivateExpired function in > > the User model that would do the necessary checking and saving. > > --~--~-~--~~~---~--~~ 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: to change the decoration of active link
but actually the problem is that i have many links as isaid before like Today Tomorrow week month year and i want that if i click on week then week remains undecorated and the rest as underlined. But if i add a new class in css say a.nodec{text-decoration:none} and then to my link whick is like echo $html->link ('Today', array > ('controller'=>'entities', 'action'=>'popular'),array > ('class'=>'greenFont')); How should i integrate nodec with this so that only on clicking the link becomes nondecorated but remains as underlined if not clicked..??? are you getting the point or should i elaborate it more?? On Mar 23, 11:17 am, brian wrote: > It should work. But, by 'active', are you referring to the current > page? With CSS, 'active' refers to a link as it's being clicked. If > you want to style the 'current' link, you will need to add a class. > > On Mon, Mar 23, 2009 at 1:31 AM, aman batra wrote: > > > actually that :active is not serving the work for me.. and yes i keep > > the thinkgs in mind brian.. thanx for the valueable advice.. > > > On Mar 23, 10:08 am, brian wrote: > >> On Mon, Mar 23, 2009 at 12:34 AM,amanbatra > >> wrote: > > >> > how can i change the decoration of an active link?? i have the lin ks > >> > underlined by default and i want to make the decoration to none when a > >> > particular link is clicked and rest of the links to be as before > >> > underlined.. how can i do that??? > > >> > will in css a.class:active{text-decoration:none} work??? > > >> Wouldn't it have been easier to try that? This isn't even related to > >> Cake, nor even PHP. I'm not ranting; I actually find this a bit funny. > > >> > initially i have a colourfont class applied on to the link. how to > >> > apply two classes on active link and just a colour font class on the > >> > inactive link..?? > >> > my link as of now is something like.. > > >> > echo $html->link('Today', > >> > > >> > array > >> > ('controller'=>'entities', 'action'=>'popular'),array > >> > ('class'=>'greenFont')); > > >> > echo $html->link('Tommorow', > >> > > >> > array > >> > ('controller'=>'entities', 'action'=>'popular'),array > >> > ('class'=>'greenFont')); > > >> a.class:active should suffice. > > >> A bit of advice, though: don't name your CSS classes in terms of the > >> style. What's green today may well be red tomorrow. A better classname > >> might be 'Popular', for instance. > > --~--~-~--~~~---~--~~ 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: to change the decoration of active link
actually that :active is not serving the work for me.. and yes i keep the thinkgs in mind brian.. thanx for the valueable advice.. On Mar 23, 10:08 am, brian wrote: > On Mon, Mar 23, 2009 at 12:34 AM,amanbatra wrote: > > > how can i change the decoration of an active link?? i have the lin ks > > underlined by default and i want to make the decoration to none when a > > particular link is clicked and rest of the links to be as before > > underlined.. how can i do that??? > > > will in css a.class:active{text-decoration:none} work??? > > Wouldn't it have been easier to try that? This isn't even related to > Cake, nor even PHP. I'm not ranting; I actually find this a bit funny. > > > initially i have a colourfont class applied on to the link. how to > > apply two classes on active link and just a colour font class on the > > inactive link..?? > > my link as of now is something like.. > > > echo $html->link('Today', > > > > array > > ('controller'=>'entities', 'action'=>'popular'),array > > ('class'=>'greenFont')); > > > echo $html->link('Tommorow', > > > > array > > ('controller'=>'entities', 'action'=>'popular'),array > > ('class'=>'greenFont')); > > a.class:active should suffice. > > A bit of advice, though: don't name your CSS classes in terms of the > style. What's green today may well be red tomorrow. A better classname > might be 'Popular', for instance. --~--~-~--~~~---~--~~ 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 change the decoration of active link
how can i change the decoration of an active link?? i have the lin ks underlined by default and i want to make the decoration to none when a particular link is clicked and rest of the links to be as before underlined.. how can i do that??? will in css a.class:active{text-decoration:none} work??? initially i have a colourfont class applied on to the link. how to apply two classes on active link and just a colour font class on the inactive link..?? my link as of now is something like.. echo $html->link('Today', array ('controller'=>'entities', 'action'=>'popular'),array ('class'=>'greenFont')); echo $html->link('Tommorow', array ('controller'=>'entities', 'action'=>'popular'),array ('class'=>'greenFont')); --~--~-~--~~~---~--~~ 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: xml element to create the format
i have done it with the help of xml helper and it works fine for me.. in order to make something like http://www.abc.com"; type= "video/quicktime"> . . . it can be done as.. $url = Router::url(array('controller'=>'controller', 'action'=>'view', 'name1'=>$entity['Table']['name1']),true); echo $xml->elem('content', array('namespace'=>'media')); it will output as http://"/> --~--~-~--~~~---~--~~ 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 make XML of this format in Cake
i have done it with the help of xml helper and it works fine for me.. in order to make something like http://www.abc.com"; type= "video/quicktime"> . . . it can be done as.. $url = Router::url(array('controller'=>'controller', 'action'=>'view', 'name1'=>$entity['Table']['name1']),true); echo $xml->elem('content', array('namespace'=>'media')); it will output as http://"/> thanx, /Aman On Mar 14, 11:40 pm, aman batra wrote: > ut i need to make videositemaps and the format is different as of the > link sent by you. and thexmlis of the format i sent you.. > i am unable to generate the type of > > and so on... > like.. > > http://search.yahoo.com/mrss"; > xmlns:dcterms="http://purl.org/dc/terms/"; > xmlns:gm="http://www.google.com/schemas/gm/1.1";> > > > 2005-06-18 > http://www.google.com/samples/ > localandmaps.mpeg" type="video/mpeg"> > Google Local and Google Maps > How to use Google Local and Google Maps to > find local information. > http://www.google.com/playerLaunch? > id=localAndMaps" /> > http://www.google.com/images/ > localAndMaps.jpg"/> > Google.com media:credit> > Joe Smith > Ads & Promotional > News > > > > > > Can u help me out of this.. > > the link sent by you is exactly my sitemap.. > > On Mar 14, 5:56 pm, Smelly Eddie wrote: > > > aman: > > > How about generating dynamic sitemaps with > > CakePHPhttp://edwardawebb.com/programming/php-programming/cakephp/generating... > > > everything from getting the detailas to publishing asxml(in google > > sitemap format) > > > good luck > > > On Mar 13, 3:49 am, aman batra wrote: > > > > hello, i want to make the video sitemaps and according to google te > > >xmlshould be like > > > http://search.yahoo.com/mrss"; > > > xmlns:dcterms="http://purl.org/dc/terms/"; > > > xmlns:gm="http://www.google.com/schemas/gm/1.1";> > > > > > > > > > 2005-06-18 > > > http://www.google.com/samples/ > > > localandmaps.mpeg" type="video/mpeg"> > > > > Google Local and Google Maps > > > How to use Google Local and Google Maps to > > > find local information. > > > http://www.google.com/playerLaunch? > > > id=localAndMaps" /> > > > http://www.google.com/images/ > > > localAndMaps.jpg"/> > > > Google.com > > media:credit> > > > Joe Smith > > > > Ads & Promotional > > > News > > > > > > > > > > > > > > > > how should i useXmlhelper in my controller to make the namespace > > > like above and get my sitemap working like that. > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
xml element to create the format
hey, i am trying to create an xml formal like http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: router breaks in a certain case when i search something
Anyone??? I am still struck in the same prob.. On Mar 15, 10:54 pm, aman batra wrote: > i have a searches controller and the index function of it is :- > > function index($searchstr, $by='Entity') > { > $conditions = array(); > switch($by) { > case 'Tags': > case 'doc': > case 'video': > case 'image': > case 'slide': > $modelName = 'Entity'; > if ($by=='doc'||'video'||'image'||'slide') { > $conditions = array('Entity.type'=>$by); > } > break; > default: > $modelName = $by; > break; > } > > if(empty($searchstr)) > { > $error = 'No search string found'; > $this->set('error',$error); > > } > else > { > $fltrstr = urldecode($searchstr); > > if ($modelName == 'Entity') > { > if ($by == 'Tags') { > $match_fields = array('Entity.tags'); > } > else { > $match_fields = array('Entity.title', > 'Entity.description', 'Entity.tags'); > } > > // The required fields for the o/p are fetched. > $match_string = implode(",", $match_fields); > $conditions = array_merge(array(" MATCH($match_string) > AGAINST (('$fltrstr')) AND `Entity`.`status`='Y' AND > `Entity`.`approved`='Y'"), > > $conditions); > > // The page title and the tags implementation. > $this->pageTitle = "$searchstr - Videos, > Presentations, Pics, Documents on $searchstr | ABC"; > $this->set('meta_tags', > "$searchstr, $searchstr > videos, $searchstr presentations, > $searchstr pics, $searchstr documents, $searchstr images"); > $this->set('meta_desc', > "$searchstr - Get thousands > of videos, slides, pics & documents > on $searchstr - the best of internet collected at ABC"); > > // Save the search query. > > $this->SearchLog->save(array('SearchLog'=>array('query'=> > $searchstr, 'type'=>'A'))); > > // Find Related Searches. > $match_fields = > array('SearchLog.query'); > $match_string = implode(",", $match_fields); > > $logconditions = array(" MATCH($match_string)AGAINST > (('$fltrstr'))"); > > $queries = $this->SearchLog->find('all', array > ('conditions'=>$logconditions)); > > $this->set('queries', $queries); > } > else > { > $match_fields = array > ('User.first_name','User.last_name', > 'User.email_address', 'User.uid'); > > // The required fields for the o/p > are fetched. > $match_string = implode(",", $match_fields); > > $conditions = array(" MATCH($match_string)AGAINST > (('$fltrstr')) AND `User`.`account_status`='Y'"); > > // The page title and the tags implementation. > $this->pageTitle = "Users Matching $searchstr | ABC"; > $this->set('meta_tags', "$searchstr, Users"); > $this->set('meta_desc', "Users > Matching $searchstr on ABC"); > } > > $data = $this->paginate($modelName, $conditions); > >
router breaks in a certain case when i search something
i have a searches controller and the index function of it is :- function index($searchstr, $by='Entity') { $conditions = array(); switch($by) { case 'Tags': case 'doc': case 'video': case 'image': case 'slide': $modelName = 'Entity'; if ($by=='doc'||'video'||'image'||'slide') { $conditions = array('Entity.type'=>$by); } break; default: $modelName = $by; break; } if(empty($searchstr)) { $error = 'No search string found'; $this->set('error',$error); } else { $fltrstr = urldecode($searchstr); if ($modelName == 'Entity') { if ($by == 'Tags') { $match_fields = array('Entity.tags'); } else { $match_fields = array('Entity.title', 'Entity.description', 'Entity.tags'); } // The required fields for the o/p are fetched. $match_string = implode(",", $match_fields); $conditions = array_merge(array(" MATCH($match_string) AGAINST (('$fltrstr')) AND `Entity`.`status`='Y' AND `Entity`.`approved`='Y'"), $conditions); // The page title and the tags implementation. $this->pageTitle = "$searchstr - Videos, Presentations, Pics, Documents on $searchstr | ABC"; $this->set('meta_tags', "$searchstr, $searchstr videos, $searchstr presentations, $searchstr pics, $searchstr documents, $searchstr images"); $this->set('meta_desc', "$searchstr - Get thousands of videos, slides, pics & documents on $searchstr - the best of internet collected at ABC"); // Save the search query. $this->SearchLog->save(array('SearchLog'=>array('query'=> $searchstr, 'type'=>'A'))); // Find Related Searches. $match_fields = array('SearchLog.query'); $match_string = implode(",", $match_fields); $logconditions = array(" MATCH($match_string)AGAINST (('$fltrstr'))"); $queries = $this->SearchLog->find('all', array ('conditions'=>$logconditions)); $this->set('queries', $queries); } else { $match_fields = array ('User.first_name','User.last_name', 'User.email_address', 'User.uid'); // The required fields for the o/p are fetched. $match_string = implode(",", $match_fields); $conditions = array(" MATCH($match_string)AGAINST (('$fltrstr')) AND `User`.`account_status`='Y'"); // The page title and the tags implementation. $this->pageTitle = "Users Matching $searchstr | ABC"; $this->set('meta_tags', "$searchstr, Users"); $this->set('meta_desc', "Users Matching $searchstr on ABC"); } $data = $this->paginate($modelName, $conditions); if(empty($data)){ $error = 'No data matching your string'; $this->set('error', $error); } // Filters the string $this->set('res', $data); } $this->set('by',$by); $this->set('keyword',$searchstr); $this->render($modelName); } } And its corresponding view element of displaying result and paginating is :- if ($this->params['controller'] == 'searches') { $paginator->options(array('url'=>$this- >passedArgs)); Now corresponding to the above code whenever i search for a string say "joke" on my site then my url is www.abc.com/search/joke and is also paginating fine. but as I filter my result according to its type like(videos, documents, etc) then the url is www.abc.com/search/joke/video which is ok but when i click for the next page the url is www.abc.com/search/joke/joke/video/page:1 and so on... the searchstring comes twice.. I am unable to tackle this one.. --~--~-~--~~~--
multiple params creating problem
hey everyone, i am getting a problem with my pagination as-- i have a route like www.abc.com/param1/ and www.abc.com/param1/param2 but when i paginate my routes then in the first case i easily get www.abc.com/param1/page:1 but when i aplly it to the second case then my route breaks and it shows like www.abc.com/param1/page:1 and this comes everytime i have two params in my route. How to tackle the prob like this??? My logic has been simple as i call in my view the $paginator->options whenever the particular param is set.. --~--~-~--~~~---~--~~ 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 make XML of this format in Cake
ut i need to make videositemaps and the format is different as of the link sent by you. and the xml is of the format i sent you.. i am unable to generate the type of and so on... like.. http://search.yahoo.com/mrss"; xmlns:dcterms="http://purl.org/dc/terms/"; xmlns:gm="http:// www.google.com/schemas/gm/1.1"> 2005-06-18 http://www.google.com/samples/ localandmaps.mpeg" type="video/mpeg"> Google Local and Google Maps How to use Google Local and Google Maps to find local information. http://www.google.com/playerLaunch? id=localAndMaps" /> http://www.google.com/images/ localAndMaps.jpg"/> Google.com Joe Smith Ads & Promotional News Can u help me out of this.. the link sent by you is exactly my sitemap.. On Mar 14, 5:56 pm, Smelly Eddie wrote: > aman: > > How about generating dynamic sitemaps with > CakePHPhttp://edwardawebb.com/programming/php-programming/cakephp/generating... > > everything from getting the detailas to publishing asxml(in google > sitemap format) > > good luck > > On Mar 13, 3:49 am, aman batra wrote: > > > hello, i want to make the video sitemaps and according to google te > >xmlshould be like > > http://search.yahoo.com/mrss"; > > xmlns:dcterms="http://purl.org/dc/terms/"; > > xmlns:gm="http://www.google.com/schemas/gm/1.1";> > > > > > > 2005-06-18 > > http://www.google.com/samples/ > > localandmaps.mpeg" type="video/mpeg"> > > > Google Local and Google Maps > > How to use Google Local and Google Maps to > > find local information. > > http://www.google.com/playerLaunch? > > id=localAndMaps" /> > > http://www.google.com/images/ > > localAndMaps.jpg"/> > > Google.com > media:credit> > > Joe Smith > > > Ads & Promotional > > News > > > > > > > > > > > how should i useXmlhelper in my controller to make the namespace > > like above and get my sitemap working like that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to make XML of this format in Cake
ut i need to make videositemaps and the format is different as of the link sent by you. and the xml is of the format i sent you.. i am unable to generate the type of and so on... like.. http://search.yahoo.com/mrss"; xmlns:dcterms="http://purl.org/dc/terms/"; xmlns:gm="http:// www.google.com/schemas/gm/1.1"> 2005-06-18 http://www.google.com/samples/ localandmaps.mpeg" type="video/mpeg"> Google Local and Google Maps How to use Google Local and Google Maps to find local information. http://www.google.com/playerLaunch? id=localAndMaps" /> http://www.google.com/images/ localAndMaps.jpg"/> Google.com Joe Smith Ads & Promotional News Can u help me out of this.. the link sent by you is exactly my sitemap.. On Mar 14, 5:56 pm, Smelly Eddie wrote: > aman: > > How about generating dynamic sitemaps with > CakePHPhttp://edwardawebb.com/programming/php-programming/cakephp/generating... > > everything from getting the detailas to publishing asxml(in google > sitemap format) > > good luck > > On Mar 13, 3:49 am, aman batra wrote: > > > hello, i want to make the video sitemaps and according to google te > >xmlshould be like > > http://search.yahoo.com/mrss"; > > xmlns:dcterms="http://purl.org/dc/terms/"; > > xmlns:gm="http://www.google.com/schemas/gm/1.1";> > > > > > > 2005-06-18 > > http://www.google.com/samples/ > > localandmaps.mpeg" type="video/mpeg"> > > > Google Local and Google Maps > > How to use Google Local and Google Maps to > > find local information. > > http://www.google.com/playerLaunch? > > id=localAndMaps" /> > > http://www.google.com/images/ > > localAndMaps.jpg"/> > > Google.com > media:credit> > > Joe Smith > > > Ads & Promotional > > News > > > > > > > > > > > how should i useXmlhelper in my controller to make the namespace > > like above and get my sitemap working like that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
how to make XML of this format in Cake
hello, i want to make the video sitemaps and according to google te xml should be like http://search.yahoo.com/mrss"; xmlns:dcterms="http://purl.org/dc/terms/"; xmlns:gm="http:// www.google.com/schemas/gm/1.1"> 2005-06-18 http://www.google.com/samples/ localandmaps.mpeg" type="video/mpeg"> Google Local and Google Maps How to use Google Local and Google Maps to find local information. http://www.google.com/playerLaunch? id=localAndMaps" /> http://www.google.com/images/ localAndMaps.jpg"/> Google.com Joe Smith Ads & Promotional News how should i use Xml helper in my controller to make the namespace like above and get my sitemap working like that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
how to create video sitemaps for the site
hello, i want to make the video sitemaps and according to google te xml should be like http://search.yahoo.com/mrss"; xmlns:dcterms="http://purl.org/dc/terms/"; xmlns:gm="http:// www.google.com/schemas/gm/1.1"> 2005-06-18 http://www.google.com/samples/ localandmaps.mpeg" type="video/mpeg"> Google Local and Google Maps How to use Google Local and Google Maps to find local information. http://www.google.com/playerLaunch? id=localAndMaps" /> http://www.google.com/images/ localAndMaps.jpg"/> Google.com Joe Smith Ads & Promotional News how should i use Xml helper in my controller to make the namespace like above and get my sitemap working like that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
how to create video sitemaps for the site
hello, i want to make the video sitemaps and according to google te xml should be like http://search.yahoo.com/mrss"; xmlns:dcterms="http://purl.org/dc/terms/"; xmlns:gm="http:// www.google.com/schemas/gm/1.1"> 2005-06-18 http://www.google.com/samples/ localandmaps.mpeg" type="video/mpeg"> Google Local and Google Maps How to use Google Local and Google Maps to find local information. http://www.google.com/playerLaunch? id=localAndMaps" /> http://www.google.com/images/ localAndMaps.jpg"/> Google.com Joe Smith Ads & Promotional News how should i use Xml helper in my controller to make the namespace like above and get my sitemap working like that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to filter the content based on its format type
function latest() { $this->paginate = array('Entity'=>array('fields'=>array ('Entity.title','Entity.description', 'Entity.user_id','Entity.thumb_url','Entity.entity_uid', 'Entity.num_fachaks', 'Entity.number_of_views', 'Entity.rating', 'Entity.entity_ext', 'Entity.service'), 'order' => 'Entity.created DESC', 'limit'=>21, 'recursive'=>-1)); if (!isset($this->params['year']) || !isset($this->params['month']) || !isset($this->params['day'])) { $entities = $this->paginate('Entity', array('Entity.status'=>'Y', 'Entity.approved'=>'Y')); } else { $datestr = $this->params['year'].'-'.$this->params['month'].'-'. $this->params['day']; $date = date('Y-m-d', strtotime($datestr)); $entities = $this->paginate('Entity', array('Entity.created >='=> $date, 'Entity.status'=>'Y', 'Entity.approved'=>'Y')); } $this->set('res', $entities); } this is my latest function. what should be done?? and the way u r saying is a change in every action..right?? can this be done through beforeFIND?? On Mar 5, 4:17 am, brian wrote: > On Wed, Mar 4, 2009 at 10:58 AM, aman batra wrote: > > > hello, > > i want to filter the data on the basis of its type i.e whether it is a > > document, or video or ppt, how should i do that. currently my finder > > query results the mix of the formats according to the condition > > supplied. I have an entities_controller.php which has the actions as > > latest, popular, browse which all result me the paginate result of > > entities and set a common variable for the view. and my url looks like > >www.abcd.com/latestfor latest data > >www.abcd.com/popularfor popular and so on > > > now i want something like > >www.abcd.com/latest/vidgives me all latest videos > >www.abcd.com/popular/docgives me all the popular documents and so on > > for rest of the actions > > > what should i alter in my code to make it generic so that one change > > can do this all.. is something done in model entity.php beforeFind or > > any other sort of approch anyone suggests. i can send the code if > > wanted for this if problem is not understood. > > If you have a route like: > > Router::connect( > '/latest', > array( > 'controller' => 'entities', > 'action' => 'latest' // or whatever your method is > ) > ) > ... you can do something like: > > Router::connect( > '/latest/:type', > array( > 'controller' => 'entities', > 'action' => 'latest' // or whatever your method is > ), > array( > 'type' => '[\+\-_A-Za-z]+', // or whatever is appropriate > 'pass' => array('type') > ) > ) > > Change your method signature to, eg: > > function latest($type = null) > { > > If $type is not null, add it to your find 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 -~--~~~~--~~--~--~---
how to filter the content based on its format type
hello, i want to filter the data on the basis of its type i.e whether it is a document, or video or ppt, how should i do that. currently my finder query results the mix of the formats according to the condition supplied. I have an entities_controller.php which has the actions as latest, popular, browse which all result me the paginate result of entities and set a common variable for the view. and my url looks like www.abcd.com/latest for latest data www.abcd.com/popular for popular and so on now i want something like www.abcd.com/latest/vid gives me all latest videos www.abcd.com/popular/doc gives me all the popular documents and so on for rest of the actions what should i alter in my code to make it generic so that one change can do this all.. is something done in model entity.php beforeFind or any other sort of approch anyone suggests. i can send the code if wanted for this if problem is not understood. Thanx, --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
SQl query in shell
i am unable to use the sql query in shell directly as $this->query("some query"); it gives me an error saying : undefined method Shell::query() Is there any way how i can use it? any answers would be 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 -~--~~~~--~~--~--~---
how to show table and fetch mysql queries in the coloumns of table
hello..i want to create a table in my admin page so that i can see the stats of site directly. how can i make a table and then how to fetch the mysql queries of number of views and no of entities on my site on the table column. the code for table must be in the view.ctp ?? and where to write the queries that are to appear in the coloumn of 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 -~--~~~~--~~--~--~---
i am unable to validate the empty fields and scripts
i want to flash an error messege whenever someone tries to add any php or javascript on the comments tag on any image on my website. i have stripped the scripts but now it is adding an empty comment on the comments field rather than displaying an error messege. this is my strip script beforevalidate in the model function beforeValidate () { App::import('Core','Sanitize'); $clean = Sanitize::stripScripts($this->data['Comment'] ['comment']); $clean = Sanitize::stripWhitespace($clean); $this->data['Comment']['comment']= $clean; if(strlen($clean)==0){ return false; } else return true; } and here is my validation var $validate = array( 'comment' => array( 'rule' => 'notEmpty', 'required' => true, 'message' => 'Comment Field Cannot be empty')); can any one suggest me the solution?? --~--~-~--~~~---~--~~ 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: just cjeck the login() function of the code below
thanx a lot..it really helped. i have one more prob with the same project but now it is in my task model and task controller. the problem here is that validation in task doesnot works. here is my task model: array('rule'=> array('minlength',1), 'message'=> 'tasks details required'), 'start_date'=> array('rule'=> 'date', 'message'=> 'valid date required'), 'end_date'=> array('rule'=> 'date', 'message'=> 'valid date required'), ); } ?> and tasks_controller is : data)) { if($this->Task->save($this->data)) { $this->Session->setFlash("Task Saved!"); } } } } ?> it is connected to above user model n controller. but the task validation is not working On Jan 9, 5:00 am, Miles J wrote: > Leave your login() action empty and remove allow('*'). Do not allow > the login action. > > http://www.milesj.me/blog/read/5/using-cakephps-auth-component/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
just cjeck the login() function of the code below
here is my task manager users_controller and user model. whenever i go to login page and click on login i m unable to go to redirected page. please help. my code is user model array('rule'=> array('minlength',1), 'message'=> 'firstname required'), 'username'=> array('rule'=> array('minlength',1), 'message'=> 'username required'), 'password'=> array('rule'=> array('minlength',5), 'message'=> 'password required'), 'repeat_password' => array( 'rule' => array('CheckPasswordMatch'), 'message' => 'Passwords did not match'), 'email'=> array('rule'=>'email', 'message'=> 'email required')); var $name = 'User'; var $hasMany= array( 'Task'=> array( 'classname'=>'Task', 'order'=>'Task.start date', 'dependent'=> 'true' ) ); function CheckPasswordMatch($data) { return $this->data['User']['password'] == Security::hash($this->data['User']['repeat_password'], null, true); } } ?> here is my users_controller Auth->allow('*'); $this->Auth->fields = array( 'username' => 'username', 'password' => 'password' ); } function add() { if(!empty($this->data)) { if($this->User->save($this->data)) { $this->Session->setFlash("User Saved!"); $this->redirect(array('controller'=>'users', 'action'=>'login')); } } } function login() { if(!empty($this->data)) { if($this->Auth->login()) { $this->Session->setFlash("Hello User"); $this->redirect(array('controller'=>'tasks', 'action'=>'add')); } else { $this->Session->setFlash('here'); } } } function call() { $this->User->find('all'); } } ?> can u just check whats wromg with my login() function --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
whenever i login i reach to the login page instead of redirecting
i m trying to make a taskmanager and whenever i login i reach to the login page instead of redirecting to task page here is my user model array('rule'=> array('minlength',1), 'message'=> 'firstname required'), 'username'=> array('rule'=> array('minlength',1), 'message'=> 'username required'), 'password'=> array('rule'=> array('minlength',5), 'message'=> 'password required'), 'repeat_password' => array( 'rule' => array('CheckPasswordMatch'), 'message' => 'Passwords did not match'), 'email'=> array('rule'=>'email', 'message'=> 'email required')); var $name = 'User'; var $hasMany= array( 'Task'=> array( 'classname'=>'Task', 'order'=>'Task.start date', 'dependent'=> 'true' ) ); function CheckPasswordMatch($data) { return $this->data['User']['password'] == Security::hash($this->data['User']['repeat_password'], null, true); } } ?> here is my users_controller Auth->allow('*'); $this->Auth->fields = array( 'username' => 'username', 'password' => 'password' ); } function add() { if(!empty($this->data)) { if($this->User->save($this->data)) { $this->Session->setFlash("User Saved!"); $this->redirect(array('controller'=>'users', 'action'=>'login')); } } } function login() { if(!empty($this->data)) { if($this->Auth->login()) { $this->Session->setFlash("Hello User"); $this->redirect(array('controller'=>'tasks', 'action'=>'add')); } else { $this->Session->setFlash('here'); } } } function call() { $this->User->find('all'); } } ?> and i have tasks_controller and task model and proper views for each.. can u depict the error??? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---