当前位置: 首页>>代码示例>>PHP>>正文


PHP AssertForbidden函数代码示例

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


在下文中一共展示了AssertForbidden函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: AssertForbidden

<?php

include "lib/common.php";
AssertForbidden("optimize");
$rStats = Query("show table status");
while ($stat = Fetch($rStats)) {
    $tables[$stat['Name']] = $stat;
}
$tablelist = "";
$total = 0;
foreach ($tables as $table) {
    $cellClass = ($cellClass + 1) % 2;
    $overhead = $table['Data_free'];
    $total += $overhead;
    $status = __("OK");
    if ($overhead > 0) {
        Query("OPTIMIZE TABLE `" . $table['Name'] . "`");
        $status = "<strong>" . __("Optimized") . "</strong>";
    }
    $tablelist .= format("\n\t<tr class=\"cell{0}\">\n\t\t<td class=\"cell2\">{1}</td>\n\t\t<td>\n\t\t\t{2}\n\t\t</td>\n\t\t<td>\n\t\t\t{3}\n\t\t</td>\n\t\t<td>\n\t\t\t{4}\n\t\t</td>\n\t</tr>\n", $cellClass, $table['Name'], $table['Rows'], $overhead, $status);
}
write("\n<table class=\"outline margin\">\n\t<tr class=\"header0\">\n\t\t<th colspan=\"7\">\n\t\t\t" . __("Table Status") . "\n\t\t</th>\n\t</tr>\n\t<tr class=\"header1\">\n\t\t<th>\n\t\t\t" . __("Name") . "\n\t\t</th>\n\t\t<th>\n\t\t\t" . __("Rows") . "\n\t\t</th>\n\t\t<th>\n\t\t\t" . __("Overhead") . "\n\t\t</th>\n\t\t<th>\n\t\t\t" . __("Final Status") . "\n\t\t</th>\n\t</tr>\n\t{0}\n\t<tr class=\"header0\">\n\t\t<th colspan=\"7\" style=\"font-size: 130%;\">\n\t\t\t" . __("Excess trimmed: {1} bytes") . "\n\t\t</th>\n\t</tr>\n</table>\n\n", $tablelist, $total);
开发者ID:RoadrunnerWMC,项目名称:ABXD-legacy,代码行数:22,代码来源:optimize.php

示例2: __

<?php

$title = __("Mood avatars");
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Mood avatars"), "editavatars"));
makeBreadcrumbs($crumbs);
AssertForbidden("editMoods");
if (!$loguserid) {
    Kill(__("You must be logged in to edit your avatars."));
}
if (isset($_POST['action'])) {
    $mid = (int) $_POST['mid'];
    if ($_POST['action'] == __("Rename")) {
        Query("update {moodavatars} set name={0} where mid={1} and uid={2}", $_POST['name'], $mid, $loguserid);
        Alert(__("Avatar renamed."), __("Okay"));
    } else {
        if ($_POST['action'] == __("Delete")) {
            Query("delete from {moodavatars} where uid={0} and mid={1}", $loguserid, $mid);
            Query("update {posts} set mood=0 where user={0} and mood={1}", $loguserid, $mid);
            if (file_exists("{$dataDir}avatars/" . $loguserid . "_" . $mid)) {
                unlink("{$dataDir}avatars/" . $loguserid . "_" . $mid);
            }
            Alert(__("Avatar deleted."), __("Okay"));
        } else {
            if ($_POST['action'] == __("Add")) {
                $highest = FetchResult("select mid from {moodavatars} where uid={0} order by mid desc limit 1", $loguserid);
                if ($highest < 1) {
                    $highest = 1;
                }
                $mid = $highest + 1;
                //Begin copypasta from edituser/editprofile_avatar...
开发者ID:knytrune,项目名称:ABXD,代码行数:31,代码来源:editavatars.php

示例3: getCategory

    $cat = getCategory($_GET["cat"]);
    if (!is_numeric($_GET["cat"])) {
        Kill('Invalid category');
    }
    $cat = getCategory($_GET["cat"]);
    $crumbs = new PipeMenu();
    $crumbs->add(new PipeMenuLinkEntry(__("Uploader"), "uploader"));
    $crumbs->add(new PipeMenuLinkEntry($cat["name"], "uploaderlist", "", "cat=" . $cat["id"]));
    $crumbs->add(new PipeMenuTextEntry(__("Upload file")));
    makeBreadcrumbs($crumbs);
    if ($loguserid && IsAllowed("useUploader")) {
        print format("\n\t\t<script type=\"text/javascript\">\n\t\t\twindow.addEventListener(\"load\", function() { hookUploadCheck(\"newfile\", 1, {1}) }, false);\n\t\t</script>\n\t\t<form action=\"" . actionLink("uploader") . "\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t<input type='hidden' name='cat' value='{$_GET["cat"]}'>\n\t\t\t<table class=\"outline margin\">\n\t\t\t\t<tr class=\"header0\">\n\t\t\t\t\t<th colspan=\"4\">" . __("Upload") . "</th>\n\t\t\t\t</tr>\n\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t<td>File</td><td>\n\t\t\t\t\t\t<input type=\"file\" id=\"newfile\" name=\"newfile\" style=\"width: 80%;\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class=\"cell1\">\n\t\t\t\t\t<td>Description</td><td>\n\t\t\t\t\t\t<input type=\"text\" name=\"description\" style=\"width: 80%;\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t<td></td><td>\n\t\t\t\t\t\t<input type=\"submit\" id=\"submit\" name=\"action\" value=\"" . __("Upload") . "\" disabled=\"disabled\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class=\"cell1 smallFonts\">\n\t\t\t\t\t<td colspan=\"3\">\n\t\t\t\t\t\t" . __("The maximum upload size is {0} per file. You can upload the following types: {2}.") . "\n\t\t\t\t\t\t<div id=\"sizeWarning\" style=\"display: none; font-weight: bold\">" . __("File is too large.") . "</div>\n\t\t\t\t\t\t<div id=\"typeWarning\" style=\"display: none; font-weight: bold\">" . __("File is not an allowed type.") . "</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</form>\n\t\t", BytesToSize($maxSizeMult), $maxSizeMult, Settings::pluginGet('uploaderWhitelist'));
    }
} else {
    if ($_GET['action'] == __("Upload")) {
        AssertForbidden("useUploader");
        if ($loguserid) {
            $cat = getCategory($_POST["cat"]);
            $targetdir = $rootdir;
            $quot = $quota;
            $privateFlag = 0;
            if ($_POST['cat'] == -1) {
                $quot = $pQuota;
                $targetdir = $rootdir . "/" . $loguserid;
                $privateFlag = 1;
            }
            $totalsize = foldersize($targetdir);
            mkdir($targetdir);
            $files = scandir($targetdir);
            if (in_array($_FILES['newfile']['name'], $files)) {
                Alert(format(__("The file \"{0}\" already exists. Please delete the old copy before uploading a new one."), $_FILES['newfile']['name']));
开发者ID:RoadrunnerWMC,项目名称:ABXD-plugins,代码行数:31,代码来源:page_uploader.php

示例4: __

<?php

//  AcmlmBoard XD - Member list page
//  Access: all
include "lib/common.php";
$title = __("Member list");
AssertForbidden("viewMembers");
$tpp = $loguser['threadsperpage'];
if ($tpp < 1) {
    $tpp = 50;
}
if (isset($_GET['from'])) {
    $from = (int) $_GET['from'];
} else {
    $from = 0;
}
if (isset($dir)) {
    unset($dir);
}
if (isset($_GET['dir'])) {
    $dir = $_GET['dir'];
    if ($dir != "asc" && $dir != "desc") {
        unset($dir);
    }
}
$sort = $_GET['sort'];
$sex = $_GET['sex'];
if (isset($_GET['pow']) && $_GET['pow'] != "") {
    $pow = (int) $_GET['pow'];
}
if (isset($_GET['letter']) && is_string($_GET['letter'])) {
开发者ID:RoadrunnerWMC,项目名称:ABXD-legacy,代码行数:31,代码来源:memberlist.php

示例5: Kill

    }
} else {
    Kill(__("Unknown forum ID."));
}
setUrlName("newreply", $tid, $thread["title"]);
setUrlName("editthread", $tid, $thread["title"]);
$threadtags = ParseThreadTags($thread['title']);
$title = $threadtags[0];
Query("update {threads} set views=views+1 where id={0} limit 1", $tid);
if (isset($_GET['from'])) {
    $fromstring = "from=" . (int) $_GET["from"];
} else {
    $fromstring = "";
}
if (isset($_GET['vote'])) {
    AssertForbidden("vote");
    if (!$loguserid) {
        Kill(__("You can't vote without logging in."));
    }
    if ($thread['closed']) {
        Kill(__("Poll's closed!"));
    }
    if (!$thread['poll']) {
        Kill(__("This is not a poll."));
    }
    if ($loguser["token"] != $_GET['token']) {
        Kill(__("Invalid token."));
    }
    $vote = (int) $_GET['vote'];
    $doublevote = FetchResult("select doublevote from {poll} where id={0}", $thread['poll']);
    $existing = FetchResult("select count(*) from {pollvotes} where poll={0} and choiceid={1} and user={2}", $thread['poll'], $vote, $loguserid);
开发者ID:knytrune,项目名称:ABXD,代码行数:31,代码来源:thread.php

示例6: __

<?php

//  AcmlmBoard XD - Board Settings editing page
//  Access: administrators
include "lib/common.php";
$title = __("Edit settings");
AssertForbidden("editSettings");
if ($loguser['powerlevel'] < 3) {
    Kill(__("You must be an administrator to edit the board settings."));
}
$key = hash('sha256', "{$loguserid},{$loguser['pss']},{$salt}");
if (isset($_POST['action']) && $key != $_POST['key']) {
    Kill(__("No."));
}
if ($_POST['action'] == __("Edit")) {
    if ((double) $_POST['uploaderCap'] <= 0) {
        $_POST['uploaderCap'] = "0.25";
    }
    if ((double) $_POST['personalCap'] <= 0) {
        $_POST['personalCap'] = "0.25";
    }
    if ((double) ($_POST['uploaderMaxFileSize'] * 1024 * 1024) > IniValToBytes(ini_get("upload_max_filesize")) || (double) $_POST['uploaderMaxFileSize'] <= 0) {
        $_POST['uploaderMaxFileSize'] = floor(IniValToBytes(ini_get("upload_max_filesize")) / 1024 / 1024);
    }
    $hax = fopen("lib/settings.php", "w");
    fputs($hax, "<?php\n");
    fputs($hax, "//Generated and parsed by the Board Settings admin panel.\n");
    fputs($hax, "\n");
    fputs($hax, "//Settings\n");
    fputs($hax, "\$boardname = " . var_export($_POST['boardname'], true) . ";\n");
    fputs($hax, "\$logoalt = " . var_export($_POST['logoalt'], true) . ";\n");
开发者ID:RoadrunnerWMC,项目名称:ABXD-legacy,代码行数:31,代码来源:editsettings.php

示例7: __

<?php

//  AcmlmBoard XD - The Records
//  Access: all
include "lib/common.php";
$title = __("Records");
AssertForbidden("viewRecords");
$df = "l, F jS Y, G:i:s";
write("\n<table class=\"outline margin width75\">\n\t<tr class=\"header0\">\n\t\t<th colspan=\"2\">\n\t\t\t" . __("Highest Numbers") . "\n\t\t</th>\n\t</tr>\n\t<tr class=\"cell0\">\n\t\t<td>\n\t\t\t" . __("Highest number of posts in 24 hours") . "\n\t\t</td>\n\t\t<td>\n\t\t\t" . __("<strong>{0}</strong>, on {1} GMT") . "\n\t\t</td>\n\t</tr>\n\t<tr class=\"cell1\">\n\t\t<td>\n\t\t\t" . __("Highest number of posts in one hour") . "\n\t\t</td>\n\t\t<td>\n\t\t\t" . __("<strong>{2}</strong>, on {3} GMT") . "\n\t\t</td>\n\t</tr>\n\t<tr class=\"cell0\">\n\t\t<td>\n\t\t\t" . __("Highest number of users in five minutes") . "\n\t\t</td>\n\t\t<td>\n\t\t\t" . __("<strong>{4}</strong>, on {5} GMT") . "\n\t\t</td>\n\t</tr>\n\t<tr class=\"cell1\">\n\t\t<td></td>\n\t\t<td>\n\t\t\t{6}\n\t\t</td>\n\t</tr>\n</table>\n", $misc['maxpostsday'], gmdate($df, $misc['maxpostsdaydate']), $misc['maxpostshour'], gmdate($df, $misc['maxpostshourdate']), $misc['maxusers'], gmdate($df, $misc['maxusersdate']), $misc['maxuserstext']);
$rStats = Query("show table status");
while ($stat = Fetch($rStats)) {
    $tables[$stat['Name']] = $stat;
}
$tablelist = "";
$rows = $avg = $datlen = $idx = $datfree = 0;
foreach ($tables as $table) {
    $cellClass = ($cellClass + 1) % 2;
    $tablelist .= format("\n\t<tr class=\"cell{0}\">\n\t\t<td class=\"cell2\">{1}</td>\n\t\t<td>\n\t\t\t{2}\n\t\t</td>\n\t\t<td>\n\t\t\t{3}\n\t\t</td>\n\t\t<td>\n\t\t\t{4}\n\t\t</td>\n\t\t<td>\n\t\t\t{5}\n\t\t</td>\n\t\t<td>\n\t\t\t{6}\n\t\t</td>\n\t\t<td>\n\t\t\t{7}\n\t\t</td>\n\t</tr>\n", $cellClass, $table['Name'], $table['Rows'], sp($table['Avg_row_length']), sp($table['Data_length']), sp($table['Index_length']), sp($table['Data_free']), sp($table['Data_length'] + $table['Index_length']));
    $rows += $table['Rows'];
    $avg += $table['Avg_row_length'];
    $datlen += $table['Data_length'];
    $idx += $table['Index_length'];
    $datfree += $table['Data_free'];
}
write("\n<table class=\"outline margin\">\n\t<tr class=\"header0\">\n\t\t<th colspan=\"7\">\n\t\t\t" . __("Table Status") . "\n\t\t</th>\n\t</tr>\n\t<tr class=\"header1\">\n\t\t<th>\n\t\t\t" . __("Name") . "\n\t\t</th>\n\t\t<th>\n\t\t\t" . __("Rows") . "\n\t\t</th>\n\t\t<th>\n\t\t\t" . __("Avg. data/row") . "\n\t\t</th>\n\t\t<th>\n\t\t\t" . __("Data size") . "\n\t\t</th>\n\t\t<th>\n\t\t\t" . __("Index size") . "\n\t\t</th>\n\t\t<th>\n\t\t\t" . __("Unused data") . "\n\t\t</th>\n\t\t<th>\n\t\t\t" . __("Total size") . "\n\t\t</th>\n\t</tr>\n\t{0}\n\t<tr class=\"header1\">\n\t\t<th colspan=\"7\" style=\"height: 8px;\"></th>\n\t</tr>\n\t<tr class=\"cell2\">\n\t\t<td style=\"font-weight: bold;\">\n\t\t\t" . __("Total") . "\n\t\t</td>\n\t\t<td>\n\t\t\t{1}\n\t\t</td>\n\t\t<td>\n\t\t\t{2}\n\t\t</td>\n\t\t<td>\n\t\t\t{3}\n\t\t</td>\n\t\t<td>\n\t\t\t{4}\n\t\t</td>\n\t\t<td>\n\t\t\t{5}\n\t\t</td>\n\t\t<td>\n\t\t\t{6}\n\t\t</td>\n\t</tr>\n</table>\n", $tablelist, $rows, sp($avg), sp($datlen), sp($idx), sp($datfree), sp($datlen + $idx));
function sp($sz)
{
    return number_format($sz, 0, '.', ',');
}
开发者ID:RoadrunnerWMC,项目名称:ABXD-legacy,代码行数:29,代码来源:records.php

示例8: AssertForbidden

<?php

//  AcmlmBoard XD - Forum list editing tool
//  Access: administrators
include "lib/common.php";
AssertForbidden("editForum");
if ($loguser['powerlevel'] < 3) {
    Kill(__("You must be an administrator to edit the forum list."));
}
if ($_POST['action'] == __("Move")) {
    $qForum = "update forums set forder=" . (int) $_POST['order'] . ", catid=" . (int) $_POST['category'] . " where id=" . (int) $_POST['fid'] . " limit 1";
    $rForum = Query($qForum);
    Alert(__("Forum moved."), __("Notice"));
} elseif ($_POST['action'] == "Add") {
    $qForum = "insert into forums (title, description, catid, forder) values ('" . justEscape($_POST['title']) . "', '" . justEscape($_POST['description']) . "', " . (int) $_POST['category'] . ", " . (int) $_POST['order'] . ")";
    $rForum = Query($qForum);
    Alert(__("Forum added."), __("Notice"));
} elseif ($_POST['action'] == __("Remove")) {
    $qForum = "select * from forums where id=" . (int) $_POST['fid'];
    $rForum = Query($qForum);
    $forum = Fetch($rForum);
    write("\n\t<div class=\"outline margin center width50\" style=\"margin: 0px auto 16px;\">\n\t\t<div class=\"errort\"><strong>" . __("Confirm deletion of \"{0}\"") . "</strong></div>\n\t\t<div class=\"errorc cell2\">\n\t\t\t<form action=\"editfora.php\" method=\"post\">\n\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Yes, do as I say.") . "\" />\n\t\t\t\t<input type=\"hidden\" name=\"fid\" value=\"{1}\" />\n\t\t\t</form>\n\t\t</div>\n\t</div>\n", $forum['title'], (int) $forum['id']);
} elseif ($_POST['action'] == __("Yes, do as I say.")) {
    $qForum = "delete from forums where id=" . (int) $_POST['fid'];
    $rForum = Query($qForum);
    Alert(__("Forum removed."), __("Notice"));
} elseif ($_POST['action'] == __("Edit")) {
    $qForum = "update forums set title='" . justEscape($_POST['title']) . "', description='" . justEscape($_POST['description']) . "' where id=" . (int) $_POST['fid'] . " limit 1";
    $rForum = Query($qForum);
    Alert(__("Forum edited."), __("Notice"));
}
开发者ID:RoadrunnerWMC,项目名称:ABXD-legacy,代码行数:31,代码来源:editfora.php

示例9: __

<?php

$title = __("Ranks");
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Ranks"), "ranks"));
makeBreadcrumbs($crumbs);
AssertForbidden("viewRanks");
loadRanksets();
if (count($ranksetData) == 0) {
    Kill(__("No ranksets have been defined."));
}
if (!isset($_GET["id"])) {
    $rankset = $loguser['rankset'];
    if (!$rankset || !isset($ranksetData[$rankset])) {
        $rankset = array_keys($ranksetData);
        $rankset = $rankset[0];
    }
    die(header("Location: " . actionLink("ranks", $rankset)));
}
$rankset = $_GET['id'];
if (!isset($ranksetData[$rankset])) {
    Kill(__("Rankset not found."));
}
if (count($ranksetNames) > 1) {
    $ranksets = new PipeMenu();
    foreach ($ranksetNames as $name => $title) {
        if ($name == $rankset) {
            $ranksets->add(new PipeMenuTextEntry($title));
        } else {
            $ranksets->add(new PipeMenuLinkEntry($title, "ranks", $name));
        }
开发者ID:knytrune,项目名称:ABXD,代码行数:31,代码来源:ranks.php

示例10: AssertForbidden

<?php

//  AcmlmBoard XD - Rankset import tool
//  Access: administrators
include "lib/common.php";
AssertForbidden("addRanks");
if ($loguser['powerlevel'] < 3) {
    Kill(__("You must be an administrator to import ranksets."));
}
Query("truncate table ranks");
Query("truncate table ranksets");
include "ranksets.php";
$bads = array(" ", "-", ".", ",", "'", '"');
write("\n\t<table class=\"outline margin width25\">\n\t\t<tr class=\"header1\">\n\t\t\t<th>\n\t\t\t\t" . __("Postcount") . "\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\t" . __("Rank") . "\n\t\t\t</th>\n\t\t</tr>\n");
foreach ($ranks as $rankset) {
    write("\n\t\t<tr class=\"header0\">\n\t\t\t<th colspan=\"2\">\n\t\t\t\t{0}\n\t\t\t</th>\n\t\t</tr>\n", $rankset['name']);
    if (!$rankset['directory']) {
        $rankset['directory'] = strtolower($rankset['name']);
    }
    $index++;
    $description = format(__("Set index is {0}. Base directory is {1}."), $index, "<a href=\"img/ranks/" . $rankset['directory'] . "/\"><code>" . $rankset['directory'] . "</code></a>");
    if ($rankset['notolower']) {
        $description .= " " . __("Set does not use lowercase filenames.");
    }
    if ($rankset['noimages']) {
        $description .= " " . __("Set is text-only.");
    }
    write("\n\t\t<tr class=\"cell1\">\n\t\t\t<td colspan=\"2\">\n\t\t\t\t{0}\n\t\t\t</td>\n\t\t</tr>\n", $description);
    Query("insert into ranksets (name) values ('" . $rankset['name'] . "')");
    foreach ($rankset['ranks'] as $val => $text) {
        $img = "<img src=\"img/ranks/" . $rankset['directory'] . "/" . str_replace($bads, "", !$rankset['notolower'] ? strtolower($text) : $text) . ".png\" alt=\"" . $text . "\" /> " . ($rankset['splitlines'] ? "<br />" : "") . $text;
开发者ID:RoadrunnerWMC,项目名称:ABXD-legacy,代码行数:31,代码来源:addranks.php

示例11: AssertForbidden

<?php

$title = "Plugin Manager";
AssertForbidden("managePlugins");
if ($loguser['powerlevel'] < 3) {
    Kill(__("You must be an administrator to manage plugins."));
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Admin"), "admin"));
$crumbs->add(new PipeMenuLinkEntry(__("Plugin manager"), "pluginmanager"));
makeBreadcrumbs($crumbs);
if ($_GET["action"] == "enable") {
    if ($_GET["key"] != $loguser['token']) {
        Kill("No.");
    }
    Query("insert into {enabledplugins} values ({0})", $_GET["id"]);
    logAction("enableplugin", array('text' => $_GET["id"]));
    Upgrade();
    redirectAction("pluginmanager");
}
if ($_GET["action"] == "disable") {
    if ($_GET["key"] != $loguser['token']) {
        Kill("No.");
    }
    Query("delete from {enabledplugins} where plugin={0}", $_GET["id"]);
    logAction("disableplugin", array('text' => $_GET["id"]));
    redirectAction("pluginmanager");
}
$pluginsDb = array();
$pluginList = query("SELECT * FROM {enabledplugins}");
while ($plugin = fetch($pluginList)) {
开发者ID:knytrune,项目名称:ABXD,代码行数:31,代码来源:pluginmanager.php

示例12: AssertForbidden

<?php

//  AcmlmBoard XD - Report/content mismatch fixing utility
//  Access: staff
include "lib/common.php";
AssertForbidden("recalculate");
if ($loguser['powerlevel'] < 1) {
    Kill(__("Staff only, please."));
}
print "<table class=\"outline margin width50\">";
print "<tr class=\"header1\"><th>" . __("Name") . "</th><th>" . __("Actual") . "</th><th>" . __("Reported") . "</th><th>&nbsp;</th></tr>";
print "<tr class=\"header0\"><th colspan=\"4\">" . __("Counting user's posts&hellip;") . "</th></tr>";
$qUsers = "select * from users";
$rUsers = Query($qUsers);
while ($user = Fetch($rUsers)) {
    $cellClass = ($cellClass + 1) % 2;
    print "<tr class=\"cell" . $cellClass . "\">";
    print "<td>" . htmlspecialchars($user['name']) . "</td>";
    $qPosts = "select count(*) from posts where user=" . $user['id'];
    $posts = FetchResult($qPosts);
    print "<td>" . $posts . "</td><td>" . $user['posts'] . "</td>";
    print "<td style=\"background: " . ($posts == $user['posts'] ? "green" : "red") . ";\"></td>";
    print "</tr>";
    $qUser = "update users set posts=" . $posts . " where id=" . $user['id'] . " limit 1";
    $rUser = Query($qUser);
    RecalculateKarma($user['id']);
}
print "<tr class=\"header0\"><th colspan=\"4\">" . __("Counting thread replies&hellip;") . "</th></tr>";
$qThreads = "select * from threads";
$rThreads = Query($qThreads);
while ($thread = Fetch($rThreads)) {
开发者ID:RoadrunnerWMC,项目名称:ABXD-legacy,代码行数:31,代码来源:recalc.php

示例13: GetFullURL

<?php

$noAutoHeader = TRUE;
include "lib/common.php";
if (isset($_POST['google'])) {
    $full = GetFullURL();
    $here = substr($full, 0, strrpos($full, "/"));
    header("Location: http://www.google.com/search?q=" . urlencode($_POST['google'] . " site:" . $here));
}
include "lib/header.php";
AssertForbidden("search");
write("\n<div style=\"float: left; width: 70%;\">\n\n\t<form action=\"search.php\" method=\"post\">\n\t\t<div class=\"outline PoRT margin width25\" style=\"margin: 16px; width: 100%; float: none;\">\n\t\t\t<div class=\"errort\">\n\t\t\t\t<strong>" . __("Google search") . "</strong>\n\t\t\t</div>\n\t\t\t<div class=\"errorc left cell0\" style=\"padding: 8px; font-size: 150%\">\n\t\t\t\t<input type=\"text\" maxlength=\"1024\" name=\"google\" style=\"width: 80%;\">\n\t\t\t\t&nbsp;\n\t\t\t\t<input type=\"submit\" value=\"" . __("Search") . "\">\n\t\t\t</div>\n\t\t</div>\n\t</form>\n");
if ($loguser['powerlevel'] < 1) {
    die("</div>");
}
write("\n\t<form action=\"search.php\" method=\"get\">\n\t\t<div class=\"outline PoRT margin\" style=\"margin: 16px; width: 100%; float: none;\">\n\t\t\t<div class=\"errort\">\n\t\t\t\t<strong>" . __("Internal search") . "</strong>\n\t\t\t</div>\n\t\t\t<div class=\"errorc left cell0\" style=\"padding: 8px; font-size: 150%\">\n\t\t\t\t<input type=\"text\" maxlength=\"1024\" name=\"q\" style=\"width: 80%;\" value=\"" . htmlspecialchars($_GET['q']) . "\">\n\t\t\t\t&nbsp;\n\t\t\t\t<input type=\"submit\" value=\"" . __("Search") . "\">\n\t\t\t</div>\n\t\t</div>\n\t</form>\n</div>\n\n<div class=\"PoRT margin width25\">\n\t<div class=\"errort\"><strong>" . __("Search help") . "</strong></div>\n\t<div class=\"errorc left cell0\" style=\"padding: 8px 8px;\">\n\t\t" . __("Internal search checks both thread titles and post text, returning results from both.") . "\n\t\t<dl>\n\t\t\t<dt><samp>foo bar</samp></dt>\n\t\t\t<dd>" . __("Find entries with either term") . "</dd>\n\t\t\t<dt><samp>\"foo bar\"</samp></dt>\n\t\t\t<dd>" . __("Find entries with full phrase") . "</dd>\n\t\t\t<dt><samp>+foo -bar</samp></dt>\n\t\t\t<dd>" . __("Find entries with <var>foo</var> but not <var>bar</var>") . "</dd>\n\t\t</dl>\n\t</div>\n</div>\n\n<hr style=\"clear: both; visibility: hidden;\" />\n\n");
if (isset($_GET['q'])) {
    $totalResults = 0;
    $bool = htmlspecialchars($_GET['q']);
    $t = explode(" ", $bool);
    $terms = array();
    foreach ($t as $term) {
        if ($term[0] == "-") {
            continue;
        }
        if ($term[0] == "+" || $term[0] == "\"") {
            $terms[] = substr($term, 1);
        } else {
            if ($term[strlen($term) - 1] == "*" || $term[strlen($term) - 1] == "\"") {
                $terms[] = substr($term, 0, strlen($term) - 1);
            } else {
开发者ID:RoadrunnerWMC,项目名称:ABXD-legacy,代码行数:31,代码来源:search.php

示例14: __

<?php

//  AcmlmBoard XD - Thread submission/preview page
//  Access: users
include "lib/common.php";
$title = __("New thread");
AssertForbidden("makeThread");
if (!$loguserid) {
    //Not logged in?
    Kill(__("You must be logged in to post."));
}
if (isset($_POST['id'])) {
    $_GET['id'] = $_POST['id'];
}
if (!isset($_GET['id'])) {
    Kill(__("Forum ID unspecified."));
}
$fid = (int) $_GET['id'];
if ($loguser['powerlevel'] < 0) {
    Kill(__("You're banned."));
}
$qFora = "select * from forums where id=" . $fid;
$rFora = Query($qFora);
if (NumRows($rFora)) {
    $forum = Fetch($rFora);
} else {
    Kill(__("Unknown forum ID."));
}
if ($forum['locked']) {
    Kill(__("This forum is locked."));
}
开发者ID:RoadrunnerWMC,项目名称:ABXD-legacy,代码行数:31,代码来源:newthread.php

示例15: __

<?php

$title = __("Uploader");
AssertForbidden("viewUploader");
$rootdir = $dataDir . "uploader";
if ($uploaderWhitelist) {
    $goodfiles = explode(" ", $uploaderWhitelist);
}
$badfiles = array("html", "htm", "php", "php2", "php3", "php4", "php5", "php6", "htaccess", "htpasswd", "mht", "js", "asp", "aspx", "cgi", "py", "exe", "com", "bat", "pif", "cmd", "lnk", "wsh", "vbs", "vbe", "jse", "wsf", "msc", "pl", "rb", "shtm", "shtml", "stm", "htc");
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}";
        }
开发者ID:RoadrunnerWMC,项目名称:ABXD-plugins,代码行数:31,代码来源:page_uploaderlist.php


注:本文中的AssertForbidden函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。