Ejemplo n.º 1
0
function doThreadPreview($tid)
{
    global $mobileLayout;
    if ($mobileLayout) {
        return;
    }
    $rPosts = Query("\n\t\tselect\n\t\t\t{posts}.id, {posts}.date, {posts}.num, {posts}.deleted, {posts}.options, {posts}.mood, {posts}.ip,\n\t\t\t{posts_text}.text, {posts_text}.text, {posts_text}.revision,\n\t\t\tu.(_userfields)\n\t\tfrom {posts}\n\t\tleft join {posts_text} on {posts_text}.pid = {posts}.id and {posts_text}.revision = {posts}.currentrevision\n\t\tleft join {users} u on u.id = {posts}.user\n\t\twhere thread={0} and deleted=0\n\t\torder by date desc limit 0, 20", $tid);
    if (NumRows($rPosts)) {
        $posts = "";
        while ($post = Fetch($rPosts)) {
            $cellClass = ($cellClass + 1) % 2;
            $poster = getDataPrefix($post, "u_");
            $nosm = $post['options'] & 2;
            $nobr = $post['options'] & 4;
            $posts .= Format("\n\t\t\t<tr>\n\t\t\t\t<td class=\"cell2\" style=\"width: 15%; vertical-align: top;\">\n\t\t\t\t\t{1}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"cell{0}\">\n\t\t\t\t\t<button style=\"float: right;\" onclick=\"insertQuote({2});\">" . __("Quote") . "</button>\n\t\t\t\t\t<button style=\"float: right;\" onclick=\"insertChanLink({2});\">" . __("Link") . "</button>\n\t\t\t\t\t{3}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t", $cellClass, UserLink($poster), $post['id'], CleanUpPost($post['text'], $poster['name'], $nosm));
        }
        Write("\n\t\t<table class=\"outline margin\">\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"2\">" . __("Thread review") . "</th>\n\t\t\t</tr>\n\t\t\t{0}\n\t\t</table>\n\t", $posts);
    }
}
Ejemplo n.º 2
0
$foo = array();
$foo[__("Theme")] = $themes[$user['theme']];
$foo[__("Items per page")] = Plural($user['postsperpage'], __("post")) . ", " . Plural($user['threadsperpage'], __("thread"));
$profileParts[__("Presentation")] = $foo;
$foo = array();
if ($user['realname']) {
    $foo[__("Real name")] = strip_tags($user['realname']);
}
if ($user['location']) {
    $foo[__("Location")] = strip_tags($user['location']);
}
if ($user['birthday']) {
    $foo[__("Birthday")] = format("{0} ({1} old)", cdate("F j, Y", $user['birthday']), Plural(floor((time() - $user['birthday']) / 86400 / 365.2425), "year"));
}
if ($user['bio']) {
    $foo[__("Bio")] = CleanUpPost($user['bio']);
}
if (count($foo)) {
    $profileParts[__("Personal information")] = $foo;
}
$prepend = "";
$bucket = "profileTable";
include "./lib/pluginloader.php";
write("\n\t<table>\n\t\t<tr>\n\t\t\t<td style=\"width: 60%; border: 0px none; vertical-align: top; padding-right: 1em; padding-bottom: 1em;\">\n\t\t\t\t{0}\n\t\t\t\t<table class=\"outline margin\">\n", $prepend);
$cc = 0;
foreach ($profileParts as $partName => $fields) {
    write("\n\t\t\t\t\t<tr class=\"header0\">\n\t\t\t\t\t\t<th colspan=\"2\">{0}</th>\n\t\t\t\t\t</tr>\n", $partName);
    foreach ($fields as $label => $value) {
        $cc = ($cc + 1) % 2;
        write("\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td class=\"cell2\">{0}</td>\n\t\t\t\t\t\t\t\t<td class=\"cell{2}\">{1}</td>\n\t\t\t\t\t\t\t</tr>\n", str_replace(" ", "&nbsp;", $label), $value, $cc);
    }
Ejemplo n.º 3
0
        $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;
        $nobr = $post['options'] & 4;
        $posts .= Format("\n\t\t<tr>\n\t\t\t<td class=\"cell2\" style=\"width: 15%; vertical-align: top;\">\n\t\t\t\t{1}\n\t\t\t</td>\n\t\t\t<td class=\"cell{0}\">\n\t\t\t\t<button style=\"float: right;\" onclick=\"insertQuote({2});\">" . __("Quote") . "</button>\n\t\t\t\t<button style=\"float: right;\" onclick=\"insertChanLink({2});\">" . __("Link") . "</button>\n\t\t\t\t{3}\n\t\t\t</td>\n\t\t</tr>\n", $cellClass, UserLink($poster), $post['id'], CleanUpPost($post['text'], $poster['name'], $nosm, $nobr));
    }
    Write("\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header0\">\n\t\t\t<th colspan=\"2\">" . __("Thread review") . "</th>\n\t\t</tr>\n\t\t{0}\n\t</table>\n", $posts);
}
MakeCrumbs(array(__("Main") => "./", $forum['title'] => "forum.php?id=" . $fid, $titleandtags => "thread.php?id=" . $tid, __("New reply") => ""), $links);
Ejemplo n.º 4
0
         $post['num'] = $post['posts'];
     }
     $post['posts'] = $post['num'];
     //Disable tags by commenting/removing this part.
     $tags = array("numposts" => $post['num'], "numdays" => floor((time() - $post['regdate']) / 86400), "date" => cdate($dateformat, $post['date']), "rank" => GetRank($post));
     $bucket = "amperTags";
     include "./lib/pluginloader.php";
     $post['posts'] = $rankHax;
     if ($post['postheader'] && !$isBlocked) {
         $postHeader = str_replace('$theme', $theme, ApplyTags(CleanUpPost($post['postheader']), $tags));
     }
     $postText = ApplyTags(CleanUpPost($post['text'], $post['name'], $noSmilies), $tags);
     $bucket = "postMangler";
     include "./lib/pluginloader.php";
     if ($post['signature'] && !$isBlocked) {
         $postFooter = ApplyTags(CleanUpPost($post['signature']), $tags);
         if (!$post['signsep']) {
             $separator = "<br />_________________________<br />";
         } else {
             $separator = "<br />";
         }
     }
     $reply = $postHeader . $postText . $separator . $postFooter;
     die($reply);
 } elseif ($action == "em") {
     $blah = FetchResult("select email from users where id=" . $id . " and showemail=1");
     die(htmlspecialchars($blah));
 } elseif ($action == "vc") {
     $blah = FetchResult("select views from misc");
     die(number_format($blah));
 }
Ejemplo n.º 5
0
echo htmlspecialchars($desc);
?>
</description>
		<atom:link href="<?php 
echo htmlspecialchars($fullurl);
?>
/rss.php" rel="self" type="application/rss+xml" />

