|
From: Jon O. <jon...@us...> - 2005-04-01 14:12:39
|
Update of /cvsroot/mxbb/kb_076_mxaddon/root/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12929/modules/kb_076_mxaddon/root/includes Modified Files: functions_kb.php functions_kb_field.php functions_kb_mx.php kb_article.php kb_cat.php kb_constants.php kb_footer.php kb_header.php kb_moderator.php kb_post.php kb_rate.php kb_stats.php Log Message: minor fixes...sprung from the phpbb dev thread Index: kb_stats.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/includes/kb_stats.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_stats.php 29 Mar 2005 21:39:31 -0000 1.3 --- kb_stats.php 1 Apr 2005 14:12:29 -0000 1.4 *************** *** 25,28 **** --- 25,30 ---- } + $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; + // Start auth check // *************** *** 71,75 **** ) ); ! get_kb_stats( $stats, '1', 'articlerow', $kb_is_auth ); ?> \ No newline at end of file --- 73,87 ---- ) ); ! $total_articles = get_kb_stats( $stats, '1', 'articlerow', $start, $kb_config['art_pagination'], $kb_is_auth ); ! ! // Stats pagination is inactivated for now ;) ! if ( $total_articles > 0 ) ! { ! // $pagination = generate_pagination( this_kb_mxurl( "mode=cat&cat=$category_id" ), $total_articles, $kb_config['art_pagination'], $start ) . ' '; ! } + if ( $total_articles > 0 ) + { + // $template->assign_block_vars( 'pagination', array() ); + } ?> \ No newline at end of file Index: kb_post.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/includes/kb_post.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** kb_post.php 30 Mar 2005 09:28:12 -0000 1.4 --- kb_post.php 1 Apr 2005 14:12:29 -0000 1.5 *************** *** 177,181 **** if ( $kb_is_auth['auth_mod'] || ( $kb_is_auth['auth_approval_edit'] && $userdata['user_id'] == $author_id ) ) { ! update_kb_number( $category, '+ 1' ); } } --- 177,181 ---- if ( $kb_is_auth['auth_mod'] || ( $kb_is_auth['auth_approval_edit'] && $userdata['user_id'] == $author_id ) ) { ! update_kb_number( $category_id, '+ 1' ); } } *************** *** 299,303 **** mx_add_search_words( 'single', $article_id, stripslashes( $article_text ), stripslashes( $article_title ), 'kb' ); ! $message = $lang['Article_submitted'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); } else --- 299,304 ---- mx_add_search_words( 'single', $article_id, stripslashes( $article_text ), stripslashes( $article_title ), 'kb' ); ! // $message = $lang['Article_submitted'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); ! $message = $lang['Article_submitted'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf($lang['Click_return_article'], '<a href="' . append_sid(this_kb_mxurl("mode=article&k=" . $article_id)). '">', '</a>') . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); } else *************** *** 500,504 **** { $template->assign_block_vars( 'custom_data_fields', array( ! 'L_ADDTIONAL_FIELD' => $lang['Addtional_field'] ) ); } --- 501,505 ---- { $template->assign_block_vars( 'custom_data_fields', array( ! 'L_ADDTIONAL_FIELD' => $lang['Addtional_field'] ) ); } Index: kb_moderator.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/includes/kb_moderator.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** kb_moderator.php 28 Mar 2005 20:54:53 -0000 1.2 --- kb_moderator.php 1 Apr 2005 14:12:29 -0000 1.3 *************** *** 28,31 **** --- 28,32 ---- $category_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval ( $HTTP_GET_VARS['cat']) : intval ( $HTTP_POST_VARS['cat'] ); + $article_id = ( isset( $HTTP_GET_VARS['a'] ) ) ? intval ( $HTTP_GET_VARS['a']) : intval ( $HTTP_POST_VARS['a'] ); $page_id = ( isset( $HTTP_GET_VARS['page'] ) ) ? intval ( $HTTP_GET_VARS['page']) : intval ( $HTTP_POST_VARS['page'] ); $ref_stats = ( isset( $HTTP_GET_VARS['ref'] ) ) ? true : 0; *************** *** 69,89 **** } - $article_id = intval ( $HTTP_GET_VARS['a'] ); - switch ( $action ) { case 'approve': $topic_sql = ''; if ( $kb_is_auth['auth_comment'] && $kb_config['use_comments'] ) { - $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; - if ( !( $results = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); - } - - $row = $db->sql_fetchrow( $results ); - if ( !$row['topic_id'] ) { --- 70,88 ---- } switch ( $action ) { case 'approve': + $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; + if ( !( $results = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); + } + + $row = $db->sql_fetchrow( $results ); + $topic_sql = ''; if ( $kb_is_auth['auth_comment'] && $kb_config['use_comments'] ) { if ( !$row['topic_id'] ) { *************** *** 135,141 **** } ! $sql = "SELECT article_category_id ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = " . $article_id; if ( !( $result = $db->sql_query( $sql ) ) ) --- 134,140 ---- } ! $sql = "SELECT * ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = " . $article_id; if ( !( $result = $db->sql_query( $sql ) ) ) *************** *** 144,150 **** } ! if ( $article = $db->sql_fetchrow( $result ) ) { ! $article_category_id = $article['article_category_id']; } --- 143,149 ---- } ! if ( $row = $db->sql_fetchrow( $result ) ) { ! $article_category_id = $row['article_category_id']; } *************** *** 161,165 **** if ( $HTTP_GET_VARS['c'] == "yes" ) { ! $sql = "SELECT article_category_id, approved, topic_id FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; --- 160,164 ---- if ( $HTTP_GET_VARS['c'] == "yes" ) { ! $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; Index: kb_article.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/includes/kb_article.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** kb_article.php 29 Mar 2005 21:39:31 -0000 1.4 --- kb_article.php 1 Apr 2005 14:12:28 -0000 1.5 *************** *** 227,234 **** --- 227,245 ---- $page_title = $article_title; + /* if ( !$is_block && !$print_version ) { include( $mx_root_path . 'includes/page_header.' . $phpEx ); } + */ + + if ( $print_version ) + { + $gen_simple_header = TRUE; + } + if ( !$is_block) + { + include( $mx_root_path . 'includes/page_header.' . $phpEx ); + } // fixup (truncates) urls, images and words for a narrow column layout *************** *** 323,330 **** } $topic = $db->sql_fetchrow( $result4 ); $temp_url = append_sid( $phpbb_root_path . "viewtopic.php?t=" . $topic['topic_id'] ); $comments = '<b>' . $lang['Comments'] . '</b>'; ! $comments_img = '<a href="' . $temp_url . '" class="gensmall"> [' . $topic['topic_replies'] . ' - ' . $lang['Post_comments'] . ']</a>'; $template->assign_block_vars( 'switch_comments', array() ); --- 334,342 ---- } $topic = $db->sql_fetchrow( $result4 ); + $num_of_replies = intval( $topic['topic_replies'] ); $temp_url = append_sid( $phpbb_root_path . "viewtopic.php?t=" . $topic['topic_id'] ); $comments = '<b>' . $lang['Comments'] . '</b>'; ! $comments_img = '<a href="' . $temp_url . '" class="gensmall"> [' . $num_of_replies . ' - ' . $lang['Post_comments'] . ']</a>'; $template->assign_block_vars( 'switch_comments', array() ); *************** *** 335,339 **** } ! if ( $kb_config['use_comments'] && $topic_id ) { --- 347,351 ---- } ! if ( $kb_config['comments_show'] && $topic_id ) { *************** *** 350,354 **** $show_num_comments = $kb_config['comments_pagination']; ! $pagination = generate_pagination( this_kb_mxurl( "mode=article&k=$article_id" . $page_numm ), $topic['topic_replies'], $kb_config['comments_pagination'], $start ) . ' '; get_kb_comments( $topic_id, $start, $show_num_comments ); } --- 362,366 ---- $show_num_comments = $kb_config['comments_pagination']; ! $pagination = generate_pagination( this_kb_mxurl( "mode=article&k=$article_id" . $page_numm ), $num_of_replies, $kb_config['comments_pagination'], $start ) . ' '; get_kb_comments( $topic_id, $start, $show_num_comments ); } *************** *** 374,381 **** get_kb_nav( $article_category_id ); ! $print_url = append_sid( this_kb_mxurl( "mode=article&k=" . $article_id . "&print=true", true ) ); $template->assign_vars( array( 'PAGINATION' => $pagination, ! 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $kb_config['comments_pagination'] ) + 1 ), ceil( $topic['topic_replies'] / $kb_config['comments_pagination'] ) ), 'L_GOTO_PAGE' => $lang['Goto_page'], --- 386,394 ---- get_kb_nav( $article_category_id ); ! // $print_url = append_sid( this_kb_mxurl( "mode=article&k=" . $article_id . "&print=true", true ) ); ! $print_url = append_sid( this_kb_mxurl( "mode=article&k=" . $article_id ."&page_num=".($page_num+1)."&start=".$start ."&print=true", true ) ); $template->assign_vars( array( 'PAGINATION' => $pagination, ! 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $kb_config['comments_pagination'] ) + 1 ), ceil( $num_of_replies / $kb_config['comments_pagination'] ) ), 'L_GOTO_PAGE' => $lang['Goto_page'], Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/includes/functions_kb.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** functions_kb.php 30 Mar 2005 09:28:12 -0000 1.5 --- functions_kb.php 1 Apr 2005 14:12:28 -0000 1.6 *************** *** 370,373 **** --- 370,518 ---- } + // get articles for the category + + function get_kb_stats( $type = false, $approve, $block_name, $start = -1, $articles_in_cat = 0, $kb_is_auth ) + { + global $db, $template, $images, $phpEx, $module_root_path, $phpbb_root_path, $mx_root_path, $board_config, $lang, $is_block, $page_id, $is_admin, $userdata; + + $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE"; + + $sql .= " approved = " . $approve; + + if ( $type ) + { + if ( $type == 'toprated' ) + { + $sql .= " AND article_totalvotes > 0"; + $sql .= " ORDER BY article_rating/article_totalvotes DESC"; + }elseif ( $type == 'latest' ) + { + $sql .= " ORDER BY article_date DESC"; + }elseif ( $type == 'mostpopular' ) + { + $sql .= " AND views > 0"; + $sql .= " ORDER BY views DESC"; + } + } + + if ( $start > -1 && $articles_in_cat > 0 ) + { + $sql .= " LIMIT $start, $articles_in_cat"; + } + + if ( !( $article_result = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); + } + + $i = 0; + + while ( $article = $db->sql_fetchrow( $article_result ) ) + { + if ( $i == $articles_in_cat ) + { + break; + } + + $article_description = $article['article_description']; + $article_cat = $article['article_category_id']; + $article_approved = $article['approved']; + // type + $type_id = $article['article_type']; + $article_type = get_kb_type( $type_id ); + + $article_date = create_date( $board_config['default_dateformat'], $article['article_date'], $board_config['board_timezone'] ); + // author information + $author_id = $article['article_author_id']; + if ( $author_id == -1 ) + { + $author = ( $article['username'] == '' ) ? $lang['Guest'] : $article['username']; + } + else + { + $author = get_kb_author( $author_id ); + + $temp_url = append_sid( $phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$author_id" ); + $author = '<a href="' . $temp_url . '" class="gen">' . $author . '</a>'; + } + + $article_id = $article['article_id']; + $views = $article['views']; + + $article_title = $article['article_title']; + $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id" ) ); + $article = '<a href="' . $temp_url . '" class="gen">' . $article_title . '</a>'; + + $approve = ''; + $delete = ''; + $category_name = ''; + + $category = get_kb_cat( $article_cat ); + $category_id = $category['category_id']; + $category_name = $category['category_name']; + $category_temp = append_sid( this_kb_mxurl( "mode=cat&cat=$category_id" ) ); + $category_url = '<a href="' . $category_temp . '" class="genmed">' . $category_name . '</a>'; + + if ( defined( 'IN_ADMIN' ) || $userdata['user_level'] == ADMIN ) + { + $category = get_kb_cat( $article_cat ); + $category_name = $category['category_name']; + + if ( $article_approved == 2 || $article_approved == 0 ) + { + // approve + $temp_url = append_sid( $module_root_path . "admin/admin_kb_art.$phpEx?mode=approve&a=$article_id" ); + $approve = '<a href="' . $temp_url . '"><img src="' . $images['icon_approve'] . '" border="0" alt="' . $lang['Approve'] . '"></a>'; + } + elseif ( $article_approved == 1 ) + { + // unapprove + $temp_url = append_sid( $module_root_path . "admin/admin_kb_art.$phpEx?mode=unapprove&a=$article_id" ); + $approve = '<a href="' . $temp_url . '"><img src="' . $images['icon_unapprove'] . '" border="0" alt="' . $lang['Un_approve'] . '"></a>'; + } + // delete + $temp_url = append_sid( $module_root_path . "admin/admin_kb_art.$phpEx?mode=delete&a=$article_id" ); + $delete = '<a href="' . $temp_url . '"><img src="' . $phpbb_root_path . $images['icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; + } + + if ( $article['article_rating'] == 0 || $article['article_totalvotes'] == 0 ) + { + $rating = 0; + $rating_votes = 0; + $rating_message = ''; + } + else + { + $rating = round( $postrow[$i]['link_rating'] / $postrow[$i]['link_totalvotes'], 2 ); + $rating_votes = $postrow[$i]['link_totalvotes']; + $rating_message = '(' . $rating . '/10, </span><span class="gensmall">' . $rating_votes . ' votes)'; + } + + if ( ns_auth_item( $article_cat, $type_id ) && ns_auth_cat( $article_cat ) && $kb_is_auth[$article_cat]['auth_view']) + { + $i++; + $template->assign_block_vars( $block_name, array( 'ARTICLE' => $article , + 'ARTICLE_DESCRIPTION' => $article_description, + 'ARTICLE_TYPE' => $article_type, + 'ARTICLE_DATE' => $article_date, + 'ARTICLE_AUTHOR' => $author, + 'CATEGORY' => $category_url, + 'ART_VIEWS' => $views, + 'ART_VOTES' => $rating_message, + + 'U_APPROVE' => $approve, + 'U_DELETE' => $delete ) + ); + } + } + if ( $i == 0 ) + { + $template->assign_block_vars( 'no_articles', array( 'COMMENT' => $lang['No_Articles'] ) + ); + } + + return $template; + } + // update number of articles in a category *************** *** 1525,1529 **** } ! if ( $total_posts != 0 ) { $template->assign_block_vars( 'switch_comments_show', array() ); --- 1670,1674 ---- } ! if ( ($start == 0 && $total_posts > 1) || ($start != 0 && $total_posts > 0) ) { $template->assign_block_vars( 'switch_comments_show', array() ); *************** *** 1532,1674 **** } - // get articles for the category - - function get_kb_stats( $type = false, $approve, $block_name, $kb_is_auth ) - { - global $db, $template, $images, $phpEx, $module_root_path, $phpbb_root_path, $mx_root_path, $board_config, $lang, $is_block, $page_id, $is_admin, $userdata; - - $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE"; - - $sql .= " approved = " . $approve; - - if ( $type ) - { - if ( $type == 'toprated' ) - { - $sql .= " AND article_totalvotes > 0"; - $sql .= " ORDER BY article_rating/article_totalvotes DESC"; - }elseif ( $type == 'latest' ) - { - $sql .= " ORDER BY article_date DESC"; - }elseif ( $type == 'mostpopular' ) - { - $sql .= " AND views > 0"; - $sql .= " ORDER BY views DESC"; - } - } - - if ( !( $article_result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); - } - - $i = 0; - - while ( $article = $db->sql_fetchrow( $article_result ) ) - { - if ( $i > 10 ) - { - break; - } - - $article_description = $article['article_description']; - $article_cat = $article['article_category_id']; - $article_approved = $article['approved']; - // type - $type_id = $article['article_type']; - $article_type = get_kb_type( $type_id ); - - $article_date = create_date( $board_config['default_dateformat'], $article['article_date'], $board_config['board_timezone'] ); - // author information - $author_id = $article['article_author_id']; - if ( $author_id == -1 ) - { - $author = ( $article['username'] == '' ) ? $lang['Guest'] : $article['username']; - } - else - { - $author = get_kb_author( $author_id ); - - $temp_url = append_sid( $phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$author_id" ); - $author = '<a href="' . $temp_url . '" class="gen">' . $author . '</a>'; - } - - $article_id = $article['article_id']; - $views = $article['views']; - - $article_title = $article['article_title']; - $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id" ) ); - $article = '<a href="' . $temp_url . '" class="gen">' . $article_title . '</a>'; - - $approve = ''; - $delete = ''; - $category_name = ''; - - $category = get_kb_cat( $article_cat ); - $category_id = $category['category_id']; - $category_name = $category['category_name']; - $category_temp = append_sid( this_kb_mxurl( "mode=cat&cat=$category_id" ) ); - $category_url = '<a href="' . $category_temp . '" class="genmed">' . $category_name . '</a>'; - - if ( defined( 'IN_ADMIN' ) || $userdata['user_level'] == ADMIN ) - { - $category = get_kb_cat( $article_cat ); - $category_name = $category['category_name']; - - if ( $article_approved == 2 || $article_approved == 0 ) - { - // approve - $temp_url = append_sid( $module_root_path . "admin/admin_kb_art.$phpEx?mode=approve&a=$article_id" ); - $approve = '<a href="' . $temp_url . '"><img src="' . $images['icon_approve'] . '" border="0" alt="' . $lang['Approve'] . '"></a>'; - }elseif ( $article_approved == 1 ) - { - // unapprove - $temp_url = append_sid( $module_root_path . "admin/admin_kb_art.$phpEx?mode=unapprove&a=$article_id" ); - $approve = '<a href="' . $temp_url . '"><img src="' . $images['icon_unapprove'] . '" border="0" alt="' . $lang['Un_approve'] . '"></a>'; - } - // delete - $temp_url = append_sid( $module_root_path . "admin/admin_kb_art.$phpEx?mode=delete&a=$article_id" ); - $delete = '<a href="' . $temp_url . '"><img src="' . $phpbb_root_path . $images['icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; - } - - if ( $article['article_rating'] == 0 || $article['article_totalvotes'] == 0 ) - { - $rating = 0; - $rating_votes = 0; - $rating_message = ''; - } - else - { - $rating = round( $postrow[$i]['link_rating'] / $postrow[$i]['link_totalvotes'], 2 ); - $rating_votes = $postrow[$i]['link_totalvotes']; - $rating_message = '(' . $rating . '/10, </span><span class="gensmall">' . $rating_votes . ' votes)'; - } - - if ( ns_auth_item( $article_cat, $type_id ) && ns_auth_cat( $article_cat ) && $kb_is_auth[$article_cat]['auth_view']) - { - $i++; - $template->assign_block_vars( $block_name, array( 'ARTICLE' => $article , - 'ARTICLE_DESCRIPTION' => $article_description, - 'ARTICLE_TYPE' => $article_type, - 'ARTICLE_DATE' => $article_date, - 'ARTICLE_AUTHOR' => $author, - 'CATEGORY' => $category_url, - 'ART_VIEWS' => $views, - 'ART_VOTES' => $rating_message, - - 'U_APPROVE' => $approve, - 'U_DELETE' => $delete ) - ); - } - } - if ( $i == 0 ) - { - $template->assign_block_vars( 'no_articles', array( 'COMMENT' => $lang['No_Articles'] ) - ); - } - - return $template; - } - function kb_get_data($row, $userdata, $kb_post_mode = '') { --- 1677,1680 ---- Index: kb_cat.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/includes/kb_cat.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** kb_cat.php 29 Mar 2005 21:39:31 -0000 1.4 --- kb_cat.php 1 Apr 2005 14:12:28 -0000 1.5 *************** *** 70,73 **** --- 70,83 ---- } + if ( $kb_config['use_comments'] && $category['comments_forum_id'] < 1 ) + { + // + // Commenting is enabled but no category forum id specified + // + $message = $lang['No_cat_comments_forum_id']; + + mx_message_die(GENERAL_MESSAGE, $message); + } + if ( !$is_block ) { *************** *** 88,92 **** break; case 'Latest': ! $kb_news_sort_method = 't.topic_last_post_id'; $kb_news_sort_method_extra = 't.article_type' . " DESC, " ; break; --- 98,103 ---- break; case 'Latest': ! //$kb_news_sort_method = 't.topic_last_post_id'; // This option is used if you want articles sorted for latest comments ! $kb_news_sort_method = 't.article_date'; $kb_news_sort_method_extra = 't.article_type' . " DESC, " ; break; *************** *** 143,146 **** --- 154,162 ---- } + if ( $total_articles > 0 ) + { + $template->assign_block_vars( 'pagination', array() ); + } + $template->assign_vars( array( 'PAGINATION' => $pagination, 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $kb_config['art_pagination'] ) + 1 ), ceil( $total_articles / $kb_config['art_pagination'] ) ), |