cake authentication

2011-07-20 Thread chris...@yahoo.com
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


menu Model

2011-07-20 Thread chris...@yahoo.com
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

?php
class Link
{
  var $url;

  var $name;

  var $style;

  function Link($url, $name, $style = array())
  {
$this-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 'li' . $html-link($this-name, $this-url, $this-style,
false, false) . '/li';
  }
}

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 = 'ul id=' . $this-id . '';
  foreach($this-links as $link)
$output .= $link-parse($html, $current_url);
  $output .= '/ul';
}

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


what version of CAKE am I using ?

2011-06-11 Thread 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 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 ?

2011-06-11 Thread chris...@yahoo.com
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 tilen.maje...@gmail.com 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 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


migrate error

2011-05-27 Thread chris...@yahoo.com
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

?php echo $content_for_layout ?

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


UPDATE table

2011-04-21 Thread chris...@yahoo.com
 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


Re: UPDATE table

2011-04-21 Thread chris...@yahoo.com
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
jeremybu...@classoutfit.com 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


Re: UPDATE table

2011-04-21 Thread chris...@yahoo.com
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


checkbox field to display

2011-04-14 Thread chris...@yahoo.com
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.

?php echo $form-checkbox('User/show_groups') ?
I have tried with  'checked' = 'checked'
?php echo $form-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

2011-03-10 Thread chris...@yahoo.com
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 sambern...@gmail.com 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

2011-03-09 Thread chris...@yahoo.com
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


Re: help with guest table update

2011-02-15 Thread chris...@yahoo.com
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
jeremybu...@classoutfit.com 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


time frame

2011-02-15 Thread chris...@yahoo.com
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: error ??

2011-02-14 Thread chris...@yahoo.com
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 google-2...@ryandesign.com 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


help with guest table update

2011-02-14 Thread chris...@yahoo.com
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 ??

2011-02-14 Thread chris...@yahoo.com
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 sicapi...@gmail.com wrote:
 phpinfo() should also say this (from memory)

 On 15 February 2011 14:00, Meroe Meroe whme...@gmail.com wrote:







  What O/S?

  On Tue, Feb 15, 2011 at 12:23 AM, chris...@yahoo.com 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 google-2...@ryandesign.com 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


views = 1234... numbers

2011-02-10 Thread chris...@yahoo.com
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: views = 1234... numbers

2011-02-10 Thread chris...@yahoo.com
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 mi...@brightstorm.co.uk wrote:
 On 10 Feb 2011, at 17:30, chris...@yahoo.com 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


Re: views = 1234... numbers

2011-02-10 Thread chris...@yahoo.com
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
jeremybu...@classoutfit.com 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 mi...@brightstorm.co.uk wrote:
  On 10 Feb 2011, at 17:30, chris...@yahoo.com 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


pagination in controller

2011-02-10 Thread chris...@yahoo.com
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

2011-02-10 Thread chris...@yahoo.com
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
jeremybu...@classoutfit.com 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
  jeremybu...@classoutfit.com 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 mi...@brightstorm.co.uk wrote:
  On 10 Feb 2011, at 17:30, chris...@yahoo.com 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


Re: php statement as to appear replaced in views

2011-02-09 Thread chris...@yahoo.com
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 adri...@jps.net 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: php statement as to appear replaced in views

2011-02-08 Thread chris...@yahoo.com
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

