fix php8 compatibility

This commit is contained in:
xiaomlove
2020-12-28 20:52:54 +08:00
parent 77ebc7caa4
commit 32d47b66c9
29 changed files with 357 additions and 302 deletions

View File

@@ -12,7 +12,7 @@ $count_left = $Attach->get_count_left();
$size_limit = $Attach->get_size_limit_byte();
$allowed_exts = $Attach->get_allowed_ext();
$css_uri = get_css_uri();
$altsize = $_POST['altsize'];
$altsize = $_POST['altsize'] ?? '';
?>
<html>
<head>

View File

@@ -209,7 +209,7 @@ class RedisCache {
// $this->set($Key,$Value, 0, $Duration);
$this->redis->set($Key, $Value, $Duration);
$this->cacheWriteTimes++;
$this->keyHits['write'][$Key] = !$this->keyHits['write'][$Key] ? 1 : $this->keyHits['write'][$Key]+1;
$this->keyHits['write'][$Key] = !isset($this->keyHits['write'][$Key]) ? 1 : $this->keyHits['write'][$Key]+1;
}
//---------- Getting functions ----------//
@@ -219,7 +219,7 @@ class RedisCache {
function next_row(){
$this->Row++;
$this->Part = 0;
if($this->Page[$this->Row] == false){
if(!isset($this->Page[$this->Row]) || $this->Page[$this->Row] == false){
return false;
}
elseif(count($this->Page[$this->Row]) == 1){
@@ -276,7 +276,7 @@ class RedisCache {
$Return = $this->redis->get($Key);
$Return = ! is_null($Return) ? $this->unserialize($Return) : null;
$this->cacheReadTimes++;
$this->keyHits['read'][$Key] = !$this->keyHits['read'][$Key] ? 1 : $this->keyHits['read'][$Key]+1;
$this->keyHits['read'][$Key] = !isset($this->keyHits['read'][$Key]) ? 1 : $this->keyHits['read'][$Key]+1;
return $Return;
}

View File

@@ -40,7 +40,7 @@ else // when it's op, default is not use secure login
$securelogin_indentity_cookie = false;
$passh = md5($row["passhash"]);
}
logincookie($row["id"], $passh,1,0x7fffffff,$securelogin_indentity_cookie);
logincookie($id, $passh,1,0x7fffffff,$securelogin_indentity_cookie);
//sessioncookie($row["id"], $passh,false);
header("Refresh: 0; url=ok.php?type=confirm");

View File

@@ -5,7 +5,7 @@ require_once(get_langfile_path());
if ($enabledonation != 'yes')
stderr($lang_donate['std_sorry'], $lang_donate['std_do_not_accept_donation']);
$do = $_GET['do'];
$do = $_GET['do'] ?? '';
if ($do == 'thanks') {
stderr($lang_donate['std_success'], $lang_donate['std_donation_success_note_one']."<a href=\"sendmessage.php?receiver=".$ACCOUNTANTID."\"><b>".$lang_donate['std_here']."</b></a>".$lang_donate['std_donation_success_note_two'], false);

50
faq.php
View File

@@ -24,17 +24,17 @@ if (!$is_rulelang){
}
$res = sql_query("SELECT `id`, `link_id`, `question`, `flag` FROM `faq` WHERE `type`='categ' AND `lang_id` = ".sqlesc($lang_id)." ORDER BY `order` ASC");
while ($arr = mysql_fetch_array($res)) {
$faq_categ[$arr[link_id]][title] = $arr[question];
$faq_categ[$arr[link_id]][flag] = $arr[flag];
$faq_categ[$arr[link_id]][link_id] = $arr[link_id];
$faq_categ[$arr['link_id']]['title'] = $arr['question'];
$faq_categ[$arr['link_id']]['flag'] = $arr['flag'];
$faq_categ[$arr['link_id']]['link_id'] = $arr['link_id'];
}
$res = sql_query("SELECT `id`, `link_id`, `question`, `answer`, `flag`, `categ` FROM `faq` WHERE `type`='item' AND `lang_id` = ".sqlesc($lang_id)." ORDER BY `order` ASC");
while ($arr = mysql_fetch_array($res, MYSQL_BOTH)) {
$faq_categ[$arr[categ]][items][$arr[id]][question] = $arr[question];
$faq_categ[$arr[categ]][items][$arr[id]][answer] = $arr[answer];
$faq_categ[$arr[categ]][items][$arr[id]][flag] = $arr[flag];
$faq_categ[$arr[categ]][items][$arr[id]][link_id] = $arr[link_id];
while ($arr = mysql_fetch_array($res)) {
$faq_categ[$arr['categ']]['items'][$arr['id']]['question'] = $arr['question'];
$faq_categ[$arr['categ']]['items'][$arr['id']]['answer'] = $arr['answer'];
$faq_categ[$arr['categ']]['items'][$arr['id']]['flag'] = $arr['flag'];
$faq_categ[$arr['categ']]['items'][$arr['id']]['link_id'] = $arr['link_id'];
}
if (isset($faq_categ)) {
@@ -44,11 +44,11 @@ if (isset($faq_categ)) {
{
if (!array_key_exists("title", $faq_categ[$id]))
{
foreach ($faq_categ[$id][items] as $id2 => $temp)
foreach ($faq_categ[$id]['items'] as $id2 => $temp)
{
$faq_orphaned[$id2][question] = $faq_categ[$id][items][$id2][question];
$faq_orphaned[$id2][answer] = $faq_categ[$id][items][$id2][answer];
$faq_orphaned[$id2][flag] = $faq_categ[$id][items][$id2][flag];
$faq_orphaned[$id2]['question'] = $faq_categ[$id]['items'][$id2]['question'];
$faq_orphaned[$id2][answer] = $faq_categ[$id]['items'][$id2][answer];
$faq_orphaned[$id2]['flag'] = $faq_categ[$id]['items'][$id2]['flag'];
unset($faq_categ[$id]);
}
}
@@ -58,16 +58,16 @@ if (isset($faq_categ)) {
begin_frame("<span id=\"top\">".$lang_faq['text_contents'] . "</span>");
foreach ($faq_categ as $id => $temp)
{
if ($faq_categ[$id][flag] == "1")
if ($faq_categ[$id]['flag'] == "1")
{
print("<ul><li><a href=\"#id". $faq_categ[$id][link_id] ."\"><b>". $faq_categ[$id][title] ."</b></a><ul>\n");
print("<ul><li><a href=\"#id". $faq_categ[$id]['link_id'] ."\"><b>". $faq_categ[$id]['title'] ."</b></a><ul>\n");
if (array_key_exists("items", $faq_categ[$id]))
{
foreach ($faq_categ[$id][items] as $id2 => $temp)
foreach ($faq_categ[$id]['items'] as $id2 => $temp)
{
if ($faq_categ[$id][items][$id2][flag] == "1") print("<li><a href=\"#id". $faq_categ[$id][items][$id2][link_id] ."\" class=\"faqlink\">". $faq_categ[$id][items][$id2][question] ."</a></li>\n");
elseif ($faq_categ[$id][items][$id2][flag] == "2") print("<li><a href=\"#id". $faq_categ[$id][items][$id2][link_id] ."\" class=\"faqlink\">". $faq_categ[$id][items][$id2][question] ."</a> <img class=\"faq_updated\" src=\"pic/trans.gif\" alt=\"Updated\" /></li>\n");
elseif ($faq_categ[$id][items][$id2][flag] == "3") print("<li><a href=\"#id". $faq_categ[$id][items][$id2][link_id] ."\" class=\"faqlink\">". $faq_categ[$id][items][$id2][question] ."</a> <img class=\"faq_new\" src=\"pic/trans.gif\" alt=\"New\" /></li>\n");
if ($faq_categ[$id]['items'][$id2]['flag'] == "1") print("<li><a href=\"#id". $faq_categ[$id]['items'][$id2]['link_id'] ."\" class=\"faqlink\">". $faq_categ[$id]['items'][$id2]['question'] ."</a></li>\n");
elseif ($faq_categ[$id]['items'][$id2]['flag'] == "2") print("<li><a href=\"#id". $faq_categ[$id]['items'][$id2]['link_id'] ."\" class=\"faqlink\">". $faq_categ[$id]['items'][$id2]['question'] ."</a> <img class=\"faq_updated\" src=\"pic/trans.gif\" alt=\"Updated\" /></li>\n");
elseif ($faq_categ[$id]['items'][$id2]['flag'] == "3") print("<li><a href=\"#id". $faq_categ[$id]['items'][$id2]['link_id'] ."\" class=\"faqlink\">". $faq_categ[$id]['items'][$id2]['question'] ."</a> <img class=\"faq_new\" src=\"pic/trans.gif\" alt=\"New\" /></li>\n");
}
}
print("</ul></li></ul><br />");
@@ -76,19 +76,19 @@ if (isset($faq_categ)) {
end_frame();
foreach ($faq_categ as $id => $temp) {
if ($faq_categ[$id][flag] == "1")
if ($faq_categ[$id]['flag'] == "1")
{
$frame = $faq_categ[$id][title] ." - <a href=\"#top\"><img class=\"top\" src=\"pic/trans.gif\" alt=\"Top\" title=\"Top\" /></a>";
$frame = $faq_categ[$id]['title'] ." - <a href=\"#top\"><img class=\"top\" src=\"pic/trans.gif\" alt=\"Top\" title=\"Top\" /></a>";
begin_frame($frame);
print("<span id=\"id". $faq_categ[$id][link_id] ."\"></span>");
print("<span id=\"id". $faq_categ[$id]['link_id'] ."\"></span>");
if (array_key_exists("items", $faq_categ[$id]))
{
foreach ($faq_categ[$id][items] as $id2 => $temp)
foreach ($faq_categ[$id]['items'] as $id2 => $temp)
{
if ($faq_categ[$id][items][$id2][flag] != "0")
if ($faq_categ[$id]['items'][$id2]['flag'] != "0")
{
print("<br /><span id=\"id".$faq_categ[$id][items][$id2][link_id]."\"><b>". $faq_categ[$id][items][$id2][question] ."</b></span><br />\n");
print("<br />". $faq_categ[$id][items][$id2][answer] ."\n<br /><br />\n");
print("<br /><span id=\"id".$faq_categ[$id]['items'][$id2]['link_id']."\"><b>". $faq_categ[$id]['items'][$id2]['question'] ."</b></span><br />\n");
print("<br />". $faq_categ[$id]['items'][$id2]['answer'] ."\n<br /><br />\n");
}
}
}

View File

@@ -253,7 +253,7 @@ if (!$topicsperpage){
$today_date = date("Y-m-d",TIMENOW);
// ------------- end: Global variables ------------------//
$action = htmlspecialchars(trim($_GET["action"]));
$action = htmlspecialchars(trim($_GET["action"] ?? ''));
//-------- Action: New topic
if ($action == "newtopic")
@@ -1408,7 +1408,7 @@ stdfoot();
die;
}
if ($_GET["catchup"] == 1){
if (isset($_GET["catchup"]) && $_GET["catchup"] == 1){
catch_up();
}

View File

@@ -51,18 +51,18 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
}
foreach ($brcats as $cat)
{
if ($_POST["cat$cat[id]"])
if (!empty($_POST["cat{$cat['id']}"]))
{
$query[] = "cat$cat[id]=1";
$query[] = "cat{$cat['id']}=1";
}
}
if ($enablespecial == 'yes')
{
foreach ($spcats as $cat)
{
if ($_POST["cat$cat[id]"])
if (!empty($_POST["cat{$cat['id']}"]))
{
$query[] = "cat$cat[id]=1";
$query[] = "cat{$cat['id']}=1";
}
}
}
@@ -70,84 +70,84 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
if ($showsource)
foreach ($sources as $source)
{
if ($_POST["sou$source[id]"])
if (!empty($_POST["sou{$source['id']}"]))
{
$query[] = "sou$source[id]=1";
$query[] = "sou{$source['id']}=1";
}
}
if ($showmedium)
foreach ($media as $medium)
{
if ($_POST["med$medium[id]"])
if (!empty($_POST["med{$medium['id']}"]))
{
$query[] = "med$medium[id]=1";
$query[] = "med{$medium['id']}=1";
}
}
if ($showcodec)
foreach ($codecs as $codec)
{
if ($_POST["cod$codec[id]"])
if (!empty($_POST["cod{$codec['id']}"]))
{
$query[] = "cod$codec[id]=1";
$query[] = "cod{$codec['id']}=1";
}
}
if ($showstandard)
foreach ($standards as $standard)
{
if ($_POST["sta$standard[id]"])
if (!empty($_POST["sta{$standard['id']}"]))
{
$query[] = "sta$standard[id]=1";
$query[] = "sta{$standard['id']}=1";
}
}
if ($showprocessing)
foreach ($processings as $processing)
{
if ($_POST["pro$processing[id]"])
if (!empty($_POST["pro{$processing['id']}"]))
{
$query[] = "pro$processing[id]=1";
$query[] = "pro{$processing['id']}=1";
}
}
if ($showteam)
foreach ($teams as $team)
{
if ($_POST["tea$team[id]"])
if (!empty($_POST["tea{$team['id']}"]))
{
$query[] = "tea$team[id]=1";
$query[] = "tea{$team['id']}=1";
}
}
if ($showaudiocodec)
foreach ($audiocodecs as $audiocodec)
{
if ($_POST["aud$audiocodec[id]"])
if (!empty($_POST["aud{$audiocodec['id']}"]))
{
$query[] = "aud$audiocodec[id]=1";
$query[] = "aud{$audiocodec['id']}=1";
}
}
}
if ($_POST["itemcategory"])
if (!empty($_POST["itemcategory"]))
{
$query[] = "icat=1";
}
if ($_POST["itemsmalldescr"])
if (!empty($_POST["itemsmalldescr"]))
{
$query[] = "ismalldescr=1";
}
if ($_POST["itemsize"])
if (!empty($_POST["itemsize"]))
{
$query[] = "isize=1";
}
if ($_POST["itemuploader"])
if (!empty($_POST["itemuploader"]))
{
$query[] = "iuplder=1";
}
$searchstr = mysql_real_escape_string(trim($_POST["search"]));
$searchstr = mysql_real_escape_string(trim($_POST["search"] ?? ''));
if (empty($searchstr))
unset($searchstr);
if ($searchstr)
{
$query[] = "search=".rawurlencode($searchstr);
if ($_POST["search_mode"]){
$search_mode = 0 + $_POST["search_mode"];
$search_mode = $_POST["search_mode"] ?? 0;
if (!in_array($search_mode,array(0,1,2)))
{
$search_mode = 0;
@@ -155,7 +155,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
$query[] = "search_mode=".$search_mode;
}
}
$inclbookmarked=0+$_POST['inclbookmarked'];
$inclbookmarked=$_POST['inclbookmarked'] ?? 0;
if($inclbookmarked)
{
if (!in_array($inclbookmarked,array(0,1)))
@@ -194,7 +194,7 @@ foreach ($brcats as $cat)//print category list of Torrents section
if ($i && $numinrow == 0){
$categories .= "</tr>".($brenablecatrow ? "<tr><td class=\"embedded\" align=\"left\"><b>".$brcatrow[$rownum]."</b></td></tr>" : "")."<tr>";
}
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"cat".$cat[id]."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat".$cat[id]."]") !== false ? " checked=\"checked\"" : "")." value='yes' />".return_category_image($cat['id'], "torrents.php?allsec=1&amp;")."</td>\n";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"cat".$cat['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat".$cat['id']."]") !== false ? " checked=\"checked\"" : "")." value='yes' />".return_category_image($cat['id'], "torrents.php?allsec=1&amp;")."</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -209,7 +209,7 @@ if ($allowspecial) //print category list of Special section
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 name=\"cat".$cat[id]."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat".$cat[id]."]") !== false ? " checked=\"checked\"" : "")." value='yes' />".return_category_image($cat['id'], "torrents.php?allsec=1&amp;")."</td>\n";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"cat".$cat['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat".$cat['id']."]") !== false ? " checked=\"checked\"" : "")." value='yes' />".return_category_image($cat['id'], "torrents.php?allsec=1&amp;")."</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -222,7 +222,7 @@ if ($allowspecial) //print category list of Special section
foreach ($sources as $source)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"sou".$source[id]."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[sou".$source[id]."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$source[name]."</td>\n";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"sou".$source['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[sou".$source['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$source['name']."</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -233,7 +233,7 @@ if ($allowspecial) //print category list of Special section
foreach ($media as $medium)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"med".$medium[id]."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[med".$medium[id]."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$medium[name]."</td>\n";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"med".$medium['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[med".$medium['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$medium['name']."</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -244,7 +244,7 @@ if ($allowspecial) //print category list of Special section
foreach ($codecs as $codec)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"cod".$codec[id]."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cod".$codec[id]."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$codec[name]."</td>\n";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"cod".$codec['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cod".$codec['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$codec['name']."</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -255,7 +255,7 @@ if ($allowspecial) //print category list of Special section
foreach ($audiocodecs as $audiocodec)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"aud".$audiocodec[id]."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[aud".$audiocodec[id]."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$audiocodec[name]."</td>\n";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"aud".$audiocodec['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[aud".$audiocodec['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$audiocodec['name']."</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -266,7 +266,7 @@ if ($allowspecial) //print category list of Special section
foreach ($standards as $standard)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"sta".$standard[id]."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[sta".$standard[id]."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$standard[name]."</td>\n";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"sta".$standard['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[sta".$standard['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$standard['name']."</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -277,7 +277,7 @@ if ($allowspecial) //print category list of Special section
foreach ($processings as $processing)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"pro".$processing[id]."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[pro".$processing[id]."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$processing[name]."</td>\n";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"pro".$processing['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[pro".$processing['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$processing['name']."</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -288,7 +288,7 @@ if ($allowspecial) //print category list of Special section
foreach ($teams as $team)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"tea".$team[id]."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[tea".$team[id]."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$team[name]."</td>\n";
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"tea".$team['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[tea".$team['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$team['name']."</td>\n";
$i++;
}
$categories .= "</tr>";

View File

@@ -11,6 +11,8 @@ set_include_path(get_include_path() . PATH_SEPARATOR . $rootpath);
$rootpath .= "/";
require $rootpath . 'include/config.php';
require $rootpath . 'include/functions.php';
require $rootpath . 'include/globalfunctions.php';
require $rootpath . get_langfile_path("functions.php");
require $rootpath . 'include/database/interface_db.php';
require $rootpath . 'include/database/class_db_mysqli.php';
@@ -18,4 +20,11 @@ require $rootpath . 'include/database/class_db.php';
require $rootpath . 'include/database/helpers.php';
require $rootpath . 'include/database/class_exception.php';
require $rootpath . 'classes/class_advertisement.php';
require $rootpath . 'classes/class_cache_redis.php';
require $rootpath . 'include/core.php';
if (!session_id()) {
session_start();
}

View File

@@ -3,10 +3,6 @@ if(!defined('IN_TRACKER'))
die('Hacking attempt!');
error_reporting(E_ERROR | E_PARSE);
ini_set('display_errors', $TWEAK['display_errors']);
//include_once($rootpath . 'classes/class_cache.php'); //Require the caching class
//$Cache = NEW CACHE(); //Load the caching class
//@todo
include_once($rootpath . 'classes/class_cache_redis.php'); //Require the caching class
$Cache = new RedisCache(); //Load the caching class
$Cache->setLanguageFolderArray(get_langfolder_list());
define('TIMENOW', time());
@@ -26,43 +22,10 @@ define ("UC_NEXUS_MASTER", 9);
define ("UC_VIP", 10);
define ("UC_RETIREE",11);
define ("UC_UPLOADER",12);
//define ("UC_FORUM_MODERATOR", 12);
define ("UC_FORUM_MODERATOR", 12);
define ("UC_MODERATOR",13);
define ("UC_ADMINISTRATOR",14);
define ("UC_SYSOP",15);
define ("UC_STAFFLEADER",16);
ignore_user_abort(1);
@set_time_limit(60);
function strip_magic_quotes($arr)
{
foreach ($arr as $k => $v)
{
if (is_array($v))
{
$arr[$k] = strip_magic_quotes($v);
} else {
$arr[$k] = stripslashes($v);
}
}
return $arr;
}
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc())
{
if (!empty($_GET)) {
$_GET = strip_magic_quotes($_GET);
}
if (!empty($_POST)) {
$_POST = strip_magic_quotes($_POST);
}
if (!empty($_COOKIE)) {
$_COOKIE = strip_magic_quotes($_COOKIE);
}
}
function get_langfolder_list()
{
//do not access db for speed up, or for flexibility
return array("en", "chs", "cht", "ko", "ja");
}

View File

@@ -97,6 +97,11 @@ class DB
return $this->driver->escapeString($string);
}
public function lastInsertId()
{
return $this->driver->lastInsertId();
}

View File

@@ -9,7 +9,7 @@ class DBMysqli implements DBInterface
$mysqli = new mysqli($host, $username, $password, $database, $port);
/* check connection */
if (mysqli_connect_errno()) {
throw new \RuntimeException(mysqli_connect_error());
throw new \DatabaseException('', mysqli_connect_error());
}
/* activate reporting */
$driver = new mysqli_driver();
@@ -71,5 +71,10 @@ class DBMysqli implements DBInterface
return $this->mysqli->real_escape_string($string);
}
public function lastInsertId(): int
{
return $this->mysqli->insert_id;
}
}

View File

@@ -55,3 +55,7 @@ function mysql_real_escape_string($string)
return DB::getInstance()->escapeString($string);
}
function mysql_insert_id()
{
return DB::getInstance()->lastInsertId();
}

View File

@@ -24,4 +24,6 @@ interface DBInterface
public function escapeString(string $string): string;
public function lastInsertId(): int;
}

View File

@@ -2,9 +2,6 @@
# IMPORTANT: Do not edit below unless you know what you are doing!
if(!defined('IN_TRACKER'))
die('Hacking attempt!');
include_once($rootpath . 'include/globalfunctions.php');
include_once($rootpath . 'classes/class_advertisement.php');
require_once($rootpath . get_langfile_path("functions.php"));
function get_langfolder_cookie()
{
@@ -283,12 +280,22 @@ function format_comment($text, $strip_html = true, $xssclean = false, $newtab =
if ($enableattach_attachment == 'yes' && $imagenum != 1){
$limit = 20;
$s = preg_replace("/\[attach\]([0-9a-zA-z][0-9a-zA-z]*)\[\/attach\]/ies", "print_attachment('\\1', ".($enableimage ? 1 : 0).", ".($imageresizer ? 1 : 0).")", $s, $limit);
// $s = preg_replace("/\[attach\]([0-9a-zA-z][0-9a-zA-z]*)\[\/attach\]/ies", "print_attachment('\\1', ".($enableimage ? 1 : 0).", ".($imageresizer ? 1 : 0).")", $s, $limit);
$s = preg_replace_callback("/\[attach\]([0-9a-zA-z][0-9a-zA-z]*)\[\/attach\]/is", function ($matches) use ($enableimage, $imageresizer) {
return print_attachment($matches[1], ".($enableimage ? 1 : 0).", ".($imageresizer ? 1 : 0).");
}, $s, $limit);
}
if ($enableimage) {
$s = preg_replace("/\[img\]([^\<\r\n\"']+?)\[\/img\]/ei", "formatImg('\\1',".$imageresizer.",".$image_max_width.",".$image_max_height.")", $s, $imagenum, $imgReplaceCount);
$s = preg_replace("/\[img=([^\<\r\n\"']+?)\]/ei", "formatImg('\\1',".$imageresizer.",".$image_max_width.",".$image_max_height.")", $s, ($imagenum != -1 ? max($imagenum-$imgReplaceCount, 0) : -1));
// $s = preg_replace("/\[img\]([^\<\r\n\"']+?)\[\/img\]/ei", "formatImg('\\1',".$imageresizer.",".$image_max_width.",".$image_max_height.")", $s, $imagenum, $imgReplaceCount);
$s = preg_replace_callback("/\[img\]([^\<\r\n\"']+?)\[\/img\]/i", function ($matches) use ($imageresizer, $image_max_width, $image_max_height) {
return formatImg($matches[1],".$imageresizer.",".$image_max_width.",".$image_max_height.");
}, $s, $imagenum, $imgReplaceCount);
// $s = preg_replace("/\[img=([^\<\r\n\"']+?)\]/ei", "formatImg('\\1',".$imageresizer.",".$image_max_width.",".$image_max_height.")", $s, ($imagenum != -1 ? max($imagenum-$imgReplaceCount, 0) : -1));
$s = preg_replace_callback("/\[img=([^\<\r\n\"']+?)\]/i", function ($matches) use ($imageresizer, $image_max_width, $image_max_height) {
return formatImg($matches[1],".$imageresizer.",".$image_max_width.",".$image_max_height.");
}, $s, ($imagenum != -1 ? max($imagenum-$imgReplaceCount, 0) : -1));
} else {
$s = preg_replace("/\[img\]([^\<\r\n\"']+?)\[\/img\]/i", '', $s, -1);
$s = preg_replace("/\[img=([^\<\r\n\"']+?)\]/i", '', $s, -1);
@@ -366,6 +373,7 @@ function get_user_class()
function get_user_class_name($class, $compact = false, $b_colored = false, $I18N = false)
{
global $SITENAME;
static $en_lang_functions;
static $current_user_lang_functions;
if (!$en_lang_functions) {
@@ -1142,7 +1150,7 @@ function EmailBanned($newEmail)
$newEmail = trim(strtolower($newEmail));
$sql = sql_query("SELECT * FROM bannedemails") or sqlerr(__FILE__, __LINE__);
$list = mysql_fetch_array($sql);
$addresses = explode(' ', preg_replace("/[[:space:]]+/", " ", trim($list[value])) );
$addresses = explode(' ', preg_replace("/[[:space:]]+/", " ", trim($list['value'])) );
if(count($addresses) > 0)
{
@@ -1986,7 +1994,7 @@ function tr_small($x,$y,$noesc=0,$relation='') {
}
function twotd($x,$y,$nosec=0){
if ($noesc)
if ($nosec)
$a = $y;
else {
$a = htmlspecialchars($y);
@@ -2032,6 +2040,8 @@ function menu ($selected = "home") {
global $BASEURL,$CURUSER;
global $enableoffer, $enablespecial, $enableextforum, $extforumurl, $where_tweak;
global $USERUPDATESET;
//no this option in config.php
$enablerequest = 'no';
$script_name = $_SERVER["SCRIPT_FILENAME"];
if (preg_match("/index/i", $script_name)) {
$selected = "home";
@@ -2133,14 +2143,14 @@ function get_style_addicode()
function get_cat_folder($cat = 101)
{
static $catPath = array();
if (!$catPath[$cat]) {
if (!isset($catPath[$cat])) {
global $CURUSER, $CURLANGDIR;
$catrow = get_category_row($cat);
$catmode = $catrow['catmodename'];
$caticonrow = get_category_icon_row($CURUSER['caticon']);
$catPath[$cat] = "category/".$catmode."/".$caticonrow['folder'] . ($caticonrow['multilang'] == 'yes' ? $CURLANGDIR."/" : "");
}
return $catPath[$cat];
return $catPath[$cat] ?? '';
}
function get_style_highlight()
@@ -2174,7 +2184,6 @@ function stdhead($title = "", $msgalert = true, $script = "", $place = "")
$cssupdatedate = $cssdate_tweak;
// Variable for Start Time
$tstart = getmicrotime(); // Start time
//Insert old ip into iplog
if ($CURUSER){
if ($iplog1 == "yes") {
@@ -2356,7 +2365,7 @@ else {
<font class="color_ratio"><?php echo $lang_functions['text_ratio'] ?></font> <?php echo $ratio?> <font class='color_uploaded'><?php echo $lang_functions['text_uploaded'] ?></font> <?php echo mksize($CURUSER['uploaded'])?><font class='color_downloaded'> <?php echo $lang_functions['text_downloaded'] ?></font> <?php echo mksize($CURUSER['downloaded'])?> <font class='color_active'><?php echo $lang_functions['text_active_torrents'] ?></font> <img class="arrowup" alt="Torrents seeding" title="<?php echo $lang_functions['title_torrents_seeding'] ?>" src="pic/trans.gif" /><?php echo $activeseed?> <img class="arrowdown" alt="Torrents leeching" title="<?php echo $lang_functions['title_torrents_leeching'] ?>" src="pic/trans.gif" /><?php echo $activeleech?>&nbsp;&nbsp;<font class='color_connectable'><?php echo $lang_functions['text_connectable'] ?></font><?php echo $connectable?> <?php echo maxslots();?></span></td>
<td class="bottom" align="right"><span class="medium"><?php echo $lang_functions['text_the_time_is_now'] ?><?php echo $datum[hours].":".$datum[minutes]?><br />
<td class="bottom" align="right"><span class="medium"><?php echo $lang_functions['text_the_time_is_now'] ?><?php echo $datum['hours'].":".$datum['minutes']?><br />
<?php
if (get_user_class() >= $staffmem_class){
@@ -2690,7 +2699,7 @@ function pager($rpp, $count, $href, $opts = array(), $pagename = "page") {
global $lang_functions,$add_key_shortcut;
$pages = ceil($count / $rpp);
if (!$opts["lastpagedefault"])
if (empty($opts["lastpagedefault"]))
$pagedefault = 0;
else {
$pagedefault = floor(($count - 1) / $rpp);
@@ -3244,7 +3253,7 @@ function get_username($id, $big = false, $link = true, $bold = true, $target = f
global $lang_functions;
$id = 0+$id;
if (func_num_args() == 1 && $usernameArray[$id]) { //One argument=is default display of username. Get it directly from static array if available
if (func_num_args() == 1 && isset($usernameArray[$id])) { //One argument=is default display of username. Get it directly from static array if available
return $usernameArray[$id];
}
$arr = get_user_row($id);
@@ -4004,7 +4013,7 @@ function get_searchbox_value($mode = 1, $item = 'showsubcat'){
}
$Cache->cache_value('searchbox_content', $rows, 100500);
}
return $rows[$mode][$item];
return $rows[$mode][$item] ?? '';
}
function get_ratio($userid, $html = true){
@@ -4310,7 +4319,7 @@ function return_avatar_image($url)
function return_category_image($categoryid, $link="")
{
static $catImg = array();
if ($catImg[$categoryid]) {
if (isset($catImg[$categoryid])) {
$catimg = $catImg[$categoryid];
} else {
$categoryrow = get_category_row($categoryid);
@@ -4323,6 +4332,41 @@ function return_category_image($categoryid, $link="")
return $catimg;
}
function strip_magic_quotes($arr)
{
foreach ($arr as $k => $v)
{
if (is_array($v))
{
$arr[$k] = strip_magic_quotes($v);
} else {
$arr[$k] = stripslashes($v);
}
}
return $arr;
}
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc())
{
if (!empty($_GET)) {
$_GET = strip_magic_quotes($_GET);
}
if (!empty($_POST)) {
$_POST = strip_magic_quotes($_POST);
}
if (!empty($_COOKIE)) {
$_COOKIE = strip_magic_quotes($_COOKIE);
}
}
function get_langfolder_list()
{
//do not access db for speed up, or for flexibility
return array("en", "chs", "cht", "ko", "ja");
}
function dd($vars)
{
echo '<pre>';

View File

@@ -34,7 +34,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST")
stderr($lang_index['std_error'], $lang_index['std_option_unselected']);
}
}
stdhead($lang_index['head_home']);
begin_main_frame();

View File

@@ -5,7 +5,7 @@ require_once(get_langfile_path());
loggedinorreturn();
parked();
$id = 0 + $_GET["id"];
$type = unesc($_GET["type"]);
$type = unesc($_GET["type"] ?? '');
registration_check('invitesystem',true,false);

View File

@@ -10,7 +10,7 @@ $lang_mybonus = array
'text_success_vip' => "祝贺你,你获得了一个月的",
'text_success_vip_two' => "资格!",
'text_no_permission' => "<b>错误!</b>你没有该权限。",
'text_success_custom_title' => "祝贺你,你获得了<b>".$CURUSER[title]."</b>头衔!",
'text_success_custom_title' => "祝贺你,你获得了<b>".$CURUSER['title']."</b>头衔!",
'text_success_gift' => "你成功赠送了<b>魔力值</b>。",
'head_karma_page' => "的魔力值",
'text_karma_system' => "魔力值系统",

44
log.php
View File

@@ -33,7 +33,7 @@ function searchtable($title, $action, $opts = array()){
print("<table border=1 cellspacing=0 width=940 cellpadding=5>\n");
print("<tr><td class=colhead align=left>".$title."</td></tr>\n");
print("<tr><td class=toolbox align=left><form method=\"get\" action='" . $_SERVER['PHP_SELF'] . "'>\n");
print("<input type=\"text\" name=\"query\" style=\"width:500px\" value=\"".$_GET['query']."\">\n");
print("<input type=\"text\" name=\"query\" style=\"width:500px\" value=\"".($_GET['query'] ?? '')."\">\n");
if ($opts) {
print($lang_log['text_in']."<select name=search>");
foreach($opts as $value => $text)
@@ -50,7 +50,7 @@ function additem($title, $action){
print("<table border=1 cellspacing=0 width=940 cellpadding=5>\n");
print("<tr><td class=colhead align=left>".$title."</td></tr>\n");
print("<tr><td class=toolbox align=left><form method=\"post\" action='" . $_SERVER['PHP_SELF'] . "'>\n");
print("<textarea name=\"txt\" style=\"width:500px\" rows=\"3\" >".$row["txt"]."</textarea>\n");
print("<textarea name=\"txt\" style=\"width:500px\" rows=\"3\" >".$title."</textarea>\n");
print("<input type=\"hidden\" name=\"action\" value=".$action.">");
print("<input type=\"hidden\" name=\"do\" value=\"add\">");
print("<input type=submit value=" . $lang_log['submit_add'] . "></form>\n");
@@ -84,8 +84,8 @@ else {
case "dailylog":
stdhead($lang_log['head_site_log']);
$query = mysql_real_escape_string(trim($_GET["query"]));
$search = $_GET["search"];
$query = mysql_real_escape_string(trim($_GET["query"] ?? ''));
$search = $_GET["search"] ?? '';
$addparam = "";
$wherea = "";
@@ -108,7 +108,7 @@ else {
}
logmenu('dailylog');
$opt = array (all => $lang_log['text_all'], normal => $lang_log['text_normal'], mod => $lang_log['text_mod']);
$opt = array ('all' => $lang_log['text_all'], 'normal' => $lang_log['text_normal'], 'mod' => $lang_log['text_mod']);
searchtable($lang_log['text_search_log'], 'dailylog',$opt);
$res = sql_query("SELECT COUNT(*) FROM sitelog".$wherea);
@@ -151,7 +151,7 @@ else {
break;
case "chronicle":
stdhead($lang_log['head_chronicle']);
$query = mysql_real_escape_string(trim($_GET["query"]));
$query = mysql_real_escape_string(trim($_GET["query"] ?? ''));
if($query){
$wherea=" WHERE txt LIKE '%$query%' ";
$addparam = "query=".rawurlencode($query)."&";
@@ -164,21 +164,27 @@ else {
searchtable($lang_log['text_search_chronicle'], 'chronicle');
if (get_user_class() >= $chrmanage_class)
additem($lang_log['text_add_chronicle'], 'chronicle');
if ($_GET['do'] == "del" || $_GET['do'] == 'edit' || $_POST['do'] == "add" || $_POST['do'] == "update") {
$txt = $_POST['txt'];
if (
(isset($_GET['do']) && $_GET['do'] == "del")
|| (isset($_GET['do'] ) && $_GET['do'] == 'edit')
|| (isset($_POST['do']) && $_POST['do'] == "add")
|| (isset($_POST['do']) && $_POST['do'] == "update")
)
{
$txt = $_POST['txt'] ?? '';
if (get_user_class() < $chrmanage_class)
permissiondeny();
elseif ($_POST['do'] == "add")
elseif (isset($_POST['do']) && $_POST['do'] == "add")
sql_query ("INSERT INTO chronicle (userid,added, txt) VALUES ('".$CURUSER["id"]."', now(), ".sqlesc($txt).")") or sqlerr(__FILE__, __LINE__);
elseif ($_POST['do'] == "update"){
elseif (isset($_POST['do'] ) && $_POST['do'] == "update"){
$id = 0 + $_POST['id'];
if (!$id) { header("Location: log.php?action=chronicle"); die();}
else sql_query ("UPDATE chronicle SET txt=".sqlesc($txt)." WHERE id=".$id) or sqlerr(__FILE__, __LINE__);}
else {$id = 0 + $_GET['id'];
else {$id = 0 + ($_GET['id'] ?? 0);
if (!$id) { header("Location: log.php?action=chronicle"); die();}
elseif ($_GET['do'] == "del")
sql_query ("DELETE FROM chronicle where id = '".$id."'") or sqlerr(__FILE__, __LINE__);
elseif ($_GET['do'] == "edit")
elseif (isset($_GET['do']) && $_GET['do'] == "edit")
edititem($lang_log['text_edit_chronicle'],'chronicle', $id);
}
}
@@ -203,7 +209,7 @@ else {
while ($arr = mysql_fetch_assoc($res))
{
$date = gettime($arr['added'],true,false);
print("<tr><td class=rowfollow align=center><nobr>$date</nobr></td><td class=rowfollow align=left>".format_comment($arr["txt"],true,false,true)."</td>".(get_user_class() >= $chrmanage_class ? "<td align=center nowrap><b><a href=\"".$PHP_SELF."?action=chronicle&do=edit&id=".$arr["id"]."\">".$lang_log['text_edit']."</a>&nbsp;|&nbsp;<a href=\"".$PHP_SELF."?action=chronicle&do=del&id=".$arr["id"]."\"><font color=red>".$lang_log['text_delete']."</font></a></b></td>" : "")."</tr>\n");
print("<tr><td class=rowfollow align=center><nobr>$date</nobr></td><td class=rowfollow align=left>".format_comment($arr["txt"],true,false,true)."</td>".(get_user_class() >= $chrmanage_class ? "<td align=center nowrap><b><a href=\"".$_SERVER['PHP_SELF']."?action=chronicle&do=edit&id=".$arr["id"]."\">".$lang_log['text_edit']."</a>&nbsp;|&nbsp;<a href=\"".$_SERVER['PHP_SELF']."?action=chronicle&do=del&id=".$arr["id"]."\"><font color=red>".$lang_log['text_delete']."</font></a></b></td>" : "")."</tr>\n");
}
print("</table>");
echo $pagerbottom;
@@ -261,8 +267,8 @@ else {
break;
case "news":
stdhead($lang_log['head_news']);
$query = mysql_real_escape_string(trim($_GET["query"]));
$search = $_GET["search"];
$query = mysql_real_escape_string(trim($_GET["query"] ?? ''));
$search = $_GET["search"] ?? '';
if($query){
switch ($search){
case "title": $wherea=" WHERE title LIKE '%$query%' "; break;
@@ -276,7 +282,7 @@ else {
$addparam = "";
}
logmenu("news");
$opt = array (title => $lang_log['text_title'], body => $lang_log['text_body'], both => $lang_log['text_both']);
$opt = array ('title' => $lang_log['text_title'], 'body' => $lang_log['text_body'], 'both' => $lang_log['text_both']);
searchtable($lang_log['text_search_news'], 'news', $opt);
$res = sql_query("SELECT COUNT(*) FROM news".$wherea);
@@ -308,9 +314,9 @@ else {
die;
break;
case "poll":
$do = $_GET["do"];
$pollid = $_GET["pollid"];
$returnto = htmlspecialchars($_GET["returnto"]);
$do = $_GET["do"] ?? '';
$pollid = $_GET["pollid"] ?? 0;
$returnto = htmlspecialchars($_GET["returnto"] ?? '');
if ($do == "delete")
{
if (get_user_class() < $chrmanage_class)

View File

@@ -9,10 +9,10 @@ define('PM_DELETED',0); // Message was deleted
define('PM_INBOX',1); // Message located in Inbox for reciever
define('PM_SENTBOX',-1); // GET value for sent box
// Determine action
$action = (string) $_GET['action'];
$action = $_GET['action'] ?? '';
if (!$action)
{
$action = (string) $_POST['action'];
$action = $_POST['action'] ?? '';
if (!$action)
$action = 'viewmailbox';
}
@@ -21,7 +21,7 @@ if (!$action)
if ($action == "viewmailbox")
{
// Get Mailbox Number
$mailbox = (int) $_GET['box'];
$mailbox = $_GET['box'] ?? 0;
if (!$mailbox)
$mailbox = PM_INBOX;
@@ -58,8 +58,8 @@ stdhead($mailbox_name);
<?php
//search
$keyword = mysql_real_escape_string(trim($_GET["keyword"]));
$place = $_GET["place"];
$keyword = mysql_real_escape_string(trim($_GET["keyword"] ?? ''));
$place = $_GET["place"] ?? '';
if($keyword)
switch ($place){
case "body": $wherea=" AND msg LIKE '%$keyword%' "; break;
@@ -69,7 +69,7 @@ stdhead($mailbox_name);
}
else
$wherea="";
$unread=$_GET["unread"];
$unread=$_GET["unread"] ?? '';
if ($unread)
switch ($unread){
case "yes": $wherea.=" AND unread = 'yes' "; break;
@@ -674,10 +674,10 @@ function insertJumpTo($selected = 0)
global $lang_messages;
global $CURUSER;
$res = sql_query('SELECT * FROM pmboxes WHERE userid=' . sqlesc($CURUSER['id']) . ' ORDER BY boxnumber');
$place = $_GET['place'];
$place = $_GET['place'] ?? '';
?>
<form action="messages.php" method="get">
<input type="hidden" name="action" value="viewmailbox"><?php echo $lang_messages['text_search'] ?>&nbsp;&nbsp;<input id="searchinput" name="keyword" type="text" value="<?php echo $_GET['keyword']?>" style="width: 200px"/>
<input type="hidden" name="action" value="viewmailbox"><?php echo $lang_messages['text_search'] ?>&nbsp;&nbsp;<input id="searchinput" name="keyword" type="text" value="<?php echo $_GET['keyword'] ?? ''?>" style="width: 200px"/>
<?php echo $lang_messages['text_in'] ?>&nbsp;<select name="place">
<option value="both" <?php echo ($place == 'both' ? " selected" : "")?>><?php echo $lang_messages['select_both'] ?></option>
<option value="title" <?php echo ($place == 'title' ? " selected" : "")?>><?php echo $lang_messages['select_title'] ?></option>

View File

@@ -96,8 +96,8 @@ function bonusarray($option){
if ($bonus_tweak == "disable" || $bonus_tweak == "disablesave")
stderr($lang_mybonus['std_sorry'],$lang_mybonus['std_karma_system_disabled'].($bonus_tweak == "disablesave" ? "<b>".$lang_mybonus['std_points_active']."</b>" : ""),false);
$action = htmlspecialchars($_GET['action']);
$do = htmlspecialchars($_GET['do']);
$action = htmlspecialchars($_GET['action'] ?? '');
$do = htmlspecialchars($_GET['do'] ?? null);
unset($msg);
if (isset($do)) {
if ($do == "upload")

View File

@@ -15,20 +15,20 @@ function bark($msg) {
exit;
}
if ($_GET["category"]){
if (isset($_GET['category']) && $_GET["category"]){
$categ = isset($_GET['category']) ? (int)$_GET['category'] : 0;
if(!is_valid_id($categ))
stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']);
}
if ($_GET["id"]){
if (isset($_GET['id']) && $_GET["id"]){
$id = 0 + htmlspecialchars($_GET["id"]);
if (preg_match('/^[0-9]+$/', !$id))
stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']);
}
//==== add offer
if ($_GET["add_offer"]){
if (isset($_GET['add_offer']) && $_GET["add_offer"]){
if (get_user_class() < $addoffer_class)
permissiondenied();
$add_offer = 0 + $_GET["add_offer"];
@@ -60,7 +60,7 @@ if ($_GET["add_offer"]){
//=== end add offer
//=== take new offer
if ($_GET["new_offer"]){
if (isset($_GET['new_offer']) && $_GET["new_offer"]){
if (get_user_class() < $addoffer_class)
permissiondenied();
$new_offer = 0 + $_GET["new_offer"];
@@ -125,7 +125,7 @@ if ($_GET["new_offer"]){
//==end take new offer
//=== offer details
if ($_GET["off_details"]){
if (isset($_GET['off_details']) && $_GET["off_details"]){
$off_details = 0 + $_GET["off_details"];
if($off_details != '1')
@@ -233,7 +233,7 @@ if ($_GET["off_details"]){
}
//=== end offer details
//=== allow offer by staff
if ($_GET["allow_offer"]) {
if (isset($_GET["allow_offer"]) && $_GET["allow_offer"]) {
if (get_user_class() < $offermanage_class)
stderr($lang_offers['std_access_denied'], $lang_offers['std_mans_job']);
@@ -268,7 +268,7 @@ if ($_GET["allow_offer"]) {
//=== end allow the offer
//=== allow offer by vote
if ($_GET["finish_offer"]) {
if (isset($_GET["finish_offer"]) && $_GET["finish_offer"]) {
if (get_user_class() < $offermanage_class)
stderr($lang_offers['std_access_denied'], $lang_offers['std_have_no_permission']);
@@ -321,7 +321,7 @@ if ($_GET["finish_offer"]) {
//=== edit offer
if ($_GET["edit_offer"]) {
if (isset($_GET["edit_offer"]) && $_GET["edit_offer"]) {
$edit_offer = 0 + $_GET["edit_offer"];
if($edit_offer != '1')
@@ -367,7 +367,7 @@ if ($_GET["edit_offer"]) {
//=== end edit offer
//==== take offer edit
if ($_GET["take_off_edit"]){
if (isset($_GET["take_off_edit"]) && $_GET["take_off_edit"]){
$take_off_edit = 0 + $_GET["take_off_edit"];
if($take_off_edit != '1')
@@ -410,7 +410,7 @@ if ($_GET["take_off_edit"]){
//======end take offer edit
//=== offer votes list
if ($_GET["offer_vote"]){
if (isset($_GET["offer_vote"]) && $_GET["offer_vote"]){
$offer_vote = 0 + $_GET["offer_vote"];
if($offer_vote != '1')
@@ -458,7 +458,7 @@ if ($_GET["offer_vote"]){
//=== end offer votes list
//=== offer votes
if ($_GET["vote"]){
if (isset($_GET["vote"]) && $_GET["vote"]){
$offerid = 0 + htmlspecialchars($_GET["id"]);
$vote = htmlspecialchars($_GET["vote"]);
if ($vote == 'against' && get_user_class() < $againstoffer_class)
@@ -530,7 +530,7 @@ if ($_GET["vote"]){
//=== end offer votes
//=== delete offer
if ($_GET["del_offer"]){
if (isset($_GET["del_offer"]) && $_GET["del_offer"]){
$del_offer = 0 + $_GET["del_offer"];
if($del_offer != '1')
@@ -590,7 +590,8 @@ if ($_GET["del_offer"]){
//== end delete offer
//=== prolly not needed, but what the hell... basically stopping the page getting screwed up
if ($_GET["sort"])
$sort = '';
if (isset($_GET["sort"]) && $_GET["sort"])
{
$sort = $_GET["sort"];
if($sort == 'cat' || $sort == 'name' || $sort == 'added' || $sort == 'comments' || $sort == 'yeah' || $sort == 'against' || $sort == 'v_res')
@@ -600,15 +601,15 @@ if ($_GET["sort"])
}
//=== end of prolly not needed, but what the hell :P
$categ = 0 + $_GET["category"];
if ($_GET["offerorid"]){
$categ = $_GET["category"] ?? 0;
$offerorid = 0;
if (isset($_GET["offerorid"]) && $_GET["offerorid"]){
$offerorid = 0 + htmlspecialchars($_GET["offerorid"]);
if (preg_match("/^[0-9]+$/", !$offerorid))
stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']);
}
$search = ($_GET["search"]);
$search = ($_GET["search"] ?? '');
if ($search) {
$search = " AND offers.name like ".sqlesc("%$search%");
@@ -684,7 +685,7 @@ $count = $row[0];
$perpage = 25;
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER["PHP_SELF"] ."?" . "category=" . $_GET["category"] . "&sort=" . $_GET["sort"] . "&" );
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER["PHP_SELF"] ."?" . "category=" . ($_GET["category"] ?? '') . "&sort=" . ($_GET["sort"] ?? '') . "&" );
//stderr("", $sort);
if($sort == "")

View File

@@ -19,7 +19,7 @@ if (!$is_rulelang){
}
$res = sql_query("SELECT * FROM rules WHERE lang_id = ".sqlesc($lang_id)." ORDER BY id");
while ($arr=mysql_fetch_assoc($res)){
begin_frame($arr[title], false);
begin_frame($arr['title'], false);
print(format_comment($arr["text"]));
end_frame();
}

View File

@@ -264,10 +264,10 @@ elseif ($action == 'smtpsettings') // stmp settings
tr($lang_settings['row_smtp_sendmail_path'], $lang_settings['text_smtp_sendmail_path_note'], 1);
print("</tbody><tbody id=\"smtp_external\"".($SMTP['smtptype'] == "external" ? "" : " style=\"display: none;\"").">");
print("<tr><td colspan=2 align=center><b>".$lang_settings['text_setting_for_external_type']."</b></td></tr>");
tr($lang_settings['row_outgoing_mail_address'], "<input type=text name=smtpaddress style=\"width: 300px\" ".($SMTP['smtpaddress'] ? "value=\"".$SMTP['smtpaddress']."\"" : "")."> ".$lang_settings['text_outgoing_mail_address_note'], 1);
tr($lang_settings['row_outgoing_mail_port'], "<input type=text name=smtpport style=\"width: 300px\" ".($SMTP['smtpport'] ? "value=\"".$SMTP['smtpport']."\"" : "")."> ".$lang_settings['text_outgoing_mail_port_note'], 1);
tr($lang_settings['row_smtp_account_name'], "<input type=text name=accountname style=\"width: 300px\" ".($SMTP['accountname'] ? "value=\"".$SMTP['accountname']."\"" : "")."> ".$lang_settings['text_smtp_account_name_note'], 1);
tr($lang_settings['row_smtp_account_password'], "<input type=password name=accountpassword style=\"width: 300px\" ".($SMTP['accountpassword'] ? "value=\"".$SMTP['accountpassword']."\"" : "")."> ".$lang_settings['text_smtp_account_password_note'], 1);
tr($lang_settings['row_outgoing_mail_address'], "<input type=text name=smtpaddress style=\"width: 300px\" ".(!empty($SMTP['smtpaddress']) ? "value=\"".$SMTP['smtpaddress']."\"" : "")."> ".$lang_settings['text_outgoing_mail_address_note'], 1);
tr($lang_settings['row_outgoing_mail_port'], "<input type=text name=smtpport style=\"width: 300px\" ".(!empty($SMTP['smtpport']) ? "value=\"".$SMTP['smtpport']."\"" : "")."> ".$lang_settings['text_outgoing_mail_port_note'], 1);
tr($lang_settings['row_smtp_account_name'], "<input type=text name=accountname style=\"width: 300px\" ".(!empty($SMTP['accountname']) ? "value=\"".$SMTP['accountname']."\"" : "")."> ".$lang_settings['text_smtp_account_name_note'], 1);
tr($lang_settings['row_smtp_account_password'], "<input type=password name=accountpassword style=\"width: 300px\" ".(!empty($SMTP['accountpassword']) ? "value=\"".$SMTP['accountpassword']."\"" : "")."> ".$lang_settings['text_smtp_account_password_note'], 1);
print("</tbody><tbody>");
tr($lang_settings['row_save_settings'],"<input type='submit' name='save' value='".$lang_settings['submit_save_settings']."'>", 1);
print ("<tr><td colspan=2 align=center>".$lang_settings['text_mail_test_note']."<a href=\"mailtest.php\" target=\"_blank\"><b>".$lang_settings['text_here']."</b></a></td></tr>");
@@ -312,7 +312,7 @@ elseif ($action == 'authoritysettings') //Authority settings
tr($lang_settings['row_view_userlist'], $lang_settings['text_minimum_class'].classlist('viewuserlist',$maxclass,$AUTHORITY['viewuserlist']).$lang_settings['text_default'].get_user_class_name(UC_POWER_USER,false,true,true).$lang_settings['text_view_userlist_note'],1);
tr($lang_settings['row_torrent_management'], $lang_settings['text_minimum_class'].classlist('torrentmanage',$maxclass,$AUTHORITY['torrentmanage']).$lang_settings['text_default'].get_user_class_name(UC_MODERATOR,false,true,true).$lang_settings['text_torrent_management_note'], 1);
tr($lang_settings['row_torrent_sticky'], $lang_settings['text_minimum_class'].classlist('torrentsticky',$maxclass,$AUTHORITY['torrentsticky']).$lang_settings['text_default'].get_user_class_name(UC_ADMINISTRATOR,false,true,true).$lang_settings['text_torrent_sticky_note'],1);
tr($lang_settings['row_torrent_on_promotion'], $lang_settings['text_minimum_class'].classlist('torrentonpromotion',$maxclass,$AUTHORITY['torrentonpromotion']).$lang_settings['text_default'].get_user_class_name(UC_ADMINISTRATOR,false,true,true).$lang_settings['text_torrent_promotion_note'],1);
tr($lang_settings['row_torrent_on_promotion'], $lang_settings['text_minimum_class'].classlist('torrentonpromotion',$maxclass,$AUTHORITY['torrentonpromotion'] ?? '').$lang_settings['text_default'].get_user_class_name(UC_ADMINISTRATOR,false,true,true).$lang_settings['text_torrent_promotion_note'],1);
tr($lang_settings['row_ask_for_reseed'], $lang_settings['text_minimum_class'].classlist('askreseed',$maxclass,$AUTHORITY['askreseed']).$lang_settings['text_default'].get_user_class_name(UC_POWER_USER,false,true,true).$lang_settings['text_ask_for_reseed_note'],1);
tr($lang_settings['row_view_nfo'], $lang_settings['text_minimum_class'].classlist('viewnfo',$maxclass,$AUTHORITY['viewnfo']).$lang_settings['text_default'].get_user_class_name(UC_POWER_USER,false,true,true).$lang_settings['text_view_nfo_note'],1);
tr($lang_settings['row_view_torrent_structure'], $lang_settings['text_minimum_class'].classlist('torrentstructure',$maxclass,$AUTHORITY['torrentstructure']).$lang_settings['text_default'].get_user_class_name(UC_ULTIMATE_USER,false,true,true).$lang_settings['text_view_torrent_structure_note'],1);
@@ -404,7 +404,7 @@ elseif ($action == 'codesettings') // code settings
tr($lang_settings['row_main_version'],"<input type='text' style=\"width: 300px\" name=mainversion value='".($CODE["mainversion"] ? $CODE["mainversion"] : PROJECTNAME." PHP")."'> ".$lang_settings['text_main_version_note'], 1);
tr($lang_settings['row_sub_version'],"<input type='text' style=\"width: 300px\" name=subversion value='".($CODE["subversion"] ? $CODE["subversion"] : "1.0")."'> ".$lang_settings['text_sub_version_note'], 1);
tr($lang_settings['row_release_date'],"<input type='text' style=\"width: 300px\" name=releasedate value='".($CODE["releasedate"] ? $CODE["releasedate"] : "2008-12-10")."'> ".$lang_settings['text_release_date_note'], 1);
tr($lang_settings['row_web_site'],"<input type='text' style=\"width: 300px\" name=website value='".($CODE["website"] ? $CODE["website"] : "")."'> ".$lang_settings['text_web_site_note_one'].PROJECTNAME.$lang_settings['text_web_site_note_two'], 1);
tr($lang_settings['row_web_site'],"<input type='text' style=\"width: 300px\" name=website value='".($CODE["website"] ? $CODE["website"] : "")."'> ".($lang_settings['text_web_site_note_one'] ?? '').PROJECTNAME.$lang_settings['text_web_site_note_two'], 1);
tr($lang_settings['row_save_settings'],"<input type='submit' name='save' value='".$lang_settings['submit_save_settings']."'>", 1);
print ("</form>");
}
@@ -558,6 +558,7 @@ elseif ($action == 'mainsettings') // main settings
tr($lang_settings['row_external_forum_url'],"<input type='text' style=\"width: 300px\" name=extforumurl value='".($MAIN["extforumurl"] ? $MAIN["extforumurl"] : "")."'> ".$lang_settings['text_external_forum_url_note'], 1);
$res = sql_query("SELECT id, name FROM searchbox") or sqlerr(__FILE__, __LINE__);
$catlist = "";
$bcatlist = $scatlist = '';
while($array = mysql_fetch_array($res)){
$bcatlist .= "<input type=radio name=browsecat value='".$array['id']."'".($MAIN["browsecat"] == $array['id'] ? " checked" : "").">".$array['name']."&nbsp;";
$scatlist .= "<input type=radio name=specialcat value='".$array['id']."'".($MAIN["specialcat"] == $array['id'] ? " checked" : "").">".$array['name']."&nbsp;";

View File

@@ -59,8 +59,8 @@ countdown(time);
</head>
<body class='inframe' <?php if ($_GET["type"] != "helpbox"){?> onload="<?php echo $startcountdown?>" <?php } else {?> onload="hbquota()" <?php } ?>>
<?php
if($_GET["sent"]=="yes"){
if(!$_GET["shbox_text"])
if(isset($_GET["sent"]) && $_GET["sent"]=="yes"){
if(!isset($_GET["shbox_text"]) || !$_GET['shbox_text'])
{
$userid=0+$CURUSER["id"];
}

View File

@@ -15,7 +15,7 @@ $onlineimg = "<img class=\"button_online\" src=\"pic/trans.gif\" alt=\"online\"
$offlineimg = "<img class=\"button_offline\" src=\"pic/trans.gif\" alt=\"offline\" title=\"".$lang_staff['title_offline']."\" />";
$sendpmimg = "<img class=\"button_pm\" src=\"pic/trans.gif\" alt=\"pm\" />";
//--------------------- FIRST LINE SUPPORT SECTION ---------------------------//
unset($ppl);
$ppl = '';
$res = sql_query("SELECT * FROM users WHERE users.support='yes' AND users.status='confirmed' ORDER BY users.username") or sqlerr();
while ($arr = mysql_fetch_assoc($res))
{
@@ -53,7 +53,7 @@ end_frame();
//--------------------- FIRST LINE SUPPORT SECTION ---------------------------//
//--------------------- film critics section ---------------------------//
unset($ppl);
$ppl = '';
$res = sql_query("SELECT * FROM users WHERE users.picker='yes' AND users.status='confirmed' ORDER BY users.username") or sqlerr();
while ($arr = mysql_fetch_assoc($res))
{
@@ -89,7 +89,7 @@ end_frame();
//--------------------- film critics section ---------------------------//
//--------------------- forum moderators section ---------------------------//
unset($ppl);
$ppl = '';
$res = sql_query("SELECT forummods.userid AS userid, users.last_access, users.country FROM forummods LEFT JOIN users ON forummods.userid = users.id GROUP BY userid ORDER BY forummods.forumid, forummods.userid") or sqlerr();
while ($arr = mysql_fetch_assoc($res))
{
@@ -131,8 +131,9 @@ end_frame();
//--------------------- film critics section ---------------------------//
//--------------------- general staff section ---------------------------//
unset($ppl);
$ppl = '';
$res = sql_query("SELECT * FROM users WHERE class > ".UC_VIP." AND status='confirmed' ORDER BY class DESC, username") or sqlerr();
$curr_class = '';
while ($arr = mysql_fetch_assoc($res))
{
if($curr_class != $arr['class'])
@@ -172,7 +173,7 @@ end_frame();
//--------------------- VIP section ---------------------------//
unset($ppl);
$ppl = '';
$res = sql_query("SELECT * FROM users WHERE class=".UC_VIP." AND status='confirmed' ORDER BY username") or sqlerr();
while ($arr = mysql_fetch_assoc($res))
{

View File

@@ -10,9 +10,9 @@ if (!isset($CURUSER))
stdhead($lang_subtitles['head_subtitles']);
$in_detail = $_POST['in_detail'];
$detail_torrent_id = $_POST['detail_torrent_id'];
$torrent_name = $_POST['torrent_name'];
$in_detail = $_POST['in_detail'] ?? '';
$detail_torrent_id = $_POST['detail_torrent_id'] ?? 0;
$torrent_name = $_POST['torrent_name'] ?? '';
function isInteger($n)
{
@@ -23,15 +23,15 @@ function isInteger($n)
return true;
}
$act = (int)$_GET["act"];
$search = trim($_GET['search']);
$letter = trim($_GET["letter"]);
$act = $_GET["act"] ?? 0;
$search = trim($_GET['search'] ?? '');
$letter = trim($_GET["letter"] ?? '');
if (strlen($letter) > 1)
die;
if ($letter == "" || strpos("abcdefghijklmnopqrstuvwxyz", $letter) === false)
$letter = "";
$lang_id = $_GET['lang_id'];
$lang_id = $_GET['lang_id'] ?? 0;
if (!is_valid_id($lang_id))
$lang_id = '';
@@ -197,7 +197,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "upload" && ($in
if (get_user_class() >= $delownsub_class)
{
$delete = $_GET["delete"];
$delete = $_GET["delete"] ?? 0;
if (is_valid_id($delete))
{
$r = sql_query("SELECT id,torrent_id,ext,lang_id,title,filename,uppedby,anonymous FROM subs WHERE id=".sqlesc($delete)) or sqlerr(__FILE__, __LINE__);

View File

@@ -30,16 +30,16 @@ if ($showsubcat){
if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
}
$searchstr_ori = htmlspecialchars(trim($_GET["search"]));
$searchstr = mysql_real_escape_string(trim($_GET["search"]));
$searchstr_ori = htmlspecialchars(trim($_GET["search"] ?? ''));
$searchstr = mysql_real_escape_string(trim($_GET["search"] ?? ''));
if (empty($searchstr))
unset($searchstr);
// sorting by MarkoStamcar
if ($_GET['sort'] && $_GET['type']) {
$column = '';
$ascdesc = '';
if (isset($_GET['sort']) && $_GET['sort'] && isset($_GET['type']) && $_GET['type']) {
$column = '';
$ascdesc = '';
switch($_GET['sort']) {
case '1': $column = "name"; break;
@@ -172,7 +172,7 @@ elseif ($include_dead == 2) //dead
}
// ----------------- end include dead ---------------------//
if ($_GET)
$special_state = 0 + $_GET["spstate"];
$special_state = $_GET["spstate"] ?? 0;
elseif ($CURUSER['notifs']){
if (strpos($CURUSER['notifs'], "[spstate=0]") !== false)
$special_state = 0;
@@ -291,18 +291,19 @@ elseif ($special_state == 7) //30% down
}
}
$category_get = 0 + $_GET["cat"];
$category_get = $_GET["cat"] ?? 0;
$source_get = $medium_get = $codec_get = $standard_get = $processing_get = $team_get = $audiocodec_get = 0;
if ($showsubcat){
if ($showsource) $source_get = 0 + $_GET["source"];
if ($showmedium) $medium_get = 0 + $_GET["medium"];
if ($showcodec) $codec_get = 0 + $_GET["codec"];
if ($showstandard) $standard_get = 0 + $_GET["standard"];
if ($showprocessing) $processing_get = 0 + $_GET["processing"];
if ($showteam) $team_get = 0 + $_GET["team"];
if ($showaudiocodec) $audiocodec_get = 0 + $_GET["audiocodec"];
if ($showsource) $source_get = $_GET["source"] ?? 0;
if ($showmedium) $medium_get = $_GET["medium"] ?? 0;
if ($showcodec) $codec_get = $_GET["codec"] ?? 0;
if ($showstandard) $standard_get = $_GET["standard"] ?? 0;
if ($showprocessing) $processing_get = $_GET["processing"] ?? 0;
if ($showteam) $team_get = $_GET["team"] ?? 0;
if ($showaudiocodec) $audiocodec_get = $_GET["audiocodec"] ?? 0;
}
$all = 0 + $_GET["all"];
$all = $_GET["all"] ?? 0;
if (!$all)
{
@@ -311,7 +312,7 @@ if (!$all)
$all = true;
foreach ($cats as $cat)
{
$all &= $cat[id];
$all &= $cat['id'];
$mystring = $CURUSER['notifs'];
$findme = '[cat'.$cat['id'].']';
$search = strpos($mystring, $findme);
@@ -322,7 +323,7 @@ if (!$all)
if ($catcheck)
{
$wherecatina[] = $cat[id];
$wherecatina[] = $cat['id'];
$addparam .= "cat$cat[id]=1&";
}
}
@@ -330,7 +331,7 @@ if (!$all)
if ($showsource)
foreach ($sources as $source)
{
$all &= $source[id];
$all &= $source['id'];
$mystring = $CURUSER['notifs'];
$findme = '[sou'.$source['id'].']';
$search = strpos($mystring, $findme);
@@ -341,14 +342,14 @@ if (!$all)
if ($sourcecheck)
{
$wheresourceina[] = $source[id];
$addparam .= "source$source[id]=1&";
$wheresourceina[] = $source['id'];
$addparam .= "source{$source['id']}=1&";
}
}
if ($showmedium)
foreach ($media as $medium)
{
$all &= $medium[id];
$all &= $medium['id'];
$mystring = $CURUSER['notifs'];
$findme = '[med'.$medium['id'].']';
$search = strpos($mystring, $findme);
@@ -359,14 +360,14 @@ if (!$all)
if ($mediumcheck)
{
$wheremediumina[] = $medium[id];
$addparam .= "medium$medium[id]=1&";
$wheremediumina[] = $medium['id'];
$addparam .= "medium{$medium['id']}=1&";
}
}
if ($showcodec)
foreach ($codecs as $codec)
{
$all &= $codec[id];
$all &= $codec['id'];
$mystring = $CURUSER['notifs'];
$findme = '[cod'.$codec['id'].']';
$search = strpos($mystring, $findme);
@@ -377,14 +378,14 @@ if (!$all)
if ($codeccheck)
{
$wherecodecina[] = $codec[id];
$addparam .= "codec$codec[id]=1&";
$wherecodecina[] = $codec['id'];
$addparam .= "codec{$codec['id']}=1&";
}
}
if ($showstandard)
foreach ($standards as $standard)
{
$all &= $standard[id];
$all &= $standard['id'];
$mystring = $CURUSER['notifs'];
$findme = '[sta'.$standard['id'].']';
$search = strpos($mystring, $findme);
@@ -395,14 +396,14 @@ if (!$all)
if ($standardcheck)
{
$wherestandardina[] = $standard[id];
$addparam .= "standard$standard[id]=1&";
$wherestandardina[] = $standard['id'];
$addparam .= "standard{$standard['id']}=1&";
}
}
if ($showprocessing)
foreach ($processings as $processing)
{
$all &= $processing[id];
$all &= $processing['id'];
$mystring = $CURUSER['notifs'];
$findme = '[pro'.$processing['id'].']';
$search = strpos($mystring, $findme);
@@ -413,14 +414,14 @@ if (!$all)
if ($processingcheck)
{
$whereprocessingina[] = $processing[id];
$addparam .= "processing$processing[id]=1&";
$whereprocessingina[] = $processing['id'];
$addparam .= "processing{$processing['id']}=1&";
}
}
if ($showteam)
foreach ($teams as $team)
{
$all &= $team[id];
$all &= $team['id'];
$mystring = $CURUSER['notifs'];
$findme = '[tea'.$team['id'].']';
$search = strpos($mystring, $findme);
@@ -431,14 +432,14 @@ if (!$all)
if ($teamcheck)
{
$whereteamina[] = $team[id];
$addparam .= "team$team[id]=1&";
$whereteamina[] = $team['id'];
$addparam .= "team{$team['id']}=1&";
}
}
if ($showaudiocodec)
foreach ($audiocodecs as $audiocodec)
{
$all &= $audiocodec[id];
$all &= $audiocodec['id'];
$mystring = $CURUSER['notifs'];
$findme = '[aud'.$audiocodec['id'].']';
$search = strpos($mystring, $findme);
@@ -449,8 +450,8 @@ if (!$all)
if ($audiocodeccheck)
{
$whereaudiocodecina[] = $audiocodec[id];
$addparam .= "audiocodec$audiocodec[id]=1&";
$whereaudiocodecina[] = $audiocodec['id'];
$addparam .= "audiocodec{$audiocodec['id']}=1&";
}
}
}
@@ -509,82 +510,90 @@ if (!$all)
$all = True;
foreach ($cats as $cat)
{
$all &= $_GET["cat$cat[id]"];
if ($_GET["cat$cat[id]"])
$__is = (isset($_GET["cat{$cat['id']}"]) && $_GET["cat{$cat['id']}"]);
$all &= $__is;
if ($__is)
{
$wherecatina[] = $cat[id];
$addparam .= "cat$cat[id]=1&";
$wherecatina[] = $cat['id'];
$addparam .= "cat{$cat['id']}=1&";
}
}
if ($showsubcat){
if ($showsource)
foreach ($sources as $source)
{
$all &= $_GET["source$source[id]"];
if ($_GET["source$source[id]"])
$__is = (isset($_GET["source{$source['id']}"]) && $_GET["source{$source['id']}"]);
$all &= $__is;
if ($__is)
{
$wheresourceina[] = $source[id];
$addparam .= "source$source[id]=1&";
$wheresourceina[] = $source['id'];
$addparam .= "source{$source['id']}=1&";
}
}
if ($showmedium)
foreach ($media as $medium)
{
$all &= $_GET["medium$medium[id]"];
if ($_GET["medium$medium[id]"])
$__is = (isset($_GET["medium{$medium['id']}"]) && $_GET["medium{$medium['id']}"]);
$all &= $__is;
if ($__is)
{
$wheremediumina[] = $medium[id];
$addparam .= "medium$medium[id]=1&";
$wheremediumina[] = $medium['id'];
$addparam .= "medium{$medium['id']}=1&";
}
}
if ($showcodec)
foreach ($codecs as $codec)
{
$all &= $_GET["codec$codec[id]"];
if ($_GET["codec$codec[id]"])
$__is = (isset($_GET["codec{$codec['id']}"]) && $_GET["codec{$codec['id']}"]);
$all &= $__is;
if ($__is)
{
$wherecodecina[] = $codec[id];
$addparam .= "codec$codec[id]=1&";
$wherecodecina[] = $codec['id'];
$addparam .= "codec{$codec['id']}=1&";
}
}
if ($showstandard)
foreach ($standards as $standard)
{
$all &= $_GET["standard$standard[id]"];
if ($_GET["standard$standard[id]"])
$__is = (isset($_GET["standard{$standard['id']}"]) && $_GET["standard{$standard['id']}"]);
$all &= $__is;
if ($__is)
{
$wherestandardina[] = $standard[id];
$addparam .= "standard$standard[id]=1&";
$wherestandardina[] = $standard['id'];
$addparam .= "standard{$standard['id']}=1&";
}
}
if ($showprocessing)
foreach ($processings as $processing)
{
$all &= $_GET["processing$processing[id]"];
if ($_GET["processing$processing[id]"])
$__is = (isset($_GET["processing{$processing['id']}"]) && $_GET["processing{$processing['id']}"]);
$all &= $__is;
if ($__is)
{
$whereprocessingina[] = $processing[id];
$addparam .= "processing$processing[id]=1&";
$whereprocessingina[] = $processing['id'];
$addparam .= "processing{$processing['id']}=1&";
}
}
if ($showteam)
foreach ($teams as $team)
{
$all &= $_GET["team$team[id]"];
if ($_GET["team$team[id]"])
$__is = (isset($_GET["team{$team['id']}"]) && $_GET["team{$team['id']}"]);
$all &= $__is;
if ($__is)
{
$whereteamina[] = $team[id];
$addparam .= "team$team[id]=1&";
$whereteamina[] = $team['id'];
$addparam .= "team{$team['id']}=1&";
}
}
if ($showaudiocodec)
foreach ($audiocodecs as $audiocodec)
{
$all &= $_GET["audiocodec$audiocodec[id]"];
if ($_GET["audiocodec$audiocodec[id]"])
$__is = (isset($_GET["audiocodec{$audiocodec['id']}"]) && $_GET["audiocodec{$audiocodec['id']}"]);
$all &= $__is;
if ($__is)
{
$whereaudiocodecina[] = $audiocodec[id];
$addparam .= "audiocodec$audiocodec[id]=1&";
$whereaudiocodecina[] = $audiocodec['id'];
$addparam .= "audiocodec{$audiocodec['id']}=1&";
}
}
}
@@ -606,7 +615,7 @@ if ($all)
$addparam .= "";
}
//stderr("", count($wherecatina)."-". count($wheresourceina));
$wherecatin = $wheresourcein = $wheremediumin = $wherecodecin = $wherestandardin = $whereprocessingin = $whereteamin = $whereaudiocodecin = '';
if (count($wherecatina) > 1)
$wherecatin = implode(",",$wherecatina);
elseif (count($wherecatina) == 1)
@@ -656,7 +665,7 @@ elseif (count($whereaudiocodecina) == 1)
$wherea[] = "audiocodec = $whereaudiocodecina[0]";}
$wherebase = $wherea;
$search_area = 0;
if (isset($searchstr))
{
if (!$_GET['notnewword']){
@@ -673,7 +682,7 @@ if (isset($searchstr))
write_log("User " . $CURUSER["username"] . "," . $CURUSER["ip"] . " is hacking search_mode field in" . $_SERVER['SCRIPT_NAME'], 'mod');
}
$search_area = 0 + $_GET["search_area"];
$search_area = $_GET["search_area"] ?? 0 ;
if ($search_area == 4) {
$searchstr = (int)parse_imdb_id($searchstr);
@@ -829,7 +838,7 @@ if ($count)
{
if ($pagerlink != "")
{
if ($addparam{strlen($addparam)-1} != ";")
if ($addparam[strlen($addparam)-1] != ";")
{ // & = &amp;
$addparam = $addparam . "&" . $pagerlink;
}
@@ -888,7 +897,7 @@ if ($allsec != 1 || $enablespecial != 'yes'){ //do not print searchbox if showin
if ($i && $i % $catsperrow == 0){
print("</tr><tr>");
}
print("<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px; padding-left: ".$catpadding."px;\"><input type=\"checkbox\" id=\"".$cbname.$list[id]."\" name=\"".$cbname.$list[id]."\"" . (in_array($list[id],$wherelistina) ? " checked=\"checked\"" : "") . " value=\"1\" />".($showimg ? return_category_image($list[id], "?") : "<a title=\"" .$list[name] . "\" href=\"?".$cbname."=".$list[id]."\">".$list[name]."</a>")."</td>\n");
print("<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px; padding-left: ".$catpadding."px;\"><input type=\"checkbox\" id=\"".$cbname.$list['id']."\" name=\"".$cbname.$list['id']."\"" . (in_array($list['id'],$wherelistina) ? " checked=\"checked\"" : "") . " value=\"1\" />".($showimg ? return_category_image($list['id'], "?") : "<a title=\"" .$list['name'] . "\" href=\"?".$cbname."=".$list['id']."\">".$list['name']."</a>")."</td>\n");
$i++;
}
$checker = "<input name=\"".$btname."\" value='" . $lang_torrents['input_check_all'] . "' class=\"btn medium\" type=\"button\" onclick=\"javascript:SetChecked('".$cbname."','".$btname."','". $lang_torrents['input_check_all'] ."','" . $lang_torrents['input_uncheck_all'] . "',-1,10)\" />";
@@ -1000,7 +1009,7 @@ if ($allsec != 1 || $enablespecial != 'yes'){ //do not print searchbox if showin
<select name="search_area">
<option value="0"><?php echo $lang_torrents['select_title'] ?></option>
<option value="1"<?php print($_GET["search_area"] == 1 ? " selected=\"selected\"" : ""); ?>><?php echo $lang_torrents['select_description'] ?></option>
<option value="1"<?php print(isset($_GET["search_area"]) && $_GET["search_area"] == 1 ? " selected=\"selected\"" : ""); ?>><?php echo $lang_torrents['select_description'] ?></option>
<?php
/*if ($smalldescription_main == 'yes'){
?>
@@ -1008,16 +1017,16 @@ if ($allsec != 1 || $enablespecial != 'yes'){ //do not print searchbox if showin
<?php
}*/
?>
<option value="3"<?php print($_GET["search_area"] == 3 ? " selected=\"selected\"" : ""); ?>><?php echo $lang_torrents['select_uploader'] ?></option>
<option value="4"<?php print($_GET["search_area"] == 4 ? " selected=\"selected\"" : ""); ?>><?php echo $lang_torrents['select_imdb_url'] ?></option>
<option value="3"<?php print(isset($_GET["search_area"]) && $_GET["search_area"] == 3 ? " selected=\"selected\"" : ""); ?>><?php echo $lang_torrents['select_uploader'] ?></option>
<option value="4"<?php print(isset($_GET["search_area"]) && $_GET["search_area"] == 4 ? " selected=\"selected\"" : ""); ?>><?php echo $lang_torrents['select_imdb_url'] ?></option>
</select>
<?php echo $lang_torrents['text_with'] ?>
<select name="search_mode" style="width: 60px;">
<option value="0"><?php echo $lang_torrents['select_and'] ?></option>
<option value="1"<?php echo $_GET["search_mode"] == 1 ? " selected=\"selected\"" : "" ?>><?php echo $lang_torrents['select_or'] ?></option>
<option value="2"<?php echo $_GET["search_mode"] == 2 ? " selected=\"selected\"" : "" ?>><?php echo $lang_torrents['select_exact'] ?></option>
<option value="1"<?php echo isset($_GET["search_mode"]) && $_GET["search_mode"] == 1 ? " selected=\"selected\"" : "" ?>><?php echo $lang_torrents['select_or'] ?></option>
<option value="2"<?php echo isset($_GET["search_mode"]) && $_GET["search_mode"] == 2 ? " selected=\"selected\"" : "" ?>><?php echo $lang_torrents['select_exact'] ?></option>
</select>
<?php echo $lang_torrents['text_mode'] ?>
@@ -1060,8 +1069,10 @@ echo $Cache->next_row();
<?php
}
if ($Advertisement->enable_ad()){
$belowsearchboxad = $Advertisement->get_ad('belowsearchbox');
echo "<div align=\"center\" style=\"margin-top: 10px\" id=\"ad_belowsearchbox\">".$belowsearchboxad[0]."</div>";
$belowsearchboxad = $Advertisement->get_ad('belowsearchbox');
if (!empty($belowsearchboxad[0])) {
echo "<div align=\"center\" style=\"margin-top: 10px\" id=\"ad_belowsearchbox\">".$belowsearchboxad[0]."</div>";
}
}
if($inclbookmarked == 1)
{

View File

@@ -129,7 +129,7 @@ stdhead($lang_upload['head_upload']);
}
//==== offer dropdown for offer mod from code by S4NE
$offerres = sql_query("SELECT id, name FROM offers WHERE userid = ".sqlesc($CURUSER[id])." AND allowed = 'allowed' ORDER BY name ASC") or sqlerr(__FILE__, __LINE__);
$offerres = sql_query("SELECT id, name FROM offers WHERE userid = ".sqlesc($CURUSER['id'])." AND allowed = 'allowed' ORDER BY name ASC") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($offerres) > 0)
{
$offer = "<select name=\"offer\"><option value=\"0\">".$lang_upload['select_choose_one']."</option>";

View File

@@ -138,22 +138,23 @@ if ($action){
$countries = "<option value=0>---- ".$lang_usercp['select_none_selected']." ----</option>\n";
$ct_r = sql_query("SELECT id,name FROM countries ORDER BY name") or die;
while ($ct_a = mysql_fetch_array($ct_r))
$countries .= "<option value=".htmlspecialchars($ct_a[id])."" . (htmlspecialchars($CURUSER["country"]) == htmlspecialchars($ct_a['id']) ? " selected" : "") . ">".htmlspecialchars($ct_a[name])."</option>\n";
$countries .= "<option value=".htmlspecialchars($ct_a['id'])."" . (htmlspecialchars($CURUSER["country"]) == htmlspecialchars($ct_a['id']) ? " selected" : "") . ">".htmlspecialchars($ct_a['name'])."</option>\n";
$isplist = "<option value=0>---- ".$lang_usercp['select_none_selected']." ----</option>\n";
$isp_r = sql_query("SELECT id,name FROM isp ORDER BY id ASC") or die;
while ($isp_a = mysql_fetch_array($isp_r))
$isplist .= "<option value=".htmlspecialchars($isp_a[id])."" . (htmlspecialchars($CURUSER["isp"]) == htmlspecialchars($isp_a['id']) ? " selected" : "") . ">".htmlspecialchars($isp_a[name])."</option>\n";
$isplist .= "<option value=".htmlspecialchars($isp_a['id'])."" . (htmlspecialchars($CURUSER["isp"]) == htmlspecialchars($isp_a['id']) ? " selected" : "") . ">".htmlspecialchars($isp_a['name'])."</option>\n";
$downloadspeed = "<option value=0>---- ".$lang_usercp['select_none_selected']." ----</option>\n";
$ds_a = sql_query("SELECT id,name FROM downloadspeed ORDER BY id") or die;
while ($ds_b = mysql_fetch_array($ds_a))
$downloadspeed .= "<option value=".htmlspecialchars($ds_b[id])."" . (htmlspecialchars($CURUSER["download"]) == htmlspecialchars($ds_b['id']) ? " selected" : "") . ">".htmlspecialchars($ds_b[name])."</option>\n";
$downloadspeed .= "<option value=".htmlspecialchars($ds_b['id'])."" . (htmlspecialchars($CURUSER["download"]) == htmlspecialchars($ds_b['id']) ? " selected" : "") . ">".htmlspecialchars($ds_b['name'])."</option>\n";
$uploadspeed = "<option value=0>---- ".$lang_usercp['select_none_selected']." ----</option>\n";
$us_a = sql_query("SELECT id,name FROM uploadspeed ORDER BY id") or die;
while ($us_b = mysql_fetch_array($us_a))
$uploadspeed .= "<option value=".htmlspecialchars($us_b[id])."" . (htmlspecialchars($CURUSER["upload"]) == htmlspecialchars($us_b['id']) ? " selected" : "") . ">".htmlspecialchars($us_b[name])."</option>\n";
$uploadspeed .= "<option value=".htmlspecialchars($us_b['id'])."" . (htmlspecialchars($CURUSER["upload"]) == htmlspecialchars($us_b['id']) ? " selected" : "") . ">".htmlspecialchars($us_b['name'])."</option>\n";
$ra=sql_query("SELECT * FROM bitbucket WHERE public = '1'");
$options='';
$text = '';
while ($sor=mysql_fetch_array($ra))
{
$text.='<option value="'. get_protocol_prefix() . $BASEURL .'/bitbucket/'.$sor["name"].'">'.$sor["name"].'</option>';
@@ -179,7 +180,7 @@ if ($showschool == 'yes'){
$schools = "<option value=35>---- ".$lang_usercp['select_none_selected']." ----</option>n";
$sc_r = sql_query("SELECT id,name FROM schools ORDER BY name") or die;
while ($sc_a = mysql_fetch_array($sc_r))
$schools .= "<option value=$sc_a[id]" . ($sc_a['id'] == $CURUSER['school'] ? " selected" : "") . ">$sc_a[name]</option>n";
$schools .= "<option value={$sc_a['id']}" . ($sc_a['id'] == $CURUSER['school'] ? " selected" : "") . ">{$sc_a['name']}</option>n";
tr($lang_usercp['row_school'], "<select name=school>$schools</select>", 1);
}
tr_small($lang_usercp['row_network_bandwidth'], "<b>".$lang_usercp['text_downstream_rate']. "</b>: <select name=download>".$downloadspeed."</select>&nbsp;&nbsp;<b>".$lang_usercp['text_upstream_rate']."</b>: <select name=upload>".$uploadspeed."</select>&nbsp;&nbsp;<b>".$lang_usercp['text_isp']."</b>: <select name=isp>".$isplist."</select>",1);
@@ -222,8 +223,8 @@ tr($lang_usercp['row_school'], "<select name=school>$schools</select>", 1);
for ($i = 0; $i < $rows; ++$i)
{
$a = mysql_fetch_assoc($r);
if ($_POST[$cbname.$a[id]] == 'yes')
$return .= "[".$cbname.$a[id]."]";
if ($_POST[$cbname.$a['id']] == 'yes')
$return .= "[".$cbname.$a['id']."]";
}
return $return;
}
@@ -232,8 +233,8 @@ tr($lang_usercp['row_school'], "<select name=school>$schools</select>", 1);
for ($i = 0; $i < $rows; ++$i)
{
$a = mysql_fetch_assoc($r);
if ($_POST["cat$a[id]"] == 'yes')
$notifs .= "[cat$a[id]]";
if ($_POST["cat$a['id']"] == 'yes')
$notifs .= "[cat$a['id']]";
}*/
$notifs .= browsecheck("categories", "cat");
$notifs .= browsecheck("sources", "sou");
@@ -400,7 +401,8 @@ if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
print("<tr><td colspan=2 class=\"heading\" valign=\"top\" align=\"center\"><font color=red>".$lang_usercp['text_saved']."</font></td></tr>\n");
if ($emailnotify_smtp=='yes' && $smtptype != 'none')
tr_small($lang_usercp['row_email_notification'], "<input type=checkbox name=pmnotif" . (strpos($CURUSER['notifs'], "[pm]") !== false ? " checked" : "") . " value=yes> ".$lang_usercp['checkbox_notification_received_pm']."<br />\n<input type=checkbox name=emailnotif" . (strpos($CURUSER['notifs'], "[email]") !== false ? " checked" : "") . " value=\"yes\" /> ".$lang_usercp['checkbox_notification_default_categories'], 1);
//no this option
$brenablecatrow = false;
$categories = "<table>".($allowspecial ? "<tr><td class=embedded align=left><font class=big>".$lang_usercp['text_at_browse_page']."</font></td></tr></table><table>" : "")."<tr><td class=embedded align=left><b>".($brenablecatrow == true ? $brcatrow[0] : $lang_usercp['text_category'])."</b></td></tr><tr>";
$i = 0;
foreach ($brcats as $cat)//print category list of Torrents section
@@ -410,7 +412,7 @@ if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
if ($i && $numinrow == 0){
$categories .= "</tr>".($brenablecatrow ? "<tr><td class=embedded align=left><b>".$brcatrow[$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'>".return_category_image($cat['id'], "torrents.php?allsec=1&amp;")."</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'], "torrents.php?allsec=1&amp;")."</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -426,7 +428,7 @@ 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";
$i++;
}
$categories .= "</tr>";
@@ -440,7 +442,7 @@ if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
foreach ($sources as $source)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=sou$source[id] type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[sou".$source[id]."]") !== false ? " checked" : "") . " value='yes'>$source[name]</td>\n";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=sou{$source['id']} type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[sou".$source['id']."]") !== false ? " checked" : "") . " value='yes'>{$source['name']}</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -451,7 +453,7 @@ if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
foreach ($media as $medium)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=med$medium[id] type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[med".$medium[id]."]") !== false ? " checked" : "") . " value='yes'>$medium[name]</td>\n";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=med{$medium['id']} type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[med".$medium['id']."]") !== false ? " checked" : "") . " value='yes'>{$medium['name']}</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -462,7 +464,7 @@ if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
foreach ($codecs as $codec)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=cod$codec[id] type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cod".$codec[id]."]") !== false ? " checked" : "") . " value='yes'>$codec[name]</td>\n";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=cod{$codec['id']} type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cod".$codec['id']."]") !== false ? " checked" : "") . " value='yes'>{$codec['name']}</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -473,7 +475,7 @@ if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
foreach ($audiocodecs as $audiocodec)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=aud$audiocodec[id] type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[aud".$audiocodec[id]."]") !== false ? " checked" : "") . " value='yes'>$audiocodec[name]</td>\n";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=aud{$audiocodec['id']} type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[aud".$audiocodec['id']."]") !== false ? " checked" : "") . " value='yes'>{$audiocodec['name']}</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -484,7 +486,7 @@ if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
foreach ($standards as $standard)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=sta$standard[id] type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[sta".$standard[id]."]") !== false ? " checked" : "") . " value='yes'>$standard[name]</td>\n";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=sta{$standard['id']} type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[sta".$standard['id']."]") !== false ? " checked" : "") . " value='yes'>{$standard['name']}</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -495,7 +497,7 @@ if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
foreach ($processings as $processing)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=pro$processing[id] type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[pro".$processing[id]."]") !== false ? " checked" : "") . " value='yes'>$processing[name]</td>\n";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=pro{$processing['id']} type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[pro".$processing['id']."]") !== false ? " checked" : "") . " value='yes'>{$processing['name']}</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -506,7 +508,7 @@ if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
foreach ($teams as $team)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=tea$team[id] type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[tea".$team[id]."]") !== false ? " checked" : "") . " value='yes'>$team[name]</td>\n";
$categories .= "<td align=left class=bottom style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input class=checkbox name=tea{$team['id']} type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[tea".$team['id']."]") !== false ? " checked" : "") . " value='yes'>{$team['name']}</td>\n";
$i++;
}
$categories .= "</tr>";
@@ -544,7 +546,9 @@ if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs");
}
ksort($ss_sa);
reset($ss_sa);
while (list($ss_name, $ss_id) = each($ss_sa))
$stylesheets = $categoryicons = '';
// while (list($ss_name, $ss_id) = each($ss_sa))
foreach ($ss_sa as $ss_name => $ss_id)
{
if ($ss_id == $CURUSER["stylesheet"]) $ss = " selected"; else $ss = "";
$stylesheets .= "<option value=$ss_id$ss>$ss_name</option>\n";
@@ -643,7 +647,7 @@ tr_small($lang_usercp['row_funbox'],"<input type=checkbox name=showfb".($CURUSER
if ($showtooltipsetting)
tr($lang_usercp['row_tooltip_last_post'], "<input type=checkbox name=ttlastpost" . ($CURUSER["showlastpost"] == "yes" ? " checked" : "") . ">".$lang_usercp['checkbox_last_post_note'],1);
tr_small($lang_usercp['row_click_on_topic'], "<input type=radio name=clicktopic" . ($CURUSER["clicktopic"] == "firstpage" ? " checked" : "") . " value=\"firstpage\">".$lang_usercp['text_go_to_first_page']."<input type=radio name=clicktopic" . ($CURUSER["clicktopic"] == "lastpage" ? " checked" : "") . " value=\"lastpage\">".$lang_usercp['text_go_to_last_page'],1);
tr_small($lang_usercp['row_forum_signature'], "<textarea name=signature style=\"width:700px\" rows=10>" . $CURUSER[signature] . "</textarea><br />".$lang_usercp['text_signature_note'],1);
tr_small($lang_usercp['row_forum_signature'], "<textarea name=signature style=\"width:700px\" rows=10>" . $CURUSER['signature'] . "</textarea><br />".$lang_usercp['text_signature_note'],1);
submit();
print("</table>");
stdfoot();
@@ -874,11 +878,11 @@ if ($prolinkpoint_bonus)
tr_small($lang_usercp['row_promotion_link'], $prolinkclick. " [<a href=\"promotionlink.php\">".$lang_usercp['text_read_more']."</a>]", 1);
//tr_small($lang_usercp['row_promotion_link'], $prolinkclick. " [<a href=\"promotionlink.php?updatekey=1\">".$lang_usercp['text_update_promotion_link']."</a>] [<a href=\"promotionlink.php\">".$lang_usercp['text_read_more']."</a>]", 1);
}
tr_small($lang_usercp['row_invitations'],$CURUSER[invites]." [<a href=\"invite.php?id=".$CURUSER[id]."\" title=\"".$lang_usercp['link_send_invitation']."\">".$lang_usercp['text_send']."</a>]",1);
tr_small($lang_usercp['row_invitations'],$CURUSER['invites']." [<a href=\"invite.php?id=".$CURUSER['id']."\" title=\"".$lang_usercp['link_send_invitation']."\">".$lang_usercp['text_send']."</a>]",1);
tr_small($lang_usercp['row_karma_points'], $CURUSER['seedbonus']." [<a href=\"mybonus.php\" title=\"".$lang_usercp['link_use_karma_points']."\">".$lang_usercp['text_use']."</a>]", 1);
tr_small($lang_usercp['row_written_comments'], $commentcount." [<a href=\"userhistory.php?action=viewcomments&id=".$CURUSER[id]."\" title=\"".$lang_usercp['link_view_comments']."\">".$lang_usercp['text_view']."</a>]", 1);
tr_small($lang_usercp['row_written_comments'], $commentcount." [<a href=\"userhistory.php?action=viewcomments&id=".$CURUSER['id']."\" title=\"".$lang_usercp['link_view_comments']."\">".$lang_usercp['text_view']."</a>]", 1);
if ($forumposts)
tr($lang_usercp['row_forum_posts'], $forumposts." [<a href=\"userhistory.php?action=viewposts&id=".$CURUSER[id]."\" title=\"".$lang_usercp['link_view_posts']."\">".$lang_usercp['text_view']."</a>] (".$dayposts.$lang_usercp['text_posts_per_day']."; ".$percentages.$lang_usercp['text_of_total_posts'].")", 1);
tr($lang_usercp['row_forum_posts'], $forumposts." [<a href=\"userhistory.php?action=viewposts&id=".$CURUSER['id']."\" title=\"".$lang_usercp['link_view_posts']."\">".$lang_usercp['text_view']."</a>] (".$dayposts.$lang_usercp['text_posts_per_day']."; ".$percentages.$lang_usercp['text_of_total_posts'].")", 1);
?>
</table>
<table border="0" cellspacing="0" cellpadding="5" width=940>
@@ -893,7 +897,7 @@ print("<table border=0 cellspacing=0 cellpadding=3 width=940><tr>".
"<td class=colhead align=center>".$lang_usercp['col_topic_starter']."</td>".
"<td class=colhead align=center width=20%>".$lang_usercp['col_last_post']."</td>".
"</tr>");
$res_topics = sql_query("SELECT * FROM readposts INNER JOIN topics ON topics.id = readposts.topicid WHERE readposts.userid = ".$CURUSER[id]." ORDER BY readposts.id DESC LIMIT 5") or sqlerr();
$res_topics = sql_query("SELECT * FROM readposts INNER JOIN topics ON topics.id = readposts.topicid WHERE readposts.userid = ".$CURUSER['id']." ORDER BY readposts.id DESC LIMIT 5") or sqlerr();
while ($topicarr = mysql_fetch_assoc($res_topics))
{
$topicid = $topicarr["id"];