本文整理汇总了PHP中security::html_safe方法的典型用法代码示例。如果您正苦于以下问题:PHP security::html_safe方法的具体用法?PHP security::html_safe怎么用?PHP security::html_safe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类security
的用法示例。
在下文中一共展示了security::html_safe方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sub_cat
public static function sub_cat($sub)
{
global $db;
MCached::connect();
$key = 'sub::categories::' . $sub;
$name = MCached::get($key);
if ($name === MCached::NO_RESULT) {
$c_q = @$db->query("SELECT name FROM categories WHERE id = '" . $sub . "'");
$c_q = @$c_q->fetch_array(MYSQLI_BOTH);
$name = security::html_safe(unesc($c_q["name"]));
MCached::add($key, $name, self::ONE_DAY);
}
return $name;
}
示例2: format_shout
function format_shout($text)
{
global $Smileys, $BASEURL;
$s = $text;
$s = strip_tags($s);
$s = security::html_safe(unesc($s));
$f = @fopen("badwords.txt", "r");
if ($f && filesize("badwords.txt") != 0) {
$bw = fread($f, filesize("badwords.txt"));
$badwords = explode("\n", $bw);
for ($i = 0; $i < count($badwords); ++$i) {
$badwords[$i] = trim($badwords[$i]);
}
$s = str_replace($badwords, "*censored*", $s);
}
@fclose($f);
// [b]Bold[/b]
$s = preg_replace("/\\[b\\]((\\s|.)+?)\\[\\/b\\]/", "<b>\\1</b>", $s);
// [i]Italic[/i]
$s = preg_replace("/\\[i\\]((\\s|.)+?)\\[\\/i\\]/", "<i>\\1</i>", $s);
// [u]Underline[/u]
$s = preg_replace("/\\[u\\]((\\s|.)+?)\\[\\/u\\]/", "<u>\\1</u>", $s);
// [u]Underline[/u]
$s = preg_replace("/\\[u\\]((\\s|.)+?)\\[\\/u\\]/i", "<u>\\1</u>", $s);
// [color=blue]Text[/color]
$s = preg_replace("/\\[color=([a-zA-Z]+)\\]((\\s|.)+?)\\[\\/color\\]/i", "<font color=\\1>\\2</font>", $s);
// [color=#ffcc99]Text[/color]
$s = preg_replace("/\\[color=(#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])\\]((\\s|.)+?)\\[\\/color\\]/i", "<font color=\\1>\\2</font>", $s);
// [url=http://www.example.com]Text[/url]
$s = preg_replace("/\\[url=((http|ftp|https|ftps|irc):\\/\\/[^<>\\s]+?)\\]((\\s|.)+?)\\[\\/url\\]/i", "<a href=\\1 target=_blank>\\3</a>", $s);
// [url]http://www.example.com[/url]
$s = preg_replace("/\\[url\\]((http|ftp|https|ftps|irc):\\/\\/[^<>\\s]+?)\\[\\/url\\]/i", "<a href=\\1 target=_blank>\\1</a>", $s);
// [size=4]Text[/size]
$s = preg_replace("/\\[size=([1-7])\\]((\\s|.)+?)\\[\\/size\\]/i", "<font size=\\1>\\2</font>", $s);
// [font=Arial]Text[/font]
$s = preg_replace("/\\[font=([a-zA-Z ,]+)\\]((\\s|.)+?)\\[\\/font\\]/i", "<font face=\"\\1\">\\2</font>", $s);
// Linebreaks
$s = nl2br($s);
// Maintain spacing
$s = str_replace(" ", " ", $s);
reset($Smileys);
while (list($code, $url) = each($Smileys)) {
$s = str_replace($code, "<img border='0' src='" . $BASEURL . "/images/smilies/" . $url . "'>", $s);
}
return $s;
}
示例3: prepare_user
public static function prepare_user(&$user, $curuser = false)
{
if ($curuser && empty($user)) {
die;
}
if (isset($user['torrentsperpage'])) {
$user['torrentsperpage'] = (int) $user['torrentsperpage'];
}
if (isset($user['uid'])) {
$user['uid'] = (int) $user['uid'];
}
if (isset($user['username'])) {
$user['username'] = security::html_safe($user['username']);
}
if (isset($user['language'])) {
$user['language'] = (int) $user['language'];
}
if (isset($user['style'])) {
$user['style'] = (int) $user['style'];
}
if (isset($user['flag'])) {
$user['flag'] = (int) $user['flag'];
}
if (isset($user['topicsperpage'])) {
$user['topicsperpage'] = (int) $user['topicsperpage'];
}
if (isset($user['postsperpage'])) {
$user['postsperpage'] = (int) $user['postsperpage'];
}
if (isset($user['id_level'])) {
$user['id_level'] = (int) $user['id_level'];
}
if (isset($user['WT'])) {
$user['WT'] = (int) $user['WT'];
}
if (isset($user['random'])) {
$user['random'] = (int) $user['random'];
}
if (isset($user['flags'])) {
$user['flags'] = (int) $user['flags'];
}
}
示例4: comment_form
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'>
<input type='hidden' name='info_hash' value='<?php
echo $id;
?>
' />
<table class='lista' border='0' cellpadding='10'>
<tr>
<tr><td align='left' class='header'><?php
echo USER_NAME;
?>
:</td><td class='lista' align='left'><input name='user' type='text' value='<?php
echo security::html_safe($_GET["usern"]);
?>
' size='20' maxlength='100' disabled; readonly></td></tr>
<tr><td align='left' class='header'><?php
echo COMMENT_1;
?>
:</td><td class='lista' align='left'><?php
textbbcode("comment", "comment", security::html_safe(unesc($comment)));
?>
</td></tr>
<tr><td class='header' colspan='2' align='center'><input type='submit' name='confirm' value='<?php
echo FRM_CONFIRM;
?>
' /> <input type='submit' name='confirm' value='<?php
echo FRM_PREVIEW;
?>
' /></td></tr>
</table>
</form>
</center>
<?php
block_end();
}
示例5: _torrenttable
function _torrenttable($res, $frame_caption, $speed = "false")
{
global $db;
block_begin($frame_caption, 'center');
begin_table();
$num = 0;
while ($a = $res->fetch_assoc()) {
++$num;
if ($a["leechers"] > 0) {
$r = (int) $a["seeds"] / (int) $a["leechers"];
$ratio = number_format($r, 2);
} else {
$ratio = INFINITE;
}
if (!isset($menu)) {
$menu = "";
}
if ($menu != "1") {
echo "<tr>" . "<table width='100%' class='lista'>" . "<td class='header' align='center'>" . USER_LEVEL . "</td>" . "<td class='header'>" . FILE . "</td>";
if ($speed != "true") {
echo "<td class='header' align='center'>" . FINISHED . "</td>" . "<td class='header' align='center'>" . SEEDERS . "</td>" . "<td class='header' align='center'>" . LEECHERS . "</td>" . "<td class='header' align='center'>" . PEERS . "</td>" . "<td class='header' align='center'>" . RATIO . "</td>";
} else {
echo "<td class='header' align='right'>" . SPEED . "</td>";
}
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();
}
示例6: unset
unset($_POST['pseudo']);
unset($_POST['mess']);
}
}
$msg2 = array_reverse($msg);
echo "<div align='left' class='chat'><table width='95%' align='center'><tr><td>";
include INCL_PATH . 'offset.php';
for ($i = 0; $i < 10 && $i < count($msg2); ++$i) {
$sql = "SELECT users.id AS uid, prefixcolor, suffixcolor FROM users INNER JOIN users_level ON users_level.id = users.id_level WHERE users.username = '" . $db->real_escape_string($msg2[$i]['pseudo']) . "'";
$res = $db->query($sql);
$result = $res->fetch_assoc();
// user or level don't exit in db
if (!$result) {
echo '<b>' . '</b> [' . date("d/m/y H:i", $msg2[$i]['date'] - $offset) . ']' . ' <b>' . security::html_safe($msg2[$i]['pseudo']) . '</b>: ' . format_comment(security::html_safe($msg2[$i]['texte'])) . '<hr>';
} else {
echo '<b>' . '</b> [' . date("d/m/y H:i", $msg2[$i]['date'] - $offset) . ']' . " <a style='text-decoration:none' href='userdetails.php?id=" . (int) $result["uid"] . "'>" . unesc($result['prefixcolor']) . security::html_safe($msg2[$i]['pseudo']) . unesc($result['suffixcolor']) . '</a>: ' . format_comment(security::html_safe($msg2[$i]['texte'])) . '<hr>';
unset($result);
}
$res->free();
}
echo "</td></tr></table></div>";
file_save("chat.php", "<?php\n\$msg = " . var_export($msg, true) . "\n?>");
unset($_POST['pseudo']);
unset($_POST['mess']);
if (user::$current["uid"] > 1) {
?>
<div class="miniform" align="center">
<form method="post" name="shout">
<input type="hidden" name="pseudo" value="<?php
echo user::$current["username"];
?>
示例7: foreach
print "\n<form name='jump1'><td class='lista'><select name='style' size='1' onChange='location=document.jump1.style.options[document.jump1.style.selectedIndex].value' style='font-size:10px'>";
foreach ($style as $a) {
print "<option ";
if ($a["id"] == user::$current["style"]) {
print "selected='selected'";
}
print " value='account_change.php?style=" . (int) $a["id"] . "&returnto=" . urlencode($_SERVER['REQUEST_URI']) . "'>" . security::html_safe($a["style"]) . "</option>";
}
print "</select></td>";
print "\n<td class='lista'><select name='langue' size='1' onChange='location=document.jump1.langue.options[document.jump1.langue.selectedIndex].value' style='font-size:10px'>";
foreach ($langue as $a) {
print "<option ";
if ($a["id"] == user::$current["language"]) {
print "selected='selected'";
}
print " value='account_change.php?langue=" . (int) $a["id"] . "&returnto=" . urlencode($_SERVER['REQUEST_URI']) . "'>" . security::html_safe($a["language"]) . "</option>";
}
print "</select></td></form>";
?>
</tr>
</table>
<?php
} else {
if (!isset($user)) {
$user = '';
}
?>
<form action='login.php' name='login' method='post'>
<table class='lista' border='0' width='100%' cellpadding='2' cellspacing='0'>
<tr>
<td class='lista' align='left'>
示例8: SendIT
?>
<script language='javascript'>
function SendIT(){
window.opener.document.forms['edit'].elements['receiver'].value = document.forms['result'].elements['name'].options[document.forms['result'].elements['name'].options.selectedIndex].value;
window.close();
}
</script>
<div align='center'>
<form name='result'><table class='lista'>
<tr>
<td class='lista'><?php
print USER_NAME;
?>
:</td>
<?php
print "\n<td class='lista'><select name='name' size='1'>";
while ($result = $res->fetch_array(MYSQLI_BOTH)) {
print "\n<option name='uname' value='" . security::html_safe($result["username"]) . "'>" . security::html_safe($result["username"]) . "</option>";
}
print "\n</select></td>";
print "\n<td class='lista'><input type='button' name='confirm' onclick='javascript:SendIT();' value='" . FRM_CONFIRM . "' /></td>";
?>
</tr>
</table></form>
</div>
<?php
}
}
print "\n<br />\n<div align='center'><a href='javascript: window.close()'>" . CLOSE . "</a></div>";
print "</body>\n</html>\n";
示例9: while
print "<td align='center' class='header'>" . PEER_COUNTRY . "</td>";
print "<td align='center' class='header'>Active</td>";
print "<td align='center' class='header'>" . PEER_CLIENT . "</td>\n";
print "<td align='center' class='header'>" . DOWNLOADED . "</td>\n";
print "<td align='center' class='header'>" . UPLOADED . "</td>\n";
print "<td align='center' class='header'>" . RATIO . "</td>\n";
print "<td align='center' class='header'>" . FINISHED . "</td></tr>\n";
while ($row = $res->fetch_array(MYSQLI_BOTH)) {
print "<tr><td align='center' class='lista'>" . "<a href='userdetails.php?id=" . (int) $row["uid"] . "'>" . security::html_safe(unesc($row["username"])) . "</a></td>" . "<td align='center' class='lista'><a href='usercp.php?do=pm&action=edit&uid=" . user::$current['uid'] . "&what=new&to=" . urlencode(unesc($row["username"])) . "'>" . image_or_link($STYLEPATH . "/pm.png", "", "PM") . "</a></td>";
if ($row["flagpic"] != "") {
print "<td align='center' class='lista'><img src='images/flag/" . $row["flagpic"] . "' alt='" . security::html_safe($row["country"]) . "' /></td>";
} else {
print "<td align='center' class='lista'><img src='images/flag/unknown.gif' alt='" . UNKNOWN . "' /></td>";
}
print "<td align='center' class='lista'>" . $row["active"] . "</td>";
print "<td align='center' class='lista'>" . security::html_safe($row["agent"]) . "</td>";
$dled = misc::makesize((int) $row["downloaded"]);
$upld = misc::makesize((int) $row["uploaded"]);
print "<td align='center' class='lista'>" . $dled . "</td>";
print "<td align='center' class='lista'>" . $upld . "</td>";
if (intval($row["downloaded"]) > 0) {
$ratio = number_format((int) $row["uploaded"] / (int) $row["downloaded"], 2);
} else {
$ratio = "∞";
}
print "<td align='center' class='lista'>" . $ratio . "</td>";
print "<td align='center' class='lista'>" . get_elapsed_time($row["date"]) . " ago</td></tr>";
}
if ($res->num_rows == 0) {
print "<tr><td align='center' colspan='9' class='lista'>No history to display</td></tr>";
}
示例10: date
print "\n<tr>\n<td class='lista' align='left'>" . security::html_safe($rtorrent["filename"]) . "</td>";
print "\n<td class='lista' align='left'>" . date("d/m/Y H:i", $rtorrent["lastupdate"] - $offset) . "</td>";
print "\n<td class='lista' align='right'>" . (int) $rtorrent["seeds"] . "</td>";
print "\n<td class='lista' align='right'>" . (int) $rtorrent["leechers"] . "</td>";
print "\n<td class='lista' align='center'><input type='checkbox' name='hash[]' value='" . security::html_safe($rtorrent["info_hash"]) . "' /></td></tr>";
$count++;
}
// external
$res = $db->query("SELECT namemap.info_hash, filename, UNIX_TIMESTAMP(namemap.lastupdate) AS lastupdate, summary.seeds, " . " summary.leechers FROM namemap LEFT JOIN summary ON summary.info_hash = namemap.info_hash WHERE external = 'yes' AND UNIX_TIMESTAMP(namemap.lastupdate) < (UNIX_TIMESTAMP() - " . $timeout . ") ORDER BY lastupdate");
if ($res->num_rows > 0) {
while ($rtorrent = $res->fetch_array(MYSQLI_BOTH)) {
print "\n<tr>\n<td class='lista' align='left'>" . security::html_safe($rtorrent["filename"]) . "</td>";
print "\n<td class='lista' align='left'>" . date("d/m/Y H:i", $rtorrent["lastupdate"] - $offset) . "</td>";
print "\n<td class='lista' align='right'>" . (int) $rtorrent["seeds"] . "</td>";
print "\n<td class='lista' align='right'>" . (int) $rtorrent["leechers"] . "</td>";
print "\n<td class='lista' align='center'><input type='checkbox' name='hash[]' value='" . security::html_safe($rtorrent["info_hash"]) . "' /></td></tr>";
$count++;
}
}
print "\n<tr>\n<td class='lista' align='right' colspan='5'><input type='submit' name='action' value='GO' /></td></tr>";
print "\n</table>\n</form>";
} else {
print "<p align=center>No torrents to prune...<p>";
}
block_end();
print "<br />\n";
} else {
block_begin("Prune torrents");
print "\n<form action='admincp.php?user=" . user::$current["uid"] . "&code=" . user::$current["random"] . "&do=prunet&action=view' name='prune' method='post'>";
print "<p align='center'>Imput the number of days which the torrents are to be considered as 'dead' <input type='text' name='days' value='" . $days . "' size='10' maxlength='3' />";
print "\n<input type='submit' name='action' value='View' /></td></tr>";
示例11: while
$ad_display .= "<td align='center' class='header'>{$fname->name}</td>";
$field[$i] = $fname->name;
$i++;
}
$ad_display .= "</tr>";
while ($fname = $dbres->fetch_array(MYSQLI_BOTH)) {
$ad_display .= "\n <tr>";
for ($i = 0; $i < count($field); $i++) {
$ad_display .= "<td class='lista'>" . $fname[$field[$i]] . "</td>";
}
$ad_display .= "\n </tr>";
}
$ad_display .= "\n </table>\n </td>\n </tr>\n </table>\n </form>";
} else {
// display num rows affected...
$ad_display .= "\n <table class='lista' cellspacing='1' cellpadding='0' align='center' border='0' width='98%'>\n <tr>\n <td class='lista'>" . security::html_safe(unesc($_POST["runquery"])) . "<tr>\n <td class='header'>" . $db->info . "\n </td>\n </tr>\n </table>\n ";
}
}
} else {
header("Location: admincp.php?user=" . user::$current["uid"] . "&code=" . user::$current["random"] . "&do=dbutil&action=qry");
}
break;
case 'qry':
// display tables
$ad_display .= "\n <form name='dbutil' action='admincp.php?user=" . user::$current["uid"] . "&code=" . user::$current["random"] . "&do=dbutil&action=runqry' method='post'>\n <table class='lista' cellspacing='1' cellpadding='0' align='center' border='0' width='100%'>\n <tr>\n <td class='lista' align='center'>\n Input a query and press confirm to run it on current datase.\n <textarea name='runquery' rows='8' cols='75'></textarea>\n </td>\n </tr>\n <tr>\n <td align='center' class='header'>\n <input type='submit' name='confirm' value='" . FRM_CONFIRM . "' /> \n <input type='submit' name='confirm' value='" . FRM_CANCEL . "' /></td>\n </tr>\n </table>\n </form>";
break;
case 'tables':
if (isset($_POST["doit"]) && isset($_POST["tname"])) {
$table_action = $_POST["doit"];
$tables = implode(",", $_POST["tname"]);
switch ($table_action) {
示例12: while
print "<tr><td>" . TOPICS . "/" . POSTS . ":</td><td align='right'>" . $posts_avg . " %</td></tr>\n";
print "</table>\n</td></tr>\n";
if ($topics > 0) {
if (isset($GLOBALS["block_forumlimit"])) {
$limit = "LIMIT " . (int) $GLOBALS["block_forumlimit"];
} else {
$limit = "LIMIT 5";
}
$tres = $db->query("SELECT topics.id, topics.subject, topics.lastpost FROM topics INNER JOIN forums ON forums.id = topics.forumid WHERE forums.minclassread <= " . user::$current["id_level"] . " ORDER BY lastpost DESC " . $limit);
while ($trow = $tres->fetch_array(MYSQLI_BOTH)) {
$lpres = $db->query("SELECT p.added, p.userid, u.username, u.id_level, prefixcolor, suffixcolor FROM posts p, users u INNER JOIN users_level ON u.id_level = users_level.id WHERE p.userid = u.id AND p.topicid = " . (int) $trow['id'] . " ORDER BY p.added");
while ($lprow = $lpres->fetch_array(MYSQLI_BOTH)) {
$last_post_userid = (int) $lprow['userid'];
$last_poster = security::html_safe($lprow['username']);
$last_post_time = get_date_time($lprow['added']);
$pcolor = unesc($lprow["prefixcolor"]);
$scolor = unesc($lprow["suffixcolor"]);
}
if ($trow['lastpost']) {
print "<tr><td class='lista'><b><a href='forum.php?action=viewtopic&topicid=" . (int) $trow['id'] . "&page=last#" . (int) $trow['lastpost'] . "'>" . security::html_safe(unesc($trow['subject'])) . "</a></b><br />" . LAST_POST_BY . " <a href='userdetails.php?id=" . $last_post_userid . "'>" . $pcolor . $last_poster . $scolor . "</a><br />On " . $last_post_time . "</td></tr>\n";
} else {
print "<tr><td class='lista'><b><a href='forum.php?action=viewtopic&topicid=" . (int) $trow['id'] . "&page=last'>" . security::html_safe(unesc($trow['subject'])) . "</a></b><br />" . LAST_POST_BY . " <a href='userdetails.php?id=" . $last_post_userid . "'>" . $pcolor . $last_poster . $scolor . "</a><br />On " . $last_post_time . "</td></tr>\n";
}
}
} else {
print "<tr><td class='lista'>" . NO_TOPIC . "</td></tr>\n";
}
print "</table>\n";
block_end();
}
// end if user can view
示例13: block_begin
print "<script language='javascript'>window.location.href='" . $link . "'</script>";
exit;
} else {
print "<script language='javascript'>window.location.href='" . $link . "'</script>";
exit;
}
}
block_begin(DELETE_TORRENT);
print "<table width='100%' class='lista' border='0' cellspacing='5' cellpadding='5'>\n";
print "<tr><td align='right' class='header'>" . FILE_NAME . ":</td><td class='lista'>" . security::html_safe($row["filename"]) . "</td></tr>";
print "<tr><td align='right' class='header'>" . INFO_HASH . ":</td><td class='lista'>" . security::html_safe($row["info_hash"]) . "</td></tr>";
if (!empty($row["comment"])) {
print "<tr><td align='right' class='header'>" . DESCRIPTION . ":</td><td align='left' class='lista'>" . format_comment(unesc($row["comment"])) . "</td></tr>";
}
if (isset($row["cat_name"])) {
print "<tr><td align='right' class='header'>" . CATEGORY_FULL . ":</td><td class='lista'>" . security::html_safe($row["cat_name"]) . "</td></tr>";
} else {
print "<tr><td align='right' class='header'>" . CATEGORY_FULL . ":</td><td class='lista'>(None)</td></tr>";
}
print "<tr><td align='right' class='header'>" . SIZE . ":</td><td class='lista'>" . misc::makesize((int) $row["size"]) . "</td></tr>";
print "<tr><td align='right' class='header'>" . ADDED . ":</td><td class='lista'>" . date("d/m/Y H:m:s", $row["data"]) . "</td></tr>";
if ($row["speed"] < 0) {
$speed = "N/A";
} else {
if ($row["speed"] > 2097152) {
$speed = round((int) $row["speed"] / 1048576, 2) . " MiB per sec";
} else {
$speed = round((int) $row["speed"] / 1024, 2) . " KiB per sec";
}
}
print "<tr><td align='right' class='header'>" . SPEED . ":</td><td class='lista'>" . $speed . "</td></tr>";
示例14: while
<?php
}
}
// forums
if (user::$current["view_forum"] == "yes") {
$getItems = "SELECT topics.id AS topicid, posts.id AS postid, forums.name, users.username, topics.subject, posts.added, posts.body FROM topics INNER JOIN posts ON posts.topicid = topics.id INNER JOIN forums ON topics.forumid = forums.id INNER JOIN users ON users.id = posts.userid ORDER BY added DESC LIMIT 100";
$doGet = $db->query($getItems);
while ($item = $doGet->fetch_array(MYSQLI_BOTH)) {
$topicid = (int) $item['topicid'];
$postid = (int) $item['postid'];
$forum = strip_tags($item['name']);
$subject = strip_tags($item['subject']);
$added = strip_tags(date("d/m/Y H:i:s", $item['added']));
$body = format_comment("[b]Author: " . security::html_safe($item['username']) . "[/b]\n\n" . security::html_safe($item['body']) . "\n");
// output to browser
$link = security::html_safe($BASEURL . "/forum.php?action=viewtopic&topicid=" . $topicid . "&page=p" . $postid . "#" . $postid);
?>
<item>
<title><?php
print safehtml("[" . FORUM . "] " . $forum . " - " . $subject);
?>
</title>
<description><?php
print safehtml($body);
?>
</description>
<link><?php
print $link;
?>
</link>
示例15: elseif
}
} elseif ($do == "banip" && $action == "read") {
block_begin(ACP_BAN_IP);
$getbanned = $db->query("SELECT * FROM bannedip ORDER BY added DESC");
$rowsbanned = @$getbanned->num_rows;
print "<form action='admincp.php?user=" . user::$current["uid"] . "&code=" . user::$current["random"] . "&do=banip&action=write' name='ban' method='post'>";
print "<center>" . BAN_NOTE . "</center>";
print "<br /><br />\n<table class='lista' width='100%' align='center'>\n";
print "<tr><td class='header'>" . ADDED . "</td><td class='header' align='left'>" . FIRST_IP . "</td>" . "<td class='header' align='left'>" . LAST_IP . "</td><td class='header' align='left'>" . BY . "</td>" . "<td class='header' align='left'>" . COMMENTS . "</td><td class='header'>" . REMOVE . "</td></tr>\n";
if ($rowsbanned > 0) {
while ($arr = $getbanned->fetch_assoc()) {
$r2 = $db->query("SELECT username FROM users WHERE id = " . (int) $arr['addedby']);
$a2 = $r2->fetch_assoc();
$arr["first"] = long2ip($arr["first"]);
$arr["last"] = long2ip($arr["last"]);
print "<tr><td class='lista'>" . get_date_time($arr['added']) . "</td><td class='lista' align='left'>" . security::html_safe($arr['first']) . "</td>" . "<td align='left' class='lista'>" . security::html_safe($arr['last']) . "</td><td align='left' class='lista'><a href='userdetails.php?id=" . (int) $arr['addedby'] . "'>" . security::html_safe($a2['username']) . "" . "</a></td><td align='left' class='lista'>" . security::html_safe($arr['comment']) . "</td><td class='lista'><a href='admincp.php?user=" . user::$current["uid"] . "&code=" . user::$current["random"] . "&do=banip&action=delete&ip=" . $arr['id'] . "'>" . image_or_link($STYLEPATH . "/delete.png", "", DELETE) . "</a></td></tr>\n";
}
print "</table>\n";
} else {
print "<tr><td colspan='6' align='center'>" . NO_BANNED_IPS . "</td></tr></table>";
}
print "<br /><br />\n<table class='lista' width='100%' align='center'>\n";
print "<tr>\n";
print "<td class='header'>" . FIRST_IP . " :</td><td class='lista'><input type='text' name='firstip' size='15' /></td>";
print "<td class='header'>" . LAST_IP . " :</td><td class='lista'><input type='text' name='lastip' size='15' /></td>";
print "</tr>\n<tr>\n";
print "<td class='header'>" . COMMENTS . " :</td><td class='lista' colspan=3><input type='text' name='comment' size='60' /></td>";
print "</tr>\n";
print "<tr><td align='center' class='header' colspan=4>";
print "<input type='submit' name='write' value='" . FRM_CONFIRM . "' />";
print " <input type='submit' name='write' value='" . FRM_CANCEL . "' />";