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>"; }
<td colspan='2'> Welcome to Treeki's development board!<br> This is just for testing Treeki's custom forum software which will most likely never be finished. </td> </tr> <tr> <td style='width: 70%' valign='top'> <?php if ($portalforum > -1) { $getnews = dbquery("SELECT * FROM threads WHERE forum = {$portalforum} ORDER BY id DESC LIMIT 5"); while ($thread = dbrow($getnews)) { $thread[name] = htmlspecialchars($thread[name]); $threadid = $thread[id]; $post = dbrow(dbquery("SELECT posts.id,posts.postdate,posts.posttext,users.userid,users.username,users.powerlevel FROM posts LEFT JOIN users ON posts.authorid=users.userid WHERE thread = {$threadid} ORDER BY postdate LIMIT 1")); $author = userlink($post[userid], htmlspecialchars($post[username]), $post[powerlevel]); $postdate = parsedate_short($post[postdate]); print "<div class='portalheader'><b>{$thread['name']}</b> (<i>{$postdate} by {$author}</i>)</div>"; $posttext = getpost($post[posttext], true, true, false); print "<div class='portalbox'>"; print $posttext; print "<div style='text-align: center; padding: 2px; margin: 2px 0px; border-top: 1px solid #aad6ff'><a href='index.php?showthread={$threadid}'>view original thread</a> ({$thread['replies']} replies)</div>"; print "</div>"; } } ?> </td> <td style='width: 30%' valign='top'> <div class='portalheader'>Unused Box</div> <div class='portalbox' style='text-align: center'> Stuff can go here if you want. Edit modules/main.php. </div>