Example #1
0
        $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&amp;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&amp;topic_id=' . $arr_unread['topic_id'] . '&amp;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 . '">
		<table border="0" cellspacing="0" cellpadding="0">
		<tr>
Example #2
0
                break;
            case $total_pages < 11:
                $multi_pages = ' <span style="font-size: xx-small;"> <img src="' . $INSTALLER09['pic_base_url'] . 'forums/multipage.gif" alt="+" title="+" />';
                for ($i = 1; $i < $total_pages; ++$i) {
                    $multi_pages .= ' <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=view_topic&amp;topic_id=' . $topic_id . '&amp;page=' . $i . '">' . $i . '</a>';
                }
                $multi_pages .= '</span>';
                break;
        }
        $new = $arr_post_stuff['added'] > TIME_NOW - $readpost_expiry ? !$last_unread_post_res || $last_post_id > $last_unread_post_id : 0;
        $topic_pic = $posts < 30 ? $locked ? $new ? 'lockednew' : 'locked' : ($new ? 'topicnew' : 'topic') : ($locked ? $new ? 'lockednew' : 'locked' : ($new ? 'hot_topic_new' : 'hot_topic'));
        $topic_name = ($sticky ? '<img src="' . $INSTALLER09['pic_base_url'] . 'forums/pinned.gif" alt="Pinned" title="Pinned" /> ' : ' ') . ($topic_poll ? '<img src="' . $INSTALLER09['pic_base_url'] . 'forums/poll.gif" alt="Poll:" title="Poll" /> ' : ' ') . ' <a class="altlink" href="?action=view_topic&amp;topic_id=' . $topic_id . '">' . htmlsafechars($topic_arr['topic_name'], ENT_QUOTES) . '</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="subscribed" title="Subcribed" /> ' : ' ') . ($new ? ' <img src="' . $INSTALLER09['pic_base_url'] . 'forums/new.gif" alt="New post in topic!" title="New post in topic!" />' : '') . $multi_pages;
        //=== change colors
        $colour = ++$colour % 2;
        $class = $colour == 0 ? 'one' : 'two';
        $rpic = $topic_arr['num_ratings'] != 0 ? ratingpic_forums(ROUND($topic_arr['rating_sum'] / $topic_arr['num_ratings'], 1)) : '';
        //=== delete thread  //= .$delete_me
        if ($CURUSER['class'] == UC_MAX && $forum_id === 2) {
            $delete_me = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: x-small;">[ <a class="altlink" href="' . $INSTALLER09['baseurl'] . '/forums.php?action=delete_topic&amp;topic_id=' . $topic_id . '&amp;sure=1&amp;send_me_back=666">Delete</a> ]</span>';
        }
        $content .= '<tr>
		<td class="' . $class . '" align="center"><img src="' . $INSTALLER09['pic_base_url'] . 'forums/' . $topic_pic . '.gif" alt="topic" title="Topic" /></td>
		<td class="' . $class . '" align="center">' . $icon . '</td>
		<td align="left" valign="middle" class="' . $class . '">
		<table border="0" cellspacing="0" cellpadding="0">
		<tr>
		<td  class="' . $class . '" align="left">' . $topic_name . $first_post_text . $topic_status_image . '</td>
		<td class="' . $class . '" align="right">' . $rpic . '</td>
		</tr>
		</table>
		' . ($topic_arr['topic_desc'] !== '' ? '&#9658; <span style="font-size: x-small;">' . htmlsafechars($topic_arr['topic_desc'], ENT_QUOTES) . '</span>' : '') . '</td>