• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getDataPrefix函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getDataPrefix函数的典型用法代码示例。如果您正苦于以下问题:PHP getDataPrefix函数的具体用法?PHP getDataPrefix怎么用?PHP getDataPrefix使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getDataPrefix函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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']);
}
开发者ID:RoadrunnerWMC,项目名称:Blargboard-1.1,代码行数:11,代码来源:notifications.php


示例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);
    }
}
开发者ID:knytrune,项目名称:ABXD,代码行数:19,代码来源:lists.php


示例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 "";
    }
}
开发者ID:knytrune,项目名称:ABXD,代码行数:20,代码来源:index.php


示例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;
}
开发者ID:Servault,项目名称:Blargboard,代码行数:40,代码来源:onlineusers.php


示例5: __

<?php

//  AcmlmBoard XD - Frequently Asked Questions page
//  Access: all
if (!defined('BLARG')) {
    die;
}
$title = __("FAQ");
$links = array();
if (HasPermission('admin.editsettings')) {
    $links[] = actionLinkTag(__("Edit the FAQ"), "editsettings", '', 'field=faqText');
}
MakeCrumbs(array(actionLink("faq") => __("FAQ")), $links);
makeThemeArrays();
$admin = Fetch(Query("select u.(_userfields) from {users} u where u.primarygroup={0}", Settings::get('rootGroup')));
$admin = userLink(getDataPrefix($admin, 'u_'));
$sexes = array(0 => __("Male"), 1 => __("Female"), 2 => __("N/A"));
$scolors = array(0 => 'color_male', 1 => 'color_female', 2 => 'color_unspec');
$gcolors = array();
$g = Query("SELECT title, color_male, color_female, color_unspec FROM {usergroups} WHERE type=0 ORDER BY rank");
while ($group = Fetch($g)) {
    $gcolors[] = $group;
}
$headers = "";
$colors = "";
foreach ($sexes as $ss) {
    $headers .= format("\n\t<th>\n\t\t{0}\n\t</th>\n", $ss);
}
foreach ($gcolors as $g) {
    $cellClass = ($cellClass + 1) % 2;
    $items = "";
开发者ID:Servault,项目名称:Blargboard,代码行数:31,代码来源:faq.php


示例6: cdate

        $ts = cdate($mydatefmt, $date);
        if ($ts == $today) {
            $ts = 'Today';
        } else {
            if ($ts == $yesterday) {
                $ts = 'Yesterday';
            }
        }
        if ($ts != $lastts) {
            $lastts = $ts;
            echo '
		<tr class="header0">
			<th colspan="2">' . $ts . '</th>
		</tr>';
        }
        $user = getDataPrefix($change, 'u_');
        $userlink = userLink($user);
        $date = formatdate($date);
        $links = actionLinkTagItem('View page', 'wiki', $change['id'], 'rev=' . $change['revision']);
        $changetext = 'Page ' . actionLinkTag(htmlspecialchars(url2title($change['id'])), 'wiki', $change['id']);
        if ($change['revision'] > 1) {
            $changetext .= ' edited by ' . $userlink . ' on ' . $date . ' (revision ' . $change['revision'] . ')';
            $links .= actionLinkTagItem('Diff', 'wikidiff', $change['id'], 'rev=' . $change['revision']);
        } else {
            $changetext .= ' created by ' . $userlink . ' on ' . $date;
        }
        echo '
		<tr class="cell' . $c . '">
			<td>' . $changetext . '</td>
			<td><ul class="pipemenu">' . $links . '</ul></td>
		</tr>';
开发者ID:Servault,项目名称:Blargboard,代码行数:31,代码来源:page_wikichanges.php


示例7: Kill

$rankset = $_GET['id'];
if (!isset($ranksetData[$rankset])) {
    Kill(__("Rankset not found."));
}
$ranksets = array();
foreach ($ranksetNames as $name => $title) {
    if ($name == $rankset) {
        $ranksets[] = $title;
    } else {
        $ranksets[] = actionLinkTag($title, 'ranks', $name);
    }
}
$users = array();
$rUsers = Query("select u.(_userfields), u.(posts,lastposttime) from {users} u order by id asc");
while ($user = Fetch($rUsers)) {
    $users[$user['u_id']] = getDataPrefix($user, "u_");
}
$ranks = $ranksetData[$rankset];
$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']) {
开发者ID:RoadrunnerWMC,项目名称:Blargboard-1.1,代码行数:31,代码来源:ranks.php


示例8: PipeMenu

<?php

//  AcmlmBoard XD - Frequently Asked Questions page
//  Access: all
$title = "FAQ";
$links = new PipeMenu();
if ($loguser["powerlevel"] >= 3) {
    $links->add(new PipeMenuLinkEntry(__("Edit the FAQ"), "editsettings", "faq"));
}
makeLinks($links);
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("FAQ"), "faq"));
makeBreadcrumbs($crumbs);
makeThemeArrays();
$admin = Fetch(Query("select u.(_userfields) from {users} u where id = 1"));
$admin = UserLink(getDataPrefix($admin, "u_"));
$sexes = array(0 => __("Male"), 1 => __("Female"), 2 => __("N/A"));
$powerlevels = array(0 => __("Normal user"), 1 => __("Local moderator"), 2 => __("Full moderator"), 3 => __("Administrator"), 4 => __("Root"));
$headers = "";
$colors = "";
foreach ($sexes as $ss) {
    $headers .= format("\n\t<th>\n\t\t{0}\n\t</th>\n", $ss);
}
foreach ($powerlevels as $pn => $ps) {
    $cellClass = ($cellClass + 1) % 2;
    $items = "";
    foreach ($sexes as $sn => $ss) {
        $items .= format("\n\t<td class=\"center\">\n\t\t<a href=\"javascript:void()\"><span class=\"nc{0}{1}\" style=\"font-weight: bold;\">\n\t\t\t{2}\n\t\t</span></a>\n\t</td>\n", $sn, $pn, $ps);
    }
    $colors .= format("\n<tr class=\"cell{0}\">\n\t{1}\n</tr>\n", $cellClass, $items);
}
开发者ID:RoadrunnerWMC,项目名称:ABXD-plugins,代码行数:31,代码来源:page_faq.php


