1
WordPress / Re: Sugestão de tags
« em: 10/Nov/2013 01:59 »
A ideia era um site de wallpapers em que os visitantes iam ajudar a organizar o conteúdo.
<?php
error_reporting(E_ALL);
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("conta_tabela", $con) or die(mysql_error());
echo "connected";
mysql_query("UPDATE phcdl_users SET user_uploads = (SELECT COUNT(file_id) FROM phcdl_files WHERE phcdl_files.file_author = phcdl_users.user_name GROUP BY user_id"); echo "<br/>1# done";
mysql_query("UPDATE phcdl_users SET total_downs = (SELECT SUM(file_downloads) FROM phcdl_files WHERE phcdl_users.user_uploads > '0' AND phcdl_files.file_author = phcdl_users.user_name GROUP BY user_id");echo "<br/>2# done";
mysql_query("UPDATE phcdl_users SET total_cmmnts = (SELECT SUM(file_total_comments) FROM phcdl_files WHERE phcdl_users.user_uploads > '0' AND phcdl_files.file_author = phcdl_users.user_name GROUP BY user_id");echo "<br/>3# done";
mysql_query("UPDATE phcdl_users SET total_views = (SELECT SUM(file_fiews) FROM phcdl_files WHERE phcdl_users.user_uploads > '0' AND phcdl_files.file_author = phcdl_users.user_name GROUP BY user_id") ;echo "<br/>4# done";
mysql_query("UPDATE phcdl_users SET total_votes = (SELECT SUM(file_votes) FROM phcdl_files WHERE phcdl_users.user_uploads > '0' AND phcdl_files.file_author = phcdl_users.user_name GROUP BY user_id");echo "<br/>5# done";
mysql_close($con);
?>
connected
1# done
2# done
3# done
4# done
5# done
Basicamente era ver quem conseguia mais uptime com um computador.
Tinha-mos um pequeno programa instalado no pc.. com login que ia actualizando.
Se fizesses reboot começava do 0. Não sei mas na altura tinha muita gente a participar.