mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
parent
6eed2e8a76
commit
6abd9babc9
53 changed files with 197 additions and 197 deletions
|
@ -73,7 +73,7 @@ foreach ($cron_jobs as $job) {
|
|||
$msg[] = sprintf('%-4s', round(sys('la'), 1));
|
||||
$msg[] = sprintf('%05d', getmypid());
|
||||
$msg[] = $job['cron_title'];
|
||||
$msg = join(LOG_SEPR, $msg);
|
||||
$msg = implode(LOG_SEPR, $msg);
|
||||
bb_log($msg . LOG_LF, CRON_LOG_DIR . '/' . CRON_LOG_FILE);
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ foreach ($cron_jobs as $job) {
|
|||
$msg[] = sprintf('%-4s', round(sys('la'), 1));
|
||||
$msg[] = sprintf('%05d', getmypid());
|
||||
$msg[] = round(utime() - $cron_start_time) . '/' . round(utime() - TIMESTART) . ' sec';
|
||||
$msg = join(LOG_SEPR, $msg);
|
||||
$msg = implode(LOG_SEPR, $msg);
|
||||
$msg .= LOG_LF . '------=-------=----------=------=-------=----------';
|
||||
bb_log($msg . LOG_LF, CRON_LOG_DIR . '/' . CRON_LOG_FILE);
|
||||
|
||||
|
|
|
@ -66,13 +66,13 @@ if ($dir = @opendir($attach_dir)) {
|
|||
$f_len += strlen($f) + 5;
|
||||
|
||||
if ($f_len > $db_max_packet) {
|
||||
$files = join(',', $files);
|
||||
$files = implode(',', $files);
|
||||
DB()->query("INSERT INTO $tmp_attach_tbl VALUES $files");
|
||||
$files = array();
|
||||
$f_len = 0;
|
||||
}
|
||||
}
|
||||
if ($files = join(',', $files)) {
|
||||
if ($files = implode(',', $files)) {
|
||||
DB()->query("INSERT INTO $tmp_attach_tbl VALUES $files");
|
||||
}
|
||||
closedir($dir);
|
||||
|
@ -154,7 +154,7 @@ if ($check_attachments) {
|
|||
$orphan_db_attach[] = $row['attach_id'];
|
||||
}
|
||||
// Delete all orphan attachments
|
||||
if ($orphans_sql = join(',', $orphan_db_attach)) {
|
||||
if ($orphans_sql = implode(',', $orphan_db_attach)) {
|
||||
if ($fix_errors) {
|
||||
DB()->query("DELETE FROM " . BB_ATTACHMENTS_DESC . " WHERE attach_id IN($orphans_sql)");
|
||||
DB()->query("DELETE FROM " . BB_ATTACHMENTS . " WHERE attach_id IN($orphans_sql)");
|
||||
|
@ -172,7 +172,7 @@ if ($check_attachments) {
|
|||
$orphan_tor[] = $row['topic_id'];
|
||||
}
|
||||
// Delete all orphan torrents
|
||||
if ($orphans_sql = join(',', $orphan_tor)) {
|
||||
if ($orphans_sql = implode(',', $orphan_tor)) {
|
||||
if ($fix_errors) {
|
||||
DB()->query("DELETE FROM " . BB_BT_TORRENTS . " WHERE topic_id IN($orphans_sql)");
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ if ($check_attachments) {
|
|||
foreach (DB()->fetch_rowset($sql) as $row) {
|
||||
$posts_without_attach[] = $row['post_id'];
|
||||
}
|
||||
if ($posts_sql = join(',', $posts_without_attach)) {
|
||||
if ($posts_sql = implode(',', $posts_without_attach)) {
|
||||
if ($fix_errors) {
|
||||
DB()->query("UPDATE " . BB_POSTS . " SET post_attachment = 0 WHERE post_id IN($posts_sql)");
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ if ($check_attachments) {
|
|||
foreach (DB()->fetch_rowset($sql) as $row) {
|
||||
$topics_without_attach[] = $row['topic_id'];
|
||||
}
|
||||
if ($topics_sql = join(',', $topics_without_attach)) {
|
||||
if ($topics_sql = implode(',', $topics_without_attach)) {
|
||||
if ($fix_errors) {
|
||||
DB()->query("UPDATE " . BB_TOPICS . " SET topic_attachment = 0 WHERE topic_id IN($topics_sql)");
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ foreach ($keeping_dlstat as $dl_status => $days_to_keep) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($delete_dlstat_sql = join(') OR (', $delete_dlstat_sql)) {
|
||||
if ($delete_dlstat_sql = implode(') OR (', $delete_dlstat_sql)) {
|
||||
DB()->query("DELETE QUICK FROM " . BB_BT_DLSTATUS . " WHERE ($delete_dlstat_sql)");
|
||||
}
|
||||
|
||||
|
|
|
@ -47,8 +47,8 @@ foreach (DB()->fetch_rowset($sql) as $row) {
|
|||
$topics_sql[] = $row['topic_id'];
|
||||
$attach_sql[] = $row['attach_id'];
|
||||
}
|
||||
$dead_tor_sql = join(',', $topics_sql);
|
||||
$attach_sql = join(',', $attach_sql);
|
||||
$dead_tor_sql = implode(',', $topics_sql);
|
||||
$attach_sql = implode(',', $attach_sql);
|
||||
|
||||
if ($dead_tor_sql && $attach_sql) {
|
||||
// Delete torstat
|
||||
|
|
|
@ -73,7 +73,7 @@ while (true) {
|
|||
}
|
||||
|
||||
foreach (DB()->fetch_rowset($sql) as $row) {
|
||||
$val[] = join(',', $row);
|
||||
$val[] = implode(',', $row);
|
||||
}
|
||||
|
||||
if ($val) {
|
||||
|
@ -81,13 +81,13 @@ while (true) {
|
|||
DB()->query("
|
||||
REPLACE INTO " . NEW_BB_BT_TRACKER_SNAP . "
|
||||
(topic_id, seeders, leechers, speed_up, speed_down)
|
||||
VALUES(" . join('),(', $val) . ")
|
||||
VALUES(" . implode('),(', $val) . ")
|
||||
");
|
||||
} else {
|
||||
DB()->query("
|
||||
INSERT INTO " . BB_BT_TRACKER_SNAP . "
|
||||
(topic_id, speed_up, speed_down)
|
||||
VALUES(" . join('),(', $val) . ")
|
||||
VALUES(" . implode('),(', $val) . ")
|
||||
ON DUPLICATE KEY UPDATE speed_up = VALUES(speed_up), speed_down = VALUES(speed_down)
|
||||
");
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ if ($bb_cfg['torhelp_enabled']) {
|
|||
$online_users_ary[] = $row['uid'];
|
||||
}
|
||||
|
||||
if ($online_users_csv = join(',', $online_users_ary)) {
|
||||
if ($online_users_csv = implode(',', $online_users_ary)) {
|
||||
DB()->query("
|
||||
INSERT INTO " . NEW_BB_BT_TORHELP . " (user_id, topic_id_csv)
|
||||
SELECT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue