Beispiel #1
0
$title = __("Edit settings");
AssertForbidden("editSettings");
if ($loguser['powerlevel'] < 3) {
    Kill(__("You must be an administrator to edit the board settings."));
}
$plugin = "main";
if (isset($_GET["id"])) {
    $plugin = $_GET["id"];
}
if (isset($_POST["_plugin"])) {
    $plugin = $_POST["_plugin"];
}
if (!ctype_alnum($plugin)) {
    Kill(__("No."));
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Admin"), "admin"));
if ($plugin == "main") {
    $crumbs->add(new PipeMenuLinkEntry(__("Edit settings"), "editsettings"));
} else {
    $crumbs->add(new PipeMenuLinkEntry(__("Plugin manager"), "pluginmanager"));
    $crumbs->add(new PipeMenuLinkEntry($plugins[$plugin]["name"], "editsettings", $plugin));
}
makeBreadcrumbs($crumbs);
$settings = Settings::getSettingsFile($plugin);
$oursettings = Settings::$settingsArray[$plugin];
$invalidsettings = array();
if (isset($_POST["_plugin"])) {
    //Save the settings.
    $valid = true;
    foreach ($_POST as $key => $value) {
Beispiel #2
0
<?php

if ($loguserid && isset($_GET['action']) && $_GET['action'] == "markallread") {
    Query("REPLACE INTO {threadsread} (id,thread,date) SELECT {0}, {threads}.id, {1} FROM {threads}", $loguserid, time());
    redirectAction("board");
}
$links = new PipeMenu();
if ($loguserid) {
    $links->add(new PipeMenuLinkEntry(__("Mark all forums read"), "board", 0, "action=markallread", "ok"));
}
makeLinks($links);
makeBreadcrumbs(new PipeMenu());
if (!$mobileLayout) {
    $statData = Fetch(Query("SELECT\n\t\t(SELECT COUNT(*) FROM {threads}) AS numThreads,\n\t\t(SELECT COUNT(*) FROM {posts}) AS numPosts,\n\t\t(SELECT COUNT(*) FROM {users}) AS numUsers,\n\t\t(select count(*) from {posts} where date > {0}) AS newToday,\n\t\t(select count(*) from {posts} where date > {1}) AS newLastHour,\n\t\t(select count(*) from {users} where lastposttime > {2}) AS numActive", time() - 86400, time() - 3600, time() - 2592000));
    $stats = Format(__("{0} and {1} total"), Plural($statData["numThreads"], __("thread")), Plural($statData["numPosts"], __("post")));
    $stats .= "<br />" . format(__("{0} today, {1} last hour"), Plural($statData["newToday"], __("new post")), $statData["newLastHour"]);
    $percent = $statData["numUsers"] ? ceil(100 / $statData["numUsers"] * $statData["numActive"]) : 0;
    $lastUser = Query("select u.(_userfields) from {users} u order by u.regdate desc limit 1");
    if (numRows($lastUser)) {
        $lastUser = getDataPrefix(Fetch($lastUser), "u_");
        $last = format(__("{0}, {1} active ({2}%)"), Plural($statData["numUsers"], __("registered user")), $statData["numActive"], $percent) . "<br />" . format(__("Newest: {0}"), UserLink($lastUser));
    } else {
        $last = __("No registered users") . "<br />&nbsp;";
    }
    write("\n\t\t<table class=\"outline margin width100\" style=\"overflow: auto;\">\n\t\t\t<tr class=\"cell2 center\" style=\"overflow: auto;\">\n\t\t\t<td>\n\t\t\t\t<div style=\"float: left; width: 25%;\">&nbsp;<br />&nbsp;</div>\n\t\t\t\t<div style=\"float: right; width: 25%;\">{1}</div>\n\t\t\t\t<div class=\"center\">\n\t\t\t\t\t{0}\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t", $stats, $last);
}
printRefreshCode();
makeForumListing(0);
     }
     if ($check) {
         $entry = Fetch(Query("select * from {uploader} where id = {0}", $fid));
         if ($entry['private']) {
             @unlink($rootdir . "/" . $entry['user'] . "/" . $entry['filename']);
         } else {
             @unlink($rootdir . "/" . $entry['filename']);
         }
         Query("delete from {uploader} where id = {0}", $fid);
         Report("[b]" . $loguser['name'] . "[/] deleted \"[b]" . $entry['filename'] . "[/]\".", 1);
         die(header("Location: " . actionLink("uploaderlist", "", "cat=" . $_GET["cat"])));
     } else {
         Alert(__("No such file or not yours to mess with."));
     }
 } else {
     $crumbs = new PipeMenu();
     $crumbs->add(new PipeMenuLinkEntry(__("Uploader"), "uploader"));
     makeBreadcrumbs($crumbs);
     $errormsg = __("No categories found.");
     $entries = Query("select * from {uploader_categories} order by ord");
     if (NumRows($entries) == 0) {
         print "\n\t\t<table class=\"outline margin\">\n\t\t\t<tr class=\"header0\">\n\n\n\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 width50\">\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"7\">" . __("Categories") . "</th>\n\t\t\t</tr>\n\t\t";
         $cellClass = 0;
         while ($entry = Fetch($entries)) {
             $filecount = FetchResult("select count(*) from {uploader} where category = {0}", $entry['id']);
             print "<tr class=\"cell{$cellClass}\"><td>";
             print actionLinkTag($entry['name'], "uploaderlist", "", "cat=" . $entry['id']);
             print "<br>";
             print $entry['description'];
Beispiel #4
0
        //Single vote only?
        //Remove any old votes by this user on this poll, then add a new one.
        Query("delete from {pollvotes} where poll={0} and user={1}", $thread['poll'], $loguserid);
        if (!$existing) {
            Query("insert into {pollvotes} (poll, choiceid, user) values ({0}, {1}, {2})", $thread['poll'], $vote, $loguserid);
        }
    }
    redirectAction("thread", $tid, $fromstring);
}
if (!$thread['sticky'] && Settings::get("oldThreadThreshold") > 0 && $thread['lastpostdate'] < time() - 2592000 * Settings::get("oldThreadThreshold")) {
    $replyWarning = " onclick=\"if(!confirm('" . __("Are you sure you want to reply to this old thread? This will move it to the top of the list. Please only do this if you have something new and relevant to share about this thread's topic that is not better placed in a new thread.") . "')) return false;\"";
}
if ($thread['closed']) {
    $replyWarning = " onclick=\"if(!confirm('" . __("This thread is actually closed. Are you sure you want to abuse your staff position to post in a closed thread?") . "')) return false;\"";
}
$links = new PipeMenu();
if ($loguserid) {
    if ($loguser['powerlevel'] < 0) {
        $links->add(new PipeMenuTextEntry(__("You're banned.")));
    } else {
        if (IsAllowed("makeReply", $tid) && (!$thread['closed'] || $loguser['powerlevel'] > 2)) {
            $links->add(new PipeMenuLinkEntry(__("Post reply"), "newreply", $tid, "", "comment"));
        } else {
            if (IsAllowed("makeReply", $tid)) {
                $links->add(new PipeMenuTextEntry(__("Thread closed.")));
            }
        }
    }
    if (CanMod($loguserid, $forum['id']) && IsAllowed("editThread", $tid)) {
        $links->add(new PipeMenuLinkEntry(__("Edit"), "editthread", $tid, "", "pencil"));
        if ($thread['closed']) {
Beispiel #5
0
<?php

//  AcmlmBoard XD - User account registration page
//  Access: any, but meant for guests.
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Register"), "register"));
makeBreadcrumbs($crumbs);
$haveSecurimage = is_file("securimage/securimage.php");
if ($haveSecurimage) {
    session_start();
}
$title = __("Register");
function validateSex($sex)
{
    if ($sex == 0) {
        return 0;
    }
    if ($sex == 1) {
        return 1;
    }
    if ($sex == 2) {
        return 2;
    }
    return 2;
}
if (isset($_POST['name'])) {
    $name = trim($_POST['name']);
    $cname = str_replace(" ", "", strtolower($name));
    $rUsers = Query("select name, displayname from {users}");
    while ($user = Fetch($rUsers)) {
        $uname = trim(str_replace(" ", "", strtolower($user['name'])));
Beispiel #6
0
<?php

if (!defined('WIKIXD')) {
    return;
}
$tools = new PipeMenu();
$tools->add(new PipeMenuLinkEntry('Recent changes', 'wikichanges'));
if ($canedit) {
    $tools->add(new PipeMenuLinkEntry('Create page', 'wikiedit', '', 'createnew'));
}
$tools->add(new PipeMenuLinkEntry('Random page', 'wikirandom'));
echo '
		<table class="outline margin">
			<tr class="header1"><th>Wiki tools</th></tr>
			<tr class="cell1 center"><td>' . $tools->build() . '</td></tr>
		</table>';
Beispiel #7
0
}
if (!isset($_GET['id'])) {
    Kill(__("User ID unspecified."));
}
$id = (int) $_GET['id'];
$rUser = Query("select * from {users} where id={0}", $id);
if (NumRows($rUser)) {
    $user = Fetch($rUser);
} else {
    Kill(__("Unknown user ID."));
}
if ($id == $loguserid) {
    Query("update {users} set newcomments = 0 where id={0}", $loguserid);
    $loguser['newcomments'] = false;
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Member list"), "memberlist"));
$crumbs->add(new PipeMenuHtmlEntry(userLink($user)));
$crumbs->add(new PipeMenuTextEntry(__("Comments")));
makeBreadcrumbs($crumbs);
$canDeleteComments = ($id == $loguserid || $loguser['powerlevel'] > 2) && IsAllowed("deleteComments") && $loguser['powerlevel'] >= 0;
$canComment = $loguser['powerlevel'] >= 0;
if ($loguserid && ($_GET['token'] == $loguser['token'] || $_POST['token'] == $loguser['token'])) {
    if ($canDeleteComments && $_GET['action'] == "delete") {
        AssertForbidden("deleteComments");
        Query("delete from {usercomments} where uid={0} and id={1}", $id, (int) $_GET['cid']);
        if ($mobileLayout) {
            die(header("Location: " . actionLink("usercomments", $id)));
        } else {
            die(header("Location: " . actionLink("profile", $id)));
        }
Beispiel #8
0
<?php

if ($loguser['powerlevel'] < 3) {
    Kill(__("Access denied."));
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Admin"), "admin"));
$crumbs->add(new PipeMenuLinkEntry(__("Log"), "log"));
makeBreadcrumbs($crumbs);
doLogList("1");
Beispiel #9
0
function makePostLinks($post, $type, $params = array())
{
    global $loguser, $loguserid, $mobileLayout;
    $forum = $params['fid'];
    $thread = $params['tid'];
    $canMod = CanMod($loguserid, $forum);
    $canReply = ($canMod || !$post['closed'] && $loguser['powerlevel'] > -1) && $loguserid;
    $links = new PipeMenu();
    if ($type == POST_PM || $type == POST_SAMPLE) {
        return $links;
    }
    if ($post['deleted']) {
        if ($canMod) {
            $links->add(new PipeMenuLinkEntry(__('Undelete'), "", "", "", "undo", "deletePost(" . $post["id"] . ", '" . $loguser["token"] . "', 2);return false;"));
        }
        if ($canMod || $post["u_id"] == $loguserid) {
            if ($type == POST_DELETED_SNOOP) {
                $links->add(new PipeMenuLinkEntry(__('Close'), "", "", "", "chevron-up", "replacePost(" . $post['id'] . ", false); return false;"));
            } else {
                $links->add(new PipeMenuLinkEntry(__('View'), "", "", "", "chevron-down", "replacePost(" . $post['id'] . ", true); return false;"));
            }
        }
    } else {
        $links->add(new PipeMenuLinkEntry(__("Link"), "post", $post['id'], "", "link"));
        if ($canReply && !$params['noreplylinks']) {
            $links->add(new PipeMenuLinkEntry(__("Quote"), "newreply", $thread, "quote=" . $post['id'], "quote-left"));
        }
        if ($canMod || $post['user'] == $loguserid && $loguser['powerlevel'] > -1 && !$post['closed']) {
            $links->add(new PipeMenuLinkEntry(__("Edit"), "editpost", $post['id'], "", "pencil"));
        }
        if ($canMod) {
            $links->add(new PipeMenuLinkEntry(__('Delete'), "", "", "", "remove", "deletePost(" . $post["id"] . ", '" . $loguser["token"] . "', 1);return false;"));
        }
        if (!$mobileLayout) {
            $links->add(new PipeMenuTextEntry(format(__("ID: {0}"), $post['id'])));
            if ($canMod) {
                $links->add(new PipeMenuTextEntry($post['ip']));
            }
        }
        $bucket = "topbar";
        include "./lib/pluginloader.php";
    }
    return $links;
}
Beispiel #10
0
<?php

//Category/forum editor -- By Nikolaj
//Secured and improved by Dirbaio
$title = __("Edit forums");
if ($loguser['powerlevel'] < 3) {
    Kill(__("You're not allowed to access the forum editor."));
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Admin"), "admin"));
$crumbs->add(new PipeMenuLinkEntry(__("Edit forum list"), "editfora"));
makeBreadcrumbs($crumbs);
/**
	Okay. Much like the category editor, now the action is specified by $_POST["action"].

	Possible actions are:
	- updateforum: Updates the settings of a forum in the DB.
	- addforum: Adds a new forum to the DB.
	- deleteforum: Deletes a forum from the DB. Also, depending on $_GET["threads"]: (NOT YET)
		- "delete": DELETES all threads and posts in the DB.
		- "trash": TRASHES all the threads (move to trash and close)
		- "move": MOVES the threads to forum ID $_POST["threadsmove"]
		- "leave": LEAVES all the threads untouched in the DB (like the old forum editor. Not recommended. Will cause "invisible posts" that will still count towards user's postcounts)

	- forumtable: Returns the forum table for the left panel.
	- editforum: Returns the HTML code for the forum settings in right panel.
		- editforumnew: Returns the forum edit box to create a new forum. This way the huge HTML won't be duplicated in the code.
		- editforum: Returns the forum edit box to edit a forum.

**/
//Make actions be requested by GET also. Makes AJAX stuff easier in some cases. And manual debugging too :)
Beispiel #11
0
<?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)) {
Beispiel #12
0
<?php

if ($loguser['powerlevel'] < 3) {
    Kill(__("You're not an administrator. There is nothing for you here."));
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Admin"), "admin"));
$crumbs->add(new PipeMenuLinkEntry(__("Update table structure"), "updateschema"));
makeBreadcrumbs($crumbs);
Upgrade();
?>

Beispiel #13
0
<?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);
}
Beispiel #14
0
<?php

if ($loguser['powerlevel'] < 3) {
    Kill(__("You're not an administrator. There is nothing for you here."));
}
$ip = $_GET["id"];
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
    Kill("Invalid IP");
}
$links = new PipeMenu();
$links->add(new PipeMenuAnyLinkEntry(__("WHOIS query"), "http://dnsquery.org/ipwhois/{$ip}"));
$links->add(new PipeMenuHtmlEntry("<a onclick=\"if(confirm('Are you sure you want to IP-ban {$ip}?')) {document.getElementById('banform').submit();} return false;\" href=\"#\">IP Ban</a>"));
makeLinks($links);
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Admin"), "admin"));
$crumbs->add(new PipeMenuLinkEntry(__("IP bans"), "ipbans"));
$crumbs->add(new PipeMenuLinkEntry($ip, "ipquery", $id));
makeBreadcrumbs($crumbs);
$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");
Beispiel #15
0
<?php

//  AcmlmBoard XD - The Records
//  Access: all
$title = __("Records");
AssertForbidden("viewRecords");
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Records"), "records"));
makeBreadcrumbs($crumbs);
$df = "l, F jS Y, G:i:s";
$maxUsersText = $misc['maxuserstext'];
if ($maxUsersText[0] == ":") {
    $users = explode(":", $maxUsersText);
    $maxUsersText = "";
    foreach ($users as $user) {
        if (!$user) {
            continue;
        }
        if ($maxUsersText) {
            $maxUsersText .= ", ";
        }
        $maxUsersText .= UserLinkById($user);
    }
}
// Awesome way of calculating the mean birth date.
// I'm not sure if there's any problems with overflows and all.
// But it seems to work fine :3
$sumAge = FetchResult("SELECT SUM(birthday) FROM {users} WHERE birthday != 0");
$countAge = FetchResult("SELECT COUNT(*) FROM {users} WHERE birthday != 0");
if ($countAge > 0) {
    $avgAge = (int) ($sumAge / $countAge);
Beispiel #16
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));
        }
    }
    echo "\n\t\t<table class=\"outline margin width25\">\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t" . __("Ranksets") . "\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" . $ranksets->build() . "\n\t\t\t\t</td>\n\t\t</table>";
}
/*
//Handle climbing the ranks again
//$users[1]['posts'] = 6000;
$climbingAgain = array();
for($i = 0; $i < count($users); $i++)
{
$rev = (int) $_GET['rev'];
$page = getWikiPage($_GET['id'], $rev);
$rev = min($page['revision'], $rev);
$urltitle = $page['id'];
//urlencode($page['id']);
$nicetitle = htmlspecialchars(url2title($page['id']));
$title = 'Wiki &raquo; Diff: ' . $nicetitle;
$links = new PipeMenu();
//I think this is broken.
$links->add(new PipeMenuLinkEntry('Page', 'wiki', substr($urltitle, 5)));
$links->add(new PipeMenuLinkEntry('Discuss', 'wiki', 'Talk:' . $urltitle));
if ($page['canedit']) {
    $links->add(new PipeMenuLinkEntry('Edit', 'wikiedit', $urltitle));
}
makeLinks($links);
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Wiki"), "wiki"));
if ($page['ismain']) {
    $crumbs->add(new PipeMenuLinkEntry('Main page: Diff', 'wikidiff', $urltitle, 'rev=' . $rev));
} else {
    $crumbs->add(new PipeMenuLinkEntry($nicetitle, 'wiki', $urltitle));
    $crumbs->add(new PipeMenuLinkEntry('Diff', 'wikidiff', $urltitle, 'rev=' . $rev));
}
makeBreadcrumbs($crumbs);
if ($page['new']) {
    Kill('This page has not been created yet.');
}
if ($page['revision'] <= 1) {
    Kill('This page has not been edited since its creation.');
}
if ($page['flags'] & WIKI_PFLAG_DELETED) {
<?php

//  AcmlmBoard XD Plugin - User badges management tool
//  Access: administrators only
//  Based on ipbans.php
$title = __("User Badges Manager");
assertForbidden("editUserBadges");
if ($loguser['powerlevel'] < 3) {
    kill(__("You're not an administrator. There is nothing for you here."));
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Admin"), "admin"));
$crumbs->add(new PipeMenuLinkEntry(__("User Badges Manager"), "userbadges"));
makeBreadcrumbs($crumbs);
if ($_POST['action'] == __("Add")) {
    if ($_POST['color'] == -1 || empty($_POST['userid']) || empty($_POST['name'])) {
        kill(__("Please review your settings before adding a user badge."));
    } else {
        query("insert into {badges} values ({0}, {1}, {2})", (int) $_POST['userid'], $_POST['name'], (int) $_POST['color']);
        alert(__("Added."), __("Notice"));
    }
} elseif ($_GET['action'] == "delete") {
    query("delete from {badges} where owner = {0} and name = {1}", (int) $_GET['userid'], $_GET['name']);
    alert(__("Removed."), __("Notice"));
} elseif ($_GET['action'] == "deleteall") {
    query("delete from {badges} where owner = {0}", (int) $_GET['userid']);
    alert(__("Removed all badges of the user."), __("Notice"));
} elseif ($_GET['action'] == "newbadge") {
    $userID = "value=\"" . (int) $_GET['userid'] . "\"";
}
// Fetch badges
Beispiel #19
0
}
$whereFrom .= " and drafting = " . $drafting;
$total = FetchResult("select count(*) from {pmsgs} where {$whereFrom} and deleted != {1}", $user, $deleted);
$ppp = $loguser['postsperpage'];
if (isset($_GET['from'])) {
    $from = (int) $_GET['from'];
} else {
    $from = 0;
}
$links = new PipeMenu();
$links->add(new PipeMenuLinkEntry(__("Show received"), "private", $userGet, "", "download-alt"));
$links->add(new PipeMenuLinkEntry(__("Show sent"), "private", $userGet, "show=1", "upload-alt"));
$links->add(new PipeMenuLinkEntry(__("Show drafts"), "private", $userGet, "show=2", "save"));
$links->add(new PipeMenuLinkEntry(__("Send new PM"), "sendprivate", "", "", "plus"));
makeLinks($links);
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Member list"), "memberlist"));
$crumbs->add(new PipeMenuHtmlEntry(userLinkById($user)));
$crumbs->add(new PipeMenuLinkEntry(__("Private messages"), "private", $userGet));
makeBreadcrumbs($crumbs);
$rPM = Query("select * from {pmsgs} left join {pmsgs_text} on pid = {pmsgs}.id where " . $whereFrom . " and deleted != {1} order by date desc limit {2u}, {3u}", $user, $deleted, $from, $ppp);
$numonpage = NumRows($rPM);
$pagelinks = PageLinks(actionLink("private", "", "{$show}{$userGet}&from="), $ppp, $from, $total);
if ($pagelinks) {
    write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
if (NumRows($rPM)) {
    while ($pm = Fetch($rPM)) {
        $rUser = Query("select * from {users} where id = {0}", isset($_GET['show']) ? $pm['userto'] : $pm['userfrom']);
        if (NumRows($rUser)) {
            $user = Fetch($rUser);
Beispiel #20
0
                }
            }
            $cellClass = ($cellClass + 1) % 2;
            $memberList .= format("\n\t\t\t<tr class=\"cell{0}\">\n\t\t\t\t<td>{1}</td>\n\t\t\t\t<td class=\"center\">{2}</td>\n\t\t\t\t<td>{3}</td>\n\t\t\t\t<td>{4}</td>\n\t\t\t\t<td>{5}</td>\n\t\t\t\t<td>{6}</td>\n\t\t\t\t<td>{7}</td>\n\t\t\t\t<td>{8}</td>\n\t\t\t</tr>\n\t", $cellClass, $user['id'], $userPic, UserLink($user), $user['posts'], $user['average'], $user['karma'], $user['birthday'] ? cdate("M jS", $user['birthday']) : "&nbsp;", cdate("M jS Y", $user['regdate']));
        }
    } else {
        $memberList = "\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td colspan=\"8\">\n\t\t\t\t\t" . __("Nothing matched your search.") . "\n\t\t\t\t</td>\n\t\t\t</tr>";
    }
    echo "\n\t\t\t<tr class=\"header1\">\n\t\t\t\t<th style=\"width: 30px; \">#</th>\n\t\t\t\t<th style=\"width: 62px; \">" . __("Picture") . "</th>\n\t\t\t\t<th>" . __("Name") . "</th>\n\t\t\t\t<th style=\"width: 50px; \">" . __("Posts") . "</th>\n\t\t\t\t<th style=\"width: 50px; \">" . __("Average") . "</th>\n\t\t\t\t<th style=\"width: 50px; \">" . __("Karma") . "</th>\n\t\t\t\t<th style=\"width: 80px; \">" . __("Birthday") . "</th>\n\t\t\t\t<th style=\"width: 130px; \">" . __("Registered on") . "</th>\n\t\t\t</tr>\n\t\t\t{$memberList}";
    if ($pagelinks) {
        echo "\n\t\t\t<tr class=\"cell2\">\n\t\t\t\t<td colspan=\"2\">\n\t\t\t\t\t" . __("Page") . "\n\t\t\t\t</td>\n\t\t\t\t<td colspan=\"6\">\n\t\t\t\t\t{$pagelinks}\n\t\t\t\t</td>\n\t\t\t</tr>";
    }
    echo "</table>";
    die;
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Member list"), "memberlist"));
makeBreadcrumbs($crumbs);
if (!$isBot) {
    echo "\n\t<script type=\"text/javascript\" src=\"" . resourceLink("js/memberlist.js") . "\"></script>\n\t<table>\n\t<tr>\n\t<td id=\"userFilter\" style=\"margin-bottom: 1em; margin-left: auto; margin-right: auto; padding: 1em; padding-bottom: 0.5em; padding-top: 0.5em;\">\n\t\t<label>\n\t\t" . __("Sort by") . ":\n\t\t" . makeSelect("orderBy", array("" => __("Post count"), "id" => __("ID"), "name" => __("Name"), "karma" => __("Karma"), "reg" => __("Registration date"))) . " &nbsp;\n\t\t</label>\n\t\t<label>\n\t\t" . __("Order") . ":\n\t\t" . makeSelect("order", array("desc" => __("Descending"), "asc" => __("Ascending"))) . " &nbsp;\n\t\t</label>\n\t\t<label>\n\t\t" . __("Sex") . ":\n\t\t" . makeSelect("sex", array("" => __("(any)"), "n" => __("N/A"), "f" => __("Female"), "m" => __("Male"))) . " &nbsp;\n\t\t</label>\n\t\t<label>\n\t\t" . __("Power") . ":\n\t\t" . makeSelect("power", array("" => __("(any)"), -1 => __("Banned"), 0 => __("Normal"), 1 => __("Local Mod"), 2 => __("Full Mod"), 3 => __("Admin"), 4 => __("Root"), 5 => __("System"))) . "\n\t\t</label>\n\t</td>\n\t<td style=\"text-align: right;\">\n\t\t\t<form action=\"javascript:refreshMemberlist();\">\n\t\t\t\t<div style=\"display:inline-block\">\n\t\t\t\t\t<input type=\"text\" name=\"query\" id=\"query\" placeholder=\"" . __("Search") . "\" />\n\t\t\t\t\t<button id=\"submitQuery\"><i class=\"icon-search\"></i></button>\n\t\t\t\t</div>\n\t\t\t</form>\n\t</td></tr></table>";
}
echo "\n\t<div id=\"memberlist\">\n\t\t<div class=\"center\" style=\"padding: 2em;\">\n\t\t\t" . __("Loading memberlist...") . "\n\t\t</div>\n\t</div>";
//We do not need a default index.
//All options are translatable too, so no need for __() in the array.
//Name is the same as ID.
function makeSelect($name, $options)
{
    $result = "<select name=\"" . $name . "\" id=\"" . $name . "\">";
    $i = 0;
    foreach ($options as $key => $value) {
        $result .= "\n\t<option" . ($i = 0 ? " selected=\"selected\"" : "") . " value=\"" . $key . "\">" . $value . "</option>";
<?php

$title = 'Referrals';
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Admin"), "admin"));
$crumbs->add(new PipeMenuLinkEntry(__("Referrals"), "referrals"));
makeBreadcrumbs($crumbs);
echo '<table class="outline margin">
	<tr class="header1"><th>URL</th><th>Hit count</th></tr>
';
$refs = Query("SELECT referral,count FROM {referrals} ORDER BY count DESC LIMIT 200");
if (!NumRows($refs)) {
    echo '	<tr class="cell0"><td colspan="2">No referrals recorded.</td></tr>
';
} else {
    $c = 0;
    while ($ref = Fetch($refs)) {
        echo '	<tr class="cell', $c, '"><td>', htmlspecialchars($ref['referral']), '</td><td class="center">', $ref['count'], '</td></tr>
';
        $c = 1 - $c;
    }
}
echo '</table>
';
Beispiel #22
0
<?php

$navigation = new PipeMenu();
if ($loguser['powerlevel'] >= 3 && isAllowed("viewAdminRoom")) {
    $navigation->add(new PipeMenuLinkEntry(__("Admin"), "admin", "", "", "cogs"));
}
$bucket = "topMenuStart";
include "./lib/pluginloader.php";
$navigation->add(new PipeMenuLinkEntry(Settings::get("menuMainName"), "board", "", "", "home"));
if (isAllowed("viewMembers")) {
    $navigation->add(new PipeMenuLinkEntry(__("Member list"), "memberlist", "", "", "group"));
}
if (isAllowed("viewRanks")) {
    $navigation->add(new PipeMenuLinkEntry(__("Ranks"), "ranks", "", "", "trophy"));
}
if (isAllowed("viewOnline")) {
    $navigation->add(new PipeMenuLinkEntry(__("Online users"), "online", "", "", "eye-open"));
}
if (isAllowed("search")) {
    $navigation->add(new PipeMenuLinkEntry(__("Search"), "search", "", "", "search"));
}
$navigation->add(new PipeMenuLinkEntry(__("Last posts"), "lastposts", "", "", "reorder"));
$bucket = "topMenu";
include "./lib/pluginloader.php";
$layout_navigation = $navigation;
Beispiel #23
0
<?php

//  AcmlmBoard XD - Realtime visitor statistics page
//  Access: all
$title = __("Online users");
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Online users"), "online"));
makeBreadcrumbs($crumbs);
AssertForbidden("viewOnline");
// This can (and will) be turned into a permission.
$showIPs = $loguser['powerlevel'] > 0;
$time = (int) $_GET['time'];
if (!$time) {
    $time = 300;
}
$rUsers = Query("select * from {users} where lastactivity > {0} order by lastactivity desc", time() - $time);
$rGuests = Query("select * from {guests} where date > {0} and bot = 0 order by date desc", time() - $time);
$rBots = Query("select * from {guests} where date > {0} and bot = 1 order by date desc", time() - $time);
$spans = array(60, 300, 900, 3600, 86400);
$spanList = "";
foreach ($spans as $span) {
    $spanList .= actionLinkTagItem(timeunits($span), "online", "", "time={$span}");
}
write("\n\t<div class=\"smallFonts margin\">\n\t\t" . __("Show visitors from this far back:") . "\n\t\t<ul class=\"pipemenu\">\n\t\t\t{0}\n\t\t</ul>\n\t</div>\n", $spanList);
$userList = "";
$i = 1;
if (NumRows($rUsers)) {
    while ($user = Fetch($rUsers)) {
        $cellClass = ($cellClass + 1) % 2;
        if ($user['lasturl']) {
            $lastUrl = "<a href=\"" . FilterURL($user['lasturl']) . "\">" . FilterURL($user['lasturl']) . "</a>";
Beispiel #24
0
<?php

$userMenu = new PipeMenu();
if ($loguserid) {
    $userMenu->add(new PipeMenuHtmlEntry(userLink($loguser)));
    if (isAllowed("editProfile")) {
        $userMenu->add(new PipeMenuLinkEntry(__("Edit profile"), "editprofile", "", "", "pencil"));
    }
    if (isAllowed("viewPM")) {
        $userMenu->add(new PipeMenuLinkEntry(__("Private messages"), "private", "", "", "envelope"));
    }
    if (isAllowed("editMoods")) {
        $userMenu->add(new PipeMenuLinkEntry(__("Mood avatars"), "editavatars", "", "", "picture"));
    }
    $bucket = "bottomMenu";
    include "./lib/pluginloader.php";
    if (!isset($_POST['id']) && isset($_GET['id'])) {
        $_POST['id'] = (int) $_GET['id'];
    }
    if (isset($user_panel)) {
        echo $user_panel;
    }
    $userMenu->add(new PipeMenuLinkEntry(__("Log out"), "", "", "", "signout", "document.forms[0].submit(); return false;"));
} else {
    $userMenu->add(new PipeMenuLinkEntry(__("Register"), "register", "", "", "user"));
    $userMenu->add(new PipeMenuLinkEntry(__("Log in"), "login", "", "", "signin"));
}
$layout_userpanel = $userMenu;
Beispiel #25
0
<?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...
            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>";
    }
}
$cat = getCategory($_GET["cat"]);
$links = new PipeMenu();
if ($_GET["cat"] != -2 && $loguserid && !$isBot) {
    $links->add(new PipeMenuLinkEntry("Upload file", "uploader", "", "action=uploadform&cat=" . $_GET["cat"], "cloud-upload"));
}
makeLinks($links);
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Uploader"), "uploader"));
$crumbs->add(new PipeMenuLinkEntry($cat["name"], "uploaderlist", "", "cat=" . $cat["id"]));
makeBreadcrumbs($crumbs);
print "<form method=\"post\" action=\"" . actionLink("uploader", "", "cat={$_GET["cat"]}") . "\">";
listCategory($_GET["cat"]);
print "</form>";
function getCategory($cat)
{
    if (!is_numeric($cat)) {
        Kill('Invalid category');
    }
    if ($cat >= 0) {
        $rCategory = Query("select * from {uploader_categories} where id={0}", $cat);
        if (NumRows($rCategory) == 0) {
            Kill("Invalid category");
Beispiel #27
0
<?php

//  AcmlmBoard XD - Private message sending/previewing page
//  Access: user
$title = __("Private messages");
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Member list"), "memberlist"));
$crumbs->add(new PipeMenuHtmlEntry(userLink($loguser)));
$crumbs->add(new PipeMenuLinkEntry(__("Private messages"), "private"));
$crumbs->add(new PipeMenuLinkEntry(__("New PM"), "sendprivate"));
makeBreadcrumbs($crumbs);
AssertForbidden("sendPM");
if (!$loguserid) {
    //Not logged in?
    Kill(__("You must be logged in to send private messages."));
}
$pid = (int) $_GET['pid'];
if ($pid) {
    $rPM = Query("select * from {pmsgs} p left join {pmsgs_text} t on t.pid = p.id where p.userto = {0} and p.id = {1}", $loguserid, $pid);
    if (NumRows($rPM)) {
        $sauce = Fetch($rPM);
        $rUser = Query("select * from {users} where id = {0}", (int) $sauce['userfrom']);
        if (NumRows($rUser)) {
            $user = Fetch($rUser);
        } else {
            Kill(__("Unknown user."));
        }
        $prefill = "[reply=\"" . $user['name'] . "\"]" . htmlspecialchars($sauce['text']) . "[/reply]";
        if (strpos($sauce['title'], "Re: Re: Re: ") !== false) {
            $trefill = str_replace("Re: Re: Re: ", "Re*4: ", $sauce['title']);
        } else {
    $flags = $page['flags'];
    setflag($flags, WIKI_PFLAG_NOCONTBOX, $_POST['nocontbox']);
    if ($canmod) {
        setflag($flags, WIKI_PFLAG_SPECIAL, $_POST['special']);
        setflag($flags, WIKI_PFLAG_DELETED, $_POST['deleted']);
    }
    if ($_POST['text'] !== $page['text']) {
        $rev++;
        Query("INSERT INTO {wiki_pages_text} (id,revision,date,user,text) VALUES ({0},{1},UNIX_TIMESTAMP(),{2},{3})", $page['id'], $rev, $loguserid, $_POST['text']);
    }
    Query("INSERT INTO {wiki_pages} (id,revision,flags) VALUES ({0},{1},{2}) ON DUPLICATE KEY UPDATE revision={1}, flags={2}", $page['id'], $rev, $flags);
    $bucket = 'wikixd_pageedit';
    include "lib/pluginloader.php";
    die(header('Location: ' . actionLink('wiki', $page['id'])));
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Wiki"), "wiki"));
if (!$page['ismain']) {
    $crumbs->add(new PipeMenuLinkEntry($nicetitle, "wiki", $urltitle));
}
if ($page['new'] == 2) {
    $crumbs->add(new PipeMenuLinkEntry("New page", 'wikiedit', '', 'createnew'));
} else {
    if ($page['ismain']) {
        $crumbs->add(new PipeMenuLinkEntry('Edit main page', 'wikiedit', $urltitle));
    } else {
        $crumbs->add(new PipeMenuLinkEntry($nicetitle, 'wiki', $urltitle));
        $crumbs->add(new PipeMenuLinkEntry('Edit', 'wikiedit', $urltitle));
    }
}
makeBreadcrumbs($crumbs);
<?php

if ($loguser['powerlevel'] < 2) {
    Kill(__("You're not admin. There is nothing for you here."));
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Admin"), "admin"));
$crumbs->add(new PipeMenuLinkEntry(__("Update board"), "gitpull"));
makeBreadcrumbs($crumbs);
$output = array();
exec("git pull 2>&1", $output);
echo '<div style="width: 50%; margin-left: auto; margin-right: auto; background: black; border: 1px solid #0f0; color: #0f0; font-family: \'Consolas\', \'Lucida Console\', \'Courier New\', monospace;">';
if (empty($output)) {
    echo '<em>(no output)</em>';
} else {
    foreach ($output as $line) {
        echo htmlspecialchars($line) . '<br>';
    }
}
echo '</div>';
Beispiel #30
0
<?php

//  AcmlmBoard XD - Smiley editing tool
//  Access: administrators only
AssertForbidden("editSmilies");
if ($loguser['powerlevel'] < 3) {
    Kill("You must be an administrator to edit the smiley table.");
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Admin"), "admin"));
$crumbs->add(new PipeMenuLinkEntry(__("Edit smilies"), "editsmilies"));
makeBreadcrumbs($crumbs);
if (isset($_POST['action']) && $loguser['token'] != $_POST['key']) {
    Kill(__("No."));
}
if ($_POST['action'] == "Apply") {
    $rSmilies = Query("select * from {smilies}");
    $numSmilies = NumRows($rSmilies);
    for ($i = 0; $i <= $numSmilies; $i++) {
        if ($_POST['code_' . $i] != $_POST['oldcode_' . $i] || $_POST['image_' . $i] != $_POST['oldimage_' . $i]) {
            if ($_POST['code_' . $i] == "") {
                $act = "deleted";
                $rSmiley = Query("delete from {smilies} where code={0}", $_POST['oldcode_' . $i]);
            } else {
                $act = "edited to \"" . $_POST['image_' . $i] . "\"";
                $rSmiley = Query("update {smilies} set code={0}, image={1} where code={2}", $_POST['code_' . $i], $_POST['image_' . $i], $_POST['oldcode_' . $i]);
            }
            $log .= "Smiley \"" . $_POST['oldcode_' . $i] . "\" " . $act . ".<br />";
        }
    }
    if ($_POST['code_add'] && $_POST['image_add']) {