?php
class Video extends AppModel {
var $name = 'Video';

var $validate = array(
'name' = 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

?php
class VideoFavorite extends AppModel {
  var $name = 'VideoFavorite';

  var $validate = array(
'video_id' = 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

?php
class User extends AppModel {
  var $name = 'User';

  var $validate = array(
'username' = '/^[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')));
  }


SWF Uploader ... or any Good One...?

2011-02-08 Thread chris...@yahoo.com
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: ?php echo
session_id(); ?},

HERE IS THE ORIGINAL for PHOTOS

var swfu;

window.onload = function() {
  var settings = {
flash_url : ?php echo $this-webroot ?swf/swfupload.swf,
upload_url: ?php echo $html-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 : ?php echo $this-webroot ?swf/swfupload.swf,
upload_url: ?php echo $html-url('/groups/upload/' .
$group['Group']['id'], true) ?,   // Relative to the SWF file
post_params: {PHPSESSID: ?php echo session_id(); ?},


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 : ?php echo $this-webroot ?swf/swfupload.swf,
upload_url: ?php echo $html-url('/groups/upload/ .
$group['Group']['id']?PHPSESSID=' . session_id(), true) ?,//
Relative to the SWF file
post_params: {PHPSESSID: ?php echo session_id(); ?},

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: SWF Uploader ... or any Good One...?

2011-02-08 Thread chris...@yahoo.com
hi 2345,...
I download it. I have a question,...
where do you put your action...??? (this is from previous one)
form id=form5 action=?php echo $html-url('/groups/upload/' .
$group['Group']['id'], true) ? method=post enctype=multipart/form-
data

...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 21 ');
exec('/usr/bin/convert -geometry 135x135 ' .
$original_file_path . ' ' . $this-GroupPhoto-getSmallFile($this-
GroupPhoto-id, $secret)-pwd() .'  /dev/null 21 ');
exec('/usr/bin/convert -geometry 140x220 ' .
$original_file_path . ' ' . $this-GroupPhoto-getThumbFile($this-
GroupPhoto-id, $secret)-pwd() .'  /dev/null 21 ');
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 21 ');
  }

  echo 'OK';
  die();
}

  }

Thanks
chris


On Feb 8, 7:44 pm, thatsgreat2345 thatsgreat2...@gmail.com 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 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: ?php echo
  session_id(); ?},

  HERE IS THE ORIGINAL for PHOTOS

      var swfu;

      window.onload = function() {
        var settings = {
          flash_url : ?php echo $this-webroot ?swf/swfupload.swf,
          upload_url: ?php echo $html-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 : ?php echo $this-webroot ?swf/swfupload.swf,
          upload_url: ?php echo $html-url('/groups/upload/' .
  $group['Group']['id'], true) ?,       // Relative to the SWF file
          post_params: {PHPSESSID: ?php echo session_id(); ?},

  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 : ?php echo $this-webroot ?swf/swfupload.swf,
          upload_url: ?php echo $html-url('/groups/upload/ .
  $group['Group']['id']?PHPSESSID=' . session_id(), true) ?,    //
  Relative to the SWF file
          post_params: {PHPSESSID: ?php echo session_id(); ?},

  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


error loading model on setup

2011-02-08 Thread chris...@yahoo.com
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

?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


Re: error loading model on setup

2011-02-08 Thread chris...@yahoo.com
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 j.andersen...@gmail.com 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 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

  ?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


Re: php statement as to appear replaced in views

2011-02-07 Thread chris...@yahoo.com
), 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 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:

  span style=float: right; margin: 0 5px 0 0;
    ?php echo $html-link(ucfirst(__('create Resume', true)), '/resumes/
  create', array('class' = 'album'), false, false, false) ?

       ?php echo $html-link(__('edit Resume', true), '/resumes/
  edit/' . $resume['Resume']['id'], array('class' = 'edit'), false,
  false) ?

       ?php echo $html-link(__('delete Resume', true), '/resumes/
  delete/' . $resume['Resume']['id'], array('class' = 'delete'), false,
  false) ?
  /span

  Mucho Thanks in advance ... !!!
  Chris

 On Jan 23, 2:59 pm, chris...@yahoo.com 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:

  span style=float: right; margin: 0 5px 0 0;
    ?php echo $html-link(ucfirst(__('create Resume', true)), '/resumes/
  create', array('class' = 'album'), false, false, false) ?

       ?php echo $html-link(__('edit Resume', true), '/resumes/
  edit/' . $resume['Resume']['id'], array('class' = 'edit'), false,
  false) ?

       ?php echo $html-link(__('delete Resume', true), '/resumes/
  delete/' . $resume['Resume']['id'], array('class' = 'delete'), false,
  false) ?
  /span

  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


php statement is_set or array_key_exist ??

2011-02-07 Thread chris...@yahoo.com
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:

?php if( WHAT THE HELL IS IN HERE ??? oopps... ($group['Group']
['id'])): ?

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


array_key_exists php statement

2011-02-06 Thread 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

?php if(!(array_key_exists($gift['GiftCategory']['name'])) ?

Please some one help me with this...  or if I have to call from
controller,... how do I do that...?

?php if(!(array_key_exists('controller', $this-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: array_key_exists php statement

2011-02-06 Thread chris...@yahoo.com
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 tilen.maje...@gmail.com 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 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

  ?php if(!(array_key_exists($gift['GiftCategory']['name'])) ?

  Please some one help me with this...  or if I have to call from
  controller,... how do I do that...?

  ?php if(!(array_key_exists('controller', $this-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

2011-02-06 Thread chris...@yahoo.com
Ok,
I manage to do that...
here is what works

?php if(!is_null($gift['GiftPhoto']['category_id'])): ?

?php echo $html-link($gift['GiftCategory']['name'], '/gifts/
category/' . $gift['GiftCategory']['name']) ?

?php else: ?
?php echo ucfirst(__('no categories', true)) ?

?php endif ?


thanks
chris


On Feb 6, 10:00 pm, Tilen Majerle tilen.maje...@gmail.com 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 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

  ?php if(!(array_key_exists($gift['GiftCategory']['name'])) ?

  Please some one help me with this...  or if I have to call from
  controller,... how do I do that...?

  ?php if(!(array_key_exists('controller', $this-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: two ids in a view $id, $id

2011-02-03 Thread chris...@yahoo.com
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 tariques...@gmail.com 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 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


Re: Save and Update 2 or more Tables

2011-01-24 Thread chris...@yahoo.com
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. ?php if(($favorite['Favorite']['user_id'] ==)): ? ...? ? ?

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 amit.sanis...@gmail.com 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 chris...@yahoo.comwrote:







  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

2011-01-24 Thread chris...@yahoo.com
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. ?php if(($favorite['VideoFavorite']['user_id']  == )): ? ...??
I don't know how... lol

Thank You All for Your Help...
Chris


On Jan 23, 8:45 pm, Sam Sherlock sam.sherl...@gmail.com wrote:
 make your nav display links dependent on the action.

 On 24/01/2011, chris...@yahoo.com 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 zijn.digi...@gmail.com wrote:
  On Sun, Jan 23, 2011 at 5:59 PM, chris...@yahoo.com 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:

   span style=float: right; margin: 0 5px 0 0;
    ?php echo $html-link(ucfirst(__('create Resume', true)), '/resumes/
   create', array('class' = 'album'), false, false, false) ?

       ?php echo $html-link(__('edit Resume', true), '/resumes/
   edit/' . $resume['Resume']['id'], array('class' = 'edit'), false,
   false) ?

       ?php echo $html-link(__('delete Resume', true), '/resumes/
   delete/' . $resume['Resume']['id'], array('class' = 'delete'), false,
   false) ?
   /span

  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


php statement as to appear replaced in views

2011-01-23 Thread chris...@yahoo.com
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:

span style=float: right; margin: 0 5px 0 0;
  ?php echo $html-link(ucfirst(__('create Resume', true)), '/resumes/
create', array('class' = 'album'), false, false, false) ?

 ?php echo $html-link(__('edit Resume', true), '/resumes/
edit/' . $resume['Resume']['id'], array('class' = 'edit'), false,
false) ?

 ?php echo $html-link(__('delete Resume', true), '/resumes/
delete/' . $resume['Resume']['id'], array('class' = 'delete'), false,
false) ?
/span


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: php statement as to appear replaced in views

2011-01-23 Thread chris...@yahoo.com
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 zijn.digi...@gmail.com wrote:
 On Sun, Jan 23, 2011 at 5:59 PM, chris...@yahoo.com 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:

  span style=float: right; margin: 0 5px 0 0;
   ?php echo $html-link(ucfirst(__('create Resume', true)), '/resumes/
  create', array('class' = 'album'), false, false, false) ?

      ?php echo $html-link(__('edit Resume', true), '/resumes/
  edit/' . $resume['Resume']['id'], array('class' = 'edit'), false,
  false) ?

      ?php echo $html-link(__('delete Resume', true), '/resumes/
  delete/' . $resume['Resume']['id'], array('class' = 'delete'), false,
  false) ?
  /span

 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


display page views

2011-01-16 Thread chris...@yahoo.com
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


Re: error ??

2011-01-16 Thread chris...@yahoo.com
Thanks Rayan,...


On Jan 15, 7:39 am, Ryan Schmidt google-2...@ryandesign.com 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


Re: Video Points, Cost

2011-01-16 Thread chris...@yahoo.com
Thanks Amit,
I manage to do that...


On Jan 5, 8:37 pm, Amit Badkas amit.sanis...@gmail.com 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 chris...@yahoo.comwrote:







  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

  ?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

  form id=admin_points method=post 

   table  style=width: 620px; align=center

   tr
     thlabel for=VideoPointCost?php echo ucfirst(__('Video
  Cost', true)) ?/label/th
     td?php echo $form-text('VideoPoint/cost', array('value' =
  $points ,'style' = 'width: 200px')) ?/td

   /tr

   /table

   p
     div class=buttons style=float: right; margin-right: 60px;
         button type=submit class=positive
             ?php echo $html-image('tick.png') ?
             ?php echo ucfirst(__('save', true)) ?
         /button
     /div
   /p
   div class=clr/div
  /form

  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.comcake-php%2Bunsubscribe@googlegroups.c 
  omFor more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


error ??

2011-01-14 Thread chris...@yahoo.com
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

2011-01-06 Thread chris...@yahoo.com
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

2011-01-05 Thread chris...@yahoo.com
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

?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


form id=admin_points method=post 

  table  style=width: 620px; align=center

  tr
thlabel for=VideoPointCost?php echo ucfirst(__('Video
Cost', true)) ?/label/th
td?php echo $form-text('VideoPoint/cost', array('value' =
$points ,'style' = 'width: 200px')) ?/td

  /tr



  /table

  p
div class=buttons style=float: right; margin-right: 60px;
button type=submit class=positive
?php echo $html-image('tick.png') ?
?php echo ucfirst(__('save', true)) ?
/button
/div
  /p
  div class=clr/div
/form


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...

2010-12-29 Thread chris...@yahoo.com
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:


form id=admin_points method=post 

  table  style=width: 645px; align=center

  tr
thlabel for=UserFeaturedVideoPoints?php echo
ucfirst(__('Enter Points in Mulitiplication', true)) ?/label/th
td?php echo $form-text('User/featured_video_points',
array('value' = $points ,'style' = 'width: 200px')) ?/td

  /tr



  /table

  p
div class=buttons style=float: right; margin-right: 60px;
button type=submit class=positive
?php echo $html-image('tick.png') ?
?php echo ucfirst(__('save', true)) ?
/button
/div
  /p
  div class=clr/div
/form


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...

2010-12-23 Thread chris...@yahoo.com
=javascript:swapImage(1, this)
onmouseover=javascript:swapImage(0, this)
onmouseout=javascript:swapImage(2, this)

  div class=sub_menu id=id_menu_date
?php echo $html-link(__('all', true) . ' - ' .
$videos_count, '/videos/index/' . $user_obj['User']['username']) ?
?php foreach($dates as $date): ?
?php echo $html-link($application-daysAgo($time,
current(current($date))) . ' - ' . $date[0]['videos'], $paginator-
url(am($url_options, array('date' = $time-format('j.n.Y',
current(current($date), true)) ?
 ?php endforeach ?
  /div
div class=clr/div
/div


div class=clr/div
br /

 ?php if($user-is_authorized($user_obj['User']['id'])): ?
  span style=text-align: left; font-size: 12px; font-weight:
normal;
span style=float: right; margin: 0 40px 0 0;
   ?php echo $html-link(ucfirst(__('upload Videos', true)), '/
videoupload', array('class' = 'photos'), false, false, false) ?
|
 ?php echo $html-link(ucfirst(__('manage Videos', true)), '/videos/
manage/' . $user_obj['User']['id'], array('class' = 'edit'), false,
false) ?
/span
  /span
?php endif ?
div class=clr/div


div  style=float: left; margin: 10px 5px 0 5px; 
padding: 0 3px 0
3px; width: 625px;
?php $i = 0; ?
?php foreach($videos as $video): ?


  div style=float: left; width: 625px; padding: 0 3px 7px 3px;
class=comment notlast

div style=float: left; border: 1px solid #aaa; padding: 5px;

? if(empty($video['Video']['video_thumb'])): ?
?php echo $html-link($html-image(myplay.jpg, array('height' =
84, 'width' = 120)),'/videos/show/'.$user_obj['User']['username'].'/'.
$video['Video']['id'],array('escape'=false))?

? else: ?
?php echo $html-link($html-image($video['Video']['video_thumb'],
array('height' = 84, 'width' = 120)),'/videos/show/'.
$user_obj['User']['username'].'/'.$video['Video']
['id'],array('escape'=false))?
? endif ?


/div


div style=float: left; margin: 0 0 0 13px; display: block; width:
470px;

span style=float: left; font-size: 1.1em; color: #0B1033; font-
weight: normal; margin-top: 0;
?php echo ucfirst(__('title', true)) ?: 
strong?php echo $application-cut($video['Video']['name'], 60) ?/
strong
/span

div class=clr/div

span style=float: left; font-size: 1.4em; font-weight: normal;
?php echo ucfirst(__('description', true)) ?: 
?php echo $application-cut($video['Video']['description'], 100) ?/
span

div class=clr/div


  span style=float: left; font-size: 1.1em; font-weight: normal;
color: #aaa; margin-top: 5px;

?php echo ucfirst(__('category', true)) ?: 
?php echo $html-link($video['VideoCategory']['name'], '/videos/' .
$video['VideoCategory']['name']) ?

 ?php echo ucfirst(__('by', true)) ?: 
?php echo $html-link($parent['User']['username'], '/profile/' .
$parent['User']['username']) ?/span

div class=clr/div


span style=float: left; font-size: 1em; font-weight: normal;
color: #00; margin-top: 13px;
?php echo ucfirst(__('views', true)) ?: 
?php echo $video['Video']['views'] ?
   |   
?php echo $html-link(ucfirst(Inflector::pluralize(__('comment',
true))) . ' - ' . $video['Video']['comments'], '/videos/show/' .
$user_obj['User']['username'] . '/' . $video['Video']['id']) ?
/span


   span class=notimportant date style=float: right; margin-top:
15px;
?php echo $application-timeAgo($time, $video['Video']['created']) ?
/span

   div class=clr/div

   /div
/div


  ?php if($i++ % 1 - 0 == 0): ?
  div class=clr/div
  ?php endif ?
 ?php endforeach ?
  div class=clr/div
  /div





  div class=clr/div

!-- span style=float: left; display: block; font-size: 11px; font-
weight: normal; margin: 20px;
 ?php echo $html-link(ucfirst(__('what\'s This ?', true)), '/
videos') ?
/span --
/div
/div
div style=width: 250px; float: left; margin: 1px 0 0 5px; padding-
left: 15px; border-left: 1px solid #aaa;

   h3 class=styled style=width: 240px;?php echo
ucfirst(__('highlights', true)) ?/h3
  div class=clr/div
  p style=float: right; font-size: 11px; font-weight: normal;
margin: 0 5px 8px 0; letter-spacing: 3px; color: #2DD1F9;?php echo
__('advertising', true) ?/p
  div class=clr/div
div style=float: left; margin: 0 0 0 5px;
!-- ?php echo $this-renderElement('../pages/ad') ? --
br /br /
?php echo $this-renderElement('../pages/ad2') ?
br /br /
/div
 /div
div class=clr/div
br /br /
div class=clr/div
?php echo $this-renderElement('paginator') ?
div class=clr/div

THANKS
Chris


On Dec 23, 10:34 am, cricket zijn.digi...@gmail.com wrote:
 On Wed, Dec 22, 2010 at 8:56 PM, chris...@yahoo.com 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

call in to variables...

2010-12-22 Thread chris...@yahoo.com
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


Re: call in to variables...

2010-12-22 Thread chris...@yahoo.com
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 datetimeNo  -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 appreciated !!!
Chris



On Dec 22, 4:20 pm, Amit Rawat rawatami...@gmail.com wrote:
 Hi Chris,

 Use find field

 $parent_id = $this-Video-field('user_id',array('your condition goes
 here'))

 enjoy,

 Amit

 On Thu, Dec 23, 2010 at 3:41 AM, chris...@yahoo.com chris...@yahoo.comwrote:







  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 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

Re: call in to variables...

2010-12-22 Thread chris...@yahoo.com
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 rawatami...@gmail.com 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 chris...@yahoo.comwrote:







  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)         UNSIGNED        No              auto_increment
         user_id int(11)                 Yes     NULL
         category_id     int(11)                 Yes

Re: call in to variables...

2010-12-22 Thread chris...@yahoo.com
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 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 rawatami...@gmail.com 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 
  chris...@yahoo.comwrote:

   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

Re: call in to variables...

2010-12-22 Thread chris...@yahoo.com
and here what I have in models: I roow knoow knoow what's right what's
wrong anymore...

?php
class Video extends AppModel {
var $name = 'Video';

var $validate = array(
'name' = 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

?php
class VideoFavorite extends AppModel {
  var $name = 'VideoFavorite';

  var $validate = array(
'video_id' = 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 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 rawatami...@gmail.com 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 
  chris...@yahoo.comwrote:

   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

video sharing script

2010-12-20 Thread chris...@yahoo.com
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...

2010-12-14 Thread chris...@yahoo.com
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 nikola.parad...@gmail.com 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 j.andersen...@gmail.com 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 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...

2010-12-01 Thread chris...@yahoo.com
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


how do I create categories and read from FORM FIELD and post to that... in CAKEphp

2010-11-08 Thread chris...@yahoo.com
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:

?php
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
);

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

?php
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 form fields e.g.
?php echo $form-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


Re: how do I create categories and read from FORM FIELD and post to that... in CAKEphp

2010-11-08 Thread chris...@yahoo.com
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 zijn.digi...@gmail.com wrote:
 On Mon, Nov 8, 2010 at 5:46 PM, chris...@yahoo.com 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:

  ?php
  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

  ?php
  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 form fields e.g.
  ?php echo $form-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


The Biggest Social Network site...

2010-10-29 Thread chris...@yahoo.com
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

2010-10-20 Thread chris...@yahoo.com

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