示例9: WriteForumEditContents

function WriteForumEditContents($fid)
{
    global $loguser;
    //Get all categories.
    $rCats = Query("SELECT * FROM {categories} ORDER BY corder, id");
    $cats = array();
    while ($cat = Fetch($rCats)) {
        $cats[$cat['id']] = $cat;
    }
    $rFora = Query("SELECT * FROM {forums} ORDER BY forder, id");
    $fora = array();
    while ($forum = Fetch($rFora)) {
        $fora[$forum['id']] = $forum;
    }
    if (count($cats) == 0) {
        $cats[0] = __("No categories");
    }
    if ($fid != -1) {
        $rForum = Query("SELECT * FROM {forums} WHERE id={0}", $fid);
        if (!NumRows($rForum)) {
            Kill(__("Forum not found."));
        }
        $forum = Fetch($rForum);
        $title = htmlspecialchars($forum['title']);
        $description = htmlspecialchars($forum['description']);
        $catselect = MakeCatSelect('cat', $cats, $fora, $forum['catid'], $forum['id']);
        $minpower = PowerSelect('minpower', $forum['minpower']);
        $minpowerthread = PowerSelect("minpowerthread", $forum['minpowerthread']);
        $minpowerreply = PowerSelect('minpowerreply', $forum['minpowerreply']);
        $forder = $forum['forder'];
        $func = "changeForumInfo";
        $button = __("Save");
        $boxtitle = __("Edit Forum");
        $delbutton = "\n\t\t\t<button onclick='showDeleteForum(); return false;'>\n\t\t\t\t" . __("Delete") . "\n\t\t\t</button>";
        $localmods = "";
        $rMods = query("SELECT u.(_userfields)\n\t\t\t\t\t\tFROM {forummods} m\n\t\t\t\t\t\tLEFT JOIN {users} u ON u.id = m.user\n\t\t\t\t\t\tWHERE m.forum={0}\n\t\t\t\t\t\tORDER BY m.user", $fid);
        $addedMods = array();
        if (!numRows($rMods)) {
            $localmods .= "(No local moderators assigned to this forum)<br /><br />";
        } else {
            $localmods .= "<ul>";
            while ($mod = fetch($rMods)) {
                $mod = getDataPrefix($mod, "u_");
                $localmods .= "<li>" . UserLink($mod);
                $mid = $mod["id"];
                $addedMods[$mid] = 1;
                $localmods .= " <sup><a href=\"\" onclick=\"deleteMod({$mid}); return false;\">&#x2718;</a></li>";
            }
            $localmods .= "</ul>";
        }
        $rMods = query("SELECT u.(_userfields)\n\t\t\t\t\t\tFROM {users} u\n\t\t\t\t\t\tWHERE u.powerlevel = 1\n\t\t\t\t\t\tORDER BY u.id");
        $canAddMods = false;
        $addmod = "Add a mod: ";
        $addmod .= "<select name=\"addmod\" id=\"addmod\">";
        while ($mod = fetch($rMods)) {
            $mod = getDataPrefix($mod, "u_");
            if (isset($addedMods[$mod["id"]])) {
                continue;
            }
            $canAddMods = true;
            $mid = $mod["id"];
            $mname = $mod["displayname"];
            if (!$mname) {
                $mname = $mod["name"];
            }
            $addmod .= "<option value=\"{$mid}\">{$mname} ({$mid})</option>";
        }
        $addmod .= "</select>";
        $addmod .= "<button type=\"button\" onclick=\"addMod(); return false;\">Add</button>";
        if (!$canAddMods) {
            $addmod = "<br>No moderators available for adding.<br>To add a mod, set his powerlevel to Local Mod first.";
        }
        $localmods .= $addmod;
    } else {
        $title = __("New Forum");
        $description = __("Description goes here. <strong>HTML allowed.</strong>");
        $catselect = MakeCatSelect('cat', $cats, $fora, 1, -1);
        $minpower = PowerSelect('minpower', 0);
        $minpowerthread = PowerSelect("minpowerthread", 0);
        $minpowerreply = PowerSelect('minpowerreply', 0);
        $forder = 0;
        $func = "addForum";
        $button = __("Add");
        $boxtitle = __("New Forum");
        $delbutton = "";
        $localmods = "(Create the forum before managing mods)";
        $privusers = '<small>(create the forum before adding users here)</small>';
    }
    echo "\n\t<form method=\"post\" id=\"forumform\" action=\"" . actionLink("editfora") . "\">\n\t<input type=\"hidden\" name=\"key\" value=\"" . $loguser['token'] . "\">\n\t<input type=\"hidden\" name=\"id\" value=\"{$fid}\">\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header1\">\n\t\t\t<th colspan=\"2\">\n\t\t\t\t{$boxtitle}\n\t\t\t</th>\n\t\t</tr>\n\t\t<tr class=\"cell1\">\n\t\t\t<td style=\"width: 25%;\">\n\t\t\t\t" . __("Title") . "\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input type=\"text\" style=\"width: 98%;\" name=\"title\" value=\"{$title}\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"cell0\">\n\n\t\t\t<td>\n\t\t\t\t" . __("Description") . "\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input type=\"text\" style=\"width: 98%;\" name=\"description\" value=\"{$description}\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"cell1\">\n\t\t\t<td>\n\t\t\t\t" . __("Parent") . "\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{$catselect}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"cell0\">\n\t\t\t<td>\n\t\t\t\t" . __("Listing order") . "\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input type=\"text\" size=\"2\" name=\"forder\" value=\"{$forder}\" />\n\t\t\t\t<img src=\"" . resourceLink("img/icons/icon5.png") . "\" title=\"" . __("Everything is sorted by listing order first, then by ID. If everything has its listing order set to 0, they will therefore be sorted by ID only.") . "\" alt=\"[?]\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"cell1\">\n\t\t\t<td>\n\t\t\t\t" . __("Powerlevel required") . "\n\t\t\t</td>\n\t\t\t<td>\n\n\t\t\t\t{$minpower}\n\t\t\t\t" . __("to view") . "\n\t\t\t\t<br />\n\t\t\t\t{$minpowerthread}\n\t\t\t\t" . __("to post threads") . "\n\t\t\t\t<br />\n\t\t\t\t{$minpowerreply}\n\t\t\t\t" . __("to reply") . "\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"cell0\">\n\t\t\t<td>\n\t\t\t\t" . __("Local moderators") . "\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{$localmods}\n\t\t\t</td>\n\t\t</tr>\n\n\t\t<tr class=\"cell2\">\n\t\t\t<td>\n\t\t\t\t&nbsp;\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<button onclick=\"{$func}(); return false;\">\n\t\t\t\t\t{$button}\n\t\t\t\t</button>\n\t\t\t\t{$delbutton}\n\t\t\t</td>\n\t\t</tr>\n\t</table></form>\n\n\t<form method=\"post\" id=\"deleteform\" action=\"" . actionLink("editfora") . "\">\n\t<input type=\"hidden\" name=\"key\" value=\"" . $loguser['token'] . "\">\n\t<input type=\"hidden\" name=\"id\" value=\"{$fid}\">\n\t<div id=\"deleteforum\" style=\"display:none\">\n\t\t<table class=\"outline margin\">\n\t\t\t<tr class=\"header1\">\n\n\t\t\t\t<th>\n\t\t\t\t\t" . __("Delete forum") . "\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Instead of deleting a forum, you might want to consider archiving it: Change its name or description to say so, and raise the minimum powerlevel to reply and create threads so it's effectively closed.") . "<br><br>\n\t\t\t\t\t" . __("If you still want to delete it, click below:") . "<br>\n\t\t\t\t\t<button onclick=\"deleteForum('delete'); return false;\">\n\t\t\t\t\t\t" . __("Delete forum") . "\n\t\t\t\t\t</button>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n\t</form>";
    //	, $title, $description, $catselect, $minpower, $minpowerthread, $minpowerreply, $fid, $forder, $loguser['token'], $func, $button, $boxtitle, $delbutton);
}
开发者ID:knytrune,项目名称:ABXD,代码行数:91,代码来源:editfora.php


