Example #1
0
function main_menu()
{
    global $TABLE_PREFIX, $CURUSER, $tpl;
    $blocks = get_result('SELECT content FROM ' . $TABLE_PREFIX . 'blocks WHERE position="t" AND status=1 AND ' . $CURUSER['id_level'] . '>=minclassview  AND ' . $CURUSER['id_level'] . '<=maxclassview ' . ($FORUMLINK == '' || $FORUMLINK == 'internal' || substr($FORUMLINK, 0, 3) == 'smf' || $FORUMLINK == 'ipb' ? '' : ' AND content!="forum"') . ' ORDER BY sortid', true, $CACHE_DURATION);
    $return = '';
    foreach ($blocks as $entry) {
        $return .= get_content(realpath(dirname(__FILE__) . '/..') . '/blocks/' . $entry['content'] . '_block.php');
    }
    return set_block('', 'justify', $return);
}
Example #2
0
        $tpl->set("main_title", $btit_settings["name"] . " .::. " . "Index->Rules");
        break;
        /*End mod by losmi rules - mod*/
        /*Mod by losmi - faq mod*/
    /*End mod by losmi rules - mod*/
    /*Mod by losmi - faq mod*/
    case 'faq':
        require "{$THIS_BASEPATH}/faq.php";
        $tpl->set("main_content", set_block($language["MNU_FAQ"], "center", $faqtpl->fetch(load_template("faq.tpl"))));
        $tpl->set("main_title", $btit_settings["name"] . " .::. " . "Index->F.A.Q.");
        break;
        /*End mod by losmi faq - mod*/
    /*End mod by losmi faq - mod*/
    case 'moder':
        require "{$THIS_BASEPATH}/moder.php";
        $tpl->set("main_content", set_block($language["MODERATE_TORRENT"], "center", $torrenttpl->fetch(load_template("admin.moder.tpl"))));
        $tpl->set("main_title", $btit_settings["name"] . " .::. " . "Index->Torrent->Moderate");
        break;
    case 'index':
    case '':
    default:
        $tpl->set("main_content", center_menu());
        break;
}
// controll if client can handle gzip
if ($GZIP_ENABLED) {
    if (stristr($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip") && extension_loaded('zlib') && ini_get("zlib.output_compression") == 0) {
        if (ini_get('output_handler') != 'ob_gzhandler') {
            ob_start("ob_gzhandler");
            $gzip = 'enabled';
        } else {
Example #3
0
        case 'newtopic':
        case 'post':
        case 'quotepost':
        case 'reply':
            include "{$FORUM_PATH}/forum.post.php";
            $tpl->set("main_content", set_block($block_title, "center", $forumtpl->fetch(load_template("forum.post.tpl"))));
            break;
        case 'search':
            include "{$FORUM_PATH}/forum.search.php";
            $tpl->set("main_content", set_block($block_title, "center", $forumtpl->fetch(load_template("forum.search.tpl"))));
            break;
        case 'viewforum':
            include "{$FORUM_PATH}/forum.viewforum.php";
            $tpl->set("main_content", set_block($block_title, "center", $forumtpl->fetch(load_template("forum.viewforum.tpl"))));
            break;
        case 'viewtopic':
            include "{$FORUM_PATH}/forum.viewtopic.php";
            $tpl->set("main_content", set_block($block_title, "center", $forumtpl->fetch(load_template("forum.viewtopic.tpl"))));
            break;
        case 'viewunread':
            include "{$FORUM_PATH}/forum.unread.php";
            $tpl->set("main_content", set_block($block_title, "center", $forumtpl->fetch(load_template("forum.unread.tpl"))));
            break;
        case 'index':
        case '':
        default:
            include "{$FORUM_PATH}/forum.main.php";
            $tpl->set("main_content", set_block($language["FORUM"], "center", $forumtpl->fetch(load_template("forum.main.tpl"))));
            break;
    }
}
Example #4
0
function information_msg($heading = 'Error!', $string, $close = false)
{
    global $language, $STYLEPATH, $tpl, $page, $STYLEURL;
    if (!isset($tpl) || empty($tpl)) {
        die($heading . "<br />" . $string);
    }
    // just in case not found the language
    if (!$language['BACK']) {
        $language['BACK'] = 'Back';
    }
    $err_tpl = new bTemplate();
    $err_tpl->set('information_title', $heading);
    $err_tpl->set('information_message', $string);
    $err_tpl->set('information_image', $STYLEURL . '/images/error.gif');
    $err_tpl->set('language', $language);
    if ($close) {
        $err_tpl->set('information_footer', '<a href="javascript: window.close();">' . $language['CLOSE'] . '</a>');
    } else {
        $err_tpl->set('information_footer', '<a href="javascript: history.go(-1);">' . $language['BACK'] . '</a>');
    }
    $tpl->set('main_content', set_block($heading, 'center', $err_tpl->fetch(load_template('information.tpl'))));
    stdfoot(true, false);
    die;
}
Example #5
0
for ($i = 0; $i < count($sqlver); $i++) {
    $admin["infos"] .= "<tr><td align=\"left\">{$sqlver[$i]}</td></tr>\n";
}
$admin["infos"] .= "\n</table><br />\n";
unset($sqlver);
// check for news on btiteam site (read rss from comunication forum)
include "{$THIS_BASEPATH}/include/class.rssreader.php";
$btit_news = get_cached_version($btit_url_rss);
if (!$btit_news) {
    $frss = get_remote_file($btit_url_rss);
    if (!$frss) {
        $btit_news = "<div class=\"blocklist\" style=\"padding:5px; align:center;\">Unable to contact Btiteam's site</div>";
    } else {
        $nrss = new rss_reader();
        $rss_array = $nrss->rss_to_array($frss);
        $btit_news = "<div class=\"blocklist\" style=\"padding:5px;\">";
        if (!$rss_array) {
            $btit_news = "<div class=\"blocklist\" style=\"padding:5px;\">Unable to contact Btiteam's site</div>";
        } else {
            foreach ($rss_array[0]["item"] as $id => $rss) {
                $btit_news .= date("d M Y", strtotime($rss["pubDate"])) . ":&nbsp;\n<a href=\"" . $rss["guid"] . "\">" . $rss["title"] . "</a><br />\n<br />\n";
                $btit_news .= "\n" . $rss["description"] . "<br />\n<hr />\n";
            }
        }
        $btit_news .= "</div>";
    }
    write_cached_version($btit_url_rss, $btit_news);
}
$admintpl->set("btit_news", set_block("BtiTacker Lastest News", "left", $btit_news));
$admintpl->set("language", $language);
$admintpl->set("admin", $admin);
Example #6
0
        $tpl->set("main_content", set_block($language["ACP_BAN_IP"], "center", $admintpl->fetch(load_template("admin.banip.tpl"))));
        break;
    case 'module_config':
        include "{$ADMIN_PATH}/admin.module_config.php";
        $tpl->set("main_content", set_block($language["ACP_MODULES_CONFIG"], "center", $admintpl->fetch(load_template("admin.module_config.tpl"))));
        break;
    case 'hacks':
        include "{$ADMIN_PATH}/admin.hacks.php";
        $tpl->set("main_content", set_block($language["ACP_HACKS_CONFIG"], "center", $admintpl->fetch(load_template("admin.hacks.tpl"))));
        break;
    case 'users':
        include "{$ADMIN_PATH}/admin.users.tools.php";
        $tpl->set("main_content", set_block($block_title, "center", $admintpl->fetch(load_template("admin.users.tools.tpl"))));
        break;
    case 'sanity':
        require_once "{$THIS_BASEPATH}/include/sanity.php";
        $now = time();
        $res = do_sqlquery("SELECT last_time FROM {$TABLE_PREFIX}tasks WHERE task='sanity'");
        $row = mysql_fetch_row($res);
        if (!$row) {
            do_sqlquery("INSERT INTO {$TABLE_PREFIX}tasks (task, last_time) VALUES ('sanity',{$now})");
        } else {
            $ts = $row[0];
            do_sqlquery("UPDATE {$TABLE_PREFIX}tasks SET last_time={$now} WHERE task='sanity' AND last_time = {$ts}");
        }
        do_sanity();
    default:
        include "{$ADMIN_PATH}/admin.main.php";
        $tpl->set("main_content", set_block($language["WELCOME_ADMINCP"], "center", $admintpl->fetch(load_template("admin.main.tpl"))));
        break;
}
Example #7
0
         break;
     case 'pid_c':
         include "{$USER_PATH}/usercp.pidchange.php";
         $tpl->set("main_content", set_block($language["CHANGE_PID"], "center", $usercptpl->fetch(load_template("usercp.pidchange.tpl"))));
         break;
     case 'rename':
         include "{$USER_PATH}/usercp.rename.php";
         $tpl->set("main_content", set_block($language["MNU_UCP_RENAME"], "center", $usercptpl->fetch(load_template("usercp.rename.tpl"))));
         break;
     case 'invite':
         include "{$USER_PATH}/usercp.invitations.php";
         $tpl->set("main_content", set_block($language["MNU_UCP_INVITATIONS"], "center", $usercptpl->fetch(load_template("usercp.invitations.tpl"))));
         break;
     default:
         include "{$USER_PATH}/usercp.main.php";
         $tpl->set("main_content", set_block($language["MNU_UCP_HOME"], "center", $usercptpl->fetch(load_template("usercp.main.tpl"))));
         break;
 }
 // Reverify Mail Hack by Petr1fied - Start --->
 // Update the members e-mail account if the validation link checks out
 // ==========================================================================================
 // If both "do=verify" and "action=changemail" are in the url
 if ($do == "verify" && $action == "changemail") {
     if ($GLOBALS["FORUMLINK"] == "ipb") {
         if (!defined('IPS_ENFORCE_ACCESS')) {
             define('IPS_ENFORCE_ACCESS', true);
         }
         if (!defined('IPB_THIS_SCRIPT')) {
             define('IPB_THIS_SCRIPT', 'public');
         }
         require_once $THIS_BASEPATH . '/ipb/initdata.php';
Example #8
0
function _torrenttable($rt, $frame_caption, $speed = false)
{
    global $STYLEPATH, $extratpl, $language;
    $torrent = array();
    $num = 0;
    foreach ($rt as $id => $a) {
        $num++;
        if ($a["leechers"] > 0) {
            $r = $a["seeds"] / $a["leechers"];
            $ratio = number_format($r, 2);
        } else {
            $ratio = $language["INFINITE"];
        }
        $torrent[$num - 1]["rank"] = $num;
        if ($GLOBALS["usepopup"]) {
            $torrent[$num - 1]["filename"] = "<a href=\"javascript:popdetails('index.php?page=details&amp;id=" . $a['hash'] . "');\">" . unesc($a["name"]) . "</a>";
        } else {
            $torrent[$num - 1]["filename"] = "<a href=\"index.php?page=details&amp;id=" . $a['hash'] . "\">" . unesc($a["name"]) . "</a>";
        }
        $torrent[$num - 1]["complete"] = number_format($a["finished"]);
        $torrent[$num - 1]["seeds"] = number_format($a["seeds"]);
        $torrent[$num - 1]["leechers"] = number_format($a["leechers"]);
        $torrent[$num - 1]["peers"] = number_format($a["leechers"] + $a["seeds"]);
        $torrent[$num - 1]["ratio"] = $ratio;
        if ($speed) {
            $torrent[$num - 1]["speed"] = makesize($a["speed"]);
        }
    }
    $extratpl->set("language", $language);
    $extratpl->set("torrent", $torrent);
    $extratpl->set("DISPLAY_SPEED", $speed, true);
    $extratpl->set("DISPLAY_SPEED1", $speed, true);
    return set_block($frame_caption, "center", $extratpl->fetch(load_template("extra-stats.torrent.tpl")));
}
    $your_version = set_block("Version", "center", $your_version);
}
// check for news on btiteam site (read rss from comunication forum)
if ($btit_url_rss != "") {
    include "{$THIS_BASEPATH}/include/class.rssreader.php";
    $btit_news = get_cached_version($btit_url_rss);
    if (!$btit_news) {
        $frss = get_remote_file($btit_url_rss);
        if (!$frss) {
            $btit_news = "<div class=\"blocklist\" style=\"padding:5px; align:center;\">Unable to contact Btiteam's site</div>";
        } else {
            $nrss = new rss_reader();
            $rss_array = $nrss->rss_to_array($frss);
            $btit_news = "<div class=\"blocklist\" style=\"padding:5px;\">";
            if (!$rss_array) {
                $btit_news = "<div class=\"blocklist\" style=\"padding:5px;\">Unable to contact Btiteam's site</div>";
            } else {
                foreach ($rss_array[0]["item"] as $id => $rss) {
                    $btit_news .= date("d M Y", strtotime($rss["pubDate"])) . ":&nbsp;\n<a href=\"" . $rss["guid"] . "\">" . $rss["title"] . "</a><br />\n<br />\n";
                    $btit_news .= "\n" . $rss["description"] . "<br />\n<hr />\n";
                }
            }
            $btit_news .= "</div>";
        }
        write_cached_version($btit_url_rss, $btit_news);
    }
} else {
    $btit_news = "<div class=\"blocklist\" style=\"padding:5px; align:center;\">Unable to contact Btiteam's site</div>";
}
$btit_news = set_block("Btiteam Latest News", "center", $btit_news);
echo $your_version . $btit_news;
Example #10
0
        // the main_content for current template is setting within users/index.php
        $tpl->set("main_title", $btit_settings["name"] . " .::. " . "Index->My Panel");
        break;
    case 'upload':
        require "{$THIS_BASEPATH}/upload.php";
        $tpl->set("main_content", set_block($language["MNU_UPLOAD"], "center", $uploadtpl->fetch(load_template("{$tplfile}.tpl"))));
        $tpl->set("main_title", $btit_settings["name"] . " .::. " . "Index->Torrent->Upload");
        break;
    case 'userdetails':
        require "{$THIS_BASEPATH}/userdetails.php";
        $tpl->set("main_content", set_block($language["USER_DETAILS"], "center", $userdetailtpl->fetch(load_template("userdetails.tpl"))));
        $tpl->set("main_title", $btit_settings["name"] . " .::. " . "Index->Users->Details");
        break;
    case 'viewnews':
        require "{$THIS_BASEPATH}/viewnews.php";
        $tpl->set("main_content", set_block($language["LAST_NEWS"], "center", $viewnewstpl->fetch(load_template("viewnews.tpl"))));
        $tpl->set("main_title", $btit_settings["name"] . " .::. " . "Index->News");
        break;
    case 'index':
    case '':
    default:
        $tpl->set("main_content", center_menu());
        break;
}
// controll if client can handle gzip
if ($GZIP_ENABLED) {
    if (stristr($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip") && extension_loaded('zlib') && ini_get("zlib.output_compression") == 0) {
        if (ini_get('output_handler') != 'ob_gzhandler') {
            ob_start("ob_gzhandler");
            $gzip = 'enabled';
        } else {
Example #11
0
$tpl_comment->set("comment_comment", textbbcode("comment", "comment", htmlspecialchars(unesc($comment))));
if (isset($_POST["info_hash"])) {
    if ($_POST["confirm"] == $language["FRM_CONFIRM"]) {
        $comment = addslashes($_POST["comment"]);
        $user = AddSlashes($CURUSER["username"]);
        if ($user == "") {
            $user = "******";
        }
        if (empty($comment)) {
            stderr($language["ERROR"], $language['ERR_COMMENT_EMPTY']);
            exit;
        } else {
            do_sqlquery("INSERT INTO {$TABLE_PREFIX}comments (added,text,ori_text,user,info_hash) VALUES (NOW(),\"{$comment}\",\"{$comment}\",\"{$user}\",\"" . mysql_real_escape_string(StripSlashes($_POST["info_hash"])) . "\")", true);
            redirect("index.php?page=torrent-details&id=" . StripSlashes($_POST["info_hash"]) . "#comments");
            die;
        }
    }
    # Comment preview by miskotes
    #############################
    if ($_POST["confirm"] == $language["FRM_PREVIEW"]) {
        $tpl_comment->set("PREVIEW", TRUE, TRUE);
        $tpl_comment->set("comment_preview", set_block($language["COMMENT_PREVIEW"], "center", format_comment($comment), false));
        #####################
        # Comment preview end
    } else {
        redirect("index.php?page=torrent-details&id=" . StripSlashes($_POST["info_hash"]) . "#comments");
        die;
    }
} else {
    $tpl_comment->set("PREVIEW", FALSE, TRUE);
}
Example #12
0
    $your_version = set_block("Version", "center", $your_version);
}
// check for news on DiemThuy,s site (read rss from comunication forum)
if ($btit_url_rss != "") {
    include "{$THIS_BASEPATH}/include/class.rssreader.php";
    $btit_news = get_cached_version($btit_url_rss);
    if (!$btit_news) {
        $frss = get_remote_file($btit_url_rss);
        if (!$frss) {
            $btit_news = "<div class=\"blocklist\" style=\"padding:5px; align:center;\">Unable to contact xbtitdeveloping</div>";
        } else {
            $nrss = new rss_reader();
            $rss_array = $nrss->rss_to_array($frss);
            $btit_news = "<div class=\"blocklist\" style=\"padding:5px;\">";
            if (!$rss_array) {
                $btit_news = "<div class=\"blocklist\" style=\"padding:5px;\">Unable to contact xbtitdeveloping</div>";
            } else {
                foreach ($rss_array[0]["item"] as $id => $rss) {
                    $btit_news .= date("d M Y", strtotime($rss["pubDate"])) . ":&nbsp;\n<a href=\"" . $rss["guid"] . "\">" . $rss["title"] . "</a><br />\n<br />\n";
                    $btit_news .= "\n" . $rss["description"] . "<br />\n<hr />\n";
                }
            }
            $btit_news .= "</div>";
        }
        write_cached_version($btit_url_rss, $btit_news);
    }
} else {
    $btit_news = "<div class=\"blocklist\" style=\"padding:5px; align:center;\">Unable to contact xbtitdeveloping</div>";
}
$btit_news = set_block("Xbtit Developing Latest News", "center", $btit_news);
echo $your_version . $btit_news;
Example #13
0
    case 'warn':
        require "{$THIS_BASEPATH}/warn.php";
        break;
    case 'rewarn':
        require "{$THIS_BASEPATH}/rewarn.php";
        break;
    case 'staff':
        require "{$THIS_BASEPATH}/staff.php";
        $tpl->set("main_content", set_block($SITENAME . " " . $language["STAFF"], "center", $stafftpl->fetch(load_template("staff.tpl"))));
        $tpl->set("main_title", $btit_settings["name"] . " .::. " . "Staff");
        break;
        /*Mod by losmi - faq mod*/
    /*Mod by losmi - faq mod*/
    case 'faq':
        require "{$THIS_BASEPATH}/faq.php";
        $tpl->set("main_content", set_block($language["MNU_FAQ"], "center", $faqtpl->fetch(load_template("faq.tpl"))));
        $tpl->set("main_title", $btit_settings["name"] . " .::. " . "F.A.Q.");
        break;
        /*End mod by losmi faq - mod*/
    /*End mod by losmi faq - mod*/
    case 'index':
    case '':
    default:
        $tpl->set("main_content", center_menu());
        break;
}
// controll if client can handle gzip
if ($GZIP_ENABLED) {
    if (stristr($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip") && extension_loaded('zlib') && ini_get("zlib.output_compression") == 0) {
        if (ini_get('output_handler') != 'ob_gzhandler') {
            ob_start("ob_gzhandler");