Hi,
I'm trying to setup an auto site rating for WCDDL. I have used the code from a mod here: http://warezcoders.com/forum/viewtopic.php?f=15&t=1095
Which is meant to set all sites as rating 1*, then if they have 100 downloads 2*, 200 downloads 3*, 300 downloads 4*, and 300 downloads and in whitelist 5*.
But it is just setting all the sites as *4 but none of the sites have even 100 downloads (and none in whitelist hence its not setting then as 5*. As it stands all of the sites should be set as 1*. can anybody tell me whats wrong with the code??
I'm trying to setup an auto site rating for WCDDL. I have used the code from a mod here: http://warezcoders.com/forum/viewtopic.php?f=15&t=1095
PHP:
if(isset($rsites)) {
mysql_query("UPDATE wcddl_sites SET rating=1");
$get300 = mysql_query("SELECT COUNT(title) AS 'number' , sid FROM wcddl_downloads GROUP BY sid ORDER BY number DESC LIMIT 0,300");
while ($row = mysql_fetch_array($get300)) {
mysql_query("UPDATE wcddl_sites SET rating= rating+1 where id = '".$row['sid']."'"); }
$get200 = mysql_query("SELECT COUNT(title) AS 'number' , sid FROM wcddl_downloads GROUP BY sid ORDER BY number DESC LIMIT 0,200");
while ($row = mysql_fetch_array($get200)) {
mysql_query("UPDATE wcddl_sites SET rating= rating+1 where id = '".$row['sid']."'"); }
$get100 = mysql_query("SELECT COUNT(title) AS 'number' , sid FROM wcddl_downloads GROUP BY sid ORDER BY number DESC LIMIT 0,100");
while ($row = mysql_fetch_array($get100)) {
mysql_query("UPDATE wcddl_sites SET rating= rating+1 where id = '".$row['sid']."'"); }
$getwhite = mysql_query("SELECT url FROM wcddl_whitelist");
while ($row = mysql_fetch_array($getwhite)) {
mysql_query("UPDATE wcddl_sites SET rating= rating+1 where url = '".$row['url']."'"); }
echo '<div align="center" style="color:green;">Sites Rated</div>';
}
But it is just setting all the sites as *4 but none of the sites have even 100 downloads (and none in whitelist hence its not setting then as 5*. As it stands all of the sites should be set as 1*. can anybody tell me whats wrong with the code??