Decode
Can somebody decode this. This is from FTS 1.0 thanks
Code:
} // stdhead |
Lol where do you find this
send my the php |
This is from FTS 1.0.0 Free Torrent Source
|
|
Yes but I put that script FTS 1.0 on my domain
|
yes ok
php file but how did you find this code FTS 1.0 is one of the first releases get else fts 1.1 is more stable than many bugs are fixed We can help you but we just need the php file |
You need fuctions.php
|
Try this one :drink: include/fucktions.php [php] if (!defined('IN_TRACKER')) die('Hacking attempt!'); require_once ($rootpath . 'include/handle.php'); require_once ($rootpath . 'include/cache_init.php'); include_once ($rootpath . 'include/class_logger.php'); include_once ($rootpath . 'include/globalfunctions.php'); include_once ($rootpath . 'include/config.php'); include_once ($rootpath . 'include/html.php'); HANDLE::freq('libs.cron', 'cron'); HANDLE::freq('libs.anticheat', 'main'); HANDLE::Freq('libs.small_tools', 'ipvalidation', '.php'); HANDLE::Freq('libs.administrator','tools'); HANDLE::Freq('libs.antiflood','floodprotect'); HANDLE::Freq('libs.tools','functions_user_details' ,'.php'); $_logger = new Logger(); register_shutdown_function(array($_logger, 'Save')); HANDLE::checkins(); $CURUSER = userlogin(); require_once ($rootpath . 'include/cron-main.php'); if (basename($_SERVER['SCRIPT_FILENAME']) == 'index.php' OR basename($_SERVER['SCRIPT_FILENAME']) == 'shoutbox.php') register_shutdown_function("autoclean"); HANDLE::freq('libs.tools', 'user_rights'); $SUBSPATH = "fts-contents/subs"; include_once ($rootpath . 'include/libs/config/recaptcha.php'); include_once ($rootpath . 'include/libs/config/misc.php'); $a = mysql_fetch_assoc(mysql_query('SELECT id FROM usergroups ORDER BY id DESC LIMIT 1')); $maximumclass = (int)$a['id']; $mycl = (int)get_user_class(); if($mycl > $maximumclass) error(12,"(Maximum is $maximumclass but you have $mycl. Are you a hacker?)"); if(!get("software_database_version")) @update("software_database_version",'1.0.2'); /** * sql_query() * * @param mixed $query * @return */ function sql_query($query) { $_SESSION['queries']++; global $_db; return $_db->query($query); } /** * EmailBanned() * * @param mixed $newEmail * @return */ 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]))); if (count($addresses) > 0) { foreach ($addresses as $email) { $email = trim(strtolower(ereg_replace('\.', '\\.', $email))); if (strstr($email, "@")) { if (ereg('^@', $email)) { $email = ereg_replace('^@', '[@\\.]', $email); if (ereg("$email$", $newEmail)) return true; } } elseif (ereg('@$', $email)) { if (ereg("^$email", $newEmail)) return true; } else { if (strtolower($email) == $newEmail) return true; } } } return false; } /** * getage() * * @param mixed $year * @param mixed $month * @param mixed $day * @return */ function getage($year, $month, $day) { $year_diff = date("Y") - ($year); $month_diff = date("m") - ($month); $day_diff = date("d") - ($day); if ($month_diff < 0) $year_diff--; elseif ($month_diff == 0 && $day_diff < 0) $year_diff--; return apply_filters("getage",$year_diff); } /** * redirect() * * @param mixed $url * @param string $message * @param string $title * @param integer $wait * @param bool $usephp * @param bool $withbaseurl * @return */ function redirect($url, $message = '', $title = '', $wait = 3, $usephp = false, $withbaseurl = true) { global $SITENAME, $BASEURL, $defaulttemplate, $lang; if (empty($message)) $message = $lang->global['redirect']; if (empty($title)) $title = $SITENAME; $url = htmlspecialchars($url); $url = str_replace("&", "&", $url); $url = ($withbaseurl ? $BASEURL . '/' . $url : $url); if ($usephp) { header("Location: $url"); exit; } ob_start(); ?> ob_end_flush(); exit; } /** * cache_check() * * @param string $file * @return */ function cache_check($file = 'cachefile') { global $rootpath, $cache; $cachefile = $rootpath . $cache . '/' . $file . '.html'; $cachetime = 60 * 60; if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile))) { include ($cachefile); print (" This page last updated " . date('Y-m-d H:i:s', end_main_frame(); stdfoot(); exit; } ob_start(); } /** * cache_save() * * @param string $file * @return */ function cache_save($file = 'cachefile') { global $rootpath, $cache; $cachefile = $rootpath . $cache . '/' . $file . '.html'; $fp = fopen($cachefile, 'w'); fwrite($fp, ob_get_contents()); fclose($fp); ob_end_flush(); } /** * checkbrowser() * * @return */ function checkbrowser() { unset($browser); if (strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko')) { if (strpos($_SERVER['HTTP_USER_AGENT'], 'Netscape')) { $browser = true; } else if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox')) { $browser = true; } else { $browser = true; } } else $browser = false; if (!$browser) print (" If you enable cookies and are still unable to log in, perhaps something happened to cause a problem with your login cookie. We suggest delete your cookies and trying again. To delete cookies in Internet Explorer, go to Tools > Internet Options... and click on the Delete Cookies button. Note that this will delete all cookies stored on your system for other sites as well. ");} /** * safe_email() * * @param mixed $email * @return */ function safe_email($email) { $email = str_replace("<", "", $email); $email = str_replace(">", "", $email); $email = str_replace("\'", "", $email); $email = str_replace('\"', "", $email); $email = str_replace("\\\\", "", $email); return apply_filters("safe_email",$email); } /** * check_email() * * @param mixed $email * @return */ function check_email($email) { if (ereg("^([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", $email)) return true; else return false; } /** * sent_mail() * * @param mixed $to * @param mixed $fromname * @param mixed $fromemail * @param mixed $subject * @param mixed $body * @param string $type * @param bool $showmsg * @param bool $multiple * @param string $multiplemail * @return */ function sent_mail($to, $fromname, $fromemail, $subject, $body, $type = "confirmation", $showmsg = true, $multiple = false, $multiplemail = '') { global $rootpath, $SITENAME, $SITEEMAIL, $smtptype, $smtp, $smtp_host, $smtp_port, $smtp_from, $smtpaddress, $smtpport, $accountname, $accountpassword; if ($smtptype == 'default') { @mail($to, $subject, $body, "From: $SITEEMAIL", "-f$SITEEMAIL") or stderr("Error", "Unable to send mail. Please contact an administrator about this error."); } elseif ($smtptype == 'advanced') { if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { $eol = "\r\n"; $windows = true; } elseif (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) $eol = "\r"; else $eol = "\n"; $mid = md5(IP::getip() . $fromname); $name = $_SERVER["SERVER_NAME"]; $headers .= "From: $fromname <$fromemail>" . $eol; $headers .= "Reply-To: $fromname <$fromemail>" . $eol; $headers .= "Return-Path: $fromname <$fromemail>" . $eol; $headers .= "Message-ID: <$mid thesystem@$name>" . $eol; $headers .= "X-Mailer: PHP v" . phpversion() . $eol; $headers .= "MIME-Version: 1.0" . $eol; $headers .= "X-Sender: PHP" . $eol; if ($multiple) $headers .= "Bcc: $multiplemail.$eol"; if ($smtp == "yes") { ini_set('SMTP', $smtp_host); ini_set('smtp_port', $smtp_port); if ($windows) ini_set('sendmail_from', $smtp_from); } @mail($to, $subject, $body, $headers) or stderr("Error", "Unable to send mail. Please contact an administrator about this error."); ini_restore(SMTP); ini_restore(smtp_port); if ($windows) ini_restore(sendmail_from); } elseif ($smtptype == 'external') { require ($rootpath . 'include/smtp/smtp.lib.php'); $mail = new smtp; $mail->debug(false); $mail->open($smtpaddress, $smtpport); $mail->auth($accountname, $accountpassword); $mail->from($SITEEMAIL); $mail->to($to); $mail->subject($subject); $mail->body($body); $mail->send(); $mail->close(); } if ($showmsg) { if ($type == "confirmation") stderr("Success", "A confirmation email has been mailed to " . htmlspecialchars($to) . ".\n" . "Please allow a few minutes for the mail to arrive.", false); else if ($type == "details") stderr("Success", "The new account details have been mailed to " . htmlspecialchars($to) . ".\n" . "Please allow a few minutes for the mail to arrive.", false); } else return true; } include 'class_failedlogin.php'; /** * warn_debug() * * @return */ function warn_debug() { } /** * registration_check() * * @param string $type * @param bool $maxuserscheck * @param bool $ipcheck * @return */ function registration_check($type = "invitesystem", $maxuserscheck = true, $ipcheck = true) { global $invitesystem, $registration, $maxusers, $SITENAME, $maxip; if ($type == "invitesystem") { if ($invitesystem == "off") { stderr("Sorry", "Invite System is currently disabled."); } } if ($type == "normal") { if ($registration == "off") { stderr("Sorry", "Registration is currently disabled."); } } if ($maxuserscheck) { $res = mysql_query("SELECT COUNT(*) FROM users") or sqlerr(__file__, __line__); $arr = mysql_fetch_row($res); if ($arr[0] >= $maxusers) stderr("Sorry", "The current user account limit has been reached. Inactive accounts are pruned all the time, please check back again later..."); } if ($ipcheck) { $ip = IP::getip(); $a = (@mysql_fetch_row(@mysql_query("select count(*) from users where ip='" . mysql_real_escape_string($ip) . "'"))) or sqlerr(__file__, __line__); if ($a[0] >= $maxip) stderr("Sorry", "The IP " . htmlspecialchars($ip) . " is Already being used on one or more accounts($a[0]).... No Dupe accounts allowed at $SITENAME.", false); } do_action("registration_check"); } HANDLE::Freq('libs.image_verification', 'iv', '.php'); /** * maxslots() * * @return */ function maxslots() { global $CURUSER, $maxdlsystem; $gigs = $CURUSER["uploaded"] / (1024 * 1024 * 1024); $ratio = (($CURUSER["downloaded"] > 0) ? ($CURUSER["uploaded"] / $CURUSER["downloaded"]) : 1); if ($ratio < 0.5 || $gigs < 5) $max = 1; elseif ($ratio < 0.65 || $gigs < 6.5) $max = 2; elseif ($ratio < 0.8 || $gigs < 8) $max = 3; elseif ($ratio < 0.95 || $gigs < 9.5) $max = 4; else $max = 0; if ($maxdlsystem == "yes") { if ($CURUSER["class"] < UC_VIP) { if ($max > 0) print ("Slots: $max"); else print ("Slots: Unlimited"); } else print ("Slots: Unlimited"); } else print ("Slots: Unlimited"); } /** * dbconn() * * @param bool $autoclean * @return */ function dbconn($autoclean = false) { } if(!function_exists("error")) { /** * error() * * @param mixed $errorid * @param string $exmess * @return */ function error($errorid, $exmess = '') { define('errorid', $errorid); if (!empty($exmess)) define('exmess', $exmess); global $rootpath; include $rootpath . 'error.php'; die; } } /** * userlogin() * * @return */ function userlogin() { global $SITE_ONLINE, $iplog1, $rootpath; unset($GLOBALS["CURUSER"]); $ip = IP::getip(); $nip = ip2long($ip); $res = mysql_query("SELECT * FROM bans WHERE $nip >= first AND $nip <= last") or sqlerr(__file__, __line__); if (mysql_num_rows($res) > 0) { error(9); } global $_pg_enable; if($_pg_enable == 'yes'): $respg = mysql_query("SELECT * FROM peerguardian WHERE $nip >= first AND $nip <= last") or sqlerr(__file__, __line__); if (mysql_num_rows($respg) > 0) { $peerg = mysql_fetch_assoc($respg); $text = "We come to belive that you are an Anti-P2P organization($peerg[comment]), so we banned your ip class."; error(13,$text); } endif; if (empty($_COOKIE["c_secure_pass"]) || empty($_COOKIE["c_secure_uid"]) || empty ($_COOKIE["c_secure_login"])) return; if ($_COOKIE["c_secure_login"] == base64("yeah")) if (empty($_SESSION["s_secure_uid"]) || empty($_SESSION["s_secure_pass"])) return; $b_id = base64($_COOKIE["c_secure_uid"], false); $id = 0 + $b_id; if (!$id || !is_valid_id($id) || strlen($_COOKIE["c_secure_pass"]) != 32) return; if ($_COOKIE["c_secure_login"] == base64("yeah")) if (strlen($_SESSION["s_secure_pass"]) != 32) return; $res = mysql_query("SELECT users.*, NOW() as ctime FROM users WHERE id = " . mysql_real_escape_string($id) . " AND enabled='yes' AND status = 'confirmed' LIMIT 1"); $row = mysql_fetch_array($res); if (!$row) return; $sec = hash_pad($row["secret"]); global $sechash; if ($_COOKIE["c_secure_pass"] !== md5($row["passhash"] . $sechash)) return; if ($_COOKIE["c_secure_login"] == base64("yeah")) if ($_SESSION["s_secure_pass"] !== md5($row["passhash"] . $sechash)) return; if (!$row["passkey"]) { $passkey = md5($row['username'] . get_date_time() . $row['passhash']); mysql_query("UPDATE users SET passkey = " . sqlesc($passkey) . " WHERE id=" . mysql_real_escape_string($row["id"])); } if ($iplog1 == "yes") { if (($ip != $row["ip"]) && $row["ip"]) mysql_query("INSERT INTO iplog (ip, userid, access) VALUES (" . sqlesc($row["ip"]) . ", " . $row["id"] . ", '" . $row["last_access"] . "')"); } mysql_query("UPDATE users SET last_access='" . get_date_time() . "', ip=" . sqlesc($ip) . " WHERE id=" . mysql_real_escape_string($row["id"])); $row['ip'] = $ip; $usergroup = $row['class']; $get_group_data = sql_query('SELECT * FROM usergroups WHERE id = ' . sqlesc($usergroup)); $group_data_results = mysql_fetch_array($get_group_data); $GLOBALS["usergroups"] = $group_data_results; $_defaults_ = array( "canpostintopics" => 'yes', ); $add_args = parse_args(unserialize($GLOBALS["usergroups"]['args'])); $GLOBALS["usergroups"] += $add_args; return $row; } /** * autoclean() * * @return */ function autoclean() { global $autoclean_interval, $rootpath; $now = time(); $docleanup = 0; $res = mysql_query("SELECT value_u FROM avps WHERE arg = 'lastcleantime'"); $row = mysql_fetch_array($res); if (!$row) { mysql_query("INSERT INTO avps (arg, value_u) VALUES ('lastcleantime',$now)"); return; } $ts = $row[0]; if ($ts + $autoclean_interval > $now) return; mysql_query("UPDATE avps SET value_u=$now WHERE arg='lastcleantime' AND value_u = $ts"); if (!mysql_affected_rows()) return; if (!update('lastcron', $now)) { add('lastcron', $now); } docleanup(); } /** * unesc() * * @param mixed $x * @return */ function unesc($x) { if (get_magic_quotes_gpc()) return stripslashes($x); return $x; } /** * mksize() * * @param mixed $bytes * @return */ function mksize($bytes) { if ($bytes < 1000 * 1024) return number_format($bytes / 1024, 2) . " KB"; elseif ($bytes < 1000 * 1048576) return number_format($bytes / 1048576, 2) . " MB"; elseif ($bytes < 1000 * 1073741824) return number_format($bytes / 1073741824, 2) . " GB"; else return number_format($bytes / 1099511627776, 2) . " TB"; } /** * mksizeint() * * @param mixed $bytes * @return */ function mksizeint($bytes) { $bytes = max(0, $bytes); if ($bytes < 1000) return floor($bytes) . " B"; elseif ($bytes < 1000 * 1024) return floor($bytes / 1024) . " kB"; elseif ($bytes < 1000 * 1048576) return floor($bytes / 1048576) . " MB"; elseif ($bytes < 1000 * 1073741824) return floor($bytes / 1073741824) . " GB"; else return floor($bytes / 1099511627776) . " TB"; } /** * deadtime() * * @return */ function deadtime() { global $announce_interval; return time() - floor($announce_interval * 1.3); } /** * mkprettytime() * * @param mixed $s * @return */ function mkprettytime($s) { if ($s < 0) $s = 0; $t = array(); foreach (array("60:sec", "60:min", "24:hour", "0:day") as $x) { $y = explode(":", $x); if ($y[0] > 1) { $v = $s % $y[0]; $s = floor($s / $y[0]); } else $v = $s; $t[$y[1]] = $v; } if ($t["day"]) return $t["day"] . "d " . sprintf("%02d:%02d:%02d", $t["hour"], $t["min"], $t["sec"]); if ($t["hour"]) return sprintf("%d:%02d:%02d", $t["hour"], $t["min"], $t["sec"]); return sprintf("%d:%02d", $t["min"], $t["sec"]); } /** * mkglobal() * * @param mixed $vars * @return */ function mkglobal($vars) { if (!is_array($vars)) $vars = explode(":", $vars); foreach ($vars as $v) { if (isset($_GET[$v])) $GLOBALS[$v] = unesc($_GET[$v]); elseif (isset($_POST[$v])) $GLOBALS[$v] = unesc($_POST[$v]); else return 0; } return 1; } /** * tr() * * @param mixed $x * @param mixed $y * @param integer $noesc * @param string $relation * @param string $params1 * @param string $params2 * @return */ function tr($x, $y, $noesc = 0, $relation = '', $params1 = '', $params2 = '') { if ($noesc) $a = $y; else { $a = htmlspecialchars($y); $a = str_replace("\n", " \n", $a); } print (" $x |
$params2 . " align=left>$a | } /** * validfilename() * * @param mixed $name * @return */ function validfilename($name) { return preg_match('/^[^\0-\x1f:\\\\\/?*\xff#<>|]+$/si', $name); } /** * validemail() * * @param mixed $email * @return */ function validemail($email) { return preg_match('/^[\w.-]+@([\w.-]+\.)+[a-z]{2,6}$/is', $email); } /** * sqlesc() * * @param mixed $value * @return */ function sqlesc($value) { if (get_magic_quotes_gpc()) { $value = stripslashes($value); } if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value) . "'"; } return apply_filters("sqlesc",$value); } /** * sqlwildcardesc() * * @param mixed $x * @return */ function sqlwildcardesc($x) { return str_replace(array("%", "_"), array("\\%", "\\_"), mysql_real_escape_string($x)); } /** * urlparse() * * @param mixed $m * @return */ function urlparse($m) { $t = $m[0]; if (preg_match(',^\w+://,', $t)) return "$t"; return "$t"; } /** * parsedescr() * * @param mixed $d * @param mixed $html * @return */ function parsedescr($d, $html) { if (!$html) { $d = htmlspecialchars($d); $d = str_replace("\n", "\n ", $d); } return apply_filters("parsedescr","$d"); } /** * where() * * @param string $scriptname * @param mixed $userid * @return */ function where($scriptname = "index", $userid) { global $where; if ($where == "yes") { if (!is_valid_id($userid)) die; $wheref = "$scriptname"; $query = sprintf("UPDATE users SET page=" . sqlesc($wheref) . " WHERE id ='%s'", mysql_real_escape_string($userid)); $result = mysql_query($query); if (!$result) sqlerr(__file__, __line__); else return $wheref; } return; } /** * menu() * * @param string $selected * @return */ function menu($selected = "home") { global $BASEURL; $script_name = $_SERVER["SCRIPT_FILENAME"]; if (preg_match("/index/i", $script_name)) { $selected = "home"; } elseif (preg_match("/browse/i", $script_name)) { $selected = "browse"; } elseif (preg_match("/viewrequests/i", $script_name) or preg_match("/viewoffers/i", $script_name) or preg_match("/offcomment/i", $script_name) or preg_match("/reqcomment/i", $script_name)) { $selected = "requests"; } elseif (preg_match("/upload/i", $script_name)) { $selected = "upload"; } elseif (preg_match("/usercp/i", $script_name)) { $selected = "usercp"; } elseif (preg_match("/forums/i", $script_name)) { $selected = "forums"; } elseif (preg_match("/topten/i", $script_name)) { $selected = "topten"; } elseif (preg_match("/rules/i", $script_name)) { $selected = "rules"; } elseif (preg_match("/faq/i", $script_name)) { $selected = "faq"; } elseif (preg_match("/links/i", $script_name)) { $selected = "links"; } elseif (preg_match("/staff/i", $script_name)) { $selected = "staff"; } else $selected = ""; print ("
print (" print (" print (" print (" print (" print (" print (" print (" print (" print (" print (" } /** * ug() * * @param mixed $add * @return */ function ug($add = array()) { stderr('Error', apply_filters("ug","You do not have permission to access this page. This could be because of one of the following reasons: 1. Your account has either been suspended or you have been banned from accessing this resource. 2. You do not have permission to access this page. Are you trying to access administrative pages or a resource that you shouldn\'t be? Check in the tracker rules that you are allowed to perform this action. 3. Your account may still be awaiting activation or moderation. 4. Feel free to contact us about this error message. "), false,true,true,false); die; } /** * fts_register_menu() * * @param mixed $id * @param mixed $c * @return */ function fts_register_menu($id, $c) { if (is_array($c)) { echo ""; } } /** * fts_show_menu() * * @param mixed $id * @param mixed $text * @return */ function fts_show_menu($id, $text) { return "$text"; } /** * ftsmenu() * * @return */ function ftsmenu() { ?> } /** * ftsmenu2() * * @param string $width * @return */ function ftsmenu2($width = "150px") { ?> } /** * scripts() * * @return */ function scripts() { global $CURUSER, $SITE_ONLINE, $FUNDS, $SITENAME, $SITEEMAIL, $BASEURL, $offlinemsg, $disablerightclick, $showversion, $autorefreshtime, $autorefresh, $leftmenu, $rootpath; do_action("scripts"); javascript('collapse'); javascript('global'); JsB::insertjq(1); ?> if ($leftmenu == "yes") { ?> javascript('ssm'); ?> } javascript('java_klappe'); javascript('ncode_imageresizer'); ?> if ($disablerightclick == "yes") { ?> } ?> } /** * ads() * * @return */ function ads() { global $DISABLE_ADS; if(isset($DISABLE_ADS) AND $DISABLE_ADS) return; global $BASEURL; define('rpt', './../'); if (@dbv('ads')) { $ads = @dbv('ads'); if (!empty($ads) AND $ads != "---") { print ('
'); } } do_action("ads"); } /** * makevars() * * @return */ function makevars() { global $BASEURL; return apply_filters("makevars",""); } /** * stdhead() * * @param string $title * @param bool $msgalert * @param string $script * @return */ function stdhead($title = "", $msgalert = true, $script = "") { do_action("stdhead_start"); global $rootpath; include $rootpath . 'include/class_template.php'; global $CURUSER, $SITE_ONLINE, $FUNDS, $SITENAME, $SITEEMAIL, $BASEURL, $offlinemsg, $disablerightclick, $showversion, $autorefreshtime, $autorefresh, $leftmenu, $template, $usergroups, $rootpath; if ($usergroups['isbanned'] == 'yes') { error(10); } if ($SITE_ONLINE == "no") { if (get_user_class() < UC_ADMINISTRATOR) { die("Site is down for maintenance, please check back again later... thanks "); } else { $offlinemsg = true; } } header("Content-Type: text/html; charset=iso-8859-1"); if ($title == "") $title = $SITENAME . $showversion; else $title = "$SITENAME :: " . htmlspecialchars($title) . "$showversion"; if ($msgalert && $CURUSER) { $res = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " && unread='yes'") or die("OopppsY!"); $arr = mysql_fetch_row($res); $unread = $arr[0]; } if ($CURUSER) { $datum = getdate(); $datum["hours"] = sprintf("%02.0f", $datum["hours"]); $datum["minutes"] = sprintf("%02.0f", $datum["minutes"]); $uped = mksize($CURUSER['uploaded']); $downed = mksize($CURUSER['downloaded']); if ($CURUSER["downloaded"] > 0) { $ratio = $CURUSER['uploaded'] / $CURUSER['downloaded']; $ratio = number_format($ratio, 3); $ratio = "$ratio"; } else if ($CURUSER["uploaded"] > 0) $ratio = "Inf."; else $ratio = "---"; if ($CURUSER['donor'] == "yes") $medaldon = ""; if ($CURUSER['warned'] == "yes") $warn = ""; $res1 = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " AND location<>0") or print (mysql_error()); $arr1 = mysql_fetch_row($res1); $messages = $arr1[0]; $res1 = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " AND location=1 AND unread='yes'") or print (mysql_error()); $arr1 = mysql_fetch_row($res1); $unread = $arr1[0]; $res1 = mysql_query("SELECT COUNT(*) FROM messages WHERE sender=" . $CURUSER["id"] . " AND saved='yes'") or print (mysql_error()); $arr1 = mysql_fetch_row($res1); $outmessages = $arr1[0]; $res1 = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " && unread='yes'") or die("OopppsY!"); $arr1 = mysql_fetch_row($res1); $unread = $arr1[0]; if ($unread) $inboxpic = ""; else $inboxpic = ""; $res2 = mysql_query("SELECT COUNT(*) FROM peers WHERE userid=" . $CURUSER["id"] . " AND seeder='yes'") or print (mysql_error()); $row = mysql_fetch_row($res2); $activeseed = $row[0]; $res2 = mysql_query("SELECT COUNT(*) FROM peers WHERE userid=" . $CURUSER["id"] . " AND seeder='no'") or print (mysql_error()); $row = mysql_fetch_row($res2); $activeleech = $row[0]; $res3 = mysql_query("SELECT connectable FROM peers WHERE userid=" . sqlesc($CURUSER["id"]) . " LIMIT 1") or print (mysql_error()); if ($row = mysql_fetch_row($res3)) { $connect = $row[0]; if ($connect == "yes") { $connectable = "Yes"; } else { $connectable = "No"; } } else { $connectable = "waiting..."; } } global $rootpath, $defaulttemplate; $template = !empty($CURUSER['skin']) ? $CURUSER['skin'] : $defaulttemplate; if (file_exists($rootpath . 'fts-contents/templates/' . $template . '/head.php')) include $rootpath . 'fts-contents/templates/' . $template . '/head.php'; elseif (file_exists($rootpath . 'fts-contents/templates/' . $template . '/header.php')) include $rootpath . 'fts-contents/templates/' . $template . '/header.php'; do_action("stdhead_end"); } /** * cpfooter() * * @return */ function cpfooter() { $referring_url = $_SERVER['HTTP_REFERER']; print ("
} /** * copyright() * * @param mixed $get_it * @return */ function copyright($get_it = none) { static $found = false; if ($get_it === true) return $found; if ($get_it == 'none') { $found = true; } $yearpast = date(Y) - 1; $yearnow = date(Y); global $forumc; if ($forumc == 'show') { global $rootpath; include $rootpath . 'forums/functions/ver.php'; echo "Powered by FF ".FFver."| FF © $yearpast-$yearnow, Free Forums LLC "; } else echo "Powered by FTS ".VERSION."| FTS © $yearpast-$yearnow, Free Torrent Source LLC "; do_action("copyright"); } /** * stdfoot() * * @return */ function stdfoot() { do_action("stdfoot_start"); global $SITENAME, $BASEURL, $template; global $rootpath; $mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime; $mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); if (file_exists($rootpath . 'fts-contents/templates/' . $template . '/foot.php')) include $rootpath . 'fts-contents/templates/' . $template . '/foot.php'; elseif (file_exists($rootpath . 'fts-contents/templates/' . $template . '/footer.php')) include $rootpath . 'fts-contents/templates/' . $template . '/footer.php'; $check = false; global $FTSpass; if($check && !$FTSpass['copy']): if (!copyright(true)) { echo ' Sorry, the copyright must be in the template. Please notify this site\'s administrator that this site is missing the copyright message for FTS so they can rectify the situation. Display of copyright is a legal requirement. } endif; do_action("stdfoot_end"); } /** * genbark() * * @param mixed $x * @param mixed $y * @return */ function genbark($x, $y) { stdhead($y); print (" " . htmlspecialchars($y) . "\n");print (" " . htmlspecialchars($x) . " \n");stdfoot(); exit(); } /** * javaredirect() * * @param mixed $where * @param bool $echo * @return */ function javaredirect($where,$echo = true) { if(!$echo) { return << e; } else { echo << e; } } /** * doredir() * * @param mixed $where * @param bool $echo * @return void */ function doredir($where,$echo = true) { if(headers_sent()) { javaredirect($where,$echo); } else header('location:'.$where); } /** * mksecret() * * @param integer $len * @return */ function mksecret($len = 20) { $ret = ""; for ($i = 0; $i < $len; $i++) $ret .= chr(mt_rand(0, 255)); return apply_filters("mksecret",$ret); } /** * httperr() * * @param integer $code * @return */ function httperr($code = 404) { header("HTTP/1.0 404 Not found"); print (" Not Found\n");print (" Sorry pal :( \n");exit(); } /** * gmtime() * * @return */ function gmtime() { return strtotime(get_date_time()); } /** * sessioncookie() * * @param mixed $id * @param mixed $passhash * @param bool $expires * @return */ function sessioncookie($id, $passhash, $expires = false) { if ($expires) $GLOBALS[$sessioncacheexpire] = true; $_SESSION['s_secure_uid'] = base64($id); $_SESSION['s_secure_pass'] = $passhash; return apply_filters("sessioncookie",$sessioncacheexpire); } /** * logincookie() * * @param mixed $id * @param mixed $passhash * @param integer $updatedb * @param integer $expires * @param bool $securelogin * @return */ function logincookie($id, $passhash, $updatedb = 1, $expires = 0x7fffffff, $securelogin = true) { if ($expires != 0x7fffffff) $expires = time() + 900; setcookie("c_secure_uid", base64($id), $expires, "/"); setcookie("c_secure_pass", $passhash, $expires, "/"); if ($securelogin) setcookie("c_secure_login", base64("yeah"), $expires, "/"); else setcookie("c_secure_login", base64("nope"), $expires, "/"); if ($updatedb) mysql_query("UPDATE users SET last_login = NOW() WHERE id = " . mysql_real_escape_string($id)); } /** * logoutsession() * * @return */ function logoutsession() { session_unset(); session_destroy(); } /** * logoutcookie() * * @return */ function logoutcookie() { setcookie("c_secure_uid", "", 0x7fffffff, "/"); setcookie("c_secure_pass", "", 0x7fffffff, "/"); setcookie("c_secure_login", "", 0x7fffffff, "/"); } /** * base64() * * @param mixed $string * @param bool $encode * @return */ function base64($string, $encode = true) { if ($encode) return base64_encode($string); else return base64_decode($string); } /** * loggedinorreturn() * * @param bool $mainpage * @return */ function loggedinorreturn($mainpage = false) { global $CURUSER, $BASEURL; if (!$CURUSER) { if ($mainpage) header("Location: $BASEURL/login.php"); else { $to = $_SERVER["REQUEST_URI"]; header("Location: $BASEURL/login.php?returnto=" . urlencode($to)); } exit(); } } /** * deletetorrent() * * @param mixed $id * @return */ function deletetorrent($id) { global $torrent_dir; mysql_query("DELETE FROM torrents WHERE id = " . mysql_real_escape_string($id)); mysql_query("DELETE FROM snatched WHERE torrentid = " . mysql_real_escape_string ($id)); foreach (explode(".", "peers.files.comments.ratings") as $x) mysql_query("DELETE FROM $x WHERE torrent = " . mysql_real_escape_string($id)); unlink("$torrent_dir/$id.torrent"); do_action("deletetorrent"); } /** * pager() * * @param mixed $rpp * @param mixed $count * @param mixed $href * @param mixed $opts * @return */ function pager($rpp, $count, $href, $opts = array()) { $pages = ceil($count / $rpp); if (!$opts["lastpagedefault"]) $pagedefault = 0; else { $pagedefault = floor(($count - 1) / $rpp); if ($pagedefault < 0) $pagedefault = 0; } if (isset($_GET["page"])) { $page = 0 + $_GET["page"]; if ($page < 0) $page = $pagedefault; } else $page = $pagedefault; $pager_next = ""; $pager_prev = ""; $mp = $pages - 1; if ($page >= 1) { $pager_prev .= " } else $pager_prev .= " if ($page < $mp && $mp >= 0) { $pager_next .= " } else $pager_next .= " $pager = ""; $mp = $pages - 1; $as = "<< Prev"; if ($page >= 1) { $pager .= ""; $pager .= $as; $pager .= ""; } else $pager .= $as; $pager .= " "; $as = "Next >>"; if ($page < $mp && $mp >= 0) { $pager .= ""; $pager .= $as; $pager .= ""; } else $pager .= $as; if ($count) { $pagerarr = array(); $dotted = 0; $dotspace = 2; $dotend = $pages - $dotspace; $curdotend = $page - $dotspace; $curdotstart = $page + $dotspace; for ($i = 0; $i < $pages; $i++) { if (($i >= $dotspace && $i <= $curdotend) || ($i >= $curdotstart && $i < $dotend)) { if (!$dotted) $pagerarr[] = " $dotted = 1; continue; } $dotted = 0; $start = $i * $rpp + 1; $end = $start + $rpp - 1; if ($end > $count) $end = $count; $text = "$start - $end"; if ($i != $page) $pagerarr[] = " else $pagerarr[] = " } $pagerstr = join("", $pagerarr); $pagertop = " $pagerbottom = " } else { $pagertop = " $pager \n";$pagerbottom = $pagertop; } $start = $page * $rpp; return array($pagertop, $pagerbottom, "LIMIT $start,$rpp"); } /** * downloaderdata() * * @param mixed $res * @return */ function downloaderdata($res) { $rows = array(); $ids = array(); $peerdata = array(); while ($row = mysql_fetch_assoc($res)) { $rows[] = $row; $id = $row["id"]; $ids[] = $id; $peerdata[$id] = array(downloaders => 0, seeders => 0, comments => 0); } if (count($ids)) { $allids = implode(",", $ids); $res = mysql_query("SELECT COUNT(*) AS c, torrent, seeder FROM peers WHERE torrent IN ($allids) GROUP BY torrent, seeder"); while ($row = mysql_fetch_assoc($res)) { if ($row["seeder"] == "yes") $key = "seeders"; else $key = "downloaders"; $peerdata[$row["torrent"]][$key] = $row["c"]; } $res = mysql_query("SELECT COUNT(*) AS c, torrent FROM comments WHERE torrent IN ($allids) GROUP BY torrent"); while ($row = mysql_fetch_assoc($res)) { $peerdata[$row["torrent"]]["comments"] = $row["c"]; } } return array($rows, $peerdata); } /** * commenttable() * * @param mixed $rows * @return */ function commenttable($rows) { global $CURUSER; begin_main_frame('100%'); begin_frame('', false, '10', '100%'); $count = 0; foreach ($rows as $row) { print (" #" . $row["id"] . " by "); $avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars(trim($row["avatar"])) : ""); if (!$avatar) $avatar = "pic/default_avatar.gif"; $text = format_comment($row["text"]); if ($row["editedby"]) $text .= " Last edited by $row[username] at $row[editedat] GMT \n";$text = apply_filters("comment_text",$text); begin_table(true); $dt = gmtime() - 180; $dt = sqlesc(get_date_time($dt)); print (" print (" \n"); | print (" $text | \n");print (" print (" " . ("'" . $row['last_access'] . "'" > $dt ? | ");"" : "") . " htmlspecialchars(trim($row["user"])) . "\"> htmlspecialchars($row["username"]) . "\"> htmlspecialchars(trim($row["id"])) . "\"> end_table(); } end_frame(); end_main_frame(); } /** * searchfield() * * @param mixed $s * @return */ function searchfield($s) { return apply_filters("searchfield",preg_replace(array('/[^a-z0-9]/si', '/^\s*/s', '/\s*$/s', '/\s+/s'), array(" ", "", "", " "), $s)); } /** * genrelist() * * @return */ function genrelist() { $ret = array(); $res = mysql_query("SELECT id, name FROM categories ORDER BY name"); while ($row = mysql_fetch_array($res)) $ret[] = $row; return apply_filters("genrelist",$ret); } /** * linkcolor() * * @param mixed $num * @return */ function linkcolor($num) { if (!$num) return "red"; return "green"; } /** * ratingpic() * * @param mixed $num * @return */ function ratingpic($num) { global $pic_base_url, $rootpath; $r = round($num * 2) / 2; if ($r < 1 || $r > 5) return; return ""; } /** * writecomment() * * @param mixed $userid * @param mixed $comment * @return */ function writecomment($userid, $comment) { $res = mysql_query("SELECT modcomment FROM users WHERE id = '$userid'") or sqlerr(__file__, __line__); $arr = mysql_fetch_assoc($res); $modcomment = gmdate("d-m-Y") . " - " . $comment . "" . ($arr[modcomment] != "" ? "\n\n" : "") . "$arr[modcomment]"; $modcom = sqlesc($modcomment); return mysql_query("UPDATE users SET modcomment = $modcom WHERE id = '$userid'") or sqlerr(__file__, __line__); } /** * _torrents() * * @param mixed $res * @param string $variant * @return */ function _torrents($res, $variant = "index") { do_action("_torrents_start"); global $pic_base_url, $CURUSER, $waitsystem; unset($wait); $browse_res = mysql_query("SELECT last_browse FROM users WHERE id=" . sqlesc($CURUSER[id])); $browse_arr = mysql_fetch_row($browse_res); $last_browse = $browse_arr[0]; $time_now = gmtime(); if ($last_browse > $time_now) { $last_browse = $time_now; } if ($CURUSER["class"] < UC_VIP) { if ($waitsystem == "yes") { $gigs = $CURUSER["uploaded"] / (1024 * 1024 * 1024); $ratio = (($CURUSER["downloaded"] > 0) ? ($CURUSER["uploaded"] / $CURUSER["downloaded"]) : 0); if ($ratio < 0.5 || $gigs < 5) $wait = 48; elseif ($ratio < 0.65 || $gigs < 6.5) $wait = 24; elseif ($ratio < 0.8 || $gigs < 8) $wait = 12; elseif ($ratio < 0.95 || $gigs < 9.5) $wait = 6; else $wait = 0; } } ?>
Free download (only upload stats are recorded! Double Upload (upload stats are recorded double!) \n");do_action("_torrents_end"); return $rows; } /** * add_shout() * * @param string $m * @return */ function add_shout($m = '') { $message = "/notice " . $m; mysql_query("INSERT INTO shoutbox (date, text, userid, username) VALUES (" . implode(", ", array_map("sqlesc", array(time(), $message, '1', 'system'))) . ")") or sqlerr(__file__, __line__); } /** * iplogger() * * @return */ function iplogger() { global $HTTP_SERVER_VARS, $CURUSER, $iplog2; if ($iplog2 == "yes") { $ip = IP::getip(); $res = mysql_query("SELECT * FROM ips WHERE ip = '" . mysql_real_escape_string($ip) . "' AND userid = " . mysql_real_escape_string($CURUSER[id])) or die(mysql_error()); if (mysql_num_rows($res) == 0) { mysql_query("INSERT INTO ips(userid,ip) VALUES ('" . mysql_real_escape_string($CURUSER[id]) . "', '" . mysql_real_escape_string($ip) . "')") or die(mysql_error()); } } } /** * fancy() * * @param mixed $text * @param integer $withp * @return */ function fancy($text, $withp = 0) { echo apply_filters("fancy",($withp ? " " : "")." ?> } /** * get_extension() * * @param mixed $file * @return */ function get_extension($file) { return strtolower(substr(strrchr($file, "."), 1)); } /** * dir_list() * * @param mixed $dir * @param integer $istemplate * @return */ function dir_list($dir, $istemplate = 0) { global $rootpath; $dl = array(); $ext = ''; if (!file_exists($dir)) error1(); if ($hd = opendir($dir)) { while ($sz = readdir($hd)) { $ext = get_extension($sz); if ($istemplate) { if (preg_match("/^\./", $sz) == 0 && $ext != 'php' && file_exists($rootpath . "fts-contents/templates/$sz/info_template.xml") && $sz != 'administrator-templates') $dl[] = $sz; } else { if (preg_match("/^\./", $sz) == 0 && $ext != 'php') $dl[] = $sz; } } closedir($hd); asort($dl); return $dl; } else error1('', 'Couldn\'t open storage folder! Please check the path.'); } /** * javascript() * * @param mixed $scr * @return */ function javascript($scr) { if (is_array($scr)) { foreach ($src as $s); javascript($s); } else { global $rootpath; echo ''; } } /** * cssload() * * @param mixed $css * @return */ function cssload($css) { if (is_array($css)) { foreach ($css as $c) ; javascript($c); } else { global $BASEURL; echo ''; } } /** * hash_pad() * * @param mixed $hash * @return */ function hash_pad($hash) { return apply_filters("hash_pad",str_pad($hash, 20)); } /** * hash_where() * * @param mixed $name * @param mixed $hash * @return */ function hash_where($name, $hash) { $shhash = preg_replace('/ *$/s', "", $hash); return "($name = " . sqlesc($hash) . " OR $name = " . sqlesc($shhash) . ")"; } /** * get_user_icons() * * @param mixed $arr * @param bool $big * @return */ function get_user_icons($arr, $big = false) { if ($big) { $donorpic = "starbig.gif"; $leechwarnpic = "warnedbig.gif"; $warnedpic = "warnedbig3.gif"; $disabledpic = "disabledbig.gif"; $style = "style='margin-left: 4pt'"; } else { $donorpic = "star.gif"; $leechwarnpic = "warned.gif"; $warnedpic = "warned3.gif"; $disabledpic = "disabled.gif"; $style = "style=\"margin-left: 2pt\""; } $pics = $arr["donor"] == "yes" ? "" : ""; if ($arr["enabled"] == "yes") $pics .= ($arr["leechwarn"] == "yes" ? "" : "") . ($arr["warned"] == "yes" ? "" : ""); else $pics .= "\n"; return apply_filters("get_user_icons",$pics); } /** * get_percent_completed_image() * * @param mixed $p * @return */ function get_percent_completed_image($p) { $maxpx = "45"; if ($p == 0) $progress = ""; if ($p == 100) $progress = ""; if ($p >= 1 && $p <= 30) $progress = ""; if ($p >= 31 && $p <= 65) $progress = ""; if ($p >= 66 && $p <= 99) $progress = ""; return "" . $progress . ""; } /** * parked() * * @return */ function parked() { global $CURUSER; if ($CURUSER["parked"] == "yes") stderr("Access Denied!", "Your account is parked."); } /** * quote_smart() * * @param mixed $value * @return */ function quote_smart($value) { if (get_magic_quotes_gpc()) { $value = stripslashes($value); } if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value) . "'"; } return apply_filters("quote_smart",$value); } /** * sec2hms() * * @param mixed $sec * @param bool $padHours * @return */ function sec2hms($sec, $padHours = false) { $hms = ""; $hours = intval(intval($sec) / 3600); $hms .= ($padHours) ? str_pad($hours, 2, "0", STR_PAD_LEFT) . ':' : $hours . ':'; $minutes = intval(($sec / 60) % 60); $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT) . ':'; $seconds = intval($sec % 60); $hms .= str_pad($seconds, 2, "0", STR_PAD_LEFT); return $hms; } /** * auto_enter_cheater() * * @param mixed $userid * @param mixed $rate * @param mixed $upthis * @param mixed $diff * @param mixed $torrentid * @param mixed $client * @param mixed $ip * @param mixed $last_up * @return */ function auto_enter_cheater($userid, $rate, $upthis, $diff, $torrentid, $client, $ip, $last_up) { mysql_query("INSERT INTO cheaters (added, userid, client, rate, beforeup, upthis, timediff, userip, torrentid) VALUES('" . get_date_time() . "', $userid, '$client', '$rate', '$last_up', '$upthis', '$diff', '$ip', '$torrentid')") or sqlerr(__file__, __line__); } /** * duty() * * @param mixed $check * @return */ function duty($check) { global $shoutduty,$shoutbot; if($shoutbot == 'yes') return eregi("$check",$shoutduty); else return false; } /** * _value() * * @param mixed $name * @return */ function _value($name) { global $$name; if(is_array($$name)){ foreach($$name as $n) return $n; } else return $$name; } #bridge start function gzip ($use = false) { $gzipcompress = 'no'; if ((((($gzipcompress == 'yes' OR $use) AND @extension_loaded ('zlib')) AND @ini_get ('zlib.output_compression') != '1') AND @ini_get ('output_handler') != 'ob_gzhandler')) { @ob_start ('ob_gzhandler'); } } #bridge end function my_datee ($format, $stamp = '', $offset = '', $ty = 1) { global $CURUSER; global $lang; global $dateformat; global $timeformat; global $regdateformat; global $timezoneoffset; global $dstcorrection; if (empty ($stamp)) { $stamp = time (); } else { if (strstr ($stamp, '-')) { $stamp = sql_timestamp_to_unix_timestamp ($stamp); } } if ((!$offset AND $offset != '0')) { if (($CURUSER['id'] != 0 AND array_key_exists ('tzoffset', $CURUSER))) { $offset = $CURUSER['tzoffset']; $dstcorrection = $CURUSER['dst']; } else { $offset = $timezoneoffset; $dstcorrection = $dstcorrection; } if ($dstcorrection == 'yes') { ++$offset; if (my_substrr ($offset, 0, 1) != '-') { $offset = '+' . $offset; } } } if ($offset == '-') { $offset = 0; } $date = gmdate ($format, $stamp + $offset * 3600); if (($dateformat == $format AND $ty)) { $stamp = time (); $todaysdate = gmdate ($format, $stamp + $offset * 3600); $yesterdaysdate = gmdate ($format, $stamp - 86400 + $offset * 3600); if ($todaysdate == $date) { $date = $lang->global['today']; } else { if ($yesterdaysdate == $date) { $date = $lang->global['yesterday']; } } } return apply_filters("my_datee",$date); } /** * bark() * * @param mixed $msg * @return */ function bark($msg) { stdhead("Failed"); stdmsg("Failed", apply_filters("barkmsg",$msg)); stdfoot(); exit; } /** * format_ratio() * * @param mixed $up * @param mixed $down * @param bool $color * @return */ function format_ratio($up,$down, $color = True) { if ($down > 0) { $r = number_format($up / $down, 2); if ($color) $r = "$r"; } else if ($up > 0) $r = "'Inf.'"; else $r = "'---'"; return apply_filters("format_ratio",$r); } /** * reqcommenttable() * * @param mixed $rows * @return */ function reqcommenttable($rows) { global $CURUSER, $HTTP_SERVER_VARS; begin_main_frame('100%'); begin_frame('',0,'10','100%'); $count = 0; foreach ($rows as $row) { //=======change colors if($count2 == 0) { $count2 = $count2+1; $class = "clearalt6"; } else { $count2 = 0; $class = "clearalt7"; } print(" "); begin_table(true); print(" #" . $row["id"] . " by: "); $avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($row["avatar"]) : ""); if (!$avatar) $avatar = "pic/default_avatar.gif"; $text = apply_filters("reqcomment_text",$row["text"]); $text = format_comment($text); if ($row["editedby"]) $text .= " ".str64." $row[username] $row[editedat] GMT \n";print(" $text | end_table(); } end_frame(); end_main_frame(); } /** * offcommenttable() * * @param mixed $rows * @return */ function offcommenttable($rows) { global $CURUSER, $HTTP_SERVER_VARS; begin_main_frame('100%'); begin_frame('',0,'10','100%'); $count = 0; foreach ($rows as $row) { //=======change colors if($count2 == 0) { $count2 = $count2+1; $class = "clearalt6"; } else { $count2 = 0; $class = "clearalt7"; } print(" "); begin_table(true); print(" #" . $row["id"] . " by: "); $avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($row["avatar"]) : ""); if (!$avatar) $avatar = "pic/default_avatar.gif"; $text = apply_filters("offcomment_text",$row["text"]); $text = format_comment($text); if ($row["editedby"]) $text .= " Edited by $row[username] $row[editedat] GMT \n";print(" $text | end_table(); } end_frame(); end_main_frame(); } // code: Takes a string and does a IBM-437-to-HTML-Unicode-Entities-conversion. // swedishmagic specifies special behavior for Swedish characters. // Some Swedish Latin-1 letters collide with popular DOS glyphs. If these // characters are between ASCII-characters (a-zA-Z and more) they are // treated like the Swedish letters, otherwise like the DOS glyphs. /** * code() * * @param mixed $ibm_437 * @param bool $swedishmagic * @return */ function code($ibm_437, $swedishmagic = false) { $table437 = array("\200", "\201", "\202", "\203", "\204", "\205", "\206", "\207", "\210", "\211", "\212", "\213", "\214", "\215", "\216", "\217", "\220", "\221", "\222", "\223", "\224", "\225", "\226", "\227", "\230", "\231", "\232", "\233", "\234", "\235", "\236", "\237", "\240", "\241", "\242", "\243", "\244", "\245", "\246", "\247", "\250", "\251", "\252", "\253", "\254", "\255", "\256", "\257", "\260", "\261", "\262", "\263", "\264", "\265", "\266", "\267", "\270", "\271", "\272", "\273", "\274", "\275", "\276", "\277", "\300", "\301", "\302", "\303", "\304", "\305", "\306", "\307", "\310", "\311", "\312", "\313", "\314", "\315", "\316", "\317", "\320", "\321", "\322", "\323", "\324", "\325", "\326", "\327", "\330", "\331", "\332", "\333", "\334", "\335", "\336", "\337", "\340", "\341", "\342", "\343", "\344", "\345", "\346", "\347", "\350", "\351", "\352", "\353", "\354", "\355", "\356", "\357", "\360", "\361", "\362", "\363", "\364", "\365", "\366", "\367", "\370", "\371", "\372", "\373", "\374", "\375", "\376", "\377"); $tablehtml = array("Ç", "ü", "é", "â", "ä", "à", "å", "ç", "ê", "ë", "è", "ï", "î", "ì", "Ä", "Å", "É", "æ", "Æ", "ô", "ö", "ò", "û", "ù", "ÿ", "Ö", "Ü", "¢", "£", "¥", "₧", "ƒ", "á", "í", "ó", "ú", "ñ", "Ñ", "ª", "º", "¿", "⌐", "¬", "½", "¼", "¡", "«", "»", "░", "▒", "▓", "│", "┤", "╡", "╢", "╖", "╕", "╣", "║", "╗", "╝", "╜", "╛", "┐", "└", "┴", "┬", "├", "─", "┼", "╞", "╟", "╚", "╔", "╩", "╦", "╠", "═", "╬", "╧", "╨", "╤", "╥", "╙", "╘", "╒", "╓", "╫", "╪", "┘", "┌", "█", "▄", "▌", "▐", "▀", "α", "ß", "Γ", "π", "Σ", "σ", "μ", "τ", "Φ", "Θ", "Ω", "δ", "∞", "φ", "ε", "∩", "≡", "±", "≥", "≤", "⌠", "⌡", "÷", "≈", "°", "∙", "·", "√", "ⁿ", "²", "■", " "); $s = htmlspecialchars($ibm_437); // 0-9, 11-12, 14-31, 127 (decimalt) $control = array("\000", "\001", "\002", "\003", "\004", "\005", "\006", "\007", "\010", "\011", /*"\012",*/ "\013", "\014", /*"\015",*/ "\016", "\017", "\020", "\021", "\022", "\023", "\024", "\025", "\026", "\027", "\030", "\031", "\032", "\033", "\034", "\035", "\036", "\037", "\177"); /* Code control characters to control pictures. http://www.unicode.org/charts/PDF/U2400.pdf (This is somewhat the Right Thing, but looks crappy with Courier New.) $controlpict = array("␣","␄"); $s = str_replace($control,$controlpict,$s); */ // replace control chars with space - feel free to fix the regexp smile.gif /*echo "[a\\x00-\\x1F]"; //$s = ereg_replace("[ \\x00-\\x1F]", " ", $s); $s = ereg_replace("[ \000-\037]", " ", $s); */ $s = str_replace($control," ",$s); if ($swedishmagic){ $s = str_replace("\345","\206",$s); // Code windows "a" to dos. $s = str_replace("\344","\204",$s); // Code windows " |
Yours fuctions.php is from FTS 1.1 look this is my fuctions.php
|
the fuctions.php is from 1.0.3
|
All times are GMT +2. The time now is 00:28. |
Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.