本文整理汇总了PHP中standardheader函数的典型用法代码示例。如果您正苦于以下问题:PHP standardheader函数的具体用法?PHP standardheader怎么用?PHP standardheader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了standardheader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
/*
* BtiTracker v1.5.0 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified).
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2014 Btiteam.org
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php';
dbconn();
standardheader('Comments');
if (!user::$current || user::$current["uid"] == 1) {
err_msg(ERROR, ONLY_REG_COMMENT);
stdfoot();
exit;
}
$comment = $db->real_escape_string($_POST["comment"]);
$id = $db->real_escape_string($_GET["id"]);
if (isset($_GET["cid"])) {
$cid = intval($_GET["cid"]);
} else {
$cid = 0;
}
function comment_form()
{
global $comment, $id, $cid;
block_begin(NEW_COMMENT);
$comment = str_replace('\\r\\n', "\n", $comment);
?>
<center>
<form enctype='multipart/form-data' name='comment' method='post'>
示例2: dirname
<?php
/*
* BtiTracker v1.5.0 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified).
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2014 Btiteam.org
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php';
dbconn();
standardheader('Torrent Details');
if (!user::$current || user::$current["view_torrents"] != "yes") {
err_msg(ERROR . NOT_AUTHORIZED . " " . MNU_TORRENT . "!", SORRY . "...");
stdfoot();
exit;
}
block_begin(TORRENT_DETAIL);
$id = AddSlashes(isset($_GET["id"]) ? $_GET["id"] : false);
if (!isset($id) || !$id) {
die(ERROR_ID . ": " . $id);
}
if (isset($_GET["act"])) {
print "<center>" . TORRENT_UPDATE . "</center>";
require_once INCL_PATH . 'getscrape.php';
scrape(urldecode($_GET["surl"]), $id);
redirect("details.php?id=" . $id);
exit;
}
if (isset($_GET["vote"]) && $_GET["vote"] == VOTE) {
if (isset($_GET["rating"]) && $_GET["rating"] == 0) {
err_msg(ERROR, ERR_NO_VOTE);
示例3: standardheader
standardheader("Login");
print "<br /><br /><div align='center'><font size='2' color='#FF0000'>" . ERR_USERNAME_INCORRECT . "</font></div>";
login();
} elseif (md5($row["random"] . $row["password"] . $row["random"]) != md5($row["random"] . md5($pwd) . $row["random"])) {
standardheader("Login");
print "<br /><br /><div align='center'><font size='2' color='#FF0000'>" . ERR_PASSWORD_INCORRECT . "</font></div>";
login();
} else {
$db->query("UPDATE users SET loginhash = '" . md5(vars::$ip . $row['password']) . "' WHERE id = " . (int) $row['id']);
$salted = md5($GLOBALS["salting"] . $row["random"] . $row["password"] . $row["random"]);
logincookie((int) $row["id"], $salted);
if (isset($_GET["returnto"])) {
$url = security::html_safe(urldecode($_GET["returnto"]));
} else {
$url = "index.php";
}
redirect($url);
}
} else {
standardheader("Login");
login();
exit;
}
} else {
if (isset($_GET["returnto"])) {
$url = security::html_safe(urldecode($_GET["returnto"]));
} else {
$url = "index.php";
}
redirect($url);
}
示例4: dirname
<?php
/*
* BtiTracker v1.5.1 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified).
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2015 Btiteam.org
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php';
dbconn();
standardheader('Password Recovery', true);
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$email = trim(htmlentities(urldecode($_POST["email"])));
if (!$email) {
stderr(ERROR, ERR_NO_EMAIL);
}
$res = $db->query("SELECT * FROM users WHERE email = " . sqlesc($email) . " LIMIT 1");
$arr = $res->fetch_assoc() or stderr(ERROR, ERR_EMAIL_NOT_FOUND_1 . " <b>" . $email . "</b> " . ERR_EMAIL_NOT_FOUND_2);
if ($USE_IMAGECODE) {
if (extension_loaded('gd')) {
$arrgd = gd_info();
if ($arrgd['FreeType Support'] == 1) {
$public = $_POST['public_key'];
$private = $_POST['private_key'];
$p = new ocr_captcha();
if ($p->check_captcha($public, $private) != true) {
stderr(ERROR, ERR_IMAGE_CODE);
}
}
}
}
示例5: number_format
echo "</tr>";
$menu = 1;
}
print "<tr><td class='lista' align='center'>" . $num . "</td><td class='lista' align='left'>";
print "<a href='" . "details.php?id=" . $a['hash'] . "'>" . "<b>";
print security::html_safe($a["name"]) . "</b></a></td>";
if ($speed != "true") {
print "<td class='lista' align='center' width='10%' ><a href='torrent_history.php?id=" . $a["hash"] . "'>" . number_format((int) $a["finished"]) . "</a></td><td class='lista' align='center' width='10%' ><a href='peers.php?id=" . $a["hash"] . "'>" . number_format((int) $a["seeds"]) . "</a></td><td class='lista' align='center' width='10%' > <a href='peers.php?id=" . $a["hash"] . "'>" . number_format((int) $a["leechers"]) . "</a></td><td class='lista' align='center' width='10%' > <a href='peers.php?id=" . $a["hash"] . "'>" . number_format((int) $a["leechers"] + (int) $a["seeds"]) . "</a></td><td class='lista' align='center' width='10%'>" . $ratio . "</td>\n";
} else {
print "<td class='lista' align='center'>" . misc::makesize((int) $a["speed"]) . "/s" . "\n";
}
}
end_table();
block_end();
}
standardheader('Tracker Statistics');
// the display the box only if number of rows is > 0
if (user::$current["view_users"] == "yes") {
$r = $db->query("SELECT * FROM users WHERE uploaded > 0 ORDER BY uploaded DESC LIMIT 10") or die;
if ($r->num_rows > 0) {
usertable($r, TOP_10_UPLOAD);
echo "<br /><br />";
}
$r = $db->query("SELECT * FROM users WHERE uploaded > 0 AND downloaded > 0 ORDER BY downloaded DESC LIMIT 10") or die;
if ($r->num_rows > 0) {
usertable($r, TOP_10_DOWNLOAD);
echo "<br /><br />";
}
$r = $db->query("SELECT * FROM users WHERE downloaded > 104857600 ORDER BY uploaded - downloaded DESC LIMIT 10") or die;
if ($r->num_rows > 0) {
usertable($r, TOP_10_SHARE . " <font class='lista'>" . MINIMUM_100_DOWN . "</font>");
示例6: dirname
<?php
//Torrent RSS by DiemThuy ( jul 2012 ) TBDEV conversion with some improvements; Adapated by Yupy for BtiTracker...
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php';
dbconn();
if (user::$current['view_torrents'] == 'yes') {
standardheader('RSS');
$res = $db->query("SELECT id, name, image FROM categories ORDER BY name");
while ($cat = $res->fetch_assoc()) {
if ($cat['image'] == '') {
$catoptions .= '';
} else {
$catoptions .= "<a href='torrents.php?category=" . $cat['id'] . "'>" . image_or_link($cat['image'] == '' ? '' : "{$STYLEPATH}/images/categories/" . $cat['image'], '', security::html_safe($cat['name'])) . "</a><input type='checkbox' name='cat[]' value='" . (int) $cat['id'] . "' " . (strpos($CURUSER['notifs'], "[cat{$cat['id']}]") !== false ? " checked" : '') . "/>";
}
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (empty($_POST['cat'])) {
stderr('Error', 'You need to chose at least one Category !');
}
if (empty($_POST['feed'])) {
stderr('Error', 'You need to chose a feed type !');
}
$link = $BASEURL . '/rss_torrents.php';
if ($_POST['feed'] == 'dl') {
$query[] = 'feed=dl';
}
foreach ($_POST['cat'] as $cat) {
$query[] = 'cat[]=' . $cat;
}
$query[] = 'pid=' . user::$current['pid'];
$queries = implode('&', $query);
示例7: dirname
<?php
/*
* BtiTracker v1.5.1 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified).
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2015 Btiteam.org
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php';
dbconn();
standardheader('User Details');
block_begin(USER_DETAILS);
$id = intval(0 + $_GET['id']);
if (!isset($_GET['returnto'])) {
$_GET["returnto"] = '';
}
$link = rawurlencode($_GET['returnto']);
if (user::$current['view_users'] != 'yes') {
err_msg(ERROR, NOT_AUTHORIZED . ' ' . MEMBERS);
block_end();
stdfoot();
die;
}
if ($id > 1) {
$res = $db->query("SELECT users.cip, UNIX_TIMESTAMP(users.joined) AS joined, UNIX_TIMESTAMP(users.lastconnect) AS lastconnect, users_level.level, users_level.prefixcolor, users_level.suffixcolor, countries.name, countries.flagpic, users.pid, users.time_offset FROM users INNER JOIN users_level ON users_level.id = users.id_level LEFT JOIN countries ON users.flag = countries.id WHERE users.id = " . $id);
$num = $res->num_rows;
#Stats Upped, Downed, etc...
$user_stats = MCached::get('user::stats::' . $id);
if ($user_stats === MCached::NO_RESULT) {
$stats = $db->query('SELECT uploaded, downloaded FROM users WHERE id = ' . $id);
$user_stats = $stats->fetch_assoc();
示例8: dirname
<?php
/*
* BtiTracker v1.5.1 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified).
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2015 Btiteam.org
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php';
dbconn();
standardheader('Forum');
if (!user::$current || user::$current["view_forum"] != "yes") {
stderr(ERROR, NOT_AUTHORIZED . " " . MNU_FORUM);
}
if (isset($_GET["action"])) {
$action = security::html_safe($_GET["action"]);
} else {
$action = "";
}
function catch_up()
{
global $db;
$userid = user::$current["uid"];
$res = $db->query("SELECT id, lastpost FROM topics");
while ($arr = $res->fetch_assoc()) {
$topicid = (int) $arr["id"];
$postid = (int) $arr["lastpost"];
$r = $db->query("SELECT id, lastpostread FROM readposts WHERE userid = " . $userid . " AND topicid = " . $topicid) or sqlerr(__FILE__, __LINE__);
if ($r->num_rows == 0) {
$db->query("INSERT INTO readposts (userid, topicid, lastpostread) VALUES(" . $userid . ", " . $topicid . ", " . $postid . ")") or sqlerr(__FILE__, __LINE__);
} else {
示例9: dirname
<?php
/*
* BtiTracker v1.5.0 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified).
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2014 Btiteam.org
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php';
dbconn();
standardheader('Users Search', false);
if (isset($_GET['action']) && $_GET['action']) {
$action = security::html_safe($_GET['action']);
} else {
$action = '';
}
if ($action = "find") {
?>
<form action='searchusers.php?action=find' name='users' method='post'>
<div align='center'>
<table class='lista'>
<tr>
<td><?php
echo USER_NAME;
?>
:</td>
<td class='lista'><input type='text' name='user' size='40' maxlength='40' /></td>
<td class='lista'><input type='submit' name='confirm' value='Search' /></td>
</tr>
</table>
</div>
示例10: dirname
<?php
/*
* BtiTracker v1.5.1 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified).
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2015 Btiteam.org
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php';
dbconn(true);
standardheader('User Control Panel');
$uid = isset($_GET["uid"]) ? intval($_GET["uid"]) : 1;
?>
<script type="text/javascript">
<!--
var newwindow;
function popusers(url)
{
newwindow=window.open(url,'popusers','height=100,width=450');
if (window.focus) {newwindow.focus()}
}
// -->
</script>
<?php
if (user::$current["uid"] != $uid || user::$current["uid"] == 1) {
err_msg(ERROR, ERR_USER_NOT_USER);
stdfoot();
exit;
} else {
$utorrents = user::$current["torrentsperpage"];
if (isset($_GET["do"])) {
示例11: dirname
<?php
/*
* BtiTracker v1.5.0 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified).
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2014 Btiteam.org
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php';
dbconn();
standardheader('Edit Torrents');
$scriptname = $_SERVER["PHP_SELF"];
$link = $_GET["returnto"];
if ($link == "") {
$link = "details.php?id=" . $row["info_hash"];
}
if (isset($_POST["comment"]) && isset($_POST["name"])) {
if ($_POST["action"] == FRM_CONFIRM) {
if ($_POST["name"] == '') {
err_msg("Error!", "You must specify torrent name.");
stdfoot();
exit;
}
if ($_POST["comment"] == '') {
err_msg("Error!", "You must specify description.");
stdfoot();
exit;
}
$fname = sqlesc(security::html_safe($_POST["name"]));
$torhash = AddSlashes($_POST["info_hash"]);
write_log("Modified torrent " . $fname . " (" . $torhash . ")", "modify");
示例12: dirname
<?php
/*
* BtiTracker v1.5.1 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified).
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2015 Btiteam.org
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php';
require_once CLASS_PATH . 'class.Bencode.php';
function_exists("sha1") or die('<font color="red">' . NOT_SHA . '</font></body></html>');
dbconn();
standardheader('Uploads');
if (!user::$current || user::$current["can_upload"] == "no") {
stderr(ERROR . NOT_AUTHORIZED_UPLOAD, SORRY . "...");
}
block_begin(MNU_UPLOAD);
print "<table class='lista' border='0' width='100%'>\n";
print "<tr><td align='center'>";
if (isset($_FILES["torrent"])) {
if ($_FILES["torrent"]["error"] != 4) {
$fd = fopen($_FILES["torrent"]["tmp_name"], "rb") or die(FILE_UPLOAD_ERROR_1);
is_uploaded_file($_FILES["torrent"]["tmp_name"]) or die(FILE_UPLOAD_ERROR_2);
$length = filesize($_FILES["torrent"]["tmp_name"]);
if ($length) {
$alltorrent = fread($fd, $length);
} else {
err_msg(ERROR, FILE_UPLOAD_ERROR_3);
print "</td></tr></table>";
block_end();
stdfoot();
示例13: dirname
<?php
/*
* BtiTracker v1.5.1 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified).
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2015 Btiteam.org
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php';
dbconn();
standardheader('Members');
if (user::$current['view_users'] == 'no') {
err_msg(ERROR, NOT_AUTHORIZED . ' ' . MEMBERS . '!');
stdfoot();
exit;
} else {
block_begin(MEMBERS_LIST);
print_users();
block_end();
}
stdfoot();
示例14: require_once
<?
require_once ("include/functions.php");
require_once ("include/config.php");
require_once ("include/blocks.php");
dbconn(true);
standardheader('Index',true,0);
//center_menu();
/*
if (!$CURUSER || $CURUSER["view_torrents"]=="no")
{
err_msg(ERROR.NOT_AUTHORIZED." ".MNU_TORRENT."!",SORRY."...");
stdfoot();
exit();
}
else
{
*/
?>
<script language="Javascript" type="text/javascript">
<!--
var newwindow;
function popdetails(url)
{
newwindow=window.open(url,'popdetails','height=500,width=500,resizable=yes,scrollbars=yes,status=yes');
if (window.focus) {newwindow.focus()}
示例15: intval
$arandom = intval($_GET["code"]);
if (!$aid || empty($aid) || $aid == 0 || !$arandom || empty($arandom) || $arandom == 0) {
standardheader('Access Denied');
err_msg(ERROR, NOT_ADMIN_CP_ACCESS);
stdfoot();
exit;
}
$mqry = $db->query("SELECT users.id FROM users INNER JOIN users_level ON users_level.id = users.id_level WHERE users.id = " . $aid . " AND random = " . $arandom . " AND admin_access = 'yes' AND username = " . sqlesc(user::$current["username"]) . "");
if ($mqry->num_rows < 1) {
standardheader('Access Denied');
err_msg(ERROR, NOT_ADMIN_CP_ACCESS);
stdfoot();
exit;
}
// EOF
standardheader('Administrator Control Panel');
if (!user::$current || user::$current["admin_access"] != "yes") {
err_msg(ERROR, NOT_ADMIN_CP_ACCESS);
stdfoot();
exit;
} else {
define("IN_ACP", true);
//
// Read a listing of uploaded category images for use in the edit menu link code...
//
$dir = @opendir('images/categories/');
while ($file = @readdir($dir)) {
if (!@is_dir('images/categories/' . $file)) {
$img_size = @getimagesize('images/categories/' . $file);
if ($img_size[0] && $img_size[1]) {
$images[] = $file;