while ($arr = @mysqli_fetch_assoc($res)) { //=== change colors $count2 = ++$count2 % 2; $class = $count2 == 0 ? 'one' : 'two'; $invitor_res = sql_query('SELECT id, username, donor, class, enabled, warned, leechwarn, chatpost, pirate, king, suspended FROM users WHERE id=' . sqlesc($arr['invitedby'])) or sqlerr(__FILE__, __LINE__); $invitor_arr = mysqli_fetch_assoc($invitor_res); $the_flip_box = ' [ <a id="d' . $div_link_number . '_open" style="font-weight:bold;cursor:pointer;">View reason</a> ] <div align="left" id="d' . $div_link_number . '" style="display:none">' . format_comment($arr['watched_user_reason']) . '</div>'; $HTMLOUT .= ' <tr> <td align="center" class="' . $class . '">' . get_date($arr['watched_user'], '') . '</td> <td align="left" class="' . $class . '">' . print_user_stuff($arr) . '</td> <td align="left" class="' . $class . '">' . $the_flip_box . '</td> <td align="center" class="' . $class . '">' . member_ratio($arr['uploaded'], $INSTALLER09['ratio_free'] ? '0' : $arr['downloaded']) . '</td> <td align="center" class="' . $class . '">' . ($invitor_arr['username'] == '' ? 'open sign-ups' : print_user_stuff($invitor_arr)) . '</td> ' . ($CURUSER['class'] >= UC_STAFF ? ' <td align="center" class="' . $class . '"><input type="checkbox" name="wu[]" value="' . (int) $arr['id'] . '" /></td>' : '') . ' </tr>'; $div_link_number++; } $div_link_number = 1; } else { $HTMLOUT .= '<tr> <td align="center" class="one"><h1>The watched members list is empty!</h1></td></tr>'; } $HTMLOUT .= ' <tr> <td align="center" colspan="6" class="colhead"><a class="altlink" href="javascript:SetChecked(1,\'wu[]\')"> select all</a> - <a class="altlink" href="javascript:SetChecked(0,\'wu[]\')">un-select all</a> <input type="submit" class="button_big" value="remove selected from watched users" onmouseover="this.className=\'button_big_hover\'" onmouseout="this.className=\'button_big\'" /></td></tr></table></form> <script type="text/javascript" src="scripts/check_selected.js"></script>';
' . ($CURUSER['class'] >= UC_STAFF && $arr['post_history'] !== '' ? ' <a class="altlink" href="forums.php?action=view_post_history&post_id=' . $arr['post_id'] . '&forum_id=' . $arr['forum_id'] . '&topic_id=' . $arr['topic_id'] . '">read post history</a></span><br />' : ''); } $body = $arr['bbcode'] == 'yes' ? format_comment($arr['body']) : format_comment_no_bbcode($arr['body']); $post_id = $arr['post_id']; $HTMLOUT .= '<tr> <td class="forum_head_dark" colspan="3" align="left">Forum: <a class="altlink" href="forums.php?action=view_forum&forum_id=' . $arr['forum_id'] . '" title="Link to Forum"> <span style="color: white;font-weight: bold;">' . htmlentities($arr['forum_name'], ENT_QUOTES) . '</span></a> Topic: <a class="altlink" href="forums.php?action=view_topic&topic_id=' . $arr['topic_id'] . '" title="Link to Forum"> <span style="color: white;font-weight: bold;">' . htmlentities($arr['topic_name'], ENT_QUOTES) . '</span></a>' . $topic_status_image . '</td> </tr> <tr> <td class="forum_head" align="left" width="100" valign="middle"><a name="' . $post_id . '"></a></td> <td class="forum_head" align="left" valign="middle"> <span style="white-space:nowrap;">' . $post_icon . ' <a class="altlink" href="forums.php?action=view_topic&topic_id=' . $arr['topic_id'] . '&page=' . $page . '#' . $arr['post_id'] . '" title="Link to Post"> ' . $post_title . '</a> ' . $post_status_image . ' posted on: ' . get_date($arr['added'], '') . ' [' . get_date($arr['added'], '', 0, 1) . ']</span></td> <td class="forum_head" align="right" valign="middle"><span style="white-space:nowrap;"> <a href="forums.php?action=view_my_posts&page=' . $page . '#top"><img src="pic/forums/up.gif" alt="top" /></a> <a href="forums.php?action=view_my_posts&page=' . $page . '#bottom"><img src="pic/forums/down.gif" alt="bottom" /></a></span></td> </tr> <tr> <td class="' . $class_alt . '" align="center" width="100px" valign="top">' . avatar_stuff($user_arr) . '<br />' . print_user_stuff($user_arr) . ($user_arr['title'] == '' ? '' : '<br /><span style=" font-size: xx-small;">[' . htmlspecialchars($user_arr['title']) . ']</span>') . '<br /> <span style="font-weight: bold;">' . get_user_class_name($user_arr['class']) . '</span><br /></td> <td class="' . $post_status . '" align="left" valign="top" colspan="2">' . $body . $edited_by . '</td> </tr> <tr> <td class="' . $class_alt . '" align="right" valign="middle" colspan="3"></td> </tr>'; } //=== end while loop $HTMLOUT .= $the_top_and_bottom . '</table><a name="bottom"></a><br />' . $links . '<br />';
//== } $body = $arr['bbcode'] == 'yes' ? format_comment($arr['body']) : format_comment_no_bbcode($arr['body']); $post_id = (int) $arr['post_id']; $width = 100; $HTMLOUT .= '<tr> <td class="forum_head_dark" colspan="3" align="left">' . $lang['fe_forum'] . ': <a class="altlink" href="forums.php?action=view_forum&forum_id=' . (int) $arr['forum_id'] . '" title="' . $lang['fe_link_to_forum'] . '"> <span style="color: white;font-weight: bold;">' . htmlsafechars($arr['forum_name'], ENT_QUOTES) . '</span></a> ' . $lang['fe_topic'] . ': <a class="altlink" href="forums.php?action=view_topic&topic_id=' . (int) $arr['topic_id'] . '" title="' . $lang['fe_link_to_forum'] . '"> <span style="color: white;font-weight: bold;">' . htmlsafechars($arr['topic_name'], ENT_QUOTES) . '</span></a>' . $topic_status_image . '</td> </tr> <tr> <td class="forum_head" align="left" width="100" valign="middle"><a name="' . $post_id . '"></a></td> <td class="forum_head" align="left" valign="middle"> <span style="white-space:nowrap;">' . $post_icon . ' <a class="altlink" href="forums.php?action=view_topic&topic_id=' . (int) $arr['topic_id'] . '&page=' . $page . '#' . (int) $arr['post_id'] . '" title="' . $lang['fe_link_to_post'] . '"> ' . $post_title . '</a> ' . $post_status_image . ' ' . $lang['fe_posted_on'] . ': ' . get_date($arr['added'], '') . ' [' . get_date($arr['added'], '', 0, 1) . ']</span></td> <td class="forum_head" align="right" valign="middle"><span style="white-space:nowrap;"> <a href="forums.php?action=view_my_posts&page=' . $page . '#top"><img src="pic/forums/up.gif" alt="' . $lang['fe_top'] . '" /></a> <a href="forums.php?action=view_my_posts&page=' . $page . '#bottom"><img src="pic/forums/down.gif" alt="' . $lang['fe_bottom'] . '" /></a></span></td> </tr> <tr> <td class="' . $class_alt . '" align="center" width="100px" valign="top">' . ($arr['anonymous'] == 'yes' ? '<img style="max-width:' . $width . 'px;" src="' . $INSTALLER09['pic_base_url'] . 'anonymous_1.jpg" alt="avatar" />' : avatar_stuff($user_arr)) . '<br />' . ($arr['anonymous'] == 'yes' ? '<i>' . $lang['fe_anonymous'] . '</i>' : print_user_stuff($user_arr)) . ($arr['anonymous'] == 'yes' || $user_arr['title'] == '' ? '' : '<br /><span style=" font-size: xx-small;">[' . htmlsafechars($user_arr['title']) . ']</span>') . '<br /><span style="font-weight: bold;">' . ($arr['anonymous'] == 'yes' ? '' : get_user_class_name($user_arr['class'])) . '</span><br /></td> <td class="' . $post_status . '" align="left" valign="top" colspan="2">' . $body . $edited_by . '</td> </tr> <tr> <td class="' . $class_alt . '" align="right" valign="middle" colspan="3"></td> </tr>'; } //=== end while loop $HTMLOUT .= $the_top_and_bottom . '</table><a name="bottom"></a><br />' . $links . '<br />';
//=== ok let's show the posts... while ($arr_unread = mysql_fetch_assoc($res_unread)) { $res_post_read = sql_query('SELECT last_post_read FROM read_posts WHERE user_id=' . $CURUSER['id'] . ' AND topic_id=' . $arr_unread['topic_id']); $arr_post_read = mysql_fetch_row($res_post_read); $did_i_post_here = sql_query('SELECT user_id FROM posts WHERE user_id=' . $CURUSER['id'] . ' AND topic_id=' . $arr_unread['topic_id']); $posted = mysql_num_rows($did_i_post_here) > 0 ? 1 : 0; if ($arr_post_read[0] < $arr_unread['last_post'] && $posted) { //=== change colors $colour = ++$colour % 2; $class = $colour == 0 ? 'one' : 'two'; $locked = $arr_unread['locked'] == 'yes'; $sticky = $arr_unread['sticky'] == 'yes'; $topic_poll = $arr_unread['poll_id'] > 0; $first_unread_poster = sql_query('SELECT added FROM posts WHERE status = \'ok\' AND topic_id=' . $arr_unread['topic_id'] . ' ORDER BY id ASC LIMIT 1'); $first_unread_poster_arr = mysql_fetch_row($first_unread_poster); $thread_starter = ($arr_unread['username'] !== '' ? print_user_stuff($arr_unread) : 'Lost [' . $arr_unread['id'] . ']') . '<br />' . get_date($first_unread_poster_arr[0], ''); $topicpic = $arr_unread['post_count'] < 30 ? $locked ? 'lockednew' : 'topicnew' : ($locked ? 'lockednew' : 'hot_topic_new'); $rpic = $arr_unread['num_ratings'] != 0 ? ratingpic_forums(ROUND($arr_unread['rating_sum'] / $arr_unread['num_ratings'], 1)) : ''; $sub = sql_query('SELECT user_id FROM subscriptions WHERE user_id=' . $CURUSER['id'] . ' AND topic_id=' . $arr_unread['topic_id']); $subscriptions = mysql_num_rows($sub) > 0 ? 1 : 0; $icon = $arr_unread['icon'] == '' ? '<img src="pic/forums/topic_normal.gif" alt="Topic" title="Topic" />' : '<img src="pic/smilies/' . htmlspecialchars($arr_unread['icon']) . '.gif" alt="' . htmlspecialchars($arr_unread['icon']) . '" title="' . htmlspecialchars($arr_unread['icon']) . '" />'; $first_post_text = tool_tip(' <img src="pic/forums/mg.gif" height="14" alt="Preview" title="Preview" />', format_comment($arr_unread['body']), 'Last Post Preview'); $topic_name = ($sticky ? '<img src="pic/forums/pinned.gif" alt="Pinned" title="Pinned" /> ' : ' ') . ($topicpoll ? '<img src="pic/forums/poll.gif" alt="Poll" title="Poll" /> ' : ' ') . ' <a class="altlink" href="?action=view_topic&topic_id=' . $arr_unread['topic_id'] . '" title="First post in thread">' . htmlentities($arr_unread['topic_name'], ENT_QUOTES) . '</a> <a class="altlink" href="forums.php?action=view_topic&topic_id=' . $arr_unread['topic_id'] . '&page=0#' . $arr_post_read[0] . '" title="First unread post in this thread"><img src="pic/forums/last_post.gif" alt="First unread post" title="First unread post" /></a> ' . ($posted ? '<img src="pic/forums/posted.gif" alt="Posted" title="Posted" /> ' : ' ') . ($subscriptions ? '<img src="pic/forums/subscriptions.gif" alt="subscribed" title="subscribed" /> ' : ' ') . ' <img src="pic/forums/new.gif" alt="New post in topic!" title="New post in topic!" />'; //=== print here $HTMLOUT .= '<tr> <td class="' . $class . '" align="center"><img src="pic/forums/' . $topicpic . '.gif" alt="topic" title="topic" /></td> <td class="' . $class . '" align="center">' . $icon . '</td> <td align="left" valign="middle" class="' . $class . '">
<td class="colhead" align="center">' . $lang['mega_ip'] . '</td> <td class="colhead" align="center">' . $lang['mega_last_acc'] . '</td> <td class="colhead" align="center">' . $lang['mega_joined'] . '</td> <td class="colhead" align="center">' . $lang['mega_ud'] . '</td> <td class="colhead" align="center">' . $lang['mega_ratio'] . '</td> <td class="colhead" align="center">' . $lang['mega_invited_by'] . '</td> </tr> <tr> <td align="left">' . print_user_stuff($user_invited) . '</td> <td align="center">' . htmlsafechars($user_invited['email']) . '</td> <td align="center">' . htmlsafechars($user_invited['ip']) . '</td> <td align="center">' . get_date($user_invited['last_access'], '') . '</td> <td align="center">' . get_date($user_invited['added'], '') . '</td> <td align="center"><img src="pic/up.png" alt="' . $lang['mega_up'] . '" title="' . $lang['mega_uploaded'] . '" /> <span style="color: green;">' . mksize($user_invited['uploaded']) . '</span> ' . ($INSTALLER09['ratio_free'] ? '' : '<br /> <img src="pic/dl.png" alt="' . $lang['mega_down'] . '" title="' . $lang['mega_downloaded'] . '" /> <span style="color: red;">' . mksize($user_invited['downloaded']) . '</span></td>') . ' <td align="center" class="' . $class2 . '">' . member_ratio($user_invited['uploaded'], $INSTALLER09['ratio_free'] ? '0' : $user_invited['downloaded']) . '</td> <td align="center">' . ($user_invited['invitedby'] == 0 ? $lang['mega_open'] : print_user_stuff($user2)) . '</td> </tr> </table>'; } } $HTMLOUT .= '</td></tr></table>'; } $HTMLOUT .= '</div></div>'; echo stdhead($lang['mega_stdhead'], true, $stdhead) . $HTMLOUT . stdfoot(); ?>
if ($now_viewing !== '') { $now_viewing = '<hr /><span style="font-size: xx-small;">now viewing:</span>' . $now_viewing; } if ($last_post_arr['tan'] == 'yes') { if ($CURUSER['class'] < UC_STAFF && $last_post_arr['user_id'] != $CURUSER['id']) { $last_post = 'Last Post by: Anonymous in ► <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $last_post_arr['topic_id'] . '&page=p' . (int) $last_post_arr['last_post'] . '#' . (int) $last_post_arr['last_post'] . '" title="' . htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES) . '"> <span style="font-weight: bold;">' . CutName(htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br /> ' . get_date($last_post_arr['added'], '') . '<br />'; } else { $last_post = 'Last Post by: Anonymous [' . print_user_stuff($last_post_arr) . '] <span style="font-size: x-small;"> [ ' . get_user_class_name($last_post_arr['class']) . ' ] </span><br /> in ► <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $last_post_arr['topic_id'] . '&page=p' . (int) $last_post_arr['last_post'] . '#' . (int) $last_post_arr['last_post'] . '" title="' . htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES) . '"> <span style="font-weight: bold;">' . CutName(htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br /> ' . get_date($last_post_arr['added'], '') . '<br />'; } } else { $last_post = 'Last Post by: ' . print_user_stuff($last_post_arr) . ' <span style="font-size: x-small;"> [ ' . get_user_class_name($last_post_arr['class']) . ' ] </span><br /> in ► <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $last_post_arr['topic_id'] . '&page=p' . (int) $last_post_arr['last_post'] . '#' . (int) $last_post_arr['last_post'] . '" title="' . htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES) . '"> <span style="font-weight: bold;">' . CutName(htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br /> ' . get_date($last_post_arr['added'], '') . '<br />'; } } else { $img = 'unlocked'; $now_viewing = ''; $last_post = 'N/A'; } $HTMLOUT .= '<tr> <td class="' . $class . '" align="center" valign="middle" width="30"><img src="' . $INSTALLER09['pic_base_url'] . 'forums/' . $img . '.gif" alt="' . $INSTALLER09['pic_base_url'] . 'forums/' . $img . '.gif" title="' . $INSTALLER09['pic_base_url'] . 'forums/' . $img . '.gif" /></td> <td class="' . $class . '" align="left"> <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_forum&forum_id=' . (int) $forums_arr['forum_id'] . '">' . htmlsafechars($forums_arr['forum_name'], ENT_QUOTES) . '</a> <br />' . htmlsafechars($forums_arr['forum_description'], ENT_QUOTES) . $child_boards . $now_viewing . '</td> <td class="' . $class . '" align="center" width="80">' . number_format($forums_arr['post_count']) . ' Posts<br />' . number_format($forums_arr['topic_count']) . ' Topics</td>
<td width= "1%" class="colhead"> </td> <td class="colhead">Subject </td> <td width="35%" class="colhead">' . ($mailbox === PM_SENTBOX ? 'Sent to' : 'Sender') . '</td> <td width="1%" class="colhead"> Date</td> <td width="1%" class="colhead"></td> </tr>') : ''; while ($row = mysqli_fetch_assoc($res_search)) { //=======change colors $count2 = ++$count2 % 2; $class = $count2 == 0 ? 'one' : 'two'; $class2 = $count2 == 0 ? 'two' : 'one'; //=== if not searching one member... if (!$member) { $res_username = sql_query('SELECT id, username, warned, suspended, enabled, donor, leechwarn, chatpost, pirate, king, class FROM users WHERE id = ' . sqlesc($row[$sender_reciever]) . ' LIMIT 1') or sqlerr(__FILE__, __LINE__); $arr_username = mysqli_fetch_assoc($res_username); $the_username = print_user_stuff($arr_username); } //=== if searching all boxes... $arr_box = $row['location'] == 1 ? 'Inbox' : ($row['location'] == -1 ? 'Sentbox' : ($row['location'] == -2 ? 'Drafts' : '')); if ($all_boxes && $arr_box === '') { $res_box_name = sql_query('SELECT name FROM pmboxes WHERE userid = ' . sqlesc($CURUSER['id']) . ' AND boxnumber = ' . sqlesc($row['location'])) or sqlerr(__FILE__, __LINE__); $arr_box_name = mysqli_fetch_assoc($res_box_name); $arr_box = htmlsafechars($arr_box_name['name']); } //==== highlight search terms... from Jaits search forums mod $body = str_ireplace($keywords, '<span style="background-color:yellow;font-weight:bold;color:black;">' . $keywords . '</span>', format_comment($row['msg'])); $subject = str_ireplace($keywords, '<span style="background-color:yellow;font-weight:bold;color:black;">' . $keywords . '</span>', htmlsafechars($row['subject'])); //=== print the damn thing ... if it's as a list or as posts... $HTMLOUT .= $as_list_post == 2 ? ' <tr> <td class="colhead" colspan="4">message from: ' . ($row[$sender_reciever] == 0 ? 'Sys-bot' : $the_username) . '</td>
//=== get last ten posts $res_posts = sql_query('SELECT p.id AS post_id, p.user_id, p.added, p.body, p.icon, p.post_title, p.bbcode, p.anonymous, u.id, u.username, u.class, u.donor, u.suspended, u.chatpost, u.leechwarn, u.pirate, u.king, u.warned, u.enabled, u.avatar, u.offensive_avatar FROM posts AS p LEFT JOIN users AS u ON p.user_id = u.id WHERE ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND' : '')) . ' topic_id=' . sqlesc($topic_id) . ' ORDER BY p.id DESC LIMIT 0, 10'); $HTMLOUT .= '<br /><span style="text-align: center;">' . $lang['fe_last_ten_posts_in_reverse_order'] . '</span> <table border="0" cellspacing="5" cellpadding="10" width="90%" align="center">'; //=== lets start the loop \o/ while ($arr = mysqli_fetch_assoc($res_posts)) { //=== change colors $colour = ++$colour % 2; $class = $colour == 0 ? 'one' : 'two'; $class_alt = $colour == 0 ? 'two' : 'one'; $HTMLOUT .= '<tr><td class="forum_head" align="left" width="100" valign="middle"># <span style="font-weight: bold;">' . ($arr['anonymous'] == 'yes' ? '<i>' . $lang['fe_anonymous'] . '</i>' : htmlsafechars($arr['username'])) . '</span></td> <td class="forum_head" align="left" valign="middle"><span style="white-space:nowrap;"> ' . $lang['fe_posted_on'] . ': ' . get_date($arr['added'], '') . ' [' . get_date($arr['added'], '', 0, 1) . ']</span></td></tr>'; $width = 100; if ($arr['anonymous'] == 'yes') { if ($CURUSER['class'] < UC_STAFF && $arr['user_id'] != $CURUSER['id']) { $HTMLOUT .= '<tr><td class="' . $class_alt . '" align="center" width="100" valign="top"><img style="max-width:' . $width . 'px;" src="' . $INSTALLER09['pic_base_url'] . 'anonymous_1.jpg" alt="avatar" /><br /><i>' . $lang['fe_anonymous'] . '</i></td>'; } else { $HTMLOUT .= '<tr><td class="' . $class_alt . '" align="center" width="100" valign="top">' . avatar_stuff($arr) . '<br /><i>' . $lang['fe_anonymous'] . '</i>[' . print_user_stuff($arr) . ']</td>'; } } else { $HTMLOUT .= '<tr><td class="' . $class_alt . '" align="center" width="100" valign="top">' . avatar_stuff($arr) . '<br />' . print_user_stuff($arr) . '</td>'; } $HTMLOUT .= '<td class="' . $class . '" align="left" valign="top" colspan="2">' . ($arr['bbcode'] == 'yes' ? format_comment($arr['body']) : format_comment_no_bbcode($arr['body'])) . '</td></tr>'; } //=== end while loop $HTMLOUT .= '</table> </td></tr></table><br /><br />';
$extra = ($row['unread'] === 'yes' ? $spacer.'' . $lang['pm_mailbox_char1'] . '<span style="color: red;">' . $lang['pm_mailbox_unread'] . '</span>' . $lang['pm_mailbox_char2'] . '' : '').($row['urgent'] === 'yes' ? $spacer.'<span style="color: red;">' . $lang['pm_mailbox_urgent'] . '</span>' : ''); $avatar = (($CURUSER['avatars'] === 'no' || $CURUSER['show_pm_avatar'] === 'no' || $row['id'] == 0)? '' : (empty($row['avatar']) ? ' <img width="40" src="pic/default_avatar.gif" alt="no avatar" />' : (($row['offensive_avatar'] === 'yes' && $CURUSER['view_offensive_avatar'] === 'no') ? '<img width="40" src="pic/fuzzybunny.gif" alt="fuzzy!" />' : '<img width="40" src="'.htmlsafechars($row['avatar']).'" alt="avatar" />'))); $HTMLOUT .= ' <tr> <td class="'.$class.'" align="center">'.$read_unread.'</td> <td class="'.$class.'" align="left"><a class="altlink" href="pm_system.php?action=view_message&id='.(int)$row['message_id'].'">'.$subject.'</a>'.$extra.'</td> <td class="'.$class.'" align="left">'.$avatar.$who_sent_it.'</td> <td class="'.$class.'" align="left">'.get_date($row['added'], '').'</td> <td class="'.$class.'" align="center"><input type="checkbox" name="pm[]" value="'.(int)$row['message_id'].'" /></td> </tr>'; */ $subject = !empty($row['subject']) ? htmlsafechars($row['subject']) : $lang['pm_search_nosubject']; $who_sent_it = $row['id'] == 0 ? '<span style="font-weight: bold;">' . $lang['pm_forward_system'] . '</span>' : print_user_stuff($row) . $friends; $read_unread = $row['unread'] === 'yes' ? '<img src="pic/pn_inboxnew.gif" title="' . $lang['pm_mailbox_unreadmsg'] . '" alt="' . $lang['pm_mailbox_unread'] . '" />' : '<img src="pic/pn_inbox.gif" title="' . $lang['pm_mailbox_readmsg'] . '" alt="' . $lang['pm_mailbox_read'] . '" />'; $extra = ($row['unread'] === 'yes' ? $spacer . '' . $lang['pm_mailbox_char1'] . '<span style="color: red;">' . $lang['pm_mailbox_unread'] . '</span>' . $lang['pm_mailbox_char2'] . '' : '') . ($row['urgent'] === 'yes' ? $spacer . '<span style="color: red;">' . $lang['pm_mailbox_urgent'] . '</span>' : ''); $avatar = !$CURUSER['opt1'] & user_options::AVATARS || !$CURUSER['opt2'] & user_options_2::SHOW_PM_AVATAR || $row['id'] == 0 ? '' : (empty($row['avatar']) ? ' <img width="40" src="pic/default_avatar.gif" alt="no avatar" />' : ($row['opt1'] & user_options::OFFENSIVE_AVATAR && !$CURUSER['opt1'] & user_options::VIEW_OFFENSIVE_AVATAR ? '<img width="40" src="pic/fuzzybunny.gif" alt="fuzzy!" />' : '<img width="40" src="' . htmlsafechars($row['avatar']) . '" alt="avatar" />')); $HTMLOUT .= ' <tr> <td class="text-center">' . $read_unread . '</td> <td class="text-left"><a class="altlink" href="pm_system.php?action=view_message&id=' . (int) $row['message_id'] . '">' . $subject . '</a>' . $extra . '</td> <td class="text-left">' . $avatar . $who_sent_it . '</td> <td class="text-left">' . get_date($row['added'], '') . '</td> <td class="text-center"><input type="checkbox" name="pm[]" value="' . (int) $row['message_id'] . '" /></td> </tr>'; } } //=== per page drop down
function comment_table($rows) { $count2 = ''; global $CURUSER, $INSTALLER09; $comment_table = '<table class="table table-hover table-bordered"> <tr> <td class="three" align="center">'; foreach ($rows as $row) { //=======change colors $count2 = ++$count2 % 2; $class = $count2 == 0 ? 'one' : 'two'; $text = format_comment($row['text']); if ($row['editedby']) { $res_user = sql_query('SELECT username FROM users WHERE id=' . sqlesc($row['editedby'])) or sqlerr(__FILE__, __LINE__); $arr_user = mysqli_fetch_assoc($res_user); $text .= '<p><font size="1" class="small">Last edited by <a href="userdetails.php?id=' . (int) $row['editedby'] . '"><b>' . htmlsafechars($arr_user['username']) . '</b></a> at ' . get_date($row['editedat'], 'DATE') . '</font></p>'; } $top_comment_stuff = $row['comment_id'] . ' by ' . (isset($row['username']) ? print_user_stuff($row) . ($row['title'] !== '' ? ' [ ' . htmlsafechars($row['title']) . ' ] ' : ' [ ' . get_user_class_name($row['class']) . ' ] ') : ' M.I.A. ') . get_date($row['added'], '') . ($row['id'] == $CURUSER['id'] || $CURUSER['class'] >= UC_STAFF ? ' - [<a href="requests.php?action=edit_comment&id=' . (int) $row['request'] . '&comment_id=' . (int) $row['comment_id'] . '">Edit</a>]' : '') . ($CURUSER['class'] >= UC_STAFF ? ' - [<a href="requests.php?action=delete_comment&id=' . (int) $row['request'] . '&comment_id=' . (int) $row['comment_id'] . '">Delete</a>]' : '') . ($row['editedby'] && $CURUSER['class'] >= UC_STAFF ? ' - [<a href="comment.php?action=vieworiginal&cid=' . (int) $row['id'] . '">View original</a>]' : '') . ' - [<a href="report.php?type=Request_Comment&id_2=' . (int) $row['request'] . '&id=' . (int) $row['comment_id'] . '">Report</a>]'; $comment_table .= ' <table class="table table-hover table-bordered"> <tr> <td align="left" colspan="2" class="colhead"># ' . $top_comment_stuff . '</td> </tr> <tr> <td align="center" width="80" class="' . $class . '" style="padding: 0px;">' . avatar_stuff($row) . '</td> <td class="' . $class . '">' . $text . '</td> </tr> </table><br />'; } $comment_table .= '</td></tr></table>'; return $comment_table; }
f.name AS forum_name, u.id, u.username, u.class, u.donor, u.suspended, u.warned, u.enabled, u.avatar, u.offensive_avatar, u.chatpost, u.leechwarn, u.pirate, u.king FROM posts AS p LEFT JOIN topics AS t ON p.topic_id = t.id LEFT JOIN forums AS f ON t.forum_id = f.id LEFT JOIN users AS u ON p.user_id = u.id WHERE ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND t.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND t.status != \'deleted\' AND' : '')) . ' p.id = ' . $post_id); $arr = mysql_fetch_array($res); $res_edited = sql_query('SELECT id, username, class, donor, suspended, warned, enabled, avatar, chatpost, leechwarn, pirate, king, offensive_avatar FROM users WHERE id = ' . $arr['edited_by']); $arr_edited = mysql_fetch_array($res_edited); $icon = htmlspecialchars($arr['icon']); $post_title = htmlentities($arr['post_title'], ENT_QUOTES); $location_bar = '<h1><a class="altlink" href="forums.php">Forums</a> <img src="pic/arrow_next.gif" alt="►" title="►" /> <a class="altlink" href="forums.php?action=view_forum&forum_id=' . $forum_id . '">' . htmlentities($arr['forum_name'], ENT_QUOTES) . '</a> <img src="pic/arrow_next.gif" alt="►" title="►" /> <a class="altlink" href="forums.php?action=view_topic&topic_id=' . $topic_id . '">' . htmlentities($arr['topic_name'], ENT_QUOTES) . '</a></h1> <span style="text-align: center;">' . $mini_menu . '</span><br /><br />'; $HTMLOUT .= $location_bar; $HTMLOUT .= '<h1>' . htmlspecialchars($arr['username']) . '\'s Final Edited Post. last edited by: ' . print_user_stuff($arr_edited) . '</h1> <table border="0" cellspacing="5" cellpadding="10" width="90%"> <tr> <td class="forum_head" align="left" width="120px" valign="middle"> <span style="white-space:nowrap;">#' . $post_id . ' <span style="font-weight: bold;">' . htmlspecialchars($arr['username']) . '</span></span> </td> <td class="forum_head" align="left" valign="middle"> <span style="white-space:nowrap;"> posted on: ' . get_date($arr['added'], '') . ' [' . get_date($arr['added'], '', 0, 1) . '] GMT ' . ($post_title !== '' ? ' Title: <span style="font-weight: bold;">' . $post_title . '</span>' : '') . ($icon !== '' ? ' <img src="pic/smilies/' . $icon . '.gif" alt="' . $icon . '" title="' . $icon . '"/>' : '') . '</span> </td> </tr> <tr> <td class="two" align="center" width="120px" valign="top">' . avatar_stuff($arr) . '<br />' . print_user_stuff($arr) . '</td> <td class="one" align="left" valign="top" colspan="2">' . ($arr['bbcode'] == 'yes' ? format_comment($arr['body']) : format_comment_no_bbcode($arr['body'])) . '</td> </tr> </table><br /><h1>Post History</h1>[ All Post Edits by Date Desc. ]<br /><br />' . $arr['post_history'] . '<br />' . $location_bar;
$res_box_name = sql_query('SELECT name FROM pmboxes WHERE userid = ' . sqlesc($CURUSER['id']) . ' AND boxnumber=' . sqlesc($mailbox) . ' LIMIT 1') or sqlerr(__FILE__, __LINE__); $arr_box_name = mysqli_fetch_row($res_box_name); if (mysqli_num_rows($res) === 0) { stderr($lang['pm_error'], $lang['pm_mailbox_invalid']); } $mailbox_name = htmlsafechars($arr_box_name[0]); $other_box_info = '<p class="text-center"><span style="color: red;">' . $lang['pm_mailbox_asterisc'] . '</span><span style="font-weight: bold;">' . $lang['pm_mailbox_note'] . '</span> ' . $lang['pm_mailbox_max'] . '<span style="font-weight: bold;">' . $maxbox . '</span>' . $lang['pm_mailbox_either'] . ' <span style="font-weight: bold;">' . $lang['pm_mailbox_inbox'] . '</span>' . $lang['pm_mailbox_or'] . '<span style="font-weight: bold;">' . $lang['pm_mailbox_sentbox'] . '</span>.</p>'; } //=== Display the message already! $HTMLOUT .= $h1_thingie . ($message['draft'] === 'yes' ? '<h1>' . $lang['pm_viewmsg_tdraft'] . '</h1>' : '<h1>' . $lang['pm_viewmsg_mailbox'] . '' . $mailbox_name . '</h1>') . $top_links . ' <table class="table table-bordered"> <tr> <td class="text-center" colspan="2" class="colhead"><h1>' . $lang['pm_send_subject'] . ' <span style="font-weight: bold;">' . ($message['subject'] !== '' ? htmlsafechars($message['subject']) : $lang['pm_search_nosubject']) . '</span></h1></td> </tr> <tr> <td colspan="2" class="text-left"><span style="font-weight: bold;">' . ($message['sender'] === $CURUSER['id'] ? $lang['pm_viewmsg_to'] : $lang['pm_viewmsg_from']) . ':</span> ' . ($arr_user_stuff['id'] == 0 ? $lang['pm_viewmsg_sys'] : print_user_stuff($arr_user_stuff)) . $spacer . $friends . $spacer . $spacer . ' <span style="font-weight: bold;">sent:</span> ' . get_date($message['added'], '') . $spacer . ($message['sender'] === $CURUSER['id'] && $message['unread'] == 'yes' ? '' . $lang['pm_mailbox_char1'] . '<span style="font-weight: bold;color:red;">' . $lang['pm_mailbox_unread'] . '</span>' . $lang['pm_mailbox_char2'] . '' : '') . ($message['urgent'] === 'yes' ? '<span style="font-weight: bold;color:red;">' . $lang['pm_mailbox_urgent'] . '</span>' : '') . '</td> </tr> <tr> <td class="text-center" valign="top" width="0px" id="photocol">' . $avatar . '</td> <td class="text-left text-resize">' . format_comment($message['msg']) . '</td> </tr> <tr> <td class="textright" colspan="2"> <form class="form-horizontal" role="form" action="pm_system.php" method="post"> <input class="form-control" type="hidden" name="id" value="' . $pm_id . '"> <input class="form-control" type="hidden" name="action" value="move">' . get_all_boxes() . '<br>' . $the_buttons . insertJumpTo(0) . '</td></tr></table>';
break; } $locked = $arr_unread['locked'] == 'yes'; $sticky = $arr_unread['sticky'] == 'yes'; $topic_poll = $arr_unread['poll_id'] > 0; $first_unread_poster = sql_query('SELECT added FROM posts WHERE topic_id=' . sqlesc($arr_unread['topic_id']) . ' ORDER BY id ASC LIMIT 1'); $first_unread_poster_arr = mysqli_fetch_row($first_unread_poster); //==Anonymous if ($arr_unread['tan'] == 'yes') { if ($CURUSER['class'] < UC_STAFF && $arr_unread['user_id'] != $CURUSER['id']) { $thread_starter = ($arr_unread['username'] !== '' ? '<i>' . $lang['fe_anonymous'] . '</i>' : '' . $lang['fe_lost'] . ' [' . (int) $arr_unread['id'] . ']') . '<br />' . get_date($first_unread_poster_arr[0], ''); } else { $thread_starter = ($arr_unread['username'] !== '' ? '<i>' . $lang['fe_anonymous'] . '</i> [' . print_user_stuff($arr_unread) . ']' : '' . $lang['fe_lost'] . ' [' . (int) $arr_unread['id'] . ']') . '<br />' . get_date($first_unread_poster_arr[0], ''); } } else { $thread_starter = ($arr_unread['username'] !== '' ? print_user_stuff($arr_unread) : '' . $lang['fe_lost'] . ' [' . (int) $arr_unread['id'] . ']') . '<br />' . get_date($first_unread_poster_arr[0], ''); } $topicpic = $arr_unread['post_count'] < 30 ? $locked ? 'lockednew' : 'topicnew' : ($locked ? 'lockednew' : 'hot_topic_new'); $rpic = $arr_unread['num_ratings'] != 0 ? ratingpic_forums(ROUND($arr_unread['rating_sum'] / $arr_unread['num_ratings'], 1)) : ''; $did_i_post_here = sql_query('SELECT user_id FROM posts WHERE user_id=' . sqlesc($CURUSER['id']) . ' AND topic_id=' . sqlesc($arr_unread['topic_id'])); $posted = mysqli_num_rows($did_i_post_here) > 0 ? 1 : 0; $sub = sql_query('SELECT user_id FROM subscriptions WHERE user_id=' . sqlesc($CURUSER['id']) . ' AND topic_id=' . sqlesc($arr_unread['topic_id'])); $subscriptions = mysqli_num_rows($sub) > 0 ? 1 : 0; $icon = $arr_unread['icon'] == '' ? '<img src="' . $INSTALLER09['pic_base_url'] . 'forums/topic_normal.gif" alt="' . $lang['fe_topic'] . '" title="' . $lang['fe_topic'] . '" />' : '<img src="' . $INSTALLER09['pic_base_url'] . 'smilies/' . htmlsafechars($arr_unread['icon']) . '.gif" alt="' . $lang['fe_unread'] . '" title="' . $lang['fe_unread'] . '" />'; $first_post_text = tool_tip(' <img src="' . $INSTALLER09['pic_base_url'] . 'forums/mg.gif" height="14" alt="' . $lang['fe_preview'] . '" title="' . $lang['fe_preview'] . '" />', format_comment($arr_unread['body'], true, false, false), '' . $lang['fe_last_post'] . ' ' . $lang['fe_preview'] . ''); $topic_name = ($sticky ? '<img src="' . $INSTALLER09['pic_base_url'] . 'forums/pinned.gif" alt="' . $lang['fe_pinned'] . '" title="' . $lang['fe_pinned'] . '" /> ' : ' ') . ($topicpoll ? '<img src="' . $INSTALLER09['pic_base_url'] . 'forums/poll.gif" alt="' . $lang['fe_poll'] . '" title="' . $lang['fe_poll'] . '" /> ' : ' ') . ' <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $arr_unread['topic_id'] . '" title="' . $lang['fe_1st_post_in_tread'] . '">' . htmlsafechars($arr_unread['topic_name'], ENT_QUOTES) . '</a><a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $arr_unread['topic_id'] . '&page=0#' . (int) $arr_post_read[0] . '" title="' . $lang['fe_1st_unread_post_topic'] . '"><img src="' . $INSTALLER09['pic_base_url'] . 'forums/last_post.gif" alt="' . $lang['fe_last_post'] . '" title="' . $lang['fe_last_post'] . '" /></a>' . ($posted ? '<img src="' . $INSTALLER09['pic_base_url'] . 'forums/posted.gif" alt="Posted" title="Posted" /> ' : ' ') . ($subscriptions ? '<img src="' . $INSTALLER09['pic_base_url'] . 'forums/subscriptions.gif" alt="' . $lang['fe_subscribed'] . '" title="' . $lang['fe_subscribed'] . '" /> ' : ' ') . ' <img src="' . $INSTALLER09['pic_base_url'] . 'forums/new.gif" alt="' . $lang['fe_new_post_in_topic'] . '!" title="' . $lang['fe_new_post_in_topic'] . '!" />'; //=== print here $HTMLOUT .= '<tr> <td class="' . $class . '" align="center"><img src="' . $INSTALLER09['pic_base_url'] . 'forums/' . $topicpic . '.gif" alt="' . $lang['fe_topic'] . '" title="' . $lang['fe_topic'] . '" /></td> <td class="' . $class . '" align="center">' . $icon . '</td> <td align="left" valign="middle" class="' . $class . '">
break; case 'deleted': $post_status_image = ' <img src="pic/forums/delete_icon.gif" alt="Deleted" title="this post is currently deleted" />'; break; } $last_post_username = $arr_post_stuff['username'] !== '' ? print_user_stuff($arr_post_stuff) : 'Lost [' . $arr_post_stuff['id'] . ']'; $last_post_id = $arr_post_stuff['last_post_id']; //=== Get author / first post info $first_post_res = sql_query('SELECT p.id AS first_post_id, p.added, p.icon, p.body, u.id, u.username, u.class, u.donor, u.suspended, u.warned, u.enabled, u.chatpost, u.leechwarn, u.pirate, u.king FROM posts AS p LEFT JOIN users AS u ON p.user_id = u.id WHERE ' . ($CURUSER['class'] < UC_STAFF ? ' p.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? ' p.status != \'deleted\' AND' : '')) . ' topic_id=' . $topic_id . ' ORDER BY p.id ASC LIMIT 1'); $first_post_arr = mysql_fetch_assoc($first_post_res); $thread_starter = ($first_post_arr['username'] !== '' ? print_user_stuff($first_post_arr) : 'Lost [' . $topic_arr['user_id'] . ']') . '<br />' . get_date($first_post_arr['added'], ''); $icon = $first_post_arr['icon'] == '' ? '<img src="pic/forums/topic_normal.gif" alt="Topic" title="Topic" />' : '<img src="pic/smilies/' . htmlspecialchars($first_post_arr['icon']) . '.gif" alt="' . htmlspecialchars($first_post_arr['icon']) . '" />'; $first_post_text = tool_tip(' <img src="pic/forums/mg.gif" height="14" alt="Preview" title="Preview" />', format_comment($first_post_arr['body'], 1, 0), 'First Post Preview'); //=== last post read in topic $last_unread_post_res = sql_query('SELECT last_post_read FROM read_posts WHERE user_id=' . $CURUSER['id'] . ' AND topic_id=' . $topic_id); $last_unread_post_arr = mysql_fetch_row($last_unread_post_res); $last_unread_post_id = $last_unread_post_arr[0] > 0 ? $last_unread_post_arr[0] : $first_post_arr['first_post_id']; $did_i_post_here = sql_query('SELECT user_id FROM posts WHERE user_id=' . $CURUSER['id'] . ' AND topic_id=' . $topic_id); $posted = mysql_num_rows($did_i_post_here) > 0 ? 1 : 0; //=== add subscribed forum image $sub = sql_query('SELECT user_id FROM subscriptions WHERE user_id=' . $CURUSER['id'] . ' AND topic_id=' . $topic_id); $subscriptions = mysql_num_rows($sub) > 0 ? 1 : 0; //=== make the multi pages thing... $total_pages = floor($posts / $perpage); switch (true) { case $total_pages == 0:
</tr> <tr> <td class="three" align="right" valign="top"> <span style="font-weight: bold;">' . $lang['vt_message'] . ':</span> </td> <td class="three" align="left" valign="top"> <textarea cols="30" rows="4" name="message" class="text_area_small"></textarea> </td> </tr> <tr> <td class="three" align="right" valign="top"> <span style="font-weight: bold;">' . $lang['vt_from'] . ':</span> </td> <td class="three" align="left" valign="top"> <input type="radio" name="pm_from" value="0" checked="checked" /> ' . $lang['vt_system'] . ' <input type="radio" name="pm_from" value="1" /> ' . print_user_stuff($CURUSER) . ' </td> </tr> </table> </div> <hr /></td> <td class="two" align="center"> <a class="altlink" href="javascript:SetChecked(1,\'post_to_mess_with[]\')" title="' . $lang['vt_select_all_posts_and_use_the_following_options'] . '"> ' . $lang['vt_select_all'] . '</a> <br /> <a class="altlink" href="javascript:SetChecked(0,\'post_to_mess_with[]\')" title="' . $lang['vt_unselect_all_posts'] . '">' . $lang['vt_un_select_all'] . '</a><br /> <input type="submit" name="button" class="button" value="' . $lang['vt_with_selected'] . '" onmouseover="this.className=\'button_hover\'" onmouseout="this.className=\'button\'" /> </td> </tr> <tr> <td class="two" align="center" width="28" valign="top"> <img src="' . $INSTALLER09['pic_base_url'] . 'forums/pinned.gif" alt="' . $lang['fe_pinned'] . '" title="' . $lang['fe_pinned'] . '" /></td> <td class="two" align="right" valign="top">
' . ($CURUSER['class'] >= UC_STAFF && $arr['post_history'] !== '' ? ' <a class="altlink" href="forums.php?action=view_post_history&post_id=' . $arr['post_id'] . '&forum_id=' . $arr['forum_id'] . '&topic_id=' . $arr['topic_id'] . '">read post history</a></span><br />' : ''); } $body = $arr['bbcode'] == 'yes' ? format_comment($arr['body']) : format_comment_no_bbcode($arr['body']); $post_id = $arr['post_id']; $HTMLOUT .= '<tr><td class="forum_head_dark" colspan="3" align="left">Forum: <a class="altlink" href="forums.php?action=view_forum&forum_id=' . $arr['forum_id'] . '" title="Link to Forum"> <span style="color: white;font-weight: bold;">' . htmlentities($arr['forum_name'], ENT_QUOTES) . '</span></a> Topic: <a class="altlink" href="forums.php?action=view_topic&topic_id=' . $arr['topic_id'] . '" title="Link to Forum"> <span style="color: white;font-weight: bold;">' . htmlentities($arr['topic_name'], ENT_QUOTES) . '</span></a>' . $topic_status_image . '</td></tr> <tr><td class="forum_head" align="left" width="100" valign="middle"><a name="' . $post_id . '"></a></td> <td class="forum_head" align="left" valign="middle"> <span style="white-space:nowrap;">' . $post_icon . ' <a class="altlink" href="forums.php?action=view_topic&topic_id=' . $arr['topic_id'] . '&page=' . $page . '#' . $arr['post_id'] . '" title="Link to Post"> ' . $post_title . '</a> ' . $post_status_image . ' posted on: ' . get_date($arr['added'], '') . ' [' . get_date($arr['added'], '', 0, 1) . ']</span></td> <td class="forum_head" align="right" valign="middle"><span style="white-space:nowrap;"> <a href="forums.php?action=view_my_posts&page=' . $page . '#top"><img src="pic/forums/up.gif" alt="top" /></a> <a href="forums.php?action=view_my_posts&page=' . $page . '#bottom"><img src="pic/forums/down.gif" alt="bottom" /></a> </span></td> </tr> <tr><td class="' . $class_alt . '" align="center" width="100px" valign="top">' . avatar_stuff($CURUSER) . '<br /> ' . print_user_stuff($CURUSER) . ($CURUSER['title'] == '' ? '' : '<br /><span style=" font-size: xx-small;">[' . htmlspecialchars($CURUSER['title']) . ']</span>') . '<br /> <span style="font-weight: bold;">' . get_user_class_name($CURUSER['class']) . '</span><br /> </td> <td class="' . $post_status . '" align="left" valign="top" colspan="2">' . $body . $edited_by . '</td></tr> <tr><td class="' . $class_alt . '" align="right" valign="middle" colspan="3"></td></tr>'; } //=== end while loop $HTMLOUT .= $the_top_and_bottom . '</table><a name="bottom"></a><br />' . $links . '<br />';
$class2 = $count2 == 0 ? 'two' : 'one'; //=== if not system or themselves, see if they are a friend yet? if ($mailbox === PM_DRAFTS || $row['id'] === 0) { $friends = ''; } else { if ($row['friend'] > 0) { $friends = ' [ <span class="font_size_1"><a href="friends.php?action=delete&type=friend&targetid=' . (int) $row['id'] . '">remove from friends</a></span> ]'; } elseif ($row['blocked'] > 0) { $friends = ' [ <span class="font_size_1"><a href="friends.php?action=delete&type=block&targetid=' . (int) $row['id'] . '">remove from blocks</a></span> ]'; } else { $friends = ' [ <span class="font_size_1"><a href="friends.php?action=add&type=friend&targetid=' . (int) $row['id'] . '">add to friends</a></span> ] [ <span class="font_size_1"><a href="friends.php?action=add&type=block&targetid=' . (int) $row['id'] . '">add to blocks</a></span> ]'; } } $subject = !empty($row['subject']) ? htmlsafechars($row['subject']) : 'No Subject'; $who_sent_it = $row['id'] == 0 ? '<span style="font-weight: bold;">System</span>' : print_user_stuff($row) . $friends; $read_unread = $row['unread'] === 'yes' ? '<img src="pic/pn_inboxnew.gif" title="Unread Message" alt="Unread" />' : '<img src="pic/pn_inbox.gif" title="Read Message" alt="Read" />'; $extra = ($row['unread'] === 'yes' ? $spacer . '[ <span style="color: red;"> un-read</span> ]' : '') . ($row['urgent'] === 'yes' ? $spacer . '<span style="color: red;">URGENT!</span>' : ''); $avatar = $CURUSER['avatars'] === 'no' || $CURUSER['show_pm_avatar'] === 'no' || $row['id'] == 0 ? '' : (empty($row['avatar']) ? ' <img width="40" src="pic/default_avatar.gif" alt="no avatar" />' : ($row['offensive_avatar'] === 'yes' && $CURUSER['view_offensive_avatar'] === 'no' ? '<img width="40" src="pic/fuzzybunny.gif" alt="fuzzy!" />' : '<img width="40" src="' . htmlsafechars($row['avatar']) . '" alt="avatar" />')); $HTMLOUT .= ' <tr> <td class="' . $class . '" align="center">' . $read_unread . '</td> <td class="' . $class . '" align="left"><a class="altlink" href="pm_system.php?action=view_message&id=' . (int) $row['message_id'] . '">' . $subject . '</a>' . $extra . '</td> <td class="' . $class . '" align="left">' . $avatar . $who_sent_it . '</td> <td class="' . $class . '" align="left">' . get_date($row['added'], '') . '</td> <td class="' . $class . '" align="center"><input type="checkbox" name="pm[]" value="' . (int) $row['message_id'] . '" /></td> </tr>'; } } //=== per page drop down
$topic_id = isset($_GET['topic_id']) ? intval($_GET['topic_id']) : (isset($_POST['topic_id']) ? intval($_POST['topic_id']) : 0); if (!is_valid_id($post_id) || !is_valid_id($forum_id) || !is_valid_id($topic_id)) { stderr($lang['gl_error'], $lang['gl_bad_id']); } $res = sql_query('SELECT p.added, p.body, p.edited_by, p.user_id AS poster_id, p.edit_date, p.post_title, p.icon, p.post_history, p.bbcode, p.anonymous, t.topic_name AS topic_name, f.name AS forum_name, u.id, u.username, u.class, u.donor, u.suspended, u.warned, u.enabled, u.avatar, u.offensive_avatar, u.chatpost, u.leechwarn, u.pirate, u.king FROM posts AS p LEFT JOIN topics AS t ON p.topic_id = t.id LEFT JOIN forums AS f ON t.forum_id = f.id LEFT JOIN users AS u ON p.user_id = u.id WHERE ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND t.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND t.status != \'deleted\' AND' : '')) . ' p.id = ' . sqlesc($post_id)); $arr = mysqli_fetch_array($res); $res_edited = sql_query('SELECT id, username, class, donor, suspended, warned, enabled, avatar, chatpost, leechwarn, pirate, king, offensive_avatar FROM users WHERE id = ' . $arr['edited_by']); $arr_edited = mysqli_fetch_array($res_edited); $icon = htmlsafechars($arr['icon']); $post_title = htmlsafechars($arr['post_title'], ENT_QUOTES); $location_bar = '<h1><a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php">' . $lang['fe_forums'] . '</a> <img src="' . $INSTALLER09['pic_base_url'] . 'arrow_next.gif" alt="►" title="►" /> <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_forum&forum_id=' . $forum_id . '">' . htmlsafechars($arr['forum_name'], ENT_QUOTES) . '</a> <img src="' . $INSTALLER09['pic_base_url'] . 'arrow_next.gif" alt="►" title="►" /> <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . $topic_id . '">' . htmlsafechars($arr['topic_name'], ENT_QUOTES) . '</a></h1> <span style="text-align: center;">' . $mini_menu . '</span><br /><br />'; $width = 100; $HTMLOUT .= $location_bar; $HTMLOUT .= '<h1>' . ($arr['anonymous'] == 'yes' ? '<i>' . $lang['fe_anonymous'] . '</>' : htmlsafechars($arr['username'])) . '\'s ' . $lang['vph_final_edit_post'] . '. ' . $lang['vph_last_edit_by'] . ': ' . ($arr['anonymous'] == 'yes' ? '<i>' . $lang['fe_anonymous'] . '</i>' : print_user_stuff($arr_edited)) . '</h1> <table border="0" cellspacing="5" cellpadding="10" width="90%"> <tr> <td class="forum_head" align="left" width="120px" valign="middle"> <span style="white-space:nowrap;">#' . $post_id . ' <span style="font-weight: bold;">' . ($arr['anonymous'] == 'yes' ? '<i>' . $lang['fe_anonymous'] . '</i>' : htmlsafechars($arr['username'])) . '</span></span></td> <td class="forum_head" align="left" valign="middle"> <span style="white-space:nowrap;"> ' . $lang['fe_posted_on'] . ': ' . get_date($arr['added'], '') . ' [' . get_date($arr['added'], '', 0, 1) . '] GMT ' . ($post_title !== '' ? ' ' . $lang['fe_title'] . ': <span style="font-weight: bold;">' . $post_title . '</span>' : '') . ($icon !== '' ? ' <img src="' . $INSTALLER09['pic_base_url'] . 'smilies/' . $icon . '.gif" alt="' . $icon . '" title="' . $icon . '"/>' : '') . '</span> </td></tr> <tr> <td class="two" align="center" width="120px" valign="top">' . ($arr['anonymous'] == 'yes' ? '<img style="max-width:' . $width . 'px;" src="' . $INSTALLER09['pic_base_url'] . 'anonymous_1.jpg" alt="avatar" />' : avatar_stuff($arr)) . '<br />' . ($arr['anonymous'] == 'yes' ? '<i>' . $lang['fe_anonymous'] . '</i>' : print_user_stuff($arr)) . '</td> <td class="one" align="left" valign="top" colspan="2">' . ($arr['bbcode'] == 'yes' ? format_comment($arr['body']) : format_comment_no_bbcode($arr['body'])) . '</td> </tr> </table><br /><h1>' . $lang['fe_post_history'] . '</h1>[ ' . $lang['vph_all_post_edits_date'] . '. ]<br /><br />' . htmlspecialchars_decode($arr['post_history']) . '<br />' . $location_bar;
while ($arr = @mysqli_fetch_assoc($res)) { //=== change colors $count2 = ++$count2 % 2; $class = $count2 == 0 ? 'one' : 'two'; $invitor_res = sql_query('SELECT id, username, donor, class, enabled, warned, leechwarn, chatpost, pirate, king, suspended FROM users WHERE id=' . sqlesc($arr['invitedby'])) or sqlerr(__FILE__, __LINE__); $invitor_arr = mysqli_fetch_assoc($invitor_res); $the_flip_box = ' [ <a id="d' . $div_link_number . '_open" style="font-weight:bold;cursor:pointer;">' . $lang['watched_viewreason'] . '</a> ] <div align="left" id="d' . $div_link_number . '" style="display:none">' . format_comment($arr['watched_user_reason']) . '</div>'; $HTMLOUT .= ' <tr> <td align="center" class="' . $class . '">' . get_date($arr['watched_user'], '') . '</td> <td align="left" class="' . $class . '">' . print_user_stuff($arr) . '</td> <td align="left" class="' . $class . '">' . $the_flip_box . '</td> <td align="center" class="' . $class . '">' . member_ratio($arr['uploaded'], $INSTALLER09['ratio_free'] ? '0' : $arr['downloaded']) . '</td> <td align="center" class="' . $class . '">' . ($invitor_arr['username'] == '' ? '' . $lang['watched_open_sign-ups'] . '' : print_user_stuff($invitor_arr)) . '</td> ' . ($CURUSER['class'] >= UC_STAFF ? ' <td align="center" class="' . $class . '"><input type="checkbox" name="wu[]" value="' . (int) $arr['id'] . '" /></td>' : '') . ' </tr>'; $div_link_number++; } $div_link_number = 1; } else { $HTMLOUT .= '<tr> <td align="center" class="one"><h1>' . $lang['watched_usrempty'] . '!</h1></td></tr>'; } $HTMLOUT .= ' <tr> <td align="center" colspan="6" class="colhead"><a class="altlink" href="javascript:SetChecked(1,\'wu[]\')"> ' . $lang['watched_selall'] . '</a> - <a class="altlink" href="javascript:SetChecked(0,\'wu[]\')">un-' . $lang['watched_selall'] . '</a> <input type="submit" class="button_big" value="remove selected' . $lang['watched_removedfrom'] . '" onmouseover="this.className=\'button_big_hover\'" onmouseout="this.className=\'button_big\'" /></td></tr></table></form> <script type="text/javascript" src="scripts/check_selected.js"></script>';
//=== get the last post read by CURUSER (with Retro's $readpost_expiry thingie) - cached \0/ if (($last_read_post_arr = $mc1->get_value('last_read_post_' . $last_post_arr['topic_id'] . '_' . $CURUSER['id'])) === false) { $last_read_post_arr = mysqli_fetch_row(sql_query('SELECT last_post_read FROM read_posts WHERE user_id=' . sqlesc($CURUSER['id']) . ' AND topic_id=' . sqlesc($last_post_arr['topic_id']))); $mc1->cache_value('last_read_post_' . $last_post_arr['topic_id'] . '_' . $CURUSER['id'], $last_read_post_arr, $INSTALLER09['expires']['last_read_post']); } $image_to_use = $last_post_arr['added'] > TIME_NOW - $readpost_expiry ? !$last_read_post_arr or $last_post_id > $last_read_post_arr[0] : 0; $img = $image_to_use ? 'unlockednew' : 'unlocked'; //== Anonymous -> if ($last_post_arr["tan"] == "yes") { if ($CURUSER['class'] < UC_STAFF && $last_post_arr["user_id"] != $CURUSER["id"]) { $last_post = '<span style="white-space:nowrap;">' . $lang['fe_last_post_by'] . ': <i>' . $lang['fe_anonymous'] . '</i> in ► <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $last_post_arr['topic_id'] . '&page=' . $last_post_id . '#' . $last_post_id . '" title="' . htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES) . '"><span style="font-weight: bold;">' . CutName(htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br />' . get_date($last_post_arr['added'], '') . '<br /></span>'; } else { $last_post = '<span style="white-space:nowrap;">' . $lang['fe_last_post_by'] . ': <i>' . $lang['fe_anonymous'] . '</i> [' . ($last_post_arr['username'] !== '' ? print_user_stuff($last_post_arr) : '' . $lang['fe_lost'] . '') . '] <span style="font-size: x-small;"> [ ' . get_user_class_name($last_post_arr['class']) . ' ] </span><br />in ► <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $last_post_arr['topic_id'] . '&page=' . $last_post_id . '#' . $last_post_id . '" title="' . htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES) . '"><span style="font-weight: bold;">' . CutName(htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br />' . get_date($last_post_arr['added'], '') . '<br /></span>'; } } else { $last_post = '<span style="white-space:nowrap;">' . $lang['fe_last_post_by'] . ': ' . ($last_post_arr['username'] !== '' ? print_user_stuff($last_post_arr) : '' . $lang['fe_lost'] . '') . ' <span style="font-size: x-small;"> [ ' . get_user_class_name($last_post_arr['class']) . ' ] </span><br />in ► <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $last_post_arr['topic_id'] . '&page=' . $last_post_id . '#' . $last_post_id . '" title="' . htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES) . '"><span style="font-weight: bold;">' . CutName(htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br />' . get_date($last_post_arr['added'], '') . '<br /></span>'; } //== //=== get child boards if any - cached \0/ $keys['child_boards'] = 'child_boards_' . $last_post_id . '_' . $CURUSER['class']; if (($child_boards_cache = $mc1->get_value($keys['child_boards'])) === false) { $child_boards = ''; $child_boards_cache = array(); $res = sql_query('SELECT name, id FROM forums WHERE parent_forum = ' . sqlesc($arr_forums['real_forum_id']) . ' AND min_class_read <= ' . sqlesc($CURUSER['class']) . ' ORDER BY sort ASC') or sqlerr(__FILE__, __LINE__); while ($arr = mysqli_fetch_assoc($res)) { if ($child_boards) { $child_boards .= ', '; } $child_boards .= '<a href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_forum&forum_id=' . (int) $arr['id'] . '" title="' . $lang['fm_click_to_view'] . '!" class="altlink">' . htmlsafechars($arr['name'], ENT_QUOTES) . '</a>'; } $child_boards_cache['child_boards'] = $child_boards;
if ($now_viewing !== '') { $now_viewing = '<hr /><span style="font-size: xx-small;">' . $lang['sv_now_viewing'] . ':</span>' . $now_viewing; } if ($last_post_arr['tan'] == 'yes') { if ($CURUSER['class'] < UC_STAFF && $last_post_arr['user_id'] != $CURUSER['id']) { $last_post = '' . $lang['fe_last_post_by'] . ': ' . $lang['sv_anonymous_in'] . ' ► <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $last_post_arr['topic_id'] . '&page=p' . (int) $last_post_arr['last_post'] . '#' . (int) $last_post_arr['last_post'] . '" title="' . htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES) . '"> <span style="font-weight: bold;">' . CutName(htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br /> ' . get_date($last_post_arr['added'], '') . '<br />'; } else { $last_post = '' . $lang['fe_last_post_by'] . ': ' . $lang['fe_anonymous'] . ' [' . print_user_stuff($last_post_arr) . '] <span style="font-size: x-small;"> [ ' . get_user_class_name($last_post_arr['class']) . ' ] </span><br /> in ► <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $last_post_arr['topic_id'] . '&page=p' . (int) $last_post_arr['last_post'] . '#' . (int) $last_post_arr['last_post'] . '" title="' . htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES) . '"> <span style="font-weight: bold;">' . CutName(htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br /> ' . get_date($last_post_arr['added'], '') . '<br />'; } } else { $last_post = '' . $lang['fe_last_post_by'] . ': ' . print_user_stuff($last_post_arr) . ' <span style="font-size: x-small;"> [ ' . get_user_class_name($last_post_arr['class']) . ' ] </span><br /> in ► <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&topic_id=' . (int) $last_post_arr['topic_id'] . '&page=p' . (int) $last_post_arr['last_post'] . '#' . (int) $last_post_arr['last_post'] . '" title="' . htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES) . '"> <span style="font-weight: bold;">' . CutName(htmlsafechars($last_post_arr['topic_name'], ENT_QUOTES), 30) . '</span></a><br /> ' . get_date($last_post_arr['added'], '') . '<br />'; } } else { $img = 'unlocked'; $now_viewing = ''; $last_post = $lang['fe_na']; } $HTMLOUT .= '<tr> <td class="' . $class . '" align="center" valign="middle" width="30"><img src="' . $INSTALLER09['pic_base_url'] . 'forums/' . $img . '.gif" alt="' . $INSTALLER09['pic_base_url'] . 'forums/' . $img . '.gif" title="' . $INSTALLER09['pic_base_url'] . 'forums/' . $img . '.gif" /></td> <td class="' . $class . '" align="left"> <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_forum&forum_id=' . (int) $forums_arr['forum_id'] . '">' . htmlsafechars($forums_arr['forum_name'], ENT_QUOTES) . '</a> <br />' . htmlsafechars($forums_arr['forum_description'], ENT_QUOTES) . $child_boards . $now_viewing . '</td> <td class="' . $class . '" align="center" width="80">' . number_format($forums_arr['post_count']) . ' ' . $lang['fe_posts'] . '<br />' . number_format($forums_arr['topic_count']) . ' ' . $lang['fe_topics'] . '</td>
<td class="' . $class . '" align="center" width="80"><span style="font-size: x-small;">' . $post_count . ' Posts<br />' . $topic_count . ' Topics</span></td> <td class="' . $class . '" align="left" width="140"><span style="font-size: x-small;">' . $last_post . '</span></td> </tr>'; } //== end of sectioon $over_forum_id = $arr_forums['over_forum_id']; $child_boards = ''; } //=== end while loop! $HTMLOUT .= '</table><br />' . $location_bar . insert_quick_jump_menu() . '<br />'; //=== members active in forums $active_members_res = sql_query('SELECT n_v.user_id, u.id, u.username, u.class, u.donor, u.warned, u.suspended, u.enabled, u.chatpost, u.leechwarn, u.pirate, u.king, u.avatar_rights FROM now_viewing AS n_v LEFT JOIN users AS u ON n_v.user_id = u.id'); //=== let's see whos lookng in here... $now_viewing = ''; while ($active_members_arr = mysql_fetch_assoc($active_members_res)) { $now_viewing .= print_user_stuff($active_members_arr); } $HTMLOUT .= '<table border="0" cellspacing="5" cellpadding="5" style="max-width:80%;min-width:600px;" align="center"> <tr> <td class="forum_head_dark" align="center">Members currently active</td> </tr> <tr> <td class="three" align="center">' . $now_viewing . '</td> </tr> </table><br />' . $legend . stdfoot(); break; } //=== end switch //=== search string highlighting by fusion found at stackoverflow.com :D function highlightWords($text, $words) {
$locked = $topic_arr['locked'] == 'yes'; $sticky = $topic_arr['sticky'] == 'yes'; $topic_poll = $topic_arr['poll_id'] > 0; $last_post_username = $topic_arr['pan'] == 'no' && $topic_arr['username'] !== '' ? print_user_stuff($topic_arr) : '[<i>' . $lang['fe_anonymous'] . '</i>]'; $last_post_id = (int) $topic_arr['last_post']; //=== Get author / first post info $first_post_res = sql_query('SELECT p.added, p.icon, p.body, p.user_id, p.anonymous, u.id, u.username, u.class, u.donor, u.suspended, u.warned, u.enabled, u.chatpost, u.leechwarn, u.pirate, u.king FROM posts AS p LEFT JOIN users AS u ON p.user_id = u.id WHERE ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND' : '')) . ' topic_id=' . sqlesc($topic_id) . ' ORDER BY id DESC LIMIT 1'); $first_post_arr = mysqli_fetch_assoc($first_post_res); if ($topic_arr['tan'] == 'yes') { if ($CURUSER['class'] < UC_STAFF && $first_post_arr['user_id'] != $CURUSER['id']) { $thread_starter = ($first_post_arr['username'] !== '' ? '<i>' . $lang['fe_anonymous'] . '</i>' : '' . $lang['fe_lost'] . ' [' . (int) $first_post_arr['id'] . ']') . '<br />' . get_date($first_post_arr['added'], ''); } else { $thread_starter = ($first_post_arr['username'] !== '' ? '<i>' . $lang['fe_anonymous'] . '</i> [' . print_user_stuff($first_post_arr) . ']' : '' . $lang['fe_lost'] . ' [' . (int) $first_post_arr['id'] . ']') . '<br />' . get_date($first_post_arr['added'], ''); } } else { $thread_starter = ($first_post_arr['username'] !== '' ? print_user_stuff($first_post_arr) : '' . $lang['fe_lost'] . ' [' . (int) $first_post_arr['id'] . ']') . '<br />' . get_date($first_post_arr['added'], ''); } $icon = $first_post_arr['icon'] == '' ? '<img src="' . $INSTALLER09['pic_base_url'] . 'forums/topic_normal.gif" alt="' . $lang['fe_topic'] . '" title="' . $lang['fe_topic'] . '" />' : '<img src="' . $INSTALLER09['pic_base_url'] . 'smilies/' . htmlsafechars($first_post_arr['icon']) . '.gif" alt="' . htmlsafechars($first_post_arr['icon']) . '" title="' . htmlsafechars($first_post_arr['icon']) . '" />'; $first_post_text = tool_tip(' <img src="' . $INSTALLER09['pic_base_url'] . 'forums/mg.gif" height="14" alt="' . $lang['fe_preview'] . '" title="' . $lang['fe_preview'] . '" />', format_comment($first_post_arr['body'], true, false, false), '' . $lang['fe_first_post'] . ' ' . $lang['fe_preview'] . ''); //=== last post read in topic $last_unread_post_res = sql_query('SELECT last_post_read FROM read_posts WHERE user_id=' . sqlesc($CURUSER['id']) . ' AND topic_id=' . sqlesc($topic_id)); $last_unread_post_arr = mysqli_fetch_row($last_unread_post_res); $did_i_post_here = sql_query('SELECT user_id FROM posts WHERE user_id=' . sqlesc($CURUSER['id']) . ' AND topic_id=' . sqlesc($topic_id)); $posted = mysqli_num_rows($did_i_post_here) > 0 ? 1 : 0; //=== make the multi pages thing... $total_pages = floor($posts / $perpage); switch (true) { case $total_pages == 0: $multi_pages = ''; break; case $total_pages > 11:
if (mysqli_num_rows($res) == 0) { $HTMLOUT .= ' <tr> <td class="one" align="center" valign="top" colspan="4"> <img src="pic/smilies/shit.gif" alt="*" /> Your shit list is empty. <img src="pic/smilies/shit.gif" alt="*" /></td> </tr>'; } else { while ($shit_list = mysqli_fetch_array($res)) { $shit = ''; for ($poop = 1; $poop <= $shit_list['shittyness']; $poop++) { $shit .= ' <img src="pic/smilies/shit.gif" title="' . (int) $shit_list['shittyness'] . ' out of 10 on the sittyness scale" alt="*" />'; } $HTMLOUT .= ($i % 2 == 1 ? '<tr>' : '') . ' <td class="' . ($i % 2 == 0 ? 'one' : 'two') . '" align="center" valign="top" width="80">' . avatar_stuff($shit_list) . ' ' . print_user_stuff($shit_list) . ' <b> [ ' . get_user_class_name($shit_list['class']) . ' ]</b> <a class="altlink" href="staffpanel.php?tool=shit_list&action=shit_list&action2=delete&shit_list_id=' . (int) $shit_list['suspect_id'] . '" title="remove this toad from your shit list">Remove</a> <a class="altlink" href="sendmessage.php?receiver=' . (int) $shit_list['suspect_id'] . '" title="send a PM to this evil toad">Send PM</a></td> <td class="' . ($i % 2 == 0 ? 'one' : 'two') . '" align="left" valign="top">' . $shit . ' <b>joined:</b> ' . get_date($shit_list['added'], '') . ' [ ' . get_date($shit_list['added'], '', 0, 1) . ' ] <b>added to shit list:</b> ' . get_date($shit_list['shit_list_added'], '') . '
<td align="left" class="two">' . BBcode($body) . $more_options . ' </td></tr> <tr><td align="center" colspan="2" class="two"> <input type="submit" name="button" class="button" value="Preview" onmouseover="this.className=\'button_hover\'" onmouseout="this.className=\'button\'" /> <input type="submit" name="button" class="button_tiny" value="Edit" onmouseover="this.className=\'button_tiny_hover\'" onmouseout="this.className=\'button_tiny\'" /> </td></tr> </table></form>'; //=== get last ten posts $res_posts = sql_query('SELECT p.id AS post_id, p.user_id, p.added, p.body, p.icon, p.post_title, p.bbcode, u.id, u.username, u.class, u.donor, u.suspended, u.warned, u.enabled, u.avatar, u.chatpost, u.leechwarn, u.pirate, u.king, u.offensive_avatar FROM posts AS p LEFT JOIN users AS u ON p.user_id = u.id WHERE ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND' : '')) . ' topic_id=' . $topic_id . ' ORDER BY p.id DESC LIMIT 1, 10'); $HTMLOUT .= '<br /><span style="text-align: center;">last ten posts in reverse order</span> <table border="0" cellspacing="5" cellpadding="10" width="90%" align="center">'; //=== lets start the loop \o/ while ($arr = mysql_fetch_assoc($res_posts)) { //=== change colors $colour = ++$colour % 2; $class = $colour == 0 ? 'one' : 'two'; $class_alt = $colour == 0 ? 'two' : 'one'; $HTMLOUT .= '<tr><td class="forum_head" align="left" width="100" valign="middle"><a name="' . $arr['post_id'] . '"></a> <span style="white-space:nowrap;">#' . $arr['post_id'] . ' <span style="font-weight: bold;">' . htmlspecialchars($arr['username']) . '</span></span></td> <td class="forum_head" align="left" valign="middle"><span style="white-space:nowrap;"> posted on: ' . get_date($arr['added'], '') . ' [' . get_date($arr['added'], '', 0, 1) . ']</span></td></tr> <tr><td class="' . $class_alt . '" align="center" width="100" valign="top">' . avatar_stuff($arr) . '<br /> ' . print_user_stuff($arr) . '</td> <td class="' . $class . '" align="left" valign="top" colspan="2">' . ($arr['bbcode'] == 'yes' ? format_comment($arr['body']) : format_comment_no_bbcode($arr['body'])) . '</td></tr>'; } //=== end while loop $HTMLOUT .= '</table><br /> </td></tr></table><br />';
$offers[] = $offer; } $mc1->cache_value('offers_', $offers, $INSTALLER09['expires']['off_limit']); } } if (count($offers) > 0) { $HTMLOUT .= "<table class='table table-striped table-bordered'>"; $HTMLOUT .= " <thead><tr>\n <th class='col-md-1 text-left'><b>Category</b></th>\n <th class='col-md-5 text-left'><b>Title</b></th>\n\t <th class='col-md-1 text-center'><b>Added</b></th>\n \t<th class='col-md-1 text-center''>Comm</th> \n \t<th class='col-md-1 text-center''>Votes</th>\n \t<th class='col-md-1 text-center''>Offered</th>\n <th class='col-md-1 text-center''>Status</th>\n </tr></thead>\n"; if ($offers) { foreach ($offers as $offerarr) { $torrname = htmlsafechars($offerarr['offer_name']); $offerarr['cat_name'] = htmlsafechars($change[$offerarr['category']]['name']); $offerarr['cat_pic'] = htmlsafechars($change[$offerarr['category']]['image']); $status = $offerarr['status'] == 'approved' ? '<span style="color: limegreen;font-weight: bold;">Approved!</span>' : ($offerarr['status'] == 'pending' ? '<span style="color: skyblue;font-weight: bold;">Pending...</span>' : '<span style="color: red;font-weight: bold;">denied</span>'); if (strlen($torrname) > 50) { $torrname = substr($torrname, 0, 50) . "..."; } $HTMLOUT .= " <tbody><tr>\n <td class='text-center'><img src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/" . htmlsafechars($offerarr["cat_pic"]) . "' alt='" . htmlsafechars($offerarr["cat_name"]) . "' title='" . htmlsafechars($offerarr["cat_name"]) . "' /></td>\n <td class='text-left'><a href=\"{$INSTALLER09['baseurl']}/offers.php?action=offer_details&id=" . (int) $offerarr['offer_id'] . "&hit=1\" >{$torrname}</a></td>\n\t\t<td class='text-center'>" . get_date($offerarr['added'], 'LONG') . "</td>\n \t<td class='text-center'>" . number_format($offerarr['comments']) . "</td> \n \t<td class='text-center'>yes: " . number_format($offerarr['vote_yes_count']) . "<br />\n \t\t\t\t no: " . number_format($offerarr['vote_no_count']) . "</td> \n \t<td class='text-center'>" . print_user_stuff($offerarr) . "</td>\n\t\t<td class='text-center'>" . $status . "</td>\n</tr></tbody>"; } $HTMLOUT .= "</table></div>"; } else { //== If there are no offers if (empty($offers)) { $HTMLOUT .= "<tbody><tr><td class='text-left' colspan='5'>No Offers Found</td></tr></tbody></table></div>"; } } } //==End $HTMLOUT .= "</div></div></div>"; // End Class // End File
<td class="colhead" align="center">Email</td> <td class="colhead" align="center">IP</td> <td class="colhead" align="center">Last access</td> <td class="colhead" align="center">Joined</td> <td class="colhead" align="center">Up / Down</td> <td class="colhead" align="center">Ratio</td> <td class="colhead" align="center">Invited by</td> </tr> <tr> <td align="left">' . print_user_stuff($user_invited) . '</td> <td align="center">' . htmlsafechars($user_invited['email']) . '</td> <td align="center">' . htmlsafechars($user_invited['ip']) . '</td> <td align="center">' . get_date($user_invited['last_access'], '') . '</td> <td align="center">' . get_date($user_invited['added'], '') . '</td> <td align="center"><img src="pic/up.png" alt="Up" title="Uploaded" /> <span style="color: green;">' . mksize($user_invited['uploaded']) . '</span> ' . ($INSTALLER09['ratio_free'] ? '' : '<br /> <img src="pic/dl.png" alt="Down" title="Downloaded" /> <span style="color: red;">' . mksize($user_invited['downloaded']) . '</span></td>') . ' <td align="center" class="' . $class2 . '">' . member_ratio($user_invited['uploaded'], $INSTALLER09['ratio_free'] ? '0' : $user_invited['downloaded']) . '</td> <td align="center">' . ($user_invited['invitedby'] == 0 ? 'open sign ups' : print_user_stuff($user2)) . '</td> </tr> </table>'; } } $HTMLOUT .= '</td></tr></table>'; } echo stdhead('Mega Search', true, $stdhead) . $HTMLOUT . stdfoot(); ?>