xoops forums

irmtfan

Module Developer
Posted on: 2013/4/3 2:35
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#1

Like system (module/extension) for xoops

Honestly i can see a big lack in xoops without a like system.
a like system is very needed for a community website.
It will work similar to FB Like.
Xoops users will have (like/unlike)|(dislike/undislike) options in any xoops links: e.g: a news item, a single post in a forum topic, a download, a single comment, even a user account

It would be very interesting rating system for any website.
because you will have most liked items, ...

Recently i start to work on such a system for xoops 2.5.5 as a module (then xoops 2.6)

I just need to know what do you think about it.

This module will work similar to Tag module.
The coding part is far from my abilities and i will be happy to see some experts help on writing codes.

Today i start by writing this structure for table in database:
# like module database structure
# version 1
# irmtfan irmtfan@yahoo.com
# --------------------------------------------------------
CREATE TABLE mod_like_like (
  
like_id mediumint(8unsigned NOT NULL auto_increment,
  
time_create int(11unsigned NOT NULL default 0,
  
time_update int(11unsigned NOT NULL default 0,
  
like_uid mediumint(8unsigned NOT NULL default 0,
  
item_module varchar(10NOT NULL default '',
  
item_name varchar(10NOT NULL default '',
  
item_id int(11unsigned NOT NULL default 0,
  
item_uid mediumint(8unsigned NOT NULL default 0,
  
status   smallint(2unsigned NOT NULL default 0,
  
PRIMARY KEY  (like_id),
  
KEY item (item_moduleitem_nameitem_id)
ENGINE=MyISAM;

CREATE TABLE mod_like_status (
  
status_id mediumint(8unsigned NOT NULL auto_increment,
  
status_name varchar(100NOT NULL default '',
  
status smallint(2unsigned NOT NULL default 0,
  
PRIMARY KEY  (status_id)
ENGINE=MyISAM;


the status will represent like/unlike features.

Then i want to create a smarty function to work like this by inserting to any module template:
<{like op="like" item_name="post_id" item_id=$post_id}>


I think we need to have a like system in XOOPS at the soonest possible time by gathering all resources (all developers) otherwise it would be a big missing feature for today world.

Mamba

Moderator
Posted on: 2013/4/3 3:16
Mamba
Mamba (Show more)
Moderator
Posts: 10750
Since: 2004/4/23
#2

Re: Like system (module/extension) for xoops

I hope, we could use/modify the Rating extension to have different ways of "rating":

- stars
- numbers
- like/dislike

etc.

It would make more sense to have to deal only with one extensions for a similar functionality
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

redheadedrod

Home away from home
Posted on: 2013/4/3 7:50
redheadedrod
redheadedrod (Show more)
Home away from home
Posts: 1296
Since: 2008/2/26
#3

Re: Like system (module/extension) for xoops

I agree Mamba... Would also be nice to add multi step ratings as well and show the average score.

irmtfan

Module Developer
Posted on: 2013/4/4 2:28
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#4

Re: Like system (module/extension) for xoops

Yes i review that rating extension and it is a step forward.
But a like system is different in concept.
do you know why a FB like boutton is so popular? it is because a like system is focused on who is rate who's page(content)
the current rating system in xoops just make a rating system available in pages(contents) without think about people but the main point is a liker/follower rate the author not the page itself. that's why the current rating in xoops is useless.

by a like system you will find useful content from good authors. eg: most liked items means those information more people liked.
let me show you by a real example in forums.
assume user A has 1000 posts and user B has only 10 posts.
the Like status would be:
- 34 users liked user A in 12 posts and 1453 users dislike user A in 786 posts
- 465 users liked user B in 6 posts and 2 users dislike user B in 1 post.

The above is so informative and meaningful. it shows that user A is like a spam he submit too many posts but his posts are useless. also it shows user B is too popular and his posts are informative. then a new comer will understand that user B is trustful although he has only 10 posts

Anyway we can use Rating extension written by kraven30 but it needs to changed so much.
so this rating extension should be changed as below:

1- the structure should be changed similar to what i wrote in the first post to add like_uid (liker/follower) and item_uid (author)

2- a module developer or even a simple webmaster just need to add a smarty code in the module template without touching php file.

is kraven30 ready to accept a huge changes in rating concept? so we can put his codes in the http://svn.code.sf.net/p/xoops/svn/XoopsModules26/ and start change it.
by the way the jQuery used in this extension is very nice.
I hope kraven30 can work on a like system because he has more knowlege in coding.
Quote:

- stars
- numbers
- like/dislike

as you can see in my proposal there is a different table for status. so you can define them yourself.
Actually in a like system 1=like and 0=no interest but you can define more number ( e.g.: 1=worst 2=bad 3=good 4=very good 5= excellent)

kraven30

Just popping in
Posted on: 2013/4/4 12:45
kraven30
kraven30 (Show more)
Just popping in
Posts: 88
Since: 2008/12/23
#5

Re: Like system (module/extension) for xoops

Hi,
If you want to do this, see the comments at the bottom of page


I read your topic and add your like/dislike system, just add a field in table 'rating_user' autor_uid and replace the fields by uid submiter_uid. In the field 'rate', 0 star = dislike = 0 and 5 stars = like = 5, add a field 'type' in your table 'rating_modules' to put to choose between rating and like / dislike.

Quote:
just need to add a smarty template code in the Module without touching php file.

For a system item, just a request for a forum if there 'are 20 posts, 20 queries loool. So you have to go through a PHP implementation, I think. I remember too Smarty. I have spent a parameter array with the post_id and the autor_uid in the function, just one query

Quote:
is kraven30 ready to accept a huge changes in rating concept?

No problem

irmtfan

Module Developer
Posted on: 2013/4/6 2:47
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#6

Re: Like system (module/extension) for xoops

Thank you kraven30.
Where can i see your code changes? could you move to xoops svn?
Quote:

For a system item, just a request for a forum if there 'are 20 posts, 20 queries loool.

It is the case, but we need to have 20 like/dislike button in 20 posts in one page submitted by different authors. same will come with comments.
It is very important. you can see such a like system in many websites.



irmtfan

Module Developer
Posted on: 2013/5/27 2:25
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#7

Re: Like system (module/extension) for xoops

Hi, kraven30
I still didnt hear from you.
I want to repeat the main request for a rating system.
It could be able to rate many item_id in one page with a multi level permission system and also recognize who is voting who's article.
for example: In a forum topic:

- newbb/viewtopic.php?topic_id=XX
this rating has already built-in functions and tables in newbb. but it is useless. It seems this new rating extension do this for all modules.

- newbb/viewtopic.php?post_id=XX
we need this rating system. It could be able to rate all posts in one page of a topic.
Or all comments in one page.

I know you can find many examples yourself because now it is widely used in websites:
1- Thank you system:(Like)
Can be simplify as (entry in db = like) (nothing in db = no like)
It is the simplest rating system widely used in forums and Also FB. It just has a "thank you" Or "like" button. Also it shows who is like who's post/page.

2- Vote-up, vote-down OR (Thumbs-up and Thumbs-down) OR (Like and dislike)
can be simplify as 1 = like and 0 = dislike
eg: see the comment in this link: http://net.tutsplus.com/tutorials/htm ... with-jquery-ajax-and-php/
As you can see, It has a permission for "vote-up" (like) for anon users but you should be registered to "vote-down" (dislike)
Also you can cancel your vote-up which means "Unvote-up" (unlike)

3- more complicated rating eg: that 5-star you worked on.

irmtfan

Module Developer
Posted on: 2013/5/30 6:47
irmtfan
irmtfan (Show more)
Module Developer
Posts: 3419
Since: 2003/12/7
#8

Re: Like system (module/extension) for xoops

@Mamba:
Because you are very good in finding best practices, could you show us best examples of ratings?
eg:
- X star (X number) rating
- Thank you buttons
- Vote up and down system

The most important thing is they should be implemented in many elements in one web page

Mamba

Moderator
Posted on: 2013/5/30 12:08
Mamba
Mamba (Show more)
Moderator
Posts: 10750
Since: 2004/4/23
#9

Re: Like system (module/extension) for xoops

Interesting tutorial for Thumbs up and down rating system:
http://www.youtube.com/watch?v=Si4r6iKT9Rk

Rating systems on PHP Classes

Recent list of "Best 17 JQuery Star Rating Plugins"

Star & Voting plugins:
http://pixaza.com/jquery-rating-and-vote-system-plugins/

Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs