menu Model
hi guys,... can some one tell me whats wrong whit this...? this is a Model Menu that I use for version 1.2.0 and it works perfect. but now I need to upgrade to 1.2.8 or higher and this model seems to me is not responding... thanks url = $url; $this->name = $name; $this->style = $style; } function parse($html, $current_url) { if($html->url($this->url) == $current_url) $this->style['class'] = array_key_exists('class', $this- >style) ? $this->style['class'] . ' current' : 'current'; return '' . $html->link($this->name, $this->url, $this->style, false, false) . ''; } } class Menu { var $id = false; var $links = array(); var $selected = false; function Menu($id) { $this->id = $id; } function setSelected($selected) { $this->selected = $selected; } function addLink($url, $name, $style = array()) { $this->links[] = new Link($url, $name, $style); } function parse($html) { $output = ''; if(!empty($this->links)) { $current_url = $this->selected ? $html->url($this->selected) : $html->url(); $output = ''; foreach($this->links as $link) $output .= $link->parse($html, $current_url); $output .= ''; } return $output; } } ?> -- 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
cake authentication
hi guys,... trying to setup cake 1.2.8 authentication / login and having error after loging in... any clue...? Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references: thanks -- 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: what version of CAKE am I using ?
OK,.. I got it... thanks version 1.2.0.5875 pre-beta Now,... trying to migrate and the first problem I encounter is: Missing Database Table Error: Database table fociki_aros for model Aro was not found. --- where no aros tables I had previously. my existing database has no aros in it... ??? can someone help... thanks On Jun 11, 1:14 pm, Tilen Majerle wrote: > do this somewhere in controller or view > > print Configure::version(); and it will print your version > > -- > Lep pozdrav, Tilen Majerlehttp://majerle.eu > > 2011/6/11 chris...@yahoo.com > > > > > > > > > Hi guys, > > what version of CAKE am I using? I'm confused... > > Have an existing script... Some files shows CakePHP(tm) v 1.2.0.4116 > > and some are in Library Helpers CakePHP(tm) v 0.10.0.1076 > > > I would like to migrate completely new version but having problems... > > What do I need to do...? and How to find out what exactly version am I > > on now... > > > thanks > > Chris > > > -- > > 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
what version of CAKE am I using ?
Hi guys, what version of CAKE am I using? I'm confused... Have an existing script... Some files shows CakePHP(tm) v 1.2.0.4116 and some are in Library Helpers CakePHP(tm) v 0.10.0.1076 I would like to migrate completely new version but having problems... What do I need to do...? and How to find out what exactly version am I on now... thanks Chris -- 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
migrate error
Hi guys, ... How Yooo All doinnn... Trying to migrate from 1.2 to 1.3 and having problem. I have existing database, tables,... but with no Aros or Acos and it works perfect with old version. When I call in default.ctp Error: Database table fociki_aros for model Aro was not found. It's still looking... And I don't need to have these tables as my script is set it up without them, or I'm missing something here... I also have problem finding correct path on the browser... it reads: http://www.my_domain.com/app/webroot/index.php/policy Can some one help me,.. what's wrong with this... thanks chris -- 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: UPDATE table
thank you Mike,... I got a different approach... $this->Session->write('guest', array('guest_id' => $this->user['id'], 'user_id' => $user['User']['id'])); it's working like a Clock... :) thank You All ! On Apr 21, 3:48 am, mi...@brightstorm.co.uk wrote: > > I think you are missing some apostrophes and full stops... > > > $this->User->query('UPDATE fociki_quests SET guest_id = ' . > > $this->user['id'] . ' WHERE id = ' . $user['User']['id']); > > > I'd stick the SQL into a variable first and debug it to screen to check > > its syntax. > > or use a cake syntax > > $this->User->FokitiGuest->id= $user['User']['id']; > $result = $this->User->FokitiGuest->saveField('guest_id',$this->user['id']); > > which is far cleaner. > > HTH > mikek > > > > > > > > > > > Jeremy Burns > > Class Outfit > > > jeremybu...@classoutfit.com > >http://www.classoutfit.com > > > On 21 Apr 2011, at 10:52, chris...@yahoo.com wrote: > > >> $this->User->query('UPDATE fociki_quests SET guest_id = ' $this- > >>> user['id'] WHERE id = ' . $user['User']['id']); > > > -- > > 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: UPDATE table
Hi Jermy,.. thanks for reply I have change a little bit but still getting error... $this->Guest->query('UPDATE fociki_quests guest_id = ' . $this- >user['id'] . ' . WHERE id = ' . $user['User']['id']); ?? can some one help? thanks On Apr 21, 2:56 am, Jeremy Burns | Class Outfit wrote: > I think you are missing some apostrophes and full stops... > > $this->User->query('UPDATE fociki_quests SET guest_id = ' . $this->user['id'] > . ' WHERE id = ' . $user['User']['id']); > > I'd stick the SQL into a variable first and debug it to screen to check its > syntax. > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 21 Apr 2011, at 10:52, chris...@yahoo.com wrote: > > > > > > > > > $this->User->query('UPDATE fociki_quests SET guest_id = ' $this- > >> user['id'] WHERE id = ' . $user['User']['id']); -- 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
UPDATE table
Hi guys,... What am I doin wrong...? Getting this error: Query: UPDATE fociki_quests WHERE id = 155 Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax... $this->User->query('UPDATE fociki_quests SET guest_id = ' $this- >user['id'] WHERE id = ' . $user['User']['id']); can anyone help please thanks in advance -- 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
checkbox field to display
Hi guys, I have a checkbox field which suppose to read db... value 0 or 1... checked=1 or not=0 but its not. What am I missing. checkbox('User/show_groups') ?> I have tried with 'checked' => 'checked' checkbox('User/show_videos', array('checked' => 'checked')) ?> but still no results. Thanks Chris -- 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: search function results
Thank you for your response Sam,... In fact I did that,... another version to attempt... but now I'm not getting search results, but the page is clean on URL bar,... and yes its a urlencoded space %20 here is what I have... function search($name = null) { if(!empty($this->data)) { $url = '/groups/search/'; if(!empty($this->data['Group']['name'])) { $url .= str_replace(' ', '+', $this->data['Group']['name']); unset($this->data['Group']['name']); } $this->redirect($url); } else { $filter = $this->params['pass']; unset($filter['page']); unset($filter['sort']); unset($filter['direction']); $this->data = array('Group' => $filter); $this->set('url_options', $filter); $this->data = array('Group' => array('name' => str_replace('+', ' ', $name))); // $this->set_title(ucfirst(i18n::translate('search Groups'))); $this- >set_title(ucfirst(Inflector::pluralize(i18n::translate('group'))) . ' : ' . str_replace('+', ' ', $name)); $scope = array('Group.name IS NOT NULL'); foreach(array('name') as $field) { if(!empty($filter[$field])) $scope[] = 'Group.' . $field . ' LIKE \'%' . $filter[$field] . '%\''; } if($this->is_user()) $this->set('friends_ids', $this->Friend->myFriends($this- >user['id'])); else $this->set('friends_ids', array()); if(empty($filter['name'])) $this->set('groups', $this->paginate('Group', '1 = 0')); else $this->set('groups', $this->paginate('Group', $scope)); } } On Mar 10, 7:27 am, Sam Bernard wrote: > What error are you getting? %20 is just a urlencoded space... it isn't an > error. > > If you want to replace it with a space then just do your str_replace on your > $url var right before "$this->redirect($url);". -- 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
search function results
Hi ALL, can someone help me with "search" function... When I have 2 or more words in search field I'm getting en error on URL bar with %20 where I'm missing str_replace(' ', '+', and don't know where to put here is what I have in my controller ... function search() { $this->paginate['order'] = array('Group.created' => 'desc'); if(!empty($this->data)) { $url = '/groups/search/'; foreach($this->data['Group'] as $name => $value) { if(isset($value) && strlen($value) > 0) $url .= '/' . $name . ':' . $value; } $this->redirect($url); } else { $filter = $this->params['pass']; unset($filter['page']); unset($filter['sort']); unset($filter['direction']); $this->data = array('Group' => $filter); $this->set_title(ucfirst(i18n::translate('search Groups'))); $this->set('url_options', $filter); $scope = array('Group.name IS NOT NULL'); foreach(array('name') as $field) { if(!empty($filter[$field])) $scope[] = 'Group.' . $field . ' LIKE \'%' . $filter[$field] . '%\''; } if($this->is_user()) $this->set('friends_ids', $this->Friend->myFriends($this- >user['id'])); else $this->set('friends_ids', array()); if(empty($filter['name'])) $this->set('groups', $this->paginate('Group', '1 = 0')); else $this->set('groups', $this->paginate('Group', $scope)); } } -- 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
time frame
Hi All, can some one tell how to setup time frame. Say if User want to run add for one month, and auto stop it, and maybe delete it after all. I dig in cake website, couldn't find it. Thank You All, chris -- 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: help with guest table update
Thank you Geremy, Than you John, Yes,... I'm a newbie... I straight it up on Video view issue but can't do it here,... I'll give it a try,... But I also, forgot to mention, need to have that Guest table updated to delete old records like 2 weeks ago..., and ALSO once some user is traveling to other ones Videos, Profile, Blogs,... etc,... this table NEED TO KEEP ONLY ONE RECORD OF A guest, and not to write every time is same user accessed other once pages... Video, Profile,... etc... Please help help with this guys,.. thank You chris Salute All !! On Feb 14, 11:40 pm, Jeremy Burns | Class Outfit wrote: > The first thing you are doing wrong is using Model->query; you might as well > skip Cake altogether and write your app in plain old PHP. > > You raised a similar query a few days ago, and this warrants the same > solution. Here it is again (amended with your new models and fields): > > Sounds like you need to have a line of code in the controller's view method > that calls a simple model function: > > $this->FocikiGuest->recordVisit($id, $user['User']['id'], $this->user['id']); > > In the model: > > function recordVisit($id, $userId, $guestId) { > $this->updateAll( > array( > 'FocikiGuest.user_id' => $userId, > 'FocikiGuest.guest_id' => $guestId > ), > array('FocikiGuest.id' => $id) > ); > > } > > Or you could just call it directly from the view method in the controller: > > $this-> FocikiGuest->updateAll( > array( > 'FocikiGuest.user_id' => $user['User']['id'], > 'FocikiGuest.guest_id' => $this->user['id'] > ), > array('FocikiGuest.id' => $id) > ); > > This way, whenever the view method is called (in other words, each time the > page is rendered) you record the user_id and guest_id. > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 15 Feb 2011, at 06:11, chris...@yahoo.com wrote: > > > > > > > > > Hi All, > > Ok guys, what am I doing wrong...? > > > $this->Guest->query('UPDATE fociki_guests' . 'SET user_id = > > ($user['User']['id'])' . ' AND guest_id = ($this->user['id'])'); > > > I need to update guest table every time its accessed by users to any > > User page. First I need to make this code straight it up... Please > > help. I can't make it work... > > > Thanks > > chris > > > -- > > Our newest site for the community: CakePHP Video > > Tutorialshttp://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: error ??
But look,... am I pulling 8 meg File...?, ... I don't think so just by accessing one little page. Apparently I did something wrong in Models or controllers,... and I can't find it what... the error is random, its not alway coming up... Anyone can tell what it is...? thanks chris On Feb 14, 10:10 pm, Ryan Snowden wrote: > phpinfo() should also say this (from memory) > > On 15 February 2011 14:00, Meroe Meroe wrote: > > > > > > > > > What O/S? > > > On Tue, Feb 15, 2011 at 12:23 AM, chris...@yahoo.com > > wrote: > > >> Hi Ryan, > >> sorry to bother you again,... but where is that php.ini file is > >> located? > >> Can't find it. > > >> thanks > >> chris > > >> On Jan 15, 7:39 am, Ryan Schmidt wrote: > >> > On Jan 14, 2011, at 23:28, chris...@yahoo.com wrote: > > >> > > getting error on first attempt to access the user page,... after > >> > > all,... refresh,... it getting thru and working... why...? Did anyone > >> > > know why...? > > >> > > Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to > >> > > allocate 311296 bytes) in /home/zipmaniak/zippopeople.com/html/app/ > >> > > views/users/show.ctp on line 344 > > >> > As the error message says, your PHP process ran out of memory. Your > >> > php.ini is currently configured to allow each PHP process only 8MB of > >> > memory, and this was clearly not enough. Allow each PHP process to have > >> > more > >> > memory, by editing the appropriate value in your php.ini. > > >> -- > >> 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 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 at > >http://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
help with guest table update
Hi All, Ok guys, what am I doing wrong...? $this->Guest->query('UPDATE fociki_guests' . 'SET user_id = ($user['User']['id'])' . ' AND guest_id = ($this->user['id'])'); I need to update guest table every time its accessed by users to any User page. First I need to make this code straight it up... Please help. I can't make it work... Thanks chris -- 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: error ??
Hi Ryan, sorry to bother you again,... but where is that php.ini file is located? Can't find it. thanks chris On Jan 15, 7:39 am, Ryan Schmidt wrote: > On Jan 14, 2011, at 23:28, chris...@yahoo.com wrote: > > > getting error on first attempt to access the user page,... after > > all,... refresh,... it getting thru and working... why...? Did anyone > > know why...? > > > Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to > > allocate 311296 bytes) in /home/zipmaniak/zippopeople.com/html/app/ > > views/users/show.ctp on line 344 > > As the error message says, your PHP process ran out of memory. Your php.ini > is currently configured to allow each PHP process only 8MB of memory, and > this was clearly not enough. Allow each PHP process to have more memory, by > editing the appropriate value in your php.ini. -- 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: views = "1234..." numbers
Thank You Jeremy, I got another approch to it... here is what works in my case: $this->Video->query('UPDATE fociki_videos' . ' SET views = views + 1' . ' WHERE id = ' . $video['Video']['id']); Thank You for Your Help guys,... I love you with all my heart... LoL I'm sorry to bother you with all these questions,... I learn on the way,... With little or no knowllege of CAKE and PHP I have gone so far... Check me out if you what,... and hire me for your next project help... LOL Just kidding guys, don't take it siriously... Thank you All !! chris On Feb 10, 8:39 pm, Jeremy Burns | Class Outfit wrote: > Sounds like you need to have a line of code in the controller's view method > that calls a simple model function: > > $this->Model->increment($id); > > In the model: > > function increment($id) { > $this->updateAll(array('Model.view_count' => 'Model.view_count+1'), > array('Model.id' => $id)); > > } > > Or you could just call it directly from the view method in the controller: > > $this->Model->updateAll(array('Model.view_count' => 'Model.view_count+1'), > array('Model.id' => $id)); > > This way, whenever the view method is called (in other words, each time the > page is rendered) you increment the view_count field by one. > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 11 Feb 2011, at 03:31, chris...@yahoo.com wrote: > > > > > > > > > Hi Jeremy, > > What I'm looking for is to set the data,... say to set field views in > > Video table increment by 1 every time page accessed. To set data,... > > NOT to retrive. > > > Thanks > > chris > > > On Feb 10, 1:11 pm, Jeremy Burns | Class Outfit > > wrote: > >> RTFM.http://book.cakephp.org/ > > >> Jeremy Burns > >> Class Outfit > > >> jeremybu...@classoutfit.comhttp://www.classoutfit.com > > >> On 10 Feb 2011, at 20:57, chris...@yahoo.com wrote: > > >>> Hi Mike, > >>> Yes, I know that I have to read from table,... > >>> But I don't know how... LOL > >>> the code... anyone can help...? > > >>> Thanks > >>> chris > > >>> On Feb 10, 11:59 am, mike karthauser wrote: > >>>> On 10 Feb 2011, at 17:30, "chris...@yahoo.com" > >>>> wrote: > > >>>>> Hi All, > >>>>> How u All Doinnn...?! > > >>>>> Can anyone teach me how to setup views,... so when page is > >>>>> accessed ... it will set field views="increment numbers" like Video > >>>>> views=906, Group views=489, etc.. like how many time page has been > >>>>> accessed. > > >>>> You won't be doing any counts in the view, rather updating the count > >>>> when the action is called and passing that value to the view. > > >>>> All you'll need to do is to get a count value from your table and then > >>>> resave it after you have added 1. You may also want to do this as an > >>>> ajax call in JavaScript when you have played say half of the video as > >>>> then it won't be affected if bots hit the page or people refresh loads > > >>>>> Thanks > >>>>> chris > > >>>>> -- > >>>>> Our newest site for the community: CakePHP Video > >>>>> Tutorialshttp://tv.cakephp.org > >>>>> Check out the new CakePHP Questions > >>>>> sitehttp://ask.cakephp.organdhelpothers 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 > >>> Tutorialshttp://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 > > Tutorialshttp://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
pagination in controller
Hi guys,... a ??? How can I have two or more pagination in same controller? if I put to together like this, ... will it work? var $paginate = array('order' => array('Gift.created' => 'desc')); var $paginate = array('order' => array('GiftPhoto.created' => 'desc')); Thanks chris -- 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: views = "1234..." numbers
Hi Jeremy, What I'm looking for is to set the data,... say to set field views in Video table increment by 1 every time page accessed. To set data,... NOT to retrive. Thanks chris On Feb 10, 1:11 pm, Jeremy Burns | Class Outfit wrote: > RTFM.http://book.cakephp.org/ > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 10 Feb 2011, at 20:57, chris...@yahoo.com wrote: > > > > > > > > > Hi Mike, > > Yes, I know that I have to read from table,... > > But I don't know how... LOL > > the code... anyone can help...? > > > Thanks > > chris > > > On Feb 10, 11:59 am, mike karthauser wrote: > >> On 10 Feb 2011, at 17:30, "chris...@yahoo.com" wrote: > > >>> Hi All, > >>> How u All Doinnn...?! > > >>> Can anyone teach me how to setup views,... so when page is > >>> accessed ... it will set field views="increment numbers" like Video > >>> views=906, Group views=489, etc.. like how many time page has been > >>> accessed. > > >> You won't be doing any counts in the view, rather updating the count when > >> the action is called and passing that value to the view. > > >> All you'll need to do is to get a count value from your table and then > >> resave it after you have added 1. You may also want to do this as an ajax > >> call in JavaScript when you have played say half of the video as then it > >> won't be affected if bots hit the page or people refresh loads > > >>> Thanks > >>> chris > > >>> -- > >>> Our newest site for the community: CakePHP Video > >>> Tutorialshttp://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 > > Tutorialshttp://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: views = "1234..." numbers
Hi Mike, Yes, I know that I have to read from table,... But I don't know how... LOL the code... anyone can help...? Thanks chris On Feb 10, 11:59 am, mike karthauser wrote: > On 10 Feb 2011, at 17:30, "chris...@yahoo.com" wrote: > > > Hi All, > > How u All Doinnn...?! > > > Can anyone teach me how to setup views,... so when page is > > accessed ... it will set field views="increment numbers" like Video > > views=906, Group views=489, etc.. like how many time page has been > > accessed. > > You won't be doing any counts in the view, rather updating the count when the > action is called and passing that value to the view. > > All you'll need to do is to get a count value from your table and then resave > it after you have added 1. You may also want to do this as an ajax call in > JavaScript when you have played say half of the video as then it won't be > affected if bots hit the page or people refresh loads > > > > > > > > > Thanks > > chris > > > -- > > Our newest site for the community: CakePHP Video > > Tutorialshttp://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
views = "1234..." numbers
Hi All, How u All Doinnn...?! Can anyone teach me how to setup views,... so when page is accessed ... it will set field views="increment numbers" like Video views=906, Group views=489, etc.. like how many time page has been accessed. Thanks chris -- 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: php statement as to appear replaced in views
Hi Shadow, and again Thank you so much, but in some point it still unclear for me what to do exactly, I have tried it tried it,... and not giving up...! lol You sound like one of the Senior Programmer in here. I would like to ask you if you can take a look of my script,... I will give you access to ftp and phpmyadmin Please... Please... I have done so much to it, and can't give it up,... and Have a Million Dollar Idea to develop and implement to greatest Social site on the Net... LoLo But, that just me... Please help me if you can. You can grab the testing URL from my profile,... I don't wanna post it here, not to sound like a spam... And if you signup on my site, I will meet you there,... and there'll be my contacts, and skype info... Thank Yo Much chris On Feb 9, 6:44 am, ShadowCross wrote: > Chris: > > After reviewing your code snippets, here are some of my > recommendations: > > 1) Instead of defining your classes as: > > Video > - belongsTo VideoCategory > - belongsTo User > - hasMany VideoComment > - hasMany VideoFavorite > > VideoFavorite > - belongsTo User > - belongsTo Video > > User > - hasMany Video > - hasMany VideoFavorite > > consider the following instead: > > Video > - belongsTo VideoCategory > - belongsTo User > - hasMany VideoComment > - hasAndBelongsToMany User with VideoFavorite (alias: VideoFavorite1) > > VideoFavorite > - belongsTo User > - belongsTo Video > > User > - hasMany Video > - hasAndBelongsToMany Video with VideoFavorite (alias: VideoFavorite2) > > Note that Video has two relations to User, and vice-versa; the "alias" > just needs tbe different (I used arbitrary ones). > Seehttp://book.cakephp.org/view/1046/Multiple-relations-to-the-same-model > > You can the do something like the following: > > controllers/videos: > function favorites() { > > $this->User->contain('VideoFavorite2'); > $info = $this->User->find('first', array( > 'conditions' => array('User.id' => $this->user['id']) > ); > > ... > } > > The data returned ($info) will include a sub-array (with the index > VideoFavorite2) of all the Video rows tagged as that user's favorite. > You can then use that sub-array to determine whether a particular > video should have the "Add to favorites" or the "Remove from > favorites" (i.e. in_array() or Set::contains(), or your favorite > method of determining whether one array contained in another array). > > 1a) Whether you follow this recommendation or not, the answer to your > question is basically: > - Get the list of the user's favorite videos > - Check if the particular video is in the list. > - If yes, display the "Remove from favorites" > - If no, display the "Add to favorites" > > 1b) the video_user_id field in the video_favorites table seems > redundant. VideoFavorite belongsTo Video, so that information can > easily be obtained directly from Video, without any significant loss > in performance (i.e. > $res = $this->VideoFavorite->find('all', array( > 'contain' => 'Video' > )); > and using $res['Video']['user_id'] instead of $res['VideoFavorite'] > ['video_user_id'] ) > > 2) Take advantage of CakePHP's cascading delete. Basically, if you > include 'dependent' => true as part of your Video hasMany VideoComment > and hasMany VideoFavorite definition, the code in your > Video.afterDelete() method is unnecessary. > Seehttp://book.cakephp.org/view/1036/delete > andhttp://book.cakephp.org/view/1043/hasManyfor details. > > 3) Consider using CakePHP's counterCache option for your belongsTo > definitions. Seehttp://book.cakephp.org/view/1042/belongsTo. > Advantages: > a) reduce manual queries. Currently, your set_favorites() method hard- > codes the fociki_users tablename. What if you decide to change the > tablePrefix later? > b) promotes the thin controller / fat model concept (where most of the > business logic is defined in the model, and the controller only links > the model with the view). What happens if you later want to add the > option to automatically add all videos uploaded by the user's favorite > author? If you leave the "update query" in the controller, you will > need to add the same code to the new controller/action. > > = > To summarize my recommendations: take the time to design your model > relations and let the framework do most of the work; that's the > advantage of using a framework -- it facilitates the "rudimentary" > tasks so you can focus on your business logic. -- 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: error loading model on setup
Thank you John, Now I have another problem: $this->menu = new Menu('nav'); $this->user_menu = new Menu('user_nav'); which gives me an error: Notice (8): Undefined property: CakeErrorController::$menu [APP/ app_controller.php, line 234] Notice (8): Undefined property: CakeErrorController::$user_menu [APP/ app_controller.php, line 235] Please help me with this ahh so Ican understand what is what in here... Thanks chris On Feb 8, 11:16 pm, John Andersen wrote: > Take a look at the App class in the CakePHP book > at:http://book.cakephp.org/view/529/Using-App-import#!/view/499/The-App-... > > That may be what you wish to use. > Enjoy, > John > > On 9 Feb., 07:23, "chris...@yahoo.com" wrote: > > > > > > > > > Hi guys, > > I'm trying to setup existing script, actually trying to migrate > > existing script to new version. > > And I have in my app_controller.php > > > > uses('L10n'); > > uses('I18n'); > > loadModel('Menu'); > > > class AppController extends Controller { > > > static $FLASH_ALLOWED_TYPES = array('error', 'valid', 'notice'); > > > var $helpers = array('Html', 'Form', 'Time', 'Text', 'Javascript', > > 'Ajax', 'Session', 'Application', 'User', 'PhotoShow', 'GroupShow', > > 'GiftShow'); > > > var $components = array('Cookie', 'RequestHandler'); > > > AND I CANT SEE IT IN VEIW,... > > getting this error message > > > Fatal error: Call to undefined function loadModel() in /home/weedguy/ > > weedzag.com/html/app/app_controller.php on line 4 > > > any suggestion...??? > > > Thanks -- 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
error loading model on setup
Hi guys, I'm trying to setup existing script, actually trying to migrate existing script to new version. And I have in my app_controller.php 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: SWF Uploader ... or any Good One...?
hi 2345,... I download it. I have a question,... where do you put your "action"...??? (this is from previous one) ...coz I have to have upload to go to group_controller function upload($id = null), ...coz it must create photos in different sizes. function upload($id = null) { $this->authorize(); $user = $this->User->findById($this->user['id']); if(!($group = $this->Group->findById($id))) { $this->flash('error', ucfirst(i18n::translate('group not found'))); $this->redirect('/'); } else { $this->set('group', $group); $secret = $this->generateRandomString(20); $name = str_replace(array('.jpg', '.jpeg', '.JPG', '.JPEG', '.png', '.PNG'), '', $this->params['form']['Filename']); if($this->GroupPhoto->save(array('GroupPhoto' => array('name' => $name, 'user_id' => $this->user['id'], 'group_id' => $group['Group'] ['id'], 'secret' => $secret, 'hidden' => 0 { $this->Group->query('UPDATE fociki_groups' . ' SET photos = photos + 1' . ' WHERE id = ' . $group['Group']['id']); $original_file = $this->GroupPhoto->getOriginalFile($this- >GroupPhoto->id, $secret, true); $original_file_path = $original_file->pwd(); move_uploaded_file($this->params['form']['Filedata'] ['tmp_name'], $original_file_path); exec('/usr/bin/convert -geometry 400x360 ' . $original_file_path . ' ' . $this->GroupPhoto->getMediumFile($this- >GroupPhoto->id, $secret)->pwd() .' > /dev/null 2>&1 &'); exec('/usr/bin/convert -geometry 135x135 ' . $original_file_path . ' ' . $this->GroupPhoto->getSmallFile($this- >GroupPhoto->id, $secret)->pwd() .' > /dev/null 2>&1 &'); exec('/usr/bin/convert -geometry 140x220 ' . $original_file_path . ' ' . $this->GroupPhoto->getThumbFile($this- >GroupPhoto->id, $secret)->pwd() .' > /dev/null 2>&1 &'); exec('/usr/bin/convert -thumbnail x150 -resize "150x<" -resize 50% -gravity center -crop 75x75+0+0 +repage ' . $original_file_path . ' ' . $this->GroupPhoto->getSquareFile($this->GroupPhoto->id, $secret)- >pwd() .' > /dev/null 2>&1 &'); } echo 'OK'; die(); } } Thanks chris On Feb 8, 7:44 pm, thatsgreat2345 wrote: > I use uploadify, works just fine with cakephp, allows multiple file > uploads and restriction to file types before uploading. > > On Feb 8, 7:01 pm, "chris...@yahoo.com" wrote: > > > > > > > > > Hi guys, > > > need help with UPLOAD... > > I have SWF Uploader originaly setup on a script for photos. > > And its uploading greate on photos,... however I have created groups > > and group photos seperated from original one. > > Now with this when I'm trying to upload I'm loosing session_id() when > > I try to set it up to::: post_params: {"PHPSESSID": " > session_id(); ?>"}, > > > HERE IS THE ORIGINAL for PHOTOS > > > var swfu; > > > window.onload = function() { > > var settings = { > > flash_url : "webroot ?>swf/swfupload.swf", > > upload_url: "url('/photos/upload? > > PHPSESSID=' . session_id(), true) ?>", // Relative to the SWF file > > post_params: {}, > > > HERE IS THE ONE for GROUP PHOTOS when its lossing session_id() > > > var swfu; > > > window.onload = function() { > > var settings = { > > flash_url : "webroot ?>swf/swfupload.swf", > > upload_url: "url('/groups/upload/' . > > $group['Group']['id'], true) ?>", // Relative to the SWF file > > post_params: {"PHPSESSID": ""}, > > > AND HERE IS THE ONE for GROUP PHOTOS when I'm having with group ID ... > > $group['Group']['id'] in there,... BUT THIS ONE GIVES ME AN ERROR. I > > CAN'T FIGURE OUT WHAT'S WRONG IN IT... > > > CAN ANYONE HELP... ??? > > > var swfu; > > > window.onload = function() { > > var settings = { > > flash_url : "webroot ?>swf/swfupload.swf", > > upload_url: "url('/groups/upload/ . > > $group['Group']['id']?PHPSESSID=' . session_id(), true) ?>", // > > Relative to the SWF file > > post_params: {"PHPSESSID": ""}, > > > or can anyone suggest good uploader,... so it can upload > > all: .jpg, .bmp, .gif, .pdf. ect... this SWF uploader is good, it can > > upload multiple files. any ohter good once out there...??? > > > THANK YOU AL !!! > > chris -- 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
SWF Uploader ... or any Good One...?
Hi guys, need help with UPLOAD... I have SWF Uploader originaly setup on a script for photos. And its uploading greate on photos,... however I have created groups and group photos seperated from original one. Now with this when I'm trying to upload I'm loosing session_id() when I try to set it up to::: post_params: {"PHPSESSID": ""}, HERE IS THE ORIGINAL for PHOTOS var swfu; window.onload = function() { var settings = { flash_url : "webroot ?>swf/swfupload.swf", upload_url: "url('/photos/upload? PHPSESSID=' . session_id(), true) ?>", // Relative to the SWF file post_params: {}, HERE IS THE ONE for GROUP PHOTOS when its lossing session_id() var swfu; window.onload = function() { var settings = { flash_url : "webroot ?>swf/swfupload.swf", upload_url: "url('/groups/upload/' . $group['Group']['id'], true) ?>", // Relative to the SWF file post_params: {"PHPSESSID": ""}, AND HERE IS THE ONE for GROUP PHOTOS when I'm having with group ID ... $group['Group']['id'] in there,... BUT THIS ONE GIVES ME AN ERROR. I CAN'T FIGURE OUT WHAT'S WRONG IN IT... CAN ANYONE HELP... ??? var swfu; window.onload = function() { var settings = { flash_url : "webroot ?>swf/swfupload.swf", upload_url: "url('/groups/upload/ . $group['Group']['id']?PHPSESSID=' . session_id(), true) ?>",// Relative to the SWF file post_params: {"PHPSESSID": ""}, or can anyone suggest good uploader,... so it can upload all: .jpg, .bmp, .gif, .pdf. ect... this SWF uploader is good, it can upload multiple files. any ohter good once out there...??? THANK YOU AL !!! chris -- 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: php statement as to appear replaced in views
Hi Shadow, Thank you for your help and try, ... here are the tables say for Videos Favorite Feature: videos Table: id int(11) UNSIGNEDNo auto_increment user_id int(11) Yes NULL category_id int(11) Yes NULL namevarchar(120)latin1_swedish_ci No description textlatin1_swedish_ci Yes NULL embed_code textlatin1_swedish_ci Yes NULL video_thumb textlatin1_swedish_ci Yes NULL views int(11) No 0 commentsint(11) No 0 last_commentdatetimeYes NULL featuredint(1) UNSIGNEDNo 0 privacy int(1) UNSIGNEDNo 0 created datetimeNo -00-00 00:00:00 favorites int(1) UNSIGNEDNo 0 spotlights int(1) UNSIGNEDNo 0 video_favorites Table: id int(11) UNSIGNEDNo auto_increment video_idint(11) UNSIGNEDNo 0 user_id int(11) No 0 video_user_id int(11) UNSIGNEDNo 0 created datetimeNo -00-00 00:00:00 WHERE "video_user_id" IS ORIGINAL VIDEO POSTER to video table. BUT THERE IS ALSO A User TABLE WHICH IS SO HUGE no need to paste in here... Here are Models: video.php VALID_NOT_EMPTY, 'user_id' => VALID_NOT_EMPTY, 'category_id' => VALID_NOT_EMPTY, 'description' => VALID_NOT_EMPTY, 'embed_code' => VALID_NOT_EMPTY ); var $belongsTo = array( 'VideoCategory' => array( 'className' => 'VideoCategory', 'foreignKey'=> 'category_id' ), 'User' ); var $hasMany = array( 'VideoComment' => array( 'className' => 'VideoComment', 'foreignKey'=> 'video_id' ), 'VideoFavorite' => array( 'className' => 'VideoFavorite', 'foreignKey'=> 'video_id' ) ); function afterDelete() { $this->loadModels('VideoComment', 'VideoFavorite'); foreach($this->VideoComment->find('all', array('conditions' => array('VideoComment.video_id' => $this->id( as $video_comment) $this->VideoComment->delete($video_comment); foreach($this->VideoFavorite->find('all', array('conditions' => array('VideoFavorite.video_id' => $this->id( as $video_favorite) $this->VideoFavorite->delete($video_favorite); } } ?> AND video_favirite.php VALID_NOT_EMPTY, 'video_user_id' => VALID_NOT_EMPTY, 'user_id' => VALID_NOT_EMPTY ); var $belongsTo = array('User' => array('foreignKey' => 'video_user_id'), 'Video' => array('foreignKey' => 'video_id'), 'VideoCategory' => array('foreignKey' => 'video_id') ); function afterDelete() { } } ?> AND user.php '/^[a-z0-9\_\-\.]{5,40}$/i', 'password' => VALID_NOT_EMPTY, 'firstname' => VALID_NOT_EMPTY, 'lastname' => VALID_NOT_EMPTY, 'gender' => VALID_NOT_EMPTY, 'birthday' => VALID_NOT_EMPTY, 'location' => VALID_NOT_EMPTY, 'email' => VALID_EMAIL ); function afterDelete() { } } ?> here is the function to set favorite: function set_favorites($id) { if(!($user = $this->User->findById($this->user['id']))) { $this->flash('error', ucfirst(i18n::translate('user not found'))); $this->redirect('/'); } else { if(!($video = $this->Video->findById($id))) { $this->flash('error', ucfirst(i18n::translate('video not found'))); $this->redirect('/'); } else { $favorite['VideoFavorite']['video_id'] = $video['Video'] ['id']; $favorite['VideoFavorite']['user_id'] = $user['User']['id']; $favorite['VideoFavorite']['video_user_id'] = $video['Video'] ['user_id']; if(!$this->VideoFavorite->save($favorite)) { $this->flash('error', ucfirst(i18n::translate('unexpected'))); } else { $this->User->query('UPDATE fociki_users' . ' SET video_favorites = video_favorites + 1' . ' WHERE id = ' . $this- >user['id']); $this->flash('valid', ucfirst(i18n::translate('video added to your favorites'))); } $this->redirect('/videos/favorites/' . $user['User'] ['username']); } } } ALL I NEED IS WHEN some User favorite that Video,... so that "Button" = "Add To Favorite" will NOT show up since its in your Favorite already. And can be removed from you
php statement is_set or array_key_exist ??
Hi guys,... How u all doi... Needless to say "...I Love You All ! " What A Wonderful Group ... ! I still have problems on Favorite issues,... Once the User favorite say some group, or video,... the button to "Add to Favorites" MUST BE REPLACED WITH "Remove Favorites" I want to know how to make that statement in php... I don't know how... lol I'm still a newbie,... but have some experiance from long time ago. And what I'm doing is creating Social Network site, and with little or no knowlllege at all do so far this much. Can you PLEASE help me with my project?? Or anyone... ?? Here is my question again: Thanks Chris -- 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: php statement as to appear replaced in views
baked by > cake (the default function name when "baked" is "add"). I'll make the > big jump and assume that your view function is defined something like: > > function view() { > $user_id = $this->Auth->user('id'); > $this->set('resume', $this->Resume->find('first', > array('user_id' => > $user_id))); > } > > where you are acessing the resume record based on the user_id and not > the id of the resume record. If that is the case, you can basically > check if the id (of the resume record, not the user_id) is null. If > the id is null, it indicates that a resume record was not found, so > display the "create" link; otherwise display the "edit" and "delete" > links. > > You might want to consider this alternative: in the controller, > instead of immediately saving the result set of the find() to the view > variable, save it to a local variable (i.e. $resume), check if the id > is defined; if not, display a session flash message indicating that > there is no resume on file, then redirect to the create action, > otherwise, save the local variable to the view variable and resume as > normal. That way, you don't have to deal with displaying the "name" > and "content" field headers with blank values and checking whether to > display the create vs. edit/delete links -- the user will be shown the > form to enter their resume info, avoiding the extra step of having to > click the "Create Resume" button; s/he can just as easily navigate > away from that page as s/he would from your original (blank) view.ctp. > > On Jan 23, 2:59 pm, "chris...@yahoo.com" wrote: > > > > > > > > > > > Hi guys, > > > I wanna to make a statement in ../views/resume/view.ctp > > > I have a table named: resume > > > id int(11) UNSIGNED No auto_increment > > user_id int(11) Yes NULL > > name varchar(120) latin1_swedish_ci No > > content text latin1_swedish_ci No > > > and in view... when resume is created, link to "Create Resume" will be > > replaced with "Edit Resume" and "Delete Resume" > > > How do I do that...? > > > What I have is manage to do is just a links: > > > > > link(ucfirst(__('create Resume', true)), '/resumes/ > > create', array('class' => 'album'), false, false, false) ?> > > > link(__('edit Resume', true), '/resumes/ > > edit/' . $resume['Resume']['id'], array('class' => 'edit'), false, > > false) ?> > > > link(__('delete Resume', true), '/resumes/ > > delete/' . $resume['Resume']['id'], array('class' => 'delete'), false, > > false) ?> > > > > > Mucho Thanks in advance ... !!! > > Chris > > On Jan 23, 2:59 pm, "chris...@yahoo.com" wrote: > > > > > > > > > Hi guys, > > > I wanna to make a statement in ../views/resume/view.ctp > > > I have a table named: resume > > > id int(11) UNSIGNED No auto_increment > > user_id int(11) Yes NULL > > name varchar(120) latin1_swedish_ci No > > content text latin1_swedish_ci No > > > and in view... when resume is created, link to "Create Resume" will be > > replaced with "Edit Resume" and "Delete Resume" > > > How do I do that...? > > > What I have is manage to do is just a links: > > > > > link(ucfirst(__('create Resume', true)), '/resumes/ > > create', array('class' => 'album'), false, false, false) ?> > > > link(__('edit Resume', true), '/resumes/ > > edit/' . $resume['Resume']['id'], array('class' => 'edit'), false, > > false) ?> > > > link(__('delete Resume', true), '/resumes/ > > delete/' . $resume['Resume']['id'], array('class' => 'delete'), false, > > false) ?> > > > > > Mucho Thanks in advance ... !!! > > Chris -- 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: array_key_exists php statement
Ok, I manage to do that... here is what works link($gift['GiftCategory']['name'], '/gifts/ category/' . $gift['GiftCategory']['name']) ?> thanks chris On Feb 6, 10:00 pm, Tilen Majerle wrote: > wtf are u trying to do?? > > {{{ > > if (array_key_exists($gift['GiftCategory']['name'], $yourArray)): > > else: > > endif; > > if (array_key_exists('controller', $this->params) && > $this->params['controller'] == 'gifts'): > > else: > > endif; > > //better choice > if (isset($this->params['controller']) && $this->controller == 'gifts') > { > > } > }}} > > -- > Lep pozdrav, Tilen Majerlehttp://majerle.eu > > 2011/2/7 chris...@yahoo.com > > > > > > > > > Hi guys,... > > how u ding... > > > I need help with php statement. I'm getting an error: > > Parse error: syntax error, unexpected ';' in /home/zipmaniak/ > > zippopeople.com/html/app/views/gifts/admin_manage.ctp on line 93 > > > > > > Please some one help me with this... or if I have to call from > > controller,... how do I do that...? > > > params) && $this- > > >params['controller'] == 'gifts' . ---WHAT ELSE IN > > HERE ???--- )): ?> > > > Thanks > > Chris > > > -- > > 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: array_key_exists php statement
Hi Tinel, Ok,.. here is the deal,... I'm trying to upload gifts,... but they are not assign any categories yet, and I will add Category and Name and Description later... But for now, since it has no category and Category table (which is like a theme to display later on a site) and which is connected thru the Gift Model to GiftPhoto Model, ... I'm having that error. Which is I wanna fix... Please tell me what $yourArray means ;) lol if I knew that why would I ask... lol Please tell me what to do in here... the whole code if possible... thanks chris On Feb 6, 10:00 pm, Tilen Majerle wrote: > wtf are u trying to do?? > > {{{ > > if (array_key_exists($gift['GiftCategory']['name'], $yourArray)): > > else: > > endif; > > if (array_key_exists('controller', $this->params) && > $this->params['controller'] == 'gifts'): > > else: > > endif; > > //better choice > if (isset($this->params['controller']) && $this->controller == 'gifts') > { > > } > }}} > > -- > Lep pozdrav, Tilen Majerlehttp://majerle.eu > > 2011/2/7 chris...@yahoo.com > > > > > > > > > Hi guys,... > > how u ding... > > > I need help with php statement. I'm getting an error: > > Parse error: syntax error, unexpected ';' in /home/zipmaniak/ > > zippopeople.com/html/app/views/gifts/admin_manage.ctp on line 93 > > > > > > Please some one help me with this... or if I have to call from > > controller,... how do I do that...? > > > params) && $this- > > >params['controller'] == 'gifts' . ---WHAT ELSE IN > > HERE ???--- )): ?> > > > Thanks > > Chris > > > -- > > 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
array_key_exists php statement
Hi guys,... how u ding... I need help with php statement. I'm getting an error: Parse error: syntax error, unexpected ';' in /home/zipmaniak/ zippopeople.com/html/app/views/gifts/admin_manage.ctp on line 93 Please some one help me with this... or if I have to call from controller,... how do I do that...? params) && $this- >params['controller'] == 'gifts' . ---WHAT ELSE IN HERE ???--- )): ?> Thanks Chris -- 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: two ids in a view $id, $id
Thanks Tarique,... but I don't think that's possible, ... I already have tables starts with id any other sujestion...? On Feb 3, 3:41 am, "Dr. Tarique Sani" wrote: > write the function signature of your show() as > > function show($groupId, $photoId) { > //write your code here using $groupId and $photoId > > } > > Strongly recommend you to brush up your basics of PHP (and programming > in general) - the time spent will be well worth it > > Cheers > Tarique > > On Thu, Feb 3, 2011 at 4:27 PM, chris...@yahoo.com wrote: > > Hi guys, > > having a problem to display two ids in a controller > > I need to display page having ids in a URL. ... > > > e.g. domain.com/index.php/groups/show/3/26 > > I need this to show photos (26, 27, 32, 35,... 41...) in groups 3, and > > so on for group 4 (28, 29, 33...) and so on... > > -- > = > PHP for E-Biz:http://sanisoft.com > = -- 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
two ids in a view $id, $id
Hi guys, having a problem to display two ids in a controller I need to display page having ids in a URL. ... e.g. domain.com/index.php/groups/show/3/26 I need this to show photos (26, 27, 32, 35,... 41...) in groups 3, and so on for group 4 (28, 29, 33...) and so on... abviouslly I'm doing something wrong. How do I do that... any one can help... greatly appreciated... function show($id, $id) { if(!($group = $this->Group->findById($id))) { $this->flash('error', ucfirst(i18n::translate('group not found'))); $this->redirect('/'); } else { if(!($photo = $this->GroupPhoto->findByIdAndGroupId($id, $group['Group']['id']))) { $this->flash('error', ucfirst(i18n::translate('photo not found'))); $this->redirect('/'); } } Thanks Chris -- 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: php statement as to appear replaced in views
Hi Sam, thanks for help... and how do I do that...? Here is another example, what I have is a video to be favorite. And once its favorite it, the button "Add to Favorites" should not be seen. The table for favorites I have is: id int(11) UNSIGNEDNo auto_increment video_id int(11) UNSIGNEDNo 0 user_idint(11) No 0 video_user_id int(11) UNSIGNEDNo 0 created where video_user_id is original video poster. I need to create this statement e.g. ...?? I don't know how... lol Thank You All for Your Help... Chris On Jan 23, 8:45 pm, Sam Sherlock wrote: > make your nav display links dependent on the action. > > On 24/01/2011, chris...@yahoo.com wrote: > > > > > > > > > > > No cricket,... no,.. no,... there is no java issue that I have. > > All I want is to make a statement to hide "Create Resume" link when > > resume is created, and show links to "Edit Resume" and "Delete > > Resume" . > > > Please,... anyone help... > > > Thanks > > Chris > > > On Jan 23, 4:21 pm, cricket wrote: > >> On Sun, Jan 23, 2011 at 5:59 PM, chris...@yahoo.com > >> wrote: > >> > Hi guys, > > >> > I wanna to make a statement in ../views/resume/view.ctp > > >> > I have a table named: resume > > >> > id int(11) UNSIGNED No auto_increment > >> > user_id int(11) Yes NULL > >> > name varchar(120) latin1_swedish_ci No > >> > content text latin1_swedish_ci No > > >> > and in view... when resume is created, link to "Create Resume" will be > >> > replaced with "Edit Resume" and "Delete Resume" > > >> > How do I do that...? > > >> > What I have is manage to do is just a links: > > >> > > >> > link(ucfirst(__('create Resume', true)), '/resumes/ > >> > create', array('class' => 'album'), false, false, false) ?> > > >> > link(__('edit Resume', true), '/resumes/ > >> > edit/' . $resume['Resume']['id'], array('class' => 'edit'), false, > >> > false) ?> > > >> > link(__('delete Resume', true), '/resumes/ > >> > delete/' . $resume['Resume']['id'], array('class' => 'delete'), false, > >> > false) ?> > >> > > > >> This is a javascript issue; nothing to do with CakePHP. > > > -- > > 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 at > >http://groups.google.com/group/cake-php > > -- > - S > > +44 (0)7908 069 219 -- 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: Save and Update 2 or more Tables
Thanks Amit, I manage to do that, but I have another problem,... Once user is a member now I need that "Join" button replaced with "Leave" and I can not make that php statement. e.g. ...? ? ? the table I have is id int(11) UNSIGNEDNo auto_increment group_idint(11) UNSIGNEDNo 0 user_id int(11) No 0 created datetimeNo -00-00 00:00:00 group_user_id where group_user_id is original group creator anyone... please help Thanks Chris On Jan 6, 10:05 pm, Amit Badkas wrote: > Hi. > > I think the line > > if(!$this->GroupMember->save($this->$member)) > > should be > > if($this->GroupMember->save($member)) > > Hope this helps. > > Amit Badkas > > PHP Applications for E-Biz:http://www.sanisoft.com > > On Fri, Jan 7, 2011 at 10:22 AM, chris...@yahoo.com wrote: > > > > > > > > > if(!$this->GroupMember->save($this->$member)) -- 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: php statement as to appear replaced in views
No cricket,... no,.. no,... there is no java issue that I have. All I want is to make a statement to hide "Create Resume" link when resume is created, and show links to "Edit Resume" and "Delete Resume" . Please,... anyone help... Thanks Chris On Jan 23, 4:21 pm, cricket wrote: > On Sun, Jan 23, 2011 at 5:59 PM, chris...@yahoo.com > wrote: > > Hi guys, > > > I wanna to make a statement in ../views/resume/view.ctp > > > I have a table named: resume > > > id int(11) UNSIGNED No auto_increment > > user_id int(11) Yes NULL > > name varchar(120) latin1_swedish_ci No > > content text latin1_swedish_ci No > > > and in view... when resume is created, link to "Create Resume" will be > > replaced with "Edit Resume" and "Delete Resume" > > > How do I do that...? > > > What I have is manage to do is just a links: > > > > > link(ucfirst(__('create Resume', true)), '/resumes/ > > create', array('class' => 'album'), false, false, false) ?> > > > link(__('edit Resume', true), '/resumes/ > > edit/' . $resume['Resume']['id'], array('class' => 'edit'), false, > > false) ?> > > > link(__('delete Resume', true), '/resumes/ > > delete/' . $resume['Resume']['id'], array('class' => 'delete'), false, > > false) ?> > > > > This is a javascript issue; nothing to do with CakePHP. -- 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
php statement as to appear replaced in views
Hi guys, I wanna to make a statement in ../views/resume/view.ctp I have a table named: resume id int(11) UNSIGNEDNo auto_increment user_idint(11) Yes NULL name varchar(120)latin1_swedish_ci No contenttextlatin1_swedish_ci No and in view... when resume is created, link to "Create Resume" will be replaced with "Edit Resume" and "Delete Resume" How do I do that...? What I have is manage to do is just a links: link(ucfirst(__('create Resume', true)), '/resumes/ create', array('class' => 'album'), false, false, false) ?> link(__('edit Resume', true), '/resumes/ edit/' . $resume['Resume']['id'], array('class' => 'edit'), false, false) ?> link(__('delete Resume', true), '/resumes/ delete/' . $resume['Resume']['id'], array('class' => 'delete'), false, false) ?> Mucho Thanks in advance ... !!! Chris -- 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: Video Points, Cost
Thanks Amit, I manage to do that... On Jan 5, 8:37 pm, Amit Badkas wrote: > Hi, > > The code in action uses $id but from where does it come/initialize? > > Amit Badkas > > PHP Applications for E-Biz:http://www.sanisoft.com > > On Thu, Jan 6, 2011 at 1:55 AM, chris...@yahoo.com wrote: > > > > > > > > > Hi guys, > > I need help with video points,... I'm creating feature that users can > > promote their videos, groups,... etc... in my social network site. In > > order to do that we need video promotion cost, which is in this case > > is points. And ADMIN can update points any time from control panel. > > Say default is 300 points, and in one month I can increase to 350 or > > make at less to 250. > > > And I can't make it work, Its kind of adding points to and > > auto_increment id, and I want it to update ONLY the cost, and NOT TO > > auto_increment id. > > > Here is what I have > > > In my video_controller.php > > > function admin_points() > > { > > > //print_r($_SESSION); > > > $this->VideoPoint->cost = $id; > > > if(!($points = $this->VideoPoint->findById($id))) > > > $this->set('points', $points); > > $this->set_title(ucfirst(i18n::translate('edit Video Cost'))); > > > if(empty($this->data)) > > { > > $this->data['VideoPoint']['cost'] = $points; > > // $this->data = $points; > > } > > else > > { > > > if($this->VideoPoint->save($this->data)) > > { > > > $this->flash('valid', ucfirst(i18n::translate('Video Costs > > Updated Succesfully'))); > > $this->redirect('/admin/videos/points/'); > > } > > } > > > } > > > In models: video_point.php > > > > class VideoPoint extends AppModel { > > var $name = 'VideoPoint'; > > > var $validate = array( > > 'cost' => VALID_NOT_EMPTY > > ); > > > var $belongsTo = array( ); > > > function afterDelete() > > { > > } > > } > > ?> > > > And in View ../views/videos/admin_points.ctp > > > > > > > > > > > > Cost', true)) ?> > > text('VideoPoint/cost', array('value' => > > $points ,'style' => 'width: 200px')) ?> > > > > > > > > > > > > > > > image('tick.png') ?> > > > > > > > > > > > > > > > Thank You for your help in advance !! > > Chris > > > 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 > om>For 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: error ??
Thanks Rayan,... On Jan 15, 7:39 am, Ryan Schmidt wrote: > On Jan 14, 2011, at 23:28, chris...@yahoo.com wrote: > > > getting error on first attempt to access the user page,... after > > all,... refresh,... it getting thru and working... why...? Did anyone > > know why...? > > > Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to > > allocate 311296 bytes) in /home/zipmaniak/zippopeople.com/html/app/ > > views/users/show.ctp on line 344 > > As the error message says, your PHP process ran out of memory. Your php.ini > is currently configured to allow each PHP process only 8MB of memory, and > this was clearly not enough. Allow each PHP process to have more memory, by > editing the appropriate value in your php.ini. 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
display page views
Hi Guys, ... How you all doi... Have a ??? How can I display page views,... I have a table and a field called "views" and I want it to increment by 1 (one) every time is specific page accessed. Here is my videos table: id int(11) UNSIGNEDNo auto_increment user_id int(11) Yes NULL category_id int(11) Yes NULL namevarchar(120)latin1_swedish_ci No description textlatin1_swedish_ci Yes NULL embed_code textlatin1_swedish_ci Yes NULL video_thumb textlatin1_swedish_ci Yes NULL views int(11) No 0 commentsint(11) No 0 last_commentdatetimeYes NULL featuredint(1) UNSIGNEDNo 0 privacy int(1) UNSIGNEDNo 0 created datetimeNo -00-00 00:00:00 favorites int(1) UNSIGNEDNo 0 spotlights Thanks Chris 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
error ??
Hi guys, getting error on first attempt to access the user page,... after all,... refresh,... it getting thru and working... why...? Did anyone know why...? Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 311296 bytes) in /home/zipmaniak/zippopeople.com/html/app/ views/users/show.ctp on line 344 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
Save and Update 2 or more Tables
Hi guys, Trying to create members join function and need to save and update in 3 tables. Here is what I have, but its not working, it's not adding to GroupMember table... any clue...? function join($id) { if(!($user = $this->User->findById($this->user['id']))) { $this->flash('error', ucfirst(i18n::translate('user not found'))); $this->redirect('/'); } else { if(!($group = $this->Group->findById($id))) { $this->flash('error', ucfirst(i18n::translate('group not found'))); $this->redirect('/'); } else { $group['Group']['favorites'] = 1; if(!$this->Group->save($group)) { $this->flash('error', ucfirst(i18n::translate('unexpected'))); } else { $member['GroupMember']['group_id'] = $group['Group']['id']; $member['GroupMember']['user_id'] = $user['User']['id']; if(!$this->GroupMember->save($this->$member)) { $this->User->query('UPDATE fociki_users' . ' SET group_favorites = group_favorites + 1' . ' WHERE id = ' . $this- >user['id']); $this->flash('valid', ucfirst(i18n::translate('thank you for join. It is also added to your groups favorites'))); } } $this->redirect('/groups/index/' . $user['User']['username']); } } } Thanks Chris 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
Video Points, Cost
Hi guys, I need help with video points,... I'm creating feature that users can promote their videos, groups,... etc... in my social network site. In order to do that we need video promotion cost, which is in this case is points. And ADMIN can update points any time from control panel. Say default is 300 points, and in one month I can increase to 350 or make at less to 250. And I can't make it work, Its kind of adding points to and auto_increment id, and I want it to update ONLY the cost, and NOT TO auto_increment id. Here is what I have In my video_controller.php function admin_points() { //print_r($_SESSION); $this->VideoPoint->cost = $id; if(!($points = $this->VideoPoint->findById($id))) $this->set('points', $points); $this->set_title(ucfirst(i18n::translate('edit Video Cost'))); if(empty($this->data)) { $this->data['VideoPoint']['cost'] = $points; // $this->data = $points; } else { if($this->VideoPoint->save($this->data)) { $this->flash('valid', ucfirst(i18n::translate('Video Costs Updated Succesfully'))); $this->redirect('/admin/videos/points/'); } } } In models: video_point.php VALID_NOT_EMPTY ); var $belongsTo = array( ); function afterDelete() { } } ?> And in View ../views/videos/admin_points.ctp text('VideoPoint/cost', array('value' => $points ,'style' => 'width: 200px')) ?> image('tick.png') ?> Thank You for your help in advance !! Chris 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
admin edit points featured videos, groups, etc...
Hi guys, How yo.. guys doinnn... I need help calling "$point" from User Table... I'm getting this error... Notice (8): Undefined index: data [CORE/app/controllers/ videos_controller.php, line 17] Apparently, I admit,.. lol... I don't know how to do this in CAKE. Can some one please help... This is what I have: in my controller: function admin_points() { $point=$_POST['data']['User']['featured_video_points']; // print_r($point); if($point!='') { $sql="UPDATE fociki_users SET featured_video_points= '". $point."' "; mysql_query($sql) or die(mysql_error()); $this->flash('notice', ucfirst(i18n::translate('Points Successfuly Updated'))); } $res=mysql_fetch_array(mysql_query("select featured_video_points from fociki_users ")); $result=$res['featured_video_points']; $this->set('points', $result); } and in my ../videos/admin_points.ctp I have: text('User/featured_video_points', array('value' => $points ,'style' => 'width: 200px')) ?> image('tick.png') ?> Can some one please teach me how to do this in CAKE and not get any error. THANKS chris 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: call in to variables...
#x27;id'])): ?> link(ucfirst(__('upload Videos', true)), '/ videoupload', array('class' => 'photos'), false, false, false) ?> | link(ucfirst(__('manage Videos', true)), '/videos/ manage/' . $user_obj['User']['id'], array('class' => 'edit'), false, false) ?> link($html->image("myplay.jpg", array('height' => 84, 'width' => 120)),'/videos/show/'.$user_obj['User']['username'].'/'. $video['Video']['id'],array('escape'=>false))?> link($html->image($video['Video']['video_thumb'], array('height' => 84, 'width' => 120)),'/videos/show/'. $user_obj['User']['username'].'/'.$video['Video'] ['id'],array('escape'=>false))?> : cut($video['Video']['name'], 60) ?> : cut($video['Video']['description'], 100) ?> : link($video['VideoCategory']['name'], '/videos/' . $video['VideoCategory']['name']) ?> : link($parent['User']['username'], '/profile/' . $parent['User']['username']) ?> : | link(ucfirst(Inflector::pluralize(__('comment', true))) . ' - ' . $video['Video']['comments'], '/videos/show/' . $user_obj['User']['username'] . '/' . $video['Video']['id']) ?> timeAgo($time, $video['Video']['created']) ?> renderElement('../pages/ad2') ?> renderElement('paginator') ?> THANKS Chris On Dec 23, 10:34 am, cricket wrote: > On Wed, Dec 22, 2010 at 8:56 PM, chris...@yahoo.com > wrote: > > > no there is no unique username, this is a social network site with > > lots of users ;) I guess,... this still in construction... > > If username is not unique your favorites action will never work > properly as it's only param is $username. You'll either need to ensure > that usernames are unique across your DB or use something else with > which to get a particular user's favorites. > > I haven't gone through all of your code (frankly, it looks like it > would benefit from a careful re-write, especially moving quite a lot > of it to a model) but, in order to use model::field() you first must > set the model's id. The point of field() is to get the column value > for a particular row. If the model's id is not set, you can't query > that row. > > I think $parent_id isn't a good choice for variable name here, as > you're not dealing with the parent Video of another Video. I assume > that it's the User that created the Video, but I'm unsure. 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: call in to variables...
and here what I have in models: I roow knoow knoow what's right what's wrong anymore... VALID_NOT_EMPTY, 'user_id' => VALID_NOT_EMPTY, 'category_id' => VALID_NOT_EMPTY, 'description' => VALID_NOT_EMPTY, 'embed_code' => VALID_NOT_EMPTY ); var $belongsTo = array( 'VideoCategory' => array( 'className' => 'VideoCategory', 'foreignKey'=> 'category_id' ), 'User' ); var $hasMany = array( 'VideoComment' => array( 'className' => 'VideoComment', 'foreignKey'=> 'video_id' ), 'VideoFavorite' => array( 'className' => 'VideoFavorite', 'foreignKey'=> 'video_id' ) ); function afterDelete() { $this->loadModels('VideoComment'); foreach($this->VideoComment->find('all', array('conditions' => array('VideoComment.video_id' => $this->id( as $video_comment) $this->VideoComment->delete($video_comment); } } ?> AND VALID_NOT_EMPTY, 'user_id' => VALID_NOT_EMPTY, 'parent_id' => VALID_NOT_EMPTY, 'category_id' => VALID_NOT_EMPTY ); var $belongsTo = array( 'VideoCategory' => array( 'className' => 'VideoCategory', 'foreignKey'=> 'category_id' ), 'User', 'Video' ); var $hasMany = array( 'Video' => array( 'className' => 'Video', 'foreignKey'=> 'id' ), 'VideoCategory' => array( 'className' => 'VideoCategory', 'foreignKey'=> 'id' ) ); function afterDelete() { } } ?> MUCHO THANKS !!! Chris On Dec 22, 5:56 pm, "chris...@yahoo.com" wrote: > Hi Amit, thanks again,... > > no there is no unique username, this is a social network site with > lots of users ;) I guess,... this still in construction... > and I'm building and adding Users Video Favorites Section, Group > Favorites, Blog Favorites etc... > And I think I have to call user_id or parent_id either from Video or > VideoFavorite tables. > > I already set it up VideoFavorite parent_id value to = Video user_id > > function set_favorites($id) > { > > if(!($user = $this->User->findById($this->user['id']))) > { > $this->flash('error', ucfirst(i18n::translate('user not > found'))); > $this->redirect('/'); > } > else > { > if(!($video = $this->Video->findById($id))) > { > $this->flash('error', ucfirst(i18n::translate('video not > found'))); > $this->redirect('/'); > } > else > { > $favorites['VideoFavorite']['video_id'] = $video['Video'] > ['id']; > $favorites['VideoFavorite']['parent_id'] = $video['Video'] > ['user_id']; > $favorites['VideoFavorite']['category_id'] = $video['Video'] > ['category_id']; > $favorites['VideoFavorite']['privacy'] = $video['Video'] > ['privacy']; > $favorites['VideoFavorite']['created'] = $video['Video'] > ['created']; > $favorites['VideoFavorite']['user_id'] = $user['User']['id']; > > if(!$this->VideoFavorite->save($favorites)) > { > $this->flash('error', > ucfirst(i18n::translate('unexpected'))); > } > else > { > $this->flash('valid', ucfirst(i18n::translate('favorites > added'))); > } > > $this->redirect('/videos/favorites/' . $user['User'] > ['username']); > } > } > } > > Thanks > Chris > > On Dec 22, 5:26
Re: call in to variables...
I have tried them all,... nothing seems working // $parent_id = $this->VideoFavorite- >findById($user['VideoFavorite']['parent_id']); // $parent_id = $this->User->field('id',array('username'=> $username)); // $parent_id = $this->Video->field('id',array('user_id'=> $user_id)); $parent_id = $this->VideoFavorite->field('id',array('parent_id'=> $parent_id)); // $parent_id = $this->Video->field(user_id); Please help... Thanks On Dec 22, 5:56 pm, "chris...@yahoo.com" wrote: > Hi Amit, thanks again,... > > no there is no unique username, this is a social network site with > lots of users ;) I guess,... this still in construction... > and I'm building and adding Users Video Favorites Section, Group > Favorites, Blog Favorites etc... > And I think I have to call user_id or parent_id either from Video or > VideoFavorite tables. > > I already set it up VideoFavorite parent_id value to = Video user_id > > function set_favorites($id) > { > > if(!($user = $this->User->findById($this->user['id']))) > { > $this->flash('error', ucfirst(i18n::translate('user not > found'))); > $this->redirect('/'); > } > else > { > if(!($video = $this->Video->findById($id))) > { > $this->flash('error', ucfirst(i18n::translate('video not > found'))); > $this->redirect('/'); > } > else > { > $favorites['VideoFavorite']['video_id'] = $video['Video'] > ['id']; > $favorites['VideoFavorite']['parent_id'] = $video['Video'] > ['user_id']; > $favorites['VideoFavorite']['category_id'] = $video['Video'] > ['category_id']; > $favorites['VideoFavorite']['privacy'] = $video['Video'] > ['privacy']; > $favorites['VideoFavorite']['created'] = $video['Video'] > ['created']; > $favorites['VideoFavorite']['user_id'] = $user['User']['id']; > > if(!$this->VideoFavorite->save($favorites)) > { > $this->flash('error', > ucfirst(i18n::translate('unexpected'))); > } > else > { > $this->flash('valid', ucfirst(i18n::translate('favorites > added'))); > } > > $this->redirect('/videos/favorites/' . $user['User'] > ['username']); > } > } > } > > Thanks > Chris > > On Dec 22, 5:26 pm, Amit Rawat wrote: > > > > > > > > > Hi, > > > Is your username unique? > > > if yes then you can use this > > > $parent_id=$this->User->field('id',array('username'=>$username)); > > > Enjoy > > > On Thu, Dec 23, 2010 at 6:48 AM, chris...@yahoo.com > > wrote: > > > > Hi Amit, thank you for your help. But it didn't work. I may, as well > > > post the whole function here. This is a favorites section that I'm > > > trying to create. All I'm trying to do,... is call parent_id so I can > > > link it to original video user username(profile) and video from view > > > page favorites.ctp. If you have a time can you please take peak at > > > >http://www.zippopeople.com > > > and this is a testing URL > > > > Thank Yo..All ! > > > > function favorites($username = null) > > > { > > > > if($username == 'unknown') > > > $this->authorize(); > > > > if(!($user = $this->User->findByUsername($username))) > > > { > > > $this->flash('error', ucfirst(i18n::translate('user not > > > found'))); > > > $this->redirect('/'); > > > } > > > > else > > > { > > > $filter = $this->params['pass']; > > > unset($filter['page']); > > > unset($filter['sort']); > > > unset($filter['direction']); > > > $this->set('url_options', $filter); > > > > $parent_id = $this->Video->field('user_id'); > > > > $this->menu->setSelected('/videos/index/' . $us
Re: call in to variables...
Hi Amit, thanks again,... no there is no unique username, this is a social network site with lots of users ;) I guess,... this still in construction... and I'm building and adding Users Video Favorites Section, Group Favorites, Blog Favorites etc... And I think I have to call user_id or parent_id either from Video or VideoFavorite tables. I already set it up VideoFavorite parent_id value to = Video user_id function set_favorites($id) { if(!($user = $this->User->findById($this->user['id']))) { $this->flash('error', ucfirst(i18n::translate('user not found'))); $this->redirect('/'); } else { if(!($video = $this->Video->findById($id))) { $this->flash('error', ucfirst(i18n::translate('video not found'))); $this->redirect('/'); } else { $favorites['VideoFavorite']['video_id'] = $video['Video'] ['id']; $favorites['VideoFavorite']['parent_id'] = $video['Video'] ['user_id']; $favorites['VideoFavorite']['category_id'] = $video['Video'] ['category_id']; $favorites['VideoFavorite']['privacy'] = $video['Video'] ['privacy']; $favorites['VideoFavorite']['created'] = $video['Video'] ['created']; $favorites['VideoFavorite']['user_id'] = $user['User']['id']; if(!$this->VideoFavorite->save($favorites)) { $this->flash('error', ucfirst(i18n::translate('unexpected'))); } else { $this->flash('valid', ucfirst(i18n::translate('favorites added'))); } $this->redirect('/videos/favorites/' . $user['User'] ['username']); } } } Thanks Chris On Dec 22, 5:26 pm, Amit Rawat wrote: > Hi, > > Is your username unique? > > if yes then you can use this > > $parent_id=$this->User->field('id',array('username'=>$username)); > > Enjoy > > On Thu, Dec 23, 2010 at 6:48 AM, chris...@yahoo.com wrote: > > > > > > > > > Hi Amit, thank you for your help. But it didn't work. I may, as well > > post the whole function here. This is a favorites section that I'm > > trying to create. All I'm trying to do,... is call parent_id so I can > > link it to original video user username(profile) and video from view > > page favorites.ctp. If you have a time can you please take peak at > > >http://www.zippopeople.com > > and this is a testing URL > > > Thank Yo..All ! > > > function favorites($username = null) > > { > > > if($username == 'unknown') > > $this->authorize(); > > > if(!($user = $this->User->findByUsername($username))) > > { > > $this->flash('error', ucfirst(i18n::translate('user not > > found'))); > > $this->redirect('/'); > > } > > > else > > { > > $filter = $this->params['pass']; > > unset($filter['page']); > > unset($filter['sort']); > > unset($filter['direction']); > > $this->set('url_options', $filter); > > > $parent_id = $this->Video->field('user_id'); > > > $this->menu->setSelected('/videos/index/' . $user['User'] > > ['username']); > > $this- > > >set_title(ucfirst(Inflector::pluralize(i18n::translate('favorite > > videos'))) . ' : ' . $user['User']['firstname'] . ' ' . $user['User'] > > ['lastname']); > > > $scope = array('VideoFavorite.user_id' => $user['User']['id']); > > if(array_key_exists('date', $this->params['pass'])) > > $scope[] = 'DATE(VideoFavorite.created) = \'' . strftime('%Y- > > %m-%d', strtotime($this->params['pass']['date'])) . '\''; > > > if($this->is_user()) > > $is_friend = in_array($this->user['id'], $this->Friend- > > >myFriends($user['User']['id'])); > > else > > $is_friend = false; > > > if($this->is_user() && $this->user['id'] == $user['User']['
Re: call in to variables...
Hi Amit, thank you for your help. But it didn't work. I may, as well post the whole function here. This is a favorites section that I'm trying to create. All I'm trying to do,... is call parent_id so I can link it to original video user username(profile) and video from view page favorites.ctp. If you have a time can you please take peak at http://www.zippopeople.com and this is a testing URL Thank Yo..All ! function favorites($username = null) { if($username == 'unknown') $this->authorize(); if(!($user = $this->User->findByUsername($username))) { $this->flash('error', ucfirst(i18n::translate('user not found'))); $this->redirect('/'); } else { $filter = $this->params['pass']; unset($filter['page']); unset($filter['sort']); unset($filter['direction']); $this->set('url_options', $filter); $parent_id = $this->Video->field('user_id'); $this->menu->setSelected('/videos/index/' . $user['User'] ['username']); $this- >set_title(ucfirst(Inflector::pluralize(i18n::translate('favorite videos'))) . ' : ' . $user['User']['firstname'] . ' ' . $user['User'] ['lastname']); $scope = array('VideoFavorite.user_id' => $user['User']['id']); if(array_key_exists('date', $this->params['pass'])) $scope[] = 'DATE(VideoFavorite.created) = \'' . strftime('%Y- %m-%d', strtotime($this->params['pass']['date'])) . '\''; if($this->is_user()) $is_friend = in_array($this->user['id'], $this->Friend- >myFriends($user['User']['id'])); else $is_friend = false; if($this->is_user() && $this->user['id'] == $user['User']['id']) { // the owner has no restriction } elseif($this->is_user() && $is_friend) { $scope[] = 'VideoFavorite.privacy <= ' . array_search('friend', Configure::read('Site.privacy')); } else { $scope[] = 'VideoFavorite.privacy <= ' . array_search('public', Configure::read('Site.privacy')); } $videos = $this->paginate('VideoFavorite', $scope); $this->set('videos', $videos); $this->set('dates', $dates = $this->VideoFavorite->query('SELECT DATE(created) AS date, COUNT(*) AS videos FROM fociki_video_favorites WHERE user_id = ' . $user['User']['id'] . ' GROUP BY DATE(created) ORDER BY created DESC')); $videos_count = 0; foreach($dates as $date) $videos_count += $date[0]['videos']; $this->set('videos_count', $videos_count); $this->set('user_obj', $user); $this->set('parent', $parent_id); $this->set('friends', $this->Friend->find('all', array('limit' => 12, 'conditions' => array('Friend.user_id' => $user['User']['id']), 'order' => array('Friend.created' => 'DESC'; } } and here is my tables: videos table id int(11) UNSIGNEDNo auto_increment user_id int(11) Yes NULL category_id int(11) Yes NULL namevarchar(120)latin1_swedish_ci No description textlatin1_swedish_ci Yes NULL embed_code textlatin1_swedish_ci Yes NULL video_thumb textlatin1_swedish_ci Yes NULL views int(11) No 0 commentsint(11) No 0 last_commentdatetimeYes NULL promo_statusint(11) No 0 privacy int(1) UNSIGNEDNo 0 created datetime No -00-00 00:00:00 video_favorites table id int(11) UNSIGNEDNo auto_increment video_idint(11) UNSIGNEDNo 0 user_id int(11) Yes NULL category_id int(11) Yes NULL privacy int(1) UNSIGNEDNo 0 created datetimeNo -00-00 00:00:00 parent_id int(11) Yes NULL Thanks again, any help is appreciat
call in to variables...
Hi All,... sound stupid but I have to ask... I want to call user_id from Video table in to $parent_id variable in my controller in order to display and link to parent user username, video in ..."Favorites" section. And how do I do that...? Please help... $parent_id = $this->Video ??? 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
video sharing script
Hi guys, anyone can suggest video sharing "social network" script written in CAKE. I want to add video section to my social network (still in testing) site. So users can add their own videos from these MAJOR guys like Youtube, Metacafe, DailyMotion Vimeo,... etc... and if possible just by placing the URL of video site, and NOT the whole embed code. I have some script,... and need help to integrate it. Thanks Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: ratings, like and dislike buttons...
Thank you for your reply guys,... Have any one tried Rating from CAKE https://github.com/CakeDC/ratings/tree/ I don't know can it work on my version,... I don't even know what version I have and how can I check it... And if possible to migrate to new 1.3.x.x. version... Thanks Salute, Chris On Dec 1, 2:55 pm, Salines wrote: > Create new table: > > | id | fociki_blog_id | like | dislike | user_id | created | > > and add some logic to your code > > On 1 pro, 16:38, John Andersen wrote: > > > > > > > > > What are your requirements with regard to: > > - tracking which user used the Like and the Dislike buttons? > > - tracking when the Like or Dislike event took place? > > - statistics on the Like and Dislike event over time (total, within > > last 3 months, last week, location, etc)? > > > I would register the Like and Dislike event in a separate table, > > possibly together with the foreign key to the user who did it. > > Something like: > > > fociki_blogs -> hasMany -> like_indications <- belongsTo <- users > > users -> hasMany -> like_indications <- belongsTo <- fociki_blogs > > > The rest is up to you :) Enjoy, > > John > > > On 1 Dec., 15:49, "chris...@yahoo.com" wrote: > > > > hii All,... please help,... I need to create like and dislike buttons > > > for users to use in my social network BLOG section, something like in > > > a facebook. Please advise,... should I take it to a new table or add > > > fields in existing one,... this is what I have so far... > > > > CREATE TABLE `fociki_blogs` ( > > > `id` int(11) unsigned NOT NULL auto_increment, > > > `user_id` int(11), > > > `category_id` int(11), > > > `title` varchar(255) NOT NULL default '', > > > `topic` text NOT NULL, > > > `last_comment` datetime default NULL, > > > `comments` int(11) NOT NULL default '0', > > > `privacy` int(1) unsigned NOT NULL default '0', > > > `created` datetime NOT NULL default '-00-00 00:00:00', > > > PRIMARY KEY (`id`) > > > ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; > > > > 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
ratings, like and dislike buttons...
hii All,... please help,... I need to create like and dislike buttons for users to use in my social network BLOG section, something like in a facebook. Please advise,... should I take it to a new table or add fields in existing one,... this is what I have so far... CREATE TABLE `fociki_blogs` ( `id` int(11) unsigned NOT NULL auto_increment, `user_id` int(11), `category_id` int(11), `title` varchar(255) NOT NULL default '', `topic` text NOT NULL, `last_comment` datetime default NULL, `comments` int(11) NOT NULL default '0', `privacy` int(1) unsigned NOT NULL default '0', `created` datetime NOT NULL default '-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; THANKS ! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: how do I create categories and read from FORM FIELD and post to that... in CAKEphp
Thank you for your help cricket,... leme try this... lol I know that this is still old version of it. But I bought it and kind of stack with it,... like it too much, I did lots of work on it already ... but will love to upgrade to 1.3.5 if possible. I'm still leaning the process of it, I mean the CAKE and will catch you up in a year or so... lol here is my testing site url: http://www.zippopeople.com in case you want to look into it... THANKS A LOT again On Nov 8, 5:09 pm, cricket wrote: > On Mon, Nov 8, 2010 at 5:46 PM, chris...@yahoo.com wrote: > > Hi guys, I'm new to this,... and make a long story short I bought an > > incomplete social network script... I need to add videos, blogs, > > groups,... etc... and having problem to categories them... Found you > > here in Google Groups,... What a great place to be... Thank you in > > advance for your help and effort... Here we go... > > What I have is: > > > > class Video extends AppModel { > > var $name = 'Video'; > > > var $validate = array( > > 'video_title' => VALID_NOT_EMPTY, > > 'user_id' => VALID_NOT_EMPTY, > > 'category_id' => VALID_NOT_EMPTY, > > 'video_description' => VALID_NOT_EMPTY, > > 'video_embed_code' => VALID_NOT_EMPTY > > ); > > It looks like you're using an older version of Cake. You'll need to > take care that any advice you receive, or find online, corresponds to > your version. In any case, VALID_NOT_EMPTY has been deprecated. See > this page for the latest: > > http://book.cakephp.org/view/1152/Core-Validation-Rules > > I suggest, if at all possible, you upgrade to 1.3.5. It'll mean a few > modifications but it'll be worth it. > > > > > > > > > > > var $belongsTo = array( > > 'VideoCategory' => array( > > 'className' => 'VideoCategory', > > 'foreignKey' => 'category_id' > > ), > > 'User' => array( > > 'className' => 'User', > > 'foreignKey' => 'id' > > ) > > ); > > > var $hasMany = array( > > 'VideoComment' => array( > > 'className' => 'VideoComment', > > 'foreignKey' => 'video_id' > > ), > > 'User' => array( > > 'className' => 'User', > > 'foreignKey' => 'id' > > ) > > ); > > > } > > ?> > > > and > > > > class VideoCategory extends AppModel { > > var $name = 'VideoCategory'; > > > var $validate = array( > > 'id' => VALID_NOT_EMPTY, > > 'category_name' => VALID_NOT_EMPTY > > ); > > > } > > ?> > > > in models > > > I like to know how to display these categories in fields e.g. > > select('Video/category'), . and how to post that > > video to belong to that category and what I need to have in > > videos_controller.php and .../views/videos/add.ctp for select box. > > The easiest way is to use find('list'), which returns an array in the > form, $id => $name, and can be passed to the FormHelper to create a > select list. > > Videosontroller: > > function edit($id = null) > { > if (!$id) > { > // set Flash msg and redirect > } > > if (!empty($this->data)) > { > // check validation, save, redirect if saved > } > > $this->set( > 'categories', > $this->Video->VideoCategory->find('list') > ); > > } > > view: > > echo $form->select('Video.category_id', $categories); > > Actually, now that I think about it, FormHelper didn't exist in > version 1.1.x, I think. But that's the basic idea in > 1.2.x.http://book.cakephp.org/view/305/The-Manual 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 do I create categories and read from FORM FIELD and post to that... in CAKEphp
Hi guys, I'm new to this,... and make a long story short I bought an incomplete social network script... I need to add videos, blogs, groups,... etc... and having problem to categories them... Found you here in Google Groups,... What a great place to be... Thank you in advance for your help and effort... Here we go... What I have is: VALID_NOT_EMPTY, 'user_id' => VALID_NOT_EMPTY, 'category_id' => VALID_NOT_EMPTY, 'video_description' => VALID_NOT_EMPTY, 'video_embed_code' => VALID_NOT_EMPTY ); var $belongsTo = array( 'VideoCategory' => array( 'className' => 'VideoCategory', 'foreignKey'=> 'category_id' ), 'User' => array( 'className' => 'User', 'foreignKey'=> 'id' ) ); var $hasMany = array( 'VideoComment' => array( 'className' => 'VideoComment', 'foreignKey'=> 'video_id' ), 'User' => array( 'className' => 'User', 'foreignKey'=> 'id' ) ); } ?> and VALID_NOT_EMPTY, 'category_name' => VALID_NOT_EMPTY ); } ?> in models I like to know how to display these categories in fields e.g. select('Video/category'), . and how to post that video to belong to that category and what I need to have in videos_controller.php and .../views/videos/add.ctp for select box. Thank you all Salute Chris 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
The Biggest Social Network site...
Hello all,... I have a beautiful START with a this BIGGEST Social site I have dreamed of. Half way thru,... can't finish it. I'm just a beginner, and have plans to create the BIGGEST ever social site on the Net... lol, with plans and strategies that CAN bring more Business to your pocket. ... Looking for 3-4 motivated coders to join a Network,... and work on this OPEN project. Each one of us will have a access to same server, same TESTING domain,... we will share the ideas and feature development... Here is the testing site URL http://www.zippopeople.com please send me an email if you are interested in... and we will contact in skype. Thanks Salute Chris 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
Social Network Site script help
Hi there, I wonder if you can help me please with my social network site. Need to add video section, gift sections affiliated with Paypal or something, blog, event, and lot more to do, ... etc... Here is a testing site URL http://www.zippopeople.com Foundation cake Thanks Chris 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