$formum['max']) $id_forum = $minmaxfrm['max']; } // Вывод линейки новых сообщений $showforumsline = true; // Включаем "шапку" страницы require_once("../utils/topforum.php"); echo '
'; // Выводим список форумов $query = "SELECT * FROM $tbl_forums WHERE hide='show' ORDER BY pos"; $frm = mysql_query($query); if(!$frm) { throw new ExceptionMySQL(mysql_error(), $query, "Ошибка при обращении к таблице форумов"); } if(mysql_num_rows($frm)) { while($forums = mysql_fetch_array($frm)) { // Выводим название форума echo ""; } } echo "
 
$forums[name]
"; // Извлекаем последние три темы форума $query = "SELECT * FROM $tbl_themes WHERE id_forum = $forums[id_forum] AND hide != 'hide' ORDER BY time DESC LIMIT 3"; $thm = mysql_query($query); if(!$thm) { throw new ExceptionMySQL(mysql_error(), $query, "Ошибка при выборке последних сообщений форума"); } if(mysql_num_rows($thm)) { echo "
"; // Извлекаем время последнего посещения форума $forum_lasttime = get_last_time($current_author, $forums['id_forum']); while($themes = mysql_fetch_array($thm)) { // Подсчитываем количество сообщений в текущей теме $posts_in_topic = get_number_posts($themes['id_theme']); // Подсчитываем количество новых сообщений в текущей $new_posts_in_topics = get_number_posts($themes['id_theme'], $forum_lasttime); if($new_posts_in_topics != 0) { // Если в системе имеются новые сообщения приводим их // в скобках $theme_count = "$posts_in_topic ($new_posts_in_topics) "; $theme_style = "class=namenewtema"; } else { // Если новых сообщений нет, просто приводим общее число // сообщений в теме $theme_count = $posts_in_topic; $theme_style = "class=nametema"; } $last_author = htmlspecialchars($themes['last_author']); $time = convertdate($themes['time'], 0); $themes['name'] = theme_work_up($themes['name']); echo ""; } echo "
 

последние темы

последнее сообщение

$theme_count

$themes[name]

$time от $last_author

"; } echo "
"; // Выводим завершение страницы include "../utils/bottomforum.php"; // Помещаем страницу из буффера в переменную $buffer $buffer = ob_get_contents(); // Очищаем буффер ob_end_clean(); // Отправляем страницу клиенту echo $buffer; } catch(ExceptionObject $exc) { require_once("exception_object_debug.php"); } catch(ExceptionMySQL $exc) { require_once("exception_mysql_debug.php"); } catch(ExceptionMember $exc) { require_once("exception_member_debug.php"); } ?>