Beispiel #1
0
function display_post($userdata, $datetype, $postdate, $cmds, $posttext)
{
    global $powerlevels;
    $author = userlink_big($userdata[userid], htmlspecialchars($userdata[username]), $userdata[powerlevel]);
    $postdate = parsedate($postdate);
    $joindate = parsedate_short($userdata[joindate]);
    $sig = '';
    if ($userdata['signature'] != '') {
        $sig = '<hr>';
        $sig .= getpost($userdata['signature'], true, true, false);
    }
    $avatar = '';
    if ($userdata['hasavatar'] == 1) {
        $avatar = "<img src='avatars/{$userdata['userid']}.{$userdata['avatarext']}' alt='Avatar'><br>";
    }
    $utitle = htmlspecialchars($userdata[usertitle]);
    print "<table class='post' width='100%'>";
    print "<tr>";
    print "<td rowspan='2' valign='top' class='postsidebar'>";
    print "<b>{$author}</b>";
    if ($utitle) {
        print "<div class='smallspacing'></div>{$utitle}";
    }
    if ($avatar) {
        print "<div class='bigspacing'></div>";
        print "{$avatar}";
    }
    print "<div class='bigspacing'></div>";
    print "<span class='label'>Posts:</span> {$userdata['posts']}<br>";
    print "<span class='label'>Joined:</span> {$joindate}<br>";
    if ($userdata[powerlevel] > 5) {
        print "<span class='label'>Rank:</span> {$powerlevels[$userdata[powerlevel]]}<br>";
    }
    $replink = replink($userdata[userid], $userdata[reputation]);
    print "<span class='label'>Reputation:</span> {$replink}<br>";
    // custom postbit fields go here
    print "</td>";
    print "<td class='postdate' height='1'>{$datetype} {$postdate}{$cmds}</td>";
    print "</tr>";
    print "<tr><td valign='top' class='postcontent'>{$posttext}{$sig}</td></tr>";
    print "</table>";
}
Beispiel #2
0
                if ($result != '') {
                    print '<b>The following errors occurred while posting your reply:<br>' . $result . '</b><br>Your post data has been saved.<hr>';
                }
                if (isset($_POST['preview'])) {
                    print "<b>Preview:</b>";
                    $posttext = getpost($_POST['text'], true, true, false);
                    display_post($s[user], 'Posted', time(), $cmds, $posttext);
                    print "<br>";
                }
                if (isset($_GET['quote'])) {
                    $quoteid = intval($_GET[quote]);
                    $getquote = dbquery("SELECT * FROM posts WHERE id = {$quoteid} AND thread = {$threadid}");
                    if (dbrows($getquote) != 0) {
                        // ignore the quote if it's an invalid id
                        $quotepost = dbrow($getquote);
                        $quotetime = parsedate($quotepost[postdate]);
                        $quote = "[quote={$quotepost['authorname']} ({$quotetime})]{$quotepost['posttext']}[/quote]\n\n";
                    }
                }
                ?>
<b>Replying to <?php 
                echo htmlspecialchars($threadinfo[name]);
                ?>
