findOrFail($CURUSER["id"]); $siteName = \App\Models\Setting::getSiteName(); function bark($msg) { stdhead(); global $lang_usercp; stdmsg($lang_usercp['std_sorry'], $msg); stdfoot(); exit; } function usercpmenu ($selected = "home") { global $lang_usercp; begin_main_frame(); print ("
"); end_main_frame(); } function getimagewidth ($imagewidth, $imageheight) { while (($imagewidth > 150) or ($imageheight > 150)) { $imagewidth=150; $imageheight=150; } return $imagewidth; } function getimageheight ($imagewidth, $imageheight) { while (($imagewidth > 150) or ($imageheight > 150)) { $imagewidth=150; $imageheight=150; } return $imageheight; } function form($name, $type = "save", $id = "") { if ($id == "") { $id = "form" . random_str(); } return print("
"); } function submit($type = "submit") { global $lang_usercp; print("".$lang_usercp['row_save_settings'].""); } function format_tz($a) { $h = floor($a); $m = ($a - floor($a)) * 60; return ($a >= 0?"+":"-") . (strlen(abs($h)) > 1?"":"0") . abs($h) . ":" . ($m==0?"00":$m); } function priv($name, $descr) { global $CURUSER; if ($CURUSER["privacy"] == $name) return " ".htmlspecialchars($descr); else return " ".htmlspecialchars($descr); } function goback ($where = "-1") { global $lang_usercp; $text = $lang_usercp['text_go_back']; $goback = "".htmlspecialchars($text).""; return $goback; } $action = isset($_POST['action']) ? htmlspecialchars($_POST['action']) : (isset($_GET['action']) ? htmlspecialchars($_GET['action']) : ''); $type = isset($_POST['type']) ? htmlspecialchars($_POST['type']) : (isset($_GET['type']) ? htmlspecialchars($_GET['type']) : ''); $allowed_actions = array("personal","tracker","forum","security"); if ($action){ if (!in_array($action, $allowed_actions)) stderr($lang_usercp['std_error'], $lang_usercp['std_invalid_action']); else { switch ($action) { case "personal": if ($type == 'save') { $updateset = array(); $parked = $_POST["parked"]; if ($parked != 'yes') $parked = 'no'; $acceptpms = $_POST["acceptpms"]; $deletepms = ($_POST["deletepms"] != "" ? "yes" : "no"); $savepms = ($_POST["savepms"] != "" ? "yes" : "no"); $commentpm = $_POST["commentpm"]; $gender = $_POST["gender"]; $country = $_POST["country"]; if ($showschool = 'yes'){ $school = $_POST["school"]; $updateset[] = "school = ".sqlesc($school); } $download = $_POST["download"]; $upload = $_POST["upload"]; $isp = $_POST["isp"]; // $tzoffset = $_POST["tzoffset"]; if ( $_POST["avatar"] == '' ) $avatar=$_POST["savatar"]; else $avatar = $_POST["avatar"]; if(preg_match("/^https?:\/\/[^\s'\"<>]+\.(jpg|gif|png|jpeg)$/i", $avatar) && !preg_match("/\.php/i",$avatar) && !preg_match("/\.js/i",$avatar) && !preg_match("/\.cgi/i",$avatar)) { $avatar = htmlspecialchars( trim( $avatar ) ); $updateset[] = "avatar = " . sqlesc($avatar); } $info = htmlspecialchars(trim($_POST["info"])); $updateset[] = "parked = " . sqlesc($parked); $updateset[] = "acceptpms = " . sqlesc($acceptpms); $updateset[] = "deletepms = " . sqlesc($deletepms); $updateset[] = "savepms = " . sqlesc($savepms); $updateset[] = "commentpm = " . sqlesc($commentpm); $updateset[] = "gender = " . sqlesc($gender); if (is_valid_id($country)) $updateset[] = "country = " . sqlesc($country); if (is_valid_id($download)) $updateset[] = "download = " . sqlesc($download); if (is_valid_id($upload)) $updateset[] = "upload = " . sqlesc($upload); if (is_valid_id($isp)) $updateset[] = "isp = " . sqlesc($isp); // $updateset[] = "tzoffset = " . sqlesc($tzoffset); $updateset[] = "info = " . sqlesc($info); $updateset[] = "tracker_url_id = " . sqlesc($_POST["tracker_url_id"]); //notifs if (!empty($_POST['notifs'])) { preg_match_all('/\[(.*)\]/Ui', $CURUSER['notifs'], $notifsArr); $notifsArr = array_fill_keys($notifsArr[1], 1); foreach (\App\Models\User::$notificationOptions as $option) { if (isset($_POST['notifs'][$option])) { $notifsArr[$option] = 1; } else { unset($notifsArr[$option]); } } $updateset[] = "notifs = " . sqlesc('[' . implode('][', array_keys($notifsArr)) . ']'); } $query = "UPDATE users SET " . implode(",", $updateset) . " WHERE id = ".sqlesc($CURUSER["id"]); $result = sql_query($query); if (!$result) { sqlerr(__FILE__,__LINE__); } else { clear_user_cache($CURUSER["id"], $CURUSER['passkey']); header("Location: usercp.php?action=personal&type=saved"); } } stdhead($lang_usercp['head_control_panel'].$lang_usercp['head_personal_settings'],true); $countries = "\n"; $ct_r = sql_query("SELECT id,name FROM countries ORDER BY name") or die; while ($ct_a = mysql_fetch_array($ct_r)) $countries .= "\n"; $trackerUrls = "\n"; $trackerUrlList = \App\Models\TrackerUrl::listAll(); foreach ($trackerUrlList as $item) { $trackerUrls .= "\n"; } $isplist = "\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 .= "\n"; $downloadspeed = "\n"; $ds_a = sql_query("SELECT id,name FROM downloadspeed ORDER BY id") or die; while ($ds_b = mysql_fetch_array($ds_a)) $downloadspeed .= "\n"; $uploadspeed = "\n"; $us_a = sql_query("SELECT id,name FROM uploadspeed ORDER BY id") or die; while ($us_b = mysql_fetch_array($us_a)) $uploadspeed .= "\n"; $ra=sql_query("SELECT * FROM bitbucket WHERE public = '1'"); $options=''; $text = ''; while ($sor=mysql_fetch_array($ra)) { $text.=''; } usercpmenu ("personal"); form ("personal"); print (""); if ($type == 'saved') print("\n"); tr_small($lang_usercp['row_account_parked'], "".$lang_usercp['checkbox_pack_my_account']."
".$lang_usercp['text_account_pack_note']."" ,1); $pmY = $lang_usercp['text_accept_pms']."".$lang_usercp['radio_all_except_blocks']."".$lang_usercp['radio_friends_only']."".$lang_usercp['radio_staff_only'] ."
".$lang_usercp['checkbox_delete_pms'] ."
".$lang_usercp['checkbox_save_pms'] ."
".$lang_usercp['checkbox_pm_on_comments'] ; foreach (\App\Models\User::$notificationOptions as $option) { $pmY .= sprintf('
%s', $option, is_null($CURUSER['notifs']) || str_contains($CURUSER['notifs'], "[{$option}]") == "yes" ? " checked" : "", $lang_usercp["checkbox_pm_on_{$option}"]); } tr_small($lang_usercp['row_pms'], $pmY,1); tr_small($lang_usercp['row_gender'], "".$lang_usercp['radio_not_available']." ".$lang_usercp['radio_male']."".$lang_usercp['radio_female'],1); tr_small($lang_usercp['row_tracker_url'], "" . "
".$lang_usercp['row_tracker_url_help']."",1); tr_small($lang_usercp['row_country'], "",1); //School select if ($showschool == 'yes'){ $schools = "n"; $sc_r = sql_query("SELECT id,name FROM schools ORDER BY name") or die; while ($sc_a = mysql_fetch_array($sc_r)) $schools .= "n"; tr($lang_usercp['row_school'], "", 1); } tr_small($lang_usercp['row_network_bandwidth'], "".$lang_usercp['text_downstream_rate']. ":   ".$lang_usercp['text_upstream_rate'].":   ".$lang_usercp['text_isp'].": ",1); tr_small($lang_usercp['row_avatar_url'], "

\n".$lang_usercp['text_avatar_note'].($enablebitbucket_main == 'yes' ? $lang_usercp['text_bitbucket_note'] : ""),1); tr($lang_usercp['row_info'], "
".$lang_usercp['text_info_note'], 1); submit(); print("
".$lang_usercp['text_saved']."
"); stdfoot(); die; break; case "tracker": $showaddisabled = true; if ($enablead_advertisement == 'yes'){ if (get_user_class() >= $noad_advertisement || ($enablebonusnoad_advertisement == 'yes' && !empty($CURUSER['noaduntil']) && strtotime($CURUSER['noaduntil']) >= TIMENOW)){ $showaddisabled = false; } } if ($enabletooltip_tweak == 'yes') $showtooltipsetting = true; else $showtooltipsetting = false; if ($type == 'save') { $updateset = array(); $pmnotif = $_POST["pmnotif"] ?? ''; $emailnotif = $_POST["emailnotif"] ?? ''; preg_match_all('/\[(.*)\]/Ui', $CURUSER['notifs'], $notifs); $notifs = array_fill_keys($notifs[1], 1); foreach ($notifs as $key => $value) { foreach (['incldead', 'spstate', 'inclbookmarked'] as $item) { if (str_starts_with($key, $item)) { unset($notifs[$key]); } } } if ($pmnotif == 'yes') { $notifs['pm'] = 1; } else { unset($notifs['pm']); } if ($emailnotif == 'yes') { $notifs['email'] = 1; } else { unset($notifs['email']); } function browsecheck($dbtable, $cbname, array &$result){ global $_POST; $r = sql_query("SELECT id FROM ".$dbtable) or sqlerr(); $rows = mysql_num_rows($r); for ($i = 0; $i < $rows; ++$i) { $a = mysql_fetch_assoc($r); if (isset($_POST[$cbname.$a['id']]) && $_POST[$cbname.$a['id']] == 'yes') { $result[$cbname.$a['id']] = 1; } else { unset($result[$cbname.$a['id']]); } } } browsecheck("categories", "cat", $notifs); browsecheck("sources", "sou", $notifs); browsecheck("media", "med", $notifs); browsecheck("codecs", "cod", $notifs); browsecheck("standards", "sta", $notifs); browsecheck("processings", "pro", $notifs); browsecheck("teams", "tea", $notifs); browsecheck("audiocodecs", "aud", $notifs); $incldead = $_POST["incldead"]; if (isset($incldead) && $incldead != 1) { $notifs["incldead=$incldead"] = 1; } $spstate = $_POST["spstate"]; if ($spstate) { $notifs["spstate=$spstate"] = 1; } $inclbookmarked = $_POST["inclbookmarked"]; if ($inclbookmarked) { $notifs["inclbookmarked=$inclbookmarked"] = 1; } $stylesheet = $_POST["stylesheet"]; // $caticon = $_POST["caticon"]; $sitelanguage = $_POST["sitelanguage"]; $fontsize = $_POST["fontsize"]; if ($fontsize == 'large') $updateset[] = "fontsize = 'large'"; elseif ($fontsize == 'small') $updateset[] = "fontsize = 'small'"; else $updateset[] = "fontsize = 'medium'"; $updateset[] = "notifs = " . sqlesc('[' . implode('][', array_keys($notifs)) . ']'); if (is_valid_id($stylesheet)) $updateset[] = "stylesheet = " . sqlesc($stylesheet); // if (is_valid_id($caticon)) // $updateset[] = "caticon = " . sqlesc($caticon); if (is_valid_id($sitelanguage)) { $lang_folder = validlang($sitelanguage); if(get_langfolder_cookie() != $lang_folder) { set_langfolder_cookie($lang_folder); header("Location: " . $_SERVER['PHP_SELF']); } $updateset[] = "lang = " . sqlesc($sitelanguage); } $updateset[] = "torrentsperpage = " . min(100, intval($_POST["torrentsperpage"] ?? 0)); if ($showmovies['hot'] == "yes"){ $showhot = $_POST["show_hot"]; $updateset[] = "showhot = " . sqlesc($showhot); } if ($showmovies['classic'] == "yes"){ $showclassic = $_POST["show_classic"]; $updateset[] = "showclassic = " . sqlesc($showclassic); } if ($showtooltipsetting){ $tooltip = $_POST['tooltip']; $updateset[] = "tooltip = " . sqlesc($tooltip); } if ($enablead_advertisement == 'yes' && !$showaddisabled){ $noad = ($_POST['showad'] == 'yes' ? "no" : "yes"); $updateset[] = "noad = " . sqlesc($noad); } $timetype = $_POST['timetype']; $updateset[] = "timetype = " . sqlesc($timetype); $appendsticky = ($_POST["appendsticky"] == 'yes' ? "yes" : "no"); $updateset[] = "appendsticky = " . sqlesc($appendsticky); $appendnew = ($_POST["appendnew"] == 'yes' ? "yes" : "no"); $updateset[] = "appendnew = " . sqlesc($appendnew); $appendpromotion = $_POST["appendpromotion"]; $updateset[] = "appendpromotion = " . sqlesc($appendpromotion); $appendpicked = ($_POST["appendpicked"] == 'yes' ? "yes" : "no"); $updateset[] = "appendpicked = " . sqlesc($appendpicked); $dlicon = ($_POST['dlicon'] == 'yes' ? "yes" : "no"); $updateset[] = "dlicon = " . sqlesc($dlicon); $bmicon = ($_POST['bmicon'] == 'yes' ? "yes" : "no"); $updateset[] = "bmicon = " . sqlesc($bmicon); $showcomnum = ($_POST["showcomnum"] == 'yes' ? "yes" : "no"); $updateset[] = "showcomnum = " . sqlesc($showcomnum); if ($showtooltipsetting){ $showlastcom = ($_POST["showlastcom"] == 'yes' ? "yes" : "no"); $updateset[] = "showlastcom = " . sqlesc($showlastcom); } $pmnum = ($_POST["pmnum"] < 1 || $_POST["pmnum"] > 100 ? 20 : floor($_POST["pmnum"])); $updateset[] = "pmnum = " . $pmnum; if ($showfunbox_main == 'yes'){$showfb = ($_POST["showfb"] == 'yes' ? "yes" : "no"); $updateset[] = "showfb = " . sqlesc($showfb);} $sbnum = ($_POST["sbnum"] ? max(10, min(500, intval($_POST["sbnum"] ?? 0))) : 70); $updateset[] = "sbnum = " . $sbnum; $sbrefresh = ($_POST["sbrefresh"] ? max(10, min(3600, intval($_POST["sbrefresh"] ?? 0))) : 120); $updateset[] = "sbrefresh = " . $sbrefresh; if (isset($_POST["hidehb"]) && $_POST["hidehb"] == 'yes') $hidehb = 'yes'; else $hidehb = 'no'; $updateset[] = "hidehb = " . sqlesc($hidehb); if ($showextinfo['imdb'] == 'yes'){if ($_POST["showimdb"] == 'yes') $showimdb = 'yes'; else $showimdb = 'no'; $updateset[] = "showimdb = " . sqlesc($showimdb);} if ($_POST["showdescription"] == 'yes') $showdescription = 'yes'; else $showdescription = 'no'; $updateset[] = "showdescription = " . sqlesc($showdescription); if ($enablenfo_main == 'yes'){ if (isset($_POST["shownfo"]) && $_POST["shownfo"] == 'yes') $shownfo = 'yes'; else $shownfo = 'no'; $updateset[] = "shownfo = " . sqlesc($shownfo); } if ($_POST["smalldescr"] == 'yes') $showsmalldescr = 'yes'; else $showsmalldescr = 'no'; $updateset[] = "showsmalldescr = " . sqlesc($showsmalldescr); if ($_POST["showcomment"] == 'yes') $showcomment = 'yes'; else $showcomment = 'no'; $updateset[] = "showcomment = " . sqlesc($showcomment); $query = "UPDATE users SET " . implode(",", $updateset) . " WHERE id =".sqlesc($CURUSER["id"]); //stderr("",$query); $result = sql_query($query) or sqlerr(__FILE__,__LINE__); header("Location: usercp.php?action=tracker&type=saved"); } stdhead($lang_usercp['head_control_panel'].$lang_usercp['head_tracker_settings']); usercpmenu ("tracker"); form ("tracker"); $brsectiontype = $browsecatmode; $spsectiontype = $specialcatmode; if ($enablespecial == 'yes' && get_user_class() >= get_setting('authority.view_special_torrent')) $allowspecial = true; else $allowspecial = false; if (strpos($CURUSER['notifs'], "[spstate=0]") !== false) $special_state = 0; elseif (strpos($CURUSER['notifs'], "[spstate=1]") !== false) $special_state = 1; elseif (strpos($CURUSER['notifs'], "[spstate=2]") !== false) $special_state = 2; elseif (strpos($CURUSER['notifs'], "[spstate=3]") !== false) $special_state = 3; elseif (strpos($CURUSER['notifs'], "[spstate=4]") !== false) $special_state = 4; elseif (strpos($CURUSER['notifs'], "[spstate=5]") !== false) $special_state = 5; elseif (strpos($CURUSER['notifs'], "[spstate=6]") !== false) $special_state = 6; elseif (strpos($CURUSER['notifs'], "[spstate=7]") !== false) $special_state = 7; else $special_state = 0; /* $showsubcat = (get_searchbox_value($brsectiontype, 'showsubcat') || ($allowspecial && get_searchbox_value($spsectiontype, 'showsubcat'))); $showsource = (get_searchbox_value($brsectiontype, 'showsource') || ($allowspecial && get_searchbox_value($spsectiontype, 'showsource'))); //whether show sources or not $showmedium = (get_searchbox_value($brsectiontype, 'showmedium') || ($allowspecial && get_searchbox_value($spsectiontype, 'showmedium'))); //whether show media or not $showcodec = (get_searchbox_value($brsectiontype, 'showcodec') || ($allowspecial && get_searchbox_value($spsectiontype, 'showcodec'))); //whether show codecs or not $showstandard = (get_searchbox_value($brsectiontype, 'showstandard') || ($allowspecial && get_searchbox_value($spsectiontype, 'showstandard'))); //whether show standards or not $showprocessing = (get_searchbox_value($brsectiontype, 'showprocessing') || ($allowspecial && get_searchbox_value($spsectiontype, 'showprocessing'))); //whether show processings or not $showteam = (get_searchbox_value($brsectiontype, 'showteam') || ($allowspecial && get_searchbox_value($spsectiontype, 'showteam'))); //whether show teams or not $showaudiocodec = (get_searchbox_value($brsectiontype, 'showaudiocodec') || ($allowspecial && get_searchbox_value($spsectiontype, 'showaudiocodec'))); //whether show audio codecs or not $brcatsperror = (int)get_searchbox_value($brsectiontype, 'catsperrow'); $catsperrow = (int)get_searchbox_value($spsectiontype, 'catsperrow'); $catsperrow = !$allowspecial ? $brcatsperror : $catsperrow; //show how many cats per line $brcatpadding = get_searchbox_value($brsectiontype, 'catpadding'); $spcatpadding = get_searchbox_value($spsectiontype, 'catpadding'); $catpadding = (!$allowspecial ? $brcatpadding : ($brcatpadding < $spcatpadding ? $brcatpadding : $spcatpadding)); //padding space between categories in pixel $brcats = genrelist($brsectiontype); $spcats = genrelist($spsectiontype); if ($showsubcat){ if ($showsource) $sources = searchbox_item_list("sources"); if ($showmedium) $media = searchbox_item_list("media"); if ($showcodec) $codecs = searchbox_item_list("codecs"); if ($showstandard) $standards = searchbox_item_list("standards"); if ($showprocessing) $processings = searchbox_item_list("processings"); if ($showteam) $teams = searchbox_item_list("teams"); if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs"); } */ print (""); if ($type == 'saved') print("\n"); if ($emailnotify_smtp=='yes' && $smtptype != 'none') tr_small($lang_usercp['row_email_notification'], " ".$lang_usercp['checkbox_notification_received_pm']."
\n ".$lang_usercp['checkbox_notification_default_categories'], 1); //no this option $brenablecatrow = false; /* $categories = "
".$lang_usercp['text_saved']."
".($allowspecial ? "
".$lang_usercp['text_at_browse_page']."
" : "").""; $i = 0; foreach ($brcats as $cat)//print category list of Torrents section { $numinrow = $i % $catsperrow; $rownum = (int)($i / $catsperrow); if ($i && $numinrow == 0){ $categories .= "".($brenablecatrow ? "" : "").""; } $categories .= "\n"; $i++; } $categories .= ""; if ($allowspecial) //print category list of Special section { $categories .= "
".($brenablecatrow == true ? $brcatrow[0] : $lang_usercp['text_category'])."
".$brcatrow[$rownum]."
".return_category_image($cat['id'], "torrents.php?allsec=1&")."
".$lang_usercp['text_at_special_page']."
"; $categories .= ""; $i = 0; foreach ($spcats as $cat) { $numinrow = $i % $catsperrow; $rownum = (int)($i / $catsperrow); if ($i && $numinrow == 0){ $categories .= "".($spenablecatrow ? "" : "").""; } // $categories .= "\n"; $categories .= "\n"; $i++; } $categories .= ""; } if ($showsubcat)//Show subcategory (i.e. source, codecs) selections { $categories .= "
".($spenablecatrow == true ? $spcatrow[0] : $lang_usercp['text_category'])."
".$spcatrow[$rownum]."
\""" . return_category_image($cat['id'], "special.php?allsec=1&") . "
".$lang_usercp['text_sub_category']."
"; if ($showsource){ $categories .= ""; $i = 0; foreach ($sources as $source) { $categories .= ($i && $i % $catsperrow == 0) ? "" : ""; $categories .= "\n"; $i++; } $categories .= ""; } if ($showmedium){ $categories .= ""; $i = 0; foreach ($media as $medium) { $categories .= ($i && $i % $catsperrow == 0) ? "" : ""; $categories .= "\n"; $i++; } $categories .= ""; } if ($showcodec){ $categories .= ""; $i = 0; foreach ($codecs as $codec) { $categories .= ($i && $i % $catsperrow == 0) ? "" : ""; $categories .= "\n"; $i++; } $categories .= ""; } if ($showaudiocodec){ $categories .= ""; $i = 0; foreach ($audiocodecs as $audiocodec) { $categories .= ($i && $i % $catsperrow == 0) ? "" : ""; $categories .= "\n"; $i++; } $categories .= ""; } if ($showstandard){ $categories .= ""; $i = 0; foreach ($standards as $standard) { $categories .= ($i && $i % $catsperrow == 0) ? "" : ""; $categories .= "\n"; $i++; } $categories .= ""; } if ($showprocessing){ $categories .= ""; $i = 0; foreach ($processings as $processing) { $categories .= ($i && $i % $catsperrow == 0) ? "" : ""; $categories .= "\n"; $i++; } $categories .= ""; } if ($showteam){ $categories .= ""; $i = 0; foreach ($teams as $team) { $categories .= ($i && $i % $catsperrow == 0) ? "" : ""; $categories .= "\n"; $i++; } $categories .= ""; } } $categories .= "
".$lang_usercp['text_source']."
{$source['name']}
".$lang_usercp['text_medium']."
{$medium['name']}
".$lang_usercp['text_codec']."
{$codec['name']}
".$lang_usercp['text_audio_codec']."
{$audiocodec['name']}
".$lang_usercp['text_standard']."
{$standard['name']}
".$lang_usercp['text_processing']."
{$processing['name']}
".$lang_usercp['text_team']."
{$team['name']}
"; $categories .= ""; $categories .= ""; $categories .= "
".$lang_usercp['text_additional_selection']."
".$lang_usercp['text_show_dead_active']."
".$lang_usercp['text_show_special_torrents']."
".$lang_usercp['text_show_bookmarked']."
"; */ $categories = build_search_box_category_table($browsecatmode, 'yes','torrents.php?allsec=1', false, 3, $CURUSER['notifs'], ['section_name' => true]); $delimiter = '
'; if (get_setting('main.spsct') == 'yes') { $categories .= $delimiter . build_search_box_category_table($specialcatmode, 'yes','special.php?allsec=1', false, 3, $CURUSER['notifs'], ['section_name' => true]); } $categories .= $delimiter . "
{$lang_usercp['text_additional_selection']}
".$lang_usercp['text_show_dead_active']."
".$lang_usercp['text_show_special_torrents']."
".$lang_usercp['text_show_bookmarked']."
"; tr_small($lang_usercp['row_browse_default_categories'], $categories,1); $ss_r = sql_query("SELECT * FROM stylesheets") or die; $ss_sa = array(); while ($ss_a = mysql_fetch_array($ss_r)) { $ss_id = $ss_a["id"]; $ss_name = $ss_a["name"]; $ss_sa[$ss_name] = $ss_id; } ksort($ss_sa); reset($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 .= "\n"; } tr_small($lang_usercp['row_stylesheet'], "  ".$lang_usercp['text_stylesheet_note']."".$lang_usercp['text_stylesheet_link'].".",1); /** * make no sense, should no exists! * @since v1.6.0 */ // $cires = sql_query("SELECT * FROM caticons ORDER BY name") or die; // while($caticon = mysql_fetch_array($cires)){ // if ($caticon['id'] == $CURUSER['caticon']) $sl = " selected"; else $sl = ""; // $categoryicons .= "\n"; // } // tr_small($lang_usercp['row_category_icons'], "",1); tr_small($lang_usercp['row_font_size'], "",1); $s = "  ".$lang_usercp['text_translation_note']."".$lang_usercp['text_translation_link']."."; tr_small($lang_usercp['row_site_language'], $s,1); if($showmovies['hot'] == "yes" || $showmovies['classic'] == "yes") tr_small($lang_usercp['row_recommended_movies'], ($showmovies['hot'] == "yes" ? "".$lang_usercp['checkbox_show_hot']. " " : "") . ($showmovies['classic'] == "yes" ? "".$lang_usercp['checkbox_show_classic']." " : ""),1); tr_small($lang_usercp['row_pm_boxes'], $lang_usercp['text_show']."".$lang_usercp['text_pms_per_page'], 1); if ($showshoutbox_main == "yes") //system side setting for shoutbox tr_small($lang_usercp['row_shoutbox'], $lang_usercp['text_show_last']."".$lang_usercp['text_messages_at_shoutbox']."
".$lang_usercp['text_refresh_shoutbox_every']."".$lang_usercp['text_seconds'].($showhelpbox_main == 'yes' ? "
".$lang_usercp['text_hide_helpbox_messages'] : ""), 1); if ($showfunbox_main == 'yes') //siteside setting for funbox tr_small($lang_usercp['row_funbox'],"".$lang_usercp['text_show_funbox'] , 1); tr_small($lang_usercp['row_torrent_detail'], "".$lang_usercp['text_show_description']."
".($enablenfo_main == 'yes' && get_user_class() >= UC_POWER_USER ? "".$lang_usercp['text_show_nfo']."
" : "").($showextinfo['imdb'] == 'yes' ? "".$lang_usercp['text_show_imdb_info'] : ""),1); tr_small($lang_usercp['row_discuss'],"".$lang_usercp['text_show_comments'], 1); if ($enablead_advertisement == 'yes'){ tr_small($lang_usercp['row_show_advertisements'],"".$lang_usercp['text_show_advertisement_note'].($enablenoad_advertisement == 'yes' ? "
".get_user_class_name($noad_advertisement,false,true,true).$lang_usercp['text_can_turn_off_advertisement'] : "").($enablebonusnoad_advertisement == 'yes' ? "
".get_user_class_name($bonusnoad_advertisement,false,true,true).$lang_usercp['text_buy_no_advertisement']."".$lang_usercp['text_bonus_center']."" : ""), 1); } tr_small($lang_usercp['row_time_type'], "".$lang_usercp['text_time_added']."  ".$lang_usercp['text_time_elapsed']."
", 1); //Setting for browse page tr_small($lang_usercp['row_browse_page'], $lang_usercp['text_browse_setting_warning']."
".$lang_usercp['row_torrent_page'].":
".$lang_usercp['text_show']." ".$lang_usercp['text_torrents_per_page'].$lang_usercp['text_zero_equals_default']."
". ($showtooltipsetting ? "".$lang_usercp['text_tooltip_type'].":
".($showextinfo['imdb'] == 'yes' ? "".$lang_usercp['text_minor_imdb_info']."
".$lang_usercp['text_median_imdb_info']. "
" : "")."".$lang_usercp['text_off']."
" : ""). "".$lang_usercp['text_append_words_to_torrents'].":
".$lang_usercp['text_append_sticky']."
".$lang_usercp['text_append_new']."
".$lang_usercp['text_torrents_on_promotion']."".$lang_usercp['text_highlight']."".$lang_usercp['text_append_words']."".$lang_usercp['text_append_icon']."".$lang_usercp['text_no_mark']."
".$lang_usercp['text_append_picked']."
".$lang_usercp['text_show_title'].":
"."".$lang_usercp['text_show_small_description']."
".$lang_usercp['text_show_action_icons'].":
"."".$lang_usercp['text_show_download_icon']." \"Download\"
".$lang_usercp['text_show_bookmark_icon']." \"Bookmark\"
".$lang_usercp['text_comments_reviews'].":
".$lang_usercp['text_show_comment_number'].($showtooltipsetting ? "".$lang_usercp['text_last_comment_on_tooltip'] : ""), 1); submit(); print(""); stdfoot(); die; break; case "forum": if ($enabletooltip_tweak == 'yes') $showtooltipsetting = true; else $showtooltipsetting = false; if ($type == 'save') { $updateset = array(); $avatars = ($_POST["avatars"] != "" ? "yes" : "no"); $ttlastpost = ($_POST["ttlastpost"] != "" ? "yes" : "no"); $signatures = ($_POST["signatures"] != "" ? "yes" : "no"); $signature = htmlspecialchars( trim($_POST["signature"]) ); $updateset[] = "topicsperpage = " . min(100, intval($_POST["topicsperpage"] ?? 0)); $updateset[] = "postsperpage = " . min(100, intval($_POST["postsperpage"] ?? 0)); $updateset[] = "avatars = " . sqlesc($avatars); if ($showtooltipsetting) $updateset[] = "showlastpost = " . sqlesc($ttlastpost); $updateset[] = "signatures = " . sqlesc($signatures); $clicktopic = $_POST["clicktopic"]; $updateset[] = "clicktopic = ".sqlesc($clicktopic); $updateset[] = "signature = " . sqlesc($signature); $query = "UPDATE users SET " . implode(",", $updateset) . " WHERE id =".sqlesc($CURUSER["id"]); $result = sql_query($query); if (!$result) sqlerr(__FILE__,__LINE__); else header("Location: usercp.php?action=forum&type=saved"); } stdhead($lang_usercp['head_control_panel'].$lang_usercp['head_forum_settings'],true); usercpmenu ("forum"); form ("forum"); print (""); if ($type == 'saved') print("\n"); tr_small($lang_usercp['row_topics_per_page'], "".$lang_usercp['text_zero_equals_default'],1); tr_small($lang_usercp['row_posts_per_page'], " ".$lang_usercp['text_zero_equals_default'],1); tr_small($lang_usercp['row_view_avatars'], "".$lang_usercp['checkbox_low_bandwidth_note'],1); tr_small($lang_usercp['row_view_signatures'], "".$lang_usercp['checkbox_low_bandwidth_note'],1); if ($showtooltipsetting) tr($lang_usercp['row_tooltip_last_post'], "".$lang_usercp['checkbox_last_post_note'],1); tr_small($lang_usercp['row_click_on_topic'], "".$lang_usercp['text_go_to_first_page']."".$lang_usercp['text_go_to_last_page'],1); tr_small($lang_usercp['row_forum_signature'], "
".$lang_usercp['text_signature_note'],1); submit(); print("
".$lang_usercp['text_saved']."
"); stdfoot(); die; break; case "security": if ($type == 'confirm') { $response = $_POST['response']; if (!$response){ stderr($lang_usercp['std_error'], $lang_usercp['std_enter_old_password'].goback(), 0); } //验证旧密码 $challenge = \Nexus\Database\NexusDB::cache_get(get_challenge_key($userInfo->username)); if (empty($challenge)) { stderr($lang_usercp['std_error'], "expired!".goback(), 0); } $expectedResponse = hash_hmac('sha256', $userInfo->passhash, $challenge); if (!hash_equals($expectedResponse, $response)) { stderr($lang_usercp['std_error'], $lang_usercp['std_wrong_password_note'].goback(), 0); } $updateset = array(); $changedemail = 0; $passupdated = 0; $privacyupdated = 0; $resetpasskey = $_POST["resetpasskey"]; $email = mysql_real_escape_string( htmlspecialchars( trim($_POST["email"]) )); $chpassword = $_POST["chpassword"]; // $passagain = $_POST["passagain"]; $privacy = $_POST["privacy"]; $twoStepSecret = $_POST['two_step_secret'] ?? ''; $twoStepSecretHash = $_POST['two_step_code']; if (!empty($twoStepSecretHash)) { $ga = new \PHPGangsta_GoogleAuthenticator(); if (empty($CURUSER['two_step_secret'])) { //do bind $secretToVerify = $twoStepSecret; $updateset[] = "two_step_secret = " . sqlesc($twoStepSecret); } else { //unbind $secretToVerify = $CURUSER['two_step_secret']; $updateset[] = "two_step_secret = ''"; } if (!$ga->verifyCode($secretToVerify, $twoStepSecretHash)) { stderr($lang_usercp['std_error'], 'Invalid two step code'.goback("-2"), 0); die; } } if ($chpassword != "") { // if ($chpassword == $CURUSER["username"]) { // stderr($lang_usercp['std_error'], $lang_usercp['std_password_equals_username'].goback("-2"), 0); // die; // } // if (strlen($chpassword) > 40) { // stderr($lang_usercp['std_error'], $lang_usercp['std_password_too_long'].goback("-2"), 0); // die; // } // if (strlen($chpassword) < 6) { // stderr($lang_usercp['std_error'], $lang_usercp['std_password_too_short'].goback("-2"), 0); // die; // } // if ($chpassword != $passagain) { // stderr($lang_usercp['std_error'], $lang_usercp['std_passwords_unmatched'].goback("-2"), 0); // die; // } $sec = mksecret(); // $passhash = md5($sec . $chpassword . $sec); $passhash = hash('sha256', $sec . $chpassword); $updateset[] = "secret = " . sqlesc($sec); $updateset[] = "passhash = " . sqlesc($passhash); $authKey = mksecret(); $updateset[] = "auth_key = " . sqlesc($authKey); logincookie($CURUSER["id"], $authKey); $passupdated = 1; } if ($disableemailchange != 'no' && $smtptype != 'none' && $email != $CURUSER["email"]) { if(EmailBanned($email)) bark($lang_usercp['std_email_address_banned']); if(!EmailAllowed($email)) bark($lang_usercp['std_wrong_email_address_domains'].allowedemails()); if (!validemail($email)){ stderr($lang_usercp['std_error'], $lang_usercp['std_wrong_email_address_format'].goback("-2"), 0); die; } $r = sql_query("SELECT id FROM users WHERE email=" . sqlesc($email)) or sqlerr(); if (mysql_num_rows($r) > 0){ stderr($lang_usercp['std_error'], $lang_usercp['std_email_in_use'].goback("-2"), 0); die; } $changedemail = 1; } if ($resetpasskey == 1) { $passkey = md5($CURUSER['username'].date("Y-m-d H:i:s").$CURUSER['passhash']); $updateset[] = "passkey = " . sqlesc($passkey); } if ($changedemail == 1) { $sec = mksecret(); $hash = md5($sec . $email . $sec); $obemail = rawurlencode($email); $updateset[] = "editsecret = " . sqlesc($sec); $subject = "$SITENAME".$lang_usercp['mail_profile_change_confirmation']; $changeEmailOne = sprintf($lang_usercp['mail_change_email_one'], $siteName); $changeEmailNine = sprintf($lang_usercp['mail_change_email_nine'], $siteName); $body = <<{$lang_usercp['mail_here']}{$lang_usercp['mail_change_email_six_1']}
http://$BASEURL/confirmemail.php/{$CURUSER["id"]}/$hash/$obemail {$lang_usercp['mail_change_email_seven']} ------{$lang_usercp['mail_change_email_eight']} {$changeEmailNine} EOD; sent_mail($email,$SITENAME,$SITEEMAIL,$subject,str_replace("
","
",nl2br($body)),"profile change",false,false,''); } if ($privacy != "normal" && $privacy != "low" && $privacy != "strong") die("whoops"); $updateset[] = "privacy = " . sqlesc($privacy); if ($CURUSER['privacy'] != $privacy) $privacyupdated = 1; $user = $CURUSER["id"]; \Nexus\Database\NexusDB::transaction(function () use ($user, $updateset) { $query = sprintf("UPDATE users SET " . implode(",", $updateset) . " WHERE id ='%s'", mysql_real_escape_string($user)); sql_query($query); if (!empty($_REQUEST['resetauthkey']) && $_REQUEST['resetauthkey'] == 1) { //reset authkey $torrentRep = new \App\Repositories\TorrentRepository(); $torrentRep->resetTrackerReportAuthKeySecret($user); } do_action("usercp_security_update", $_POST); }); $to = "usercp.php?action=security&type=saved"; if ($changedemail == 1) $to .= "&mail=1"; if ($resetpasskey == 1) $to .= "&passkey=1"; if ($passupdated == 1) $to .= "&password=1"; if ($privacyupdated == 1) $to .= "&privacy=1"; clear_user_cache($CURUSER["id"]); \Nexus\Database\NexusDB::cache_del(get_challenge_key($userInfo->username)); header("Location: $to"); } stdhead($lang_usercp['head_control_panel'].$lang_usercp['head_security_settings']); usercpmenu ("security"); form ("security", $type == "save" ? "confirm" : "save","security"); print (""); if ($type == 'save') { // print(""); $resetpasskey = $_POST["resetpasskey"]; $resetauthkey = $_POST["resetauthkey"]; $email = mysql_real_escape_string( htmlspecialchars( trim($_POST["email"]) )); $chpassword = $_POST["chpassword"]; $passagain = $_POST["passagain"]; $privacy = $_POST["privacy"]; $two_step_secret = $_POST["two_step_secret"] ?? ''; $two_step_code = $_POST["two_step_code"]; if ($resetpasskey == 1) print(""); if ($resetauthkey == 1) print(""); print(""); print(""); // print(""); print(""); print(""); print(""); Print("\n"); print(''); print(''); do_action("usercp_security_update_confirm", $_POST); submit("button"); print("
".$lang_usercp['row_security_check']."
".$lang_usercp['text_security_check_note']."
"); render_password_challenge_js("security", "username", "oldpassword"); stdfoot(); die; } if ($type == 'saved') print("".$lang_usercp['text_saved'].($_GET["mail"] == "1" ? $lang_usercp['std_confirmation_email_sent'] : "")." ".($_GET["passkey"] == "1" ? $lang_usercp['std_passkey_reset'] : "")." ".($_GET["password"] == "1" ? $lang_usercp['std_password_changed'] : "")." ".($_GET["privacy"] == "1" ? $lang_usercp['std_privacy_level_updated'] : "")."\n"); tr_small($lang_usercp['row_reset_passkey'],"".$lang_usercp['checkbox_reset_my_passkey']."
".$lang_usercp['text_reset_passkey_note']."", 1); // tr_small($lang_usercp['row_reset_authkey'],"".$lang_usercp['checkbox_reset_my_authkey']."
".$lang_usercp['text_reset_authkey_note']."", 1); //two step authentication if (!empty($CURUSER['two_step_secret'])) { tr_small($lang_usercp['row_two_step_secret'],"".$lang_usercp['text_two_step_secret_unbind_note'], 1); } else { $ga = new \PHPGangsta_GoogleAuthenticator(); $twoStepSecret = $ga->createSecret(); $twoStepQrCodeUrl = $ga->getQRCodeGoogleUrl(sprintf('%s(%s)', get_setting('basic.SITENAME'), $CURUSER['username']), $twoStepSecret); $twoStepY = '
'; $twoStepY .= sprintf('
', $twoStepQrCodeUrl); $twoStepY .= sprintf( '
%sLink

%s%s

%s
', $lang_usercp['text_two_step_secret_bind_by_qrdoe_note'], $twoStepQrCodeUrl, $lang_usercp['text_two_step_secret_bind_manually_note'], $twoStepSecret, $lang_usercp['text_two_step_secret_bind_complete_note'], $twoStepSecret ); $twoStepY .= '
'; tr_small($lang_usercp['row_two_step_secret'], $twoStepY, 1); } printf('%s', nexus_trans('passkey.passkey')); \App\Repositories\UserPasskeyRepository::renderList($CURUSER['id']); printf(''); if ($disableemailchange != 'no' && $smtptype != 'none') //system-wide setting tr_small($lang_usercp['row_email_address'], "
".$lang_usercp['text_email_address_note']."", 1); do_action("usercp_security_setting_form"); tr_small($lang_usercp['row_change_password'], "", 1); print(''); tr_small($lang_usercp['row_type_password_again'], "", 1); tr_small($lang_usercp['row_privacy_level'], priv("normal", $lang_usercp['radio_normal']) . " " . priv("low", $lang_usercp['radio_low']) . " " . priv("strong", $lang_usercp['radio_strong']), 1); submit("button"); print(""); render_password_hash_js("security", "password", "chpassword", false,"passagain"); stdfoot(); die; break; } } } stdhead($lang_usercp['head_control_panel'].$lang_usercp['head_home']); \Nexus\Nexus::js('vendor/jquery-loading/jquery.loading.min.js', 'footer', true); usercpmenu (); //Comment Results $commentcount = get_row_count("comments", "WHERE user=" . sqlesc($CURUSER["id"])); //Join Date if ($CURUSER['added'] == "0000-00-00 00:00:00" || $CURUSER['added'] == null) $joindate = 'N/A'; else $joindate = $CURUSER['added']." (" . gettime($CURUSER['added'],true,false,true).")"; //Forum Posts if (!$forumposts = $Cache->get_value('user_'.$CURUSER['id'].'_post_count')){ $forumposts = get_row_count("posts","WHERE userid=".$CURUSER['id']); $Cache->cache_value('user_'.$CURUSER['id'].'_post_count', $forumposts, 3600); } $dayposts = 0; if ($forumposts) { $seconds3 = (TIMENOW - strtotime($CURUSER["added"])); $days = round($seconds3/86400, 0); if($days > 1) { $dayposts = round(($forumposts / $days), 1); } if (!$postcount = $Cache->get_value('total_posts_count')){ $postcount = get_row_count("posts"); $Cache->cache_value('total_posts_count', $postcount, 96400); } $percentages = round($forumposts*100/$postcount, 3)."%"; } ?> > renderIcon($CURUSER['ip'], $CURUSER['id']); if ($enablelocation_tweak == 'yes'){ list($loc_pub, $loc_mod) = get_ip_location($CURUSER["ip"]); tr_small($lang_usercp['row_ip_location'], hide_text($CURUSER["ip"]." [" . $loc_pub . "]$seedBoxIcon"), 1); } else{ tr_small($lang_usercp['row_ip_location'], hide_text($CURUSER["ip"] . $seedBoxIcon), 1); } if ($CURUSER["avatar"]) tr_small($lang_usercp['row_avatar'], "", 1); tr_small($lang_usercp['row_passkey'], hide_text($CURUSER["passkey"]), 1); if (get_setting('security.login_type') == 'passkey' && get_setting('security.login_secret_deadline') > date('Y-m-d H:i:s')) { tr_small($lang_usercp['row_passkey_login_url'], sprintf('%s/%s/%s', getSchemeAndHttpHost(), get_setting('security.login_secret'), $CURUSER['passkey']), 1); } if ($prolinkpoint_bonus) { $prolinkclick=get_row_count("prolinkclicks", "WHERE userid=".$CURUSER['id']); tr_small($lang_usercp['row_promotion_link'], $prolinkclick. " [".$lang_usercp['text_read_more']."]", 1); //tr_small($lang_usercp['row_promotion_link'], $prolinkclick. " [".$lang_usercp['text_update_promotion_link']."] [".$lang_usercp['text_read_more']."]", 1); } tr_small($lang_usercp['row_invitations'],$CURUSER['invites']." [".$lang_usercp['text_send']."]",1); tr_small($lang_usercp['row_karma_points'], $CURUSER['seedbonus']." [".$lang_usercp['text_use']."]", 1); tr_small($lang_usercp['row_written_comments'], $commentcount." [".$lang_usercp['text_view']."]", 1); //start seed box if (get_setting('seed_box.enabled') == 'yes') { $seedBox = ''; $columnOperator = nexus_trans('label.seed_box_record.operator'); $columnBandwidth = nexus_trans('label.seed_box_record.bandwidth'); // $columnIPBegin = nexus_trans('label.seed_box_record.ip_begin'); // $columnIPEnd = nexus_trans('label.seed_box_record.ip_end'); $columnIP = nexus_trans('label.seed_box_record.ip'); $columnIPHelp = nexus_trans('label.seed_box_record.ip_help'); $columnComment = nexus_trans('label.comment'); $columnStatus = nexus_trans('label.seed_box_record.status'); $res = \App\Models\SeedBoxRecord::query()->where('uid', $CURUSER['id'])->where('type', \App\Models\SeedBoxRecord::TYPE_USER)->get(); if ($res->count() > 0) { $seedBox .= "
"; foreach ($res as $seedBoxRecord) { $seedBox .= ""; $seedBox .= sprintf('', $seedBoxRecord->id); $seedBox .= sprintf('', $seedBoxRecord->operator); $seedBox .= sprintf('', $seedBoxRecord->bandwidth ?: ''); $seedBox .= sprintf('', $seedBoxRecord->ip ?: sprintf('%s ~ %s', $seedBoxRecord->ip_begin, $seedBoxRecord->ip_end)); $seedBox .= sprintf('', $seedBoxRecord->comment); $seedBox .= sprintf('', $seedBoxRecord->statusText); $seedBox .= sprintf('', $lang_functions['text_delete'], $seedBoxRecord->id); $seedBox .= ""; } $seedBox .= '
ID{$columnOperator}{$columnBandwidth}{$columnIP}{$columnComment}{$columnStatus}
%s%s%s%s%s%sD
'; } $seedBox .= sprintf('
', $lang_usercp['add_seed_box_btn']); tr_small($lang_usercp['row_seed_box'], $seedBox, 1); $seedBoxForm = <<
{$columnOperator}
{$columnBandwidth}
{$columnIP}
{$columnComment}
FORM; $seedBoxJs = << $label) { $permissionOptions[] = sprintf('', $name, $label); } $permissionCheckbox = implode("", $permissionOptions); $token = ''; $tokenLabel = nexus_trans("token.label"); $columnName = nexus_trans('label.name'); $columnPermission = nexus_trans('token.permission'); $columnCreatedAt = nexus_trans('label.created_at'); $actionCreate = nexus_trans('label.create'); $actionLabel = nexus_trans('label.action'); $res = $userInfo->tokens()->orderBy("id", "desc")->get(); if ($res->count() > 0) { $token .= ""; foreach ($res as $tokenRecord) { $token .= ""; $token .= sprintf('', $tokenRecord->id); $token .= sprintf('', $tokenRecord->name); $token .= sprintf('', $tokenRecord->abilitiesText); $token .= sprintf('', $tokenRecord->created_at); $token .= sprintf('', $lang_functions['text_delete'], $tokenRecord->id); $token .= ""; } $token .= '
ID{$columnName}{$columnPermission}{$columnCreatedAt}{$actionLabel}
%s%s%s%sD
'; } $token .= sprintf('
', $actionCreate); tr_small($tokenLabel, $token, 1); $tokenFoxForm = <<
{$columnName}
{$columnPermission}
$permissionCheckbox
FORM; $tokenBoxJs = <<".$lang_usercp['text_view']."] (".$dayposts.$lang_usercp['text_posts_per_day']."; ".$percentages.$lang_usercp['text_of_total_posts'].")", 1); ?> > ".$lang_usercp['text_recently_read_topics'].""); ?>
". "".$lang_usercp['col_topic_title']."". "".$lang_usercp['col_replies']."/".$lang_usercp['col_views']."". "".$lang_usercp['col_topic_starter']."". "".$lang_usercp['col_last_post']."". ""); $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"]; $topic_title = $topicarr["subject"]; $topic_userid = $topicarr["userid"]; $topic_views = $topicarr["views"]; $views = number_format($topic_views); /// GETTING TOTAL NUMBER OF POSTS /// if (!$posts = $Cache->get_value('topic_'.$topicid.'_post_count')){ $posts = get_row_count("posts","WHERE topicid=".sqlesc($topicid)); $Cache->cache_value('topic_'.$topicid.'_post_count', $posts, 3600); } $replies = max(0, $posts - 1); /// GETTING USERID AND DATE OF LAST POST /// $arr = get_post_row($topicarr['lastpost']); $postid = intval($arr["id"] ?? 0); $userid = intval($arr["userid"] ?? 0); $added = gettime($arr['added'],true,false); /// GET NAME OF LAST POSTER /// $username = get_username($userid); /// GET NAME OF THE AUTHOR /// $author = get_username($topic_userid); $subject = "" . htmlspecialchars($topicarr["subject"]) . ""; print("$subject". "".$replies."/".$views."" . "".$author."" . "".$added." | ".$username.""); } ?>