本文整理汇总了PHP中UserLink函数的典型用法代码示例。如果您正苦于以下问题:PHP UserLink函数的具体用法?PHP UserLink怎么用?PHP UserLink使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UserLink函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FormatNotif_PM
function FormatNotif_PM($id, $args)
{
global $loguserid;
$staffpm = '';
if (HasPermission('admin.viewstaffpms')) {
$staffpm = ' OR p.userto=-1';
}
$pm = Fetch(Query("\tSELECT \n\t\t\t\t\t\t\tp.id,\n\t\t\t\t\t\t\tpt.title pmtitle, \n\t\t\t\t\t\t\tu.(_userfields) \n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t{pmsgs} p \n\t\t\t\t\t\t\tLEFT JOIN {pmsgs_text} pt ON pt.pid=p.id \n\t\t\t\t\t\t\tLEFT JOIN {users} u ON u.id=p.userfrom \n\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\tp.id={0} AND (p.userto={1}{$staffpm})", $id, $loguserid));
$userdata = getDataPrefix($pm, 'u_');
return __('New private message from ') . UserLink($userdata) . "\n" . actionLinkTag(htmlspecialchars($pm['pmtitle']), 'showprivate', $pm['id']);
}
示例2: doThreadPreview
function doThreadPreview($tid)
{
global $mobileLayout;
if ($mobileLayout) {
return;
}
$rPosts = Query("\n\t\tselect\n\t\t\t{posts}.id, {posts}.date, {posts}.num, {posts}.deleted, {posts}.options, {posts}.mood, {posts}.ip,\n\t\t\t{posts_text}.text, {posts_text}.text, {posts_text}.revision,\n\t\t\tu.(_userfields)\n\t\tfrom {posts}\n\t\tleft join {posts_text} on {posts_text}.pid = {posts}.id and {posts_text}.revision = {posts}.currentrevision\n\t\tleft join {users} u on u.id = {posts}.user\n\t\twhere thread={0} and deleted=0\n\t\torder by date desc limit 0, 20", $tid);
if (NumRows($rPosts)) {
$posts = "";
while ($post = Fetch($rPosts)) {
$cellClass = ($cellClass + 1) % 2;
$poster = getDataPrefix($post, "u_");
$nosm = $post['options'] & 2;
$nobr = $post['options'] & 4;
$posts .= Format("\n\t\t\t<tr>\n\t\t\t\t<td class=\"cell2\" style=\"width: 15%; vertical-align: top;\">\n\t\t\t\t\t{1}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"cell{0}\">\n\t\t\t\t\t<button style=\"float: right;\" onclick=\"insertQuote({2});\">" . __("Quote") . "</button>\n\t\t\t\t\t<button style=\"float: right;\" onclick=\"insertChanLink({2});\">" . __("Link") . "</button>\n\t\t\t\t\t{3}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t", $cellClass, UserLink($poster), $post['id'], CleanUpPost($post['text'], $poster['name'], $nosm));
}
Write("\n\t\t<table class=\"outline margin\">\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"2\">" . __("Thread review") . "</th>\n\t\t\t</tr>\n\t\t\t{0}\n\t\t</table>\n\t", $posts);
}
}
示例3: getBirthdaysText
function getBirthdaysText()
{
$rBirthdays = Query("select u.birthday, u.(_userfields) from {users} u where birthday > 0 and powerlevel >= 0 order by name");
$birthdays = array();
while ($user = Fetch($rBirthdays)) {
$b = $user['birthday'];
if (gmdate("m-d", $b) == gmdate("m-d")) {
$y = gmdate("Y") - gmdate("Y", $b);
$birthdays[] = UserLink(getDataPrefix($user, "u_")) . " (" . $y . ")";
}
}
if (count($birthdays)) {
$birthdaysToday = implode(", ", $birthdays);
}
if ($birthdaysToday) {
return "<br>" . __("Birthdays today:") . " " . $birthdaysToday;
} else {
return "";
}
}
示例4: OnlineUsers
function OnlineUsers($forum = 0, $update = true)
{
global $loguserid;
$forumClause = "";
$browseLocation = __("online");
if ($update) {
if ($loguserid) {
Query("UPDATE {users} SET lastforum={0} WHERE id={1}", $forum, $loguserid);
} else {
Query("UPDATE {guests} SET lastforum={0} WHERE ip={1}", $forum, $_SERVER['REMOTE_ADDR']);
}
}
if ($forum) {
$forumClause = " and lastforum={1}";
$forumName = FetchResult("SELECT title FROM {forums} WHERE id={0}", $forum);
$browseLocation = format(__("browsing {0}"), $forumName);
}
$rOnlineUsers = Query("select u.(_userfields) from {users} u where (lastactivity > {0} or lastposttime > {0}) and loggedin = 1 " . $forumClause . " order by name", time() - 300, $forum);
$onlineUserCt = 0;
$onlineUsers = "";
while ($user = Fetch($rOnlineUsers)) {
$user = getDataPrefix($user, "u_");
$userLink = UserLink($user, true);
$onlineUsers .= ($onlineUserCt ? ", " : "") . $userLink;
$onlineUserCt++;
}
//$onlineUsers = $onlineUserCt." "user".(($onlineUserCt > 1 || $onlineUserCt == 0) ? "s" : "")." ".$browseLocation.($onlineUserCt ? ": " : ".").$onlineUsers;
$onlineUsers = Plural($onlineUserCt, __("user")) . " " . $browseLocation . ($onlineUserCt ? ": " : ".") . $onlineUsers;
$data = Fetch(Query("select \n\t\t(select count(*) from {guests} where bot=0 and date > {0} {$forumClause}) as guests,\n\t\t(select count(*) from {guests} where bot=1 and date > {0} {$forumClause}) as bots\n\t\t", time() - 300, $forum));
$guests = $data["guests"];
$bots = $data["bots"];
if ($guests) {
$onlineUsers .= " | " . Plural($guests, __("guest"));
}
if ($bots) {
$onlineUsers .= " | " . Plural($bots, __("bot"));
}
// $onlineUsers = "<div style=\"display: inline-block; height: 16px; overflow: hidden; padding: 0px; line-height: 16px;\">".$onlineUsers."</div>";
return $onlineUsers;
}
示例5: DoPrivateMessageBar
function DoPrivateMessageBar()
{
global $loguserid, $loguser;
if ($loguserid) {
$unread = FetchResult("select count(*) from {pmsgs} where userto = {0} and msgread=0 and drafting=0", $loguserid);
$content = "";
if ($unread) {
$pmNotice = $loguser['usebanners'] ? "id=\"pmNotice\" " : "";
$rLast = Query("select * from {pmsgs} where userto = {0} and msgread=0 order by date desc limit 0,1", $loguserid);
$last = Fetch($rLast);
$rUser = Query("select * from {users} where id = {0}", $last['userfrom']);
$user = Fetch($rUser);
$content .= format("\n\t\t" . __("You have {0}{1}. {2}Last message{1} from {3} on {4}."), Plural($unread, format(__("new {0}private message"), "<a href=\"" . actionLink("private") . "\">")), "</a>", "<a href=\"" . actionLink("showprivate", $last['id']) . "\">", UserLink($user), formatdate($last['date']));
}
if ($loguser['newcomments']) {
$content .= format("\n\t\t" . __("You {0} have new comments in your {1}profile{2}."), $content != "" ? "also" : "", "<a href=\"" . actionLink("profile", $loguserid) . "\">", "</a>");
}
if ($content) {
write("\n\t<div {0} class=\"outline margin header0 cell0 smallFonts\">\n\t\t{1}\n\t</div>\n", $pmNotice, $content);
}
}
}
示例6: str_replace
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%";
if ($totalsize > 0) {
$width = floor(100 * ($totalsize / $quota));
if ($width > 0) {
$color = "green";
示例7: getBirthdaysText
function getBirthdaysText($ret = true)
{
global $luckybastards, $loguser;
$luckybastards = array();
$today = gmdate('m-d', time() + $loguser['timezone']);
$rBirthdays = Query("select u.birthday, u.(_userfields) from {users} u where u.birthday > 0 and u.primarygroup!={0} order by u.name", Settings::get('bannedGroup'));
$birthdays = array();
while ($user = Fetch($rBirthdays)) {
$b = $user['birthday'];
if (gmdate("m-d", $b) == $today) {
$luckybastards[] = $user['u_id'];
if ($ret) {
$y = gmdate("Y") - gmdate("Y", $b);
$birthdays[] = UserLink(getDataPrefix($user, 'u_')) . " (" . $y . ")";
}
}
}
if (!$ret) {
return '';
}
if (count($birthdays)) {
$birthdaysToday = implode(", ", $birthdays);
}
if (isset($birthdaysToday)) {
return __("Birthdays today:") . " " . $birthdaysToday;
} else {
return "";
}
}
示例8: format
if ($commentsWasEmpty) {
$commentList = "";
}
$commentList .= $thisComment;
}
//print "lastCID: ".$lastCID;
if ($loguserid) {
$commentField = format("\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<form method=\"post\" action=\"profile.php\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{0}\" />\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"text\" style=\"width: 80%;\" maxlength=\"255\" />\n\t\t\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Post") . "\" />\n\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t</div>\n", $id);
if ($lastCID == $loguserid) {
$commentField = __("You already have the last word.");
}
if (!IsAllowed("makeComments")) {
$commentField = __("You are not allowed to post usercomments.");
}
}
write("\n\t\t\t<td style=\"vertical-align: top; border: 0px none;\">\n\t\t\t\t<table class=\"outline margin\">\n\t\t\t\t\t<tr class=\"header1\">\n\t\t\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t\t\t" . __("Comments about {0}") . "\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t{1}\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=\"2\" class=\"cell2\">\n\t\t\t\t\t\t\t{2}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n", UserLink($user), $commentList, $commentField);
$bucket = "profileRight";
include "./lib/pluginloader.php";
write("\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n");
/*
//Randomized previews
$previews = array
(
"(sample text)", //from AcmlmBoard 1.8a and 2.0a2
"[quote=Spock]A sample quote, with a <a href=\"about:blank\">link</a>, for testing your layout.[/quote](sample text)", //from ProtoBoard
"[quote=\"The Joker\" id=\"4\"]Why so <a href=\"profile.php?id=".$id."\">serious</a>?[/quote]Because I heard it before. And it wasn't funny then.", //from "The Dark Knight" and "The Killing Joke"
"[quote=Barack Obama]I am Barack Obama and I approve this preview message.[/quote](sample post)",
);
$previewPost['text'] = $previews[array_rand($previews)];
//</randompreviews>
*/
示例9: CheckPermission
CheckPermission('admin.ipsearch');
$ip = $_GET["id"];
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
Kill("Invalid IP");
}
$links = array();
$links[] = "<a href=\"http://dnsquery.org/ipwhois/{$ip}\" target=\"_blank\">Whois Query</a>";
$links[] = "<a onclick=\"if(confirm('Are you sure you want to IP-ban {$ip}?')) {document.getElementById('banform').submit();} return false;\" href=\"#\">IP Ban</a>";
MakeCrumbs(array(actionLink("admin") => __("Admin"), actionLink("ipbans") => __("IP ban manager"), '' => $ip), $links);
$rUsers = Query("select * from {users} where lastip={0}", $ip);
echo "<h3>Users with this IP</h3>";
$userList = "";
$ipBanComment = "";
$i = 1;
if (NumRows($rUsers)) {
while ($user = Fetch($rUsers)) {
$ipBanComment .= $user["name"] . " ";
$cellClass = ($cellClass + 1) % 2;
if ($user['lasturl']) {
$lastUrl = "<a href=\"" . $user['lasturl'] . "\">" . $user['lasturl'] . "</a>";
} else {
$lastUrl = __("None");
}
$userList .= format("\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\t<td>\n\t\t\t\t{2}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{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\t", $cellClass, $i, UserLink($user), cdate("d-m-y G:i:s", $user['lastactivity']), $user['lastposttime'] ? cdate("d-m-y G:i:s", $user['lastposttime']) : __("Never"), $lastUrl, formatIP($user['lastip']));
$i++;
}
} else {
$userList = "<tr class=\"cell0\"><td colspan=\"6\">" . __("No users") . "</td></tr>";
}
echo "<form id=\"banform\" action=\"" . htmlentities(actionLink('ipbans')) . "\" method=\"post\">\n\t<input type=\"hidden\" name=\"ip\" value=\"{$ip}\">\n\t<input type=\"hidden\" name=\"reason\" value=\"" . htmlentities($ipBanComment) . "\">\n\t<input type=\"hidden\" name=\"days\" value=\"0\">\n\t<input type=\"hidden\" name=\"actionadd\" value=\"yes, do it!\">\n</form>";
echo "\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header1\">\n\t\t\t<th style=\"width: 30px;\">\n\t\t\t\t#\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Name") . "\n\t\t\t</th>\n\t\t\t<th style=\"width: 140px;\">\n\t\t\t\t" . __("Last view") . "\n\t\t\t</th>\n\t\t\t<th style=\"width: 140px;\">\n\t\t\t\t" . __("Last post") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("URL") . "\n\t\t\t</th>\n\t\t\t<th style=\"width: 140px;\">\n\t\t\t\t" . __("IP") . "\n\t\t\t</th>\n\t\t</tr>\n\t\t{$userList}\n\t</table>";
示例10: while
if ($isMod) {
$format = "\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\t<td>\n\t\t\t\t{2}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{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</tr>\n\t";
} else {
$format = "\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\t<td>\n\t\t\t\t{2}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{3}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{5}\n\t\t\t</td>\n\t\t</tr>\n\t";
}
$items = "";
while ($user = Fetch($peeps)) {
$bucket = "userMangler";
include "./lib/pluginloader.php";
$lip = $user['lastip'];
$lkb = $user['lastknownbrowser'];
if (isset($_GET['showfull'])) {
$lkb = str_replace("-->", "", str_replace("<!--", " —", $lkb));
}
$cellClass = ($cellClass + 1) % 2;
$items .= format($format, $cellClass, $user['id'], UserLink($user), IP2C($lip), $lip, $lkb);
}
if ($isMod) {
write("\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header1\">\n\t\t\t<th>\n\t\t\t\t" . __("ID") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Name") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t \n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("IP") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Last known browser") . "\n\t\t\t</th>\n\t\t</tr>\n\t\t{0}\n\t</table>\n", $items);
} else {
write("\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header1\">\n\t\t\t<th>\n\t\t\t\t" . __("ID") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Name") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t \n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Last known browser") . "\n\t\t\t</th>\n\t\t</tr>\n\t\t{0}\n\t</table>\n", $items);
}
function IP2C($ip)
{
$q = @mysql_query("select cc from ip2c where ip_from <= inet_aton('" . $ip . "') and ip_to >= inet_aton('" . $ip . "')") or $r['cc'] = "";
if ($q) {
$r = @mysql_fetch_array($q);
}
if ($r['cc']) {
return " <img src=\"img/flags/" . strtolower($r['cc']) . ".png\" alt=\"" . $r['cc'] . "\" title=\"" . $r['cc'] . "\" />";
}
示例11: actionLinkTag
$links[] = actionLinkTag(__("Send new PM"), "sendprivate");
MakeCrumbs(array(actionLink("private") => __("Private messages")), $links);
$rPM = Query("\n\tSELECT \n\t\tp.*,\n\t\tpt.*,\n\t\tu.(_userfields) \n\tFROM \n\t\t{pmsgs} p \n\t\tLEFT JOIN {pmsgs_text} pt ON pt.pid = p.id \n\t\tLEFT JOIN {users} u ON u.id={$onclause}\n\tWHERE \n\t(" . $whereFrom . $staffpms . ") AND !(p.deleted & {1})\n\tORDER BY p.date DESC LIMIT {2u}, {3u}", $user, $deleted, $from, $ppp, -1);
$pagelinks = PageLinks(actionLink("private", "", "{$show}{$userGet}&from="), $ppp, $from, $total);
RenderTemplate('pagelinks', array('pagelinks' => $pagelinks, 'position' => 'top'));
$pms = array();
while ($pm = Fetch($rPM)) {
$pmdata = array();
if ($showWhat == 1 && $pm['userto'] == -1) {
$pmdata['userlink'] = 'Staff';
} else {
if ($pm['drafting']) {
$pmdata['userlink'] = htmlspecialchars($pm['draft_to']);
} else {
$user = getDataPrefix($pm, 'u_');
$pmdata['userlink'] = UserLink($user);
}
}
if (!$pm['msgread']) {
$pmdata['newIcon'] = "<div class=\"statusIcon new\"></div>";
} else {
$pmdata['newIcon'] = '';
}
if ($pm['drafting']) {
$pmdata['link'] = actionLinkTag(htmlspecialchars($pm['title']), 'sendprivate', '', 'pid=' . $pm['id'] . $snoop);
} else {
$pmdata['link'] = actionLinkTag(htmlspecialchars($pm['title']), 'showprivate', $pm['id'], substr($snoop, 1));
}
$pmdata['deleteCheck'] = $snoop ? '' : "<input type=\"checkbox\" name=\"delete[{$pm['id']}]\">";
$pmdata['formattedDate'] = formatdate($pm['date']);
$pms[] = $pmdata;
示例12: Format
for ($i = 1; $i < $n; $i++) {
$pl .= " <a href=\"thread.php?id=" . $thread['id'] . "&from=" . $i * $ppp . "\">" . ($i + 1) . "</a>";
}
$pl .= " … ";
for ($i = $numpages - $n + 1; $i <= $numpages; $i++) {
$pl .= " <a href=\"thread.php?id=" . $thread['id'] . "&from=" . $i * $ppp . "\">" . ($i + 1) . "</a>";
}
}
if ($pl) {
$pl = " <span class=\"smallFonts\">[<a href=\"thread.php?id=" . $thread['id'] . "\">1</a>" . $pl . "]</span>";
}
$lastLink = "";
if ($thread['lastpostid']) {
$lastLink = " <a href=\"thread.php?pid=" . $thread['lastpostid'] . "#" . $thread['lastpostid'] . "\">»</a>";
}
$forumList .= Format("\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td class=\"cell2 threadIcon\">{1}</td>\n\t\t\t<td class=\"threadIcon\" style=\"border-right: 0px none;\">\n\t\t\t\t{2}\n\t\t\t</td>\n\t\t\t<td style=\"border-left: 0px none;\">\n\t\t\t\t{3}\n\t\t\t\t<a href=\"thread.php?id={4}\">\n\t\t\t\t\t{5}\n\t\t\t\t</a>\n\t\t\t\t{6}\n\t\t\t\t{7}\n\t\t\t</td>\n\t\t\t<td class=\"center\">\n\t\t\t\t{8}\n\t\t\t</td>\n\t\t\t<td class=\"center\">\n\t\t\t\t{9}\n\t\t\t</td>\n\t\t\t<td class=\"center\">\n\t\t\t\t{10}\n\t\t\t</td>\n\t\t\t<td class=\"smallFonts center\">\n\t\t\t\t{11}<br />\n\t\t\t\t" . __("by") . " {12} {13}</td>\n\t\t</tr>\n", $cellClass, $NewIcon, $ThreadIcon, $poll, $thread['id'], strip_tags($thread['title']), $pl, $tags, UserLink($starter), $thread['replies'], $thread['views'], cdate($dateformat, $thread['lastpostdate']), UserLink($last), $lastLink);
}
Write("\n\t<table class=\"outline margin width100\">\n\t\t<tr class=\"header1\">\n\t\t\t<th style=\"width: 20px;\"> </th>\n\t\t\t<th style=\"width: 16px;\"> </th>\n\t\t\t<th style=\"width: 60%;\">" . __("Title") . "</th>\n\t\t\t<th>" . __("Started by") . "</th>\n\t\t\t<th>" . __("Replies") . "</th>\n\t\t\t<th>" . __("Views") . "</th>\n\t\t\t<th>" . __("Last post") . "</th>\n\t\t</tr>\n\t\t{0}\n\t</table>\n", $forumList);
} else {
if ($forum['minpowerthread'] > $loguser['powerlevel']) {
Alert(__("You cannot start any threads here."), __("Empty forum"));
} elseif ($loguserid) {
Alert(format(__("Would you like to {0}post something{1}?"), "<a href=\"newthread.php?id=" . $fid . "\">", "</a>"), __("Empty forum"));
} else {
Alert(format(__("{0}Log in{1} so you can post something."), "<a href=\"login.php\">", "</a>"), __("Empty forum"));
}
}
if ($pagelinks) {
Write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
MakeCrumbs(array(__("Main") => "./", $forum['title'] => "forum.php?id=" . $fid), $links);
示例13: UserLink
$r['user'] = UserLink(getDataPrefix($result, "u_"));
$r['formattedDate'] = formatdate($result['lastpostdate']);
$rdata[] = $r;
}
}
} else {
$nres = FetchResult("\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM {posts_text} pt\n\t\t\t\tLEFT JOIN {posts} p ON pt.pid = p.id\n\t\t\t\tLEFT JOIN {threads} t ON t.id = p.thread\n\t\t\tWHERE pt.pid IN ({0c}) AND t.forum IN ({1c}) AND pt.revision = p.currentrevision", $results, $viewableforums);
$search = Query("\n\t\t\tSELECT\n\t\t\t\tpt.text, pt.pid,\n\t\t\t\tp.date,\n\t\t\t\tt.title, t.id,\n\t\t\t\tu.(_userfields)\n\t\t\tFROM {posts_text} pt\n\t\t\t\tLEFT JOIN {posts} p ON pt.pid = p.id\n\t\t\t\tLEFT JOIN {threads} t ON t.id = p.thread\n\t\t\t\tLEFT JOIN {users} u ON u.id = p.user\n\t\t\tWHERE pt.pid IN ({0c}) AND t.forum IN ({1c}) AND pt.revision = p.currentrevision\n\t\t\tORDER BY p.date DESC\n\t\t\tLIMIT {2u},{3u}", $results, $viewableforums, $from, $tpp);
if (NumRows($search)) {
$results = "";
while ($result = Fetch($search)) {
$r = array();
$tags = ParseThreadTags($result['title']);
// $result['text'] = str_replace("<!--", "~#~", str_replace("-->", "~#~", $result['text']));
$r['description'] = MakeSnippet($result['text'], $terms);
$r['user'] = UserLink(getDataPrefix($result, "u_"));
$r['link'] = actionLinkTag($tags[0], "post", $result['pid']);
$r['formattedDate'] = formatdate($result['date']);
$rdata[] = $r;
}
}
}
if ($nres == 0) {
$restext = __('No results found');
} else {
if ($nres == 1) {
$restext = __('1 result found');
} else {
$restext = $nres . __(' results found');
}
}
示例14: array
$ranklist = array();
for ($i = 0; $i < count($ranks); $i++) {
$rdata = array();
$rank = $ranks[$i];
$nextRank = $ranks[$i + 1];
if ($nextRank['num'] == 0) {
$nextRank['num'] = $ranks[$i]['num'] + 1;
}
$members = array();
$inactive = 0;
$total = 0;
foreach ($users as $user) {
if ($user['posts'] >= $rank['num'] && $user['posts'] < $nextRank['num']) {
$total++;
if ($user['lastposttime'] > time() - 2592000) {
$members[] = UserLink($user);
} else {
$inactive++;
}
}
}
if ($inactive) {
$members[] = $inactive . ' inactive';
}
$showRank = HasPermission('admin.viewallranks') || $loguser['posts'] >= $rank['num'] || count($members) > 0;
if ($showRank) {
$rdata['rank'] = getRankHtml($rankset, $rank);
} else {
$rdata['rank'] = '???';
}
if (count($members) == 0) {
示例15: Query
$qThread = "select forum from {threads} where id={0}";
$rThread = Query($qThread, $post['thread']);
$thread = Fetch($rThread);
if (!HasPermission('forum.viewforum', $thread['forum'])) {
die('No.');
}
if (!HasPermission('mod.editposts', $thread['forum'])) {
die('No.');
}
$qRevs = "SELECT\n\t\t\t\trevision, date AS revdate,\n\t\t\t\tru.(_userfields)\n\t\t\tFROM\n\t\t\t\t{posts_text}\n\t\t\t\tLEFT JOIN {users} ru ON ru.id = user\n\t\t\tWHERE pid={0}\n\t\t\tORDER BY revision ASC";
$revs = Query($qRevs, $id);
$reply = __("Show revision:") . "<br />";
while ($revision = Fetch($revs)) {
$reply .= " <a href=\"javascript:void(0)\" onclick=\"showRevision(" . $id . "," . $revision["revision"] . ")\">" . format(__("rev. {0}"), $revision["revision"]) . "</a>";
if ($revision['ru_id']) {
$ru_link = UserLink(getDataPrefix($revision, "ru_"));
$revdetail = " " . format(__("by {0} on {1}"), $ru_link, formatdate($revision['revdate']));
} else {
$revdetail = '';
}
$reply .= $revdetail;
$reply .= "<br />";
}
$hideTricks = " <a href=\"javascript:void(0)\" onclick=\"showRevision(" . $id . "," . $post["currentrevision"] . "); hideTricks(" . $id . ")\">" . __("Back") . "</a>";
$reply .= $hideTricks;
die($reply);
} elseif ($action == "sr") {
$rPost = Query("\n\t\t\tSELECT\n\t\t\t\tp.*,\n\t\t\t\tpt.text, pt.revision, pt.user AS revuser, pt.date AS revdate,\n\t\t\t\tu.(_userfields), u.(rankset,title,picture,posts,postheader,signature,signsep,lastposttime,lastactivity,regdate,globalblock),\n\t\t\t\tru.(_userfields),\n\t\t\t\tdu.(_userfields),\n\t\t\t\tt.forum fid\n\t\t\tFROM\n\t\t\t\t{posts} p\n\t\t\t\tLEFT JOIN {posts_text} pt ON pt.pid = p.id AND pt.revision = {1}\n\t\t\t\tLEFT JOIN {threads} t ON t.id=p.thread\n\t\t\t\tLEFT JOIN {users} u ON u.id = p.user\n\t\t\t\tLEFT JOIN {users} ru ON ru.id=pt.user\n\t\t\t\tLEFT JOIN {users} du ON du.id=p.deletedby\n\t\t\tWHERE p.id={0} AND t.forum IN ({2c})", $id, (int) $_GET['rev'], ForumsWithPermission('forum.viewforum'));
if (NumRows($rPost)) {
$post = Fetch($rPost);
} else {