Wednesday, December 1, 2010

Re: ratings, like and dislike buttons...

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 '0000-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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: