本文整理汇总了PHP中actionLinkTag函数的典型用法代码示例。如果您正苦于以下问题:PHP actionLinkTag函数的具体用法?PHP actionLinkTag怎么用?PHP actionLinkTag使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了actionLinkTag函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeThreadListing
function makeThreadListing($threads, $pagelinks, $dostickies = true, $showforum = false)
{
global $loguserid, $loguser, $misc;
$threadlist = array();
while ($thread = Fetch($threads)) {
$tdata = array('id' => $thread['id']);
$starter = getDataPrefix($thread, 'su_');
$last = getDataPrefix($thread, 'lu_');
$ispublic = HasPermission('forum.viewforum', $thread['forum'], true);
$tags = ParseThreadTags($thread['title']);
$urlname = $ispublic ? $tags[0] : '';
$threadlink = actionLinkTag($tags[0], 'thread', $thread['id'], '', $urlname);
$tdata['link'] = Settings::get("tagsDirection") === 'Left' ? $tags[1] . ' ' . $threadlink : $threadlink . ' ' . $tags[1];
$NewIcon = '';
$tdata['gotonew'] = '';
if ($thread['closed']) {
$NewIcon = 'off';
}
if ($thread['replies'] >= $misc['hotcount']) {
$NewIcon .= 'hot';
}
if (!$loguserid && $thread['lastpostdate'] > time() - 900 || $loguserid && $thread['lastpostdate'] > $thread['readdate']) {
$NewIcon .= 'new';
if ($loguserid) {
$tdata['gotonew'] = actionLinkTag('<img src="' . resourceLink('img/gotounread.png') . '" alt="[go to first unread post]">', 'post', '', 'tid=' . $thread['id'] . '&time=' . (int) $thread['readdate']);
}
} else {
if (!$thread['closed'] && !$thread['sticky'] && Settings::get("oldThreadThreshold") > 0 && $thread['lastpostdate'] < time() - 2592000 * Settings::get("oldThreadThreshold")) {
$NewIcon = 'old';
}
}
if ($NewIcon) {
$tdata['new'] = '<div class="statusIcon ' . $NewIcon . '"></div>';
} else {
$tdata['new'] = '';
}
$tdata['sticky'] = $thread['sticky'];
if ($thread['icon']) {
//This is a hack, but given how icons are stored in the DB, I can do nothing about it without breaking DB compatibility.
if (startsWith($thread['icon'], "img/")) {
$thread['icon'] = resourceLink($thread['icon']);
}
$tdata['icon'] = "<img src=\"" . htmlspecialchars($thread['icon']) . "\" alt=\"\" class=\"smiley\" style=\"max-width:32px; max-height:32px;\">";
} else {
$tdata['icon'] = '';
}
$tdata['poll'] = $thread['poll'] ? "<img src=\"" . resourceLink("img/poll.png") . "\" alt=\"[poll]\">" : "";
$n = 4;
$total = $thread['replies'];
$ppp = $loguser['postsperpage'];
if (!$ppp) {
$ppp = 20;
}
$numpages = floor($total / $ppp);
$pl = '';
if ($numpages <= $n * 2) {
for ($i = 1; $i <= $numpages; $i++) {
$pl .= " " . actionLinkTag($i + 1, "thread", $thread['id'], "from=" . $i * $ppp, $urlname);
}
} else {
for ($i = 1; $i < $n; $i++) {
$pl .= " " . actionLinkTag($i + 1, "thread", $thread['id'], "from=" . $i * $ppp, $urlname);
}
$pl .= " … ";
for ($i = $numpages - $n + 1; $i <= $numpages; $i++) {
$pl .= " " . actionLinkTag($i + 1, "thread", $thread['id'], "from=" . $i * $ppp, $urlname);
}
}
if ($pl) {
$tdata['pagelinks'] = actionLinkTag(1, "thread", $thread['id'], '', $urlname) . $pl;
} else {
$tdata['pagelinks'] = '';
}
if ($showforum) {
$tdata['forumlink'] = actionLinkTag(htmlspecialchars($thread["f_title"]), "forum", $thread["f_id"], "", $ispublic ? $thread["f_title"] : '');
}
$tdata['startuser'] = UserLink($starter);
$tdata['replies'] = $thread['replies'];
$tdata['views'] = $thread['views'];
$tdata['lastpostdate'] = formatdate($thread['lastpostdate']);
$tdata['lastpostuser'] = UserLink($last);
$tdata['lastpostlink'] = actionLink("post", $thread['lastpostid']);
$threadlist[$tdata['id']] = $tdata;
}
RenderTemplate('threadlist', array('threads' => $threadlist, 'pagelinks' => $pagelinks, 'dostickies' => $dostickies, 'showforum' => $showforum));
}
示例2: Kill
if (!$poll) {
Kill(__("Poll not found"));
}
$totalVotes = $poll["users"];
$rOptions = Query("SELECT pc.*,\n\t\t\t\t\t\t\t(SELECT COUNT(*) FROM {pollvotes} pv WHERE pv.poll = {0} AND pv.choiceid = pc.id) as votes,\n\t\t\t\t\t\t\t(SELECT COUNT(*) FROM {pollvotes} pv WHERE pv.poll = {0} AND pv.choiceid = pc.id AND pv.user = {1}) as myvote\n\t\t\t\t\t FROM {poll_choices} pc\n\t\t\t\t\t WHERE poll={0}", $thread['poll'], $loguserid);
$pops = 0;
$noColors = 0;
$defaultColors = array("#0000B6", "#00B600", "#00B6B6", "#B60000", "#B600B6", "#B66700", "#B6B6B6", "#676767", "#6767FF", "#67FF67", "#67FFFF", "#FF6767", "#FF67FF", "#FFFF67", "#FFFFFF");
while ($option = Fetch($rOptions)) {
if ($option['color'] == "") {
$option['color'] = $defaultColors[($option["id"] + 9) % 15];
}
$chosen = $option["myvote"] ? "✔" : "";
$cellClass = ($cellClass + 1) % 2;
if ($loguserid && !$thread['closed'] && IsAllowed("vote")) {
$label = $chosen . " " . actionLinkTag(htmlspecialchars($option['choice']), "thread", $thread['id'], "vote=" . $option["id"] . "&token=" . $loguser["token"] . "&" . $fromstring);
} else {
$label = $chosen . " " . htmlspecialchars($option['choice']);
}
$votes = $option["votes"];
$bar = " 0";
if ($totalVotes > 0) {
$width = 100 * ($votes / $totalVotes);
$alt = format("{0} of {1}, {2}%", $votes, $totalVotes, $width);
$bar = format("<div class=\"pollbar\" style=\"background-color: {0}; width: {1}%;\" title=\"{2}\"> {3}</div>", $option['color'], $width, $alt, $votes);
if ($width == 0) {
$bar = " " . $votes;
}
}
$pollLines .= "\n\t<tr class=\"cell{$cellClass}\">\n\t\t<td>\n\t\t\t{$label}\n\t\t</td>\n\t\t<td class=\"width75\">\n\t\t\t<div class=\"pollbarContainer\">\n\t\t\t\t{$bar}\n\t\t\t</div>\n\t\t</td>\n\t</tr>";
}
示例3: makeNiceLink
function makeNiceLink($m)
{
return actionLinkTag(htmlspecialchars($m[2]), 'wiki', title2url($m[1]));
}
示例4: Query
$entries = Query("select \n\t\t\t\t\t\tup.*, \n\t\t\t\t\t\tu.name, u.displayname, u.powerlevel, u.sex \n\t\t\t\t\tfrom {uploader} up\n\t\t\t\t\tleft join {users} u on up.user = u.id \n\t\t\t\t\twhere up.private = 0 order by " . $skey . $sdir);
if (NumRows($entries) == 0 && !$havePrivates) {
$public = format("\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header0\">\n\t\t\t<th colspan=\"7\">" . __("Public Files") . "</th>\n\t\t</tr>\n\t\t<tr class=\"cell1\">\n\t\t\t<td colspan=\"4\">\n\t\t\t\t" . __("The uploader is empty.") . "\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n");
} else {
if ($havePrivates) {
$head = str_replace("<input type=\"checkbox\" id=\"ca\" onchange=\"checkAll();\" />", "", $head);
}
$public = format("\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header0\">\n\t\t\t<th colspan=\"7\">" . __("Public Files") . "</th>\n\t\t</tr>\n\t\t{0}\n", $head);
while ($entry = Fetch($entries)) {
$delete = "";
$multidel = "";
if ($loguserid) {
$multidel = "<td><input type=\"checkbox\" name=\"delete[" . $entry['id'] . "]\" disabled=\"disabled\" /></td>";
}
if ($loguserid == $entry['user'] || $loguser['powerlevel'] > 2) {
$delete = "<sup> " . actionLinkTag("✘", "uploader", "", "action=delete&fid=" . $entry['id']) . "</sup>";
$multidel = "<td><input type=\"checkbox\" name=\"del[" . $entry['id'] . "]\" /></td>";
}
$cellClass = ($cellClass + 1) % 2;
$public .= format("\n\t\t<tr class=\"cell{0}\">\n\t\t\t{7}\n\t\t\t<td>\n\t\t\t\t<a href=\"{$boardroot}get.php?id={1}\">{2}</a>{3}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{4}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{5}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{6}\n\t\t\t</td>\n\t\t</tr>\n", $cellClass, $entry['id'], $entry['filename'], $delete, $entry['description'], BytesToSize(@filesize($rootdir . "/" . $entry['filename'])), UserLink($entry, "user"), $multidel);
}
if ($loguserid) {
$public .= format("\n\t\t\t<tr class=\"header1\">\n\t\t\t\t<th style=\"text-align: right;\" colspan=\"6\">\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"multidel\" />\n\t\t\t\t\t<a href=\"javascript:void();\" onclick=\"document.forms[2].submit();\">" . __("delete checked") . "</a>\n\t\t\t\t</th>\n\t\t\t</tr>");
}
$public .= "</table>";
}
$maxSizeMult = $uploaderMaxFileSize * 1024 * 1024;
if ($loguserid && IsAllowed("useUploader")) {
$uploadPart = format("\n<script type=\"text/javascript\">\n\twindow.addEventListener(\"load\", function() { hookUploadCheck(\"newfile\", 1, {1}) }, false);\n</script>\n<button style=\"float: right;\" onclick=\"var uploadForm = document.getElementById("uploadForm"); uploadForm.style.display = (uploadForm.style.display == 'none' ? 'block' : 'none');\">Upload new file</button>\n<form action=\"" . actionLink("uploader") . "\" method=\"post\" enctype=\"multipart/form-data\" id=\"uploadForm\" style=\"display: none;\">\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header0\">\n\t\t\t<th colspan=\"4\">" . __("Upload") . "</th>\n\t\t</tr>\n\t\t<tr class=\"cell2\">\n\t\t\t<td>\n\t\t\t\t<input type=\"file\" id=\"newfile\" name=\"newfile\" style=\"width: 80%;\" />\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input type=\"text\" name=\"description\" style=\"width: 80%;\" />\n\t\t\t\t<label>\n\t\t\t\t\t<input type=\"checkbox\" name=\"private\" /> " . __("Private") . "\n\t\t\t\t</label>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input type=\"submit\" id=\"submit\" name=\"action\" value=\"" . __("Upload") . "\" disabled=\"disabled\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"cell1 smallFonts\">\n\t\t\t<td colspan=\"3\">\n\t\t\t\t" . __("The maximum upload size is {0} per file. You can upload the following types: {2}.") . "\n\t\t\t\t<div id=\"sizeWarning\" style=\"display: none; font-weight: bold\">" . __("File is too large.") . "</div>\n\t\t\t\t<div id=\"typeWarning\" style=\"display: none; font-weight: bold\">" . __("File is not an allowed type.") . "</div>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t<br />\n</form>\n", BytesToSize($maxSizeMult), $maxSizeMult, Settings::pluginGet('uploaderWhitelist'));
}
$bar = " 0%";
示例5: Query
$from = 0;
}
$realFrom = $total - $from - $cpp;
$realLen = $cpp;
if ($realFrom < 0) {
$realLen += $realFrom;
$realFrom = 0;
}
$rComments = Query("SELECT\n\t\tu.(_userfields),\n\t\t{usercomments}.id, {usercomments}.cid, {usercomments}.text\n\t\tFROM {usercomments}\n\t\tLEFT JOIN {users} u ON u.id = {usercomments}.cid\n\t\tWHERE uid={0}\n\t\tORDER BY {usercomments}.date ASC LIMIT {1u},{2u}", $id, $realFrom, $realLen);
$pagelinks = PageLinksInverted(actionLink($mobileLayout ? "usercomments" : "profile", $id, "from="), $cpp, $from, $total);
$commentList = "";
$commentField = "";
if (NumRows($rComments)) {
while ($comment = Fetch($rComments)) {
if ($canDeleteComments) {
$deleteLink = "<small style=\"float: right; margin: 0px 4px;\">" . actionLinkTag("✘", $mobileLayout ? "usercomments" : "profile", $id, "action=delete&cid=" . $comment['id'] . "&token={$loguser['token']}") . "</small>";
}
$cellClass = ($cellClass + 1) % 2;
$thisComment = format("\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"cell2\">\n\t\t\t\t\t\t\t\t{0}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"cell{1}\">\n\t\t\t\t\t\t\t\t{3}{2}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n", UserLink(getDataPrefix($comment, "u_")), $cellClass, CleanUpPost($comment['text'], $comment['u_name']), $deleteLink);
$commentList = $commentList . $thisComment;
if (!isset($lastCID)) {
$lastCID = $comment['cid'];
}
}
$pagelinks = "<td colspan=\"2\" class=\"cell1\">{$pagelinks}</td>";
if ($total > $cpp) {
$commentList = "{$pagelinks}{$commentList}{$pagelinks}";
}
} else {
$commentsWasEmpty = true;
$commentList = $thisComment = format("\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"cell0\" colspan=\"2\">\n\t\t\t\t\t\t\t\t" . __("No comments.") . "\n\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n");
示例6: Kill
}
if ($pm['drafting'] && !$snoop) {
Kill(__("Unknown PM"));
}
//could say "PM is addresssed to you, but is being drafted", but what they hey?
$rUser = Query("select * from {users} where id = {0}", $pm['userfrom']);
if (NumRows($rUser)) {
$user = Fetch($rUser);
} else {
Kill(__("Unknown user."));
}
$links = array();
if (!$snoop && $pm['userto'] == $loguserid) {
Query("update {pmsgs} set msgread=1 where id={0}", $pm['id']);
DismissNotification('pm', $pm['id'], $loguserid);
$links[] = actionLinkTag(__("Send reply"), "sendprivate", "", "pid=" . $pm['id']);
} else {
if ($_GET['markread']) {
Query("update {pmsgs} set msgread=1 where id={0}", $pm['id']);
DismissNotification('pm', $pm['id'], -1);
die(header('Location: ' . actionLink('private')));
}
}
$pmtitle = htmlspecialchars($pm['title']);
MakeCrumbs(array(actionLink("private") => __("Private messages"), '' => $pmtitle), $links);
$pm['num'] = 0;
$pm['posts'] = $user['posts'];
$pm['id'] = 0;
foreach ($user as $key => $value) {
$pm['u_' . $key] = $value;
}
示例7: Kill
}
$fid = $thread['forum'];
if (!HasPermission('forum.viewforum', $fid)) {
Kill(__('You may not access this forum.'));
}
$tags = ParseThreadTags($thread['title']);
$isHidden = !HasPermission('forum.viewforum', $fid, true);
if ($_POST['report']) {
if ($_POST['key'] !== $loguser['token']) {
Kill(__('No.'));
}
// TODO make this use actual notifications or anything better
Query("INSERT INTO {pmsgs_text} (title,text) VALUES ({0},{1})", "Post report (post #{$pid})", '');
$pmid = InsertId();
Query("INSERT INTO {pmsgs} (id,userto,userfrom,date,ip,msgread,deleted,drafting)\n\t\tVALUES ({0},{1},{2},{3},{4},0,0,0)", $pmid, -1, $loguserid, time(), $_SERVER['REMOTE_ADDR']);
$report = "<strong>Post report</strong>\n\n<strong>Post:</strong> " . actionLinkTag($tags[0], 'post', $pid) . " (post #{$pid})\n\n<strong>Message:</strong>\n{$_POST['message']}\n\n" . actionLinkTag('Mark issue as resolved', 'showprivate', $pmid, 'markread=1');
Query("UPDATE {pmsgs_text} SET text={0} WHERE pid={1}", $report, $pmid);
SendNotification('pm', $pmid, -1);
die(header('Location: ' . actionLink('post', $pid)));
}
MakeCrumbs(forumCrumbs($forum) + array(actionLink("thread", $tid, '', $isHidden ? '' : $tags[0]) => $tags[0], '' => __("Report post")));
$user = Fetch(Query("SELECT * FROM {users} WHERE id={0}", $post['user']));
foreach ($user as $key => $value) {
$post['u_' . $key] = $value;
}
MakePost($post, POST_SAMPLE);
$fields = array('message' => '<textarea id="text" name="message" rows=10></textarea>', 'btnSubmit' => '<input type="submit" name="report" value="' . __('Submit report') . '">');
echo '
<form action="" method="POST">';
RenderTemplate('form_reportpost', array('fields' => $fields));
echo '
示例8: listCategory
function listCategory($cat)
{
global $loguser, $loguserid, $rootdir, $userSelectUsers, $boardroot;
if (isset($_GET['sort']) && $_GET['sort'] == "filename" || $_GET['sort'] == "date") {
$skey = $_GET['sort'];
} else {
$skey = "date";
}
$sortOptions = "<div class=\"margin smallFonts\">" . __("Sort order") . ": <ul class=\"pipemenu\">";
$sortOptions .= $skey == "filename" ? "<li>" . __("Name") . "</li>" : actionLinkTagItem(__("Name"), "uploaderlist", "", "cat={$_GET["cat"]}&sort=filename");
$sortOptions .= $skey == "date" ? "<li>" . __("Date") . "</li>" : actionLinkTagItem(__("Date"), "uploaderlist", "", "cat={$_GET["cat"]}&sort=date");
$sortOptions .= "</ul></div>";
$sdir = $skey == "date" ? " desc" : " asc";
print $sortOptions;
if ($cat == -1) {
$condition = "up.user = " . $loguserid . " and up.private = 1";
} else {
if ($cat == -2 && $loguser['powerlevel'] > 2) {
$condition = "up.private = 1";
} else {
$condition = "up.private = 0 and up.category = {0}";
}
}
$errormsg = __("The category is empty.");
if ($cat < 0) {
$errormsg = __("You have no private files.");
}
$entries = Query("SELECT\n\t\t\tup.*,\n\t\t\tu.(_userfields)\n\t\t\tFROM {uploader} up\n\t\t\tLEFT JOIN {users} u on up.user = u.id\n\t\t\tWHERE {$condition}\n\t\t\tORDER BY " . $skey . $sdir, $cat);
$checkbox = "";
if ($loguserid) {
$checkbox = "<input type=\"checkbox\" id=\"ca\" onchange=\"checkAll();\" />";
$checkbox = "<th style=\"width: 22px;\">{$checkbox}</th>";
}
if (NumRows($entries) == 0) {
print "\n\t\t<table class=\"outline margin\">\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"7\">" . __("Files") . "</th>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td colspan=\"4\">\n\t\t\t\t\t" . $errormsg . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t";
} else {
print "\n\t\t<table class=\"outline margin\">\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"7\">" . __("Files") . "</th>\n\t\t\t</tr>\n\n\t\t";
print "\n\t\t\t<tr class=\"header1\">\n\t\t\t\t{$checkbox}\n\t\t\t\t<th>\n\t\t\t\t\t" . __("File") . "\n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\t" . __("Description") . "\n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\t" . __("Size") . "\n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\t" . __("Uploader") . "\n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\t" . __("Downloads") . "\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t";
while ($entry = Fetch($entries)) {
$delete = "";
$multidel = "";
if ($loguserid) {
$multidel = "<td><input type=\"checkbox\" name=\"delete[" . $entry['id'] . "]\" disabled=\"disabled\" /></td>";
}
if ($loguserid == $entry['user'] || $loguser['powerlevel'] > 2) {
$delete = " <sup>" . actionLinkTag("✘", "uploader", "", "action=delete&fid=" . $entry['id'] . "&cat=" . $_GET["cat"]) . "</sup>";
$multidel = "<td><input type=\"checkbox\" name=\"del[" . $entry['id'] . "]\" /></td>";
}
$cellClass = ($cellClass + 1) % 2;
$filepath = $rootdir . "/" . $entry['filename'];
if ($entry['private']) {
$filepath = $rootdir . "/" . $entry['user'] . "/" . $entry['filename'];
}
print format("\n\t\t\t<tr class=\"cell{0}\">\n\t\t\t\t{7}\n\t\t\t\t<td>\n\t\t\t\t\t<a href=\"{$boardroot}get.php?id={1}\">{2}</a>{3}\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t{4}\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t{5}\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t{6}\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t{8}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t", $cellClass, $entry['id'], $entry['filename'], $delete, $entry['description'], BytesToSize(@filesize($filepath)), UserLink(getDataPrefix($entry, "u_")), $multidel, $entry["downloads"]);
}
if ($loguserid) {
$entries = Query("select * from {uploader_categories} order by ord");
$movelist = "";
while ($entry = Fetch($entries)) {
$movelist .= "<option value='{$entry["id"]}'>{$entry["name"]}</option>";
}
$movelist = "<select name='destcat' size='1'>{$movelist}</select>";
print format("\n\t\t\t\t<tr class=\"header1\">\n\t\t\t\t\t<th style=\"text-align: right;\" colspan=\"6\">\n\t\t\t\t\t\t<input type=\"hidden\" id='actionfield' name=\"action\" value=\"multidel\" />\n\t\t\t\t\t\t<a href=\"javascript:void();\" onclick=\"document.getElementById('actionfield').value = 'multidel'; document.forms[1].submit();\">" . __("delete checked") . "</a>\n\t\t\t\t\t\t<a href=\"javascript:void();\" onclick=\"document.getElementById('actionfield').value = 'multimove'; document.forms[1].submit();\">" . __("Move checked to") . "</a>{$movelist}\n\t\t\t\t\t</th>\n\t\t\t\t</tr>");
}
print "</table>";
}
}
示例9: CleanUpPost
$pdata['text'] = CleanUpPost($thread['text'], $starter['name'], false, false);
if (!$thread['replies']) {
$comments = 'No comments yet';
} else {
if ($thread['replies'] < 2) {
$comments = actionLinkTag('1 comment', 'post', $thread['lastpostid']) . ' (by ' . UserLink($last) . ')';
} else {
$comments = actionLinkTag($thread['replies'] . ' comments', 'post', $thread['lastpostid']) . ' (last by ' . UserLink($last) . ')';
}
}
$pdata['comments'] = $comments;
if ($thread['closed']) {
$newreply = __('Comment posting closed.');
} else {
if (!$loguserid) {
$newreply = actionLinkTag(__('Log in'), 'login') . __(' to post a comment.');
} else {
$newreply = actionLinkTag(__("Post a comment"), "newreply", $thread['id']);
}
}
$pdata['replylink'] = $newreply;
$modlinks = array();
if ($loguserid == $starter['id'] && HasPermission('user.editownposts') || HasPermission('mod.editposts', $forum['id'])) {
$modlinks['edit'] = actionLinkTag(__('Edit'), 'editpost', $thread['pid']);
}
if ($loguserid == $starter['id'] && HasPermission('user.deleteownposts') || HasPermission('mod.deleteposts', $forum['id'])) {
$modlinks['delete'] = actionLinkTag(__('Delete'), 'editpost', $thread['pid'], 'delete=1&key=' . $loguser['token']);
}
RenderTemplate('newspost', array('post' => $pdata));
}
RenderTemplate('pagelinks', array('pagelinks' => $pagelinks, 'position' => 'bottom'));
示例10: __
$title = __("Administration");
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Admin"), "admin"));
makeBreadcrumbs($crumbs);
$cell2 = 1;
function cell2($content)
{
global $cell2;
$cell2 = $cell2 == 1 ? 0 : 1;
Write("\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td>\n\t\t\t\t{1}\n\t\t\t</td>\n\t\t</tr>\n\t", $cell2, $content);
}
Write("\n\t<table class=\"outline margin width50 floatright\">\n\t\t<tr class=\"header1\">\n\t\t\t<th colspan=\"2\">\n\t\t\t\t" . __("Information") . "\n\t\t\t</th>\n\t\t</tr>\n");
cell2(Format("\n\n\t\t\t\t" . __("Last viewcount milestone") . "\n\t\t\t</td>\n\t\t\t<td style=\"width: 60%;\">\n\t\t\t\t{0}\n\t\t\t", $misc['milestone']));
$bucket = "adminright";
include "./lib/pluginloader.php";
write("\n\t</table>\n");
$cell2 = 1;
Write("\n\t<table class=\"outline margin width25\">\n\t\t<tr class=\"header1\">\n\t\t\t<th>\n\t\t\t\t" . __("Admin tools") . "\n\t\t\t</th>\n\t\t</tr>\n");
cell2(actionLinkTag(__("Recalculate statistics"), "recalc"));
cell2(actionLinkTag(__("Last Known Browsers"), "lastknownbrowsers"));
cell2(actionLinkTag(__("Manage IP bans"), "ipbans"));
cell2(actionLinkTag(__("Manage forum list"), "editfora"));
cell2(actionLinkTag(__("Manage plugins"), "pluginmanager"));
cell2(actionLinkTag(__("Edit settings"), "editsettings"));
cell2(actionLinkTag(__("Edit smilies"), "editsmilies"));
cell2(actionLinkTag(__("Optimize tables"), "optimize"));
cell2(actionLinkTag(__("View log"), "log"));
cell2(actionLinkTag(__("Update table structure"), "updateschema"));
$bucket = "adminleft";
include "./lib/pluginloader.php";
write("\n\t</table>\n");
示例11: unserialize
<?php
if ($loguser['powerlevel'] > 3) {
$shitbugs = @file_get_contents('shitbugs.dat');
$shitbugs = $shitbugs ? unserialize($shitbugs) : array();
$extra = '';
if (count($shitbugs) > 0) {
$extra = format(", last at <strong>{0}</strong> by <strong>{1} ({2})</strong>", formatdate($shitbugs[0]['date']), $shitbugs[0]['ip'], $shitbugs[0]['banflags']);
}
write("\n\t<table class=\"outline margin width100\">\n\t\t<tr class=\"cell1\">\n\t\t\t<td style=\"text-align: center;\">\n\t\t\t\t{0}\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n", actionLinkTag(format("<span style=\"color: #f00; font-weight: normal;\"><strong>{0}</strong> suspicious request(s) logged{1}</a>", count($shitbugs), $extra), 'shitbugs'));
}
示例12: doLastPosts
function doLastPosts($compact, $limit)
{
global $mobileLayout, $loguser;
if ($mobileLayout) {
$compact = true;
}
$hours = 72;
$rPosts = Query("SELECT\n\t\t\t\t\t\tp.id, p.date,\n\t\t\t\t\t\tu.(_userfields),\n\t\t\t\t\t\tt.title AS ttit, t.id AS tid,\n\t\t\t\t\t\tf.title AS ftit, f.id AS fid\n\t\t\t\t\tFROM {posts} p\n\t\t\t\t\t\tLEFT JOIN {users} u on u.id = p.user\n\t\t\t\t\t\tLEFT JOIN {threads} t on t.id = p.thread\n\t\t\t\t\t\tLEFT JOIN {forums} f on t.forum = f.id\n\t\t\t\t\tWHERE " . forumAccessControlSql() . " AND p.date >= {0}\n\t\t\t\t\tORDER BY date DESC LIMIT 0, {1u}", time() - $hours * 60 * 60, $limit);
while ($post = Fetch($rPosts)) {
$thread = array();
$thread["title"] = $post["ttit"];
$thread["id"] = $post["tid"];
$c = ($c + 1) % 2;
if ($compact) {
$theList .= format("\n\t\t\t\t<tr class=\"cell{5}\">\n\t\t\t\t\t<td>\n\t\t\t\t\t\t{3} » {4}\n\t\t\t\t\t\t<br>{2}, {1} \n\t\t\t\t\t\t<span style=\"float:right\">» {6}</span>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t", $post['id'], formatdate($post['date']), UserLink(getDataPrefix($post, "u_")), actionLinkTag($post["ftit"], "forum", $post["fid"], "", $post["ftit"]), makeThreadLink($thread), $c, actionLinkTag($post['id'], "post", $post['id']));
} else {
$theList .= format("\n\t\t\t\t<tr class=\"cell{5}\">\n\t\t\t\t\t<td>\n\t\t\t\t\t\t{3}\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t{4}\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t{2}\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t{1}\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t» {6}\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t", $post['id'], formatdate($post['date']), UserLink(getDataPrefix($post, "u_")), actionLinkTag($post["ftit"], "forum", $post["fid"], "", $post["ftit"]), makeThreadLink($thread), $c, actionLinkTag($post['id'], "post", $post['id']));
}
}
if ($theList == "") {
$theList = format("\n\t\t<tr class=\"cell1\">\n\t\t\t<td colspan=\"5\" style=\"text-align: center\">\n\t\t\t\t" . __("Nothing has been posted in the last {0}.") . "\n\t\t\t</td>\n\t\t</tr>\n\t", Plural($hours, __("hour")));
}
if ($compact) {
write("\n\t\t<table class=\"margin outline\">\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"5\">" . __("Last posts") . "</th>\n\t\t\t</tr>\n\t\t\t{0}\n\t\t</table>\n\t\t", $theList);
} else {
write("\n\t\t<table class=\"margin outline\">\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"5\">" . __("Last posts") . "</th>\n\t\t\t</tr>\n\t\t\t<tr class=\"header1\">\n\t\t\t\t<th>" . __("Forum") . "</th>\n\t\t\t\t<th>" . __("Thread") . "</th>\n\t\t\t\t<th>" . __("User") . "</th>\n\t\t\t\t<th>" . __("Date") . "</th>\n\t\t\t\t<th></th>\n\t\t\t</tr>\n\t\t\t{0}\n\t\t</table>\n\t\t", $theList);
}
}
示例13: strip_tags
}
if ($thread['replies'] == 0) {
$lastLink = "";
}
$subtitle = strip_tags($thread['subtitle']);
if ($subtitle != "") {
$subtitle = '<br>' . $subtitle;
}
$postdate = formatdate($thread['date']);
$posttext = CleanUpPost($thread['text'], $thread['u_name'], false, false);
$comments = Plural($thread['replies'], "comment");
$comments = actionLinkTag($comments, "thread", $thread['id'], "", $thread["title"]) . ".";
if ($thread['replies'] != 0) {
$comments .= " Last by " . UserLink($last) . ". {$lastLink}";
}
$newreply = actionLinkTag("Post a comment", "newreply", $thread['id'], "", $thread["title"]);
if ($thread['sticky']) {
$forumList .= "<table class='outline margin width100'>";
$forumList .= "<tr class='cell1'><td style='border: 1px solid #000; padding:16px' colspan='2'>{$posttext}</td></tr>";
$forumList .= "</table>";
} else {
$forumList .= "<table class='outline margin width100'>";
$forumList .= "\n\t\t<tr class=\"header1\" >\n\t\t\t<th style='text-align:left;'><span style='font-size:15px'>" . $tags[0] . "</span><span style='font-weight:normal;'>{$subtitle}</span></th>\n\t\t\t<th style='text-align:left; width:150px; font-weight:normal;'>Posted by " . UserLink($starter) . "<br>{$postdate}</th>\n\t\t</tr>";
$forumList .= "<tr class='cell1'><td colspan='2' style='padding:10px'>{$posttext}</td></tr>";
$forumList .= "<tr class='cell0'><td>{$comments}</td><td style=\"border-left: 0px none;\">{$newreply}</td></tr>";
$forumList .= "</table>";
}
}
Write($forumList);
if ($pagelinks) {
Write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
示例14: MakeCrumbs
MakeCrumbs(array(actionLink('downloads') => 'Downloads', actionLink('downloads', $dl['id']) => $dl['description']), '');
echo '
<table class="outline margin width100">
<tr class="header1"><th colspan="2">' . htmlspecialchars($dl['description']) . '</th></tr>';
$filepath = $rootdir . "/" . $dl['physicalname'];
$details = 'Uploaded on ' . formatdate($dl['date']) . ' — Downloaded ' . $dl['downloads'] . ' times<br>';
$details .= 'File size: ' . BytesToSize(@filesize($filepath)) . ' — MD5: ' . @md5_file($filepath) . ' — SHA1: ' . @sha1_file($filepath);
$stuff = nl2br(htmlspecialchars($dl['big_description'])) . '<br><br>' . $details;
$outdated = '';
$lastid = FetchResult("SELECT id FROM {uploader} WHERE category={0} ORDER BY date DESC LIMIT 1", $dl['category']);
if ($lastid != $dl['id']) {
$better = FetchResult("SELECT description FROM {uploader} WHERE id={0}", $lastid);
$outdated = '
<tr class="cell0">
<td colspan="2" class="center">
<span style="font-size:200%;"><strong>This download is outdated.</strong> We recommend that you check out ' . actionLinkTag($better, 'downloads', $lastid) . ' instead.</span>
</td>
</tr>';
}
echo $outdated . '
<tr class="cell1">
<td style="padding: 0.3em;">
' . $stuff . '
</td>
<td class="center">
<a href="get.php?id=' . $dl['id'] . '&force">Download</a>
</td>
</tr>';
echo '
</table>';
return;
示例15: Kill
Kill(__("Invalid thread ID."));
}
$thread = Fetch($thread);
if (!HasPermission('forum.viewforum', $thread['forum'])) {
Kill(__("Nice try, hacker kid, but no."));
}
if ($_GET['action'] == 'add') {
Query("INSERT IGNORE INTO {favorites} (user,thread) VALUES ({0},{1})", $loguserid, $tid);
} else {
Query("DELETE FROM {favorites} WHERE user={0} AND thread={1}", $loguserid, $tid);
}
die(header('Location: ' . $_SERVER['HTTP_REFERER']));
}
}
$title = 'Favorites';
$links = array(actionLinkTag(__("Mark threads read"), 'favorites', 0, 'action=markasread'));
MakeCrumbs(array(actionLink('favorites') => 'Favorites'), $links);
$viewableforums = ForumsWithPermission('forum.viewforum');
$total = FetchResult("SELECT COUNT(*) FROM {threads} t INNER JOIN {favorites} fav ON fav.user={0} AND fav.thread=t.id WHERE t.forum IN ({1c})", $loguserid, $viewableforums);
$tpp = $loguser['threadsperpage'];
if (isset($_GET['from'])) {
$from = (int) $_GET['from'];
} else {
$from = 0;
}
if (!$tpp) {
$tpp = 50;
}
$rThreads = Query("\tSELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\ttr.date readdate,\n\t\t\t\t\t\tsu.(_userfields),\n\t\t\t\t\t\tlu.(_userfields),\n\t\t\t\t\t\tf.(id,title)\n\t\t\t\t\tFROM\n\t\t\t\t\t\t{threads} t\n\t\t\t\t\t\tINNER JOIN {favorites} fav ON fav.user={0} AND fav.thread=t.id\n\t\t\t\t\t\tLEFT JOIN {threadsread} tr ON tr.thread=t.id AND tr.id={0}\n\t\t\t\t\t\tLEFT JOIN {users} su ON su.id=t.user\n\t\t\t\t\t\tLEFT JOIN {users} lu ON lu.id=t.lastposter\n\t\t\t\t\t\tLEFT JOIN {forums} f ON f.id=t.forum\n\t\t\t\t\tWHERE f.id IN ({3c})\n\t\t\t\t\tORDER BY sticky DESC, lastpostdate DESC LIMIT {1u}, {2u}", $loguserid, $from, $tpp, $viewableforums);
$numonpage = NumRows($rThreads);
$pagelinks = PageLinks(actionLink('favorites', '', 'from='), $tpp, $from, $total);