} show_error_msg("OK", "Poll Updates " . T_("COMPLETE"), 1); } if ($action == "backups") { stdhead("Backups"); navmenu(); begin_frame("Backups"); echo "<a href='backup-database.php'>Backup Database</a> (or create a CRON task on " . $site_config["SITEURL"] . "/backup-database.php)"; end_frame(); stdfoot(); } if ($action == "forceclean") { $now = gmtime(); SQL_Query_exec("UPDATE tasks SET last_time={$now} WHERE task='cleanup'"); require_once "backend/cleanup.php"; do_cleanup(); autolink('admincp.php', T_("FORCE_CLEAN_COMPLETED")); } if ($action == "torrentlangs" && $do == "view") { stdhead(T_("TORRENT_LANGUAGES")); navmenu(); begin_frame(T_("TORRENT_LANGUAGES")); echo "<center><a href='admincp.php?action=torrentlangs&do=add'><b>Add New Language</b></a></center><br />"; print "<i>Please note that language image is optional</i><br /><br />"; echo "<center><table width='650' class='table_table'><tr>"; echo "<th width='10' class='table_head'><b>Sort</b></th><th class='table_head'><b>" . T_("NAME") . "</b></th><th class='table_head'><b>Image</b></th><th width='30' class='table_head'></th></tr>"; $query = "SELECT * FROM torrentlang ORDER BY sort_index ASC"; $sql = SQL_Query_exec($query); while ($row = mysql_fetch_array($sql)) { $id = $row['id']; $name = $row['name'];
function autoclean() { global $site_config; require_once "cleanup.php"; $now = gmtime(); $res = SQL_Query_exec("SELECT last_time FROM tasks WHERE task='cleanup'"); $row = mysql_fetch_row($res); if (!$row) { SQL_Query_exec("INSERT INTO tasks (task, last_time) VALUES ('cleanup',{$now})"); return; } $ts = $row[0]; if ($ts + $site_config["autoclean_interval"] > $now) { return; } SQL_Query_exec("UPDATE tasks SET last_time={$now} WHERE task='cleanup' AND last_time = {$ts}"); if (!mysql_affected_rows()) { return; } do_cleanup(); }