Example #1
0
function DoFooter($buffer)
{
    global $noFooter, $timeStart, $queries, $overallTidy, $boardname, $title, $dblink, $ajax, $footerButtons, $footerExtensionsA, $footerExtensionsB;
    if (!$noFooter) {
        //if(function_exists("runBucket")) runBucket("footerButtons");
        $footer = format("\n\t\t<div class=\"footer\">\n\t\t\tPowered by <a href=\"https://github.com/Dirbaio/ABXD\">AcmlmBoard XD</a>, version 2.2.6<br />\n\t\t\tBy Kawa, Mega-Mario, Nikolaj, et al<br />\n\t\t\tAcmlmBoard &copy; Jean-Fran&ccedil;ois Lapointe<br />\n\t\t\t" . __("Page rendered in {0} seconds with {1}.") . "<br />\n\t\t\t{3}\n\n\t\t\t<a href=\"http://validator.w3.org/check?uri=referer\">\n\t\t\t\t<img src=\"img/xhtml10.png\" alt=\"Valid XHTML 1.0 Transitional\" />\n\t\t\t</a>\n\t\t\t<a href=\"http://jigsaw.w3.org/css-validator/\">\n\t\t\t\t<img src=\"img/css.png\" alt=\"Valid CSS!\" />\n\t\t\t</a>\n\t\t\t<a href=\"http://abxd.dirbaio.net/?page=downloads\">\n\t\t\t\t<img src=\"img/getabxd.png\" alt=\"Get a copy for yourself\" />\n\t\t\t</a>\n\t\t\t{2}\n\t\t</div>\n\t</div>\n</body>\n</html>\n", sprintf("%1.3f", usectime() - $timeStart), Plural($queries, __("MySQL query")), $footerButtons, __("<!-- English translation by Kawa -->"));
    }
    $boardTitle = htmlval($boardname);
    if ($title != "") {
        $boardTitle .= " &raquo; " . $title;
    }
    $raw = $buffer . $footerExtensionsA . $footer . $footerExtensionsB;
    $raw = str_replace("<title>[[BOARD TITLE HERE]]</title>", "<title>" . $boardTitle . "</title>", $raw);
    if (!$ajax) {
        $raw = OptimizeLayouts($raw);
    }
    mysql_close($dblink);
    if (!$overallTidy) {
        return $raw;
    }
    $tidyConfig = array("show-body-only" => 0, "output-xhtml" => 1, "doctype" => "transitional", "logical-emphasis" => 1, "alt-text" => "", "drop-proprietary-attributes" => 1, "wrap" => 0, "preserve-entities" => 1, "indent" => 1, "input-encoding" => "utf8", "char-encoding" => "utf8", "output-encoding" => "utf8", "new-blocklevel-tags" => "video");
    //if(function_exists(OptimizeLayouts))
    //	$raw = OptimizeLayouts($raw);
    $clean = tidy_repair_string($raw, $tidyConfig);
    $clean = str_replace("class=\"required", "required=\"required\" class=\"", $clean);
    $textareaFixed = str_replace("\r", "", $clean);
    $textareaFixed = str_replace(" </text", "</text", $textareaFixed);
    $textareaFixed = str_replace("\n</text", "</text", $textareaFixed);
    //$textareaFixed = str_replace("\n</text", "</text", $textareaFixed);
    return $textareaFixed;
}
Example #2
0
if (CanMod($loguserid, $fid)) {
    $mod = "\n\n<!-- Mod options -->\n";
    //print $thread['closed'];
    if (!$thread['closed']) {
        $mod .= "<label><input type=\"checkbox\" name=\"lock\">&nbsp;" . __("Close thread", 1) . "</label>\n";
    } else {
        $mod .= "<label><input type=\"checkbox\" name=\"unlock\">&nbsp;" . __("Open thread", 1) . "</label>\n";
    }
    if (!$thread['sticky']) {
        $mod .= "<label><input type=\"checkbox\" name=\"stick\">&nbsp;" . __("Sticky", 1) . "</label>\n";
    } else {
        $mod .= "<label><input type=\"checkbox\" name=\"unstick\">&nbsp;" . __("Unstick", 1) . "</label>\n";
    }
    $mod .= "\n\n";
}
write("\n\t<table style=\"width: 100%;\">\n\t\t<tr>\n\t\t\t<td style=\"vertical-align: top; border: none;\">\n\t\t\t\t<form action=\"newreply.php\" method=\"post\">\n\t\t\t\t\t<input type=\"hidden\" name=\"ninja\" value=\"{0}\" />\n\t\t\t\t\t<table class=\"outline margin width100\">\n\t\t\t\t\t\t<tr class=\"header1\">\n\t\t\t\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t\t\t\t" . __("New reply") . "\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label for=\"uname\">\n\t\t\t\t\t\t\t\t\t" . __("User name", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"uname\" name=\"username\" value=\"{1}\" size=\"32\" maxlength=\"32\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell1\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label for=\"upass\">\n\t\t\t\t\t\t\t\t\t" . __("Password") . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"password\" id=\"upass\" name=\"password\" value=\"{2}\" size=\"32\" maxlength=\"32\" />\n\t\t\t\t\t\t\t\t<img src=\"img/icons/icon5.png\" title=\"" . __("If you want to post under another account without having to log out, enter that account's user name and password here. Leave the password field blank to use the current account ({10}).") . "\" alt=\"[?]\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label for=\"text\">\n\t\t\t\t\t\t\t\t\t" . __("Post") . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<textarea id=\"text\" name=\"text\" rows=\"16\" style=\"width: 98%;\">{3}</textarea>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell2\">\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Post") . "\" /> \n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Preview") . "\" />\n\t\t\t\t\t\t\t\t<select size=\"1\" name=\"mood\">\n\t\t\t\t\t\t\t\t\t{4}\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"nopl\" {5} />&nbsp;" . __("Disable post layout", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"nosm\" {6} />&nbsp;" . __("Disable smilies", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"nobr\" {9} />&nbsp;" . __("Disable auto-<br>", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{7}\" />\n\t\t\t\t\t\t\t\t{8}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t\t<td style=\"width: 20%; vertical-align: top; border: none;\">\n", $ninja, htmlval($postingAsUser['name']), $_POST['password'], $prefill, $moodOptions, $nopl, $nosm, $tid, $mod, $nobr, htmlspecialchars($loguser['name']));
DoSmileyBar();
DoPostHelp();
write("\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n");
$qPosts = "select ";
$qPosts .= "posts.id, posts.date, posts.num, posts.deleted, posts.options, posts.mood, posts.ip, posts_text.text, posts_text.text, posts_text.revision, users.id as uid, users.name, users.displayname, users.rankset, users.powerlevel, users.sex, users.posts";
$qPosts .= " from posts left join posts_text on posts_text.pid = posts.id and posts_text.revision = posts.currentrevision left join users on users.id = posts.user";
$qPosts .= " where thread=" . $tid . " and deleted=0 order by date desc limit 0, 20";
$rPosts = Query($qPosts);
if (NumRows($rPosts)) {
    $posts = "";
    while ($post = Fetch($rPosts)) {
        $cellClass = ($cellClass + 1) % 2;
        $poster = $post;
        $poster['id'] = $post['uid'];
        $nosm = $post['options'] & 2;
    fputs($hax, "\$feedname = " . var_export($_POST['feedname'], true) . ";\n");
    fputs($hax, "\$rssblurb = " . var_export($_POST['rssblurb'], true) . ";\n");
    fputs($hax, "\n");
    fputs($hax, "?>");
    fclose($hax);
    Redirect(__("Edited!"), "./", __("the main page"));
}
$forcetheme = $hacks['forcetheme'];
$themenames = $hacks['themenames'];
$themelist[""] = __("[Disabled]");
$themelist = array_merge($themelist, $themes);
$names = array(__("[Disabled]"), __("Christmas"), __("Rainbow"), __("Anonymous"));
if (!function_exists('tidy_repair_string')) {
    $tidyAvailable = "disabled=\"disabled\"";
}
write("\n\t<form action=\"editsettings.php\" method=\"post\">\n\t\t<table class=\"outline margin width75\">\n\n\t\t\t<tr class=\"header1\">\n\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t" . __("Settings") . "\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t" . __("Various") . "\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<label for=\"boardname\">" . __("Board name") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"width75\">\n\t\t\t\t\t<input type=\"text\" id=\"boardname\" name=\"boardname\" value=\"{0}\" class=\"width75\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"logoalt\">" . __("Logo alt text") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"logoalt\" name=\"logoalt\" value=\"{1}\" class=\"width75\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"logotitle\">" . __("Logo title") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"logotitle\" name=\"logotitle\" value=\"{2}\" class=\"width75\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"dateformat\">" . __("Date/time format") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"dateformat\" name=\"dateformat\" value=\"{3}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"autoLockMonths\">" . __("Autolock months") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"autoLockMonths\" name=\"autoLockMonths\" value=\"{4}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"warnMonths\">" . __("Bump warning months") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"warnMonths\" name=\"warnMonths\" value=\"{5}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"viewcountInterval\">" . __("Viewcount report interval") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"viewcountInterval\" name=\"viewcountInterval\" value=\"{6}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"customTitleThreshold\">" . __("Custom title threshold") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"customTitleThreshold\" name=\"customTitleThreshold\" value=\"{7}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Markup Cleanup") . "\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"overallTidy\" {8} {14} />\n\t\t\t\t\t\t" . __("Use HtmlTidy") . "\n\t\t\t\t\t</label>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\tAJAX\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"noAjax\" {22} />\n\t\t\t\t\t\t" . __("Disable AJAX refreshers") . "\n\t\t\t\t\t</label>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Guests") . "\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"noGuestLayouts\" {23} />\n\t\t\t\t\t\t" . __("Disable post layouts for guests") . "\n\t\t\t\t\t</label>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"theWord\">" . __("Registration word") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"theWord\" name=\"theWord\" value=\"{9}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"systemUser\">" . __("System user ID") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"systemUser\" name=\"systemUser\" value=\"{10}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"minWords\">" . __("Minimal word count") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"minWords\" name=\"minWords\" value=\"{18}\" />\n\t\t\t\t\t<img src=\"img/icons/icon4.png\" title=\"" . __("This is supposed to protect your board from the Happyface Guy, who floods a single smiley.") . " " . __("Set this to zero to disable the check, at your own risk.") . "\" alt=\"[!]\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"minSeconds\">" . __("Minimal seconds between posts") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"minSeconds\" name=\"minSeconds\" value=\"{19}\" />\n\t\t\t\t\t<img src=\"img/icons/icon4.png\" title=\"" . __("This is supposed to protect your board from flooders by slowing them down.") . " " . __("Set this to zero to disable the check, at your own risk.") . "\" alt=\"[!]\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"uploaderCap\">" . __("Uploader size cap") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"uploaderCap\" name=\"uploaderCap\" value=\"{20}\" />\n\t\t\t\t\tMiB\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"personalCap\">" . __("Uploader private cap") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"personalCap\" name=\"personalCap\" value=\"{25}\" />\n\t\t\t\t\tMiB\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"uploaderMaxFileSize\">" . __("Uploader max file size") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"uploaderMaxFileSize\" name=\"uploaderMaxFileSize\" value=\"{29}\" />\n\t\t\t\t\tMiB <img src=\"img/icons/icon5.png\" title=\"" . __("You cannot go past the php.ini setting, which is {30}. Exceeding this value or entering zero will reset the limit to {30}.") . "\" alt=\"[?]\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"uploaderWhitelist\">" . __("Uploader whitelist") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"uploaderWhitelist\" name=\"uploaderWhitelist\" value=\"{21}\" class=\"width75\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"mailResetFrom\">" . __("Mail Reset sender") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"email\" id=\"mailResetFrom\" name=\"mailResetFrom\" value=\"{24}\" class=\"width75\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"lastPostsTimeLimit\">" . __("Time limit for Last Posts") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"lastPostsTimeLimit\" name=\"lastPostsTimeLimit\" value=\"{26}\" /> hours\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t" . __("Hacks") . "\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<label for=\"theme\">" . __("Theme") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>{11}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"names\">" . __("Names") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>{12}\n\t\t\t\t</td>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t" . __("Profile Preview Post") . "\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<label for=\"ppp\">" . __("Text") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea id=\"ppp\" name=\"previewtext\" rows=\"8\" style=\"width: 98%;\">{15}</textarea>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t" . __("Meta") . "\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"metadesc\">" . __("Description") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"metadesc\" name=\"metadesc\" value=\"{16}\" class=\"width75\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"metakeys\">" . __("Keywords") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"metakeys\" name=\"metakeys\" value=\"{17}\" class=\"width75\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t" . __("RSS Feed") . "\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"feedname\">" . __("Feed name") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"feedname\" name=\"feedname\" value=\"{27}\" class=\"width75\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"rssblurb\">" . __("Blurb") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"rssblurb\" name=\"rssblurb\" value=\"{28}\" class=\"width75\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell2\">\n\t\t\t\t<td>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Edit") . "\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"key\" value=\"{31}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</form>\n", htmlval($boardname), htmlval($logoalt), htmlval($logotitle), htmlval($dateformat), $autoLockMonths, $warnMonths, $viewcountInterval, $customTitleThreshold, $overallTidy ? "checked=\"checked\"" : "", htmlval($theWord), $systemUser, MakeSelect("theme", $forcetheme, $themelist), MakeSelect("names", $themenames, $names), 0, $tidyAvailable, $profilePreviewText, htmlval($metaDescription), htmlval($metaKeywords), $minWords, $minSeconds, $uploaderCap, $uploaderWhitelist, $noAjax ? "checked=\"checked\"" : "", $noGuestLayouts ? "checked=\"checked\"" : "", $mailResetFrom, $personalCap, $lastPostsTimeLimit, $feedname, $rssblurb, $uploaderMaxFileSize, BytesToSize(IniValToBytes(ini_get("upload_max_filesize"))), $key);
function MakeSelect($fieldName, $checkedIndex, $choicesList, $extras = "")
{
    $checks[$checkedIndex] = " selected=\"selected\"";
    foreach ($choicesList as $key => $val) {
        $options .= format("\n\t\t\t\t\t\t<option value=\"{0}\"{1}>{2}</option>", $key, $checks[$key], $val);
    }
    $result = format("\n\t\t\t\t\t<select id=\"{0}\" name=\"{0}\" size=\"1\" {1} >{2}\n\t\t\t\t\t</select>", $fieldName, $extras, $options);
    return $result;
}
function prepare($text)
{
    $s = str_replace("\\'", "'", addslashes(deSlashMagic($text)));
    return $s;
}
//From the PHP Manual User Comments
    $qQuote = "\tselect \n\t\t\t\t\tp.id, p.deleted, pt.text,\n\t\t\t\t\tf.minpower,\n\t\t\t\t\tu.name poster\n\t\t\t\tfrom posts p\n\t\t\t\t\tleft join posts_text pt on pt.pid = p.id and pt.revision = p.currentrevision \n\t\t\t\t\tleft join threads t on t.id=p.thread\n\t\t\t\t\tleft join forums f on f.id=t.forum\n\t\t\t\t\tleft join users u on u.id=p.user\n\t\t\t\twhere p.id=" . $id;
    $rQuote = Query($qQuote);
    if (!NumRows($rQuote)) {
        die(__("Unknown post ID."));
    }
    $quote = Fetch($rQuote);
    //SPY CHECK!
    //Do we need to translate this line? It's not even displayed in its true form ._.
    if ($quote['minpower'] > $loguser['powerlevel']) {
        $quote['text'] = str_rot13("Pools closed due to not enough power. Prosecutors will be violated.");
    }
    if ($quote['deleted']) {
        $quote['text'] = __("Post is deleted");
    }
    $reply = "[quote=\"" . $quote['poster'] . "\" id=\"" . $quote['id'] . "\"]" . $quote['text'] . "[/quote]";
    $reply = str_replace("/me", "[b]* " . htmlval($quote['poster']) . "[/b]", $reply);
    die($reply);
} else {
    if ($action == 'rp') {
        $qPost = "\tselect \n\t\t\t\t\tposts.id, posts.date, posts.num, posts.deleted, posts.options, posts.mood, posts.ip, posts.thread, \n\t\t\t\t\tposts_text.text, posts_text.text, posts_text.revision, users.id as uid, \n\t\t\t\t\tforums.id fid, \n\t\t\t\t\tusers.name, users.displayname, users.rankset, users.powerlevel, users.title, users.sex, users.picture, users.posts, users.postheader, users.signature, users.signsep, users.globalblock, users.lastposttime, users.lastactivity, users.regdate\n\t\t\t\tfrom \n\t\t\t\t\tposts \n\t\t\t\t\tleft join posts_text on posts_text.pid = posts.id and posts_text.revision = posts.currentrevision \n\t\t\t\t\tleft join users on users.id = posts.user\n\t\t\t\t\tleft join threads on threads.id=posts.thread\n\t\t\t\t\tleft join forums on forums.id=threads.forum\n\t\t\t\twhere posts.id=" . $id;
        $rPost = Query($qPost);
        if (!NumRows($rPost)) {
            die(__("Unknown post ID."));
        }
        $post = Fetch($rPost);
        if (!CanMod($loguserid, $post['fid'])) {
            die(__("No."));
        }
        if (isset($_GET['o'])) {
            $post['deleted'] = 0;
            $post['unfoldhax'] = 1;
        $_POST['id'] = "???";
        $_POST['uid'] = $loguserid;
        $copies = explode(",", "title,name,displayname,picture,sex,powerlevel,avatar,postheader,signature,signsep,regdate,lastactivity,lastposttime");
        foreach ($copies as $toCopy) {
            $_POST[$toCopy] = $loguser[$toCopy];
        }
        $realtext = $_POST['text'];
        $_POST['text'] = preg_replace("'/me '", "[b]* " . $loguser['name'] . "[/b] ", $_POST['text']);
        //to prevent identity confusion
        MakePost($_POST, 0, 0);
        $_POST['title'] = $_POST['realtitle'];
        //and put it back for the form.
        $_POST['text'] = $realtext;
    }
}
//if($_POST['text']) $prefill = htmlval(deSlashMagic($_POST['text']));
//if($_POST['title']) $trefill = htmlval(deSlashMagic($_POST['title']));
if ($_POST['text']) {
    $prefill = htmlval($_POST['text']);
}
if ($_POST['title']) {
    $trefill = htmlval($_POST['title']);
}
if (!isset($_POST['iconid'])) {
    $_POST['iconid'] = 0;
}
Write("\n\t<table style=\"width: 100%;\">\n\t\t<tr>\n\t\t\t<td style=\"vertical-align: top; border: none;\">\n\t\t\t\t<form action=\"sendprivate.php\" method=\"post\">\n\t\t\t\t\t<table class=\"outline margin width100\">\n\t\t\t\t\t\t<tr class=\"header1\">\n\t\t\t\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t\t\t\t" . __("Send PM") . "\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . __("To") . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"text\" name=\"to\" style=\"width: 98%;\" maxlength=\"1024\" value=\"{2}\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell1\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . __("Title") . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"text\" name=\"title\" style=\"width: 98%;\" maxlength=\"60\" value=\"{1}\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . __("Message") . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<textarea id=\"text\" name=\"text\" rows=\"16\" style=\"width: 98%;\">{0}</textarea>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell2\">\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Send") . "\" /> \n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Preview") . "\" />\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Save as Draft") . "\" /> \n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t\t<td style=\"width: 200px; vertical-align: top; border: none;\">\n", $prefill, $trefill, $_POST['to']);
DoSmileyBar();
DoPostHelp();
Write("\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n");
MakeCrumbs(array(__("Main") => "./", __("Private messages") => "private.php", __("New PM") => ""), "");
Example #6
0
    $_POST['iconid'] = 0;
}
$qFora = "select title, id from forums order by catid, id";
$rFora = Query($qFora);
while ($forum = Fetch($rFora)) {
    $moveToTargets .= "<option value=\"" . $forum['id'] . "\">" . $forum['title'] . "</option>";
}
if ($canMod) {
    $icons = "";
    $i = 1;
    while (is_file("img/icons/icon" . $i . ".png")) {
        $check = "";
        if ($_POST['iconid'] == $i) {
            $check = "checked=\"checked\" ";
        }
        $icons .= format("\n\t\t\t\t<label>\n\t\t\t\t\t<input type=\"radio\" {0} name=\"iconid\" value=\"{1}\" />\n\t\t\t\t\t<img src=\"img/icons/icon{1}.png\" alt=\"Icon {1}\" />\n\t\t\t\t</label>\n", $check, $i);
        $i++;
    }
    $check[0] = "";
    $check[1] = "";
    if ($_POST['iconid'] == 0) {
        $check[0] = "checked=\"checked\" ";
    }
    if ($_POST['iconid'] == 255) {
        $check[1] = "checked=\"checked\" ";
        $iconurl = htmlval(deSlashMagic($_POST['iconurl']));
    }
    write("\n\t<form action=\"editthread.php\" method=\"post\">\n\t\t<table class=\"outline margin\" style=\"width: 100%;\">\n\t\t\t<tr class=\"header1\">\n\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t" . __("Edit Thread") . "\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<label for=\"tit\">" . __("Title") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"tit\" name=\"title\" style=\"width: 98%;\" maxlength=\"60\" value=\"{0}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Icon") . "\n\t\t\t\t</td>\n\t\t\t\t<td class=\"threadIcons\">\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {2} id=\"noicon\" name=\"iconid\" value=\"0\">\n\t\t\t\t\t\t" . __("None") . "\n\t\t\t\t\t</label>\n\t\t\t\t\t{1}\n\t\t\t\t\t<br/>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {3} name=\"iconid\" value=\"255\" />\n\t\t\t\t\t\t<span>" . __("Custom") . "</span>\n\t\t\t\t\t</label>\n\t\t\t\t\t<input type=\"text\" name=\"iconurl\" style=\"width: 50%;\" maxlength=\"100\" value=\"{4}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell2\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Extras") . "\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"isClosed\" {5} />\n\t\t\t\t\t\t" . __("Closed") . "\n\t\t\t\t\t</label>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"isSticky\" {6} />\n\t\t\t\t\t\t" . __("Sticky") . "\n\t\t\t\t\t</label>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell2\">\n\t\t\t\t<td></td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Edit") . "\"></input>\n\t\t\t\t\t<button onclick=\"window.navigate('editthread.php?id={7}&amp;action=delete');\">" . __("Delete") . "</button>\n\n\t\t\t\t\t<select name=\"moveTo\" size=\"1\">{8}</select>\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Move") . "\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{7}\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"key\" value=\"{9}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</form>\n", htmlval(deSlashMagic($_POST['title'])), $icons, $check[0], $check[1], $iconurl, $thread['closed'] ? " checked=\"checked\"" : "", $thread['sticky'] ? " checked=\"checked\"" : "", $tid, $moveToTargets, $key);
} else {
    write("\n\t<form action=\"editthread.php\" method=\"post\">\n\t\t<table class=\"outline margin width50\">\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"tit\">" . __("Title") . "</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"tit\" name=\"title\" style=\"width: 98%;\" maxlength=\"60\" value=\"{0}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell2\">\n\t\t\t\t<td></td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Edit") . "\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{1}\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"key\" value=\"{2}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</form>\n", htmlval(deSlashMagic($_POST['title'])), $tid, $key);
}
Example #7
0
}
if ($_POST['nobr']) {
    $nobr = "checked=\"checked\"";
}
if (!isset($_POST['mood'])) {
    $_POST['mood'] = $post['mood'];
}
if ($_POST['mood']) {
    $moodSelects[(int) $_POST['mood']] = "selected=\"selected\" ";
}
$moodOptions = Format("<option {0}value=\"0\">" . __("[Default avatar]") . "</option>\n", $moodSelects[0]);
$rMoods = Query("select mid, name from moodavatars where uid=" . $post['user'] . " order by mid asc");
while ($mood = Fetch($rMoods)) {
    $moodOptions .= Format("<option {0}value=\"{1}\">{2}</option>\n", $moodSelects[$mood['mid']], $mood['mid'], htmlval($mood['name']));
}
Write("\n\t<table style=\"width: 100%;\">\n\t\t<tr>\n\t\t\t<td style=\"vertical-align: top; border: none;\">\n\t\t\t\t<form action=\"editpost.php\" method=\"post\">\n\t\t\t\t\t<table class=\"outline margin width100\">\n\t\t\t\t\t\t<tr class=\"header1\">\n\t\t\t\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t\t\t\t" . __("Edit Post") . "\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . __("Post") . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<textarea id=\"text\" name=\"text\" rows=\"16\" style=\"width: 98%;\">{0}</textarea>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell2\">\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Edit") . "\" /> \n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Preview") . "\" />\n\t\t\t\t\t\t\t\t<select size=\"1\" name=\"mood\">\n\t\t\t\t\t\t\t\t\t{1}\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"nopl\" {3} />&nbsp;" . __("Disable post layout", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"nosm\" {4} />&nbsp;" . __("Disable smilies", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"nobr\" {5} />&nbsp;" . __("Disable auto-<br>", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{2}\" />\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"key\" value=\"{6}\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t\t<td style=\"width: 200px; vertical-align: top; border: none;\">\n", htmlval($prefill), $moodOptions, $pid, $nopl, $nosm, $nobr, $key);
DoSmileyBar();
DoPostHelp();
Write("\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n");
$qPosts = "select ";
$qPosts .= "posts.id, posts.date, posts.num, posts.deleted, posts.options, posts.mood, posts.ip, posts_text.text, posts_text.text, posts_text.revision, users.id as uid, users.name, users.displayname, users.rankset, users.powerlevel, users.sex, users.posts";
$qPosts .= " from posts left join posts_text on posts_text.pid = posts.id and posts_text.revision = posts.currentrevision left join users on users.id = posts.user";
$qPosts .= " where thread=" . $tid . " and deleted=0 order by date desc limit 0, 20";
$rPosts = Query($qPosts);
if (NumRows($rPosts)) {
    $posts = "";
    while ($post = Fetch($rPosts)) {
        $cellClass = ($cellClass + 1) % 2;
        $poster = $post;
        $poster['id'] = $post['uid'];
        $nosm = $post['options'] & 2;
Example #8
0
            while ($forum = Fetch($rFora)) {
                $localMods = "";
                $qMods = "select * from forummods where forum=" . (int) $forum['id'];
                $rMods = Query($qMods);
                if (NumRows($rMods)) {
                    while ($mod = Fetch($rMods)) {
                        $qMod = "select name, id, powerlevel, sex from users where id=" . $mod['user'];
                        $rMod = Query($qMod);
                        $mod2 = Fetch($rMod);
                        $localMods .= UserLink($mod2) . ", ";
                    }
                    $localMods = __("Moderated by:") . " " . substr($localMods, 0, strlen($localMods) - 2);
                } else {
                    $localMods = __("No mods");
                }
                $thelist .= format("\n\t\t<div class=\"errorc left cell1\" style=\"clear: both; overflow: auto;\">\n\n\t\t\t<div style=\"float: left; width: 60%;\">\n\t\t\t\t<form action=\"editfora.php\" method=\"post\">\n\t\t\t\t\t<input type=\"text\" name=\"title\" value=\"{0}\" style=\"width: 70%;\" />\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Edit") . "\" /><br />\n\t\t\t\t\t<input type=\"text\" name=\"description\" style=\"width: 90%;\" value=\"{1}\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"fid\" value=\"{2}\" /><br/>\n\t\t\t\t\t<small>{3} (<a href=\"managemods.php\">" . __("Edit") . "</a>) &bull; " . __("{4} thread(s), {5} post(s).") . "</small>\n\t\t\t\t</form>\n\t\t\t</div>\n\n\t\t\t<form action=\"editfora.php\" method=\"post\">\n\t\t\t\t{7}\n\t\t\t\t <input type=\"text\" name=\"order\" value=\"{6}\" size=\"2\" maxlength=\"2\" /><br />\n\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Move") . "\" /> \n\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Remove") . "\" />\n\t\t\t\t<input type=\"hidden\" name=\"fid\" value=\"{2}\" />\n\t\t\t</form>\n\n\t\t</div>\n", htmlval($forum['title']), htmlval($forum['description']), $forum['id'], $localMods, $forum['numthreads'], $forum['numposts'], $forum['forder'], MakeOptions($forum['catid']));
            }
        }
    }
    write("\n\t<div class=\"outline width50 margin\">\n\t\t<div class=\"errort\"><strong>" . __("Forum list") . "</strong></div>\n\t\t{0}\n\t</div>\n", $thelist);
}
write("\n\t<form action=\"editfora.php\" method=\"post\">\n\t\t<div class=\"outline width50 margin\">\n\t\t\t<div class=\"errort\"><strong>" . __("Add a Forum") . "</strong></div>\n\t\t\t<div class=\"errorc left cell1\" style=\"clear: both; overflow: auto;\">\n\t\t\t\t<div style=\"float: left; width: 60%;\">\n\t\t\t\t\t<input type=\"text\" name=\"title\" style=\"width: 70%;\" /><br/>\n\t\t\t\t\t<input type=\"text\" name=\"description\" style=\"width: 90%;\" />\n\t\t\t\t</div>\n\t\t\t\t{0}\n \t\t\t\t<input type=\"text\" name=\"order\" value=\"0\" size=\"2\" maxlength=\"2\" /> \n\t\t\t\t{1}\n\t\t\t\t<input type=\"submit\" name=\"action\" value=\"Add\" /> \n\t\t\t</div>\n\t\t</div>\n\t</form>\n\n\t<p>\n\t\t" . __("For more complex things, try PMA. This is just a toy-like quick access.") . "\n\t</p>\n", MakeOptions(-1), $levels);
function MakeOptions($catid)
{
    $sel[$catid] = " selected=\"true\"";
    $qFora = "select id,name from categories";
    $rFora = Query($qFora);
    $result = "<select name=\"category\" size=\"1\">";
    while ($forum = Fetch($rFora)) {
        $result .= "<option value=\"" . $forum['id'] . "\"" . $sel[$forum['id']] . "\\>" . $forum['name'] . "</option>";
    }
                                copy($tmpfile, $file);
                            } elseif ($type <= 3) {
                                $r = imagesx($img1) / imagesy($img1);
                                if ($r > 1) {
                                    $img2 = imagecreatetruecolor($dimx, floor($dimy / $r));
                                    imagecopyresampled($img2, $img1, 0, 0, 0, 0, $dimx, $dimy / $r, imagesx($img1), imagesy($img1));
                                } else {
                                    $img2 = imagecreatetruecolor(floor($dimx * $r), $dimy);
                                    imagecopyresampled($img2, $img1, 0, 0, 0, 0, $dimx * $r, $dimy, imagesx($img1), imagesy($img1));
                                }
                                imagepng($img2, $file);
                            } else {
                                $error .= "<li>Invalid format.</li>";
                            }
                        }
                        $usepic = $file;
                    } else {
                        Kill(__("Could not update your avatar for the following reason(s):") . "<ul>" . $error . "</ul>");
                    }
                }
            }
        }
    }
}
$moodRows = "";
$rMoods = Query("select mid, name from moodavatars where uid=" . $loguserid . " order by mid asc");
while ($mood = Fetch($rMoods)) {
    $cellClass = ($cellClass + 1) % 2;
    $moodRows .= format("\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td style=\"width: 100px;\">\n\t\t\t\t<img src=\"img/avatars/{1}_{2}\" alt=\"\">\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<form method=\"post\" action=\"editavatars.php\">\n\t\t\t\t\t<input type=\"hidden\" name=\"mid\" value=\"{2}\" />\n\t\t\t\t\t<input type=\"text\" id=\"name{2}\" name=\"name\" style=\"width: 60%;\" value=\"{3}\" />\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Rename") . "\" />\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Delete") . "\" />\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t</tr>\n", $cellClass, $loguserid, $mood['mid'], htmlval($mood['name']));
}
write("\n\t<table class=\"margin outline width50\">\n\t\t<tr class=\"header1\">\n\t\t\t<th colspan=\"2\">\n\t\t\t\t" . __("Mood avatars") . "\n\t\t\t</th>\n\t\t</tr>\n\t\t{0}\n\t\t<tr class=\"header1\">\n\t\t\t<th colspan=\"2\">\n\t\t\t\t" . __("Add new") . "\n\t\t\t</th>\n\t\t</tr>\n\t\t<tr class=\"cell2\">\n\t\t\t<td>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<form method=\"post\" action=\"editavatars.php\" enctype=\"multipart/form-data\">\n\t\t\t\t\t<label for=\"newName\">" . __("Name:") . "</label>\n\t\t\t\t\t<input type=\"text\" id=\"newName\" name=\"name\" style=\"width: 60%;\" /><br />\n\t\t\t\t\t\n\t\t\t\t\t<label for=\"pic\">" . __("Image:") . "</label>\n\t\t\t\t\t<input type=\"file\" id=\"pic\" name=\"picture\"  style=\"width: 75%;\" />\n\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Add") . "\" />\n\t\t\t\t</form>\n\t\t\t</td>\n\t</table>\n", $moodRows);
Example #10
0
    $pollOptions = "";
    for ($pops = 0; $pops < $_POST['pollOptions']; $pops++) {
        $cellClass = ($cellClass + 1) % 2;
        $fixed = htmlval(deSlashMagic($_POST['pollOption' . $pops]));
        $pollOptions .= format("\n\t\t\t\t\t\t<tr class=\"cell{0}\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label for=\"p{1}\">" . __("Option {2}") . "</label>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"p{1}\" name=\"pollOption{1}\" value=\"{3}\" style=\"width: 50%;\" maxlength=\"40\" >&nbsp;\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t" . __("Color", 1) . "&nbsp;\n\t\t\t\t\t\t\t\t\t<input type=\"text\" name=\"pollColor{1}\" value=\"{4}\" size=\"10\" maxlength=\"7\" class=\"color {hash:true,required:false,pickerFaceColor:'black',pickerFace:3,pickerBorder:0,pickerInsetColor:'black',pickerPosition:'left',pickerMode:'HVS'}\" />\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t{5}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n", $cellClass, $pops, $pops + 1, $fixed, filterPollColors($_POST['pollColor' . $pops]), $first ? "&nbsp;(#rrggbb)" : "");
        $first = false;
    }
    write("\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label for=\"pq\">\n\t\t\t\t\t\t\t\t\t" . __("Poll question") . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"pq\" name=\"pollQuestion\" value=\"{0}\" style=\"width: 98%;\" maxlength=\"100\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell1\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label for=\"pn\">\n\t\t\t\t\t\t\t\t\t" . __("Number of options") . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"pn\" name=\"pollOptions\" value=\"{1}\" size=\"2\" maxlength=\"2\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t{2}\n", htmlval(deSlashMagic($_POST['pollQuestion'])), $_POST['pollOptions'], $pollOptions);
}
if ($_POST['mood']) {
    $moodSelects[(int) $_POST['mood']] = "selected=\"selected\" ";
}
$moodOptions = "<option " . $moodSelects[0] . "value=\"0\">" . __("[Default avatar]") . "</option>\n";
$rMoods = Query("select mid, name from moodavatars where uid=" . $loguserid . " order by mid asc");
while ($mood = Fetch($rMoods)) {
    $moodOptions .= format("\n\t<option {0} value=\"{1}\">{2}</option>\n", $moodSelects[$mood['mid']], $mood['mid'], htmlval($mood['name']));
}
if (CanMod($loguserid, $forum['id'])) {
    $mod = "\n\n<!-- Mod options -->\n";
    $mod .= "<label><input type=\"checkbox\" name=\"lock\">&nbsp;" . __("Close thread", 1) . "</label>\n";
    $mod .= "<label><input type=\"checkbox\" name=\"stick\">&nbsp;" . __("Sticky", 1) . "</label>\n";
    $mod .= "<!-- More could follow -->\n\n";
}
if (!$_POST['poll'] || $_POST['pollOptions']) {
    $postButton = "<input type=\"submit\" name=\"action\" value=\"" . __("Post") . "\" /> ";
}
if ($_POST['poll']) {
    $multivote = "<label><input type=\"checkbox\" " . ($_POST['multivote'] ? "checked=\"checked\"" : "") . " name=\"multivote\" />&nbsp;" . __("Multivote", 1) . "</label>";
}
write("\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label for=\"post\">\n\t\t\t\t\t\t\t\t\tPost\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<textarea id=\"text\" name=\"text\" rows=\"16\" style=\"width: 98%;\">{0}</textarea>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell2\">\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t{1}\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Preview") . "\" />\n\t\t\t\t\t\t\t\t<select size=\"1\" name=\"mood\">\n\t\t\t\t\t\t\t\t\t{2}\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"nopl\" {3} />&nbsp;" . __("Disable post layout", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"nosm\" {4} />&nbsp;" . __("Disable smilies", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"nobr\" {8} />&nbsp;" . __("Disable auto-<br>", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{5}\" />\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"poll\" value=\"{6}\" />\n\t\t\t\t\t\t\t\t{7}\n\t\t\t\t\t\t\t\t{9}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t\t<td style=\"width: 200px; vertical-align: top; border: none;\">\n", $prefill, $postButton, $moodOptions, $nopl, $nosm, $fid, stripslashes($_POST['poll']), $multivote, $nobr, $mod);
DoSmileyBar();
Example #11
0
        $post['closed'] = $thread['closed'];
        MakePost($post, $tid, $fid);
    }
}
if ($loguserid && $loguser['powerlevel'] >= $forum['minpowerreply'] && $loguser['powerlevel'] >= $category['minpower'] && (!$thread['closed'] || $loguser['powerlevel'] > 0) && !isset($replyWarning)) {
    $ninja = FetchResult("select id from posts where thread=" . $tid . " order by date desc limit 0, 1", 0, 0);
    //Quick reply goes here
    if (CanMod($loguserid, $fid)) {
        //print $thread['closed'];
        if (!$thread['closed']) {
            $mod .= "<label><input type=\"checkbox\" name=\"lock\">&nbsp;" . __("Close thread", 1) . "</label>\n";
        } else {
            $mod .= "<label><input type=\"checkbox\" name=\"unlock\">&nbsp;" . __("Open thread", 1) . "</label>\n";
        }
        if (!$thread['sticky']) {
            $mod .= "<label><input type=\"checkbox\" name=\"stick\">&nbsp;" . __("Sticky", 1) . "</label>\n";
        } else {
            $mod .= "<label><input type=\"checkbox\" name=\"unstick\">&nbsp;" . __("Unstick", 1) . "</label>\n";
        }
    }
    $moodOptions = "<option " . $moodSelects[0] . "value=\"0\">" . __("[Default avatar]") . "</option>\n";
    $rMoods = Query("select mid, name from moodavatars where uid=" . $loguserid . " order by mid asc");
    while ($mood = Fetch($rMoods)) {
        $moodOptions .= format("\n\t<option {0} value=\"{1}\">{2}</option>\n", $moodSelects[$mood['mid']], $mood['mid'], htmlval($mood['name']));
    }
    write("\n\t<form action=\"newreply.php\" method=\"post\">\n\t\t<input type=\"hidden\" name=\"ninja\" value=\"{0}\" />\n\t\t<table class=\"outline margin width75\" style=\"margin: 4px auto;\" id=\"quickreply\">\n\t\t\t<tr class=\"header1\">\n\t\t\t\t<th onclick=\"expandTable('quickreply', this)\" style=\"cursor: pointer;\">\n\t\t\t\t\t" . __("Quick-E Post&trade;") . "\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\" style=\"display: none;\">\n\t\t\t\t<td>\n\t\t\t\t\t<textarea id=\"text\" name=\"text\" rows=\"16\" style=\"width: 98%;\">{3}</textarea>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell2\" style=\"display: none;\">\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Post") . "\" /> \n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Preview") . "\" />\n\t\t\t\t\t<select size=\"1\" name=\"mood\">\n\t\t\t\t\t\t{4}\n\t\t\t\t\t</select>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"nopl\" {5} />&nbsp;" . __("Disable post layout", 1) . "\n\t\t\t\t\t</label>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"nosm\" {6} />&nbsp;" . __("Disable smilies", 1) . "\n\t\t\t\t\t</label>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"nobr\" {9} />&nbsp;" . __("Disable auto-<br>", 1) . "\n\t\t\t\t\t</label>\n\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{7}\" />\n\t\t\t\t\t{8}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</form>\n", $ninja, htmlval($postingAsUser['name']), $_POST['password'], $prefill, $moodOptions, $nopl, $nosm, $tid, $mod, $nobr);
}
if ($pagelinks) {
    write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
MakeCrumbs(array(__("Main") => "./", $forum['title'] => "forum.php?id=" . $fid, $thread['title'] . " " . $tags => ""), $links);
Example #12
0
function BuildPage($page, $id)
{
    global $first, $loguser;
    $display = $id != $first ? " style=\"display: none;\"" : "";
    $cellClass = 0;
    $output = "<table class=\"outline margin width50 eptable\" id=\"" . $id . "\"" . $display . ">\n";
    foreach ($page as $pageID => $section) {
        $output .= "<tr class=\"header0\"><th colspan=\"2\">" . $section['name'] . "</th></tr>\n";
        foreach ($section['items'] as $field => $item) {
            $output .= "<tr class=\"cell" . $cellClass . "\">\n";
            $output .= "<td>\n";
            if ($item['type'] != "checkbox") {
                $output .= "<label for=\"" . $field . "\">" . $item['caption'] . "</label>\n";
            }
            if ($item['hint']) {
                $output .= "<img src=\"img/icons/icon5.png\" title=\"" . $item['hint'] . "\" alt=\"[?]\" />\n";
            }
            $output .= "</td>\n";
            $output .= "<td>\n";
            if ($item['before']) {
                $output .= " " . $item['before'];
            }
            switch ($item['type']) {
                case "label":
                    $output .= htmlspecialchars($item['value']) . "\n";
                    break;
                case "birthday":
                    $item['type'] = "text";
                    //$item['value'] = gmdate("F j, Y", $item['value']);
                    $item['value'] = timestamptostring($item['value']);
                case "password":
                    if (!isset($item['size'])) {
                        $item['size'] = 13;
                    }
                    if (!isset($item['length'])) {
                        $item['length'] = 32;
                    }
                    if ($item['type'] == "password") {
                        $item['extra'] = "/ " . __("Repeat:") . " <input type=\"password\" name=\"repeat" . $field . "\" size=\"" . $item['size'] . "\" maxlength=\"" . $item['length'] . "\" />";
                    }
                case "text":
                    $output .= "<input id=\"" . $field . "\" name=\"" . $field . "\" type=\"" . $item['type'] . "\" value=\"" . htmlval($item['value']) . "\"";
                    if (isset($item['size'])) {
                        $output .= " size=\"" . $item['size'] . "\"";
                    }
                    if (isset($item['length'])) {
                        $output .= " maxlength=\"" . $item['length'] . "\"";
                    }
                    if (isset($item['width'])) {
                        $output .= " style=\"width: " . $item['width'] . ";\"";
                    }
                    if (isset($item['more'])) {
                        $output .= " " . $item['more'];
                    }
                    $output .= " />\n";
                    break;
                case "textarea":
                    if (!isset($item['rows'])) {
                        $item['rows'] = 8;
                    }
                    $output .= "<textarea id=\"" . $field . "\" name=\"" . $field . "\" rows=\"" . $item['rows'] . "\" style=\"width: 98%;\">" . htmlval($item['value']) . "</textarea>";
                    break;
                case "checkbox":
                    $output .= "<label><input id=\"" . $field . "\" name=\"" . $field . "\" type=\"checkbox\"";
                    if ($item['negative'] && !$item['value'] || !$item['negative'] && $item['value']) {
                        $output .= " checked=\"checked\"";
                    }
                    $output .= " /> " . $item['caption'] . "</label>\n";
                    break;
                case "select":
                    $disabled = isset($item['disabled']) ? $item['disabled'] : false;
                    $disabled = $disabled ? "disabled=\"disabled\" " : "";
                    $checks = array();
                    $checks[$item['value']] = " selected=\"selected\"";
                    $options = "";
                    foreach ($item['options'] as $key => $val) {
                        $options .= format("<option value=\"{0}\"{1}>{2}</option>", $key, $checks[$key], $val);
                    }
                    $output .= format("<select id=\"{0}\" name=\"{0}\" size=\"1\" {2}>\n{1}\n</select>\n", $field, $options, $disabled);
                    break;
                case "radiogroup":
                    $checks = array();
                    $checks[$item['value']] = " checked=\"checked\"";
                    foreach ($item['options'] as $key => $val) {
                        $output .= format("<label><input type=\"radio\" name=\"{1}\" value=\"{0}\"{2} />{3}</label>", $key, $field, $checks[$key], $val);
                    }
                    break;
                case "displaypic":
                case "minipic":
                    $output .= "<input type=\"file\" id=\"" . $field . "\" name=\"" . $field . "\" style=\"width: 98%;\" />\n";
                    $output .= "<label><input type=\"checkbox\" name=\"remove" . $field . "\" /> " . __("Remove") . "</label>\n";
                    break;
                case "number":
                    //$output .= "<input type=\"number\" id=\"".$field."\" name=\"".$field."\" value=\"".$item['value']."\" />";
                    $output .= "<input type=\"text\" id=\"" . $field . "\" name=\"" . $field . "\" value=\"" . $item['value'] . "\" size=\"6\" maxlength=\"4\" />";
                    break;
                case "datetime":
                    $output .= "<input type=\"text\" id=\"" . $field . "\" name=\"" . $field . "\" value=\"" . $item['value'] . "\" />\n";
                    $output .= __("or preset:") . "\n";
                    $options = "<option value=\"-1\">" . __("[select]") . "</option>";
                    foreach ($item['presets'] as $key => $val) {
                        $options .= format("<option value=\"{0}\">{1}</option>", $key, $val);
                    }
                    $output .= format("<select id=\"{0}\" name=\"{0}\" size=\"1\" >\n{1}\n</select>\n", $item['presetname'], $options);
                    break;
                case "timezone":
                    $output .= "<input type=\"text\" name=\"" . $field . "H\" size=\"2\" maxlength=\"3\" value=\"" . (int) ($item['value'] / 3600) . "\" />\n";
                    $output .= ":\n";
                    $output .= "<input type=\"text\" name=\"" . $field . "M\" size=\"2\" maxlength=\"3\" value=\"" . floor(abs($item['value'] / 60) % 60) . "\" />";
                    break;
            }
            if ($item['extra']) {
                $output .= " " . $item['extra'];
            }
            $output .= "</td>\n";
            $output .= "</tr>\n";
            $cellClass = ($cellClass + 1) % 2;
        }
    }
    $output .= "</table>";
    Write($output);
}
Example #13
0
    write("\n\t<div class=\"errort\">\n\t\t<strong>Confirm deletion of \"{0}\"</strong>\n\t</div>\n\t<div class=\"errorc cell2\">\n\t\t<form action=\"editcats.php\" method=\"post\">\n\t\t\t<input type=\"submit\" name=\"action\" value=\"Yes, do as I say.\" />\n\t\t\t<input type=\"hidden\" name=\"cid\" value=\"{1}\" />\n\t\t\t<input type=\"hidden\" name=\"key\" value=\"{2}\" />\n\t\t</form>\n\t</div>\n", $category['name'], (int) $category['id'], $key);
} elseif ($_POST['action'] == "Yes, do as I say.") {
    $qCategory = "delete from categories where id=" . (int) $_POST['cid'];
    $rCategory = Query($qCategory);
    Alert("Category removed.", "Notice");
} elseif ($_POST['action'] == "Edit") {
    $qCategory = "update categories set name='" . justEscape($_POST['name']) . "', corder=" . (int) $_POST['corder'] . ", minpower=" . (int) $_POST['minpower'] . " where id=" . (int) $_POST['cid'] . " limit 1";
    $rCategory = Query($qCategory);
    Alert("Category edited.", "Notice");
}
$levels = array(-1 => "-1 - Banned", 0 => "0 - Normal user", 1 => "1 - Local Mod", 2 => "2 - Full Mod", 3 => "3 - Admin");
$cats = "";
$qCategories = "select * from categories";
$rCategories = Query($qCategories);
if (NumRows($rCategories)) {
    while ($category = Fetch($rCategories)) {
        $cats .= format("\n\t\t<div class=\"errorc left cell0\" style=\"clear: both; overflow: auto;\">\n\t\t\t<form action=\"editcats.php\" method=\"post\">\n\t\t\t\t<input type=\"text\" name=\"name\" class=\"width50\" value=\"{0}\" />\n\t\t\t\t{1}\n\t\t\t\t<input type=\"text\" name=\"corder\" size=\"2\" value=\"{3}\" />\n\t\t\t\t<input type=\"submit\" name=\"action\" value=\"Edit\" />\n\t\t\t\t<input type=\"submit\" name=\"action\" value=\"Remove\" />\n\t\t\t\t<input type=\"hidden\" name=\"cid\" value=\"{2}\" />\n\t\t\t\t<input type=\"hidden\" name=\"key\" value=\"{4}\" />\n\t\t\t</form>\n\t\t</div>\n", htmlval($category['name']), MakeSelect("minpower", $category['minpower'], $levels), $category['id'], $category['corder'], $key);
    }
}
write("\n\t<div class=\"outline margin width50\">\n\t\t<div class=\"errort center\"><strong>Category list</strong></div>\n\t\t{0}\n\t</div>\n\t<form action=\"editcats.php\" method=\"post\">\n\t\t<div class=\"outline margin width50\">\n\t\t\t<div class=\"errort center\"><strong>Add a Category</strong></div>\n\t\t\t<div class=\"errorc left cell1\" style=\"clear: both; overflow: auto;\">\n\t\t\t\t<input type=\"text\" name=\"name\" class=\"width50\" />\n\t\t\t\t{1}\n\t\t\t\t<input type=\"text\" name=\"corder\" size=\"2\" value=\"0\" />\n\t\t\t\t<input type=\"submit\" name=\"action\" value=\"Add\" />\n\t\t\t\t<input type=\"hidden\" name=\"key\" value=\"{2}\" />\n\t\t\t</div>\n\t\t</div>\n\t</form>\n\t<p>\n\t\t" . __("For more complex things, try PMA. This is just a toy-like quick access.") . "\n\t</p>\n", $cats, MakeSelect("minpower", 0, $levels), $key);
function MakeSelect($fieldName, $checkedIndex, $choicesList)
{
    global $id;
    $checks[$checkedIndex] = " selected=\"true\"";
    $result = "<select name=\"" . $fieldName . "\" size=\"1\"" . $kawa . ">";
    foreach ($choicesList as $key => $val) {
        $result .= "<option value=\"" . $key . "\"" . $checks[$key] . ">" . $val . "</option>";
    }
    $result .= "</select>";
    return $result;
}
Example #14
0
<?php

