function threadpost($post, $bg, $pthread = '') { global $loguser, $quote, $edit, $ip, $smallfont, $tzoff, $sep, $dateformat, $dateshort, $tlayout, ${"tablebg{$bg}"}; $post = setlayout($post); $p = $post['id']; $u = $post['uid']; $set['bg'] = ${"tablebg{$bg}"}; $set['tdbg'] = "<td class='tbl font tdbg{$bg}' valign=top"; $linkclass = "url" . $post['uid']; $userlink = getuserlink($post, array('id' => 'uid'), $linkclass); unset($postuser); $set['userrank'] = getrank($post['useranks'], str_replace("<div", "<<z>idiot", $post['title']), $post['posts'], $post['powerlevel']); $set['userlink'] = "<a name={$p}></a>{$userlink}"; $set['date'] = date($dateformat, $post['date'] + $tzoff); if ($post['location']) { $set['location'] = "<br>From: {$post['location']}"; } if ($post['picture'] || $post['moodid'] && $post['moodurl']) { $post['picture'] = str_replace('>', '%3E', $post['picture']); $set['userpic'] = "<img src=\"{$post['picture']}\">"; $set['picture'] = $post['picture']; if ($post['moodid'] && $post['moodurl']) { $set['userpic'] = "<img src=\"" . str_replace(array('$', '>'), array($post['moodid'], '%3E'), $post['moodurl']) . "\">"; $set['picture'] = str_replace(array('$', '>'), array($post['moodid'], '%3E'), $post['moodurl']); } // $userpicture="<img src=\"$user['picture']\" name=pic$p onload=sizelimit(pic$p,60,100)>"; } if ($post['signtext']) { $post['signtext'] = $sep[$loguser['signsep']] . $post['signtext']; } if ($pthread) { $set['threadlink'] = "<a href=thread.php?id={$pthread['id']}>{$pthread['title']}</a>"; } $post['text'] = doreplace2($post['text'], $post['options']); // if (strpos($post['text'], "http://hyperhacker.no-ip.org/b/smilies/lolface.png") || strpos($post['text'], "images/smilies/roflx.gif")) $post['text'] = "<img src=images/smilies/roflx.gif><br><br><small>(Excessive post content hidden)</small>"; if (filter_int($post['editdate'])) { $post['edited'] = " (last edited by {$post['edited']} at " . date($dateformat, $post['editdate'] + $tzoff) . ")"; } $return = dofilters(postcode($post, $set)); return $return; }
} loadtlayout(); $user['headtext'] = $user['postheader']; $user['signtext'] = $user['signature']; $user['text'] = "Sample text. [quote=fhqwhgads]A sample quote, with a <a href=about:blank>link</a>, for testing your layout.[/quote]This is how your post will appear."; $user['uid'] = $_GET['id']; $user['date'] = ctime(); // so that layouts show up regardless of setting (for obvious reasons) $loguser['viewsig'] = 1; // shop/rpg such $shops = $sql->query('SELECT * FROM itemcateg ORDER BY corder'); $eq = $sql->fetchq("SELECT * FROM users_rpg WHERE uid={$id}"); $itemids = array_unique(array($eq['eq1'], $eq['eq2'], $eq['eq3'], $eq['eq4'], $eq['eq5'], $eq['eq6'], $eq['eq7'])); $itemids = implode(',', $itemids); $eqitems = $sql->query("SELECT * FROM items WHERE id IN ({$itemids})"); while ($item = $sql->fetch($eqitems)) { $items[$item['id']] = $item; } while ($shop = $sql->fetch($shops)) { $shoplist .= "\r\n\t\t\t<tr>\r\n\t\t\t{$tccell1s}>{$shop['name']}</td>\r\n\t\t\t{$tccell2s} width=100%>" . $items[$eq['eq' . $shop['id']]]['name'] . " </td>\r\n\t\t"; } /* extra munging for whatever reason */ $user['email'] = urlencode($user['email']); // AKA if ($user['aka'] && $user['aka'] != $user['name']) { $aka = "{$tccell1l} width=150><b>Also known as</td>\t\t\t{$tccell2l}>{$user['aka']}<tr>"; } else { $aka = ''; } print "\r\n\t{$header}\r\n\t<div>{$fonttag} Profile for <b>{$minipic}<span style='color:#{$namecolor}'>{$user['name']}</span></b></div>\r\n<table cellpadding=0 cellspacing=0 border=0>\r\n<td width=100% valign=top>\r\n{$tblstart}\r\n\t{$tccellh} colspan=2><center>General information<tr>\r\n\t<!-- {$tccell1l} width=150><b>Username</td>\t\t\t{$tccell2l}>{$user['name']}<tr> -->\r\n\t{$aka}\r\n\t{$tccell1l} width=150><b>Total posts</td>\t\t\t{$tccell2l}>{$user['posts']} ({$postavg} per day) {$projdate}<br>{$bar}<tr>\r\n\t{$tccell1l} width=150><b>Total threads</td>\t\t{$tccell2l}>{$threadsposted}<tr>\r\n\t{$tccell1l} width=150><b>EXP</td>\t\t\t\t\t{$tccell2l}>{$expstatus}<tr>\r\n" . (false ? "\t{$tccell1l} width=150><b>User rating</td>\t\t\t{$tccell2l}>{$ratingstatus}<tr>" : "") . "\r\n\t{$tccell1l} width=150><b>Registered on</td>\t\t{$tccell2l}>" . @date($dateformat, $user[regdate] + $tzoff) . " (" . floor((ctime() - $user[regdate]) / 86400) . " days ago)<tr>\r\n\t{$tccell1l} width=150><b>Last post</td>\t\t\t{$tccell2l}>{$lastpostdate}{$lastpostlink}<tr>\r\n\t{$tccell1l} width=150><b>Last activity</td>\t\t{$tccell2l}>" . date($dateformat, $user[lastactivity] + $tzoff) . "{$lastip}<tr>\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>Contact information<tr>\r\n\t{$tccell1l} width=150><b>Email address</td>\t\t{$tccell2l}><a href='mailto:{$user['email']}'>{$user['email']}</a> <tr>\r\n\t{$tccell1l} width=150><b>Homepage</td>\t\t\t{$tccell2l}><a href='{$user['homepageurl']}'>{$homepagename}</a> <tr>\r\n\t{$tccell1l} width=150><b>ICQ number</td>\t\t\t{$tccell2l}>{$user['icq']} {$icqicon} <tr>\r\n\t{$tccell1l} width=150><b>AIM screen name</td>\t\t{$tccell2l}><a href='aim:goim?screenname={$aim}'>{$user['aim']}</a> <tr>\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>User settings<tr>\r\n\t{$tccell1l} width=150><b>Timezone offset</td>\t\t{$tccell2l}>{$tzoffset} hours from the server, {$tzoffrel} hours from you (current time: {$tzdate})<tr>\r\n\t{$tccell1l} width=150><b>Items per page</td>\t\t{$tccell2l}>" . $user['threadsperpage'] . " threads, " . $user['postsperpage'] . " posts<tr>\r\n\t{$tccell1l} width=150><b>Color scheme</td>\t\t{$tccell2l}>" . $schname . "<tr>\r\n{$tblend}\r\n</td><td> </td><td valign=top>\r\n{$tblstart}\r\n\t{$tccellh}><center>RPG status<tr>\r\n\t{$tccell1l}><img src='status.php?u={$id}'>\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>Equipped Items<tr>\r\n\t{$shoplist}\r\n{$tblend}\r\n</td></table>\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>Personal information<tr>\r\n\t{$tccell1l} width=150><b>Real name</td>\t\t\t{$tccell2l}>{$user['realname']} <tr>\r\n\t{$tccell1l} width=150><b>Location</td>\t\t\t{$tccell2l}>{$user['location']} <tr>\r\n\t{$tccell1l} width=150><b>Birthday</td>\t\t\t{$tccell2l}>{$birthday} {$age} <tr>\r\n\t{$tccell1l} width=150><b>User bio</td>\t\t\t{$tccell2l}>" . dofilters(doreplace2(doreplace($user['bio'], $user['posts'], (ctime() - $user['regdate']) / 86400, $user['name']))) . " <tr>\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>Sample post<tr>\r\n\t" . threadpost($user, 1) . "\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellhs} colspan=2><center>Options<tr>\r\n\t{$tccell2s} colspan=2>\r\n\t<a href=thread.php?user={$id}>Show posts</a> | \r\n\t<a href=forum.php?user={$id}>View threads by this user</a>\r\n\t{$sendpmsg}\r\n {$ratelink}\r\n {$moodavatar}\r\n <tr>\r\n\t{$tccell2s} colspan=2>\r\n\t<a href=postsbyuser.php?id={$id}>List posts by this user</a> |\r\n\t<a href=postsbytime.php?id={$id}>Posts by time of day</a> |\r\n\t<a href=postsbythread.php?id={$id}>Posts by thread</a> | \r\n\t<a href=postsbyforum.php?id={$id}>Posts by forum</td>{$sneek}\r\n\t{$tblend}{$footer}\r\n "; printtimedif($startingtime);
$restricted = true; } $header = "{$header}\n\t\t{$fonttag}<a href=index.php>{$boardname}</a> - <a href=forum.php?id={$forumid}>{$forum['title']}</a> - {$thread['title']}<form action=newreply.php name=replier method=post autocomplete=\"off\"> {$tblstart}"; // Post preview if (($power >= $forum['minpowerreply'] || $forum['minpowerreply'] < 1) && $id > 0) { $postlist = "<tr>{$tccellh} colspan=2 style=\"font-weight:bold;\">Thread history</tr><tr>{$tccellh} width=150>User</td>{$tccellh} width=*>Post</tr>"; $qppp = $ppp + 1; $posts = $sql->query("SELECT name,posts,sex,powerlevel,user,text,options,num FROM users u,posts p,posts_text WHERE thread={$id} AND p.id=pid AND user=u.id ORDER BY p.id DESC LIMIT {$qppp}"); $i = 0; while ($post = $sql->fetch($posts)) { $bg = $i++ & 1 ? 'tdbg2' : 'tdbg1'; if ($ppp-- > 0) { $postnum = $post['num'] ? "{$post['num']}/" : ''; $tcellbg = "<td class='tbl {$bg} font' valign=top>"; $namecolor = getnamecolor($post['sex'], $post['powerlevel']); $postlist .= "<tr>\n\t\t\t\t\t{$tcellbg}<a href=profile.php?id={$post['user']}><font {$namecolor}>{$post['name']}</font></a>{$smallfont}<br>\n\t\t\t\t\tPosts: {$postnum}{$post['posts']}</td>\n\t\t\t\t\t{$tcellbg}" . doreplace2(dofilters($post['text']), $post['options']) . "</tr>\n\t\t\t\t"; } else { $tcellbg = "<td bgcolor={$tablebg1} valign=top colspan=2"; $postlist .= "<tr>{$tccellh} colspan=2>This is a long thread. Click <a href=thread.php?id={$id}>here</a> to view it.</td></tr>"; } } } if (!filter_string($_POST['action']) && !$thread['closed'] && !($banned && $log) && ($power >= $forum['minpowerreply'] || $forum['minpowerreply'] < 1) && $id > 0) { print $header; print ""; if ($log) { $username = $loguser['name']; $passhint = 'Alternate Login:'******'altlogin').style.cssText=''; this.style.cssText='display:none'\">Use an alternate login</a>\n\t\t\t\t<span id=\"altlogin\" style=\"display:none\">"; } else { $username = '';
$choices .= "<tr>\r\n\t\t\t\t{$tccell1l} width=20%>{$dot}{$link}" . $pollc['choice'] . "</a></td>\r\n\t\t\t\t{$tccell2l} width=60%>{$barpart}</td>\r\n\t\t\t\t{$tccell1} width=20%>" . ($poll['doublevote'] ? "{$pct}% of users, {$votes} ({$pct2}%)" : "{$pct}%, {$votes}") . "</td>\r\n\t\t\t\t</tr>"; } if ($poll['closed']) { $polltext = 'This poll is closed.'; } else { $polltext = 'Multi-voting is ' . ($poll['doublevote'] ? 'enabled.' : 'disabled.'); } if ($tvotes_u != 1) { $s_have = 's have'; } else { $s_have = ' has'; } if ($ismod) { $polledit = "<!-- edit would go here -->"; } $polltbl = "{$tblstart}\r\n\t\t\t<tr>{$tccellc} colspan=3><b>" . htmlspecialchars($poll['question']) . "</td></tr>\r\n\t\t\t<tr>{$tccell2ls} colspan=3>" . nl2br(dofilters($poll['briefing'])) . "</td></tr>\r\n\t\t\t{$choices}\r\n\t\t\t<tr>{$tccell2l} colspan=3>{$smallfont} {$polltext} {$tvotes_u} user{$s_have} voted. {$polledit}</td></tr>\r\n\t\t\t{$tblend}<br>\r\n\t\t\t"; } loadtlayout(); switch ($loguser['viewsig']) { case 1: $sfields = ',headtext,signtext'; break; case 2: $sfields = ',u.postheader headtext,u.signature signtext'; break; default: $sfields = ''; break; } $ufields = userfields(); $activity = $sql->query("SELECT user, count(*) num FROM posts WHERE date>" . (ctime() - 86400) . " GROUP BY user");