From bdbcf3e30458c0993f14ffbbc30e5f2f0c45d0e1 Mon Sep 17 00:00:00 2001 From: Yuriy Pikhtarev Date: Fri, 30 Jun 2017 21:33:47 +0300 Subject: [PATCH 1/8] Gitkeep. --- .gitignore | 7 +------ bt/includes/.htaccess | 2 -- internal_data/ajax_html/{.keep => .gitkeep} | 0 internal_data/atom/{.keep => .gitkeep} | 0 sitemap/{.keep => .gitkeep} | 0 5 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 bt/includes/.htaccess rename internal_data/ajax_html/{.keep => .gitkeep} (100%) rename internal_data/atom/{.keep => .gitkeep} (100%) rename sitemap/{.keep => .gitkeep} (100%) diff --git a/.gitignore b/.gitignore index c7cdab175..25439f6e3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,26 +2,21 @@ .env .idea .php_cs.cache -bower_components composer.phar composer.lock -configs/local.php data/avatars data/torrent_files internal_data/ajax_html internal_data/atom internal_data/cache internal_data/log -internal_data/sitemap internal_data/triggers -library/config.local.php node_modules +sitemap vendor yarn.lock ### Archives ### -*.log -*.zip *.rar *.tar *.gz diff --git a/bt/includes/.htaccess b/bt/includes/.htaccess deleted file mode 100644 index baa56e5a3..000000000 --- a/bt/includes/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ -order allow,deny -deny from all \ No newline at end of file diff --git a/internal_data/ajax_html/.keep b/internal_data/ajax_html/.gitkeep similarity index 100% rename from internal_data/ajax_html/.keep rename to internal_data/ajax_html/.gitkeep diff --git a/internal_data/atom/.keep b/internal_data/atom/.gitkeep similarity index 100% rename from internal_data/atom/.keep rename to internal_data/atom/.gitkeep diff --git a/sitemap/.keep b/sitemap/.gitkeep similarity index 100% rename from sitemap/.keep rename to sitemap/.gitkeep From 35db5109a241611b7d202f2af1edb21924fc96b6 Mon Sep 17 00:00:00 2001 From: Yuriy Pikhtarev Date: Fri, 30 Jun 2017 21:47:51 +0300 Subject: [PATCH 2/8] Unnecessary parentheses. --- bt/announce.php | 6 +- common.php | 2 +- dl.php | 4 +- group.php | 14 ++-- group_edit.php | 4 +- index.php | 28 ++++---- info.php | 2 +- .../TorrentPier/TorrentPier/Legacy/Attach.php | 16 ++--- .../TorrentPier/TorrentPier/Legacy/BBCode.php | 2 +- .../TorrentPier/Legacy/Cache/File.php | 4 +- .../TorrentPier/Legacy/Cache/Memcache.php | 10 +-- .../TorrentPier/Legacy/Cache/Redis.php | 6 +- .../TorrentPier/Legacy/Common/User.php | 4 +- .../TorrentPier/Legacy/Datastore/File.php | 2 +- .../TorrentPier/Legacy/Datastore/Memcache.php | 2 +- .../TorrentPier/TorrentPier/Legacy/SqlDb.php | 20 +++--- library/ajax/change_user_rank.php | 6 +- library/ajax/edit_group_profile.php | 2 +- library/ajax/edit_user_profile.php | 2 +- library/ajax/group_membership.php | 2 +- library/ajax/index_data.php | 6 +- library/ajax/post_mod_comment.php | 4 +- library/ajax/posts.php | 2 +- library/ajax/user_register.php | 2 +- library/attach_mod/displaying.php | 4 +- library/attach_mod/displaying_torrent.php | 48 +++++++------- .../attach_mod/includes/functions_attach.php | 12 ++-- .../attach_mod/includes/functions_delete.php | 4 +- .../includes/functions_includes.php | 6 +- .../attach_mod/includes/functions_thumbs.php | 4 +- library/includes/bbcode.php | 2 +- library/includes/cron/cron_check.php | 2 +- library/includes/cron/cron_run.php | 4 +- library/includes/cron/jobs/prune_forums.php | 2 +- library/includes/functions.php | 64 +++++++++---------- library/includes/functions_admin.php | 2 +- library/includes/functions_admin_cron.php | 2 +- library/includes/functions_admin_torrent.php | 6 +- library/includes/functions_atom.php | 2 +- library/includes/functions_group.php | 2 +- library/includes/functions_post.php | 4 +- library/includes/init_bb.php | 2 +- library/includes/online_userlist.php | 2 +- library/includes/page_footer.php | 4 +- library/includes/page_header.php | 6 +- library/includes/posting_tpl.php | 2 +- library/includes/torrent_show_dl_list.php | 2 +- library/includes/ucp/email.php | 2 +- library/includes/ucp/register.php | 32 +++++----- library/includes/ucp/sendpasswd.php | 2 +- library/includes/ucp/topic_watch.php | 4 +- library/includes/ucp/viewprofile.php | 14 ++-- library/includes/ucp/viewtorrent.php | 28 ++++---- login.php | 4 +- memberlist.php | 8 +-- modcp.php | 34 +++++----- posting.php | 24 +++---- privmsg.php | 16 ++--- search.php | 24 +++---- tracker.php | 20 +++--- viewforum.php | 36 +++++------ viewtopic.php | 42 ++++++------ 62 files changed, 315 insertions(+), 315 deletions(-) diff --git a/bt/announce.php b/bt/announce.php index 01d781744..fe5ed95e7 100644 --- a/bt/announce.php +++ b/bt/announce.php @@ -326,7 +326,7 @@ if (config('tracker.freeleech') && $down_add) { // Insert / update peer info $peer_info_updated = false; -$update_time = ($stopped) ? 0 : TIMENOW; +$update_time = $stopped ? 0 : TIMENOW; if ($lp_info) { $sql = "UPDATE " . BB_BT_TRACKER . " SET update_time = $update_time"; @@ -340,8 +340,8 @@ if ($lp_info) { $sql .= ($downloaded != $lp_info['downloaded']) ? ", downloaded = $downloaded" : ''; $sql .= ", remain = $left"; - $sql .= ($up_add) ? ", up_add = up_add + $up_add" : ''; - $sql .= ($down_add) ? ", down_add = down_add + $down_add" : ''; + $sql .= $up_add ? ", up_add = up_add + $up_add" : ''; + $sql .= $down_add ? ", down_add = down_add + $down_add" : ''; $sql .= ", speed_up = $speed_up"; $sql .= ", speed_down = $speed_down"; diff --git a/common.php b/common.php index e792d49e4..c65833fe1 100644 --- a/common.php +++ b/common.php @@ -198,7 +198,7 @@ function bb_log($msg, $file_name) if (is_array($msg)) { $msg = implode(LOG_LF, $msg); } - $file_name .= (LOG_EXT) ? '.' . LOG_EXT : ''; + $file_name .= LOG_EXT ? '.' . LOG_EXT : ''; return file_write($msg, LOG_DIR . '/' . $file_name); } diff --git a/dl.php b/dl.php index fe47deda5..595396d56 100644 --- a/dl.php +++ b/dl.php @@ -200,8 +200,8 @@ if (IS_GUEST && !bb_captcha('check')) { 'ERROR_MESSAGE' => $message, )); - require(PAGE_HEADER); - require(PAGE_FOOTER); + require PAGE_HEADER; + require PAGE_FOOTER; } send_file_to_browser($attachment, $upload_dir); diff --git a/group.php b/group.php index 47371d55c..bff1ee874 100644 --- a/group.php +++ b/group.php @@ -119,7 +119,7 @@ if (!$group_id) { continue; } - $data = array('id' => $row['group_id'], 'm' => ($row['members'] - $row['candidates']), 'c' => $row['candidates'], 'rg' => $row['release_group']); + $data = array('id' => $row['group_id'], 'm' => $row['members'] - $row['candidates'], 'c' => $row['candidates'], 'rg' => $row['release_group']); $groups[$type][$row['group_name']] = $data; } @@ -131,11 +131,11 @@ if (!$group_id) { foreach ($params as $name => $data) { $text = htmlCHR(str_short(rtrim($name), HTML_SELECT_MAX_LENGTH)); - $members = ($data['m']) ? trans('messages.MEMBERS_IN_GROUP') . ': ' . $data['m'] : trans('messages.NO_GROUP_MEMBERS'); - $candidates = ($data['c']) ? trans('messages.PENDING_MEMBERS') . ': ' . $data['c'] : trans('messages.NO_PENDING_GROUP_MEMBERS'); + $members = $data['m'] ? trans('messages.MEMBERS_IN_GROUP') . ': ' . $data['m'] : trans('messages.NO_GROUP_MEMBERS'); + $candidates = $data['c'] ? trans('messages.PENDING_MEMBERS') . ': ' . $data['c'] : trans('messages.NO_PENDING_GROUP_MEMBERS'); $options .= '
  • ' . $text . '
  • '; - $options .= ($data['rg']) ? '