i want a karma point system for my forum and i download one hack from the net but i dont know what it does, can someone explainn it for me?
Quote:Code://********* hack start **************
$karmaquery = $db->query("SELECT fid, point, judge FROM $table_posts WHERE pid='$pid'");
$karmatemp = $db->fetch_array($karmaquery);
$karmaquery = $db->query("SELECT status FROM $table_members WHERE username='$cdbuser'");
$membertemp = $db->fetch_array($karmaquery);
$karmaquery = $db->query("SELECT moderator FROM $table_forums WHERE fid='$karmatemp[fid]'");
$moderatortemp = $db->fetch_array($karmaquery);
if (($membertemp[status] != "ÂÛ̳¹ÜÀí?"±") && ($membertemp[status] != "³¬¼¶°æ?-÷") && (strstr($moderatortemp[moderator],$cdbuser) != $cdbuser)) {
$supercdb = 0;
$allowkarma = 0;
} else {
$supercdb = 1;
}
if($allowkarma && $maxkarmavote && ($karmatemp[point]=='0')) {
$offset = 1;
//$offset = ceil($maxkarmavote / 6);
$karmabox = " <select name=\\\"fid\\\" id=\\\"fid\\\" onchange=\\\"if(this.options[this.selectedIndex].value != '') {\n"
."window.location=('topicadmin.php?action=karma&tid=\$tid&username=\$encodename&score='+this.options[this.selectedIndex].value+'&sid=$sid&pid=$pid') }\\\" align=\\\"absmiddle\\\">\n"
."<option value=\\\"\\\">ÆÀ·?-</option>\n"
."<option value=\\\"\\\">----</option>\n";
for($vote = - $maxkarmavote; $vote <= $maxkarmavote; $vote += $offset) {
$votenum = $vote > 0 ? "+$vote" : $vote;
$karmabox .= $vote ? "<option value=\\\"$vote\\\">$votenum</option>\n" : NULL;
}
$karmabox .= "</select>\n";
eval("\$karma = \"$karmabox\";");
} else {
if ($supercdb == 1) {
$offset = 1;
$karmabox = " <select name=\\\"fid\\\" id=\\\"fid\\\" onchange=\\\"if(this.options[this.selectedIndex].value != '') {\n"
."window.location=('topicadmin.php?action=karma&tid=\$tid&username=\$encodename&score='+this.options[this.selectedIndex].value+'&sid=$sid&pid=$pid') }\\\" align=\\\"absmiddle\\\">\n"
."<option value=\\\"\\\">$karmatemp[point][$karmatemp[judge]]</option>\n"
."<option value=\\\"\\\">?-ØÐÂÆÀ·?-</option>\n"
."<option value=\\\"\\\">----</option>\n";
for($vote = - $maxkarmavote; $vote <= $maxkarmavote; $vote += $offset) {
$votenum = $vote > 0 ? "+$vote" : $vote;
//$karmabox .= $vote ? "<option value=\\\"$vote\\\">$votenum</option>\n" : NULL;
$karmabox .= "<option value=\\\"$vote\\\">$votenum</option>\n";
}
$karmabox .= "</select>\n";
eval("\$karma = \"$karmabox\";");
} else {
$karmabox = " <select><option>$karmatemp[point][$karmatemp[judge]]</option></select>\n";
eval("\$karma = \"$karmabox\";");
}
}
//********* hack end *****************
or if anybody can give me a good one
thanks