HOME       >>       Programming

Comments With Ranking PHP


alex1985

Where can I obtain the tutorial which explains how to build comments system with ranking. This is really familiar to forum scripts, ranking depends on the amount the user wrote certain amount of characters in comments field. Ranks like: novice, and so on.


darjin

Where can I obtain the tutorial which explains how to build comments system with ranking. This is really familiar to forum scripts, ranking depends on the amount the user wrote certain amount of characters in comments field.
Ranks like: novice, and so on.

Yes, I would like to know how this works as well. Do we rank each other or do the admins rank?

galexcd

Where can I obtain the tutorial which explains how to build comments system with ranking. This is really familiar to forum scripts, ranking depends on the amount the user wrote certain amount of characters in comments field.
Ranks like: novice, and so on.


Do you mean like somebody types in a comment and the longer it is the higher the ranking is? You could use strlen to judge the length, then have an array of "rankings".

Example:
$string="This is the comment or whatever you want to judge";$ranks=array("novice","member","pro");$highest_rank=500; //how many characters are required to get to the highest rankreturn $ranks[floor(strlen($string)/($highest_rank/(count($ranks)-1)))];


alex1985

That's quite good. But do you know, how can I plug in or just join with my script, do I need to use if condition?If you know more complicated tutorial on it, please let me know.



VIEW DESKTOP VERSION REGISTERGET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.