add special section

This commit is contained in:
xiaomlove
2021-05-29 18:26:04 +08:00
parent 48259ab387
commit 3a54de8be7
27 changed files with 175 additions and 43 deletions
+16 -4
View File
@@ -6,6 +6,7 @@ use App\Models\Icon;
use App\Models\NexusModel;
use App\Models\SearchBox;
use App\Models\SearchBoxField;
use Illuminate\Support\Arr;
class SearchBoxRepository extends BaseRepository
{
@@ -81,11 +82,22 @@ class SearchBoxRepository extends BaseRepository
}
}
public function listIcon($id)
public function listIcon(array $idArr)
{
$searchBox = SearchBox::query()->findOrFail($id);
$iconIdArr = $searchBox->categories->pluck('icon_id')->unique();
return Icon::query()->find($iconIdArr);
$searchBoxList = SearchBox::query()->with('categories')->find($idArr);
if ($searchBoxList->isEmpty()) {
return $searchBoxList;
}
$iconIdArr = [];
foreach ($searchBoxList as $value) {
foreach ($value->categories as $category) {
$iconId = $category->icon_id;
if (!isset($iconIdArr[$iconId])) {
$iconIdArr[$iconId] = $iconId;
}
}
}
return Icon::query()->find(array_keys($iconIdArr));
}
+49 -9
View File
@@ -2117,8 +2117,8 @@ function menu ($selected = "home") {
$selected = "forums";
}elseif (preg_match("/torrents/i", $script_name)) {
$selected = "torrents";
}elseif (preg_match("/music/i", $script_name)) {
$selected = "music";
}elseif (preg_match("/special/i", $script_name)) {
$selected = "special";
}elseif (preg_match("/offers/i", $script_name) OR preg_match("/offcomment/i", $script_name)) {
$selected = "offers";
}elseif (preg_match("/requests/i", $script_name)) {
@@ -2149,7 +2149,7 @@ function menu ($selected = "home") {
print ("<li" . ($selected == "forums" ? " class=\"selected\"" : "") . "><a href=\"" . $extforumurl."\" target=\"_blank\">".$lang_functions['text_forums']."</a></li>");
print ("<li" . ($selected == "torrents" ? " class=\"selected\"" : "") . "><a href=\"torrents.php\">".$lang_functions['text_torrents']."</a></li>");
if ($enablespecial == 'yes')
print ("<li" . ($selected == "music" ? " class=\"selected\"" : "") . "><a href=\"music.php\">".$lang_functions['text_music']."</a></li>");
print ("<li" . ($selected == "special" ? " class=\"selected\"" : "") . "><a href=\"special.php\">".$lang_functions['text_special']."</a></li>");
if ($enableoffer == 'yes')
print ("<li" . ($selected == "offers" ? " class=\"selected\"" : "") . "><a href=\"offers.php\">".$lang_functions['text_offers']."</a></li>");
if ($enablerequest == 'yes')
@@ -2225,9 +2225,14 @@ function get_cat_folder($cat = 101)
* use setting, not user's caticon, that filed make no sense!
*/
$caticonrow = get_category_icon_row($catrow['icon_id'] ?: 1);
$catPath[$cat] = "category/".$catmode."/".$caticonrow['folder'] . ($caticonrow['multilang'] == 'yes' ? $CURLANGDIR."/" : "");
$path = sprintf('category/%s/%s', trim($catmode, '/'), trim($caticonrow['folder'], '/'));
if ($caticonrow['multilang'] == 'yes') {
$path .= '/' . trim($CURLANGDIR, '/');
}
do_log("cat: $cat, path: $path");
$catPath[$cat] = $path;
}
return trim($catPath[$cat] ?? '', '/');
return $catPath[$cat] ?? '';
}
function get_style_highlight()
@@ -2254,7 +2259,6 @@ function stdhead($title = "", $msgalert = true, $script = "", $place = "")
global $tstart;
global $Cache;
global $Advertisement;
global $browsecatmode;
$Cache->setLanguage($CURLANGDIR);
@@ -2325,13 +2329,15 @@ $cssupdatedate=($cssupdatedate ? "?".htmlspecialchars($cssupdatedate) : "");
if ($CURUSER){
// $caticonrow = get_category_icon_row($CURUSER['caticon']);
// if($caticonrow['cssfile']){
$requireSearchBoxIdAr = list_require_search_box_id();
if (!empty($requireSearchBoxIdAr)) {
$icons = (new \App\Repositories\SearchBoxRepository())->listIcon($requireSearchBoxIdAr);
foreach ($icons as $icon) {
$icons = (new \App\Repositories\SearchBoxRepository())->listIcon($browsecatmode);
foreach ($icons as $icon) {
?>
<link rel="stylesheet" href="<?php echo htmlspecialchars(trim($icon['cssfile'], '/')).$cssupdatedate?>" type="text/css" />
<?php
}
}}
}
?>
<link rel="alternate" type="application/rss+xml" title="Latest Torrents" href="torrentrss.php" />
@@ -4953,4 +4959,38 @@ function get_share_ratio($uploaded, $downloaded)
return $ratio;
}
function list_require_search_box_id()
{
$setting = get_setting('main');
$maps = [
'torrents' => [$setting['browsecat']],
'special' => [$setting['specialcat']],
'usercp' => [$setting['browsecat'], $setting['specialcat']],
'getrss' => [$setting['browsecat'], $setting['specialcat']],
];
return $maps[CURRENT_SCRIPT] ?? [];
}
function can_access_torrent($torrent)
{
global $specialcatmode;
if (get_setting('main.spsct') != 'yes') {
return true;
}
if (is_array($torrent) && isset($torrent['search_box_id'])) {
$searchBoxId = $torrent['search_box_id'];
} elseif (is_numeric($torrent)) {
$searchBoxId = \App\Models\Torrent::query()->findOrFail(intval($torrent), ['id', 'category'])->basic_category->mode;
} else {
throw new \InvalidArgumentException("Unsupported argument: " . json_encode($torrent));
}
if ($searchBoxId != $specialcatmode) {
return true;
}
if (get_user_class() >= get_setting('authority.view_special_torrent')) {
return true;
}
return false;
}
?>
+1
View File
@@ -64,6 +64,7 @@ function getip() {
function sql_query($query)
{
$query = preg_replace("/[\n\r\t]+/", " ", $query);
$begin = microtime(true);
global $query_name;
$result = mysql_query($query);
+12 -1
View File
@@ -39,7 +39,7 @@ $lang_details = array
'text_title' => " 片名: ",
'text_title_chinese' => "中文片名: ",
'text_also_known_as' => " 别名: ",
'text_year' => " 年代: ",
'text_year' => " 年代: ",
'text_runtime' => " 片长: ",
'text_mins' => "分钟",
'text_votes' => " 票数: ",
@@ -219,6 +219,17 @@ $lang_details = array
'row_uploader_bandwidth' => "发布者带宽",
'text_and_more' => "……(这里只显示最新记录。共",
'text_users_in_total' => "个用户表示了感谢)",
'torrent_dl_url' => "种子链接",
'torrent_dl_url_notice' => "可在BT客户端使用,请保护好Passkey,谨防泄露。",
'span_description_have_given' =>'你已经赠送魔力值',
'text_no_magic_added' => "暂无魔力值奖励",
'magic_value_number' => "已赠送Number点魔力值",
'magic_value_award' => "魔力值奖励",
'magic_newest_record' =>'这里只显示最新记录。 ',
'magic_sum_user_give_number' => '共Number个会员奖励了魔力值',
'magic_show_all_description' => '查看详单',
'magic_haveGotBonus' => '目前发布人已获得Number个魔力值奖励。',
'magic_have_no_enough_bonus_value' => '需要更多魔力值。',
);
?>
+1 -1
View File
@@ -60,7 +60,7 @@ $lang_edit = array
'radio_other' => "其他",
'submit_delete_it' => "删除",
'text_move_to_browse' => "类型变为<b>种子</b>区的 ",
'text_move_to_special' => "类型变为<b>音乐</b>区的 ",
'text_move_to_special' => "类型变为<b>特别</b>区的 ",
'text_medium' => "媒介:",
'row_pick' => "挑选",
'row_check' => "勾选",
+1
View File
@@ -213,6 +213,7 @@ $lang_functions = array
'text_ip_range' => "IP范围",
'text_min' => "分钟",
'text_music' => "&nbsp;音&nbsp;&nbsp;乐&nbsp;",
'text_special' => "&nbsp;特&nbsp;&nbsp;别&nbsp;",
'title_reply_with_quote' => "引用",
'title_add_reply' => "回复",
'title_delete' => "删除",
+2
View File
@@ -141,6 +141,8 @@ $lang_settings = array
'text_upload_torrent_note' => "。发布种子到种子区。",
'row_upload_special_torrent' => "发布种子至特别区",
'text_upload_special_torrent_note' => "。发布种子到特别区。",
'row_view_special_torrent' => '查看特别区种子',
'text_view_special_torrent_note' => '查看特别区种子。',
'row_move_torrent' => "移动种子",
'text_move_torrent_note' => "。将种子在各区间移动。",
'row_chronicle_management' => "管理史册",
+1 -1
View File
@@ -31,7 +31,7 @@ $lang_upload = array
'text_read_rules' => "我已经阅读过规则",
'submit_upload' => "发布",
'text_to_browse_section' => "发布至<b>种子</b>区 ",
'text_to_special_section' => "或<b>音乐</b>区 ",
'text_to_special_section' => "或<b>特别</b>区 ",
'text_type_note' => "&nbsp;&nbsp; <font class=\"small\"><b>只选</b>两者之一</font>",
'text_medium' => "媒介:",
'text_team' => "制作组:",
+1 -1
View File
@@ -204,7 +204,7 @@ $lang_usercp = array
'text_games_and_appz' => "游戏 & 程序:",
'text_others' => "其它:",
'text_at_browse_page' => "种子区",
'text_at_special_page' => "音乐",
'text_at_special_page' => "特别",
'text_additional_selection' => "补充设定",
'text_stylesheet_note' => "更多界面风格?想自己设计?",
'text_stylesheet_link' => "点击这里",
+12 -1
View File
@@ -39,7 +39,7 @@ $lang_details = array
'text_title' => " 片名: ",
'text_title_chinese' => "中文片名: ",
'text_also_known_as' => " 代號: ",
'text_year' => " 年代: ",
'text_year' => " 年代: ",
'text_runtime' => " 片長: ",
'text_mins' => "分鐘",
'text_votes' => " 票數: ",
@@ -218,6 +218,17 @@ $lang_details = array
'row_uploader_bandwidth' => "發布者頻寬",
'text_and_more' => "……(這裏只顯示最新記錄。共",
'text_users_in_total' => "個用戶表示了感謝)",
'torrent_dl_url' => "種子連結",
'torrent_dl_url_notice' => "可在BT用戶端使用,請保護好Passkey,謹防洩露。",
'span_description_have_given' =>'你已經贈送魔力值',
'text_no_magic_added' => "暫無魔力值獎勵",
'magic_value_number' => "已贈送Number點魔力值",
'magic_value_award' => "魔力值獎勵",
'magic_newest_record' =>'這裏只顯示最新記錄。 ',
'magic_sum_user_give_number' => '共Number個會員獎勵了魔力值',
'magic_show_all_description' => '查看詳單',
'magic_haveGotBonus' => '目前發佈人已獲得Number個魔力值獎勵。',
'magic_have_no_enough_bonus_value' => '需要更多魔力值。',
);
?>
+1 -1
View File
@@ -60,7 +60,7 @@ $lang_edit = array
'radio_other' => "其他",
'submit_delete_it' => "刪除",
'text_move_to_browse' => "類型變為<b>種子</b>區的 ",
'text_move_to_special' => "類型變為<b>音樂</b>區的 ",
'text_move_to_special' => "類型變為<b>特別</b>區的 ",
'text_medium' => "媒介:",
'row_pick' => "挑選",
'row_check' => "勾選",
+1
View File
@@ -212,6 +212,7 @@ $lang_functions = array
'text_ip_range' => "IP範圍",
'text_min' => "分鐘",
'text_music' => "&nbsp;音&nbsp;&nbsp;樂&nbsp;",
'text_special' => "&nbsp;特&nbsp;&nbsp;别&nbsp;",
'title_reply_with_quote' => "引用",
'title_add_reply' => "回復",
'title_delete' => "刪除",
+2
View File
@@ -141,6 +141,8 @@ $lang_settings = array
'text_upload_torrent_note' => "。發布種子到種子區。",
'row_upload_special_torrent' => "發布種子至特別區",
'text_upload_special_torrent_note' => "。發布種子到特別區。",
'row_view_special_torrent' => '查看特別區種子',
'text_view_special_torrent_note' => '查看特別區種子。',
'row_move_torrent' => "移動種子",
'text_move_torrent_note' => "。將種子在各區間移動。",
'row_chronicle_management' => "管理史冊",
+1 -1
View File
@@ -31,7 +31,7 @@ $lang_upload = array
'text_read_rules' => "我已經閱讀過規則",
'submit_upload' => "發布",
'text_to_browse_section' => "發布至<b>種子</b>區 ",
'text_to_special_section' => "或<b>音樂</b>區 ",
'text_to_special_section' => "或<b>特別</b>區 ",
'text_type_note' => "&nbsp;&nbsp; <font class=\"small\"><b>只選</b>兩者之一</font>",
'text_medium' => "媒介:",
'text_team' => "製作組:",
+1 -1
View File
@@ -204,7 +204,7 @@ $lang_usercp = array
'text_games_and_appz' => "游戲 & 程序:",
'text_others' => "其它:",
'text_at_browse_page' => "種子區",
'text_at_special_page' => "音樂",
'text_at_special_page' => "特别",
'text_additional_selection' => "補充設定",
'text_stylesheet_note' => "更多界面風格?想自己設計?",
'text_stylesheet_link' => "點擊這裏",
+12
View File
@@ -218,6 +218,18 @@ $lang_details = array
'row_uploader_bandwidth' => "Uploader<br />Bandwidth",
'text_and_more' => " and more (thanks from ",
'text_users_in_total' => " users in total)",
'torrent_dl_url' => "Torrent URL",
'torrent_dl_url_notice' => "You can copy it to your BT Client. Take care since it contains your passkey.",
'span_description_have_given' =>'You have given the magic of the value',
'text_no_magic_added' => "No magic value of the award",
'magic_value_number' => "Number Magic point value has been presented",
'magic_value_award' => "Magic value of awards",
'magic_newest_record' =>'Here only the latest record. ',
'magic_sum_user_give_number' => 'Number Member gave the magic award totally',
'magic_show_all_description' => 'View details of a single',
'magic_haveGotBonus' => 'Publisher now has been got Number Bonus of award.',
'magic_have_no_enough_bonus_value' => 'more points needed',
);
?>
+1 -1
View File
@@ -60,7 +60,7 @@ $lang_edit = array
'radio_other' => "Other",
'submit_delete_it' => "Delete&nbsp;it!",
'text_move_to_browse' => "Move to <b>Torrents</b> section as ",
'text_move_to_special' => "Move to <b>Music</b> section as ",
'text_move_to_special' => "Move to <b>Special</b> section as ",
'text_medium' => "Medium:",
'row_pick' => "Pick",
'row_check' => "Check",
+1
View File
@@ -212,6 +212,7 @@ $lang_functions = array
'text_ip_range' => "IP&nbsp;Range",
'text_min' => " min",
'text_music' => "Music",
'text_special' => "Special",
'title_reply_with_quote' => "Quote",
'title_add_reply' => "Add&nbsp;Reply",
'title_delete' => "Delete",
+2
View File
@@ -141,6 +141,8 @@ $lang_settings = array
'text_upload_torrent_note' => ". Upload torrents to Torrents section",
'row_upload_special_torrent' => "Upload Special Torrent",
'text_upload_special_torrent_note' => ". Upload torrents to Special section",
'row_view_special_torrent' => 'View Special Torrent',
'text_view_special_torrent_note' => 'View torrents in Special section',
'row_move_torrent' => "Move Torrent",
'text_move_torrent_note' => ". Move torrents between sections",
'row_chronicle_management' => "Chronicle Management",
+1 -1
View File
@@ -31,7 +31,7 @@ $lang_upload = array
'text_read_rules' => "I read the rules before this uploading.",
'submit_upload' => "Upload",
'text_to_browse_section' => "Upload to <b>Torrents</b> section ",
'text_to_special_section' => "or <b>Music</b> section ",
'text_to_special_section' => "or <b>Special</b> section ",
'text_type_note' => "&nbsp;&nbsp; <font class=\"small\">Choose <b>only</b> either of the two</font>",
'text_medium' => "Medium:",
'text_team' => "Group:",
+1 -1
View File
@@ -204,7 +204,7 @@ $lang_usercp = array
'text_games_and_appz' => "Games & Appz:",
'text_others' => "Others:",
'text_at_browse_page' => "Torrents section",
'text_at_special_page' => "Music section",
'text_at_special_page' => "Special section",
'text_additional_selection' => "Additional selections",
'text_stylesheet_note' => "More stylesheets? Wanna design your own? ",
'text_stylesheet_link' => "CLICK HERE",
+20 -6
View File
@@ -11,7 +11,17 @@ int_check($id);
if (!isset($id) || !$id)
die();
$res = sql_query("SELECT torrents.cache_stamp, torrents.sp_state, torrents.url, torrents.small_descr, torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, nfo, LENGTH(torrents.nfo) AS nfosz, torrents.last_action, torrents.name, 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, torrents.anonymous, torrents.pt_gen, torrents.technical_info, categories.name AS cat_name, sources.name AS source_name, media.name AS medium_name, codecs.name AS codec_name, standards.name AS standard_name, processings.name AS processing_name, teams.name AS team_name, audiocodecs.name AS audiocodec_name FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN sources ON torrents.source = sources.id LEFT JOIN media ON torrents.medium = media.id LEFT JOIN codecs ON torrents.codec = codecs.id LEFT JOIN standards ON torrents.standard = standards.id LEFT JOIN processings ON torrents.processing = processings.id LEFT JOIN teams ON torrents.team = teams.id LEFT JOIN audiocodecs ON torrents.audiocodec = audiocodecs.id WHERE torrents.id = $id LIMIT 1")
$res = sql_query("SELECT torrents.cache_stamp, torrents.sp_state, torrents.url, torrents.small_descr, torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, nfo, LENGTH(torrents.nfo) AS nfosz, torrents.last_action, torrents.name, 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, torrents.anonymous, torrents.pt_gen, torrents.technical_info,
categories.name AS cat_name, categories.mode as search_box_id, sources.name AS source_name, media.name AS medium_name, codecs.name AS codec_name, standards.name AS standard_name, processings.name AS processing_name, teams.name AS team_name, audiocodecs.name AS audiocodec_name
FROM torrents LEFT JOIN categories ON torrents.category = categories.id
LEFT JOIN sources ON torrents.source = sources.id
LEFT JOIN media ON torrents.medium = media.id
LEFT JOIN codecs ON torrents.codec = codecs.id
LEFT JOIN standards ON torrents.standard = standards.id
LEFT JOIN processings ON torrents.processing = processings.id
LEFT JOIN teams ON torrents.team = teams.id
LEFT JOIN audiocodecs ON torrents.audiocodec = audiocodecs.id
WHERE torrents.id = $id LIMIT 1")
or sqlerr();
$row = mysql_fetch_array($res);
if (get_user_class() >= $torrentmanage_class || $CURUSER["id"] == $row["owner"])
@@ -20,11 +30,14 @@ else $owned = 0;
$settingMain = get_setting('main');
if (!$row)
stderr($lang_details['std_error'], $lang_details['std_no_torrent_id']);
elseif ($row['banned'] == 'yes' && get_user_class() < $seebanned_class)
permissiondenied();
else {
if (!$row) {
stderr($lang_details['std_error'], $lang_details['std_no_torrent_id']);
} elseif (
($row['banned'] == 'yes' && get_user_class() < $seebanned_class)
|| !can_access_torrent($row)
) {
permissiondenied();
} else {
$torrentUpdate = [];
if (!empty($_GET["hit"])) {
$torrentUpdate[] = 'views = views + 1';
@@ -114,6 +127,7 @@ else {
else $download = "";
tr($lang_details['row_action'], $download. ($owned == 1 ? "<$editlink><img class=\"dt_edit\" src=\"pic/trans.gif\" alt=\"edit\" />&nbsp;<b><font class=\"small\">".$lang_details['text_edit_torrent'] . "</font></b></a>&nbsp;|&nbsp;" : ""). (get_user_class() >= $askreseed_class && $row['seeders'] == 0 ? "<a title=\"".$lang_details['title_ask_for_reseed']."\" href=\"takereseed.php?reseedid=$id\"><img class=\"dt_reseed\" src=\"pic/trans.gif\" alt=\"reseed\">&nbsp;<b><font class=\"small\">".$lang_details['text_ask_for_reseed'] ."</font></b></a>&nbsp;|&nbsp;" : "") . "<a title=\"".$lang_details['title_report_torrent']."\" href=\"report.php?torrent=$id\"><img class=\"dt_report\" src=\"pic/trans.gif\" alt=\"report\" />&nbsp;<b><font class=\"small\">".$lang_details['text_report_torrent']."</font></b></a>", 1);
tr($lang_details['torrent_dl_url'],sprintf('<b title="%s">%s/download.php?id=%u&passkey=%s</b>',$lang_details['torrent_dl_url_notice'], getSchemeAndHttpHost(),$id,$CURUSER['passkey']), 1);
// ---------------- start subtitle block -------------------//
$r = sql_query("SELECT subs.*, language.flagpic, language.lang_name FROM subs LEFT JOIN language ON subs.lang_id=language.id WHERE torrent_id = " . sqlesc($row["id"]). " ORDER BY subs.lang_id ASC") or sqlerr(__FILE__, __LINE__);
+11 -7
View File
@@ -70,15 +70,19 @@ else{
$res = sql_query("SELECT name, filename, save_as, size, owner,banned FROM torrents WHERE id = ".sqlesc($id)) or sqlerr(__FILE__, __LINE__);
$res = sql_query("SELECT torrents.name, torrents.filename, torrents.save_as, torrents.size, torrents.owner, torrents.banned, categories.mode as search_box_id FROM torrents left join categories on torrents.category = categories.id WHERE torrents.id = ".sqlesc($id)) or sqlerr(__FILE__, __LINE__);
$row = mysql_fetch_assoc($res);
$fn = ROOT_PATH . "$torrent_dir/$id.torrent";
if ($CURUSER['downloadpos']=="no")
permissiondenied();
if (!$row || !is_file($fn) || !is_readable($fn))
httperr();
if ($row['banned'] == 'yes' && get_user_class() < $seebanned_class)
permissiondenied();
if ($CURUSER['downloadpos']=="no") {
permissiondenied();
}
if (!$row || !is_file($fn) || !is_readable($fn)) {
httperr();
}
if (($row['banned'] == 'yes' && get_user_class() < $seebanned_class) || !can_access_torrent($row)) {
permissiondenied();
}
sql_query("UPDATE torrents SET hits = hits + 1 WHERE id = ".sqlesc($id)) or sqlerr(__FILE__, __LINE__);
require_once "include/benc.php";
+2 -3
View File
@@ -187,7 +187,7 @@ elseif ($action == 'savesettings_security') // save security
elseif ($action == 'savesettings_authority') // save user authority
{
stdhead($lang_settings['head_save_authority_settings']);
$validConfig = array('defaultclass','staffmem','newsmanage','newfunitem','funmanage','sbmanage','pollmanage','applylink', 'linkmanage', 'postmanage','commanage','forummanage','viewuserlist','torrentmanage','torrentsticky', 'torrentonpromotion', 'askreseed', 'viewnfo', 'torrentstructure','sendinvite','viewhistory','topten','log','confilog','userprofile', 'torrenthistory','prfmanage', 'cruprfmanage','uploadsub','delownsub','submanage','updateextinfo', 'viewanonymous','beanonymous','addoffer','offermanage', 'upload','uploadspecial','movetorrent','chrmanage','viewinvite', 'buyinvite','seebanned','againstoffer','userbar');
$validConfig = array('defaultclass','staffmem','newsmanage','newfunitem','funmanage','sbmanage','pollmanage','applylink', 'linkmanage', 'postmanage','commanage','forummanage','viewuserlist','torrentmanage','torrentsticky', 'torrentonpromotion', 'askreseed', 'viewnfo', 'torrentstructure','sendinvite','viewhistory','topten','log','confilog','userprofile', 'torrenthistory','prfmanage', 'cruprfmanage','uploadsub','delownsub','submanage','updateextinfo', 'viewanonymous','beanonymous','addoffer','offermanage', 'upload','uploadspecial','view_special_torrent','movetorrent','chrmanage','viewinvite', 'buyinvite','seebanned','againstoffer','userbar');
GetVar($validConfig);
$AUTHORITY = [];
foreach($validConfig as $config) {
@@ -404,9 +404,8 @@ elseif ($action == 'authoritysettings') //Authority settings
tr($lang_settings['row_add_offer'], $lang_settings['text_minimum_class'].classlist('addoffer',$maxclass,$AUTHORITY['addoffer']).$lang_settings['text_default'].get_user_class_name(UC_PEASANT,false,true,true).$lang_settings['text_add_offer_note'], 1);
tr($lang_settings['row_offer_management'], $lang_settings['text_minimum_class'].classlist('offermanage',$maxclass,$AUTHORITY['offermanage']).$lang_settings['text_default'].get_user_class_name(UC_MODERATOR,false,true,true).$lang_settings['text_offer_management_note'],1);
tr($lang_settings['row_upload_torrent'], $lang_settings['text_minimum_class'].classlist('upload',$maxclass,$AUTHORITY['upload']).$lang_settings['text_default'].get_user_class_name(UC_POWER_USER,false,true,true).$lang_settings['text_upload_torrent_note'], 1);
// if (THISTRACKER == "HDStar")
tr($lang_settings['row_upload_special_torrent'], $lang_settings['text_minimum_class'].classlist('uploadspecial',$maxclass,$AUTHORITY['uploadspecial']).$lang_settings['text_default'].get_user_class_name(UC_UPLOADER,false,true,true).$lang_settings['text_upload_special_torrent_note'],1);
// if (THISTRACKER == "HDStar")
tr($lang_settings['row_view_special_torrent'], $lang_settings['text_minimum_class'].classlist('view_special_torrent',$maxclass,$AUTHORITY['view_special_torrent']).$lang_settings['text_default'].get_user_class_name(UC_CRAZY_USER,false,true,true).$lang_settings['text_view_special_torrent_note'],1);
tr($lang_settings['row_move_torrent'], $lang_settings['text_minimum_class'].classlist('movetorrent',$maxclass,$AUTHORITY['movetorrent']).$lang_settings['text_default'].get_user_class_name(UC_MODERATOR,false,true,true).$lang_settings['text_move_torrent_note'],1);
tr($lang_settings['row_chronicle_management'], $lang_settings['text_minimum_class'].classlist('chrmanage',$maxclass,$AUTHORITY['chrmanage']).$lang_settings['text_default'].get_user_class_name(UC_MODERATOR,false,true,true).$lang_settings['text_chronicle_management_note'],1);
tr($lang_settings['row_view_invite'], $lang_settings['text_minimum_class'].classlist('viewinvite',$maxclass,$AUTHORITY['viewinvite']).$lang_settings['text_default'].get_user_class_name(UC_MODERATOR,false,true,true).$lang_settings['text_view_invite_note'],1);
+3
View File
@@ -0,0 +1,3 @@
<?php
require_once("torrents.php");
+17 -2
View File
@@ -1,12 +1,27 @@
<?php
require_once("../include/bittorrent.php");
dbconn(true);
require_once(get_langfile_path());
require_once(get_langfile_path('torrents.php'));
loggedinorreturn();
parked();
//check searchbox
$sectiontype = $browsecatmode;
switch (CURRENT_SCRIPT) {
case 'torrents':
$sectiontype = $browsecatmode;
break;
case 'special':
if (get_setting('main.spsct') != 'yes') {
httperr();
}
if (get_user_class() < get_setting('authority.view_special_torrent')) {
permissiondenied();
}
$sectiontype = $specialcatmode;
break;
default:
$sectiontype = 0;
}
$showsubcat = get_searchbox_value($sectiontype, 'showsubcat');//whether show subcategory (i.e. sources, codecs) or not
$showsource = get_searchbox_value($sectiontype, 'showsource'); //whether show sources or not
$showmedium = get_searchbox_value($sectiontype, 'showmedium'); //whether show media or not
+2 -1
View File
@@ -428,7 +428,8 @@ if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
if ($i && $numinrow == 0){
$categories .= "</tr>".($spenablecatrow ? "<tr><td class=embedded align=left><b>".$spcatrow[$rownum]."</b></td></tr>" : "")."<tr>";
}
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=cat".$cat['id']." type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat".$cat['id']."]") !== false ? " checked" : "")." value='yes'><img src=pic/" .get_cat_folder($cat['id']). htmlspecialchars($cat[image]) . " border='0' alt=\"" .$cat['name']."\" title=\"" .$cat['name']."\"></td>\n";
// $categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=cat".$cat['id']." type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat".$cat['id']."]") !== false ? " checked" : "")." value='yes'><img src=pic/" .get_cat_folder($cat['id']). '/'. htmlspecialchars($cat['image']) . " border='0' alt=\"" .$cat['name']."\" title=\"" .$cat['name']."\"></td>\n";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=cat".$cat['id']." type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat".$cat['id']."]") !== false ? " checked" : "")." value='yes'>" . return_category_image($cat['id'], "special.php?allsec=1&amp;") . "</td>\n";
$i++;
}
$categories .= "</tr>";