<?php 
$entries = Query("\tSELECT \n\t\t\t\t\t\t\tt.id, t.title, \n\t\t\t\t\t\t\tp.date,\n\t\t\t\t\t\t\tpt.text,\n\t\t\t\t\t\t\tsu.name uname, su.displayname udname\n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t{threads} t\n\t\t\t\t\t\t\tLEFT JOIN {posts} p ON p.thread=t.id AND p.id=t.firstpostid\n\t\t\t\t\t\t\tLEFT JOIN {posts_text} pt ON pt.pid=p.id AND pt.revision=p.currentrevision\n\t\t\t\t\t\t\tLEFT JOIN {users} su ON su.id=t.user\n\t\t\t\t\t\tWHERE t.forum={0} AND p.deleted=0\n\t\t\t\t\t\tORDER BY p.date DESC LIMIT 5", $fid);
while ($entry = Fetch($entries)) {
    $tags = ParseThreadTags($entry['title']);
    $title = htmlspecialchars($entry['title']);
    $username = $entry['udname'] ? $entry['udname'] : $entry['uname'];
    $rfcdate = htmlspecialchars(gmdate(DATE_RFC1123, $entry['date']));
    $entryurl = htmlspecialchars($url . actionLink('thread', $entry['id'], '', $tags[0]));
    $text = $entry['text'];
    $text = preg_replace_callback('@\\[youtube\\](.*?)\\[/youtube\\]@si', 'fixyoutube', $text);
    $text = preg_replace('@\\[spoiler.*?\\].*?\\[/spoiler\\]@si', '(spoiler)', $text);
    $text = CleanUpPost($text, $username, true);
    $text = preg_replace('@<img[^>]+?src\\s*=\\s*(["\'])(.*?)\\1[^>]*?>@si', '<a href="$2">(image)</a>', $text);
    $text = preg_replace('@<img[^>]+?src\\s*=\\s*([^\\s>]+?)(\\s+[^>]*?)?>@si', '<a href="$1">(image)</a>', $text);
    $text = preg_replace('@([="\'])\\?page=@si', '$1' . $fullurl . '/?page=', $text);
    $text = str_replace(']]>', ']]&gt;', $text);
    $username = htmlspecialchars($username);
    echo "\n\t\t<item>\n\t\t\t<title>{$title} -- posted by {$username}</title>\n\t\t\t<link>{$entryurl}</link>\n\t\t\t<pubDate>{$rfcdate}</pubDate>\n\t\t\t<description><![CDATA[{$text}]]></description>\n\t\t\t<guid>{$entryurl}</guid>\n\t\t</item>\n";
}
?>
	</channel>
