header('Content-type: text/html; charset=UTF-8'); @include "phpComic.php"; include($phpbb_root_path . 'integrate.inc'); include($phpbb_root_path . 'mods/phpbb_fetch_all/common.' . $phpEx); include($phpbb_root_path . 'mods/phpbb_fetch_all/posts.' . $phpEx); include($phpbb_root_path . 'mods/phpbb_fetch_all/users.' . $phpEx); # Note that because of this, this must be included before any HTML is output $display_userdata = $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($display_userdata); function RecentDiscussion($lastn = 10) { global $db, $user_friend; $now = time(); $sql = "SELECT t.topic_title, i.source, t.topic_replies, t.topic_id, t.topic_type, p.post_time, i.url FROM " . TOPICS_TABLE . " as t LEFT JOIN " . INTEGRATE_TABLE . " AS i ON (t.topic_id = i.topic) INNER JOIN " . POSTS_TABLE . " AS p ON (t.topic_last_post_id = p.post_id) " . "WHERE (t.forum_id=11 OR t.forum_id=16 " . ($user_friend?" OR t.forum_id=13":"") . ") AND (t.topic_replies > 0 OR i.topic IS NULL) ORDER BY t.topic_type DESC, p.post_time DESC LIMIT $lastn"; $result = $db->sql_query($sql); while (($row = $db->sql_fetchrow($result))) { $numcomments = $row['topic_replies']; $age = floor(($now - $row['post_time'])/60); if ($age) { $ageLbl = ($age % 60) . 'm ago'; $age = floor($age/60); } else $ageLbl = 'now'; if ($age) { $ageLbl = ($age % 24) . 'h' . $ageLbl; $age = floor($age/24); } if ($age) $ageLbl = $age . 'd' . $ageLbl; $comment = ''; if ($row['source'] && $row['url']) { $link = $row['url'] . '?comments=' . $numcomments; } else { $link = "/forum/viewtopic.php?t=" . $row['topic_id']; $comment = 'forum'; $numcomments++; } if ($row['topic_type'] == 1) $comment .= ($comment?' ':'') . 'sticky'; else if ($row['topic_type'] == 2) $comment .= ($comment?' ':'') . 'announcement'; $title = preg_replace("/<[^>]*>/", "", $row['topic_title']); /*if (strlen($title) > 30) $title = substr($title, 0, 28) . "…";*/ echo "
'; if ($is_auth['auth_reply']) echo '- reply
';
foreach (array('edit' => 'editpost', 'delete' => 'delete')
as $funcname => $funccmd)
{
if ($is_auth['auth_mod'] || ($is_auth['auth_' . $funcname] && ($display_userdata['user_id'] === $post['user_id'])))
echo '- ' . $funcname . '
';
}
if ($is_auth['auth_mod'])
echo '- IP
';
echo '
'; } echo "