Example #1
0
	{
		if (!defined('UPI2DB_UNREAD'))
		{
			$user->data['upi2db_unread'] = upi2db_unread();
		}
		$count_new_posts = sizeof($user->data['upi2db_unread']['new_posts']);
		$count_edit_posts = sizeof($user->data['upi2db_unread']['edit_posts']);
		$count_always_read = sizeof($user->data['upi2db_unread']['always_read']['topics']);
		$count_mark_unread = sizeof($user->data['upi2db_unread']['mark_posts']);
	}
	// UPI2DB - END

	// MG User Replied - BEGIN
	// check if user replied to the topic
	define('USER_REPLIED_ICON', true);
	$user_topics = $class_topics->user_replied_array($topics);
	// MG User Replied - END

	$i = 0;
	foreach ($topics as $topic)
	{
		$class = ($i % 2) ? $theme['td_class1'] : $theme['td_class2'];

		$forum_id = $topic['forum_id'];
		$topic_id = $topic['topic_id'];
		$forum_id_append = (!empty($forum_id) ? (POST_FORUM_URL . '=' . $forum_id) : '');
		$topic_id_append = (!empty($topic_id) ? (POST_TOPIC_URL . '=' . $topic_id) : '');
		$forum_url = append_sid(CMS_PAGE_VIEWFORUM . '?' . $forum_id_append);
		$topic_url = append_sid(CMS_PAGE_VIEWTOPIC . '?' . $forum_id_append . '&' . $topic_id_append);
		$views = $topic['topic_views'];
		$replies = $topic['topic_replies'];
Example #2
0
				AND p2.post_id = t.topic_first_post_id " . $where_type . "
			ORDER BY t.topic_type DESC, p.post_time DESC LIMIT " . $start . ", " . $config['topics_per_page'];
		$result = $db->sql_query($sql);

		$total_topics = 0;
		while($row = $db->sql_fetchrow($result))
		{
			$topic_rowset[] = $row;
			$total_topics++;
		}
		$db->sql_freeresult($result);

		// MG User Replied - BEGIN
		// check if user replied to the topic
		define('USER_REPLIED_ICON', true);
		$user_topics = $class_topics->user_replied_array($topic_rowset);
		// MG User Replied - END

		for($i = 0; $i < $total_topics; $i++)
		{
			$forum_id = $topic_rowset[$i]['forum_id'];
			$forum_id_append = (!empty($forum_id) ? (POST_FORUM_URL . '=' . $forum_id) : '');
			$topic_id = $topic_rowset[$i]['topic_id'];
			$topic_id_append = (!empty($topic_id) ? (POST_TOPIC_URL . '=' . $topic_id) : '');
			$user_replied = (!empty($user_topics) && isset($user_topics[$topic_id]));

			$topic_title = censor_text($topic_rowset[$i]['topic_title']);
			// Convert and clean special chars!
			$topic_title = htmlspecialchars_clean($topic_title);
			// SMILEYS IN TITLE - BEGIN
			if (($config['smilies_topic_title'] == true) && !$lofi)
Example #3
0
		if ($show_results == 'posts')
		{
			if ($search_where == -1)
			{
				$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $user->data);
			}
			else
			{
				$is_auth = auth(AUTH_ALL, $search_where, $user->data);
			}
		}

		// MG User Replied - BEGIN
		// check if user replied to the topic
		define('USER_REPLIED_ICON', true);
		$user_topics = $class_topics->user_replied_array($searchset);
		// MG User Replied - END

		$valid_results = 0;
		for($i = 0; $i < sizeof($searchset); $i++)
		{
			// CrackerTracker v5.x
			$sucheck = strtolower($highlight_active);
			$sucheck = str_replace($ct_rules, '*', $sucheck);
			if($sucheck != $highlight_active)
			{
				$highlight_active = '';
			}
			// CrackerTracker v5.x

			$forum_id = !empty($searchset[$i]['forum_id']) ? $searchset[$i]['forum_id'] : 0;
Example #4
0
$result = $db->sql_query($sql);

$line = array();
while($row = $db->sql_fetchrow($result))
{
	$line[] = $row;
}
$db->sql_freeresult($result);

$tracking_forums = (isset($_COOKIE[$config['cookie_name'] . '_f'])) ? unserialize($_COOKIE[$config['cookie_name'] . '_f']) : array();
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_t'])) ? unserialize($_COOKIE[$config['cookie_name'] . '_t']) : array();

// MG User Replied - BEGIN
// check if user replied to the topic
define('USER_REPLIED_ICON', true);
$user_topics = $class_topics->user_replied_array($line);
// MG User Replied - END

for($i = 0; $i < sizeof($line); $i++)
{
	$forum_id = $line[$i]['forum_id'];
	$topic_id = $line[$i]['topic_id'];
	$forum_id_append = (!empty($forum_id) ? (POST_FORUM_URL . '=' . $forum_id) : '');
	$topic_id_append = (!empty($topic_id) ? (POST_TOPIC_URL . '=' . $topic_id) : '');
	$forum_url = append_sid(CMS_PAGE_VIEWFORUM . '?' . $forum_id_append);
	$topic_url = append_sid(CMS_PAGE_VIEWTOPIC . '?' . $forum_id_append . '&amp;' . $topic_id_append);
	$user_replied = (!empty($user_topics) && isset($user_topics[$topic_id]));

	$topic_title_data = $class_topics->generate_topic_title($topic_id, $line[$i], $topic_length);
	$topic_title = $topic_title_data['title'];
	$topic_title_clean = $topic_title_data['title_clean'];
Example #5
0
			AND w.user_id = " . $user->data['user_id'] . "
		ORDER BY t.topic_last_post_id DESC
		LIMIT $start, " . $config['topics_per_page'];
	$result = $db->sql_query($sql);
	$watch_rows = $db->sql_fetchrowset($result);

	// are we currently watching any topics?
	if ($watch_rows)
	{
		$tracking_forums = (isset($_COOKIE[$config['cookie_name'] . '_f'])) ? unserialize($_COOKIE[$config['cookie_name'] . '_f']) : array();
		$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_t'])) ? unserialize($_COOKIE[$config['cookie_name'] . '_t']) : array();

		// MG User Replied - BEGIN
		// check if user replied to the topic
		define('USER_REPLIED_ICON', true);
		$user_topics = $class_topics->user_replied_array($watch_rows);
		// MG User Replied - END

		$template->assign_block_vars('switch_watched_topics_block', array());
		for ($i = 0; $i < sizeof($watch_rows); $i++)
		{
			$forum_id = $watch_rows[$i]['forum_id'];
			$topic_id = $watch_rows[$i]['topic_id'];
			$post_id = $watch_rows[$i]['post_id'];
			$forum_id_append = (!empty($forum_id) ? (POST_FORUM_URL . '=' . $forum_id) : '');
			$topic_id_append = (!empty($topic_id) ? (POST_TOPIC_URL . '=' . $topic_id) : '');
			$post_id_append = (!empty($post_id) ? (POST_POST_URL . '=' . $post_id) : '');
			$post_id_append_url = (!empty($post_id) ? ('#p' . $post_id) : '');
			$forum_url = append_sid(CMS_PAGE_VIEWFORUM . '?' . $forum_id_append);
			$topic_url = append_sid(CMS_PAGE_VIEWTOPIC . '?' . $forum_id_append . '&amp;' . $topic_id_append);
			$post_url = append_sid(CMS_PAGE_VIEWTOPIC . '?' . $forum_id_append . '&amp;' . $topic_id_append . '&amp;' . $post_id_append) . $post_id_append_url;