示例10: Fetch

if (NumRows($rPost)) {
    $post = Fetch($rPost);
} else {
    die(format(__("Unknown post ID #{0}."), $id) . " " . $hideTricks);
}
$qThread = "select forum from {threads} where id={0}";
$rThread = Query($qThread, $post['thread']);
$thread = Fetch($rThread);
$qForum = "select minpower from {forums} where id={0}";
$rForum = Query($qForum, $thread['forum']);
$forum = Fetch($rForum);
if ($forum['minpower'] > $loguser['powerlevel']) {
    die(__("No.") . " " . $hideTricks);
}
$qRevs = "SELECT\n\t\t\trevision, date AS revdate,\n\t\t\tru.(_userfields)\n\t\tFROM\n\t\t\t{posts_text}\n\t\t\tLEFT JOIN {users} ru ON ru.id = user\n\t\tWHERE pid={0}\n\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;
echo $reply;
开发者ID:knytrune,项目名称:ABXD,代码行数:31,代码来源:getrevisionlist.php


示例11: makePost

function makePost($post, $type, $params = array())
{
    global $loguser, $loguserid, $usergroups, $isBot, $blocklayouts;
    $poster = getDataPrefix($post, 'u_');
    $post['userlink'] = UserLink($poster);
    LoadBlockLayouts();
    $pltype = Settings::get('postLayoutType');
    $isBlocked = $poster['globalblock'] || $loguser['blocklayouts'] || $post['options'] & 1 || isset($blocklayouts[$poster['id']]);
    $post['type'] = $type;
    $post['formattedDate'] = formatdate($post['date']);
    if (!HasPermission('admin.viewips')) {
        $post['ip'] = '';
    } else {
        $post['ip'] = htmlspecialchars($post['ip']);
    }
    // TODO IP formatting?
    if ($post['deleted'] && $type == POST_NORMAL) {
        $post['deluserlink'] = UserLink(getDataPrefix($post, 'du_'));
        $post['delreason'] = htmlspecialchars($post['reason']);
        $links = array();
        if (HasPermission('mod.deleteposts', $params['fid'])) {
            $links['undelete'] = actionLinkTag(__("Undelete"), "editpost", $post['id'], "delete=2&key=" . $loguser['token']);
            $links['view'] = "<a href=\"#\" onclick=\"replacePost(" . $post['id'] . ",true); return false;\">" . __("View") . "</a>";
        }
        $post['links'] = $links;
        RenderTemplate('postbox_deleted', array('post' => $post));
        return;
    }
    $links = array();
    if ($type != POST_SAMPLE) {
        $forum = $params['fid'];
        $thread = $params['tid'];
        $notclosed = !$post['closed'] || HasPermission('mod.closethreads', $forum);
        $extraLinks = array();
        if (!$isBot) {
            if ($type == POST_DELETED_SNOOP) {
                if ($notclosed && HasPermission('mod.deleteposts', $forum)) {
                    $links['undelete'] = actionLinkTag(__("Undelete"), "editpost", $post['id'], "delete=2&key=" . $loguser['token']);
                }
                $links['close'] = "<a href=\"#\" onclick=\"replacePost(" . $post['id'] . ",false); return false;\">" . __("Close") . "</a>";
            } else {
                if ($type == POST_NORMAL) {
                    if ($notclosed) {
                        if ($loguserid && HasPermission('forum.postreplies', $forum) && !$params['noreplylinks']) {
                            $links['quote'] = actionLinkTag(__("Quote"), "newreply", $thread, "quote=" . $post['id']);
                        }
                        $editrights = 0;
                        if ($poster['id'] == $loguserid && HasPermission('user.editownposts') || HasPermission('mod.editposts', $forum)) {
                            $links['edit'] = actionLinkTag(__("Edit"), "editpost", $post['id']);
                            $editrights++;
                        }
                        if ($poster['id'] == $loguserid && HasPermission('user.deleteownposts') || HasPermission('mod.deleteposts', $forum)) {
                            if ($post['id'] != $post['firstpostid']) {
                                $link = htmlspecialchars(actionLink('editpost', $post['id'], 'delete=1&key=' . $loguser['token']));
                                $onclick = HasPermission('mod.deleteposts', $forum) ? " onclick=\"deletePost(this);return false;\"" : ' onclick="if(!confirm(\'Really delete this post?\'))return false;"';
                                $links['delete'] = "<a href=\"{$link}\"{$onclick}>" . __('Delete') . "</a>";
                            }
                            $editrights++;
                        }
                        if ($editrights < 2 && HasPermission('user.reportposts')) {
                            $links['report'] = actionLinkTag(__('Report'), 'reportpost', $post['id']);
                        }
                    }
                    // plugins should add to $extraLinks
                    $bucket = "topbar";
                    include __DIR__ . "/pluginloader.php";
                }
            }
            $links['extra'] = $extraLinks;
        }
        //Threadlinks for listpost.php
        if ($params['threadlink']) {
            $thread = array();
            $thread['id'] = $post['thread'];
            $thread['title'] = $post['threadname'];
            $thread['forum'] = $post['fid'];
            $post['threadlink'] = makeThreadLink($thread);
        } else {
            $post['threadlink'] = '';
        }
        //Revisions
        if ($post['revision']) {
            $ru_link = UserLink(getDataPrefix($post, "ru_"));
            $revdetail = ' ' . format(__('by {0} on {1}'), $ru_link, formatdate($post['revdate']));
            if (HasPermission('mod.editposts', $forum)) {
                $post['revdetail'] = "<a href=\"javascript:void(0);\" onclick=\"showRevisions(" . $post['id'] . ")\">" . Format(__('rev. {0}'), $post['revision']) . "</a>" . $revdetail;
            } else {
                $post['revdetail'] = Format(__('rev. {0}'), $post['revision']) . $revdetail;
            }
        }
        //</revisions>
    }
    $post['links'] = $links;
    // POST SIDEBAR
    $sidebar = array();
    // quit abusing custom syndromes you unoriginal fuckers
    $poster['title'] = preg_replace('@Affected by \'?.*?Syndrome\'?@si', '', $poster['title']);
    $sidebar['rank'] = GetRank($poster['rankset'], $poster['posts']);
    if ($poster['title']) {
        $sidebar['title'] = strip_tags(CleanUpPost($poster['title'], '', true), '<b><strong><i><em><span><s><del><img><a><br/><br><small>');
//.........这里部分代码省略.........
开发者ID:Servault,项目名称:Blargboard,代码行数:101,代码来源:post.php


示例12: array

<?php 
$c = 1;
$ulcache = array();
foreach ($passmatches as $uid => $match) {
    if (!$ulcache[$uid]) {
        $userdata = Fetch(Query("SELECT u.(_userfields) FROM {users} u WHERE u.id={0}", $uid));
        $userdata = getDataPrefix($userdata, 'u_');
        $ulcache[$uid] = $userdata;
    }
    $ul1 = userLink($ulcache[$uid]);
    $date = formatdate($match['m_date']);
    $users = explode(',', $match['m_matches']);
    $userlist = '';
    foreach ($users as $u) {
        if (!$ulcache[$u]) {
            $userdata = Fetch(Query("SELECT u.(_userfields) FROM {users} u WHERE u.id={0}", $u));
            $userdata = getDataPrefix($userdata, 'u_');
            $ulcache[$u] = $userdata;
        }
        $userlist .= userLink($ulcache[$u]) . ', ';
    }
    $userlist = substr($userlist, 0, -2);
    echo '
		<tr class="cell' . $c . '">
			<td class="center">' . $date . '</td>
			<td>' . $ul1 . ', ' . $userlist . '</td>
		</tr>';
    $c = $c == 1 ? 2 : 1;
}
?>
	</table>
开发者ID:RoadrunnerWMC,项目名称:Blargboard-1.1,代码行数:31,代码来源:reregs.php


示例13: Query

$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("&#x2718;", $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");
}
//print "lastCID: ".$lastCID;
if ($loguserid) {
开发者ID:knytrune,项目名称:ABXD,代码行数:31,代码来源:usercomments.php


示例14: Query

    $from = (int) $_GET['from'];
} else {
    $from = 0;
}
$tpp = 5;
print "<h2 style='text-align:center;'>Latest News</h2>";
$rThreads = Query("\tSELECT\n\t\t\t\t\t\tt.id, t.title, t.closed, t.replies, t.lastpostid,\n\t\t\t\t\t\tp.date, p.options,\n\t\t\t\t\t\tpt.text,\n\t\t\t\t\t\tsu.(_userfields),\n\t\t\t\t\t\tlu.(_userfields)\n\t\t\t\t\tFROM\n\t\t\t\t\t\t{threads} t\n\t\t\t\t\t\tLEFT JOIN {posts} p ON p.id=t.firstpostid\n\t\t\t\t\t\tLEFT JOIN {posts_text} pt ON pt.pid = p.id AND pt.revision = p.currentrevision\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\tWHERE forum={0}\n\t\t\t\t\tORDER BY sticky DESC, date DESC LIMIT {1u}, {2u}", $fid, $from, $tpp);
$numonpage = NumRows($rThreads);
$pagelinks = PageLinks(actionLink("blog", "", "from="), $tpp, $from, $total);
if ($pagelinks && $_GET["from"]) {
    Write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
$haveStickies = 0;
while ($thread = Fetch($rThreads)) {
    $starter = getDataPrefix($thread, "su_");
    $last = getDataPrefix($thread, "lu_");
    $tags = ParseThreadTags($thread['title']);
    if ($thread['sticky'] && $haveStickies == 0) {
        $haveStickies = 1;
    }
    $lastLink = "";
    if ($thread['lastpostid']) {
        $lastLink = " " . actionLinkTag("&raquo;", "post", $thread['lastpostid']);
    }
    if ($thread['replies'] == 0) {
        $lastLink = "";
    }
    $subtitle = strip_tags($thread['subtitle']);
    if ($subtitle != "") {
        $subtitle = '<br>' . $subtitle;
    }
开发者ID:RoadrunnerWMC,项目名称:ABXD-plugins,代码行数:31,代码来源:page_blog.php


示例15: getdate

$now = getdate(time());
$year = $now['year'];
$month = $now['mon'];
$day = $now['mday'];
if ((int) $_GET['month']) {
    $month = (int) $_GET['month'];
    $day = 0;
}
$d = getdate(mktime(0, 0, 0, $month, 1, $year));
$i = 1 - $d['wday'];
$d = getdate(mktime(0, 0, 0, $month + 1, 0, $year));
$max = $d['mday'];
$users = Query("select u.(_userfields), u.birthday as u_birthday from {users} u where birthday != 0 order by name");
$cells = array();
while ($user = Fetch($users)) {
    $user = getDataPrefix($user, "u_");
    $d = getdate($user['birthday']);
    if ($d['mon'] == $month) {
        $dd = $d['mday'];
        $age = $year - $d['year'];
        $cells[$dd] .= "<br />&bull; " . format(__("{0}'s birthday ({1})"), Userlink($user), $age) . "\n";
    }
}
if ($year == 2012 && $month == 12) {
    $cells[21] .= '<br>&bull; <span style="color:red;font-weight:bold;text-decoration:blink;">THE END OF THE WORLD</span>';
    $cells[22] .= '<br>&bull; Laugh at those who actually believed it';
}
$cellClass = 0;
while ($i <= $max) {
    $grid .= format("\n\t<tr>\n");
    for ($dn = 0; $dn <= 6; $dn++) {
开发者ID:Servault,项目名称:Blargboard,代码行数:31,代码来源:page_calendar.php


示例16: makeAnncBar

function makeAnncBar()
{
    global $loguserid;
    $anncforum = Settings::get('anncForum');
    if ($anncforum > 0) {
        $annc = Query("\tSELECT \n\t\t\t\t\t\t\tt.id, t.title, t.icon, t.poll, t.forum,\n\t\t\t\t\t\t\tt.date anncdate,\n\t\t\t\t\t\t\t" . ($loguserid ? "tr.date readdate," : '') . "\n\t\t\t\t\t\t\tu.(_userfields)\n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t{threads} t \n\t\t\t\t\t\t\t" . ($loguserid ? "LEFT JOIN {threadsread} tr ON tr.thread=t.id AND tr.id={1}" : '') . "\n\t\t\t\t\t\t\tLEFT JOIN {users} u ON u.id=t.user\n\t\t\t\t\t\tWHERE forum={0}\n\t\t\t\t\t\tORDER BY anncdate DESC LIMIT 1", $anncforum, $loguserid);
        if ($annc && NumRows($annc)) {
            $annc = Fetch($annc);
            $adata = array();
            $adata['new'] = '';
            if (!$loguserid && $annc['anncdate'] > time() - 900 || $loguserid && $annc['anncdate'] > $annc['readdate']) {
                $adata['new'] = "<div class=\"statusIcon new\"></div>";
            }
            $adata['poll'] = $annc['poll'] ? "<img src=\"" . resourceLink('img/poll.png') . "\" alt=\"Poll\"/> " : '';
            $adata['link'] = MakeThreadLink($annc);
            $user = getDataPrefix($annc, 'u_');
            $adata['user'] = UserLink($user);
            $adata['date'] = formatdate($annc['anncdate']);
            RenderTemplate('anncbar', array('annc' => $adata));
        }
    }
}
开发者ID:Servault,项目名称:Blargboard,代码行数:22,代码来源:layout.php


示例17: __

$links[] = $showWhat == 2 ? __("Show drafts") : actionLinkTag(__("Show drafts"), "private", "", "show=2" . $userGet);
$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']);
开发者ID:RoadrunnerWMC,项目名称:Blargboard-1.1,代码行数:31,代码来源:private.php


示例18: Query

$realLen = $cpp;
if ($realFrom < 0) {
    $realLen += $realFrom;
    $realFrom = 0;
}
$rComments = Query("SELECT\n\t\tu.(_userfields),\n\t\tuc.id, uc.cid, uc.text, uc.date\n\t\tFROM {usercomments} uc\n\t\tLEFT JOIN {users} u ON u.id = uc.cid\n\t\tWHERE uc.uid={0}\n\t\tORDER BY uc.date ASC LIMIT {1u},{2u}", $id, $realFrom, $realLen);
$pagelinks = PageLinksInverted(actionLink("profile", $id, "from=", $user['name']), $cpp, $from, $total);
$comments = array();
while ($comment = Fetch($rComments)) {
    $cmt = array();
    $deleteLink = '';
    if ($canDeleteComments || $comment['cid'] == $loguserid && HasPermission('user.deleteownusercomments')) {
        $deleteLink = "<small style=\"float: right; margin: 0px 4px;\">" . actionLinkTag("&#x2718;", "profile", $id, "action=delete&cid=" . $comment['id'] . "&token={$loguser['token']}") . "</small>";
    }
    $cmt['deleteLink'] = $deleteLink;
    $cmt['userlink'] = UserLink(getDataPrefix($comment, 'u_'));
    $cmt['formattedDate'] = relativedate($comment['date']);
    $cmt['text'] = CleanUpPost($comment['text']);
    $comments[] = $cmt;
}
$commentField = '';
if ($canComment) {
    $commentField = "\n\t\t<form name=\"commentform\" method=\"post\" action=\"" . htmlentities(actionLink("profile")) . "\">\n\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$id}\">\n\t\t\t<input type=\"text\" name=\"text\" style=\&quo 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getDatabase函数代码示例发布时间:2022-05-15
下一篇:
PHP getDataFromSQL函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap