// FIN MOD Logo aléatoire // Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility $l_timezone = explode('.', $board_config['board_timezone']); $l_timezone = count($l_timezone) > 1 && $l_timezone[count($l_timezone) - 1] != 0 ? $lang[sprintf('%.1f', $board_config['board_timezone'])] : $lang[number_format($board_config['board_timezone'])]; // // The following assigns all _common_ variables that may be used at any point // in a template. // //START MOD Keep_unread_2 // check to see if we are supposed to toggle unread link from "View your unread posts" to "You have no unread posts" depending on whether // there are unread posts (on large boards people may want to skip that toggle by defining $toggle_unreads_link as false // in index.php to save query time) if (!empty($toggle_unreads_link)) { // only run a new list_new_unreads check if we haven't already done that by the time we get here (if we're coming from index.php this will already have been done in index.php) if (!isset($new_unreads)) { $new_unreads = list_new_unreads($forum_unreads, $toggle_unreads_link) ? true : false; } } else { // if we get here, we are not supposed to toggle the unread link so we'll just set the link to read "View your unread posts" in all cases $new_unreads = true; } //END MOD Keep_unread_2 if (empty($page_title)) { $page_title = ''; } // www.phpBB-SEO.com SEO TOOLKIT BEGIN - META $seo_meta = ""; if (isset($phpbb_seo)) { // phpBB SEO - META $seo_meta = $phpbb_seo->build_meta($page_title); }
//-- mod: sf if (!defined('IN_VIEWFORUM')) { //-- mod: sf - end if (!($total_forums = count($forum_data))) { message_die(GENERAL_MESSAGE, $lang['No_forums']); } //-- mod: sf } else { if (!($total_forums = count($forum_data)) || $total_forums <= 1) { return; } unset($_sf_retained_forums); } //-- mod: sf - end //MOD Keep_unread_2 * Get new_unreads list and forum_unread flags, save cookies etc. $new_unreads = list_new_unreads($forum_unreads, $toggle_unreads_link); if (!defined('IN_VIEWFORUM')) { //V: Show the 10 most recent topics new recent_topics(); } // // Obtain list of moderators of each forum // First users, then groups ... broken into two queries // $sql = "SELECT aa.forum_id, u.user_id, u.username \r\n\t\tFROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u\r\n\t\tWHERE aa.auth_mod = " . TRUE . " \r\n\t\t\tAND g.group_single_user = 1 \r\n\t\t\tAND ug.group_id = aa.group_id \r\n\t\t\tAND g.group_id = aa.group_id \r\n\t\t\tAND u.user_id = ug.user_id \r\n\t\tGROUP BY u.user_id, u.username, aa.forum_id \r\n\t\tORDER BY aa.forum_id, u.user_id"; $sql = str_replace(', u.user_id', ', u.user_id, u.user_level, u.user_color, u.user_group_id', $sql); if (!($result = $db->sql_query($sql, false, true))) { message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql); } $forum_moderators = array(); while ($row = $db->sql_fetchrow($result)) {
if ($userdata['user_level'] != ADMIN && $userdata['user_level'] != MOD) { $where_sql = $userdata['user_id'] == ANONYMOUS ? "se.session_ip = '{$user_ip}'" : 'se.session_user_id = ' . $userdata['user_id']; $sql = 'SELECT MAX(sr.search_time) AS last_search_time FROM ' . SEARCH_TABLE . ' sr, ' . SESSIONS_TABLE . " se\r\n\t\t\tWHERE sr.session_id = se.session_id\r\n\t\t\t\tAND {$where_sql}"; if ($result = $db->sql_query($sql)) { if ($row = $db->sql_fetchrow($result)) { if (intval($row['last_search_time']) > 0 && $current_time - intval($row['last_search_time']) < intval($board_config['search_flood_interval'])) { message_die(GENERAL_MESSAGE, $lang['Search_Flood_Error']); } } } } if ($search_id == 'newposts' || $search_id == 'latest' || $search_id == 'egosearch' || $search_author != '' && $search_keywords == '') { if ($search_id == 'newposts') { //START MOD Keep_unread_2 $list_unreads = implode(',', array_keys(list_new_unreads($dummy, $toggle_unreads_link))); $sql = "SELECT post_id, topic_id, forum_id, post_time\r\n\t\t\t\t\tFROM " . POSTS_TABLE . "\r\n\t\t\t\t\tWHERE "; //post_time >= " . $userdata['user_lastvisit'] ; $sql .= $list_unreads != '' ? " topic_id IN (" . $list_unreads . ")" : " topic_id=-1"; //END MOD Keep_unread_2 $show_results = 'topics'; $sort_by = 0; $sort_dir = 'DESC'; } else { if ($search_id == 'latest') { $search_latest_hours = explode(',', $board_config['search_latest_hours']); $latest_hours = intval(isset($HTTP_GET_VARS['hours']) ? $HTTP_GET_VARS['hours'] : $search_latest_hours[0]); if (!in_array($latest_hours, $search_latest_hours)) { $latest_hours = $search_latest_hours[0]; } $sql = "SELECT post_id \r\n\t\t\t\t\tFROM " . POSTS_TABLE . " \r\n\t\t\t\t\tWHERE post_time > " . (time() - $latest_hours * 60 * 60);