3
function posts_theme() {
5
global $user, $logged_in, $globals, $AEF_SESS, $theme, $l;
6
global $categories, $forums, $active, $activebots, $anonymous, $guests, $board, $poll, $user_group, $post_group, $tid, $tpg, $fid, $title, $topic, $post, $topicpages, $attachments, $page, $pg, $dmenus, $postcodefield, $users_who_read, $feeds;
8
if (!empty($board['rss'])) {
10
$feeds[] = '<link rel="alternate" type="application/rss+xml" title="' . $board['fname'] . ' - ' . $l['rss'] . '" href="' . $globals['ind'] . 'act=feeds&forum=' . $board['fid'] . '" />';
13
if (!empty($board['rss_topic'])) {
15
$feeds[] = '<link rel="alternate" type="application/rss+xml" title="' . $topic['topic'] . ' - ' . $l['rss'] . '" href="' . $globals['ind'] . 'act=feeds&topic=' . $topic['tid'] . '" />';
18
//////////////////////////
19
// Count the topic pages
20
//////////////////////////
22
$tpages = ceil(($topic['n_posts'] + 1) / $globals['maxpostsintopics']);
24
$pg = ($page / $globals['maxpostsintopics']) + 1; //Current Page
26
$topicpages = array();
32
$topicpages['<<'] = 1;
34
$topicpages['<'] = ($pg - 1);
37
for ($i = ($pg - 4); $i < $pg; $i++) {
45
$topicpages[$pg] = $pg;
48
for ($i = ($pg + 1); $i <= ($pg + 4); $i++) {
59
$topicpages['>'] = ($pg + 1);
61
$topicpages['>>'] = $tpages;
67
$topicpages[$l['all']] = 'all';
71
//Link array of active users
72
$activeusers = array();
74
//Build the active users array
75
foreach ($active as $i => $v) {
77
$activeusers[] = '<a href="' . userlink($v['id'], $v['username']) . '" style="color: ' . $active[$i]['mem_gr_colour'] . ';" >' . $active[$i]['username'] . '</a>';
81
foreach ($activebots as $k => $v) {
89
/////////////////////////////
91
/////////////////////////////
95
//Show the Voting Form
96
if ($poll['what_to_show'] == 1) {
98
//Can he see the results without voting
99
if ($poll['show_when'] == 0) {
101
$polloptions[] = '<a href="' . $globals['ind'] . 'tid=' . $tid . '&tpg=' . $pg . '&spollres" >' . $l['show_results'] . '</a>';
105
} elseif ($poll['what_to_show'] == 2) {
108
foreach ($poll['options'] as $opk => $opt) {
110
//If the total Votes are zero
111
if ($poll['votes'] != 0) {
113
$percentage = ($opt['poo_votes'] / $poll['votes']) * 100;
115
$img_width = (400 * $percentage) / 100;
117
$img_width = (($img_width > 0) ? $img_width : 11);
124
$poll['options'][$opk]['width'] = $img_width;
125
$poll['options'][$opk]['percentage'] = substr($percentage, 0, 5);
130
if ((!$poll['user_voted']) &&
131
($user['can_vote_polls'] || $board['can_vote_polls']) &&
132
!$poll['expired'] && !$poll['locked']) {
134
$polloptions[] = '<a href="' . $globals['ind'] . 'tid=' . $tid . '&tpg=' . $pg . '" >' . $l['vote'] . '</a>';
138
//Can he delete his vote
139
if ($poll['user_voted'] && $logged_in && $poll['change_vote']) {
141
$polloptions[] = '<a href="' . $globals['ind'] . 'tid=' . $tid . '&tpg=' . $pg . '&deletevote" >' . $l['delete_vote'] . '</a>';
146
} elseif ($poll['what_to_show'] == 3) {
148
//Left empty for future compatibility
152
///////////////////////////////
153
// Some Administrative Options
154
///////////////////////////////
155
//Can he EDIT the results
156
if (($poll['i_started'] && $user['can_edit_own_poll']) ||
157
(!$poll['i_started'] && $user['can_edit_other_poll'])) {
159
$adpolloptions[] = '<a href="' . $globals['ind'] . 'act=editpoll&poid=' . $poll['poid'] . '">' . $l['edit_poll'] . '</a>';
162
//Can he Remove the poll
163
if (($poll['i_started'] && $user['can_rem_own_poll']) ||
164
(!$poll['i_started'] && $user['can_rem_other_poll'])) {
166
$adpolloptions[] = '<a href="' . $globals['ind'] . 'act=removepoll&poid=' . $poll['poid'] . '">' . $l['reomve_poll'] . '</a>';
168
}//End of empty($poll)
170
if (!empty($poll['what_to_show']) && ($poll['what_to_show'] == 2)) {
172
$showthis = '<table cellpadding="3" cellspacing="3">';
174
foreach ($poll['options'] as $opk => $opt) {
176
$showthis .= '<tr><td align="right">
177
<b>' . $opt['poo_option'] . '</b>
178
(' . $opt['poo_votes'] . ')
181
<img src="' . $theme['images'] . 'poll.gif" width="' . $poll['options'][$opk]['width'] . '" height="10" alt="" /> (' . $opt['percentage'] . '%)
185
$showthis .= '<tr><td colspan="2"><br /><b>' . $l['total_votes'] . '</b> : ' . $poll['votes'] . '</td></tr></table>';
187
//Show the form for Voting
188
} elseif (!empty($poll['what_to_show']) && ($poll['what_to_show'] == 1)) {
190
$showthis = '<form accept-charset="' . $globals['charset'] . '" method="post" action="" name="poll_vote">
191
<table cellpadding="3" cellspacing="3">';
193
foreach ($poll['options'] as $opk => $opt) {
195
$showthis .= '<tr><td align="right">
196
' . $opt['poo_option'] . '
197
<input type="radio" name="uservote" value="' . $opt['pooid'] . '" />
204
<input type="submit" name="vote_poll" value="' . $l['submit_vote'] . '" /><br />
209
} elseif (!empty($poll['what_to_show']) && ($poll['what_to_show'] == 3)) {
211
$showthis = '<table cellpadding="3" cellspacing="3">';
213
$showthis .= '<tr><td><br />' . $l['will_be_shown_at'] . ' <b>' . datify($poll['expires_on']) . '</b><br /><br />' . $l['total_votes'] . ' : <b>' . $poll['votes'] . '</b></td></tr></table>';
217
if (!empty($poll['what_to_show'])) {
219
echo'<br /><table width="100%" class="cbor" cellpadding="1" cellspacing="1">
221
<td class="ptcbg" colspan="2">' . $l['poll'] . '</td>
224
' . (!empty($adpolloptions) ? '<tr>
225
<td class="ptcbg1" colspan="2" align="right" style="padding:4px;">' . implode(' | ', $adpolloptions) . '
226
</td></tr>' : '') . '
229
<td class="ptwbg" colspan="2"><b>' . $l['the_poll_question'] . ' : </b>' . $poll['qt'] . '</td>
233
<td class="ptwbg" align="center">' . $showthis . '</td>
234
' . (!empty($polloptions) ? '<td class="ptwbg" align="center" width="25%" valign="top">' . implode('<br />', $polloptions) . '</td>' : '') . '
242
if (!empty($topicpages)) {
244
$links = '<table align="right" class="cbgbor" cellspacing="1">
246
$links .= '<td class="pagelinks"><a href="#" onmouseover="dropmenu(this, \'pagejump\')" onmouseout="pullmenu(\'pagejump\')" title="' . $l['jump_to_txt'] . '" >' . $l['page'] . ' ' . $pg . ' ' . $l['of'] . ' ' . $tpages . '</a></td>';
248
echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
249
createmenu("pagejump", [
250
[\'<form accept-charset="' . $globals['charset'] . '" name="pagejump" method="get" action="' . $globals['ind'] . '"><input type="hidden" name="tid" value="' . $tid . '" /><input type="text" name="tpg" size="10" /><input type="submit" value="' . $l['submit_go'] . '" /><\/form>\']
254
foreach ($topicpages as $k => $lv) {
256
$links .= '<td class="' . ($k == $pg ? 'activepage' : 'pagelinks' ) . '"><a href="' . topiclink($tid, $topic['topic'], $lv) . '" >' . $k . '</a></td>';
265
if (!empty($user['can_reply_to_this_topic'])) {
267
echo '<br /><a href="' . $globals['ind'] . 'act=post&topid=' . $topic['tid'] . '"><img src="' . $theme['images'] . 'buttons/reply.png" alt="" /></a>';
270
if (!empty($user['can_poll_this_topic'])) {
272
echo ' <a href="' . $globals['ind'] . 'act=postpoll"><img src="' . $theme['images'] . 'buttons/addpoll.png" alt="" /></a>';
275
if (!(empty($user['can_lock_this_topic']) && !$user['can_make_sticky']
276
&& empty($user['can_edit_this_topic']) && empty($user['can_del_this_topic'])
277
&& empty($user['can_move_this_topic']))) {
280
$top_opt[] = '<a href="#" onmouseover="dropmenu(this, \'modopt\')" onmouseout="pullmenu(\'modopt\')">' . $l['options'] . '</a>';
282
echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[';
284
if ($user['can_edit_this_topic']) {
288
var qet = \'<form accept-charset="' . $globals['charset'] . '" action="' . $globals['ind'] . 'act=edittopic&topid=' . $topic['tid'] . '" method="post" name="edittopicform"><table width="100%" cellpadding="2" cellspacing="1" align="center"><tr><td width="25%" class="etlc">' . $l['edit_title'] . '<\/td><td class="etrc"><input type="text" size="30" name="toptitle" value="' . $topic['topic'] . '" \/><\/td><\/tr><tr><td class="etlc">' . $l['edit_description'] . '<\/td><td class="etrc"><input type="text" size="30" name="topdesc" value="' . $topic['description'] . '" \/><\/td><\/tr><tr><td colspan="2" class="etrc" style="text-align:center"><input type="hidden" name="topic_icon" value="' . $topic['type_image'] . '" \/><input type="submit" name="edittopic" value="' . $l['edit_submit_button'] . '" \/><\/td><\/tr><\/table><\/form>\';
289
domwindow("qet", qet, "", "' . $l['quick_edit_topic'] . '");
294
echo 'createmenu("modopt", [
295
' . (empty($user['can_lock_this_topic']) ? '' : '[\'' . ($topic['t_status'] == 1 ? '<a href="' . $globals['ind'] . 'act=locktopic&do=0&topid=' . $topic['tid'] . '">' . $l['lock_topic'] . '<\/a>' : '<a href="' . $globals['ind'] . 'act=locktopic&do=1&topid=' . $topic['tid'] . '">' . $l['unlock_topic'] . '<\/a>') . '\'],') . '
296
' . ($user['can_make_sticky'] ? '[\'' . ($topic['t_sticky'] == 1 ? '<a href="' . $globals['ind'] . 'act=pintopic&do=0&topid=' . $topic['tid'] . '">' . $l['unpin_topic'] . '<\/a>' : '<a href="' . $globals['ind'] . 'act=pintopic&do=1&topid=' . $topic['tid'] . '">' . $l['pin_topic'] . '<\/a>') . '\'],' : '') . '
297
' . (empty($user['can_edit_this_topic']) ? '' : '[\'<a href="' . $globals['ind'] . 'act=edittopic&topid=' . $topic['tid'] . '">' . $l['edit_topic'] . '<\/a>\'],
298
[\'<a href="javascript:void(0);" onclick="qet();">' . $l['quick_edit_topic'] . '<\/a>\'],' ) . '
299
' . (empty($user['can_del_this_topic']) ? '' : '[\'<a href="' . $globals['ind'] . 'act=deletetopic&topid=' . $topic['tid'] . '">' . $l['delete_topic'] . '<\/a>\'],' ) . '
300
' . (empty($user['can_move_this_topic']) ? '' : '[\'<a href="' . $globals['ind'] . 'act=movetopic&topid=' . $topic['tid'] . '">' . $l['move_topic'] . '<\/a>\'],' ) . '
305
echo '<br /><br /><table width="100%" cellpadding="4" cellspacing="0" class="cbgbor">
306
<tr>' . (empty($board['rss_topic']) ? '' : '<td class="ptcbgrss"><a href="' . $globals['ind'] . 'act=feeds&topic=' . $topic['tid'] . '"><img src="' . $theme['images'] . 'feeds.gif" alt="" /></a></td>') . '<td class="ptcbg1" align="right">';
311
$top_opt[] = '<a href="' . $globals['ind'] . 'act=markread&mark=unreadtopic&utid=' . $topic['tid'] . '">' . $l['mark_as_unread'] . '</a>';
314
//Can he post reply - quick
315
if (!empty($user['can_reply_to_this_topic']) && !empty($board['quick_reply'])) {
317
$top_opt[] = '<a href="javascript:showquickreply(\'quickreply\')">' . $l['quick_reply'] . '</a>';
319
$usesmileys = ($logged_in ? ( $user['showsmileys'] == 1 ? true : ($user['showsmileys'] == 2 ? false : $globals['usesmileys']) ) : $globals['usesmileys']);
321
$dmenus[] = '<div id="quickreply" class="pqr">
322
<form accept-charset="' . $globals['charset'] . '" method="post" action="' . $globals['ind'] . 'act=post&topid=' . $topic['tid'] . '">
323
<table width="100%" cellspacing="0" cellpadding="0" id="qrhandle">
325
<td class="dwhl"></td>
326
<td align="left" class="dwhc"><b>' . $l['quick_reply'] . '</b></td>
327
<td align="right" class="dwhc"><a href="javascript:hideel(\'quickreply\')"><img src="' . $theme['images'] . 'close.gif" alt="" /></a></td>
328
<td class="dwhr"></td>
332
<table width="100%" cellspacing="1" cellpadding="2" class="dwbody">
334
<td class="rlc" width="15%"><b>' . $l['qr_post'] . '</b></td>
335
<td align="left" class="rrc">
336
<textarea name="post" rows="6" cols="55" id="topicpost"></textarea>
337
' . $postcodefield . '
342
<td class="rlc"><b>' . $l['qr_options'] . '</b></td>
343
<td align="left" class="rrc"><input type="checkbox" name="usesmileys" ' . (empty($usesmileys) ? '' : 'checked="checked"') . ' /> ' . $l['qr_enable_smileys'] . '
348
<td class="rlc" colspan="2" style="text-align:center">
349
<input type="submit" name="submitpost" value="' . $l['qr_submit'] . '" />
354
<td align="left" class="dwb" colspan="2"></td>
361
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
362
Drag.init($("qrhandle"), $("quickreply"));
363
function showquickreply(){
364
qrid = \'quickreply\';
365
$(qrid).style.left=((getwidth()/2)-($(qrid).offsetWidth/2))+"px";
366
$(qrid).style.top=(scrolledy()+110)+"px";
368
smoothopaque(qrid, 0, 100, 10);
373
if ($user['notify_new_posts'] && empty($user['is_topic_subscribed'])) {
375
$top_opt[] = '<a href="' . $globals['ind'] . 'act=notify&nact=topic&ntid=' . $topic['tid'] . '">' . $l['subscribe_topic'] . '</a>';
376
} elseif ($user['notify_new_posts'] && !empty($user['is_topic_subscribed'])) {
378
$top_opt[] = '<a href="' . $globals['ind'] . 'act=notify&nact=unsubtopic&ntid=' . $topic['tid'] . '">' . $l['unsubscribe_topic'] . '</a>';
381
$top_opt[] = '<a href="' . $globals['ind'] . 'tid=' . $tid . '&threaded=true">' . $l['threaded_mode'] . '</a>';
383
if ($globals['allow_taf'] && $user['can_email_topic']) {
385
$top_opt[] = '<a href="' . $globals['ind'] . 'act=tellafriend&topid=' . $topic['tid'] . '">' . $l['tell_a_friend'] . '</a>';
388
$top_opt[] = '<a href="' . $globals['ind'] . 'tid=' . $topic['tid'] . '&tpg=' . (!is_numeric($page) ? 'all' : $pg) . '&printtopic" target="_blank" title="' . $l['print_title'] . '">' . $l['print'] . '</a> ';
392
echo implode(' | ', $top_opt);
397
$show_mod = (($user['can_del_own_post'] && $user['can_del_own_post']) || $user['can_merge_posts'] ? 1 : 0);
401
echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
402
function deleteconfirm(){
403
if($("selectedposts").value == "delete"){
404
var conf = confirm("' . $l['del_sel_conf'] . '");
415
<form accept-charset="' . $globals['charset'] . '" method="post" action="" name="postmod" onsubmit="return deleteconfirm();">';
418
foreach ($post as $p => $pv) {
420
//The first row that is Headers
421
echo '<br /><table width="100%" cellpadding="0" cellspacing="0">
424
<table width="100%" cellpadding="0" cellspacing="0"><tr>
425
<td class="pcbgl"></td>
426
<td class="pcbg"><b>' . ($post[$p]['post_count'] == 0 ? ' ' . $title . (empty($topic['description']) ? '' : ', ' . $topic['description']) . ' (' . $topic['n_posts'] . ' ' . $l['replies'] . ', ' . $l['read'] . ' ' . $topic['n_views'] . ' ' . $l['times'] . ')' : $post[$p]['post_title']) . '</b></td>
427
<td class="pcbgr"></td>
435
<table width="100%" cellpadding="1" cellspacing="0">
437
<td class="posterbg" width="22%">
439
<a href="' . (isset($post[$p]['is_guest']) ? 'mailto:' . $post[$p]['email'] : userlink($pv['id'], $pv['username'])) . '">
440
' . $post[$p]['username'] . '
444
<td class="postdate" align="right">
445
<div style="float:left">
446
<a name="p' . $post[$p]['pid'] . '"></a>
447
<img src="' . $theme['images'] . 'postedon.png" title="' . $l['posted_on'] . '" alt="' . $l['posted_on'] . '" /> <a href="' . topiclink($tid, $topic['topic'], $pg) . '#p' . $p . '">#</a>
448
' . $post[$p]['pdate'];
450
echo (($post[$p]['post_count']) ? ' | ' . $l['post_num_prefix'] . ': ' . $post[$p]['post_count'] : '');
457
if (isset($post[$p]['can_reply'])) {
459
$post_opt[] = '<a href="' . $globals['ind'] . 'act=post&topid=' . $topic['tid'] . '&pid=' . $post[$p]['pid'] . '">' . $l['quote'] . '</a>';
462
//Can he edit the post
463
if (isset($post[$p]['can_edit'])) {
465
$post_opt[] = '<a href="' . $globals['ind'] . 'act=edit&pid=' . $post[$p]['pid'] . '">' . $l['edit'] . '</a>';
468
//Can he delete the post
469
if (isset($post[$p]['can_del']) && $post[$p]['post_count'] != 0) {
471
$post_opt[] = '<a href="' . $globals['ind'] . 'act=delete&pid=' . $post[$p]['pid'] . '" onclick="return confirm(\'' . $l['del_this_conf'] . '\');">' . $l['delete'] . '</a>';
474
//Can he report this post
475
if (!empty($globals['report_posts']) && !empty($user['can_report_post'])) {
477
$post_opt[] = '<a href="' . $globals['ind'] . 'act=report&pid=' . $post[$p]['pid'] . '">' . $l['report'] . '</a>';
480
//Does he have an admin
483
$post_opt[] = '<input type="checkbox" name="pids[]" value="' . $post[$p]['pid'] . '" />';
486
echo implode(' | ', $post_opt) . '</td>
490
<td class="posterinfo" valign="top">';
492
if (!empty($post[$p]['avatarurl'])) {
494
echo '<div style="text-align:center;"><a href="' . userlink($pv['id'], $pv['username']) . '"><img src="' . $post[$p]['avatarurl'][0] . '" width="' . $post[$p]['avatarurl'][1] . '" height="' . $post[$p]['avatarurl'][2] . '" alt="" /></a></div>';
497
echo '<div class="pisub">' . $l['prefix_group'] . ' <span ' . (empty($post[$p]['mem_gr_colour']) ? '' : 'style="color:' . $post[$p]['mem_gr_colour'] . ';"') . '>' . $post[$p]['mem_gr_name'] . '</span><br />';
499
//If the user group has some images as per Group
500
if ($post[$p]['image_count']) {
502
for ($i = 0; $i < $post[$p]['image_count']; $i++) {
503
echo '<img src="' . $theme['images'] . $post[$p]['image_name'] . '" alt="" />';
510
' . (!empty($post[$p]['post_gr_name']) ? '<div class="pisub">' . $l['prefix_post_group'] . ' ' . $post[$p]['post_gr_name'] . '</div>' : '') . '
511
' . (!empty($post[$p]['posts']) ? '<div class="pisub">' . $l['prefix_posts'] . ' ' . $post[$p]['posts'] . '</div>' : '') . '
512
<div class="pisub">' . $l['prefix_status'] . ' ' . ($post[$p]['status'] ? '<img src="' . $theme['images'] . 'online.png" title="' . $l['online'] . '" alt="" />' : '<img src="' . $theme['images'] . 'offline.png" title="' . $l['offline'] . '" alt="" />') . '</div>
513
' . ( (empty($post[$p]['users_text'])) ? '' : '<br />' . $post[$p]['users_text'] ) . '
515
<td class="post" align="left" valign="top">
516
' . wordwrap($post[$p]['post'], 80, " ", 1) . '
517
' . (!empty($attachments[$post[$p]['pid']]) ? '<br /><br />-----------------------<br />' . implode('<br />', $attachments[$post[$p]['pid']]) : '') . '
518
' . (!empty($post[$p]['modifier']) ? '<br /><br />' . $l['edited_by'] . ' <b>' . $post[$p]['modifier'] . '</b> : ' . $post[$p]['modtime'] : '');
520
if (!empty($post[$p]['sig'])) {
522
echo '<br /><br />-----------------------<br />' . $post[$p]['sig'];
530
<b>' . $l['ip'] . ':</b> ' . ((isset($post[$p]['poster_ip'])) ? $post[$p]['poster_ip'] : '--' ) . '
532
<td class="specialrow">
533
<a href="' . (isset($post[$p]['is_guest']) ? 'mailto:' . $post[$p]['email'] : userlink($pv['id'], $pv['username'])) . '"><img src="' . $theme['images'] . 'profile.gif" title="' . $l['view_profile_of'] . ' ' . $post[$p]['username'] . '" alt="" /></a>
535
' . (!empty($post[$p]['email']) ? '<a href="mailto:' . $post[$p]['email'] . '"><img src="' . $theme['images'] . 'email.gif" title="' . $l['send_email_to'] . ' ' . $post[$p]['username'] . '" alt="" /></a> ' : '') . '
537
' . ($logged_in ? '<a href="' . $globals['ind'] . 'act=usercp&ucpact=writepm&to=' . $post[$p]['id'] . '"><img src="' . $theme['images'] . 'pmuser.gif" title="' . $l['send_pm_to'] . ' ' . $post[$p]['username'] . '" alt="" /></a> ' : '') . '
539
' . (!empty($post[$p]['www']) ? '<a href="' . $post[$p]['www'] . '" target="_blank"><img src="' . $theme['images'] . 'www.gif" title="' . $l['visit_website_of'] . ' ' . $post[$p]['username'] . '" alt="" /></a> ' : '') . '
541
' . (!empty($post[$p]['msn']) ? '<a href="http://members.msn.com/' . $post[$p]['msn'] . '" target="_blank"><img src="' . $theme['images'] . 'msn.gif" title="' . $l['view_msn_profile'] . ' ' . $post[$p]['username'] . '" alt="" /></a> ' : '') . '
543
' . (!empty($post[$p]['aim']) ? '<a href="aim:goim?screenname=' . $post[$p]['aim'] . '&message=' . $l['aim_hello'] . '" target="_blank"><img src="' . $theme['images'] . 'aim.gif" title="' . $l['aim_username_is'] . ' ' . $post[$p]['username'] . ' ' . $l['is'] . ' ' . $post[$p]['aim'] . '" alt="" /></a> ' : '') . '
545
' . (!empty($post[$p]['yim']) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $post[$p]['yim'] . '&.src=pg" target="_blank"><img src="' . $theme['images'] . 'yim.gif" title="' . $l['yim_identity_is'] . ' ' . $post[$p]['username'] . ' ' . $l['is'] . ' ' . $post[$p]['yim'] . '" alt="" /></a> ' : '') . '
556
<td><img src="' . $theme['images'] . 'cbot.png" width="100%" height="10" alt="" /></td>
561
if (!empty($globals['prenextopic'])) {
563
echo '<br /><a href="' . $globals['ind'] . 'tid=' . $tid . '&tpg=' . $pg . '&previous" >« ' . $l['previous'] . '</a> <a href="' . $globals['ind'] . 'tid=' . $tid . '&tpg=' . $pg . '&next" >' . $l['next'] . ' »</a>';
568
echo '<br /><div style="text-align:right;">' . $l['with_selected'] . ' : <select name="withselected" id="selectedposts">
569
' . (($user['can_del_own_post'] && $user['can_del_own_post']) ? '<option value="delete">' . $l['delete_posts'] . '</option>' : '') . '
570
' . ($user['can_merge_posts'] ? '<option value="merge">' . $l['merge_posts'] . '</option>' : '') . '
571
</select>
572
<input type="submit" name="withselsubmit" value="' . $l['submit_go'] . '" />
577
echo '<br /><br /><table width="100%" cellpadding="4" cellspacing="0" class="cbgbor">
578
<tr><td class="ptcbg1" align="right">';
579
echo implode(' | ', $top_opt);
584
if (!empty($topicpages)) {
590
if (!empty($user['can_reply_to_this_topic'])) {
592
echo '<br /><a href="' . $globals['ind'] . 'act=post&topid=' . $topic['tid'] . '"><img src="' . $theme['images'] . 'buttons/reply.png" alt="" /></a>';
595
if (!empty($user['can_poll_this_topic'])) {
597
echo ' <a href="' . $globals['ind'] . 'act=postpoll"><img src="' . $theme['images'] . 'buttons/addpoll.png" alt="" /></a>';
600
echo '<div align="right">' . navigator() . '</div>';
602
if (!empty($users_who_read)) {
605
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="cbor">
608
<td colspan="2" class="cbg1" align="left">' . $l['users_who_read'] . '</td>
612
<td align="center" class="miposts" width="5%">
613
<img src="' . $theme['images'] . 'online.gif" alt="" />
617
foreach ($users_who_read as $u => $uv) {
619
$users_who_read[$u] = '<a href="' . userlink($uv['id'], $uv['username']) . '" style="color: ' . $uv['mem_gr_colour'] . ';" >' . $uv['username'] . '</a>';
622
echo implode(', ', $users_who_read) . '</td>
629
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="cbor">
632
<td colspan="2" class="cbg1" align="left">' . $l['users_viewing'] . '</td>
636
<td align="center" class="miposts" width="5%">
637
<img src="' . $theme['images'] . 'online.gif" alt="" />
640
' . $guests . ' ' . $l['guests'] . ', ' . count($active) . ' ' . $l['users'] . '' . (($anonymous) ? ', ' . $anonymous . ' ' . $l['viewing_anonymous'] : '.' ) . '
641
' . (!empty($activeusers) ? '<hr />' . implode(', ', $activeusers) : '') . '
647
//The defualt footers
651
function thread_theme() {
653
global $user, $logged_in, $globals, $AEF_SESS, $theme, $l;
654
global $categories, $forums, $active, $activebots, $anonymous, $guests, $board, $poll, $user_group, $post_group, $tid, $tpg, $fid, $title, $topic, $post, $topicpages, $attachments, $page, $dmenus, $postcodefield, $pid, $fpid, $users_who_read, $feeds;
656
if (!empty($board['rss'])) {
658
$feeds[] = '<link rel="alternate" type="application/rss+xml" title="' . $board['fname'] . ' - ' . $l['rss'] . '" href="' . $globals['ind'] . 'act=feeds&forum=' . $board['fid'] . '" />';
661
if (!empty($board['rss_topic'])) {
663
$feeds[] = '<link rel="alternate" type="application/rss+xml" title="' . $topic['topic'] . ' - ' . $l['rss'] . '" href="' . $globals['ind'] . 'act=feeds&topic=' . $topic['tid'] . '" />';
666
//Link array of active users
667
$activeusers = array();
669
//Build the active users array
670
foreach ($active as $i => $v) {
672
$activeusers[] = '<a href="' . userlink($v['id'], $v['username']) . '" style="color: ' . $active[$i]['mem_gr_colour'] . ';" >' . $active[$i]['username'] . '</a>';
676
foreach ($activebots as $k => $v) {
684
/////////////////////////////
686
/////////////////////////////
690
//Show the Voting Form
691
if ($poll['what_to_show'] == 1) {
693
//Can he see the results without voting
694
if ($poll['show_when'] == 0) {
696
$polloptions[] = '<a href="' . $globals['ind'] . 'tid=' . $tid . '&spollres" >' . $l['show_results'] . '</a>';
700
} elseif ($poll['what_to_show'] == 2) {
703
foreach ($poll['options'] as $opk => $opt) {
705
//If the total Votes are zero
706
if ($poll['votes'] != 0) {
708
$percentage = ($opt['poo_votes'] / $poll['votes']) * 100;
710
$img_width = (400 * $percentage) / 100;
712
$img_width = (($img_width > 0) ? $img_width : 11);
719
$poll['options'][$opk]['width'] = $img_width;
720
$poll['options'][$opk]['percentage'] = substr($percentage, 0, 5);
725
if ((!$poll['user_voted']) &&
726
($user['can_vote_polls'] || $board['can_vote_polls']) &&
727
!$poll['expired'] && !$poll['locked']) {
729
$polloptions[] = '<a href="' . $globals['ind'] . 'tid=' . $tid . '" >' . $l['vote'] . '</a>';
733
//Can he delete his vote
734
if ($poll['user_voted'] && $logged_in && $poll['change_vote']) {
736
$polloptions[] = '<a href="' . $globals['ind'] . 'tid=' . $tid . '&deletevote" >' . $l['delete_vote'] . '</a>';
741
} elseif ($poll['what_to_show'] == 3) {
743
//Left empty for future compatibility
747
///////////////////////////////
748
// Some Administrative Options
749
///////////////////////////////
750
//Can he EDIT the results
751
if (($poll['i_started'] && $user['can_edit_own_poll']) ||
752
(!$poll['i_started'] && $user['can_edit_other_poll'])) {
754
$adpolloptions[] = '<a href="' . $globals['ind'] . 'act=editpoll&poid=' . $poll['poid'] . '">' . $l['edit_poll'] . '</a>';
757
//Can he Remove the poll
758
if (($poll['i_started'] && $user['can_rem_own_poll']) ||
759
(!$poll['i_started'] && $user['can_rem_other_poll'])) {
761
$adpolloptions[] = '<a href="' . $globals['ind'] . 'act=removepoll&poid=' . $poll['poid'] . '">' . $l['reomve_poll'] . '</a>';
763
}//End of empty($poll)
765
if (!empty($poll['what_to_show']) && ($poll['what_to_show'] == 2)) {
767
$showthis = '<table cellpadding="3" cellspacing="3">';
769
foreach ($poll['options'] as $opk => $opt) {
771
$showthis .= '<tr><td align="right">
772
<b>' . $opt['poo_option'] . '</b>
773
(' . $opt['poo_votes'] . ')
776
<img src="' . $theme['images'] . 'poll.gif" width="' . $poll['options'][$opk]['width'] . '" height="10" alt="" /> (' . $opt['percentage'] . '%)
780
$showthis .= '<tr><td colspan="2"><br /><b>' . $l['total_votes'] . '</b> : ' . $poll['votes'] . '</td></tr></table>';
782
//Show the form for Voting
783
} elseif (!empty($poll['what_to_show']) && ($poll['what_to_show'] == 1)) {
785
$showthis = '<form accept-charset="' . $globals['charset'] . '" method="post" action="" name="poll_vote">
786
<table cellpadding="3" cellspacing="3">';
788
foreach ($poll['options'] as $opk => $opt) {
790
$showthis .= '<tr><td align="right">
791
' . $opt['poo_option'] . '
792
<input type="radio" name="uservote" value="' . $opt['pooid'] . '" />
799
<input type="submit" name="vote_poll" value="' . $l['submit_vote'] . '" /><br />
804
} elseif (!empty($poll['what_to_show']) && ($poll['what_to_show'] == 3)) {
806
$showthis = '<table cellpadding="3" cellspacing="3">';
808
$showthis .= '<tr><td><br />' . $l['will_be_shown_at'] . ' <b>' . datify($poll['expires_on']) . '</b><br /><br />' . $l['total_votes'] . ' : <b>' . $poll['votes'] . '</b></td></tr></table>';
812
if (!empty($poll['what_to_show'])) {
814
echo'<br /><table width="100%" class="cbor" cellpadding="1" cellspacing="1">
816
<td class="ptcbg" colspan="2">' . $l['poll'] . '</td>
819
' . (!empty($adpolloptions) ? '<tr>
820
<td class="ptcbg1" colspan="2" align="right" style="padding:4px;">' . implode(' | ', $adpolloptions) . '
821
</td></tr>' : '') . '
824
<td class="ptwbg" colspan="2"><b>' . $l['the_poll_question'] . ' : </b>' . $poll['qt'] . '</td>
828
<td class="ptwbg" align="center">' . $showthis . '</td>
829
' . (!empty($polloptions) ? '<td class="ptwbg" align="center" width="25%" valign="top">' . implode('<br />', $polloptions) . '</td>' : '') . '
838
if (!empty($user['can_reply_to_this_topic'])) {
840
echo '<br /><a href="' . $globals['ind'] . 'act=post&topid=' . $topic['tid'] . '&par_id=' . $pid . '"><img src="' . $theme['images'] . 'buttons/reply.png" alt="" /></a>';
843
if (!empty($user['can_poll_this_topic'])) {
845
echo ' <a href="' . $globals['ind'] . 'act=postpoll"><img src="' . $theme['images'] . 'buttons/addpoll.png" alt="" /></a>';
848
if (!(empty($user['can_lock_this_topic']) && !$user['can_make_sticky']
849
&& empty($user['can_edit_this_topic']) && empty($user['can_del_this_topic'])
850
&& empty($user['can_move_this_topic']))) {
853
$top_opt[] = '<a href="#" onmouseover="dropmenu(this, \'modopt\')" onmouseout="pullmenu(\'modopt\')">' . $l['options'] . '</a>';
855
echo '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
856
createmenu("modopt", [
857
' . (empty($user['can_lock_this_topic']) ? '' : '[\'' . ($topic['t_status'] == 1 ? '<a href="' . $globals['ind'] . 'act=locktopic&do=0&topid=' . $topic['tid'] . '">' . $l['lock_topic'] . '</a>' : '<a href="' . $globals['ind'] . 'act=locktopic&do=1&topid=' . $topic['tid'] . '">' . $l['unlock_topic'] . '</a>') . '\'],') . '
858
' . ($user['can_make_sticky'] ? '[\'' . ($topic['t_sticky'] == 1 ? '<a href="' . $globals['ind'] . 'act=pintopic&do=0&topid=' . $topic['tid'] . '">' . $l['unpin_topic'] . '</a>' : '<a href="' . $globals['ind'] . 'act=pintopic&do=1&topid=' . $topic['tid'] . '">' . $l['pin_topic'] . '</a>') . '\'],' : '') . '
859
' . (empty($user['can_edit_this_topic']) ? '' : '[\'<a href="' . $globals['ind'] . 'act=edittopic&topid=' . $topic['tid'] . '">' . $l['edit_topic'] . '<\/a>\'],' ) . '
860
' . (empty($user['can_del_this_topic']) ? '' : '[\'<a href="' . $globals['ind'] . 'act=deletetopic&topid=' . $topic['tid'] . '">' . $l['delete_topic'] . '<\/a>\'],' ) . '
861
' . (empty($user['can_move_this_topic']) ? '' : '[\'<a href="' . $globals['ind'] . 'act=movetopic&topid=' . $topic['tid'] . '">' . $l['move_topic'] . '<\/a>\'],' ) . '
866
echo '<br /><br /><table width="100%" cellpadding="4" cellspacing="0" class="cbgbor">
867
<tr>' . (empty($board['rss_topic']) ? '' : '<td class="ptcbgrss"><a href="' . $globals['ind'] . 'act=feeds&topic=' . $topic['tid'] . '"><img src="' . $theme['images'] . 'feeds.gif" alt="" /></a></td>') . '<td class="ptcbg1" align="right">';
872
$top_opt[] = '<a href="' . $globals['ind'] . 'act=markread&mark=unreadtopic&utid=' . $topic['tid'] . '">' . $l['mark_as_unread'] . '</a>';
875
//Can he post reply - quick
876
if (!empty($user['can_reply_to_this_topic']) && !empty($board['quick_reply'])) {
878
$top_opt[] = '<a href="javascript:showquickreply(\'quickreply\')">' . $l['quick_reply'] . '</a>';
880
$usesmileys = ($logged_in ? ( $user['showsmileys'] == 1 ? true : ($user['showsmileys'] == 2 ? false : $globals['usesmileys']) ) : $globals['usesmileys']);
882
$dmenus[] = '<div id="quickreply" class="pqr">
883
<form accept-charset="' . $globals['charset'] . '" method="post" action="' . $globals['ind'] . 'act=post&topid=' . $topic['tid'] . '&par_id=' . $pid . '">
884
<table width="100%" cellspacing="0" cellpadding="0" id="qrhandle">
886
<td class="dwhl"></td>
887
<td align="left" class="dwhc"><b>' . $l['quick_reply'] . '</b></td>
888
<td align="right" class="dwhc"><a href="javascript:hideel(\'quickreply\')"><img src="' . $theme['images'] . 'close.gif" alt="" /></a></td>
889
<td class="dwhr"></td>
893
<table width="100%" cellspacing="1" cellpadding="2" class="dwbody">
895
<td class="rlc" width="15%"><b>' . $l['qr_post'] . '</b></td>
896
<td align="left" class="rrc">
897
<textarea name="post" rows="6" cols="55" id="topicpost"></textarea>
898
' . $postcodefield . '
903
<td class="rlc"><b>' . $l['qr_options'] . '</b></td>
904
<td align="left" class="rrc"><input type="checkbox" name="usesmileys" ' . (empty($usesmileys) ? '' : 'checked="checked"') . ' /> ' . $l['qr_enable_smileys'] . '
909
<td class="rlc" colspan="2" style="text-align:center">
910
<input type="submit" name="submitpost" value="' . $l['qr_submit'] . '" />
915
<td align="left" class="dwb" colspan="2"></td>
922
<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
923
Drag.init($("qrhandle"), $("quickreply"));
924
function showquickreply(){
925
qrid = \'quickreply\';
926
$(qrid).style.left=((getwidth()/2)-($(qrid).offsetWidth/2))+"px";
927
$(qrid).style.top=(scrolledy()+110)+"px";
929
smoothopaque(qrid, 0, 100, 10);
934
if ($user['notify_new_posts'] && empty($user['is_topic_subscribed'])) {
936
$top_opt[] = '<a href="' . $globals['ind'] . 'act=notify&nact=topic&ntid=' . $topic['tid'] . '">' . $l['subscribe_topic'] . '</a>';
937
} elseif ($user['notify_new_posts'] && !empty($user['is_topic_subscribed'])) {
939
$top_opt[] = '<a href="' . $globals['ind'] . 'act=notify&nact=unsubtopic&ntid=' . $topic['tid'] . '">' . $l['unsubscribe_topic'] . '</a>';
942
$top_opt[] = '<a href="' . $globals['ind'] . 'tid=' . $tid . '&nor=true">' . $l['normal_mode'] . '</a>';
944
if ($globals['allow_taf'] && $user['can_email_topic']) {
946
$top_opt[] = '<a href="' . $globals['ind'] . 'act=tellafriend&topid=' . $topic['tid'] . '">' . $l['tell_a_friend'] . '</a>';
949
$top_opt[] = '<a href="' . $globals['ind'] . 'tid=' . $topic['tid'] . '&printtopic" target="_blank" title="' . $l['print_title'] . '">' . $l['print'] . '</a> ';
951
echo implode(' | ', $top_opt);
956
$p = $pid; //Just getting bored to write $pid
957
//The first row that is Headers
958
echo '<br /><table width="100%" cellpadding="0" cellspacing="0">
961
<table width="100%" cellpadding="0" cellspacing="0"><tr>
962
<td class="pcbgl"></td>
963
<td class="pcbg"><b>' . ($post[$p]['post_count'] == 0 || empty($post[$p]['post_title']) ? ' ' . $title . (empty($topic['description']) ? '' : ', ' . $topic['description']) . ' (' . $topic['n_posts'] . ' ' . $l['replies'] . ', ' . $l['read'] . ' ' . $topic['n_views'] . ' ' . $l['times'] . ')' : $post[$p]['post_title']) . '</b></td>
964
<td class="pcbgr"></td>
972
<table width="100%" cellpadding="1" cellspacing="0">
974
<td class="posterbg" width="22%">
976
<a href="' . (isset($post[$p]['is_guest']) ? 'mailto:' . $post[$p]['email'] : userlink($post[$p]['id'], $post[$p]['username'])) . '">
977
' . $post[$p]['username'] . '
981
<td class="postdate" align="right">
982
<div style="float:left">
983
<a name="p' . $post[$p]['pid'] . '"></a>
984
<img src="' . $theme['images'] . 'postedon.png" title="' . $l['posted_on'] . '" alt="" />
985
' . $post[$p]['pdate'];
987
echo (($post[$p]['post_count']) ? ' | ' . $l['post_num_prefix'] . ': ' . $post[$p]['post_count'] : '');
994
if (isset($post[$p]['can_reply'])) {
996
$post_opt[] = '<a href="' . $globals['ind'] . 'act=post&topid=' . $topic['tid'] . '&pid=' . $post[$p]['pid'] . '">' . $l['quote'] . '</a>';
999
//Can he edit the post
1000
if (isset($post[$p]['can_edit'])) {
1002
$post_opt[] = '<a href="' . $globals['ind'] . 'act=edit&pid=' . $post[$p]['pid'] . '">' . $l['edit'] . '</a>';
1005
//Can he delete the post
1006
if (isset($post[$p]['can_del']) && $post[$p]['post_count'] != 0) {
1008
$post_opt[] = '<a href="' . $globals['ind'] . 'act=delete&pid=' . $post[$p]['pid'] . '" onclick="return confirm(\'' . $l['del_this_conf'] . '\');">' . $l['delete'] . '</a>';
1011
//Can he report this post
1012
if (!empty($globals['report_posts']) && !empty($user['can_report_post'])) {
1014
$post_opt[] = '<a href="' . $globals['ind'] . 'act=report&pid=' . $post[$p]['pid'] . '">' . $l['report'] . '</a>';
1017
echo implode(' | ', $post_opt) . '</td>
1021
<td class="posterinfo" valign="top">';
1023
if (!empty($post[$p]['avatarurl'])) {
1025
echo '<div style="text-align:center;"><a href="' . userlink($post[$p]['id'], $post[$p]['username']) . '"><img src="' . $post[$p]['avatarurl'][0] . '" width="' . $post[$p]['avatarurl'][1] . '" height="' . $post[$p]['avatarurl'][2] . '" alt="" /></a></div>';
1028
echo '<div class="pisub">' . $l['prefix_group'] . ' <span ' . (empty($post[$p]['mem_gr_colour']) ? '' : 'style="color:' . $post[$p]['mem_gr_colour'] . ';"') . '>' . $post[$p]['mem_gr_name'] . '</span><br />';
1030
//If the user group has some images as per Group
1031
if ($post[$p]['image_count']) {
1033
for ($i = 0; $i < $post[$p]['image_count']; $i++) {
1034
echo '<img src="' . $theme['images'] . $post[$p]['image_name'] . '" alt="" />';
1041
' . (!empty($post[$p]['post_gr_name']) ? '<div class="pisub">' . $l['prefix_post_group'] . ' ' . $post[$p]['post_gr_name'] . '</div>' : '') . '
1042
' . (!empty($post[$p]['posts']) ? '<div class="pisub">' . $l['prefix_posts'] . ' ' . $post[$p]['posts'] . '</div>' : '') . '
1043
<div class="pisub">' . $l['prefix_status'] . ' ' . ($post[$p]['status'] ? '<img src="' . $theme['images'] . 'online.png" title="' . $l['online'] . '" alt="" />' : '<img src="' . $theme['images'] . 'offline.png" title="' . $l['offline'] . '" alt="" />') . '</div>
1044
' . ( (empty($post[$p]['users_text'])) ? '' : '<br />' . $post[$p]['users_text'] ) . '
1046
<td class="post" align="left" valign="top">
1047
' . $post[$p]['post'] . '
1048
' . (!empty($attachments[$post[$p]['pid']]) ? '<br /><br />-----------------------<br />' . implode('<br />', $attachments[$post[$p]['pid']]) : '') . '
1049
' . (!empty($post[$p]['modifier']) ? '<br /><br />' . $l['edited_by'] . ' <b>' . $post[$p]['modifier'] . '</b> : ' . $post[$p]['modtime'] : '');
1051
if (!empty($post[$p]['sig'])) {
1053
echo '<br /><br />-----------------------<br />' . $post[$p]['sig'];
1061
<b>' . $l['ip'] . ':</b> ' . ((isset($post[$p]['poster_ip'])) ? $post[$p]['poster_ip'] : '--' ) . '
1063
<td class="specialrow">
1064
<a href="' . (isset($post[$p]['is_guest']) ? 'mailto:' . $post[$p]['email'] : userlink($post[$p]['id'], $post[$p]['username'])) . '"><img src="' . $theme['images'] . 'profile.gif" title="' . $l['view_profile_of'] . ' ' . $post[$p]['username'] . '" alt="" /></a>
1066
' . (!empty($post[$p]['email']) ? '<a href="mailto:' . $post[$p]['email'] . '"><img src="' . $theme['images'] . 'email.gif" title="' . $l['send_email_to'] . ' ' . $post[$p]['username'] . '" alt="" /></a> ' : '') . '
1068
' . ($logged_in ? '<a href="' . $globals['ind'] . 'act=usercp&ucpact=writepm&to=' . $post[$p]['id'] . '"><img src="' . $theme['images'] . 'pmuser.gif" title="' . $l['send_pm_to'] . ' ' . $post[$p]['username'] . '" alt="" /></a> ' : '') . '
1070
' . (!empty($post[$p]['www']) ? '<a href="' . $post[$p]['www'] . '" target="_blank"><img src="' . $theme['images'] . 'www.gif" title="' . $l['visit_website_of'] . ' ' . $post[$p]['username'] . '" alt="" /></a> ' : '') . '
1072
' . (!empty($post[$p]['msn']) ? '<a href="http://members.msn.com/' . $post[$p]['msn'] . '" target="_blank"><img src="' . $theme['images'] . 'msn.gif" title="' . $l['view_msn_profile'] . ' ' . $post[$p]['username'] . '" alt="" /></a> ' : '') . '
1074
' . (!empty($post[$p]['aim']) ? '<a href="aim:goim?screenname=' . $post[$p]['aim'] . '&message=' . $l['aim_hello'] . '" target="_blank"><img src="' . $theme['images'] . 'aim.gif" title="' . $l['aim_username_is'] . ' ' . $post[$p]['username'] . ' ' . $l['is'] . ' ' . $post[$p]['aim'] . '" alt="" /></a> ' : '') . '
1076
' . (!empty($post[$p]['yim']) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $post[$p]['yim'] . '&.src=pg" target="_blank"><img src="' . $theme['images'] . 'yim.gif" title="' . $l['yim_identity_is'] . ' ' . $post[$p]['username'] . ' ' . $l['is'] . ' ' . $post[$p]['yim'] . '" alt="" /></a> ' : '') . '
1087
<td><img src="' . $theme['images'] . 'cbot.png" width="100%" height="10" alt="" /></td>
1091
//The post ends here
1096
echo '<br /><br /><table width="100%" cellpadding="0" cellspacing="0">
1099
<table width="100%" cellpadding="0" cellspacing="0"><tr>
1100
<td class="pcbgl"></td>
1101
<td class="pcbg"><b>' . $l['threads'] . '</b></td>
1102
<td class="pcbgr"></td>
1110
<table width="100%" cellpadding="1" cellspacing="0">
1112
<td class="post" width="22%">';
1114
//The first post title
1115
echo '<img src="' . $theme['images'] . 'postedon.png" alt="" /> <b><a href="' . (isset($post[$fpid]['is_guest']) ? 'mailto:' . $post[$fpid]['email'] : userlink($post[$fpid]['id'], $post[$fpid]['username'])) . '">' . $post[$fpid]['username'] . '</a></b> <i>' . ($pid == $fpid ? '<b>' : '') . '<a href="' . $globals['ind'] . 'tid=' . $tid . '">' . $title . '</a>' . ($pid == $fpid ? '</b>' : '') . '</i>' . (empty($topic['description']) ? '' : ', ' . $topic['description']) . ' (' . $topic['n_posts'] . ' ' . $l['replies'] . ', ' . $l['read'] . ' ' . $topic['n_views'] . ' ' . $l['times'] . ')<br />';
1117
$tab = ' ';
1127
foreach ($post as $pk => $pv) {
1129
if ($post[$pk]['post_count'] == 0) {
1136
for ($t = 0; $t < $post[$pk]['level']; $t++) {
1141
$before = $dasher . $tree;
1143
echo $before . ' <img src="' . $theme['images'] . 'thread.png" alt="" /> <b><a href="' . (isset($post[$pk]['is_guest']) ? 'mailto:' . $post[$pk]['email'] : userlink($post[$pk]['id'], $post[$pk]['username'])) . '">' . $post[$pk]['username'] . '</a></b>';
1147
echo ' <b><i><a href="' . $globals['ind'] . 'tid=' . $tid . '&pid=' . $post[$pk]['pid'] . '">' . $post[$pk]['post_thread'] . '</a></i></b>';
1150
echo ' <i><a href="' . $globals['ind'] . 'tid=' . $tid . '&pid=' . $post[$pk]['pid'] . '">' . $post[$pk]['post_thread'] . '</a></i>';
1153
echo ' <small>' . $l['on'] . ' ' . $post[$pk]['pdate'] . '</small><br />';
1160
echo '</td></tr></table>
1165
<td><img src="' . $theme['images'] . 'cbot.png" width="100%" height="10" alt="" /></td>
1169
if (!empty($globals['prenextopic'])) {
1171
echo '<br /><a href="' . $globals['ind'] . 'tid=' . $tid . '&pid=' . $pid . '&previous" >« ' . $l['previous'] . '</a> <a href="' . $globals['ind'] . 'tid=' . $tid . '&pid=' . $pid . '&next" >' . $l['next'] . ' »</a>';
1174
echo '<br /><br /><table width="100%" cellpadding="4" cellspacing="0" class="cbgbor">
1175
<tr><td class="ptcbg1" align="right">';
1176
echo implode(' | ', $top_opt);
1183
if (!empty($user['can_reply_to_this_topic'])) {
1185
echo '<br /><a href="' . $globals['ind'] . 'act=post&topid=' . $topic['tid'] . '&par_id=' . $pid . '"><img src="' . $theme['images'] . 'buttons/reply.png" alt="" /></a>';
1188
if (!empty($user['can_poll_this_topic'])) {
1190
echo ' <a href="' . $globals['ind'] . 'act=postpoll"><img src="' . $theme['images'] . 'buttons/addpoll.png" alt="" /></a>';
1193
if (!empty($users_who_read)) {
1196
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="cbor">
1199
<td colspan="2" class="cbg1" align="left">' . $l['users_who_read'] . '</td>
1203
<td align="center" class="miposts" width="5%">
1204
<img src="' . $theme['images'] . 'online.gif" alt="" />
1206
<td class="mifor">';
1208
foreach ($users_who_read as $u => $uv) {
1210
$users_who_read[$u] = '<a href="' . userlink($uv['id'], $uv['username']) . '" style="color: ' . $uv['mem_gr_colour'] . ';" >' . $uv['username'] . '</a>';
1213
echo implode(', ', $users_who_read) . '</td>
1220
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="cbor">
1223
<td colspan="2" class="cbg1" align="left">' . $l['users_viewing'] . '</td>
1227
<td align="center" class="miposts" width="5%">
1228
<img src="' . $theme['images'] . 'online.gif" alt="" />
1231
' . $guests . ' ' . $l['guests'] . ', ' . count($active) . ' ' . $l['users'] . '' . (($anonymous) ? ', ' . $anonymous . ' ' . $l['viewing_anonymous'] : '.' ) . '
1232
' . (!empty($activeusers) ? '<hr />' . implode(', ', $activeusers) : '') . '
1238
//The defualt footers
1242
function printtopic_theme() {
1244
global $user, $logged_in, $globals, $AEF_SESS, $theme, $l;
1245
global $categories, $forums, $active, $anonymous, $guests, $activeusers, $board, $poll, $user_group, $post_group, $tid, $tpg, $fid, $title, $topic, $post, $topicpages, $pg, $attachments, $page;
1247
//////////////////////////
1248
// Count the topic pages
1249
//////////////////////////
1251
$tpages = ceil(($topic['n_posts'] + 1) / $globals['maxpostsintopics']);
1253
$pg = ($page / $globals['maxpostsintopics']) + 1; //Current Page
1255
$topicpages = array();
1261
$topicpages['<<'] = 1;
1263
$topicpages['<'] = ($pg - 1);
1266
for ($i = ($pg - 4); $i < $pg; $i++) {
1270
$topicpages[$i] = $i;
1274
$topicpages[$pg] = $pg;
1277
for ($i = ($pg + 1); $i <= ($pg + 4); $i++) {
1279
if ($i <= $tpages) {
1281
$topicpages[$i] = $i;
1286
if ($pg != $tpages) {
1288
$topicpages['>'] = ($pg + 1);
1290
$topicpages['>>'] = $tpages;
1296
$topicpages[$l['all']] = 'all';
1301
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1302
<html xmlns="http://www.w3.org/1999/xhtml">
1304
<meta http-equiv="Content-Type" content="text/html; charset=' . $globals['charset'] . '" />
1305
<title>' . ((empty($title)) ? $globals['sn'] : $title) . '</title>
1306
<link rel="stylesheet" type="text/css" href="' . $theme['url'] . '/style.css" />
1311
echo '<center><h1>' . $globals['sn'] . '</h1></center>
1313
<span size="4">' . $l['topic'] . ' : <b>' . $title . '</span></b>
1314
<hr /><br /><br />';
1316
if (!empty($topicpages)) {
1318
$links = '<table class="cbgbor" cellspacing="1">
1320
$links .= '<td class="pagelinks">' . $l['page'] . ' ' . $pg . ' ' . $l['of'] . ' ' . $tpages . '</td>';
1321
foreach ($topicpages as $k => $lv) {
1323
$links .= '<td class="' . ($k == $pg ? 'activepage' : 'pagelinks' ) . '"><a href="' . $globals['ind'] . 'tid=' . $tid . '&tpg=' . $lv . '&printtopic=true" >' . $k . '</a></td>';
1331
foreach ($post as $p => $pv) {
1333
echo'<table width="100%" cellpadding="4" cellspacing="3" border="1" align="center">
1337
<a name="p' . $post[$p]['pid'] . '"></a>
1338
' . $l['posted_by'] . ': <b>' . $post[$p]['username'] . '</b> ' . $l['on'] . ' ' . $post[$p]['pdate'] . (($post[$p]['post_count']) ? ' | ' . $l['post_num_prefix'] . ': ' . $post[$p]['post_count'] : '') . '
1343
<td align="left" valign="top">
1344
' . $post[$p]['post'] . '
1345
' . (!empty($post[$p]['modifier']) ? '<br /><br />' . $l['edited_by'] . ' <b>' . $post[$p]['modifier'] . '</b> : ' . $post[$p]['modtime'] : '') . '
1346
' . (!empty($post[$p]['sig']) ? '<br /><br />-----------------------<br />' . $post[$p]['sig'] : '') . '
1354
echo '<center>' . copyright() . '</center>
b'\\ No newline at end of file'