Пример #1
0
function getRankHtml($rankset, $rank)
{
    $text = htmlspecialchars($rank["text"]);
    if ($rank["image"] == "") {
        return $text;
    }
    $img = htmlspecialchars(resourceLink("ranksets/" . $rankset . "/" . $rank["image"]));
    return "<img src=\"{$img}\" alt=\"\" /> {$text}";
}
Пример #2
0
function getRankHtml($rankset, $rank)
{
    $text = htmlspecialchars($rank["text"]);
    $img = '';
    if ($rank['image']) {
        $img = htmlspecialchars(resourceLink("ranksets/" . $rankset . "/" . $rank["image"]));
        $img = "<img src=\"{$img}\" alt=\"\" /><br>";
    }
    return $img . $text;
}
Пример #3
0
function loadSmilies()
{
    global $smilies, $smiliesReplaceOrig, $smiliesReplaceNew;
    $rSmilies = Query("select * from {smilies} order by length(code) desc");
    $smilies = array();
    while ($smiley = Fetch($rSmilies)) {
        $smilies[] = $smiley;
    }
    $smiliesReplaceOrig = $smiliesReplaceNew = array();
    foreach ($smilies as $smile) {
        $smiliesReplaceOrig[$smile['code'][0]][] = '/\\G(?<!\\w)' . preg_quote($smile['code'], "/") . '(?![\\w\\/])/';
        $smiliesReplaceNew[$smile['code'][0]][] = resourceLink("img/smilies/" . $smile['image']);
    }
}
Пример #4
0
function loadSmilies()
{
    global $smilies, $smiliesReplaceOrig, $smiliesReplaceNew;
    $rSmilies = Query("select * from {smilies} order by length(code) desc");
    $smilies = array();
    while ($smiley = Fetch($rSmilies)) {
        $smilies[] = $smiley;
    }
    $smiliesReplaceOrig = $smiliesReplaceNew = array();
    for ($i = 0; $i < count($smilies); $i++) {
        $smiliesReplaceOrig[] = "/(?<!\\w)" . preg_quote($smilies[$i]['code'], "/") . "(?!\\w)/";
        $smiliesReplaceNew[] = "<img class=\"smiley\" alt=\"\" src=\"" . resourceLink("img/smilies/" . $smilies[$i]['image']) . "\" />";
    }
}
Пример #5
0
function Fatal_Error($msg, $documentationURL = '')
{
    if ($GLOBALS['commandline']) {
        @ob_end_clean();
        print "\n" . $GLOBALS["I18N"]->get("fatalerror") . ": " . strip_tags($msg) . "\n";
        @ob_start();
    } else {
        if (isset($GLOBALS['I18N']) && is_object($GLOBALS['I18N'])) {
            print '<div align="center" class="error">' . $GLOBALS["I18N"]->get("fatalerror") . ": {$msg} ";
        } else {
            print '<div align="center" class="error">' . "Fatal Error: {$msg} ";
        }
        if (!empty($documentationURL)) {
            print resourceLink($documentationURL);
        }
        print '</div>';
        foreach ($GLOBALS['plugins'] as $pluginname => $plugin) {
            $plugin->processError($msg);
        }
    }
    # include "footer.inc";
    # exit;
    return 0;
}
Пример #6
0
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);
        }
        $cellClass = ($cellClass + 1) % 2;
        if (!$pm['msgread']) {
            $img = "<img src=\"" . resourceLink("img/status/new.png") . "\" alt=\"New!\" />";
        } else {
            $img = "";
        }
        $sender = NumRows($rUser) ? UserLink($user) : "_";
        $check = $snoop ? "" : "<input type=\"checkbox\" name=\"delete[{2}]\" />";
        $delLink = $snoop == "" ? "<sup>&nbsp;" . actionLinkTag("&#x2718;", "private", "", "del=" . $pm['id'] . $show . '&token=' . $loguser['token']) . "</sup>" : "";
        $pms .= format("\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td>\n\t\t\t\t" . $check . "\n\t\t\t</td>\n\t\t\t<td class=\"center\">\n\t\t\t\t{1}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t" . actionLinkTag(htmlspecialchars($pm['title']), "showprivate", $pm['id'], $snoop) . "{7}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{5}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{6}\n\t\t\t</td>\n\t\t</tr>\n", $cellClass, $img, $pm['id'], $snoop, htmlspecialchars($pm['title']), $sender, formatdate($pm['date']), $delLink);
    }
} else {
    $pms = format("\n\t\t<tr class=\"cell1\">\n\t\t\t<td colspan=\"6\">\n\t\t\t\t" . __("There are no messages to display.") . "\n\t\t\t</td>\n\t\t</tr>\n");
}
write("\n\t<form method=\"post\" action=\"" . actionLink("private") . "\">\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header1\">\n\t\t\t<th style=\"width: 22px;\">\n\t\t\t\t<input type=\"checkbox\" id=\"ca\" onchange=\"checkAll();\" />\n\t\t\t</th>\n\t\t\t<th style=\"width: 22px;\">&nbsp;</th>\n\t\t\t<th style=\"width: 75%;\">" . __("Title") . "</th>\n\t\t\t<th>{0}</th>\n\t\t\t<th style=\"min-width:120px\">" . __("Date") . "</th>\n\t\t</tr>\n\t\t{1}\n\t\t<tr class=\"header1\">\n\t\t\t<th style=\"text-align: right;\" colspan=\"6\">\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"multidel\" />\n\t\t\t\t<input type=\"hidden\" name=\"token\" value=\"{$loguser['token']}\" />\n\t\t\t\t<a href=\"javascript:void();\" onclick=\"document.forms[1].submit();\">" . __("delete checked") . "</a>\n\t\t\t</th>\n\t\t</tr>\n\t</table>\n\t</font>\n", isset($_GET['show']) ? __("To") : __("From"), $pms);
if ($pagelinks) {
    write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
Пример #7
0
    }
    if ($type == "theme") {
        $input = makeThemeList($name, $value);
    }
    if ($type == "layout") {
        $input = makeLayoutList($name, $value);
    }
    if ($type == "language") {
        $input = makeLangList($name, $value);
    }
    $invalidicon = "";
    if ($invalidsettings[$name]) {
        $invalidicon = "[INVALID]";
    }
    if ($help) {
        $help = "<img src=\"" . resourceLink("img/icons/icon4.png") . "\" title=\"{$help}\" alt=\"[!]\" />";
    }
    print "<tr class=\"cell{$class}\">\n\t\t\t\t<td>\n\t\t\t\t\t<label for=\"{$name}\">{$friendlyname}</label>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t{$input}\n\t\t\t\t\t{$help}\n\t\t\t\t\t{$invalidicon}\n\t\t\t\t</td>\n\t\t\t</tr>";
    $class = ($class + 1) % 2;
}
print "\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=\"_exit\" value=\"" . __("Save and Exit") . "\" />\n\t\t\t\t\t<input type=\"submit\" name=\"_action\" value=\"" . __("Save") . "\" />\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";
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)
Пример #8
0
function WriteCategoryEditContents($cid)
{
    global $loguser;
    //Get all categories.
    $rCats = Query("SELECT * FROM {categories}");
    $cats = array();
    while ($cat = Fetch($rCats)) {
        $cats[$cat['id']] = $cat;
    }
    if (count($cats) == 0) {
        $cats[0] = "No categories";
    }
    if ($cid != -1) {
        $rCategory = Query("SELECT * FROM {categories} WHERE id={0}", $cid);
        if (!NumRows($rCategory)) {
            Kill("Category not found.");
        }
        $cat = Fetch($rCategory);
        $name = htmlspecialchars($cat['name']);
        $corder = $cat['corder'];
        $func = "changeCategoryInfo";
        $button = __("Save");
        $boxtitle = __("Edit Category");
        $delbutton = "\n\t\t\t<button onclick='showDeleteForum(); return false;'>\n\t\t\t\t" . __("Delete") . "\n\t\t\t</button>";
    } else {
        $title = __("New Category");
        $corder = 0;
        $func = "addCategory";
        $button = __("Add");
        $boxtitle = __("New Category");
        $delbutton = "";
    }
    echo "<form method=\"post\" id=\"forumform\" action=\"" . actionLink("editfora") . "\">\n\t<input type=\"hidden\" name=\"key\" value=\"" . $loguser["token"] . "\">\n\t<input type=\"hidden\" name=\"id\" value=\"{$cid}\">\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header1\">\n\t\t\t<th colspan=\"2\">\n\t\t\t\t{$boxtitle}\n\t\t\t</th>\n\t\t</tr>\n\t\t<tr class=\"cell1\">\n\t\t\t<td style=\"width: 25%;\">\n\t\t\t\t" . __("Name") . "\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input type=\"text\" style=\"width: 98%;\" name=\"name\" value=\"{$name}\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"cell0\">\n\t\t\t<td>\n\t\t\t\t" . __("Listing order") . "\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<input type=\"text\" size=\"2\" name=\"corder\" value=\"{$corder}\" />\n\t\t\t\t<img src=\"" . resourceLink("img/icons/icon5.png") . "\" title=\"" . __("Everything is sorted by listing order first, then by ID. If everything has its listing order set to 0, they will therefore be sorted by ID only.") . "\" alt=\"[?]\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"cell2\">\n\t\t\t<td>\n\t\t\t\t&nbsp;\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<button onclick=\"{$func}(); return false;\">\n\t\t\t\t\t{$button}\n\t\t\t\t</button>\n\t\t\t\t{$delbutton}\n\t\t\t</td>\n\t\t</tr>\n\t</table></form>\n\n\t<form method=\"post\" id=\"deleteform\" action=\"" . actionLink("editfora") . "\">\n\t<input type=\"hidden\" name=\"key\" value=\"" . $loguser["token"] . "\">\n\t<input type=\"hidden\" name=\"id\" value=\"{$cid}\">\n\t<div id=\"deleteforum\" style=\"display:none\">\n\t\t<table class=\"outline margin\">\n\t\t\t<tr class=\"header1\">\n\n\t\t\t\t<th>\n\t\t\t\t\t" . __("Delete category") . "\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" . __("Be careful when deleting categories. Make sure there are no forums in the category before deleting it.") . "\n\t\t\t\t\t<br><br>\n\t\t\t\t\t" . __("If you still want to delete it, click below:") . "\n\t\t\t\t\t<br>\n\t\t\t\t\t<button onclick=\"deleteCategory('delete'); return false;\">\n\t\t\t\t\t\t" . __("Delete category") . "\n\t\t\t\t\t</button>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n\t</form>";
}
Пример #9
0
        setcookie("logsession", $sessionID, 0, $boardroot, "", false, true);
        Query("INSERT INTO {sessions} (id, user, autoexpire) VALUES ({0}, {1}, {2})", doHash($sessionID . $salt), $user["id"], 0);
        redirectAction("board");
    }
}
$sexes = array(__("Male"), __("Female"), __("N/A"));
$name = "";
if (isset($_POST["name"])) {
    $name = htmlspecialchars($_POST["name"]);
}
$email = "";
if (isset($_POST["email"])) {
    $email = htmlspecialchars($_POST["email"]);
}
$sex = 2;
if (isset($_POST["sex"])) {
    $sex = validateSex($_POST["sex"]);
}
echo "\n<script src=\"" . resourceLink('js/register.js') . "\"></script>\n<script src=\"" . resourceLink('js/zxcvbn.js') . "\"></script>\n<form action=\"" . actionLink("register") . "\" method=\"post\">\n\t<table class=\"outline margin width50\">\n\t\t<tr class=\"header0\">\n\t\t\t<th colspan=\"2\">\n\t\t\t\t" . __("Register") . "\n\t\t\t</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"cell2\">\n\t\t\t\t<label for=\"un\">" . __("User name") . "</label>\n\t\t\t</td>\n\t\t\t<td class=\"cell0\">\n\t\t\t\t<input type=\"text\" id=\"un\" name=\"name\" value=\"{$name}\" maxlength=\"20\" style=\"width: 98%;\"  class=\"required\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"cell2\">\n\t\t\t\t<label for=\"pw\">" . __("Password") . "</label>\n\t\t\t</td>\n\t\t\t<td class=\"cell1\">\n\t\t\t\t<input type=\"password\" id=\"pw\" name=\"pass\" size=\"13\" maxlength=\"32\" class=\"required\" /> / " . __("Repeat:") . " <input type=\"password\" id=\"pw2\" name=\"pass2\" size=\"13\" maxlength=\"32\" class=\"required\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"cell2\">\n\t\t\t\t<label for=\"email\">" . __("Email address") . "</label>\n\t\t\t</td>\n\t\t\t<td class=\"cell0\">\n\t\t\t\t<input type=\"email\" id=\"email\" name=\"email\" value=\"{$email}\" style=\"width: 98%;\" maxlength=\"60\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"cell2\">\n\t\t\t\t" . __("Sex") . "\n\t\t\t</td>\n\t\t\t<td class=\"cell1\">\n\t\t\t\t" . MakeOptions("sex", $sex, $sexes) . "\n\t\t\t</td>\n\t\t</tr>";
if ($haveSecurimage) {
    echo "\n\t\t<tr>\n\t\t\t<td class=\"cell2\">\n\t\t\t\t" . __("Security") . "\n\t\t\t</td>\n\t\t\t<td class=\"cell1\">\n\t\t\t\t<img width=\"200\" height=\"80\" id=\"captcha\" src=\"" . actionLink("captcha", shake()) . "\" alt=\"CAPTCHA Image\" />\n\t\t\t\t<button onclick=\"document.getElementById('captcha').src = '" . actionLink("captcha", shake()) . "?' + Math.random(); return false;\">" . __("New") . "</button><br />\n\t\t\t\t<input type=\"text\" name=\"captcha_code\" size=\"10\" maxlength=\"6\" class=\"required\" />\n\t\t\t</td>\n\t\t</tr>";
}
echo "\n\t\t<tr class=\"cell2\">\n\t\t\t<td></td>\n\t\t\t<td>\n\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Register") . "\"/>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=\"2\" class=\"cell0 smallFonts\">\n\t\t\t\t" . __("Specifying an email address is not exactly a hard requirement, but it will allow you to reset your password should you forget it. By default, your email is not shown.") . "\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n</form>";
function MakeOptions($fieldName, $checkedIndex, $choicesList)
{
    $checks[$checkedIndex] = " checked=\"checked\"";
    foreach ($choicesList as $key => $val) {
        $result .= format("\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" name=\"{1}\" value=\"{0}\"{2} />\n\t\t\t\t\t\t{3}\n\t\t\t\t\t</label>", $key, $fieldName, $checks[$key], $val);
    }
    return $result;
}
Пример #10
0
        # output some stuff to make sure it's not buffered in the browser, hmm, would be nice to find a better way for this
        for ($i = 0; $i < 10000; ++$i) {
            print '  ' . "\n";
        }
        flush();
        @ob_end_flush();
    }
    flush();
}
$dbversion = getConfig('version');
if (!$dbversion) {
    $dbversion = 'Older than 1.4.1';
}
output('<p class="information">' . $GLOBALS['I18N']->get('Your database version') . ': ' . $dbversion . '</p>');
if ($GLOBALS['database_module'] == 'mysql.inc') {
    print Warn(s('Please edit your config file and change "mysql.inc" to "mysqli.inc" to avoid future PHP incompatibility') . resourceLink('http://resources.phplist.com/system/mysql-mysqli-update'));
}
if ($dbversion == VERSION) {
    output($GLOBALS['I18N']->get('Your database is already the correct version, there is no need to upgrade'));
    print '<p>' . PageLinkAjax('upgrade&update=tlds', s('update Top Level Domains'), '', 'button') . '</p>';
    print subscribeToAnnouncementsForm();
} elseif (isset($_GET['doit']) && $_GET['doit'] == 'yes') {
    $success = 1;
    # once we are off, this should not be interrupted
    ignore_user_abort(1);
    # rename tables if we are using the prefix
    include dirname(__FILE__) . '/structure.php';
    while (list($table, $value) = each($DBstruct)) {
        set_time_limit(500);
        if (isset($table_prefix)) {
            if (Sql_Table_exists($table) && !Sql_Table_Exists($tables[$table])) {
Пример #11
0
    $_POST['name'] = '';
    $_POST['email'] = '';
    $_POST['sex'] = 2;
    $_POST['autologin'] = 0;
}
$kuriseed = crc32(KURIKEY . microtime());
srand($kuriseed);
$check = time();
$kurichallenge = "{$kuriseed}|{$check}|" . rand(3, 12);
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$kurichallenge = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, md5(KURIKEY . $check, true), $kurichallenge, MCRYPT_MODE_ECB, $iv);
$kurichallenge = base64_encode($kurichallenge);
$kuridata = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, md5(KURIKEY, true), "{$kuriseed}|{$check}|{$kurichallenge}", MCRYPT_MODE_ECB, $iv);
$kuridata = base64_encode($kuridata);
$fields = array('username' => "<input type=\"text\" name=\"name\" maxlength=20 size=24 value=\"" . htmlspecialchars($_POST['name']) . "\" class=\"required\">", 'password' => "<input type=\"password\" name=\"pass\" size=24 class=\"required\">", 'password2' => "<input type=\"password\" name=\"pass2\" size=24 class=\"required\">", 'email' => "<input type=\"email\" name=\"email\" value=\"" . htmlspecialchars($_POST['email']) . "\" maxlength=\"60\" size=24>", 'sex' => MakeOptions("sex", $_POST['sex'], $sexes), 'readfaq' => "<label><input type=\"checkbox\" name=\"readFaq\">" . format(__("I have read the {0}FAQ{1}"), "<a href=\"" . actionLink("faq") . "\">", "</a>") . "</label>", 'kurichallenge' => "<img src=\"" . resourceLink("kurichallenge.php?data=" . urlencode($kuridata)) . "\" alt=\"[reload the page if the image fails to load]\"><br>\n\t\t<input type=\"text\" name=\"kurichallenge\" size=\"10\" maxlength=\"6\" class=\"required\">\n\t\t<input type=\"hidden\" name=\"kuridata\" value=\"" . htmlspecialchars($kuridata) . "\">", 'autologin' => "<label><input type=\"checkbox\" checked=\"checked\" name=\"autologin\"" . ($_POST['autologin'] ? ' checked="checked"' : '') . ">" . __("Log in afterwards") . "</label>", 'btnRegister' => "<input type=\"submit\" name=\"register\" value=\"" . __("Register") . "\">");
echo "<form action=\"" . htmlentities(actionLink("register")) . "\" method=\"post\">";
RenderTemplate('form_register', array('fields' => $fields));
echo "<span style=\"display : none;\"><input type=\"checkbox\" name=\"likesCake\"> I am a robot</span></form>";
function MakeOptions($fieldName, $checkedIndex, $choicesList)
{
    $checks[$checkedIndex] = " checked=\"checked\"";
    foreach ($choicesList as $key => $val) {
        $result .= format("\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" name=\"{1}\" value=\"{0}\"{2}>\n\t\t\t\t\t\t{3}\n\t\t\t\t\t</label>", $key, $fieldName, $checks[$key], $val);
    }
    return $result;
}
function IsProxy()
{
    if ($_SERVER['HTTP_X_FORWARDED_FOR'] && $_SERVER['HTTP_X_FORWARDED_FOR'] != $_SERVER['REMOTE_ADDR']) {
        return true;
Пример #12
0
function BuildPage($page, $id)
{
    global $selectedTab, $loguser;
    //TODO: This should be done in JS.
    //So that a user who doesn't have Javascript will see all the tabs.
    $display = $id != $selectedTab ? " style=\"display: none;\"" : "";
    $cellClass = 0;
    $output = "<table class=\"outline margin width50 eptable\" id=\"" . $id . "\"" . $display . ">\n";
    foreach ($page as $pageID => $section) {
        $secClass = $section["class"];
        $output .= "<tr class=\"header0 {$secClass}\"><th colspan=\"2\">" . $section['name'] . "</th></tr>\n";
        foreach ($section['items'] as $field => $item) {
            $output .= "<tr class=\"cell{$cellClass} {$secClass}\" >\n";
            $output .= "<td>\n";
            if (isset($item["fail"])) {
                $output .= "[ERROR] ";
            }
            if ($item['type'] != "checkbox") {
                $output .= "<label for=\"" . $field . "\">" . $item['caption'] . "</label>\n";
            }
            if (isset($item['hint'])) {
                $output .= "<img src=\"" . resourceLink("img/icons/icon5.png") . "\" title=\"" . $item['hint'] . "\" alt=\"[?]\" />\n";
            }
            $output .= "</td>\n";
            $output .= "<td>\n";
            if (isset($item['before'])) {
                $output .= " " . $item['before'];
            }
            // Yes, some cases are missing the break; at the end.
            // This is intentional, but I don't think it's a good idea...
            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 ($item['type'] == "password") {
                        $item['extra'] = "/ " . __("Repeat:") . " <input type=\"password\" name=\"repeat" . $field . "\" size=\"" . $item['size'] . "\" maxlength=\"" . $item['length'] . "\" />";
                    }
                case "passwordonce":
                    if (!isset($item['size'])) {
                        $item['size'] = 13;
                    }
                    if (!isset($item['length'])) {
                        $item['length'] = 32;
                    }
                    if ($item["type"] == "passwordonce") {
                        $item["type"] = "password";
                    }
                case "color":
                case "text":
                    $output .= "<input id=\"" . $field . "\" name=\"" . $field . "\" type=\"" . $item['type'] . "\" value=\"" . htmlspecialchars($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%;\">" . htmlspecialchars($item['value']) . "</textarea>";
                    break;
                case "checkbox":
                    $output .= "<label><input id=\"" . $field . "\" name=\"" . $field . "\" type=\"checkbox\"";
                    if (isset($item['negative']) && !$item['value'] || !isset($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 (isset($item['extra'])) {
                $output .= " " . $item['extra'];
            }
            $output .= "</td>\n";
            $output .= "</tr>\n";
            $cellClass = ($cellClass + 1) % 2;
        }
    }
    $output .= "</table>";
    Write($output);
}
Пример #13
0
function makeAnncBar()
{
    global $loguserid;
    $anncforum = Settings::get('anncForum');
    if ($anncforum > 0) {
        $annc = Query("\tSELECT \n\t\t\t\t\t\t\tt.id, t.title, t.icon, t.poll, t.forum,\n\t\t\t\t\t\t\tt.date anncdate,\n\t\t\t\t\t\t\t" . ($loguserid ? "tr.date readdate," : '') . "\n\t\t\t\t\t\t\tu.(_userfields)\n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t{threads} t \n\t\t\t\t\t\t\t" . ($loguserid ? "LEFT JOIN {threadsread} tr ON tr.thread=t.id AND tr.id={1}" : '') . "\n\t\t\t\t\t\t\tLEFT JOIN {users} u ON u.id=t.user\n\t\t\t\t\t\tWHERE forum={0}\n\t\t\t\t\t\tORDER BY anncdate DESC LIMIT 1", $anncforum, $loguserid);
        if ($annc && NumRows($annc)) {
            $annc = Fetch($annc);
            $adata = array();
            $adata['new'] = '';
            if (!$loguserid && $annc['anncdate'] > time() - 900 || $loguserid && $annc['anncdate'] > $annc['readdate']) {
                $adata['new'] = "<div class=\"statusIcon new\"></div>";
            }
            $adata['poll'] = $annc['poll'] ? "<img src=\"" . resourceLink('img/poll.png') . "\" alt=\"Poll\"/> " : '';
            $adata['link'] = MakeThreadLink($annc);
            $user = getDataPrefix($annc, 'u_');
            $adata['user'] = UserLink($user);
            $adata['date'] = formatdate($annc['anncdate']);
            RenderTemplate('anncbar', array('annc' => $adata));
        }
    }
}
Пример #14
0
<script type="text/javascript" src="<?php 
print resourceLink("plugins/embeds/swf.js");
?>
"></script>
<link rel="stylesheet" type="text/css" href="<?php 
print resourceLink("plugins/embeds/swf.css");
?>
" />

Пример #15
0
        }
    } 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>";
    }
    $result .= "\n</select>";
    return $result;
}
<?php

$base = $_GET['id'];
if (!isset($base) || strpos($base, ".") !== FALSE) {
    Kill("Invalid base layout.");
}
$basefile = "plugins/layoutmaker/bases/" . $base . ".php";
if (is_file($basefile)) {
    include $basefile;
} else {
    Kill("Invalid base layout.");
}
write("\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" . resourceLink("plugins/layoutmaker/layoutmaker.css") . "\" />\n");
$parmFields = "";
foreach ($parameters as $id => $settings) {
    if ($settings['hidden']) {
        continue;
    }
    $label = "<label>" . ($settings['label'] ? $settings['label'] . "</label>" : "");
    $extrasA = "";
    $extrasB = "";
    $input = "type=\"text\"";
    if ($id == "ID") {
        $settings['default'] = $loguserid;
    }
    $pxem = "";
    if ($settings['pxem']) {
        $pxem = format("\n\t\t\t\t<select id=\"{0}TYPE\" name=\"{0}TYPE\" onchange=\"Update()\">\n\t\t\t\t\t<option value=\"px\">px</option>\n\t\t\t\t\t<option value=\"em\">em</option>\n\t\t\t\t</select>\n", $id);
    }
    switch ($settings['type']) {
        case "int":
Пример #17
0
        if ($iconid == $i) {
            $check = "checked=\"checked\" ";
        }
        $icons .= "\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {$check} name=\"iconid\" value=\"{$i}\">\n\t\t\t\t\t\t<img src=\"" . resourceLink("img/icons/icon{$i}.png") . "\" alt=\"Icon {$i}\" onclick=\"javascript:void()\">\n\t\t\t\t\t</label>";
        $i++;
    }
    $check[0] = "";
    $check[1] = "";
    if ($iconid == 0) {
        $check[0] = "checked=\"checked\" ";
    }
    if ($iconid == 255) {
        $check[1] = "checked=\"checked\" ";
    }
    $iconSettings = "\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {$check[0]} name=\"iconid\" value=\"0\">\n\t\t\t\t\t\t<span>" . __("None") . "</span>\n\t\t\t\t\t</label>\n\t\t\t\t\t{$icons}\n\t\t\t\t\t<br/>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {$check[1]} 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\" size=60 maxlength=\"100\" value=\"" . htmlspecialchars($iconurl) . "\">";
    $fields['title'] = "<input type=\"text\" id=\"tit\" name=\"title\" size=80 maxlength=\"60\" value=\"" . htmlspecialchars($thread['title']) . "\">";
    $fields['icon'] = $iconSettings;
}
if ($canClose) {
    $fields['closed'] = "<label><input type=\"checkbox\" name=\"isClosed\" " . ($thread['closed'] ? " checked=\"checked\"" : "") . "> " . __('Closed') . "</label>";
}
if ($canStick) {
    $fields['sticky'] = "<label><input type=\"checkbox\" name=\"isSticky\" " . ($thread['sticky'] ? " checked=\"checked\"" : "") . "> " . __('Sticky') . "</label>";
}
if ($canMove) {
    $fields['forum'] = makeForumList('moveTo', $thread['forum']);
}
$fields['btnEditThread'] = "<input type=\"submit\" name=\"actionedit\" value=\"" . __("Edit") . "\">";
echo "\n\t<script src=\"" . resourceLink("js/threadtagging.js") . "\"></script>\n\t<form action=\"" . htmlentities(actionLink("editthread")) . "\" method=\"post\">";
RenderTemplate('form_editthread', array('fields' => $fields, 'canRename' => $canRename, 'canClose' => $canClose, 'canStick' => $canStick, 'canMove' => $canMove));
echo "\n\t\t<input type=\"hidden\" name=\"id\" value=\"{$tid}\">\n\t\t<input type=\"hidden\" name=\"key\" value=\"" . $loguser['token'] . "\">\n\t\t<input type=\"hidden\" name=\"ref\" value=\"" . htmlspecialchars($_SERVER['HTTP_REFERER']) . "\">\n\t</form>";
Пример #18
0
	<script type="text/javascript">boardroot = <?php 
print json_encode(BOARD_ROOT);
?>
;</script>

	<?php 
$bucket = "pageHeader";
include "./lib/pluginloader.php";
?>
	
	<?php 
if ($mobileLayout) {
    ?>
	<meta name="viewport" content="user-scalable=yes, initial-scale=1.0, width=device-width">
	<script type="text/javascript" src="<?php 
    echo resourceLink('js/mobile.js');
    ?>
"></script>
	<?php 
    if ($oldAndroid) {
        ?>
	<style type="text/css"> 
	#mobile-sidebar { height: auto!important; max-height: none!important; } 
	#realbody { max-height: none!important; max-width: none!important; overflow: scroll!important; } 
	</style>
	<?php 
    }
    ?>
	
	<?php 
}
Пример #19
0
$mcTitles = Settings::pluginGet("titles");
$mcTitles = explode("\n", $mcTitles);
//Remove empty strings
$mcTitles = array_map('trim', $mcTitles);
$mcTitles = array_filter($mcTitles);
//Choose one randomly!
if (count($mcTitles)) {
    $mcTitle = $mcTitles[array_rand($mcTitles)];
} else {
    $mcTitle = "Add titles in plugin settings!";
}
?>

	<script type="text/javascript" src="<?php 
print resourceLink("plugins/mctitles/makeTitle.js");
?>
"></script>
	<script type="text/javascript">
		window.addEventListener("load", function() {
			makeMcTitle(<?php 
print json_encode($mcTitle);
?>
);
		}, false);
	</script>
	<link rel="stylesheet" type="text/css" href="<?php 
print resourceLink("plugins/mctitles/mctitles.css");
?>
" />
Пример #20
0
    }
}
$countdata = Query("SELECT theme, COUNT(id) num FROM {users} GROUP BY theme");
while ($c = Fetch($countdata)) {
    $themes[$c['theme']]['num'] = $c['num'];
}
asort($themes);
foreach ($themes as $themeKey => $themeData) {
    $themeName = $themeData['name'];
    $themeAuthor = $themeData['author'];
    $numUsers = $themeData['num'];
    $preview = "themes/" . $themeKey . "/preview.png";
    if (!is_file($preview)) {
        $preview = "img/nopreview.png";
    }
    $preview = resourceLink($preview);
    $preview = "<img src=\"" . $preview . "\" alt=\"" . $themeName . "\" style=\"margin-bottom: 0.5em\">";
    if ($themeAuthor) {
        $byline = "<br>" . nl2br($themeAuthor);
    } else {
        $byline = "";
    }
    if ($themeKey == $user['theme']) {
        $selected = " checked=\"checked\"";
    } else {
        $selected = "";
    }
    $themeList .= format("\n\t<div style=\"display: inline-block;\" class=\"theme\" title=\"{0}\">\n\t\t<input style=\"display: none;\" type=\"radio\" name=\"theme\" value=\"{3}\"{4} id=\"{3}\" onchange=\"ChangeTheme(this.value);\" />\n\t\t<label style=\"display: inline-block; clear: left; padding: 0.5em; {6} width: 260px; vertical-align: top\" onmousedown=\"void();\" for=\"{3}\">\n\t\t\t{2}<br />\n\t\t\t<strong>{0}</strong>\n\t\t\t{1}<br />\n\t\t\t{5}\n\t\t</label>\n\t</div>\n", $themeName, $byline, $preview, $themeKey, $selected, Plural($numUsers, "user"), "");
}
if (!isset($selectedTab)) {
    $selectedTab = "general";
Пример #21
0
function IP2C($ip)
{
    global $dblink;
    //This nonsense is because ips can be greater than 2^31, which will be interpreted as negative numbers by PHP.
    $ipl = ip2long($ip);
    $r = Fetch(Query("SELECT * \n\t\t\t\t FROM {ip2c}\n\t\t\t\t WHERE ip_from <= {0s} \n\t\t\t\t ORDER BY ip_from DESC\n\t\t\t\t LIMIT 1", sprintf("%u", $ipl)));
    if ($r && $r["ip_to"] >= ip2long_better($ip)) {
        return " <img src=\"" . resourceLink("img/flags/" . strtolower($r['cc']) . ".png") . "\" alt=\"" . $r['cc'] . "\" title=\"" . $r['cc'] . "\" />";
    } else {
        return "";
    }
}
Пример #22
0
function listThread($thread, $cellClass, $dostickies = true, $showforum = false)
{
    global $haveStickies, $loguserid, $loguser, $misc;
    $forumList = "";
    $starter = getDataPrefix($thread, "su_");
    $last = getDataPrefix($thread, "lu_");
    $NewIcon = "";
    $newstuff = 0;
    if ($thread['closed']) {
        $NewIcon = "off";
    }
    if ($thread['replies'] >= $misc['hotcount']) {
        $NewIcon .= "hot";
    }
    if (!$loguserid && $thread['lastpostdate'] > time() - 900 || $loguserid && $thread['lastpostdate'] > $thread['readdate'] && !$isIgnored) {
        $NewIcon .= "new";
        $newstuff++;
    } else {
        if (!$thread['closed'] && !$thread['sticky'] && Settings::get("oldThreadThreshold") > 0 && $thread['lastpostdate'] < time() - 2592000 * Settings::get("oldThreadThreshold")) {
            $NewIcon = "old";
        }
    }
    if ($NewIcon) {
        $NewIcon = "<img src=\"" . resourceLink("img/status/" . $NewIcon . ".png") . "\" alt=\"\"/>";
    }
    if ($thread['sticky'] == 0 && $haveStickies == 1 && $dostickies) {
        $haveStickies = 2;
        $forumList .= "<tr class=\"header1\"><th colspan=\"" . ($showforum ? '8' : '7') . "\" style=\"height: 6px;\"></th></tr>";
    }
    if ($thread['sticky'] && $haveStickies == 0) {
        $haveStickies = 1;
    }
    $poll = $thread['poll'] ? "<img src=\"" . resourceLink("img/poll.png") . "\" alt=\"Poll\"/> " : "";
    $n = 4;
    $total = $thread['replies'];
    $ppp = $loguser['postsperpage'];
    if (!$ppp) {
        $ppp = 20;
    }
    $numpages = floor($total / $ppp);
    $pl = "";
    if ($numpages <= $n * 2) {
        for ($i = 1; $i <= $numpages; $i++) {
            $pl .= " " . actionLinkTag($i + 1, "thread", $thread['id'], "from=" . $i * $ppp);
        }
    } else {
        for ($i = 1; $i < $n; $i++) {
            $pl .= " " . actionLinkTag($i + 1, "thread", $thread['id'], "from=" . $i * $ppp);
        }
        $pl .= " &hellip; ";
        for ($i = $numpages - $n + 1; $i <= $numpages; $i++) {
            $pl .= " " . actionLinkTag($i + 1, "thread", $thread['id'], "from=" . $i * $ppp);
        }
    }
    if ($pl) {
        $pl = " <span class=\"smallFonts\">[" . actionLinkTag(1, "thread", $thread['id']) . $pl . "]</span>";
    }
    $lastLink = "";
    if ($thread['lastpostid']) {
        $lastLink = " " . actionLinkTag("&raquo;", "post", $thread['lastpostid']);
    }
    $threadlink = makeThreadLink($thread);
    $forumcell = "";
    if ($showforum) {
        $forumcell = " in " . actionLinkTag(htmlspecialchars($thread["f_title"]), "forum", $thread["f_id"]);
    }
    $forumList .= "\n\t<tr class=\"cell{$cellClass}\">\n\t\t<td>\n\t\t\t{$NewIcon}\n\t\t\t{$poll}\n\t\t\t{$threadlink} {$pl}<br>\n\t\t\t<small>by " . UserLink($starter) . $forumcell . " -- " . Plural($thread['replies'], 'reply') . "</small>\n\t\t</td>\n\t\t<td class=\"smallFonts center\">\n\t\t\t" . formatdate($thread['lastpostdate']) . "<br />\n\t\t\t" . __("by") . " " . UserLink($last) . " {$lastLink}</td>\n\t</tr>";
    return $forumList;
}
Пример #23
0
            }
            WriteCategoryEditContents($cid);
            dieAjax('');
            break;
    }
}
//Main code.
?>
	<style type="text/css">
		.permselect, .permselect > option {color: black!important;}
		.perm { display: inline-block; width: 100%; box-sizing: border-box; -moz-box-sizing: border-box; padding-right: 7px; }
		.perm .permselect { float: right; }
	</style>
