本文整理汇总了PHP中safechar函数的典型用法代码示例。如果您正苦于以下问题:PHP safechar函数的具体用法?PHP safechar怎么用?PHP safechar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了safechar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: commenttable_new
function commenttable_new($rows)
{
global $CURUSER, $HTTP_SERVER_VARS;
begin_main_frame();
begin_frame();
$count = 0;
foreach ($rows as $row) {
$subres = mysql_query("SELECT name from torrents where id=" . unsafeChar($row["torrent"])) or sqlerr(__FILE__, __LINE__);
$subrow = mysql_fetch_array($subres);
print "<br /><a href=\"details.php?id=" . safeChar($row["torrent"]) . "\">" . safeChar($subrow["name"]) . "</a><br />\n";
print "<p class=sub>#" . $row["id"] . " by ";
if (isset($row["username"])) {
print "<a name=comm" . $row["id"] . " href=userdetails.php?id=" . safeChar($row["user"]) . "><b>" . safechar($row["username"]) . "</b></a>" . ($row["warned"] == "yes" ? "<img src=" . "pic/warned.gif alt=\"Warned\">" : "");
} else {
print "<a name=\"comm" . safeChar($row["id"]) . "\"><i>(orphaned)</i></a>\n";
}
print " at " . safeChar($row["added"]) . " GMT" . "- [<a href=comment.php?action=edit&cid={$row['id']}>Edit</a>]" . "- [<a href=deletecomment.php?id={$row['id']}>Delete</a>]</p>\n";
$avatar = $CURUSER["avatars"] == "yes" ? safechar($row["avatar"]) : "";
if (!$avatar) {
$avatar = "pic/default_avatar.gif";
}
begin_table(true);
print "<tr valign=top>\n";
print "<td align=center width=150 style='padding: 0px'><img width=150 src={$avatar}></td>\n";
print "<td class=text>" . format_comment($row["text"]) . "</td>\n";
print "</tr>\n";
end_table();
}
end_frame();
end_main_frame();
}
示例2: Do_Edit
function Do_Edit($cats = array())
{
if (empty($_POST['option'])) {
Do_Error("Error", "No option selected <a href='links_admin.php'>Go Back</a>");
}
if (!isset($_POST['cat']) || empty($_POST['cat']) || !is_valid_id($_POST['cat'])) {
Do_Error("Error", "No Section selected");
}
$cat_id = (int) $_POST['cat'];
$option = $_POST['option'] == 'heading' ? 'links_categories' : 'links';
$sql = sql_query("SELECT * FROM {$option} WHERE cid = {$cat_id}") or stderr("SQL Error", "OOps!");
if (!mysql_num_rows($sql)) {
stderr("SQL Error", "Nothing doing here!");
}
stdhead("Edit " . safechar($option));
if ('links_categories' == $option) {
while ($row = mysql_fetch_assoc($sql)) {
echo "<div class='faqhead'>heading No.{$row['cid']}</div><div class='faqbody'><form name='inputform' method='post' action='links_admin.php'>" . "<input type='hidden' name='action' value='cat_update' /><input type='hidden' name='cat' value='{$row['cid']}' />" . "<input type='text' value='" . safechar($row['rcat_name'], ENT_QUOTES) . "' name='rcat_name' style='width:380px;' /> " . "<input type='submit' name='submit' value='Edit' class='button'></form></div>";
}
} else {
while ($row = mysql_fetch_assoc($sql)) {
begin_frame();
echo "<div class='faqhead'>Link No.{$row['id']}</div><div class='faqbody'>";
print $row['mtime'];
echo "<form name='compose' method='post' action='links_admin.php'>";
echo "<input type='hidden' name='action' value='links_update' />";
echo "<input type='hidden' name='links_id' value='{$row['id']}' />";
echo "<input type='text' value='{$row['heading']}' name='heading' style='width:380px;' /> ";
echo "<select name='cat'><option value=''>--Select One--</option>";
foreach ($cats as $v) {
print "<option value='" . $v['cid'] . "'>" . $v['rcat_name'] . '</option>';
}
echo "</select><br />";
//echo "<textarea name='text' rows='5' style='width:380px;'>".htmlentities($row['text'])."</textarea>";
$body = htmlentities($row['body']);
textbbcode("compose", "body", $body);
echo "<br /><input type='submit' name='submit' value='Edit This Entry' class='button'>";
echo "</form></div>";
//===added delete
echo "<form name='deleteform' method='post' action='links_admin.php'>";
echo "<input type='hidden' name='action' value='links_delete' />";
echo "<input type='hidden' name='id' value='{$row['id']}' />";
echo "<br><input type='submit' name='submit' value='Delete This Entry' class='button'>";
echo "</form></div>";
end_frame();
}
}
Stdfoot();
exit;
}
示例3: Do_Edit
function Do_Edit($cats = array())
{
if (empty($_POST['option'])) {
Do_Error("Error", "No option selected <a href='faqadmin.php'>Go Back</a>");
}
if (!isset($_POST['cat']) || empty($_POST['cat']) || !is_valid_id($_POST['cat'])) {
Do_Error("Error", "No Category selected");
}
$cat_id = (int) $_POST['cat'];
$option = $_POST['option'] == 'category' ? 'faq_categories' : 'faq';
$sql = sql_query("SELECT * FROM {$option} WHERE cid = {$cat_id}") or stderr("SQL Error", "OOps!");
if (!mysql_num_rows($sql)) {
stderr("SQL Error", "Nothing doing here!");
}
stdhead("Edit " . safechar($option));
if ('faq_categories' == $option) {
while ($row = mysql_fetch_assoc($sql)) {
echo "<div class='faqhead'>Category No.{$row['cid']}</div><div class='faqbody'>";
echo "<form name='inputform' method='post' action='faqadmin.php'>";
echo "<input type='hidden' name='action' value='cat_update' />";
echo "<input type='hidden' name='cat' value='{$row['cid']}' />";
echo "<input type='text' value='" . htmlentities($row['fcat_name'], ENT_QUOTES) . "' name='fcat_name' style='width:380px;' /> ";
echo "<input type='submit' name='submit' value='Edit' class='btns'>";
echo "</form></div>";
}
} else {
while ($row = mysql_fetch_assoc($sql)) {
echo "<div class='faqhead'>Faq No.{$row['id']}</div><div class='faqbody'>";
print $row['mtime'];
echo "<form name='inputform' method='post' action='faqadmin.php'>";
echo "<input type='hidden' name='action' value='faq_update' />";
echo "<input type='hidden' name='faq_id' value='{$row['id']}' />";
echo "<input type='text' value='{$row['question']}' name='question' style='width:380px;' /> ";
echo "<select name='cat'><option value=''>--Select One--</option>";
foreach ($cats as $v) {
print "<option value='" . $v['cid'] . "'>" . $v['fcat_name'] . '</option>';
}
echo "</select><br /><textarea name='Answer' rows='5' style='width:380px;'>" . htmlentities($row['answer']) . "</textarea><br />";
echo "<input type='submit' name='submit' value='Edit' class='btns'>";
echo "</form></div>";
}
}
Stdfoot();
exit;
}
示例4: sharetable
function sharetable($res, $variant = "index")
{
global $pic_base_url, $CURUSER;
$wait = 0;
if ($CURUSER["class"] < UC_VIP) {
$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;
}
}
?>
<p align="center">Icon Legend :
<img alt="Delete Bookmark" src="pic/plus.gif" border="none">
= Delete Bookmark |
<img alt="Download Bookmark" by="" src="pic/download.gif">
= Download Torrent |
<img alt="Bookmark Torrent" src="pic/bookmark.gif" border="none">
= Bookmark Torrent</p>
<table border="1" cellspacing=0 cellpadding=5>
<tr>
<td class="colhead" align="center">Type</td>
<td class="colhead" align=left>Name</td>
<?php
echo ($variant == 'index' ? '<td class=colhead align=center>Download</td><td class=colhead align="right">' : '') . 'Bookmark</td>';
if ($wait) {
print "<td class=\"colhead\" align=\"center\">Wait</td>\n";
}
if ($variant == "mytorrents") {
print "<td class=\"colhead\" align=\"center\">Edit</td>\n";
print "<td class=\"colhead\" align=\"center\">Visible</td>\n";
}
?>
<td class="colhead" align=right>Files</td>
<td class="colhead" align=right>Comm.</td>
<!--<td class="colhead" align="center">Rating</td>-->
<td class="colhead" align="center">Added</td>
<td class="colhead" align="center">TTL</td>
<td class="colhead" align="center">Size</td>
<!--
<td class="colhead" align=right>Views</td>
<td class="colhead" align=right>Hits</td>
-->
<td class="colhead" align="center">Snatched</td>
<td class="colhead" align=right>Seeders</td>
<td class="colhead" align=right>Leechers</td>
<?php
if ($variant == "index") {
print "<td class=\"colhead\" align=center>Upped by</td>\n";
}
print "</tr>\n";
while ($row = mysql_fetch_assoc($res)) {
$id = $row["id"];
print "<tr>\n";
print "<td align=center style='padding: 0px'>";
if (isset($row["cat_name"])) {
print "<a href=\"browse.php?cat=" . $row["category"] . "\">";
if (isset($row["cat_pic"]) && $row["cat_pic"] != "") {
print "<img border=\"0\" src=\"{$pic_base_url}caticons/{$row['cat_pic']}\" alt=\"{$row['cat_name']}\" />";
} else {
print $row["cat_name"];
}
print "</a>";
} else {
print "-";
}
print "</td>\n";
$dispname = safechar($row["name"]);
print "<td align=left><a href=\"details.php?";
if ($variant == "mytorrents") {
print "returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&";
}
print "id={$id}";
if ($variant == "index") {
print "&hit=1";
}
print "\"><b>{$dispname}</b></a>\n";
echo $variant == 'index' ? '<td align=center><a href=download.php/' . $id . '/' . rawurlencode($row['filename']) . '><img src="' . $pic_base_url . 'download.gif" border="0" alt="Download Bookmark!" title="Download Bookmark!"></a></td>' : '';
$bm = mysql_query("SELECT * FROM bookmarks WHERE torrentid={$id} && userid={$CURUSER['id']}");
$bms = mysql_fetch_assoc($bm);
$bookmarked = empty($bms) ? '<a href=\'bookmark.php?torrent=' . $id . '&action=add\'><img src=\'' . $pic_base_url . 'bookmark.gif\' border=\'0\' alt=\'Bookmark it!\' title=\'Bookmark it!\'></a>' : '<a href="bookmark.php?torrent=' . $id . '&action=delete"><img src=\'' . $pic_base_url . 'plus.gif\' border=\'0\' alt=\'Delete Bookmark!\' title=\'Delete Bookmark!\'></a>';
echo $variant == 'index' ? '<td align=center>' . $bookmarked . '</td>' : '';
if ($wait) {
$elapsed = floor((gmtime() - strtotime($row["added"])) / 3600);
if ($elapsed < $wait) {
$color = dechex(floor(127 * ($wait - $elapsed) / 48 + 128) * 65536);
print "<td align=center><nobr><a href=\"faq.php#dl8\"><font color=\"{$color}\">" . number_format($wait - $elapsed) . " h</font></a></nobr></td>\n";
} else {
print "<td align=center><nobr>None</nobr></td>\n";
}
}
//.........这里部分代码省略.........
示例5: stdhead
print "<tr valign=top><td>Result:</td><td>{$result}\n";
if ($remarks != "") {
print "<tr><td>Remarks:</td><td>{$remarks}\n";
}
print "</table>\n";
}
stdhead("Tags");
begin_main_frame();
begin_frame("Tags");
$test = $_POST["test"];
?>
<p>The Yoursite forums supports a number of <i>BB tags</i> which you can embed to modify how your posts are displayed.</p>
<form method=post action=?>
<textarea name=test cols=60 rows=3><?php
print $test ? safechar($test) : "";
?>
</textarea>
<input type=submit value="Test this code!" style='height: 23px; margin-left: 5px'>
</form>
<?php
if ($test != "") {
print "<p><hr>" . format_comment($test) . "<hr></p>\n";
}
insert_tag("Bold", "Makes the enclosed text bold.", "[b]<i>Text</i>[/b]", "[b]This is bold text.[/b]", "");
insert_tag("Italic", "Makes the enclosed text italic.", "[i]<i>Text</i>[/i]", "[i]This is italic text.[/i]", "");
insert_tag("Underline", "Makes the enclosed text underlined.", "[u]<i>Text</i>[/u]", "[u]This is underlined text.[/u]", "");
insert_tag("Color (alt. 1)", "Changes the color of the enclosed text.", "[color=<i>Color</i>]<i>Text</i>[/color]", "[color=blue]This is blue text.[/color]", "What colors are valid depends on the browser. If you use the basic colors (red, green, blue, yellow, pink etc) you should be safe.");
insert_tag("Color (alt. 2)", "Changes the color of the enclosed text.", "[color=#<i>RGB</i>]<i>Text</i>[/color]", "[color=#0000ff]This is blue text.[/color]", "<i>RGB</i> must be a six digit hexadecimal number.");
insert_tag("Size", "Sets the size of the enclosed text.", "[size=<i>n</i>]<i>text</i>[/size]", "[size=4]This is size 4.[/size]", "<i>n</i> must be an integer in the range 1 (smallest) to 7 (biggest). The default size is 2.");
insert_tag("Font", "Sets the type-face (font) for the enclosed text.", "[font=<i>Font</i>]<i>Text</i>[/font]", "[font=Impact]Hello world![/font]", "You specify alternative fonts by separating them with a comma.");
示例6: safechar
?>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="border2" style="height:109px; background:url(themes/NB-Revolt/pic/logo-bkg.jpg);" align="center" valign="middle"><img src="themes/NB-Revolt/pic/cyberfun_tracker.png" width="649" height="109" /></td>
<td width="109" style="height:109px; background:url(themes/NB-Revolt/pic/avatar-bkg.jpg);" align="center" valign="middle" class="border3"><span class="avat_m">
<?php
$avatar = safechar($CURUSER["avatar"]);
if (!$avatar) {
$avatar = "themes/NB-Revolt/pic/noavatar.png";
}
if (!$CURUSER) {
$avatar = "themes/NB-Revolt/pic/Guest.png";
$salt = "";
} else {
$salt = "'s avatar";
}
echo '<img src="' . $avatar . '" alt="' . $CURUSER[username] . $salt . ' " title="' . $CURUSER[username] . $salt . '" border="0" width="80" height="80" style="opacity:0.8" />';
?>
</span></td>
</tr>
</table><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
示例7: stderr
stderr("Error", "Invalid ID");
}
if (get_user_class() < UC_USER || $CURUSER["id"] != $userid && get_user_class() < UC_MODERATOR) {
stderr("Error", "Permission denied");
}
// === subscribe to thread
if ($_GET["subscribe"]) {
$subscribe = 0 + $_GET["subscribe"];
if ($subscribe != '1') {
stderr("Error", "I smell a rat!");
}
if (!isset($_GET[topicid])) {
stderr("Error", "No forum selected!");
}
if ($_GET["topicid"]) {
$topicid = 0 + safechar($_GET["topicid"]);
if (ereg("^[0-9]+\$", !$topicid)) {
stderr("Error", "Bad Topic Id!");
}
}
if (get_row_count("subscriptions", "WHERE userid={$CURUSER['id']} AND topicid = {$topicid}") > 0) {
stderr("Error", "Already subscribed to thread number <b> {$topicid}</b><br><br>Click <a href=forums.php?action=viewtopic&topicid={$topicid}><b>HERE</b></a> to go back to the thread. Or click <a href=subscriptions.php><b>HERE</b></a> to view your subscriptions.");
}
sql_query("INSERT INTO subscriptions (userid, topicid) VALUES ({$CURUSER['id']}, {$topicid})") or sqlerr(__FILE__, __LINE__);
$res = sql_query("SELECT subject FROM `topics` WHERE id={$topicid}") or sqlerr(__FILE__, __LINE__);
$arr = mysql_fetch_assoc($res) or stderr("Error", "Bad forum id!");
$forumname = $arr["subject"];
stderr("Sucksex", "Successfully subscribed to thread <b>{$forumname}</b><br><br>Click <a href=forums.php?action=viewtopic&topicid={$topicid}><b>HERE</b></a> to go back to the thread. Or click <a href=subscriptions.php><b>HERE</b></a> to view your subscriptions.");
}
// === end subscribe to thread
// === Action: Delete subscription
示例8: mysql_query
$res = mysql_query("SELECT b.*, u.username FROM bans b LEFT JOIN users u on b.addedby = u.id ORDER BY added DESC") or sqlerr(__FILE__, __LINE__);
$configfile = "<" . "?php\n\n\$bans = array(\n";
stdhead("Bans");
echo "<h1>Current Bans</h1>\n";
if (mysql_num_rows($res) == 0) {
echo "<p align=center><b>Nothing found</b></p>\n";
} else {
echo "<table border=1 cellspacing=0 cellpadding=5>\n";
echo "<tr><td class=colhead>Added</td><td class=colhead align=left>First IP</td><td class=colhead align=left>Last IP</td>" . "<td class=colhead align=left>By</td><td class=colhead align=left>Comment</td><td class=colhead>Remove</td></tr>\n";
while ($arr = mysql_fetch_assoc($res)) {
if ($doUpdate) {
$configfile .= "array('id'=> '{$arr['id']}', 'first'=> {$arr['first']}, 'last'=> {$arr['last']}),\n";
}
$arr["first"] = long2ip($arr["first"]);
$arr["last"] = long2ip($arr["last"]);
echo "<tr><td>{$arr['added']}</td><td align=left>{$arr['first']}</td><td align=left>{$arr['last']}</td><td align=left><a href=userdetails.php?id={$arr['addedby']}>{$arr['username']}" . "</a></td><td align=left>" . safechar($arr['comment'], ENT_QUOTES) . "</td><td><a href=bans.php?remove={$arr['id']}>Remove</a></td></tr>\n";
}
echo "</table>\n";
}
if ($doUpdate) {
$configfile .= "\n);\n\n?" . ">";
$filenum = fopen("cache/bans_cache.php", "w");
ftruncate($filenum, 0);
fwrite($filenum, $configfile);
fclose($filenum);
}
if (get_user_class() >= UC_ADMINISTRATOR) {
echo "<h2>Add ban</h2>\n";
echo "<table border=1 cellspacing=0 cellpadding=5>\n";
echo "<form method=post action=bans.php>\n";
echo "<tr><td class=rowhead>First IP</td><td><input type=text name=first size=40></td>\n";
示例9: tr
?>
</td></tr>
<?php
}
//===end free upload / staff stuff
if (get_user_class() >= UC_UPLOADER) {
tr("" . $language['vip'] . "", "<input type='checkbox' name='vip'" . ($row["vip"] == "yes" ? " checked='checked'" : "") . " value='1' /> If this one is checked, only VIPs can download this torrent", 1);
}
if (get_user_class() > UC_MODERATOR) {
tr("" . $language['sticky'] . "", "<input type='checkbox' name='sticky'" . ($row["sticky"] == "yes" ? " checked='checked'" : "") . " value='yes' />Set sticky this torrent!", 1);
}
if (get_user_class() >= UC_ADMINISTRATOR) {
tr("" . $language['multi'] . "", "<input type=radio name=multiplicator" . ($row["multiplicator"] == "0" ? " checked='checked'" : "") . " value=0>No Multiplicator\n <input type=radio name=multiplicator " . ($row["multiplicator"] == "2" ? " checked='checked'" : "") . " value=2>Upload x 2\n <input type=radio name=multiplicator " . ($row["multiplicator"] == "3" ? " checked='checked'" : "") . " value=3>Upload x 3\n <input type=radio name=multiplicator " . ($row["multiplicator"] == "4" ? " checked='checked'" : "") . " value=4>Upload x 4\n <input type=radio name=multiplicator " . ($row["multiplicator"] == "5" ? " checked='checked'" : "") . " value=5>Upload x 5", 1);
}
tr("" . $language['nuked'] . "", "<input type=radio name=nuked" . ($row["nuked"] == "yes" ? " checked" : "") . " value=yes>Yes <input type=radio name=nuked" . ($row["nuked"] == "no" ? " checked" : "") . " value=no>No <input type=radio name=nuked" . ($row["nuked"] == "unnuked" ? " checked" : "") . " value=unnuked>Unnuked", 1);
tr("" . $language['nuker'] . "", "<input type=\"text\" name=\"nukereason\" value=\"" . safechar($row["nukereason"]) . "\" size=\"80\" />", 1);
?>
<script type="text/javascript">
window.onload = function() {
setupDependencies('edit'); //name of form(s). Seperate each with a comma (ie: 'weboptions', 'myotherform' )
};
</script>
<tr><td align=right><b><?php
echo $language['genre'];
?>
</b><br><?php
echo $language['opt'];
?>
</td><td align=left>
<table><tr><input type=radio name=genre value="keep" checked>Dont touch it (Current: <?php
echo $row["newgenre"];
示例10: mysql_fetch_row
$a = mysql_fetch_row(mysql_query("SELECT userid,date FROM shoutbox ORDER by id DESC LIMIT 1 ")) or print "bad thing in query";
if (empty($text) || strlen($text) == 1) {
print "<font class=\"small\" color=\"red\">Shout can't be empty</font>";
} elseif ($a[0] == $userid && time() - $a[1] < $limit && get_user_class() < UC_MODERATOR) {
print "<font class=\"small\" color=\"red\">{$limit} seconds between shouts <font class=\"small\">Seconds Remaining : (" . ($limit - (time() - $a[1])) . ")</font></font>";
} else {
sql_query("INSERT INTO shoutbox (id, userid, date, text, text_parsed) VALUES ('id'," . sqlesc($userid) . ", {$date}, " . sqlesc($text) . "," . sqlesc($text_parsed) . ")") or sqlerr(__FILE__, __LINE__);
print "<script type=\"text/javascript\">parent.document.forms[0].shbox_text.value='';</script>";
}
}
}
// //////////////////////
$res = sql_query("SELECT s.id, s.userid, s.date , s.text,u.username,u.class,u.donor,u.warned,u.downloadpos,u.chatpost,u.forumpost,u.uploadpos,u.parked FROM shoutbox as s LEFT JOIN users as u ON s.userid=u.id ORDER BY s.date DESC LIMIT 30") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) == 0) {
print "No shouts here ";
} else {
print "<table border=0 cellspacing=0 cellpadding=2 width='100%' align='left' class='small'>\n";
while ($arr = mysql_fetch_assoc($res)) {
$edit = get_user_class() >= UC_MODERATOR ? "<a href=/shoutbox.php?edit=" . $arr['id'] . "><img src=" . $pic_base_url . "button_edit2.gif border=0 title=\"Edit Shout\" /></a> " : "";
$del = get_user_class() >= UC_MODERATOR ? "<a href=/shoutbox.php?del=" . $arr['id'] . "><img src=" . $pic_base_url . "button_delete2.gif border=0 title=\"Delete Single Shout\" /></a> " : "";
$delall = get_user_class() >= UC_SYSOP ? "<a href=/shoutbox.php?delall onclick=\"confirm_delete(); return false;\" ><img src=" . $pic_base_url . "del.png border=0 title=\"Empty Shout\" /></a> " : "";
$pm = "<font class='date' style=\"color:{$dtcolor}\"><a target=_blank href=sendmessage.php?receiver={$arr['userid']}><img src=" . $pic_base_url . "button_pm2.gif border=0 title=\"Pm User\"/></a></font>\n";
$datum = gmdate("d M H:i", $arr["date"] + ($CURUSER['dst'] + $CURUSER["timezone"]) * 60);
print "<tr {$bg}><td><font class='date' color={$fontcolor}>['{$datum}']</font>\n{$del} {$delall} {$edit} {$pm} <a href='userdetails.php?id=" . $arr["userid"] . "' target='_blank'><font color='#" . get_user_class_color($arr['class']) . "'>" . safechar($arr['username']) . "</font></a>\n" . ($arr["donor"] == "yes" ? "<img src=pic/star.gif alt='DONOR' />\n" : "") . ($arr["warned"] == "yes" ? "<img src=" . "pic/warned.gif alt='Warned' />\n" : "") . ($arr["chatpost"] == "no" ? "<img src=pic/chatpos.gif alt='No Chat' />\n" : "") . ($arr["downloadpos"] == "no" ? "<img src=pic/downloadpos.gif alt='No Downloads' />\n" : "") . ($arr["forumpost"] == "no" ? "<img src=pic/forumpost.gif alt='No Posting' />\n" : "") . ($arr["uploadpos"] == "no" ? "<img src=pic/uploadpos.gif alt='No upload' />\n" : "") . ($arr["parked"] == "yes" ? "<img src=pic/parked.gif alt='Account Parked' />\n" : "") . "<font color={$fontcolor}> " . format_comment($arr["text"]) . "\n</font></td></tr>\n";
}
print "</table>";
}
?>
</body>
</html>
示例11: elseif
die;
} elseif ($action == "vieworiginal") {
if (get_user_class() < UC_MODERATOR) {
stderr("Error", "Permission denied.");
}
$commentid = 0 + $_GET["cid"];
if (!is_valid_id($commentid)) {
stderr("Error", "Invalid ID.");
}
$res = sql_query("SELECT c.*, t.name FROM comments AS c LEFT JOIN torrents AS t ON c.torrent = t.id WHERE c.id={$commentid}") or sqlerr(__FILE__, __LINE__);
$arr = mysql_fetch_array($res);
if (!$arr) {
stderr("Error", "Invalid ID {$commentid}.");
}
stdhead("Original comment");
print "<h1>Original contents of comment #{$commentid}</h1><p>\n";
print "<table width=500 border=1 cellspacing=0 cellpadding=5>";
print "<tr><td class=comment>\n";
echo safechar($arr["ori_text"]);
print "</td></tr></table>\n";
$returnto = $_SERVER["HTTP_REFERER"];
// $returnto = "details.php?id=$torrentid&viewcomm=$commentid#$commentid";
if ($returnto) {
print "<p><font size=small>(<a href={$returnto}>back</a>)</font></p>\n";
}
stdfoot();
die;
} else {
stderr("Error", "Unknown action");
}
die;
示例12: bdec
$dict = bdec(benc($dict));
// double up on the becoding solves the occassional misgenerated infohash
$dict['value']['comment'] = bdec(benc_str("In using this torrent you are bound by the '{$SITENAME}' Confidentiality Agreement By Law"));
// change torrent comment
list($ann, $info) = dict_check($dict, "announce(string):info");
unset($dict['value']['created by']);
$infohash = pack("H*", sha1($info["string"]));
// Replace punctuation characters with spaces
$torrent = str_replace("_", " ", $torrent);
$nfo = sqlesc(str_replace("\r\r\n", "\r\n", @file_get_contents($nfofilename)));
$ret = mysql_query("INSERT INTO torrents (search_text, filename, owner, visible, anonymous, info_hash, name, size, numfiles, type, descr, ori_descr, category, save_as, added, last_action, nfo) VALUES (" . implode(",", array_map("sqlesc", array(searchfield("{$shortfname} {$dname} {$torrent}"), $fname, $CURUSER["id"], "no", $anonymous, $infohash, $torrent, $totallen, count($filelist), $type, $descr, $descr, 0 + $_POST["type"], $dname))) . ", '" . get_date_time() . "', '" . get_date_time() . "', {$nfo})");
// //////new torrent upload detail sent to shoutbox//////////
if ($CURUSER["anonymous"] == 'yes') {
$message = "New Torrent : ({$torrent}) Uploaded - Anonymous User";
} else {
$message = "New Torrent : ({$torrent}) Uploaded by " . safechar($CURUSER["username"]) . "";
}
// ///////////////////////////END///////////////////////////////////
if (!$ret) {
if (mysql_errno() == 1062) {
stderr("Error", "torrent already uploaded!");
}
stderr("Error", "mysql puked!");
}
$id = mysql_insert_id();
@mysql_query("DELETE FROM files WHERE torrent = {$id}");
function file_list($arr, $id)
{
foreach ($arr as $v) {
$new[] = "({$id}," . sqlesc($v[0]) . "," . $v[1] . ")";
}
示例13: safeChar
</tbody>
</table>
<?php
} else {
echo '<p><b>Query OK:</b> ' . safeChar(mysql_affected_rows()) . ' rows affected.</p>';
}
} else {
echo '<p><b>Query Failed:</b> ' . safeChar(mysql_error()) . '</p>';
}
echo '<hr />';
}
?>
<form action="<?php
echo $_SERVER['PHP_SELF'];
?>
" method="POST">
<p>SQL Query:<br />
<textarea onFocus="this.select()" cols="60" rows="5" name="query">
<?php
echo safechar($_POST['query']);
?>
</textarea>
</p>
<p><input type="submit" name="submitquery" value="Submit Query (Alt-S)" accesskey="S" /></p>
</form>
<?php
// cpfooter();
end_frame();
stdfoot();
示例14: torrenttable
//.........这里部分代码省略.........
//////////////////////////////////////////
if (!$row["comments"]) {
echo "<td align=\"right\">" . $row["comments"] . "</td>\n";
} else {
if ($variant == "index") {
echo "<td align=\"right\"><b><a href=\"details.php?id={$id}&hit=1&tocomm=1\">" . $row["comments"] . "</a></b></td>\n";
} else {
echo "<td align=\"right\"><b><a href=\"details.php?id={$id}&page=0#startcomments\">" . $row["comments"] . "</a></b></td>\n";
}
}
// ////Hide the quick download if download disabled/////
if ($CURUSER["downloadpos"] == 'no') {
echo "<td class=embedded><img src=" . $pic_base_url . "downloadpos.gif alt='no download' style='margin-left: 4pt' /></td>\n";
} else {
if ($CURUSER["downloadpos"] == 'yes') {
echo "<td align=\"center\"><a href=\"/download.php/{$id}/" . rawurlencode($row["filename"]) . "\"><img src=pic/download.gif border=0 alt=Download /></a></td>\n";
}
}
// Progressbar Mod
// /comment out to remove indicator on browse//////
$seedersProgressbar = array();
$leechersProgressbar = array();
$progressPerTorrent = 0;
$iProgressbar = 0;
if (isset($progress[$row["id"]])) {
foreach ($progress[$row["id"]] as $rowProgressbar) {
$progressPerTorrent += sprintf("%.2f", 100 * (1 - $rowProgressbar["to_go"] / $rowProgressbar["size"]));
$iProgressbar++;
}
}
if ($iProgressbar == 0) {
$iProgressbar = 1;
}
$progressTotal = sprintf("%.2f", $progressPerTorrent / $iProgressbar);
$picProgress = get_percent_completed_image(floor($progressTotal)) . "<br/>(" . round($progressTotal) . "%)";
echo "<td align=center>{$picProgress}</td>\n";
// End Progress Bar mod//////////////////////////
echo "<td align=center>" . str_replace(" ", "<br/>", prefixed($row["size"])) . "</td>\n";
$_s = "";
if ($row["times_completed"] != 1) {
$_s = "s";
}
if (get_user_class() >= UC_MODERATOR) {
echo "<td align=center>" . ($row["times_completed"] > 0 ? "<a href=snatches.php?id={$id}>" . safeChar(number_format($row["times_completed"])) . "<br/>time{$_s}</a>" : "0 times") . "</td>\n";
} else {
echo "<td align=center>" . ($row["times_completed"] > 0 ? "" . safeChar(number_format($row["times_completed"])) . "<br/>time{$_s}</a>" : "0 times") . "</td>\n";
}
if ($row["seeders"]) {
if ($variant == "index") {
if ($row["leechers"]) {
$ratio = $row["seeders"] / $row["leechers"];
} else {
$ratio = 1;
}
echo "<td align=right><b><a href=details.php?id={$id}&hit=1#seeders><font color=" . get_slr_color($ratio) . ">" . $row["seeders"] . "</font></a></b></td>\n";
} else {
echo "<td align=\"right\"><b><a class=\"" . linkcolor($row["seeders"]) . "\" href=\"details.php?id={$id}#seeders\">" . $row["seeders"] . "</a></b></td>\n";
}
} else {
echo "<td align=\"right\"><span class=\"" . linkcolor($row["seeders"]) . "\">" . $row["seeders"] . "</span></td>\n";
}
$peerlink = '';
if ($row["leechers"]) {
if ($variant == "index") {
echo "<td align=right><b><a href=details.php?id={$id}&hit=1&#leechers>" . number_format($row["leechers"]) . ($peerlink ? "</a>" : "") . "</b></td>\n";
} else {
echo "<td align=\"right\"><b><a class=\"" . linkcolor($row["leechers"]) . "\" href=\"details.php?id={$id}#leechers\">" . $row["leechers"] . "</a></b></td>\n";
}
} else {
echo "<td align=\"right\">0</td>\n";
}
// //Anonymous and delete torrent begin
if ($variant == "index") {
if ($row["anonymous"] == "yes") {
echo "<td align=center><i>Anonymous</i></td>\n";
if (get_user_class() >= UC_MODERATOR) {
echo "<td align=\"center\" bgcolor=\"#FF0000\"><input type=\"checkbox\" name=\"delete[]\" value=\"" . safeChar($id) . "\" /></td>\n";
}
} else {
if ($variant == "index") {
if ($CURUSER["view_uclass"] == 'yes') {
echo "<td align=center>" . (isset($row["username"]) ? "<a href=userdetails.php?id=" . $row["owner"] . "><font color=\"#" . get_user_class_color($row["uclass"]) . "\">" . safeChar($row["username"]) . "</font></a>" : "<i>(unknown)</i>") . "</td>\n";
} else {
echo "<td align=center>" . (isset($row["username"]) ? "<a href=userdetails.php?id=" . $row["owner"] . "><b>" . safechar($row["username"]) . "</b></a>" : "<i>(unknown)</i>") . "</td>\n";
}
}
// ///////modified Delete torrent with anonymous uploader
if (get_user_class() >= UC_MODERATOR) {
echo "<td align=\"center\" bgcolor=\"#FF0000\"><input type=\"checkbox\" name=\"delete[]\" value=\"" . safeChar($id) . "\" /></td>\n";
}
}
}
echo "</tr>\n";
echo "<tr id=\"kdescr" . $row["id"] . "\"style=\"display:none;\"><td width=\"90%\" colspan=\"" . (get_user_class() >= UC_MODERATOR ? "15" : "13") . "\">" . $descr . "</td></tr>\n";
}
if (get_user_class() >= UC_MODERATOR) {
echo "<tr ><td align=\"center\" colspan=16><input type=submit value=Delete /></td></tr>\n";
}
echo "</table></form>\n";
}
示例15: header
header("HTTP/1.0 404 Not Found");
// moddifed logginorreturn by retro//Remember to change the following line to match your server
print "<html><h1>Not Found</h1><p>The requested URL /{$_SERVER['PHP_SELF']} was not found on this server.</p><hr /><address>Apache/1.1.11 (xxxxx) Server at " . $_SERVER['SERVER_NAME'] . " Port 80</address></body></html>\n";
die;
}
//optimized, secured, added options, fixed some typos by Alex2005 for TBDEV.NET\\
if (get_user_class() < UC_SYSOP) {
hacker_dork("Db Admin - Nosey Cunt !");
}
$postperpage = 0 + $_GET["postperpage"];
$returnto = $_POST["returnto"];
if (isset($_POST["delmp"])) {
$do = "DELETE FROM messages WHERE id IN (" . implode(", ", $_POST['delmp']) . ")";
$res = sql_query($do);
if ($returnto) {
header("Location: " . safechar($returnto));
die;
} else {
header("Refresh: 0; url=/msgspy.php");
stderr("Success", "The messages where successfully deleted!");
}
}
//===start page===//
stdhead("Administrative message overview");
?>
<script language="Javascript" type="text/javascript">
<!-- Begin
var checkflag = "false";
var marked_row = new Array;
function check(field) {
if (checkflag == "false") {