function initialize() { //输入过滤 if (!get_magic_quotes_gpc()) { !empty($_POST) && add_s($_POST); !empty($_GET) && add_s($_GET); !empty($_COOKIE) && add_s($_COOKIE); !empty($_FILES) && add_s($_FILES); } }
static function getParam($str = null, $default = null) { parse_str(file_get_contents('php://input'), $data); add_s($data); $data = $data ? $data : array(); $all = array_merge($_REQUEST, $data); if (!$str) { return $all; } return isset($all[$str]) ? $all[$str] : $default; }
function add_s(&$array) { if (is_array($array)) { foreach ($array as $key => $value) { if (!is_array($value)) { $array[$key] = addslashes($value); } else { add_s($array[$key]); } } } else { $array = addslashes($array); } }
function time_since($your_timestamp) { $unix_timestamp = strtotime($your_timestamp); $seconds = time() - $unix_timestamp; $minutes = 0; $hours = 0; $days = 0; $weeks = 0; $months = 0; $years = 0; if ($seconds == 0) { $seconds = 1; } if ($seconds > 60) { $minutes = $seconds / 60; } else { return add_s($seconds, 'second'); } if ($minutes >= 60) { $hours = $minutes / 60; } else { return add_s($minutes, 'minute'); } if ($hours >= 24) { $days = $hours / 24; } else { return add_s($hours, 'hour'); } if ($days >= 7) { $weeks = $days / 7; } else { return add_s($days, 'day'); } if ($weeks >= 4) { $months = $weeks / 4; } else { return add_s($weeks, 'week'); } if ($months >= 12) { $years = $months / 12; return add_s($years, 'year'); } else { return add_s($months, 'month'); } }
function forum_stats() { global $lang_forums, $Cache, $today_date; if (!($activeforumuser_num = $Cache->get_value('active_forum_user_count'))) { $secs = 900; $dt = date("Y-m-d H:i:s", TIMENOW - $secs); $activeforumuser_num = get_row_count("users", "WHERE forum_access >= " . sqlesc($dt)); $Cache->cache_value('active_forum_user_count', $activeforumuser_num, 300); } if ($activeforumuser_num) { $forumusers = $lang_forums['text_there'] . is_or_are($activeforumuser_num) . "<b>" . $activeforumuser_num . "</b>" . $lang_forums['text_online_user'] . add_s($activeforumuser_num) . $lang_forums['text_in_forum_now']; } else { $forumusers = $lang_forums['text_no_active_users']; } ?> <h2 align="left"><?php echo $lang_forums['text_stats']; ?> </h2> <table width="100%"><tr><td class="text"><div> <?php if (!($postcount = $Cache->get_value('total_posts_count'))) { $postcount = get_row_count("posts"); $Cache->cache_value('total_posts_count', $postcount, 96400); } if (!($topiccount = $Cache->get_value('total_topics_count'))) { $topiccount = get_row_count("topics"); $Cache->cache_value('total_topics_count', $topiccount, 96500); } if (!($todaypostcount = $Cache->get_value('today_' . $today_date . '_posts_count'))) { $todaypostcount = get_row_count("posts", "WHERE added > " . sqlesc(date("Y-m-d"))); $Cache->cache_value('today_' . $today_date . '_posts_count', $todaypostcount, 700); } print $lang_forums['text_our_members_have'] . "<b>" . $postcount . "</b>" . $lang_forums['text_posts_in_topics'] . "<b>" . $topiccount . "</b>" . $lang_forums['text_in_topics'] . "<b><font class=\"new\">" . $todaypostcount . "</font></b>" . $lang_forums['text_new_post'] . add_s($todaypostcount) . $lang_forums['text_posts_today'] . "<br /><br />"; print $forumusers; ?> </div></td></tr></table> <?php }
$torrentlist = maketable($res, 'leeching'); } break; // Completed torrents // Completed torrents case 'completed': $res = sql_query("SELECT torrents.id AS torrent, torrents.name AS torrentname, small_descr, categories.name AS catname, categories.image, category, sp_state, size, snatched.uploaded, snatched.seedtime, snatched.leechtime, snatched.completedat FROM torrents LEFT JOIN snatched ON torrents.id = snatched.torrentid LEFT JOIN categories on torrents.category = categories.id WHERE snatched.finished='yes' AND torrents.owner != {$id} AND userid={$id} ORDER BY snatched.completedat DESC") or sqlerr(); $count = mysql_num_rows($res); if ($count > 0) { $torrentlist = maketable($res, 'completed'); } break; // Incomplete torrents // Incomplete torrents case 'incomplete': $res = sql_query("SELECT torrents.id AS torrent, torrents.name AS torrentname, small_descr, categories.name AS catname, categories.image, category, sp_state, size, snatched.uploaded, snatched.downloaded, snatched.leechtime FROM torrents LEFT JOIN snatched ON torrents.id = snatched.torrentid LEFT JOIN categories on torrents.category = categories.id WHERE snatched.finished='no' AND userid={$id} AND torrents.owner != {$id} ORDER BY snatched.startdat DESC") or sqlerr(); $count = mysql_num_rows($res); if ($count > 0) { $torrentlist = maketable($res, 'incomplete'); } break; default: $count = 0; $torrentlist = ""; break; } if ($count) { echo "<b>" . $count . "</b>" . $lang_getusertorrentlistajax['text_record'] . add_s($count) . "<br />" . $torrentlist; } else { echo $lang_getusertorrentlistajax['text_no_record']; }
function bonusarray($option) { global $onegbupload_bonus, $fivegbupload_bonus, $tengbupload_bonus, $oneinvite_bonus, $customtitle_bonus, $vipstatus_bonus, $basictax_bonus, $taxpercentage_bonus, $bonusnoadpoint_advertisement, $bonusnoadtime_advertisement; global $lang_mybonus; $bonus = array(); switch ($option) { case 1: //1.0 GB Uploaded $bonus['points'] = $onegbupload_bonus; $bonus['art'] = 'traffic'; $bonus['menge'] = 1073741824; $bonus['name'] = $lang_mybonus['text_uploaded_one']; $bonus['description'] = $lang_mybonus['text_uploaded_note']; break; case 2: //5.0 GB Uploaded $bonus['points'] = $fivegbupload_bonus; $bonus['art'] = 'traffic'; $bonus['menge'] = 5368709120; $bonus['name'] = $lang_mybonus['text_uploaded_two']; $bonus['description'] = $lang_mybonus['text_uploaded_note']; break; case 3: //10.0 GB Uploaded $bonus['points'] = $tengbupload_bonus; $bonus['art'] = 'traffic'; $bonus['menge'] = 10737418240; $bonus['name'] = $lang_mybonus['text_uploaded_three']; $bonus['description'] = $lang_mybonus['text_uploaded_note']; break; case 4: //Invite $bonus['points'] = $oneinvite_bonus; $bonus['art'] = 'invite'; $bonus['menge'] = 1; $bonus['name'] = $lang_mybonus['text_buy_invite']; $bonus['description'] = $lang_mybonus['text_buy_invite_note']; break; case 5: //Custom Title $bonus['points'] = $customtitle_bonus; $bonus['art'] = 'title'; $bonus['menge'] = 0; $bonus['name'] = $lang_mybonus['text_custom_title']; $bonus['description'] = $lang_mybonus['text_custom_title_note']; break; case 6: //VIP Status $bonus['points'] = $vipstatus_bonus; $bonus['art'] = 'class'; $bonus['menge'] = 0; $bonus['name'] = $lang_mybonus['text_vip_status']; $bonus['description'] = $lang_mybonus['text_vip_status_note']; break; case 7: //Bonus Gift $bonus['points'] = 25; $bonus['art'] = 'gift_1'; $bonus['menge'] = 0; $bonus['name'] = $lang_mybonus['text_bonus_gift']; $bonus['description'] = $lang_mybonus['text_bonus_gift_note']; if ($basictax_bonus || $taxpercentage_bonus) { $onehundredaftertax = 100 - $taxpercentage_bonus - $basictax_bonus; $bonus['description'] .= "<br /><br />" . $lang_mybonus['text_system_charges_receiver'] . "<b>" . ($basictax_bonus ? $basictax_bonus . $lang_mybonus['text_tax_bonus_point'] . add_s($basictax_bonus) . ($taxpercentage_bonus ? $lang_mybonus['text_tax_plus'] : "") : "") . ($taxpercentage_bonus ? $taxpercentage_bonus . $lang_mybonus['text_percent_of_transfered_amount'] : "") . "</b>" . $lang_mybonus['text_as_tax'] . $onehundredaftertax . $lang_mybonus['text_tax_example_note']; } break; case 8: $bonus['points'] = $bonusnoadpoint_advertisement; $bonus['art'] = 'noad'; $bonus['menge'] = $bonusnoadtime_advertisement * 86400; $bonus['name'] = $bonusnoadtime_advertisement . $lang_mybonus['text_no_advertisements']; $bonus['description'] = $lang_mybonus['text_no_advertisements_note']; break; case 9: $bonus['points'] = 1000; $bonus['art'] = 'gift_2'; $bonus['menge'] = 0; $bonus['name'] = $lang_mybonus['text_charity_giving']; $bonus['description'] = $lang_mybonus['text_charity_giving_note']; break; default: break; } return $bonus; }
if ($user["invited_by"] > 0) { tr_small($lang_userdetails['row_invited_by'], get_username($user['invited_by']), 1); } tr_small($lang_userdetails['row_join_date'], $joindate, 1); tr_small($lang_userdetails['row_last_seen'], $lastseen, 1); if ($where_tweak == "yes") { tr_small($lang_userdetails['row_last_seen_location'], $user[page], 1); } if (get_user_class() >= $userprofile_class or $user["privacy"] == "low") { tr_small($lang_userdetails['row_email'], "<a href=\"mailto:" . $user[email] . "\">" . $user[email] . "</a>", 1); } if (get_user_class() >= $userprofile_class) { $resip = sql_query("SELECT ip FROM iplog WHERE userid ={$id} GROUP BY ip") or sqlerr(__FILE__, __LINE__); $iphistory = mysql_num_rows($resip); if ($iphistory > 0) { tr_small($lang_userdetails['row_ip_history'], $lang_userdetails['text_user_earlier_used'] . "<b><a href=\"iphistory.php?id=" . $user['id'] . "\">" . $iphistory . $lang_userdetails['text_different_ips'] . add_s($iphistory, true) . "</a></b>", 1); } } if (get_user_class() >= $userprofile_class || $user["id"] == $CURUSER["id"]) { if ($enablelocation_tweak == 'yes') { list($loc_pub, $loc_mod) = get_ip_location($user[ip]); $locationinfo = "<span title=\"" . $loc_mod . "\">[" . $loc_pub . "]</span>"; } else { $locationinfo = ""; } tr_small($lang_userdetails['row_ip_address'], $user[ip] . $locationinfo, 1); } $res = sql_query("SELECT agent, peer_id, ip, port FROM peers WHERE userid = {$user['id']} GROUP BY agent") or sqlerr(); if (mysql_num_rows($res) > 0) { $first = true; $clientselect = "";
function stdhead($title = "", $msgalert = true, $script = "", $place = "") { global $lang_functions; global $CURUSER, $CURLANGDIR, $USERUPDATESET, $iplog1, $oldip, $SITE_ONLINE, $FUNDS, $SITENAME, $SLOGAN, $logo_main, $BASEURL, $offlinemsg, $showversion, $enabledonation, $staffmem_class, $titlekeywords_tweak, $metakeywords_tweak, $metadescription_tweak, $cssdate_tweak, $deletenotransfertwo_account, $neverdelete_account, $iniupload_main; global $tstart; global $Cache; global $Advertisement; $Cache->setLanguage($CURLANGDIR); $Advertisement = new ADVERTISEMENT($CURUSER['id']); $cssupdatedate = $cssdate_tweak; // Variable for Start Time $tstart = getmicrotime(); // Start time //Insert old ip into iplog if ($CURUSER) { if ($iplog1 == "yes") { if ($oldip != $CURUSER["ip"] && $CURUSER["ip"]) { sql_query("INSERT INTO iplog (ip, userid, access) VALUES (" . sqlesc($CURUSER['ip']) . ", " . $CURUSER['id'] . ", '" . $CURUSER['last_access'] . "')"); } } $USERUPDATESET[] = "last_access = " . sqlesc(date("Y-m-d H:i:s")); $USERUPDATESET[] = "ip = " . sqlesc($CURUSER['ip']); } header("Content-Type: text/html; charset=utf-8; Cache-control:private"); //header("Pragma: No-cache"); if ($title == "") { $title = $SITENAME; } else { $title = $SITENAME . " :: " . htmlspecialchars($title); } if ($titlekeywords_tweak) { $title .= " " . htmlspecialchars($titlekeywords_tweak); } $title .= $showversion; if ($SITE_ONLINE == "no") { if (get_user_class() < UC_ADMINISTRATOR) { die($lang_functions['std_site_down_for_maintenance']); } else { $offlinemsg = true; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php if ($metakeywords_tweak) { ?> <meta name="keywords" content="<?php echo htmlspecialchars($metakeywords_tweak); ?> " /> <?php } if ($metadescription_tweak) { ?> <meta name="description" content="<?php echo htmlspecialchars($metadescription_tweak); ?> " /> <?php } ?> <meta name="generator" content="<?php echo PROJECTNAME; ?> " /> <?php print get_style_addicode(); $css_uri = get_css_uri(); $cssupdatedate = $cssupdatedate ? "?" . htmlspecialchars($cssupdatedate) : ""; ?> <title><?php echo $title; ?> </title> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <link rel="search" type="application/opensearchdescription+xml" title="<?php echo $SITENAME; ?> Torrents" href="opensearch.php" /> <link rel="stylesheet" href="<?php echo get_font_css_uri() . $cssupdatedate; ?> " type="text/css" /> <link rel="stylesheet" href="styles/sprites.css<?php echo $cssupdatedate; ?> " type="text/css" /> <link rel="stylesheet" href="<?php echo get_forum_pic_folder() . "/forumsprites.css" . $cssupdatedate; ?> " type="text/css" /> <link rel="stylesheet" href="<?php echo $css_uri . "theme.css" . $cssupdatedate; ?> " type="text/css" /> <link rel="stylesheet" href="<?php echo $css_uri . "DomTT.css" . $cssupdatedate; ?> " type="text/css" /> <link rel="stylesheet" href="styles/curtain_imageresizer.css<?php echo $cssupdatedate; ?> " type="text/css" /> <?php if ($CURUSER) { $caticonrow = get_category_icon_row($CURUSER['caticon']); if ($caticonrow['cssfile']) { ?> <link rel="stylesheet" href="<?php echo htmlspecialchars($caticonrow['cssfile']) . $cssupdatedate; ?> " type="text/css" /> <?php } } ?> <link rel="alternate" type="application/rss+xml" title="Latest Torrents" href="torrentrss.php" /> <script type="text/javascript" src="curtain_imageresizer.js<?php echo $cssupdatedate; ?> "></script> <script type="text/javascript" src="ajaxbasic.js<?php echo $cssupdatedate; ?> "></script> <script type="text/javascript" src="common.js<?php echo $cssupdatedate; ?> "></script> <script type="text/javascript" src="domLib.js<?php echo $cssupdatedate; ?> "></script> <script type="text/javascript" src="domTT.js<?php echo $cssupdatedate; ?> "></script> <script type="text/javascript" src="domTT_drag.js<?php echo $cssupdatedate; ?> "></script> <script type="text/javascript" src="fadomatic.js<?php echo $cssupdatedate; ?> "></script> </head> <body> <table class="head" cellspacing="0" cellpadding="0" align="center"> <tr> <td class="clear"> <?php if ($logo_main == "") { ?> <div class="logo"><?php echo htmlspecialchars($SITENAME); ?> </div> <div class="slogan"><?php echo htmlspecialchars($SLOGAN); ?> </div> <?php } else { ?> <div class="logo_img"><img src="<?php echo $logo_main; ?> " alt="<?php echo htmlspecialchars($SITENAME); ?> " title="<?php echo htmlspecialchars($SITENAME); ?> - <?php echo htmlspecialchars($SLOGAN); ?> " /></div> <?php } ?> </td> <td class="clear nowrap" align="right" valign="middle"> <?php if ($Advertisement->enable_ad()) { $headerad = $Advertisement->get_ad('header'); if ($headerad) { echo "<span id=\"ad_header\">" . $headerad[0] . "</span>"; } } if ($enabledonation == 'yes') { ?> <a href="donate.php"><img src="<?php echo get_forum_pic_folder(); ?> /donate.gif" alt="Make a donation" style="margin-left: 5px; margin-top: 50px;" /></a> <?php } ?> </td> </tr> </table> <table class="mainouter" width="982" cellspacing="0" cellpadding="5" align="center"> <tr><td id="nav_block" class="text" align="center"> <?php if (!$CURUSER) { ?> <a href="login.php"><font class="big"><b><?php echo $lang_functions['text_login']; ?> </b></font></a> / <a href="signup.php"><font class="big"><b><?php echo $lang_functions['text_signup']; ?> </b></font></a> <?php } else { begin_main_frame(); menu(); end_main_frame(); $datum = getdate(); $datum["hours"] = sprintf("%02.0f", $datum["hours"]); $datum["minutes"] = sprintf("%02.0f", $datum["minutes"]); $ratio = get_ratio($CURUSER['id']); //// check every 15 minutes ////////////////// $messages = $Cache->get_value('user_' . $CURUSER["id"] . '_inbox_count'); if ($messages == "") { $messages = get_row_count("messages", "WHERE receiver=" . sqlesc($CURUSER["id"]) . " AND location<>0"); $Cache->cache_value('user_' . $CURUSER["id"] . '_inbox_count', $messages, 900); } $outmessages = $Cache->get_value('user_' . $CURUSER["id"] . '_outbox_count'); if ($outmessages == "") { $outmessages = get_row_count("messages", "WHERE sender=" . sqlesc($CURUSER["id"]) . " AND saved='yes'"); $Cache->cache_value('user_' . $CURUSER["id"] . '_outbox_count', $outmessages, 900); } if (!($connect = $Cache->get_value('user_' . $CURUSER["id"] . '_connect'))) { $res3 = sql_query("SELECT connectable FROM peers WHERE userid=" . sqlesc($CURUSER["id"]) . " LIMIT 1"); if ($row = mysql_fetch_row($res3)) { $connect = $row[0]; } else { $connect = 'unknown'; } $Cache->cache_value('user_' . $CURUSER["id"] . '_connect', $connect, 900); } if ($connect == "yes") { $connectable = "<b><font color=\"green\">" . $lang_functions['text_yes'] . "</font></b>"; } elseif ($connect == 'no') { $connectable = "<a href=\"faq.php#id21\"><b><font color=\"red\">" . $lang_functions['text_no'] . "</font></b></a>"; } else { $connectable = $lang_functions['text_unknown']; } //// check every 60 seconds ////////////////// $activeseed = $Cache->get_value('user_' . $CURUSER["id"] . '_active_seed_count'); if ($activeseed == "") { $activeseed = get_row_count("peers", "WHERE userid=" . sqlesc($CURUSER["id"]) . " AND seeder='yes'"); $Cache->cache_value('user_' . $CURUSER["id"] . '_active_seed_count', $activeseed, 60); } $activeleech = $Cache->get_value('user_' . $CURUSER["id"] . '_active_leech_count'); if ($activeleech == "") { $activeleech = get_row_count("peers", "WHERE userid=" . sqlesc($CURUSER["id"]) . " AND seeder='no'"); $Cache->cache_value('user_' . $CURUSER["id"] . '_active_leech_count', $activeleech, 60); } $unread = $Cache->get_value('user_' . $CURUSER["id"] . '_unread_message_count'); if ($unread == "") { $unread = get_row_count("messages", "WHERE receiver=" . sqlesc($CURUSER["id"]) . " AND unread='yes'"); $Cache->cache_value('user_' . $CURUSER["id"] . '_unread_message_count', $unread, 60); } $inboxpic = "<img class=\"" . ($unread ? "inboxnew" : "inbox") . "\" src=\"pic/trans.gif\" alt=\"inbox\" title=\"" . ($unread ? $lang_functions['title_inbox_new_messages'] : $lang_functions['title_inbox_no_new_messages']) . "\" />"; ?> <table id="info_block" cellpadding="4" cellspacing="0" border="0" width="100%"><tr> <td><table width="100%" cellspacing="0" cellpadding="0" border="0"><tr> <td class="bottom" align="left"><span class="medium"><?php echo $lang_functions['text_welcome_back']; ?> , <?php echo get_username($CURUSER['id']); ?> [<a href="logout.php"><?php echo $lang_functions['text_logout']; ?> </a>]<?php if (get_user_class() >= UC_MODERATOR) { ?> [<a href="staffpanel.php"><?php echo $lang_functions['text_staff_panel']; ?> </a>] <?php } ?> <?php if (get_user_class() >= UC_SYSOP) { ?> [<a href="settings.php"><?php echo $lang_functions['text_site_settings']; ?> </a>]<?php } ?> [<a href="torrents.php?inclbookmarked=1&allsec=1&incldead=0"><?php echo $lang_functions['text_bookmarks']; ?> </a>] <font class = 'color_bonus'><?php echo $lang_functions['text_bonus']; ?> </font>[<a href="mybonus.php"><?php echo $lang_functions['text_use']; ?> </a>]: <?php echo number_format($CURUSER['seedbonus'], 1); ?> <font class = 'color_invite'><?php echo $lang_functions['text_invite']; ?> </font>[<a href="invite.php?id=<?php echo $CURUSER['id']; ?> "><?php echo $lang_functions['text_send']; ?> </a>]: <?php echo $CURUSER['invites']; ?> <br /> <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; ?> <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']; echo $datum[hours] . ":" . $datum[minutes]; ?> <br /> <?php if (get_user_class() >= $staffmem_class) { $totalreports = $Cache->get_value('staff_report_count'); if ($totalreports == "") { $totalreports = get_row_count("reports"); $Cache->cache_value('staff_report_count', $totalreports, 900); } $totalsm = $Cache->get_value('staff_message_count'); if ($totalsm == "") { $totalsm = get_row_count("staffmessages"); $Cache->cache_value('staff_message_count', $totalsm, 900); } $totalcheaters = $Cache->get_value('staff_cheater_count'); if ($totalcheaters == "") { $totalcheaters = get_row_count("cheaters"); $Cache->cache_value('staff_cheater_count', $totalcheaters, 900); } print "<a href=\"cheaterbox.php\"><img class=\"cheaterbox\" alt=\"cheaterbox\" title=\"" . $lang_functions['title_cheaterbox'] . "\" src=\"pic/trans.gif\" /> </a>" . $totalcheaters . " <a href=\"reports.php\"><img class=\"reportbox\" alt=\"reportbox\" title=\"" . $lang_functions['title_reportbox'] . "\" src=\"pic/trans.gif\" /> </a>" . $totalreports . " <a href=\"staffbox.php\"><img class=\"staffbox\" alt=\"staffbox\" title=\"" . $lang_functions['title_staffbox'] . "\" src=\"pic/trans.gif\" /> </a>" . $totalsm . " "; } print "<a href=\"messages.php\">" . $inboxpic . "</a> " . ($messages ? $messages . " (" . $unread . $lang_functions['text_message_new'] . ")" : "0"); print " <a href=\"messages.php?action=viewmailbox&box=-1\"><img class=\"sentbox\" alt=\"sentbox\" title=\"" . $lang_functions['title_sentbox'] . "\" src=\"pic/trans.gif\" /></a> " . ($outmessages ? $outmessages : "0"); print " <a href=\"friends.php\"><img class=\"buddylist\" alt=\"Buddylist\" title=\"" . $lang_functions['title_buddylist'] . "\" src=\"pic/trans.gif\" /></a>"; print " <a href=\"getrss.php\"><img class=\"rss\" alt=\"RSS\" title=\"" . $lang_functions['title_get_rss'] . "\" src=\"pic/trans.gif\" /></a>"; ?> </span></td> </tr></table></td> </tr></table> </td></tr> <tr><td id="outer" align="center" class="outer" style="padding-top: 20px; padding-bottom: 20px"> <?php if ($Advertisement->enable_ad()) { $belownavad = $Advertisement->get_ad('belownav'); if ($belownavad) { echo "<div align=\"center\" style=\"margin-bottom: 10px\" id=\"ad_belownav\">" . $belownavad[0] . "</div>"; } } if ($msgalert) { function msgalert($url, $text, $bgcolor = "red") { print "<p><table border=\"0\" cellspacing=\"0\" cellpadding=\"10\"><tr><td style='border: none; padding: 10px; background: " . $bgcolor . "'>\n"; print "<b><a href=\"" . $url . "\"><font color=\"white\">" . $text . "</font></a></b>"; print "</td></tr></table></p><br />"; } if ($CURUSER['leechwarn'] == 'yes') { $kicktimeout = gettime($CURUSER['leechwarnuntil'], false, false, true); $text = $lang_functions['text_please_improve_ratio_within'] . $kicktimeout . $lang_functions['text_or_you_will_be_banned']; msgalert("faq.php#id17", $text, "orange"); } if ($deletenotransfertwo_account) { if ($CURUSER['downloaded'] == 0 && ($CURUSER['uploaded'] == 0 || $CURUSER['uploaded'] == $iniupload_main)) { $neverdelete_account = $neverdelete_account <= UC_VIP ? $neverdelete_account : UC_VIP; if (get_user_class() < $neverdelete_account) { $secs = $deletenotransfertwo_account * 24 * 60 * 60; $addedtime = strtotime($CURUSER['added']); if (TIMENOW > $addedtime + $secs / 3) { $kicktimeout = gettime(date("Y-m-d H:i:s", $addedtime + $secs), false, false, true); $text = $lang_functions['text_please_download_something_within'] . $kicktimeout . $lang_functions['text_inactive_account_be_deleted']; msgalert("rules.php", $text, "gray"); } } } } if ($CURUSER['showclienterror'] == 'yes') { $text = $lang_functions['text_banned_client_warning']; msgalert("faq.php#id29", $text, "black"); } if ($unread) { $text = $lang_functions['text_you_have'] . $unread . $lang_functions['text_new_message'] . add_s($unread) . $lang_functions['text_click_here_to_read']; msgalert("messages.php", $text, "red"); } /* $pending_invitee = $Cache->get_value('user_'.$CURUSER["id"].'_pending_invitee_count'); if ($pending_invitee == ""){ $pending_invitee = get_row_count("users","WHERE status = 'pending' AND invited_by = ".sqlesc($CURUSER[id])); $Cache->cache_value('user_'.$CURUSER["id"].'_pending_invitee_count', $pending_invitee, 900); } if ($pending_invitee > 0) { $text = $lang_functions['text_your_friends'].add_s($pending_invitee).is_or_are($pending_invitee).$lang_functions['text_awaiting_confirmation']; msgalert("invite.php?id=".$CURUSER[id],$text, "red"); }*/ $settings_script_name = $_SERVER["SCRIPT_FILENAME"]; if (!preg_match("/index/i", $settings_script_name)) { $new_news = $Cache->get_value('user_' . $CURUSER["id"] . '_unread_news_count'); if ($new_news == "") { $new_news = get_row_count("news", "WHERE notify = 'yes' AND added > " . sqlesc($CURUSER['last_home'])); $Cache->cache_value('user_' . $CURUSER["id"] . '_unread_news_count', $new_news, 300); } if ($new_news > 0) { $text = $lang_functions['text_there_is'] . is_or_are($new_news) . $new_news . $lang_functions['text_new_news']; msgalert("index.php", $text, "green"); } } if (get_user_class() >= $staffmem_class) { $numreports = $Cache->get_value('staff_new_report_count'); if ($numreports == "") { $numreports = get_row_count("reports", "WHERE dealtwith=0"); $Cache->cache_value('staff_new_report_count', $numreports, 900); } if ($numreports) { $text = $lang_functions['text_there_is'] . is_or_are($numreports) . $numreports . $lang_functions['text_new_report'] . add_s($numreports); msgalert("reports.php", $text, "blue"); } $nummessages = $Cache->get_value('staff_new_message_count'); if ($nummessages == "") { $nummessages = get_row_count("staffmessages", "WHERE answered='no'"); $Cache->cache_value('staff_new_message_count', $nummessages, 900); } if ($nummessages > 0) { $text = $lang_functions['text_there_is'] . is_or_are($nummessages) . $nummessages . $lang_functions['text_new_staff_message'] . add_s($nummessages); msgalert("staffbox.php", $text, "blue"); } $numcheaters = $Cache->get_value('staff_new_cheater_count'); if ($numcheaters == "") { $numcheaters = get_row_count("cheaters", "WHERE dealtwith=0"); $Cache->cache_value('staff_new_cheater_count', $numcheaters, 900); } if ($numcheaters) { $text = $lang_functions['text_there_is'] . is_or_are($numcheaters) . $numcheaters . $lang_functions['text_new_suspected_cheater'] . add_s($numcheaters); msgalert("cheaterbox.php", $text, "blue"); } } } if ($offlinemsg) { print "<p><table width=\"737\" border=\"1\" cellspacing=\"0\" cellpadding=\"10\"><tr><td style='padding: 10px; background: red' class=\"text\" align=\"center\">\n"; print "<font color=\"white\">" . $lang_functions['text_website_offline_warning'] . "</font>"; print "</td></tr></table></p><br />\n"; } } }
$totalspeed = $totalspeed + ($e["downloaded"] - $e["downloadoffset"]) / max(1, ($e["la"] - $e["st"])); } } $avgspeed = $lang_details['text_average_speed']."<b>" . mksize($totalspeed/($seedersTmp+$leechersTmp)) . "/s</b>"; $totalspeed = $lang_details['text_total_speed']."<b>" . mksize($totalspeed) . "/s</b> ".$lang_details['text_health_note']; $health = $lang_details['text_avprogress'] . get_percent_completed_image(floor($progressTotal))." (".round($progressTotal)."%) <b>".$lang_details['text_traffic']."</b>" . $avgspeed ." ". $totalspeed; } else $health = "<b>".$lang_details['text_traffic']. "</b>" . $lang_details['text_no_traffic']; if ($row["visible"] == "no") $health = "<b>".$lang_details['text_status']."</b>" . $lang_details['text_dead'] ." ". $health; tr($lang_details['row_health'], $health, 1);*/ tr("<span id=\"seeders\"></span><span id=\"leechers\"></span>" . $lang_details['row_peers'] . "<br /><span id=\"showpeer\"><a href=\"javascript: viewpeerlist(" . $row['id'] . ");\" class=\"sublink\">" . $lang_details['text_see_full_list'] . "</a></span><span id=\"hidepeer\" style=\"display: none;\"><a href=\"javascript: hidepeerlist();\" class=\"sublink\">" . $lang_details['text_hide_list'] . "</a></span>", "<div id=\"peercount\"><b>" . $row['seeders'] . $lang_details['text_seeders'] . add_s($row['seeders']) . "</b> | <b>" . $row['leechers'] . $lang_details['text_leechers'] . add_s($row['leechers']) . "</b></div><div id=\"peerlist\"></div>", 1); if ($_GET['dllist'] == 1) { $scronload = "viewpeerlist(" . $row['id'] . ")"; echo "<script type=\"text/javascript\">\n"; echo $scronload; echo "</script>"; } // ------------- start thanked-by block--------------// $torrentid = $id; $thanksby = ""; $nothanks = ""; $thanks_said = 0; $thanks_sql = sql_query("SELECT userid FROM thanks WHERE torrentid=" . sqlesc($torrentid) . " ORDER BY id DESC LIMIT 20"); $thanksCount = get_row_count("thanks", "WHERE torrentid=" . sqlesc($torrentid)); $thanks_all = mysql_num_rows($thanks_sql); if ($thanks_all) {
function stdhead($title = "", $msgalert = true, $script = "", $place = "") { global $lang_functions; global $CURUSER, $CURLANGDIR, $USERUPDATESET, $iplog1, $oldip, $SITE_ONLINE, $FUNDS, $SITENAME, $SLOGAN, $logo_main, $BASEURL, $offlinemsg, $showversion,$enabledonation, $staffmem_class, $titlekeywords_tweak, $metakeywords_tweak, $metadescription_tweak, $cssdate_tweak, $deletenotransfertwo_account, $neverdelete_account, $iniupload_main; global $tstart; global $Cache; global $Advertisement; $Cache->setLanguage($CURLANGDIR); $Advertisement = new ADVERTISEMENT($CURUSER['id']); $cssupdatedate = $cssdate_tweak; // Variable for Start Time $tstart = getmicrotime(); // Start time //Insert old ip into iplog if ($CURUSER){ if ($iplog1 == "yes") { if (($oldip != $CURUSER["ip"]) && $CURUSER["ip"]) sql_query("INSERT INTO iplog (ip, userid, access) VALUES (" . sqlesc($CURUSER['ip']) . ", " . $CURUSER['id'] . ", '" . $CURUSER['last_access'] . "')"); } $USERUPDATESET[] = "last_access = ".sqlesc(date("Y-m-d H:i:s")); $USERUPDATESET[] = "ip = ".sqlesc($CURUSER['ip']); } header("Content-Type: text/html; charset=utf-8; Cache-control:private"); //header("Pragma: No-cache"); if ($title == "") $title = $SITENAME; else $title = $SITENAME." :: " . htmlspecialchars($title); if ($titlekeywords_tweak) $title .= " ".htmlspecialchars($titlekeywords_tweak); $title .= $showversion; if ($SITE_ONLINE == "no") { if (get_user_class() < UC_ADMINISTRATOR) { die($lang_functions['std_site_down_for_maintenance']); } else { $offlinemsg = true; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php if ($metakeywords_tweak){ ?> <meta name="keywords" content="<?php echo htmlspecialchars($metakeywords_tweak)?>" /> <?php } if ($metadescription_tweak){ ?> <meta name="description" content="<?php echo htmlspecialchars($metadescription_tweak)?>" /> <?php } ?> <meta name="generator" content="<?php echo PROJECTNAME?>" /> <?php print(get_style_addicode()); $css_uri = get_css_uri(); $cssupdatedate=($cssupdatedate ? "?".htmlspecialchars($cssupdatedate) : ""); ?> <title><?php echo $title?></title> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <link rel="search" type="application/opensearchdescription+xml" title="<?php echo $SITENAME?> Torrents" href="opensearch.php" /> <link rel="stylesheet" href="<?php echo get_font_css_uri().$cssupdatedate?>" type="text/css" /> <link rel="stylesheet" href="styles/sprites.css<?php echo $cssupdatedate?>" type="text/css" /> <link rel="stylesheet" href="<?php echo get_forum_pic_folder()."/forumsprites.css".$cssupdatedate?>" type="text/css" /> <link rel="stylesheet" href="<?php echo $css_uri."theme.css".$cssupdatedate?>" type="text/css" /> <link rel="stylesheet" href="<?php echo $css_uri."DomTT.css".$cssupdatedate?>" type="text/css" /> <link rel="stylesheet" href="styles/curtain_imageresizer.css<?php echo $cssupdatedate?>" type="text/css" /> <link rel="stylesheet" href="jquerylib/jquery.alerts.css<?php echo $cssupdatedate?>" type="text/css" /> <?php if ($CURUSER){ $caticonrow = get_category_icon_row($CURUSER['caticon']); if($caticonrow['cssfile']){ ?> <link rel="stylesheet" href="<?php echo htmlspecialchars($caticonrow['cssfile']).$cssupdatedate?>" type="text/css" /> <?php } } ?> <link rel="alternate" type="application/rss+xml" title="Latest Torrents" href="torrentrss.php" /> <script type="text/javascript" src="curtain_imageresizer.js<?php echo $cssupdatedate?>"></script> <script type="text/javascript" src="ajaxbasic.js<?php echo $cssupdatedate?>"></script> <script type="text/javascript" src="common.js<?php echo $cssupdatedate?>"></script> <script type="text/javascript" src="domLib.js<?php echo $cssupdatedate?>"></script> <script type="text/javascript" src="domTT.js<?php echo $cssupdatedate?>"></script> <script type="text/javascript" src="domTT_drag.js<?php echo $cssupdatedate?>"></script> <script type="text/javascript" src="fadomatic.js<?php echo $cssupdatedate?>"></script> <script type="text/javascript" src="jquerylib/jquery-1.5.2.min.js<?php echo $cssupdatedate?>"></script> <script type="text/javascript" src="jquerylib/jquery.alerts.js<?php echo $cssupdatedate?>"></script> <script type="text/javascript" src="jquerylib/jquery.ui.draggable.js<?php echo $cssupdatedate?>"></script> <script type="text/javascript" src="jquerylib/jquery.caretInsert.js<?php echo $cssupdatedate?>"></script> <link rel="stylesheet" href="userAutoTips.css" type="text/css"> <script type="text/javascript" src="userAutoTips.js"></script> </head> <body> <script type="text/javascript"> $(document).ready(function(){ $('#roll_top').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);}); $('#roll_bottom').click(function(){$('html,body').animate({scrollTop:$('#footer').offset().top}, 800);}); t_ids = $('textarea'); if(t_ids) { for(var i = 0 ;i <t_ids.length;i++) { userAutoTips({id:t_ids[i].id}); } } $('#roll_top').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);}); $('#roll_bottom').click(function(){$('html,body').animate({scrollTop:$('#footer').offset().top}, 800);}); }); </script> <style type="text/css"> html body { _background-image:url(about:blank); _background-attachment:fixed; } #roll_top,#roll_bottom { position:relative; cursor:pointer; height:52px; width:50px; } #roll_top { background:url(pic/up.png) no-repeat; } #roll_bottom { background:url(pic/up.png) no-repeat 0 -52px; } #roll { display:block; width:50px; margin-right:-546px; /*这个是距离的位置,请自行调整*/ position:fixed; right:50%; top:80%; _margin-right:-545px;/*Hack IE6的,请用IE6打开自行调整*/ _position:absolute; _margin-top:300px; _top:expression(eval(document.documentElement.scrollTop)); } </style> <div id="roll"><div title="回到顶部" id="roll_top"></div><div title="转到底部" id="roll_bottom"></div></div> <table class="head" cellspacing="0" cellpadding="0" align="center"> <tr> <td class="clear"> <?php if ($logo_main == "") { ?> <div class="logo"><?php echo htmlspecialchars($SITENAME)?></div> <div class="slogan"><?php echo htmlspecialchars($SLOGAN)?></div> <?php } else { ?> <div class="logo_img"><img src="<?php echo $logo_main?>" alt="<?php echo htmlspecialchars($SITENAME)?>" title="<?php echo htmlspecialchars($SITENAME)?> - <?php echo htmlspecialchars($SLOGAN)?>" /></div> <?php } ?> </td> <td class="clear nowrap" align="right" valign="middle"> <?php if ($Advertisement->enable_ad()){ $headerad=$Advertisement->get_ad('header'); if ($headerad){ echo "<span id=\"ad_header\">".$headerad[0]."</span>"; } } if ($enabledonation == 'yes'){?> <a href="donate.php"><img src="<?php echo get_forum_pic_folder()?>/donate.gif" alt="Make a donation" style="margin-left: 5px; margin-top: 50px;" /></a> <?php } ?> </td> </tr> </table> <table class="mainouter" width="982" cellspacing="0" cellpadding="5" align="center"> <tr><td id="nav_block" class="text" align="center"> <?php if (!$CURUSER) { ?> <a href="login.php"><font class="big"><b><?php echo $lang_functions['text_login'] ?></b></font></a> | <a href="signupcard.php"><font class="big"><b><?php echo $lang_functions['text_signupcard'] ?></b></font></a> | <a href="signup.php?type=invite"><font class="big"><b><?php echo $lang_functions['text_invite_reg'] ?></b></font></a> | <a href="signup.php"><font class="big"><b><?php echo $lang_functions['text_signup'] ?></b></font></a> | <a href="invitebox.php"><font class="big"><b>邀请申请区</b></font></a> <?php } else { begin_main_frame(); menu (); end_main_frame(); $datum = getdate(); $datum["hours"] = sprintf("%02.0f", $datum["hours"]); $datum["minutes"] = sprintf("%02.0f", $datum["minutes"]); $ratio = get_ratio($CURUSER['id']); //// check every 15 minutes ////////////////// $messages = $Cache->get_value('user_'.$CURUSER["id"].'_inbox_count'); if ($messages == ""){ $messages = get_row_count("messages", "WHERE receiver=" . sqlesc($CURUSER["id"]) . " AND location<>0"); $Cache->cache_value('user_'.$CURUSER["id"].'_inbox_count', $messages, 900); } $outmessages = $Cache->get_value('user_'.$CURUSER["id"].'_outbox_count'); if ($outmessages == ""){ $outmessages = get_row_count("messages","WHERE sender=" . sqlesc($CURUSER["id"]) . " AND saved='yes'"); $Cache->cache_value('user_'.$CURUSER["id"].'_outbox_count', $outmessages, 900); } if (!$connect = $Cache->get_value('user_'.$CURUSER["id"].'_connect')){ $res3 = sql_query("SELECT connectable FROM peers WHERE userid=" . sqlesc($CURUSER["id"]) . " LIMIT 1"); if($row = mysql_fetch_row($res3)) $connect = $row[0]; else $connect = 'unknown'; $Cache->cache_value('user_'.$CURUSER["id"].'_connect', $connect, 900); } if($connect == "yes") $connectable = "<b><font color=\"green\">".$lang_functions['text_yes']."</font></b>"; elseif ($connect == 'no') $connectable = "<a href=\"faq.php#id21\"><b><font color=\"red\">".$lang_functions['text_no']."</font></b></a>"; else $connectable = $lang_functions['text_unknown']; //// check every 60 seconds ////////////////// $activeseed = $Cache->get_value('user_'.$CURUSER["id"].'_active_seed_count'); if ($activeseed == ""){ $activeseed = get_row_count("peers","WHERE userid=" . sqlesc($CURUSER["id"]) . " AND seeder='yes'"); $Cache->cache_value('user_'.$CURUSER["id"].'_active_seed_count', $activeseed, 60); } $activeleech = $Cache->get_value('user_'.$CURUSER["id"].'_active_leech_count'); if ($activeleech == ""){ $activeleech = get_row_count("peers","WHERE userid=" . sqlesc($CURUSER["id"]) . " AND seeder='no'"); $Cache->cache_value('user_'.$CURUSER["id"].'_active_leech_count', $activeleech, 60); } $unread = $Cache->get_value('user_'.$CURUSER["id"].'_unread_message_count'); if ($unread == ""){ $unread = get_row_count("messages","WHERE receiver=" . sqlesc($CURUSER["id"]) . " AND unread='yes'"); $Cache->cache_value('user_'.$CURUSER["id"].'_unread_message_count', $unread, 60); } $inboxpic = "<img class=\"".($unread ? "inboxnew" : "inbox")."\" src=\"pic/trans.gif\" alt=\"inbox\" title=\"".($unread ? $lang_functions['title_inbox_new_messages'] : $lang_functions['title_inbox_no_new_messages'])."\" />"; if($connect == 'no'){ if(!$Cache->get_value('connectfaq_'.$CURUSER['id'])){ /* ?> <script type="text/javascript"> jAlert('<?=$lang_functions['text_connectfaq']?>'); </script> <? */ $Cache->cache_value('connectfaq_'.$CURUSER['id'],'1',60); } } ?> <table id="info_block" cellpadding="4" cellspacing="0" border="0" width="100%"><tr> <td><table width="100%" cellspacing="0" cellpadding="0" border="0"><tr> <td class="bottom" align="left"><span class="medium"><?php echo $lang_functions['text_welcome_back'] ?>, <?php echo get_username($CURUSER['id'])?> [<a href="logout.php"><?php echo $lang_functions['text_logout'] ?></a>]<?php if (get_user_class() == UC_UPLOADER) echo"[<a href='uploaders.php'>发布员考核</a>]";if (get_user_class() == UC_MODERATOR) echo"[<a href='moderators.php'>管理员考核</a>]";?> <?php if (get_user_class() >= UC_MODERATOR) { ?>[<a href="staffpanel.php"><?php echo $lang_functions['text_staff_panel'] ?></a>] <?php }?> <?php if (get_user_class() >= UC_SYSOP) { ?> [<a href="settings.php"><?php echo $lang_functions['text_site_settings'] ?></a>]<?php } ?> [<a href="torrents.php?inclbookmarked=1&allsec=1&incldead=0"><?php echo $lang_functions['text_bookmarks'] ?></a>] <font class = 'color_bonus'><?php echo $lang_functions['text_bonus'] ?></font>[<a href="mybonus.php"><?php echo $lang_functions['text_use'] ?></a>丨<a href="usebonus.php"><?=$lang_functions['text_app']?></a>]: <?php echo number_format((int)$CURUSER['seedbonus'], 0)?> <font class = 'color_invite'><?php echo $lang_functions['text_invite'] ?></font>[<a href="invite.php?id=<?php echo $CURUSER['id']?>"><?php echo $lang_functions['text_send'] ?></a>]: <?php echo $CURUSER['invites']?><br /> <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> <a href="userdetails.php?id=<?php echo $CURUSER['id'];?>&show=seeding"><img class="uploading" alt="Torrents seeding" title="<?php echo $lang_functions['title_torrents_seeding'] ?>" src="pic/trans.gif" /><?php echo $activeseed?></a> <a href="userdetails.php?id=<?php echo $CURUSER['id'];?>&show=leeching"><img class="downloading" alt="Torrents leeching" title="<?php echo $lang_functions['title_torrents_leeching'] ?>" src="pic/trans.gif" /><?php echo $activeleech?></a> <a href="userdetails.php?id=<?php echo $CURUSER['id'];?>&show=completed" title="已完成"><img class="completed" alt="completed" title="已完成" src="pic/trans.gif" />--</a> <a href="userdetails.php?id=<?php echo $CURUSER['id'];?>&show=uploaded" title="已发布"><img class="uploaded" alt="uploaded" title="已发布" src="pic/trans.gif" />--</a> <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 /> <?php if (get_user_class() >= $staffmem_class){ $totalreports = $Cache->get_value('staff_report_count'); if ($totalreports == ""){ $totalreports = get_row_count("reports"); $Cache->cache_value('staff_report_count', $totalreports, 900); } $totalsm = $Cache->get_value('staff_message_count'); if ($totalsm == ""){ $totalsm = get_row_count("staffmessages"); $Cache->cache_value('staff_message_count', $totalsm, 900); } $totalcheaters = $Cache->get_value('staff_cheater_count'); if ($totalcheaters == ""){ $totalcheaters = get_row_count("cheaters"); $Cache->cache_value('staff_cheater_count', $totalcheaters, 900); } print("<a href=\"cheaterbox.php\"><img class=\"cheaterbox\" alt=\"cheaterbox\" title=\"".$lang_functions['title_cheaterbox']."\" src=\"pic/trans.gif\" /> </a>".$totalcheaters." <a href=\"reports.php\"><img class=\"reportbox\" alt=\"reportbox\" title=\"".$lang_functions['title_reportbox']."\" src=\"pic/trans.gif\" /> </a>".$totalreports." <a href=\"staffbox.php\"><img class=\"staffbox\" alt=\"staffbox\" title=\"".$lang_functions['title_staffbox']."\" src=\"pic/trans.gif\" /> </a>".$totalsm." "); } print("<a href=\"messages.php\">".$inboxpic."</a> ".($messages ? $messages." (".$unread.$lang_functions['text_message_new'].")" : "0")); print(" <a href=\"messages.php?action=viewmailbox&box=-1\"><img class=\"sentbox\" alt=\"sentbox\" title=\"".$lang_functions['title_sentbox']."\" src=\"pic/trans.gif\" /></a> ".($outmessages ? $outmessages : "0")); print(" <a href=\"friends.php\"><img class=\"buddylist\" alt=\"Buddylist\" title=\"".$lang_functions['title_buddylist']."\" src=\"pic/trans.gif\" /></a>"); print(" <a href=\"getrss.php\"><img class=\"rss\" alt=\"RSS\" title=\"".$lang_functions['title_get_rss']."\" src=\"pic/trans.gif\" /></a>"); ?> </span></td> </tr></table></td> </tr></table> </td></tr> <tr><td id="outer" align="center" class="outer" style="padding-top: 20px; padding-bottom: 20px"> <?php //每日登陆奖励 global $loginadd;require "./memcache.php"; if($loginadd == 'yes'){ if($memcache){ if($memcache->get('continuelogin_'.$CURUSER['id'])!='1'){ $res = sql_query("SELECT salary,salarynum FROM users WHERE id=".$CURUSER['id']) or sqlerr(); $arr = mysql_fetch_assoc($res); $showtime=date("Y-m-d",time()); $d1=strtotime($showtime); $d2=strtotime($arr['salary']); $Days=round(($d1-$d2)/3600/24); $addbonus = 4; if($Days == 1){ $salarynum = $arr['salarynum']; if($salarynum > 7) {$addbonus= 15;} else $addbonus = $salarynum + 4; mysql_query("UPDATE users SET seedbonus=seedbonus+$addbonus , salary=now(), salarynum=salarynum + 1 WHERE id=".$CURUSER['id']); ?> <script type="text/javascript"> jAlert('<font color=red>连续登录<?=$salarynum?>天奖励,恭喜你获取了<?=$addbonus?>点麦粒,继续保持哦</font>', '每日登录奖励'); </script> <? }else if($Days > 0){ mysql_query("UPDATE users SET seedbonus=seedbonus+$addbonus , salary=now(), salarynum=1 WHERE id=".$CURUSER['id']); ?> <script type="text/javascript"> jAlert('<font color=red>每日登录奖励,恭喜你获取了<?=$addbonus?>点麦粒,连续多天登录会有更多奖励哦</font>', '每日登录奖励'); </script> <? } } $memcache->set('continuelogin_'.$CURUSER['id'],'1',false,3600) or die (""); }} if ($Advertisement->enable_ad()){ $belownavad=$Advertisement->get_ad('belownav'); if ($belownavad) echo "<div align=\"center\" style=\"margin-bottom: 10px\" id=\"ad_belownav\">".$belownavad[0]."</div>"; } //信息色块提示 if ($msgalert) { function msgalert($url, $text, $bgcolor = "red") { print("<p><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td style='border: none; padding: 9px; background: ".$bgcolor."'>\n"); print("<b><a href=\"".$url."\"><font face=\"verdana\" size=\"3\" color=\"white\">".$text."</font></a></b>"); print("</td></tr></table></p><br />");//修改于2011-11-23 @zhaojiajia } if($CURUSER['leechwarn'] == 'yes') { $kicktimeout = gettime($CURUSER['leechwarnuntil'], false, false, true); $text = $lang_functions['text_please_improve_ratio_within'].$kicktimeout.$lang_functions['text_or_you_will_be_banned']; msgalert("faq.php#id17", $text, "orange"); } if($deletenotransfertwo_account) //inactive account deletion notice { if ($CURUSER['downloaded'] == 0 && ($CURUSER['uploaded'] == 0 || $CURUSER['uploaded'] == $iniupload_main)) { $neverdelete_account = ($neverdelete_account <= UC_VIP ? $neverdelete_account : UC_VIP); if (get_user_class() < $neverdelete_account) { $secs = $deletenotransfertwo_account*24*60*60; $addedtime = strtotime($CURUSER['added']); if (TIMENOW > $addedtime+($secs/3)) // start notification if one third of the time has passed { $kicktimeout = gettime(date("Y-m-d H:i:s", $addedtime+$secs), false, false, true); $text = $lang_functions['text_please_download_something_within'].$kicktimeout.$lang_functions['text_inactive_account_be_deleted']; msgalert("rules.php", $text, "gray"); } } } } if($CURUSER['showclienterror'] == 'yes') { $text = $lang_functions['text_banned_client_warning']; msgalert("faq.php#id29", $text, "black"); } if ($unread) { $unreadidres = sql_query("SELECT id FROM messages WHERE receiver=" . sqlesc($CURUSER["id"]) . " AND unread='yes'") or sqlerr(__FILE__,__LINE__); $unreadidrow = mysql_fetch_assoc($unreadidres); $text = $lang_functions['text_you_have'].$unread.$lang_functions['text_new_message'] . add_s($unread) . $lang_functions['text_click_here_to_read']; msgalert("messages.php?action=viewmessage&id=".$unreadidrow['id'],$text, "indigo"); } /* if ($unread) // new message sound reminder,2010-12-23 { $unreadsound = $Cache->get_value("unread_sound_".$CURUSER['id']); if($unreadsound != '1'){ echo "<object type=\"application/x-mplayer2\" data=\"sound/message.wav\" width=\"0\" height=\"0\"> <param name=\"src\" value=\"sound/message.wav\"> <param name=\"autoplay\" value=\"1\"> </object>"; //support ie,firefox,chrome.. } $Cache->cache_value("unread_sound_".$CURUSER['id'], '1', 120); }*/ /* $pending_invitee = $Cache->get_value('user_'.$CURUSER["id"].'_pending_invitee_count'); if ($pending_invitee == ""){ $pending_invitee = get_row_count("users","WHERE status = 'pending' AND invited_by = ".sqlesc($CURUSER[id])); $Cache->cache_value('user_'.$CURUSER["id"].'_pending_invitee_count', $pending_invitee, 900); } if ($pending_invitee > 0) { $text = $lang_functions['text_your_friends'].add_s($pending_invitee).is_or_are($pending_invitee).$lang_functions['text_awaiting_confirmation']; msgalert("invite.php?id=".$CURUSER[id],$text, "red"); }*/ $settings_script_name = $_SERVER["SCRIPT_FILENAME"]; if (!preg_match("/index/i", $settings_script_name)) { $new_news = $Cache->get_value('user_'.$CURUSER["id"].'_unread_news_count'); if ($new_news == ""){ $new_news = get_row_count("news","WHERE notify = 'yes' AND added > ".sqlesc($CURUSER['last_home'])); $Cache->cache_value('user_'.$CURUSER["id"].'_unread_news_count', $new_news, 300); } if ($new_news > 0) { $text = $lang_functions['text_there_is'].is_or_are($new_news).$new_news.$lang_functions['text_new_news']; msgalert("index.php",$text, "green"); } } if (get_user_class() >= $staffmem_class) { $numreports = $Cache->get_value('staff_new_report_count'); if ($numreports == ""){ $numreports = get_row_count("reports","WHERE dealtwith=0"); $Cache->cache_value('staff_new_report_count', $numreports, 900); } if ($numreports){ $text = $lang_functions['text_there_is'].is_or_are($numreports).$numreports.$lang_functions['text_new_report'] .add_s($numreports); msgalert("reports.php",$text, "blue"); } $nummessages = $Cache->get_value('staff_new_message_count'); if ($nummessages == ""){ $nummessages = get_row_count("staffmessages","WHERE answered='no'"); $Cache->cache_value('staff_new_message_count', $nummessages, 900); } if ($nummessages > 0) { $text = $lang_functions['text_there_is'].is_or_are($nummessages).$nummessages.$lang_functions['text_new_staff_message'] . add_s($nummessages); msgalert("staffbox.php",$text, "blue"); } $numcheaters = $Cache->get_value('staff_new_cheater_count'); if ($numcheaters == ""){ $numcheaters = get_row_count("cheaters","WHERE dealtwith=0"); $Cache->cache_value('staff_new_cheater_count', $numcheaters, 900); } if ($numcheaters){ $text = $lang_functions['text_there_is'].is_or_are($numcheaters).$numcheaters.$lang_functions['text_new_suspected_cheater'] .add_s($numcheaters); msgalert("cheaterbox.php",$text, "blue"); } } } if ($offlinemsg) { print("<p><table width=\"737\" border=\"1\" cellspacing=\"0\" cellpadding=\"10\"><tr><td style='padding: 10px; background: red' class=\"text\" align=\"center\">\n"); print("<font color=\"white\">".$lang_functions['text_website_offline_warning']."</font>"); print("</td></tr></table></p><br />\n"); } } }
if ($numreports == "") { $numreports = get_row_count("reports", "WHERE dealtwith=0"); $Cache->cache_value('staff_new_report_count', $numreports, 900); } if ($numreports) { $text = $lang_functions['text_there_is'] . is_or_are($numreports) . $numreports . $lang_functions['text_new_report'] . add_s($numreports); msgalert("reports.php", $text, "blue"); } $nummessages = $Cache->get_value('staff_new_message_count'); if ($nummessages == "") { $nummessages = get_row_count("staffmessages", "WHERE answered='no'"); $Cache->cache_value('staff_new_message_count', $nummessages, 900); } if ($nummessages > 0) { $text = $lang_functions['text_there_is'] . is_or_are($nummessages) . $nummessages . $lang_functions['text_new_staff_message'] . add_s($nummessages); msgalert("staffbox.php", $text, "blue"); } $numcheaters = $Cache->get_value('staff_new_cheater_count'); if ($numcheaters == "") { $numcheaters = get_row_count("cheaters", "WHERE dealtwith=0"); $Cache->cache_value('staff_new_cheater_count', $numcheaters, 900); } if ($numcheaters) { $text = $lang_functions['text_there_is'] . is_or_are($numcheaters) . $numcheaters . $lang_functions['text_new_suspected_cheater'] . add_s($numcheaters); msgalert("cheaterbox.php", $text, "blue"); } } } $smarty->assign("offlinemsg", $offlinemsg); $smarty->display(MTPTTEMPLATES . "/function_smarty/header.html"); }
if ($pollid) { stdhead($lang_makepoll['head_edit_poll']); print "<h1>" . $lang_makepoll['text_edit_poll'] . "</h1>"; } else { stdhead($lang_makepoll['head_new_poll']); // Warn if current poll is less than 3 days old $res = sql_query("SELECT question, added FROM polls ORDER BY added DESC LIMIT 1") or sqlerr(); $arr = mysql_fetch_assoc($res); if ($arr) { $hours = floor((strtotime(date("Y-m-d H:i:s")) - strtotime($arr["added"])) / 3600); $days = floor($hours / 24); if ($days < 3) { if ($days >= 1) { $t = $days . $lang_makepoll['text_day'] . add_s($days); } else { $t = $hours . $lang_makepoll['text_hour'] . add_s($hours); } print "<p><font class=striking><b>" . $lang_makepoll['text_current_poll'] . "(<i>" . $arr["question"] . "</i>)" . $lang_makepoll['text_is_only'] . $t . $lang_makepoll['text_old'] . "</b></font></p>"; } } print "<h1>" . $lang_makepoll['text_make_poll'] . "</h1>"; } ?> <table border=1 cellspacing=0 cellpadding=5> <form method=post action=makepoll.php> <style type="text/css"> input.mp { width: 450px; }