Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Naujienų reitingavimo sistema

Parašė mXt· 2008 Bal. 16 21:04:22
#26

Reiks paziureti laiko turint. Galbut prisitaikyti kai kur kitur :)

EDIT: News.php tik sitas kodas iterptas, ar dar daugiau yra? Greitai perzvelgiau, tai daugiau lyg neradau..

$num_votes = dbresult(dbquery("SELECT COUNT(rating_item_id) FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['news_id']."' AND rating_type='N'"),0);
$tot_votes = dbresult(dbquery("SELECT SUM(rating_vote) FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['news_id']."' AND rating_type='N'"),0);
$pct_rating = ceil(round($tot_votes / $num_votes));
$voto = "<img src='".IMAGES."rating".$pct_rating.".gif' border='0'>";

Redagavo mXt· 2008 Bal. 16 22:04:21