: (<a href='index.php?showthread=<?php 
                echo $threadid;
                ?>
'>Return to Thread</a>)</b>
<br>
<form action='index.php?m=board&act=postreply&id=<?php 
                echo $threadid;
                ?>
Beispiel #3
0
function showthreads($threadquery, $alternating)
{
    global $postspp, $s, $lastread, $theme;
    while ($thread = dbrow($threadquery)) {
        $thread[name] = htmlspecialchars($thread[name]);
        $thread[desc] = htmlspecialchars($thread[desc]);
        $alternating = !$alternating;
        if ($alternating) {
            print "<tr class='rowalt'>";
        } else {
            print "<tr>";
        }
        $dot = '';
        if ($thread[checkpostedin]) {
            $dot = 'dot';
        }
        if ($s[logged_in] && $thread[lastpostdate] >= $lastread && $thread[thread] != $thread[id]) {
            if ($thread[locked] == 1) {
                $threadicon = "<img src='{$theme}images/icon_threadlockedunread.png' alt='This thread has unread posts, and is locked.' title='This thread has unread posts, and is locked.'>";
            } else {
                $threadicon = "<img src='{$theme}images/icon_threadunread{$dot}.png' alt='This thread has unread posts.' title='This thread has unread posts.'>";
            }
        } else {
            if ($thread[locked] == 1) {
                $threadicon = "<img src='{$theme}images/icon_threadlocked.png' alt='This thread has no unread posts, and is locked.' title='This thread has no unread posts, and is locked.'>";
            } else {
                $threadicon = "<img src='{$theme}images/icon_thread{$dot}.png' alt='This thread has no unread posts.' title='This thread has no unread posts.'>";
            }
        }
        $pages = '';
        if ($thread[replies] + 1 > $postspp) {
            $threadpagecount = ceil(($thread[replies] + 1) / $postspp);
            $pages .= ' <span class=\'pages\'>(pages: ';
            if ($threadpagecount > 6) {
                $dleft = 3;
                $dright = $threadpagecount - 2;
            } else {
                $dleft = 7;
                $dright = -1;
            }
            $docomma = false;
            for ($cp = 1; $cp <= $threadpagecount; $cp++) {
                if ($cp > $dleft && $cp < $dright) {
                    continue;
                }
                if ($docomma) {
                    $pages .= ', ';
                } else {
                    $docomma = true;
                }
                $pages .= "<a href='index.php?showthread={$thread['id']}&page={$cp}'>{$cp}</a>";
                if ($cp == $dleft) {
                    $pages .= "...";
                    $docomma = false;
                }
            }
            $pages .= ')</span>';
        }
        print "<td>{$threadicon}</td>";
        $threadcustomicon = '';
        if ($thread[icon]) {
            $threadcustomicon = "<img src='smilies/{$thread['icon']}' alt='Icon'>";
        }
        print "<td>{$threadcustomicon}</td>";
        print "<td style='text-align: left'><a href='index.php?showthread={$thread['id']}' style='font-size: 12px'>{$thread['name']}</a><br><div style='font-size: 11px; margin: 2px 0px 0px 2px'>{$thread['desc']}{$pages}</div></td>";
        $author = userlink($thread[authorid], htmlspecialchars($thread[authorname]), $thread[authorpower]);
        print "<td>{$author}</td>";
        print "<td>{$thread['replies']}</td>";
        print "<td style='font-size: 11px'>";
        $lastpostdate = parsedate($thread[lastpostdate]);
        print "{$lastpostdate}<br>";
        $lastposter = userlink($thread[lastposterid], htmlspecialchars($thread[lastpostername]), $thread[lastposterpower]);
        print "by {$lastposter}";
        print "</td>";
        print "</tr>";
    }
}
Beispiel #4
0
     print "<div style='text-align: center'>{$member['usertitle']}</div>";
 }
 print "<b>Rank:</b> {$powerlevels[$member[powerlevel]]}<br>";
 if ($member[posts] == 1) {
     $plural1 = '';
 } else {
     $plural1 = 's';
 }
 if ($member[threads] == 1) {
     $plural2 = '';
 } else {
     $plural2 = 's';
 }
 print "<b>Posts:</b> {$member['posts']} post{$plural1}, {$member['threads']} thread{$plural2}<br>";
 $joindate = parsedate($member[joindate]);
 $lastactivity = parsedate($member[lastactive]);
 print "<b>Joined:</b> {$joindate}<br>";
 print "<b>Last activity:</b> {$lastactivity}<br>";
 if ($member[quote]) {
     $member[quote] = htmlspecialchars($member[quote]);
     print "<b>Quote:</b> {$member['quote']}<br>";
 }
 $replink = replink($member[userid], $member[reputation]);
 print "<b>Reputation:</b> {$replink}<br>";
 print "</td></tr>";
 print "<tr class='header'><td>Actions</td></tr>";
 print "<tr><td>";
 print "<a href='index.php?m=messages&act=send&target={$member['userid']}'>Send PM</a>";
 print " - ";
 print "<a href='index.php?m=reputation&id={$member['userid']}'>Rate User</a>";
 print "</td></tr>";
 if (mysql_num_rows($getit) == 0) {
     print "No one has rated " . htmlspecialchars($userdata[username]) . " yet. :(";
 } else {
     $alternating = true;
     print "<table cellpadding='0' cellspacing='0' style='width: 100%' id='rep'>";
     while ($row = dbrow($getit)) {
         $alternating = !$alternating;
         if ($alternating) {
             $alt = " class='rowalt'";
         } else {
             $alt = "";
         }
         print "<tr{$alt}>";
         print "<td align='left' valign='top'>";
         $userlink = userlink($row[userid], htmlspecialchars($row[username]), $row[powerlevel]);
         $date = parsedate($row[date]);
         print "<span style='font-size: 11px'>{$userlink} rated at {$date}:";
         if ($candelete) {
             print " (<a href='index.php?m=reputation&id={$userid}&deleterep={$row['id']}'>delete</a>)";
         }
         print "</span>";
         print "<div class='smallspacing'></div>";
         if ($row[rep] > 0) {
             $outcome = "<span style='color: #248900'>Positive (+{$row['rep']})</span>";
         } elseif ($row[rep] == 0) {
             $outcome = "<span style='color: #565656'>Neutral ({$row['rep']})</span>";
         } elseif ($row[rep] < 0) {
             $outcome = "<span style='color: #af3333'>Negative ({$row['rep']})</span>";
         }
         print "{$outcome}: " . getpost($row[content], true, true, false);
         print "</td>";
Beispiel #6
0
        if ($alternating) {
            print "<tr class='rowalt'>";
        } else {
            print "<tr>";
        }
        print "<td style='text-align: center'>{$forumicon}</td>";
        print "<td style='font-size: 12px'><a href='index.php?showforum={$forum['id']}' style='font-size: 14px; font-weight: bold'>{$forum['name']}</a><br>{$forum['desc']}</td>";
        print "<td style='font-size: 11px'>{$forum['threads']} threads<br>{$forum['posts']} posts</td>";
        if ($forum[lastpostdate] == 0) {
            print "<td>Never</td>";
        } else {
            if (strlen($forum[lastpostedin]) > 35) {
                $forum[lastpostedin] = substr($forum[lastpostedin], 0, 32) . '...';
            }
            $forum[lastpostedin] = htmlspecialchars($forum[lastpostedin]);
            $lastpostdate = parsedate($forum[lastpostdate]);
            print "<td>";
            print "<a href='index.php?showthread={$forum['lastpostedinid']}&page=last'>{$forum['lastpostedin']}</a><br>";
            print "{$lastpostdate}<br>";
            $lastposter = userlink($forum[lastposterid], htmlspecialchars($forum[lastposter]), $forum[powerlevel]);
            print "by {$lastposter}";
            print "</td>";
        }
        print "</tr>";
    }
    print "</table>";
    print "<div class='bigspacing'></div>";
}
if ($s[logged_in]) {
    print "<form action='index.php?m=board' method='post'>";
    print "<input type='submit' name='markread' class='button' value='Mark all threads/forums as read'>";
		<DIV class='config_row'>
			<DIV class='config_cell_title' style='width: 15%;'>Box 8</DIV>
			<DIV class='config_cell_data' style='width: 15%;'><SELECT NAME="frm_box8" onChange='set_hint(this.form, "frm_box8", "hint8")'><?php 
    print $menu1;
    ?>
</DIV>
			<DIV class='config_cell_data' style='width: 10%;'><INPUT MAXLENGTH="12" SIZE="12" type="text" NAME="frm_t8" VALUE="<?php 
    print $type8 == 'avg' ? parsedate($t8) : $t8;
    ?>
"></DIV>
			<DIV class='config_cell_data' style='width: 10%;'><INPUT MAXLENGTH="12" SIZE="12" type="text" NAME="frm_tw8" VALUE="<?php 
    print $type8 == 'avg' ? parsedate($tw8) : $tw8;
    ?>
"></DIV>
			<DIV class='config_cell_data' style='width: 10%;'><INPUT MAXLENGTH="12" SIZE="12" type="text" NAME="frm_tf8" VALUE="<?php 
    print $type8 == 'avg' ? parsedate($tf8) : $tf8;
    ?>
"></DIV>
			<DIV id='hint8' class='config_cell_hint' style='width: 20%;'></DIV>			
			<DIV class='config_cell_data' style='width: 20%;'><SELECT NAME='frm_t_type8'><?php 
    print $menu2;
    ?>
</DIV>
		</DIV>
		</FORM>
		<DIV class='config_row'>
			<DIV class='config_cell_butts' style='width: 96%; text-align: center;'><INPUT TYPE="button" VALUE="Cancel"  onClick="window.location='stats_scr.php?stats=stats'">
			&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="button" VALUE="Submit" onClick="document.stats_config.submit()">
			</DIV>
		</DIV> 
Beispiel #8
0
function edit_post()
{
    global $s;
    // self note: not having this is why so many functions mess up
    if (isset($_POST[makeit])) {
        $error_string = '';
        if (!isset($_POST['text']) or $_POST['text'] == '') {
            $error_string .= 'You didn\'t enter a post.<br>';
        }
        if ($error_string != '') {
            return $error_string;
        } else {
            $timeformatted = parsedate(time());
            $inserttext = iprotect($_POST['text']);
            //."\n\n[size=1][Edited by {$s[user][username]} at $timeformatted.][/size]");
            $un = htmlspecialchars($s[user][username]);
            $editinfo = iprotect("Last edited by {$un} at {$timeformatted}");
            global $postid;
            dbquery("UPDATE posts SET posttext = '{$inserttext}', editinfo='{$editinfo}' WHERE id = {$postid}");
            return true;
        }
    }
    // if it returns a non-blank string, it's an error
    // if it returns true (check with ===) the post has been edited successfully
    // if it returns nothing, just show the form
}
Beispiel #9
0
                if ($result != '') {
                    print '<b>The following errors occurred while sending your PM:<br>' . $result . '</b><br>Your message has been saved.<hr>';
                }
                if (isset($_POST['preview'])) {
                    print "<b>Preview:</b>";
                    $posttext = getpost($_POST['text'], true, true, false);
                    display_post($s[user], 'Sent', time(), $cmds, $posttext);
                    print "<br>";
                }
                if (isset($_GET['reply'])) {
                    $quoteid = intval($_GET[reply]);
                    $getquote = dbquery("SELECT pmessages.*, users.username FROM pmessages LEFT JOIN users ON pmessages.sender=users.userid WHERE id = {$quoteid} AND ((sender = {$s[user][userid]} AND exists_sender = 1) or (recipient = {$s[user][userid]} AND exists_recipient = 1))");
                    if (dbrows($getquote) != 0) {
                        // ignore the quote if it's an invalid id
                        $quotepost = dbrow($getquote);
                        $quotetime = parsedate($quotepost[sentdate]);
                        $quote = "[quote={$quotepost['username']} ({$quotetime})]{$quotepost['text']}[/quote]\n\n";
                    }
                }
                if (isset($_GET['target'])) {
                    $userid = intval($_GET[target]);
                    $getuser = dbquery("SELECT username FROM users WHERE userid = {$userid}");
                    if (dbrows($getuser) != 0) {
                        $targetuser = dbrow($getuser);
                        $_POST['recipient'] = $targetuser[username];
                    }
                }
                ?>
<b>Send a private message:</b>
<br>
<form action='index.php?m=messages&act=send' method='post'>
Beispiel #10
0
print "<form action='index.php?m=admin&act=idx' method='post'>";
print "<textarea rows='4' cols='70' name='data'></textarea>";
print "<br>";
print "<input type='submit' name='makeit' value='Add Note' class='button'>";
print "</form>";
print "<hr>";
$getnotes = dbquery("select adminnotes.*,users.userid,users.username,users.powerlevel from adminnotes left join users on adminnotes.author=users.userid order by adminnotes.notedate");
if (mysql_num_rows($getnotes) == 0) {
    print "Apparently no one has posted any notes yet.";
} else {
    $alternating = true;
    print "<table cellpadding='0' cellspacing='0' style='width: 100%' id='rep'>";
    while ($row = dbrow($getnotes)) {
        $alternating = !$alternating;
        if ($alternating) {
            $alt = " class='rowalt'";
        } else {
            $alt = "";
        }
        print "<tr{$alt}>";
        print "<td align='left' valign='top'>";
        $userlink = userlink($row[userid], htmlspecialchars($row[username]), $row[powerlevel]);
        $date = parsedate($row[notedate]);
        print "<span style='font-size: 11px'>{$userlink} posted at {$date}:</span>";
        print "<div class='smallspacing'></div>";
        print getpost($row[data], true, true, false);
        print "</td>";
        print "</tr>";
    }
    print "</table>";
}