//  AcmlmBoard XD - Points of Required Attention editing page
//  Access: administrators
include "lib/common.php";
$title = __("Points of Required Attention");
AssertForbidden("editPoRA");
if ($loguser['powerlevel'] < 3) {
    Kill(__("You must be an administrator to edit the Points of Required Attention."));
}
$key = hash('sha256', "{$loguserid},{$loguser['pss']},{$salt}");
if (isset($_POST['action']) && $key != $_POST['key']) {
    Kill(__("No."));
}
if ($_POST['action'] == __("Edit")) {
    //TidyPost($_POST['text']);
    $qPora = "update misc set porabox = '" . justEscape($_POST['text']) . "', poratitle = '" . justEscape($_POST['title']) . "'";
    $rPora = Query($qPora);
    Report("[b]" . $loguser['name'] . "[/] edited the PoRA.", 1);
    Redirect(__("Edited!"), "./", __("the main page"));
}
write("\n\t<div class=\"PoRT\">\n\t\t<div class=\"errort\">\n\t\t\t<strong id=\"previewtitle\">\n\t\t\t\t{0}\n\t\t\t</strong>\n\t\t</div>\n\t\t<div class=\"errorc cell2 left\" id=\"previewtext\">\n\t\t\t{1}\n\t\t</div>\n\t</div>\n\n\t<form action=\"editpora.php\" method=\"post\">\n\t\t<table id=\"t\" class=\"outline margin width50\">\n\t\t\t<tr class=\"header1\">\n\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t" . __("PoRA Editor") . "\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" . __("Title (plain)") . "\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" name=\"title\" id=\"title\" maxlength=\"256\" style=\"width: 80%;\" value=\"{2}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Content (HTML)") . "\n\t\t\t\t</td>\n\t\t\t\t<td style=\"width: 80%;\">\n\t\t\t\t\t<textarea name=\"text\" rows=\"16\" style=\"width: 97%;\" id=\"editbox\" onkeyup=\"startPoraUpdate()\">{3}</textarea>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell2\">\n\t\t\t\t<td></td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Edit") . "\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"key\" value=\"{4}\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</form>\n", $misc['poratitle'], $misc['porabox'], htmlval($misc['poratitle']), htmlval($misc['porabox']), $key);