<?php 
echo '
<script src="' . resourceLink('js/editfora.js') . '" type="text/javascript"></script>
<div id="editcontent" style="float: right; width: 49.7%;">
	&nbsp;
</div>
<div id="flist">';
WriteForumTableContents();
echo '
</div>';
//Helper functions
// $fid == -1 means that a new forum should be made :)
function WriteForumEditContents($fid)
{
    global $loguser;
    //Get all categories.
    $rCats = Query("SELECT * FROM {categories} ORDER BY board, corder, id");
    $cats = array();
Пример #24
0
function Fatal_Error($msg, $documentationURL = '')
{
    if (empty($_SESSION['fatalerror'])) {
        $_SESSION['fatalerror'] = 0;
    }
    ++$_SESSION['fatalerror'];
    header('Fatal error', true, 509);
    if ($_SESSION['fatalerror'] > 5) {
        $_SESSION['logout_error'] = s('Too many errors, please login again');
        Redirect('logout&err=2');
    }
    if ($GLOBALS['commandline']) {
        @ob_end_clean();
        print "\n" . $GLOBALS['I18N']->get('fatalerror') . ': ' . strip_tags($msg) . "\n";
        @ob_start();
    } else {
        if (isset($GLOBALS['I18N']) && is_object($GLOBALS['I18N'])) {
            print '<div align="center" class="error">' . $GLOBALS['I18N']->get('fatalerror') . ": {$msg} ";
        } else {
            print '<div align="center" class="error">' . "Fatal Error: {$msg} ";
        }
        if (!empty($documentationURL)) {
            print resourceLink($documentationURL);
        }
        print '</div>';
        foreach ($GLOBALS['plugins'] as $pluginname => $plugin) {
            $plugin->processError($msg);
        }
    }
    # include "footer.inc";
    # exit;
    return 0;
}
Пример #25
0
             }
         }
     }
     /*checkForImage($layout_logopic, true, "logos/logo_$theme.png");
     	checkForImage($layout_logopic, true, "logos/logo_$theme.jpg");
     	checkForImage($layout_logopic, true, "logos/logo_$theme.gif");
     	checkForImage($layout_logopic, true, "logos/logo.png");
     	checkForImage($layout_logopic, true, "logos/logo.jpg");
     	checkForImage($layout_logopic, true, "logos/logo.gif");
     	checkForImage($layout_logopic, false, "themes/$theme/logo.png");
     	checkForImage($layout_logopic, false, "themes/$theme/logo.jpg");
     	checkForImage($layout_logopic, false, "themes/$theme/logo.gif");
     	checkForImage($layout_logopic, false, "themes/$theme/logo.png");
     	checkForImage($layout_logopic, false, "img/logo.png");*/
     $layout_logopic = 'img/logo.png';
     die(resourceLink($themeFile) . "|" . $layout_logopic);
 } elseif ($action == "srl") {
     $qPost = "select currentrevision, thread from {posts} where id={0}";
     $rPost = Query($qPost, $id);
     if (NumRows($rPost)) {
         $post = Fetch($rPost);
     } else {
         die(format(__("Unknown post ID #{0}."), $id) . " " . $hideTricks);
     }
     $qThread = "select forum from {threads} where id={0}";
     $rThread = Query($qThread, $post['thread']);
     $thread = Fetch($rThread);
     if (!HasPermission('forum.viewforum', $thread['forum'])) {
         die('No.');
     }
     if (!HasPermission('mod.editposts', $thread['forum'])) {
Пример #26
0
        $_POST['iconid'] = 0;
    } else {
        $_POST['iconid'] = 255;
        $_POST['iconurl'] = $thread['icon'];
    }
}
//ICONS!
$icons = "";
$i = 1;
while (is_file("img/icons/icon" . $i . ".png")) {
    $check = "";
    if ($_POST['iconid'] == $i) {
        $check = "checked=\"checked\" ";
    }
    $icons .= "\t<label>\n\t\t\t\t\t<input type=\"radio\" {$check} name=\"iconid\" value=\"{$i}\" />\n\t\t\t\t\t<img src=\"" . resourceLink("img/icons/icon{$i}.png") . "\" alt=\"Icon {$i}\" onclick=\"javascript:void()\" />\n\t\t\t\t</label>";
    $i++;
}
$check[0] = "";
$check[1] = "";
if ($_POST['iconid'] == 0) {
    $check[0] = "checked=\"checked\" ";
}
if ($_POST['iconid'] == 255) {
    $check[1] = "checked=\"checked\" ";
    $iconurl = $_POST['iconurl'];
}
if ($canMod) {
    echo "\n\t<script src=\"" . resourceLink("js/threadtagging.js") . "\"></script>\n\t<form action=\"" . actionLink("editthread") . "\" 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 id=\"threadTitleContainer\">\n\t\t\t\t\t<input type=\"text\" id=\"tit\" name=\"title\" style=\"width: 98%;\" maxlength=\"60\" value=\"" . htmlspecialchars($_POST['title']) . "\" />\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\" {$check[0]} 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{$icons}\n\t\t\t\t\t<br/>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {$check[1]} 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=\"" . htmlspecialchars($iconurl) . "\" />\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" . __("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\" " . ($thread['closed'] ? " checked=\"checked\"" : "") . " />\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\" " . ($thread['sticky'] ? " checked=\"checked\"" : "") . " />\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=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Move") . "\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t" . makeForumList('moveTo', $thread["forum"]) . "\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=\"asdf\" value=\"" . __("Edit") . "\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$tid}\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"key\" value=\"{$loguser["token"]}\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"edit\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</form>";
} else {
    echo "\n\t<script src=\"" . resourceLink("js/threadtagging.js") . "\"></script>\n\t<form action=\"" . actionLink("editthread") . "\" 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=\"" . htmlspecialchars($_POST['title']) . "\" />\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\" {$check[0]} 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{$icons}\n\t\t\t\t\t<br/>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"radio\" {$check[1]} 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=\"" . htmlspecialchars($iconurl) . "\" />\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=\"asdf\" value=\"" . __("Edit") . "\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$tid}\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"key\" value=\"{$loguser["token"]}\" />\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"edit\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</form>";
}
Пример #27
0
		<input type="text" name="pollOption[' . $i . ']" value="' . $opttext . '" size=48 maxlength=40>
		&nbsp;Color: <input type="text" name="pollColor[' . $i . ']" value="' . $color . '" size=10 maxlength=7 class="color {hash:true,required:false,pickerFaceColor:\'black\',pickerFace:3,pickerBorder:0,pickerInsetColor:\'black\',pickerPosition:\'left\',pickerMode:\'HVS\'}">
		&nbsp; <input type="submit" name="pollRemove[' . $i . ']" value="&#xD7;" onclick="removeOption(this.parentNode);return false;">
	</div>';
    }
}
$pollSettings .= '</div>';
$pollSettings .= '<input type="submit" name="pollAdd" value="' . __('Add option') . '" onclick="addOption();return false;">';
$moodSelects = array();
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={0} order by mid asc", $loguserid);
while ($mood = Fetch($rMoods)) {
    $moodOptions .= format("\n\t<option {0} value=\"{1}\">{2}</option>\n", $moodSelects[$mood['mid']], $mood['mid'], htmlspecialchars($mood['name']));
}
$mod_lock = '';
$mod_stick = '';
if (HasPermission('mod.closethreads', $forum['id'])) {
    $mod_lock = "<label><input type=\"checkbox\" " . getCheck("lock") . " name=\"lock\">&nbsp;" . __("Close thread", 1) . "</label>\n";
}
if (HasPermission('mod.stickthreads', $forum['id'])) {
    $mod_stick = "<label><input type=\"checkbox\" " . getCheck("stick") . "  name=\"stick\">&nbsp;" . __("Sticky", 1) . "</label>\n";
}
$fields = array('title' => "<input type=\"text\" name=\"title\" size=80 maxlength=\"60\" value=\"{$trefill}\">", 'icon' => $iconSettings, 'pollQuestion' => "<input type=\"text\" name=\"pollQuestion\" value=\"" . htmlspecialchars($_POST['pollQuestion']) . "\" size=80 maxlength=\"100\">", 'pollOptions' => $pollSettings, 'pollMultivote' => "<label><input type=\"checkbox\" " . ($_POST['multivote'] ? "checked=\"checked\"" : "") . " name=\"multivote\">&nbsp;" . __("Multivote", 1) . "</label>", 'text' => "<textarea id=\"text\" name=\"text\" rows=\"16\">\n{$prefill}</textarea>", 'mood' => "<select size=1 name=\"mood\">" . $moodOptions . "</select>", 'nopl' => "<label><input type=\"checkbox\" " . getCheck('nopl') . " name=\"nopl\">&nbsp;" . __("Disable post layout", 1) . "</label>", 'nosm' => "<label><input type=\"checkbox\" " . getCheck('nosm') . " name=\"nosm\">&nbsp;" . __("Disable smilies", 1) . "</label>", 'lock' => $mod_lock, 'stick' => $mod_stick, 'btnPost' => "<input type=\"submit\" name=\"actionpost\" value=\"" . __("Post") . "\">", 'btnPreview' => "<input type=\"submit\" name=\"actionpreview\" value=\"" . __("Preview") . "\">", 'btnAddPoll' => "<input type=\"submit\" name=\"addpoll\" value=\"" . __("Add poll") . "\" onclick=\"addPoll();return false;\">", 'btnRemovePoll' => "<input type=\"submit\" name=\"deletepoll\" value=\"" . __("Remove poll") . "\" onclick=\"removePoll();return false;\">");
echo "\n\t<script src=\"" . resourceLink("js/threadtagging.js") . "\"></script>\n\t<script src=\"" . resourceLink('js/polleditor.js') . "\"></script>\n\t<form name=\"postform\" action=\"" . htmlentities(actionLink("newthread", $fid)) . "\" method=\"post\" enctype=\"multipart/form-data\">";
RenderTemplate('form_newthread', array('fields' => $fields, 'pollMode' => (int) $_POST['poll']));
PostAttachForm($attachs);
echo "\n\t\t<input type=\"hidden\" name=\"poll\" id=\"pollModeVal\" value=\"" . (int) $_POST['poll'] . "\">\n\t</form>\n\t<script type=\"text/javascript\">\n\t\tdocument.postform.text.focus();\n\t</script>\n";
LoadPostToolbar();
Пример #28
0
function checkForImage(&$image, $external, $file)
{
    global $dataDir, $dataUrl;
    if ($image) {
        return;
    }
    if ($external) {
        if (file_exists($dataDir . $file)) {
            $image = $dataUrl . $file;
        }
    } else {
        if (file_exists($file)) {
            $image = resourceLink($file);
        }
    }
}
Пример #29
0
} elseif ($finishSending < $currentTime) {
    $allReady = false;
    $GLOBALS['pagefooter']['addtoqueue'] .= '<script type="text/javascript">
  $("#addtoqueue").append(\'<div class="missing">' . s('This campaign is scheduled to stop sending in the past. No mails will be sent.') . '<br/>' . PageLinkButton('send&amp;id=' . $messagedata['id'] . '&amp;tab=Scheduling', s('Review Scheduling')) . '</div>\');
  </script>';
}
if (empty($messagedata['targetlist'])) {
    $allReady = false;
    $GLOBALS['pagefooter']['addtoqueue'] .= '<script type="text/javascript">
  $("#addtoqueue").append(\'<div class="missing">' . $GLOBALS['I18N']->get('destination lists missing') . '</div>\');
  </script>';
}
if ($hasClickTrackLinks && BLOCK_PASTED_CLICKTRACKLINKS) {
    $allReady = false;
    $GLOBALS['pagefooter']['addtoqueue'] .= '<script type="text/javascript">
  $("#addtoqueue").append(\'<div class="missing">' . s('Content contains click track links.') . resourceLink('http://resources.phplist.com/documentation/errors/pasteclicktrack') . '</div>\');
  </script>';
}
foreach ($GLOBALS['plugins'] as $pluginname => $plugin) {
    $pluginerror = '';
    $pluginerror = $plugin->allowMessageToBeQueued($messagedata);
    if ($pluginerror) {
        $allReady = false;
        $pluginerror = preg_replace("/\n/", '', $pluginerror);
        $GLOBALS['pagefooter']['addtoqueue'] .= '<script type="text/javascript">
    $("#addtoqueue").append(\'<div class="missing">' . $pluginerror . '</div>\');
    </script>';
    }
}
if ($allReady) {
    $GLOBALS['pagefooter']['addtoqueue'] .= '<script type="text/javascript">
Пример #30
0
"></script>
	<script type="text/javascript" src="<?php 
print resourceLink("js/spectrum.js");
?>
"></script>
	<script type="text/javascript">
		boardroot = <?php 
print json_encode($boardroot);
?>
;
	</script>

	<?php 
if (file_exists("layouts/{$layout}/style.css")) {
    echo '<link rel="stylesheet" href="' . resourceLink("layouts/{$layout}/style.css") . '" type="text/css" />';
}
if (file_exists("layouts/{$layout}/script.js")) {
    echo '<script type="text/javascript" src="' . resourceLink("layouts/{$layout}/script.js") . '"></script>';
}
?>
	<link rel="stylesheet" type="text/css" id="theme_css" href="<?php 
print resourceLink($layout_themefile);
?>
" />

	<?php 
$bucket = "pageHeader";
include "./lib/pluginloader.php";
?>