Honesty Rocks! truth rules.

Comments With Ranking PHP

HOME      >>       Programming

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.