</rss>
Ejemplo n.º 6
0
    $links[] = actionLinkTag(__('Post new'), 'newthread', $forum['id']);
}
MakeCrumbs(array(), $links);
$rThreads = Query("\tSELECT \n\t\t\t\t\t\tt.id, t.title, t.closed, t.replies, t.lastpostid,\n\t\t\t\t\t\tp.id pid, p.date,\n\t\t\t\t\t\tpt.text,\n\t\t\t\t\t\tsu.(_userfields),\n\t\t\t\t\t\tlu.(_userfields)\n\t\t\t\t\tFROM \n\t\t\t\t\t\t{threads} t\n\t\t\t\t\t\tLEFT JOIN {posts} p ON p.thread=t.id AND p.id=t.firstpostid\n\t\t\t\t\t\tLEFT JOIN {posts_text} pt ON pt.pid=p.id AND pt.revision=p.currentrevision\n\t\t\t\t\t\tLEFT JOIN {users} su ON su.id=t.user\n\t\t\t\t\t\tLEFT JOIN {users} lu ON lu.id=t.lastposter\n\t\t\t\t\tWHERE t.forum={0} AND p.deleted=0\n\t\t\t\t\tORDER BY p.date DESC LIMIT {1u}, {2u}", $fid, $from, $tpp);
$numonpage = NumRows($rThreads);
$pagelinks = PageLinks(actionLink('home', '', 'from='), $tpp, $from, $total);
RenderTemplate('pagelinks', array('pagelinks' => $pagelinks, 'position' => 'top'));
while ($thread = Fetch($rThreads)) {
    $pdata = array();
    $starter = getDataPrefix($thread, 'su_');
    $last = getDataPrefix($thread, 'lu_');
    $tags = ParseThreadTags($thread['title']);
    $pdata['title'] = $tags[0];
    $pdata['formattedDate'] = formatdate($thread['date']);
    $pdata['userlink'] = UserLink($starter);
    $pdata['text'] = CleanUpPost($thread['text'], $starter['name'], false, false);
    if (!$thread['replies']) {
        $comments = 'No comments yet';
    } else {
        if ($thread['replies'] < 2) {
            $comments = actionLinkTag('1 comment', 'post', $thread['lastpostid']) . ' (by ' . UserLink($last) . ')';
        } else {
            $comments = actionLinkTag($thread['replies'] . ' comments', 'post', $thread['lastpostid']) . ' (last by ' . UserLink($last) . ')';
        }
    }
    $pdata['comments'] = $comments;
    if ($thread['closed']) {
        $newreply = __('Comment posting closed.');
    } else {
        if (!$loguserid) {
            $newreply = actionLinkTag(__('Log in'), 'login') . __(' to post a comment.');
Ejemplo n.º 7
0
if ($loguser['powerlevel'] < 0) {
    Kill(__("You're banned."));
}
$rFora = Query("select * from {forums} where id={0}", $fid);
if (NumRows($rFora)) {
    $forum = Fetch($rFora);
} else {
    Kill(__("Unknown forum ID."));
}
if ($forum['locked']) {
    Kill(__("This forum is locked."));
}
if ($forum['minpowerthread'] > $loguser['powerlevel']) {
    Kill(__("You are not allowed to post threads in this forum."));
}
if (isset($_POST['text']) || isset($_GET['rulesread']) || $forum["rulespost"] == 0) {
    include "pages/newthread.php";
} else {
    $OnlineUsersFid = $fid;
    $crumbs = new PipeMenu();
    makeForumCrumbs($crumbs, $forum);
    $crumbs->add(new PipeMenuTextEntry(__("New thread")));
    makeBreadcrumbs($crumbs);
    $rPosts = Query("\n\t\t\tSELECT\n\t\t\t\tpt.text\n\t\t\tFROM\n\t\t\t\t{posts} p\n\t\t\t\tLEFT JOIN {posts_text} pt ON pt.pid = p.id AND pt.revision = p.currentrevision\n\t\t\tWHERE p.id={0}", $forum["rulespost"]);
    $post = Fetch($rPosts);
    echo "<div class=\"faq outline margin\" style=\"width: 60%; overflow: auto; margin: auto;\">";
    echo "<h3>Please read the ", htmlspecialchars($forum["title"]), " forum rules before posting a new thread.</h3><br><br>";
    echo CleanUpPost($post["text"]);
    echo "<br><br><br><h3>", actionLinkTag("I've read the rules, continue.", "newthread", $_GET["id"], "rulesread=1"), "</h3>";
    echo "</div>";
}
Ejemplo n.º 8
0
function makePost($post, $type, $params = array())
{
    global $loguser, $loguserid, $usergroups, $isBot, $blocklayouts;
    $poster = getDataPrefix($post, 'u_');
    $post['userlink'] = UserLink($poster);
    LoadBlockLayouts();
    $pltype = Settings::get('postLayoutType');
    $isBlocked = $poster['globalblock'] || $loguser['blocklayouts'] || $post['options'] & 1 || isset($blocklayouts[$poster['id']]);
    $post['type'] = $type;
    $post['formattedDate'] = formatdate($post['date']);
    if (!HasPermission('admin.viewips')) {
        $post['ip'] = '';
    } else {
        $post['ip'] = htmlspecialchars($post['ip']);
    }
    // TODO IP formatting?
    if ($post['deleted'] && $type == POST_NORMAL) {
        $post['deluserlink'] = UserLink(getDataPrefix($post, 'du_'));
        $post['delreason'] = htmlspecialchars($post['reason']);
        $links = array();
        if (HasPermission('mod.deleteposts', $params['fid'])) {
            $links['undelete'] = actionLinkTag(__("Undelete"), "editpost", $post['id'], "delete=2&key=" . $loguser['token']);
            $links['view'] = "<a href=\"#\" onclick=\"replacePost(" . $post['id'] . ",true); return false;\">" . __("View") . "</a>";
        }
        $post['links'] = $links;
        RenderTemplate('postbox_deleted', array('post' => $post));
        return;
    }
    $links = array();
    if ($type != POST_SAMPLE) {
        $forum = $params['fid'];
        $thread = $params['tid'];
        $notclosed = !$post['closed'] || HasPermission('mod.closethreads', $forum);
        $extraLinks = array();
        if (!$isBot) {
            if ($type == POST_DELETED_SNOOP) {
                if ($notclosed && HasPermission('mod.deleteposts', $forum)) {
                    $links['undelete'] = actionLinkTag(__("Undelete"), "editpost", $post['id'], "delete=2&key=" . $loguser['token']);
                }
                $links['close'] = "<a href=\"#\" onclick=\"replacePost(" . $post['id'] . ",false); return false;\">" . __("Close") . "</a>";
            } else {
                if ($type == POST_NORMAL) {
                    if ($notclosed) {
                        if ($loguserid && HasPermission('forum.postreplies', $forum) && !$params['noreplylinks']) {
                            $links['quote'] = actionLinkTag(__("Quote"), "newreply", $thread, "quote=" . $post['id']);
                        }
                        $editrights = 0;
                        if ($poster['id'] == $loguserid && HasPermission('user.editownposts') || HasPermission('mod.editposts', $forum)) {
                            $links['edit'] = actionLinkTag(__("Edit"), "editpost", $post['id']);
                            $editrights++;
                        }
                        if ($poster['id'] == $loguserid && HasPermission('user.deleteownposts') || HasPermission('mod.deleteposts', $forum)) {
                            if ($post['id'] != $post['firstpostid']) {
                                $link = htmlspecialchars(actionLink('editpost', $post['id'], 'delete=1&key=' . $loguser['token']));
                                $onclick = HasPermission('mod.deleteposts', $forum) ? " onclick=\"deletePost(this);return false;\"" : ' onclick="if(!confirm(\'Really delete this post?\'))return false;"';
                                $links['delete'] = "<a href=\"{$link}\"{$onclick}>" . __('Delete') . "</a>";
                            }
                            $editrights++;
                        }
                        if ($editrights < 2 && HasPermission('user.reportposts')) {
                            $links['report'] = actionLinkTag(__('Report'), 'reportpost', $post['id']);
                        }
                    }
                    // plugins should add to $extraLinks
                    $bucket = "topbar";
                    include __DIR__ . "/pluginloader.php";
                }
            }
            $links['extra'] = $extraLinks;
        }
        //Threadlinks for listpost.php
        if ($params['threadlink']) {
            $thread = array();
            $thread['id'] = $post['thread'];
            $thread['title'] = $post['threadname'];
            $thread['forum'] = $post['fid'];
            $post['threadlink'] = makeThreadLink($thread);
        } else {
            $post['threadlink'] = '';
        }
        //Revisions
        if ($post['revision']) {
            $ru_link = UserLink(getDataPrefix($post, "ru_"));
            $revdetail = ' ' . format(__('by {0} on {1}'), $ru_link, formatdate($post['revdate']));
            if (HasPermission('mod.editposts', $forum)) {
                $post['revdetail'] = "<a href=\"javascript:void(0);\" onclick=\"showRevisions(" . $post['id'] . ")\">" . Format(__('rev. {0}'), $post['revision']) . "</a>" . $revdetail;
            } else {
                $post['revdetail'] = Format(__('rev. {0}'), $post['revision']) . $revdetail;
            }
        }
        //</revisions>
    }
    $post['links'] = $links;
    // POST SIDEBAR
    $sidebar = array();
    // quit abusing custom syndromes you unoriginal fuckers
    $poster['title'] = preg_replace('@Affected by \'?.*?Syndrome\'?@si', '', $poster['title']);
    $sidebar['rank'] = GetRank($poster['rankset'], $poster['posts']);
    if ($poster['title']) {
        $sidebar['title'] = strip_tags(CleanUpPost($poster['title'], '', true), '<b><strong><i><em><span><s><del><img><a><br/><br><small>');
    } else {
        $sidebar['title'] = htmlspecialchars($usergroups[$poster['primarygroup']]['title']);
    }
    $sidebar['syndrome'] = GetSyndrome(getActivity($poster['id']));
    if ($post['mood'] > 0) {
        if (file_exists(DATA_DIR . "avatars/" . $poster['id'] . "_" . $post['mood'])) {
            $sidebar['avatar'] = "<img src=\"" . DATA_URL . "avatars/" . $poster['id'] . "_" . $post['mood'] . "\" alt=\"\">";
        }
    } else {
        if ($poster['picture']) {
            $pic = str_replace('$root/', DATA_URL, $poster['picture']);
            $sidebar['avatar'] = "<img src=\"" . htmlspecialchars($pic) . "\" alt=\"\">";
        }
    }
    $lastpost = $poster['lastposttime'] ? timeunits(time() - $poster['lastposttime']) : "none";
    $lastview = timeunits(time() - $poster['lastactivity']);
    if (!$post['num']) {
        $sidebar['posts'] = $poster['posts'];
    } else {
        $sidebar['posts'] = $post['num'] . '/' . $poster['posts'];
    }
    $sidebar['since'] = cdate($loguser['dateformat'], $poster['regdate']);
    $sidebar['lastpost'] = $lastpost;
    $sidebar['lastview'] = $lastview;
    if ($poster['lastactivity'] > time() - 300) {
        $sidebar['isonline'] = __("User is <strong>online</strong>");
    }
    $sidebarExtra = array();
    $bucket = "sidebar";
    include __DIR__ . "/pluginloader.php";
    $sidebar['extra'] = $sidebarExtra;
    $post['sidebar'] = $sidebar;
    // OTHER STUFF
    $post['haslayout'] = false;
    $post['fulllayout'] = false;
    if (!$isBlocked) {
        $poster['postheader'] = $pltype ? trim($poster['postheader']) : '';
        $poster['signature'] = trim($poster['signature']);
        $post['haslayout'] = $poster['postheader'] ? 1 : 0;
        $post['fulllayout'] = $poster['fulllayout'] && $post['haslayout'] && $pltype == 2;
        if (!$post['haslayout'] && $poster['signature']) {
            $poster['signature'] = '<div class="signature">' . $poster['signature'] . '</div>';
        }
    } else {
        $poster['postheader'] = '';
        $poster['signature'] = '';
    }
    $post['contents'] = makePostText($post, $poster);
    //PRINT THE POST!
    RenderTemplate('postbox', array('post' => $post));
}
Ejemplo n.º 9
0
    if ($thread['replies'] != 0) {
        $comments .= " Last by " . UserLink($last) . ". {$lastLink}";
    }
    $newreply = actionLinkTag("Post a comment", "newreply", $thread['id'], "", $thread["title"]);
    if ($thread['sticky']) {
        $forumList .= "<table class='outline margin width100'>";
        $forumList .= "<tr class='cell1'><td style='border: 1px solid #000; padding:16px' colspan='2'>{$posttext}</td></tr>";
        $forumList .= "</table>";
    } else {
        $forumList .= "<table class='outline margin width100'>";
        $forumList .= "\n\t\t<tr class=\"header1\" >\n\t\t\t<th style='text-align:left;'><span style='font-size:15px'>" . $tags[0] . "</span><span style='font-weight:normal;'>{$subtitle}</span></th>\n\t\t\t<th style='text-align:left; width:150px; font-weight:normal;'>Posted by " . UserLink($starter) . "<br>{$postdate}</th>\n\t\t</tr>";
        $forumList .= "<tr class='cell1'><td colspan='2' style='padding:10px'>{$posttext}</td></tr>";
        $forumList .= "<tr class='cell0'><td>{$comments}</td><td style=\"border-left: 0px none;\">{$newreply}</td></tr>";
        $forumList .= "</table>";
    }
}
Write($forumList);
if ($pagelinks) {
    Write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
if ($twoColumns) {
    echo '</td><td style="border: 0px none; vertical-align: top; padding-right: 1em; padding-bottom: 1em;">';
    echo '<table class="outline margin width100">
	<tr class="header0"><th>&nbsp;</th></tr>
	<tr class="cell1"><td style="padding:16px" colspan="2">';
    echo CleanUpPost(Settings::pluginGet("righttext"));
    echo '</td></tr></table>';
    $bucket = "blogxd_rightcolumn";
    include "lib/pluginloader.php";
    echo '</td></tr></table>';
}
Ejemplo n.º 10
0
    $realLen += $realFrom;
    $realFrom = 0;
}
$rComments = Query("SELECT\n\t\tu.(_userfields),\n\t\tuc.id, uc.cid, uc.text, uc.date\n\t\tFROM {usercomments} uc\n\t\tLEFT JOIN {users} u ON u.id = uc.cid\n\t\tWHERE uc.uid={0}\n\t\tORDER BY uc.date ASC LIMIT {1u},{2u}", $id, $realFrom, $realLen);
$pagelinks = PageLinksInverted(actionLink("profile", $id, "from=", $user['name']), $cpp, $from, $total);
$comments = array();
while ($comment = Fetch($rComments)) {
    $cmt = array();
    $deleteLink = '';
    if ($canDeleteComments || $comment['cid'] == $loguserid && HasPermission('user.deleteownusercomments')) {
        $deleteLink = "<small style=\"float: right; margin: 0px 4px;\">" . actionLinkTag("&#x2718;", "profile", $id, "action=delete&cid=" . $comment['id'] . "&token={$loguser['token']}") . "</small>";
    }
    $cmt['deleteLink'] = $deleteLink;
    $cmt['userlink'] = UserLink(getDataPrefix($comment, 'u_'));
    $cmt['formattedDate'] = relativedate($comment['date']);
    $cmt['text'] = CleanUpPost($comment['text']);
    $comments[] = $cmt;
}
$commentField = '';
if ($canComment) {
    $commentField = "\n\t\t<form name=\"commentform\" method=\"post\" action=\"" . htmlentities(actionLink("profile")) . "\">\n\t\t\t<input type=\"hidden\" name=\"id\" value=\"{$id}\">\n\t\t\t<input type=\"text\" name=\"text\" style=\"width: 80%;\" maxlength=\"255\">\n\t\t\t<input type=\"submit\" name=\"actionpost\" value=\"" . __("Post") . "\">\n\t\t\t<input type=\"hidden\" name=\"token\" value=\"{$loguser['token']}\">\n\t\t</form>";
}
RenderTemplate('profile', array('username' => htmlspecialchars($uname), 'userlink' => UserLink($user), 'profileParts' => $profileParts, 'comments' => $comments, 'commentField' => $commentField, 'pagelinks' => $pagelinks));
if (!$mobileLayout) {
    $previewPost['text'] = Settings::get("profilePreviewText");
    $previewPost['num'] = 0;
    $previewPost['id'] = 0;
    foreach ($user as $key => $value) {
        $previewPost['u_' . $key] = $value;
    }
    MakePost($previewPost, POST_SAMPLE);
Ejemplo n.º 11
0
function doThreadPreview($tid, $maxdate = 0)
{
    global $loguser;
    $review = array();
    $ppp = $loguser['postsperpage'] ?: 20;
    $rPosts = Query("\n\t\tselect\n\t\t\t{posts}.id, {posts}.date, {posts}.num, {posts}.deleted, {posts}.options, {posts}.mood, {posts}.ip,\n\t\t\t{posts_text}.text, {posts_text}.text, {posts_text}.revision,\n\t\t\tu.(_userfields), u.(posts)\n\t\tfrom {posts}\n\t\tleft join {posts_text} on {posts_text}.pid = {posts}.id and {posts_text}.revision = {posts}.currentrevision\n\t\tleft join {users} u on u.id = {posts}.user\n\t\twhere thread={0} and deleted=0" . ($maxdate ? ' AND {posts}.date<={1}' : '') . "\n\t\torder by date desc limit 0, {2u}", $tid, $maxdate, $ppp);
    while ($post = Fetch($rPosts)) {
        $pdata = array('id' => $post['id']);
        $poster = getDataPrefix($post, 'u_');
        $pdata['userlink'] = UserLink($poster);
        $pdata['posts'] = $post['num'] . '/' . $poster['posts'];
        $nosm = $post['options'] & 2;
        $pdata['contents'] = CleanUpPost($post['text'], $poster['name'], $nosm);
        $review[] = $pdata;
    }
    RenderTemplate('threadreview', array('review' => $review));
}
Ejemplo n.º 12
0
$profileParts[__("Presentation")] = $foo;
$foo = array();
if ($user['realname']) {
    $foo[__("Real name")] = htmlspecialchars($user['realname']);
}
if ($user['location']) {
    $foo[__("Location")] = htmlspecialchars($user['location']);
}
if ($user['birthday']) {
    $floo[__("Birthday")] = formatBirthday($user['birthday']);
}
if (count($foo)) {
    $profileParts[__("Personal information")] = $foo;
}
if ($user['bio']) {
    $profileParts[__("Bio")] = array("" => CleanUpPost($user['bio'], $user['displayname'] ? $user['displayname'] : $user['name']));
}
$badgersR = Query("select * from {badges} where owner={0} order by color", $id);
if (NumRows($badgersR)) {
    $badgers = "";
    $colors = array("bronze", "silver", "gold", "platinum");
    while ($badger = Fetch($badgersR)) {
        $badgers .= Format("<span class=\"badge {0}\">{1}</span> ", $colors[$badger['color']], $badger['name']);
    }
    $profileParts['General information']['Badges'] = $badgers;
}
$bucket = "profileTable";
include "./lib/pluginloader.php";
if (!$mobileLayout) {
    echo "\n\t<table>\n\t\t<tr>\n\t\t\t<td style=\"width: 60%; border: 0px none; vertical-align: top; padding-right: 1em; padding-bottom: 1em;\">";
}
Ejemplo n.º 13
0
function makePost($post, $type, $params = array())
{
    global $loguser, $loguserid, $blocklayouts, $dataDir, $dataUrl, $mobileLayout;
    $sideBarStuff = "";
    $poster = getDataPrefix($post, "u_");
    LoadBlockLayouts();
    $isBlocked = $poster['globalblock'] || $loguser['blocklayouts'] || $post['options'] & 1 || isset($blocklayouts[$poster['id']]);
    $links = makePostLinks($post, $type, $params);
    if ($post['deleted'] && $type == POST_NORMAL) {
        $meta = format(__("Posted on {0}"), formatdate($post['date']));
        $meta .= __(', deleted');
        if ($post['deletedby']) {
            $db_link = UserLink(getDataPrefix($post, "du_"));
            $meta .= __(' by ') . $db_link;
            if ($post['reason']) {
                $meta .= ': ' . htmlspecialchars($post['reason']);
            }
        }
        if ($mobileLayout) {
            $links->setClass("toolbarMenu");
            echo "\n\t\t\t\t<table class=\"outline margin mobile-postBox\" id=\"post{$post['id']}\">\n\t\t\t\t\t<tr class=\"header0 mobile-postHeader\">\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t{$anchor}\n\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<div class=\"mobile-userAvatarBox\">\n\t\t\t\t\t\t\t\t\t\t\t{$picture}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td class=\"mobile-postInfoCell\" style=\"width: 99%; overflow: hidden;\">\n\t\t\t\t\t\t\t\t\t\t<div style=\"position: relative; height: 40px; top: 0; left: 0;\">\n\t\t\t\t\t\t\t\t\t\t\t<div style=\"position: absolute; top: 0; left: 0;\">\n\t\t\t\t\t\t\t\t\t\t\t\t" . userLink($poster) . "<br />\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"date\">{$meta}</span>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<span style=\"text-align:left; display: none;\" id=\"dyna_{$post['id']}\">\n\t\t\t\t\t\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t" . $links->build(2) . "\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t";
        } else {
            echo "\n\t\t\t\t<table class=\"post margin deletedpost\" id=\"post{$post['id']}\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"side userlink\">\n\t\t\t\t\t\t\t" . userLink($poster) . "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class=\"smallFonts meta right\">\n\t\t\t\t\t\t\t<div style=\"float:left\">\n\t\t\t\t\t\t\t\t{$meta}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t" . $links->build() . "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>";
        }
        return;
    }
    if ($type == POST_SAMPLE) {
        $meta = $params['metatext'] ? $params['metatext'] : __("Sample post");
    } else {
        $forum = $params['fid'];
        $thread = $params['tid'];
        $canMod = CanMod($loguserid, $forum);
        $canReply = ($canMod || !$post['closed'] && $loguser['powerlevel'] > -1) && $loguserid;
        if ($type == POST_PM) {
            $message = __("Sent on {0}");
        } else {
            $message = __("Posted on {0}");
        }
        $meta = format($message, formatdate($post['date']));
        //Threadlinks for listpost.php
        if ($params['threadlink']) {
            $thread = array();
            $thread["id"] = $post["thread"];
            $thread["title"] = $post["threadname"];
            $meta .= " " . __("in") . " " . makeThreadLink($thread);
        }
        //Revisions
        if ($post['revision']) {
            if ($post['revuser']) {
                $ru_link = UserLink(getDataPrefix($post, "ru_"));
                $revdetail = " " . format(__("by {0} on {1}"), $ru_link, formatdate($post['revdate']));
            } else {
                $revdetail = '';
            }
            if ($canMod) {
                $meta .= " (<a href=\"javascript:void(0);\" onclick=\"showRevisions(" . $post['id'] . ")\">" . format(__("rev. {0}"), $post['revision']) . "</a>" . $revdetail . ")";
            } else {
                $meta .= " (" . format(__("rev. {0}"), $post['revision']) . $revdetail . ")";
            }
        }
        //</revisions>
    }
    // POST SIDEBAR
    $sideBarStuff .= GetRank($poster["rankset"], $poster["posts"]);
    if ($sideBarStuff) {
        $sideBarStuff .= "<br />";
    }
    if ($poster['title']) {
        $sideBarStuff .= strip_tags(CleanUpPost($poster['title'], "", true), "<b><strong><i><em><span><s><del><img><a><br/><br><small>") . "<br />";
    } else {
        $levelRanks = array(-1 => __("Banned"), 0 => "", 1 => __("Local mod"), 2 => __("Full mod"), 3 => __("Administrator"));
        $sideBarStuff .= $levelRanks[$poster['powerlevel']] . "<br />";
    }
    $sideBarStuff .= GetSyndrome(getActivity($poster["id"]));
    $pictureUrl = "";
    if ($post['mood'] > 0) {
        if (file_exists("{$dataDir}avatars/" . $poster['id'] . "_" . $post['mood'])) {
            $pictureUrl = "{$dataUrl}avatars/" . $poster['id'] . "_" . $post['mood'];
        }
    } else {
        if ($poster["picture"] == "#INTERNAL#") {
            $pictureUrl = "{$dataUrl}avatars/" . $poster['id'];
        } else {
            if ($poster["picture"]) {
                $pictureUrl = $poster["picture"];
            }
        }
    }
    if ($pictureUrl) {
        $sideBarStuff .= "<img src=\"" . htmlspecialchars($pictureUrl) . "\" alt=\"\" />";
    }
    $lastpost = $poster['lastposttime'] ? timeunits(time() - $poster['lastposttime']) : "none";
    $lastview = timeunits(time() - $poster['lastactivity']);
    $sideBarStuff .= "<br />\n" . __("Karma:") . " " . $poster['karma'];
    if (!$params['forcepostnum'] && ($type == POST_PM || $type == POST_SAMPLE)) {
        $sideBarStuff .= "<br />\n" . __("Posts:") . " " . $poster['posts'];
    } else {
        $sideBarStuff .= "<br />\n" . __("Posts:") . " " . $post['num'] . "/" . $poster['posts'];
    }
    $sideBarStuff .= "<br />\n" . __("Since:") . " " . cdate($loguser['dateformat'], $poster['regdate']) . "<br />";
    $bucket = "sidebar";
    include "./lib/pluginloader.php";
    if (Settings::get("showExtraSidebar")) {
        $sideBarStuff .= "<br />\n" . __("Last post:") . " " . $lastpost;
        $sideBarStuff .= "<br />\n" . __("Last view:") . " " . $lastview;
        if ($poster['lastactivity'] > time() - 300) {
            $sideBarStuff .= "<br />\n" . __("User is <strong>online</strong>");
        }
    }
    // OTHER STUFF
    if ($type == POST_NORMAL) {
        $anchor = "<a name=\"" . $post['id'] . "\"></a>";
    }
    if (!$isBlocked) {
        $pTable = "table" . $poster['id'];
        $row1 = "row" . $poster['id'] . "_1";
        $row2 = "row" . $poster['id'] . "_2";
        $topBar1 = "topbar" . $poster['id'] . "_1";
        $topBar2 = "topbar" . $poster['id'] . "_2";
        $sideBar = "sidebar" . $poster['id'];
        $mainBar = "mainbar" . $poster['id'];
    }
    $postText = makePostText($post);
    //PRINT THE POST!
    if ($mobileLayout) {
        $links->setClass("toolbarMenu");
        if ($pictureUrl) {
            $picture = "<img src=\"" . htmlspecialchars($pictureUrl) . "\" alt=\"\" style=\"max-width: 40px; max-height: 40px;\"/>";
        } else {
            $picture = "";
        }
        echo "\n\t\t\t\t<table class=\"outline margin mobile-postBox\" id=\"post{$post['id']}\">\n\t\t\t\t<tr class=\"header0 mobile-postHeader\">\n\t\t\t\t\t<th>\n\t\t\t\t\t\t{$anchor}\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<div class=\"mobile-userAvatarBox\">\n\t\t\t\t\t\t\t\t\t\t{$picture}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td class=\"mobile-postInfoCell\" style=\"width: 99%; overflow: hidden;\">\n\t\t\t\t\t\t\t\t\t<div style=\"position: relative; height: 40px; top: 0; left: 0;\">\n\t\t\t\t\t\t\t\t\t\t<div style=\"position: absolute; top: 0; left: 0;\">\n\t\t\t\t\t\t\t\t\t\t\t" . userLink($poster) . "<br />\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"date\">{$meta}</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span style=\"text-align:left; display: none;\" id=\"dyna_{$post['id']}\">\n\t\t\t\t\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t" . $links->build(2) . "\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</th>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"3\" class=\"cell0 mobile-postBox\">\n\t\t\t\t\t\t{$postText}\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t";
    } else {
        echo "\n\t\t\t<table class=\"post margin {$pTable}\" id=\"post{$post['id']}\">\n\t\t\t\t<tr class=\"{$row1}\">\n\t\t\t\t\t<td class=\"side userlink {$topBar1}\">\n\t\t\t\t\t\t{$anchor}\n\t\t\t\t\t\t" . UserLink($poster) . "\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"meta right {$topBar2}\">\n\t\t\t\t\t\t<div style=\"float: left;\" id=\"meta_{$post['id']}\">\n\t\t\t\t\t\t\t{$meta}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style=\"float: left; text-align:left; display: none;\" id=\"dyna_{$post['id']}\">\n\t\t\t\t\t\t\tHi.\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t" . $links->build() . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class=\"" . $row2 . "\">\n\t\t\t\t\t<td class=\"side {$sideBar}\">\n\t\t\t\t\t\t<div class=\"smallFonts\">\n\t\t\t\t\t\t\t{$sideBarStuff}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"post {$mainBar}\" id=\"post_{$post['id']}\">\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t{$postText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>";
    }
}
Ejemplo n.º 14
0
function MakePost($post, $thread, $forum, $ispm = 0)
{
    global $loguser, $loguserid, $dateformat, $theme, $hacks, $isBot, $blocklayouts, $postText, $sideBarStuff, $sideBarData, $salt;
    $sideBarStuff = "";
    if (isset($_GET['pid'])) {
        $highlight = (int) $_GET['pid'];
    }
    //$qBlock = "select * from blockedlayouts where user=".$post['uid']." and blockee=".$loguserid;
    //$rBlock = Query($qBlock);
    LoadBlockLayouts();
    $isBlocked = $blocklayouts[$post['uid']] | $post['globalblock'] | $loguser['blocklayouts'] | $post['options'] & 1;
    $noSmilies = $post['options'] & 2;
    $noBr = $post['options'] & 4;
    if ($post['deleted'] && !$ispm) {
        $meta = format(__("Posted on {0}"), cdate($dateformat, $post['date']));
        $links = "<ul class=\"pipemenu\"><li>" . __("Post deleted") . "</li>";
        if (CanMod($loguserid, $forum)) {
            $key = hash('sha256', "{$loguserid},{$loguser['pss']},{$salt}");
            if (IsAllowed("editPost", $post['id'])) {
                $links .= "<li><a href=\"editpost.php?id=" . $post['id'] . "&amp;delete=2&amp;key=" . $key . "\">" . __("Undelete") . "</a></li>";
            }
            $links .= "<li><a href=\"#\" onclick=\"ReplacePost(" . $post['id'] . ",true); return false;\">" . __("View") . "</a></li>";
        }
        $links .= "<li>" . format(__("ID: {0}"), $post['id']) . "</li></ul>";
        write("\n\t\t<table class=\"post margin\" id=\"post{0}\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"side userlink\" id=\"{0}\">\n\t\t\t\t\t{1}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"smallFonts\" style=\"border-left: 0px none; border-right: 0px none;\">\n\t\t\t\t\t{2}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"smallFonts right\" style=\"border-left: 0px none;\">\n\t\t\t\t\t{3}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n", $post['id'], UserLink($post, "uid"), $meta, $links);
        return;
    }
    if ($ispm == 1) {
        $thread = $ispm;
    }
    if ($thread) {
        $links = "";
        if (!$ispm && !$isBot) {
            if ($post['unfoldhax']) {
                $key = hash('sha256', "{$loguserid},{$loguser['pss']},{$salt}");
                $links = "<ul class=\"pipemenu\"><li>" . __("Post deleted") . "</li>";
                if (IsAllowed("editPost", $post['id'])) {
                    $links .= "<li><a href=\"editpost.php?id=" . $post['id'] . "&amp;delete=2&amp;key=" . $key . "\">" . __("Undelete") . "</a></li>";
                }
                $links .= "<li><a href=\"#\" onclick=\"ReplacePost(" . $post['id'] . ",false); return false;\">" . __("Close") . "</a></li>";
                $links .= "<li>" . format(__("ID: {0}"), $post['id']) . "</li></ul>";
            } else {
                $links .= "<ul class=\"pipemenu\"><li><a href=\"thread.php?pid=" . $post['id'] . "#" . $post['id'] . "\">" . __("Link") . "</a></li>";
                if ($thread && $loguser['powerlevel'] > -1 && $forum != -2 && IsAllowed("makeReply", $thread)) {
                    $links .= "<li><a href=\"newreply.php?id=" . $thread . "&amp;quote=" . $post['id'] . "\">" . __("Quote") . "</a></li>";
                }
                if (CanMod($loguserid, $forum) || $post['uid'] == $loguserid && $loguser['powerlevel'] > -1 && !$post['closed'] && IsAllowed("editPost", $post['id'])) {
                    $links .= "<li><a href=\"editpost.php?id=" . $post['id'] . "\">" . __("Edit") . "</a></li>";
                }
                if (CanMod($loguserid, $forum) && IsAllowed("editPost", $post['id'])) {
                    $key = hash('sha256', "{$loguserid},{$loguser['pss']},{$salt}");
                    $links .= "<li><a href=\"editpost.php?id=" . $post['id'] . "&amp;delete=1&amp;key=" . $key . "\">" . __("Delete") . "</a></li>";
                }
                if ($forum != -2 && IsAllowed("makeReply", $thread)) {
                    $links .= "<li>" . format(__("ID: {0}"), "<a href=\"newreply.php?id=" . $thread . "&amp;link=" . $post['id'] . "\">" . $post['id'] . "</a>") . "</li>";
                } else {
                    $links .= "<li>" . format(__("ID: {0}"), $post['id']) . "</li>";
                }
                if ($loguser['powerlevel'] > 0) {
                    $links .= "<li>" . $post['ip'] . "</li>";
                }
                $links .= "</ul>";
            }
        }
        $meta = format(__(!$ispm ? "Posted on {0}" : "Sent on {0}"), cdate($dateformat, $post['date']));
        //Threadlinks for listpost.php
        if ($forum == -2) {
            $meta .= " " . __("in") . " <a href=\"thread.php?id=" . $post['thread'] . "\">" . htmlspecialchars($post['threadname']) . "</a>";
        }
        //Revisions
        if ($post['revision']) {
            if (CanMod($loguserid, $forum)) {
                $meta .= " (<a href=\"javascript:void(0);\" onclick=\"showRevisions(" . $post['id'] . ")\">" . format(__("revision {0}"), $post['revision']) . "</a>)";
            } else {
                $meta .= " (" . format(__("revision {0}"), $post['revision']) . ")";
            }
        }
        //</revisions>
    } else {
        $meta = __("Sample post");
    }
    if ($forum == -1) {
        $meta = __("Posted in") . " <a href=\"thread.php?id=" . $thread['id'] . "\">" . htmlspecialchars($thread['title']) . "</a>";
    }
    //if($post['postbg'])
    //	$postbg = " style=\"background: url(".$post['postbg'].");\"";
    $sideBarStuff .= GetRank($post);
    if ($sideBarStuff) {
        $sideBarStuff .= "<br />";
    }
    if ($post['title']) {
        $sideBarStuff .= strip_tags(CleanUpPost($post['title'], "", true), "<b><strong><i><em><span><s><del><img><a><br><small>") . "<br />";
    } else {
        $levelRanks = array(-1 => __("Banned"), 0 => "", 1 => __("Local mod"), 2 => __("Full mod"), 3 => __("Administrator"));
        $sideBarStuff .= $levelRanks[$post['powerlevel']] . "<br />";
    }
    $sideBarStuff .= GetSyndrome($post['activity']);
    if ($post['picture']) {
        if ($post['mood'] > 0 && file_exists("img/avatars/" . $post['uid'] . "_" . $post['mood'])) {
            $sideBarStuff .= "<img src=\"img/avatars/" . $post['uid'] . "_" . $post['mood'] . "\" alt=\"\" />";
        } else {
            $sideBarStuff .= "<img src=\"" . $post['picture'] . "\" alt=\"\" />";
        }
    } else {
        $sideBarStuff .= "<div style=\"width: 50px; height: 50px;\">&nbsp;</div>";
    }
    $lastpost = $post['lastposttime'] ? timeunits(time() - $post['lastposttime']) : "none";
    $lastview = timeunits(time() - $post['lastactivity']);
    if ($post['num'] != "preview") {
        $sideBarStuff .= "<br />\n" . __("Posts:") . " " . $post['num'] . "/" . $post['posts'];
    } else {
        $sideBarStuff .= "<br />\n" . __("Posts:") . " " . $post['posts'];
    }
    $sideBarStuff .= "<br />\n" . __("Since:") . " " . cdate($loguser['dateformat'], $post['regdate']) . "<br />";
    $bucket = "sidebar";
    include "./lib/pluginloader.php";
    $sideBarStuff .= "<br />\n" . __("Last post:") . " " . $lastpost;
    $sideBarStuff .= "<br />\n" . __("Last view:") . " " . $lastview;
    if ($hacks['themenames'] == 3) {
        $sideBarStuff = "";
        $isBlocked = 1;
    }
    if ($post['lastactivity'] > time() - 3600) {
        $sideBarStuff .= "<br />\n" . __("User is <strong>online</strong>");
    }
    if ($post['id'] != "preview") {
        $anchor = "<a name=\"" . $post['id'] . "\" />";
    }
    if (!$isBlocked) {
        $topBar1 = "topbar" . $post['uid'] . "_1";
        $topBar2 = "topbar" . $post['uid'] . "_2";
        $sideBar = "sidebar" . $post['uid'];
        $mainBar = "mainbar" . $post['uid'];
    }
    $tags = array();
    $rankHax = $post['posts'];
    //if($post['num'] == "preview")
    //	$post['num'] = $post['posts'];
    $post['posts'] = $post['num'];
    //Disable tags by commenting/removing this part.
    $tags = array("numposts" => $post['num'], "numdays" => floor((time() - $post['regdate']) / 86400), "date" => cdate($dateformat, $post['date']), "rank" => GetRank($post));
    $bucket = "amperTags";
    include "./lib/pluginloader.php";
    $post['posts'] = $rankHax;
    if ($post['postheader'] && !$isBlocked) {
        $postHeader = str_replace('$theme', $theme, ApplyTags(CleanUpPost($post['postheader'], "", $noSmilies, true), $tags));
    }
    $postText = ApplyTags(CleanUpPost($post['text'], $post['name'], $noSmilies, $noBr), $tags);
    $bucket = "postMangler";
    include "./lib/pluginloader.php";
    if ($post['signature'] && !$isBlocked) {
        $postFooter = ApplyTags(CleanUpPost($post['signature'], "", $noSmilies, true), $tags);
        if (!$post['signsep']) {
            $separator = "<br />_________________________<br />";
        } else {
            $separator = "<br />";
        }
    }
    $postCode = "\n\t\t<table class=\"post margin {14}\" id=\"post{13}\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"side userlink {1}\">\n\t\t\t\t\t{0}\n\t\t\t\t\t{5}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"meta right {2}\">\n\t\t\t\t\t<div style=\"float: left;\" id=\"meta_{13}\">\n\t\t\t\t\t\t{7}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"float: left; display: none;\" id=\"dyna_{13}\">\n\t\t\t\t\t\tHi.\n\t\t\t\t\t</div>\n\t\t\t\t\t{8}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=\"side {3}\">\n\t\t\t\t\t<div class=\"smallFonts\">\n\t\t\t\t\t\t{6}\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"post {4}\" id=\"post_{13}\">\n\n\t\t\t\t\t{9}\n\n\t\t\t\t\t{10}\n\n\t\t\t\t\t{12}\n\t\t\t\t\t{11}\n\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n";
    write($postCode, $anchor, $topBar1, $topBar2, $sideBar, $mainBar, UserLink($post, "uid"), $sideBarStuff, $meta, $links, $postHeader, $postText, $postFooter, $separator, $post['id'], $post['id'] == $highlight ? "highlightedPost" : "");
}
Ejemplo n.º 15
0
$realLen = $cpp;
if ($realFrom < 0) {
    $realLen += $realFrom;
    $realFrom = 0;
}
$rComments = Query("SELECT\n\t\tu.(_userfields),\n\t\t{usercomments}.id, {usercomments}.cid, {usercomments}.text\n\t\tFROM {usercomments}\n\t\tLEFT JOIN {users} u ON u.id = {usercomments}.cid\n\t\tWHERE uid={0}\n\t\tORDER BY {usercomments}.date ASC LIMIT {1u},{2u}", $id, $realFrom, $realLen);
$pagelinks = PageLinksInverted(actionLink($mobileLayout ? "usercomments" : "profile", $id, "from="), $cpp, $from, $total);
$commentList = "";
$commentField = "";
if (NumRows($rComments)) {
    while ($comment = Fetch($rComments)) {
        if ($canDeleteComments) {
            $deleteLink = "<small style=\"float: right; margin: 0px 4px;\">" . actionLinkTag("&#x2718;", $mobileLayout ? "usercomments" : "profile", $id, "action=delete&cid=" . $comment['id'] . "&token={$loguser['token']}") . "</small>";
        }
        $cellClass = ($cellClass + 1) % 2;
        $thisComment = format("\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"cell2\">\n\t\t\t\t\t\t\t\t{0}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"cell{1}\">\n\t\t\t\t\t\t\t\t{3}{2}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n", UserLink(getDataPrefix($comment, "u_")), $cellClass, CleanUpPost($comment['text'], $comment['u_name']), $deleteLink);
        $commentList = $commentList . $thisComment;
        if (!isset($lastCID)) {
            $lastCID = $comment['cid'];
        }
    }
    $pagelinks = "<td colspan=\"2\" class=\"cell1\">{$pagelinks}</td>";
    if ($total > $cpp) {
        $commentList = "{$pagelinks}{$commentList}{$pagelinks}";
    }
} else {
    $commentsWasEmpty = true;
    $commentList = $thisComment = format("\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"cell0\" colspan=\"2\">\n\t\t\t\t\t\t\t\t" . __("No comments.") . "\n\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n");
}
//print "lastCID: ".$lastCID;
if ($loguserid) {
Ejemplo n.º 16
0
function CheckTableBreaks($text)
{
    $text = strtolower(CleanUpPost($text));
    //	$openers = substr_count($text, "<table") + substr_count($text, "<div") + substr_count($text, "[quote");
    //	$closers = substr_count($text, "</table>") + substr_count($text, "</div>") + substr_count($text, "[/quote]");
    //	return ($openers != $closers);
    $tabO = substr_count($text, "<table");
    $tabC = substr_count($text, "</table>");
    $divO = substr_count($text, "<div");
    $divC = substr_count($text, "</div>");
    $quoO = substr_count($text, "[quote");
    $quoC = substr_count($text, "[/quote]");
    $spoO = substr_count($text, "[spoiler");
    $spoC = substr_count($text, "[/spoiler]");
    if ($tabO != $tabC) {
        return true;
    }
    if ($divO != $divC) {
        return true;
    }
    if ($quoO != $quoC) {
        return true;
    }
    if ($spoO != $spoC) {
        return true;
    }
    return false;
}
Ejemplo n.º 17
0
    print htmlspecialchars($logotitle);
    ?>
" id="theme_banner" style="padding: 8px;" />
								</a>
							</td>
							<td style="border: 0px none;">
								<div class="PoRT nom">
									<div class="errort">
										<strong><?php 
    print $misc['poratitle'];
    ?>
</strong>
									</div>
									<div class="errorc cell2 left">
										<?php 
    print CleanUpPost($misc['porabox'], "", true, true);
    ?>
									</div>
								</div>
							</td>
							<?php 
} else {
    ?>
							<td style="border: 0px none; text-align: center;">
								<a href="./">
									<img src="<?php 
    print htmlspecialchars($logopic);
    ?>
" alt="<?php 
    print htmlspecialchars($logoalt);
    ?>
Ejemplo n.º 18
0
        }
        $voters = count($voters);
        write("\n\t<table border=\"2\">\n\t\t<tr>\n\t\t\t<th colspan=\"2\">\n\t\t\t\tPoll: {1}\n\t\t\t</th>\n\t\t</tr>\n\t\t{2}\n\t\t<tr>\n\t\t\t<td colspan=\"2\">\n\t\t\t\t{3} voted so far.\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n", $cellClass, htmlspecialchars($poll['question']), $pollLines, $voters == 1 ? $voters . " user has" : $voters . " users have");
    }
}
$rPosts = Query("select\n{posts}.id, {posts}.date, {posts}.deleted, {posts}.options, {posts}.num, {posts_text}.text, {posts_text}.revision, {users}.name, {users}.displayname, {users}.rankset, {users}.posts\nfrom {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\nwhere thread={0} order by date asc", $tid);
if (NumRows($rPosts)) {
    while ($post = Fetch($rPosts)) {
        $noSmiles = $post['options'] & 2;
        $noBr = $post['options'] & 4;
        $text = $post['text'];
        $text = preg_replace("'\\[spoiler\\](.*?)\\[/spoiler\\]'si", "&laquo;Spoiler&raquo;", $text);
        $text = preg_replace("'\\[video\\](.*?)\\[/video\\]'si", "&laquo;HTML5 video&raquo;", $text);
        $text = preg_replace("'\\[youtube\\](.*?)\\[/youtube\\]'si", "&laquo;YouTube video&raquo;", $text);
        $text = preg_replace("'\\[youtube/loop\\](.*?)\\[/youtube\\]'si", "&laquo;YouTube video&raquo;", $text);
        $text = preg_replace("'\\[swf ([0-9]+) ([0-9]+)\\](.*?)\\[/swf\\]'si", "&laquo;Flash video&raquo;", $text);
        $text = preg_replace("'\\[svg ([0-9]+) ([0-9]+)\\](.*?)\\[/svg\\]'si", "&laquo;SVG image&raquo;", $text);
        $text = CleanUpPost($text, $post['name'], $noSmiles, $noBr);
        $text = preg_replace("'<div class=\"geshi\">(.*?)</div>'si", "<div class=\"geshi\"><code>\\1</code></div>", $text);
        $text = preg_replace("'<table class=\"outline\">'si", "<table border=\"2\">", $text);
        $text = preg_replace("'<td (.*?)style=\"(.*?)\"(.*?)>'si", "<td \\1\\3>", $text);
        $text = preg_replace("'<a (.*?)style=\"(.*?)\"(.*?)>'si", "<a \\1\\3>", $text);
        $tags = array();
        $rankHax = $post['posts'];
        $post['posts'] = $post['num'];
        $tags = array("numposts" => $post['num'], "5000" => 5000 - $post['num'], "20000" => 20000 - $post['num'], "30000" => 30000 - $post['num'], "rank" => GetRank($post));
        $post['posts'] = $rankHax;
        $text = ApplyTags($text, $tags);
        write("\n\t<hr />\n\t<p>\n\t\t<strong>\n\t\t\t{1}\n\t\t</strong>\n\t\t<small>\n\t\t\t&mdash; {2}, post #{3}\n\t\t</small>\n\t</p>\n\t<p>\n\t\t{0}\n\t</p>\n", $text, $post['name'], formatdate($post['date']), $post['id']);
    }
}
Ejemplo n.º 19
0
function wikiFilter($text, $nocontbox)
{
    global $hlevels, $contentsbox;
    // get rid of those annoying \r's once for all
    $text = str_replace("\r", '', $text);
    // special wiki markup
    // gets processed before we run the post parser and its security filters -- we never know
    $text = preg_replace_callback('@\\[\\[([^\\]]+?)\\|([\\w\\s]+?)\\]\\]@s', 'makeNiceLink', $text);
    $text = preg_replace_callback('@\\[\\[([^\\]]+?)\\]\\]@s', 'makeLink', $text);
    //$text = preg_replace_callback('@^\s*\*\s*.+?$@m', 'makeList', $text);
    //$text = preg_replace_callback("@(\[li\](.+?)\[/li\]\n)+@", 'finalizeList', $text);
    $text = preg_replace('@^[ ]*\\*[ ]*(.+?)$@m', '&bull; $1', $text);
    // run the post parser on it and call it good
    $text = CleanUpPost($text, '', false, false);
    $hlevels = array('cur' => 0, 'curtag' => -1);
    $contentsbox = '';
    $text = preg_replace_callback('@^<(h[1-6]).*?>(.+?)</\\1.*?>$@mi', 'headingHandler', $text);
    if ($contentsbox && !$nocontbox) {
        $text = '
		<table class="outline margin" style="display:inline-block;width:auto;">
			<tr class="header1"><th>Contents</th></tr>
			<tr class="cell0">
				<td style="padding:1em;">
					' . $contentsbox . '
				</td>
			</tr>
		</table>
		<br>
		' . $text;
    }
    return $text;
}
Ejemplo n.º 20
0
<?php

for ($i = 0; $i < Settings::pluginGet('numberOfFields'); $i++) {
    if (getSetting("profileExt" . $i . "t", true) != "" && getSetting("profileExt" . $i . "v", true) != "") {
        $profileParts[__('Other stuff')][strip_tags(getSetting("profileExt" . $i . "t", true))] = CleanUpPost(getSetting("profileExt" . $i . "v", true));
    }
}