About 76 results: "mysql_query repo:nexea/x00n"
Page 1 of 4
Filter Results
Sources
Languages
Filter Results
Try Search On




topten.php in x00n https://bitbucket.org/nexea/x00n | 348 lines | PHP
  1.   	{
  2. 		  $r = mysql_query("SELECT t.*, (t.size * t.times_completed + SUM(p.downloaded)) AS data FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' GROUP BY t.id ORDER BY seeders + leechers DESC, seeders DESC, added ASC LIMIT $limit") or mysql_error();
  3.    	{
  4. 	  	$r = mysql_query("SELECT t.*, (t.size * t.times_completed + SUM(p.downloaded)) AS data FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' GROUP BY t.id ORDER BY times_completed DESC LIMIT $limit") or mysql_error();
  5.    	{
  6. 		  $r = mysql_query("SELECT t.*, (t.size * t.times_completed + SUM(p.downloaded)) AS data FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' AND leechers >= 5 AND times_completed > 0 GROUP BY t.id ORDER BY data DESC, added ASC LIMIT $limit") or mysql_error();
  7.    	{
  8. 		  $r = mysql_query("SELECT t.*, (t.size * t.times_completed + SUM(p.downloaded)) AS data FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' AND seeders >= 5 GROUP BY t.id ORDER BY seeders / leechers DESC, seeders DESC, added ASC LIMIT $limit") or mysql_error();
  9.    	{
  10. 		  $r = mysql_query("SELECT t.*, (t.size * t.times_completed + SUM(p.downloaded)) AS data FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' AND leechers >= 5 AND times_completed > 0 GROUP BY t.id ORDER BY seeders / leechers ASC, leechers DESC LIMIT $limit") or mysql_error();
  11.    	{
  12. 		  $r = mysql_query("SELECT name, flagpic, COUNT(users.country) as num FROM countries, users WHERE users.country = countries.id GROUP BY name ORDER BY num DESC LIMIT $limit") or mysql_error();
  13.    	{
  14. 	  	$r = mysql_query("SELECT c.name, c.flagpic, sum(u.uploaded) AS ul FROM users u, countries c WHERE u.country = c.id AND u.enabled = 'yes' GROUP BY c.name ORDER BY ul DESC LIMIT $limit") or mysql_error();
  15. 		{
  16. 		  $r = mysql_query("SELECT c.name, c.flagpic, sum(u.uploaded)/count(u.id) AS ul_avg FROM users u, countries c WHERE u.country = c.id AND u.enabled = 'yes' GROUP BY c.name HAVING sum(u.uploaded) > 1099511627776 AND count(u.id) >= 100 ORDER BY ul_avg DESC LIMIT $limit") or mysql_error();


announce.php in x00n https://bitbucket.org/nexea/x00n | 320 lines | PHP
  1. 	$limit = "ORDER BY RAND() LIMIT $rsize";
  2. $res = mysql_query("SELECT $fields FROM peers WHERE torrent = $torrentid AND connectable = 'yes' $limit") or err('nog iets');
  3. 	$sql = "SELECT $fields FROM peers WHERE $selfwhere";
  4. 	$res = mysql_query($sql) or err('fout');
  5. {
  6. 	$valid = @mysql_fetch_row(@mysql_query("SELECT COUNT(*) FROM peers WHERE torrent=$torrentid AND passkey=" . sqlesc($passkey))) or err('mistake');
  7. 	
  8. 	$rz = mysql_query("SELECT id, uploaded, downloaded, class FROM users WHERE passkey=".sqlesc($passkey)." AND enabled = 'yes' ORDER BY last_access DESC LIMIT 1") or err("Tracker error 2");
  9. 	if ($upthis > 0 || $downthis > 0)
  10. 		mysql_query("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error 3");
  11. 	{
  12. 		mysql_query("UPDATE peers SET uploaded = $uploaded, downloaded = $downloaded, to_go = $left, last_action = NOW(), seeder = '$seeder'"
  13. 
                        
  14.  $ret = mysql_query("INSERT INTO peers (connectable, torrent, peer_id, ip, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, agent, uploadoffset, downloadoffset, passkey) VALUES ('$connectable', $torrentid, " . sqlesc($peer_id) . ", " . sqlesc($ip) . ", $port, $uploaded, $downloaded, $left, NOW(), NOW(), '$seeder', $userid, " . sqlesc($agent) . ", $uploaded, $downloaded, " . sqlesc($passkey) . ")") or err('tracker error');
  15. if (count($updateset))
  16. 	mysql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $torrentid");






details.php in x00n https://bitbucket.org/nexea/x00n | 390 lines | PHP
  1. 
                        
  2. $res = mysql_query("SELECT torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, UNIX_TIMESTAMP() - UNIX_TIMESTAMP(torrents.last_action) AS lastseed, torrents.numratings, torrents.name, IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.numfiles, categories.name AS cat_name, users.username FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id")
  3. 	if ($_GET["hit"]) {
  4. 		mysql_query("UPDATE torrents SET views = views + 1 WHERE id = $id");
  5. 			if (!$owned || $moderator) {
  6. 				$xres = mysql_query("SELECT rating, added FROM ratings WHERE torrent = $id AND user = " . $CURUSER["id"]);
  7. 
                        
  8. 				$subres = mysql_query("SELECT * FROM files WHERE torrent = $id ORDER BY id");
  9. 			/*
  10. 			$subres = mysql_query("SELECT seeder, COUNT(*) FROM peers WHERE torrent = $id GROUP BY seeder");
  11. 			$seeders = array();
  12. 			$subres = mysql_query("SELECT seeder, finishedat, downloadoffset, uploadoffset, ip, port, uploaded, downloaded, to_go, UNIX_TIMESTAMP(started) AS st, connectable, agent, UNIX_TIMESTAMP(last_action) AS la, userid FROM peers WHERE torrent = $id") or sqlerr();
  13. 
                        
  14. 	$subres = mysql_query("SELECT COUNT(*) FROM comments WHERE torrent = $id");
  15. 
                        
  16. 		$subres = mysql_query("SELECT comments.id, text, user, comments.added, editedby, editedat, avatar, warned, ".








Back to Top