|
From: Jon O. <jon...@us...> - 2006-06-28 20:52:36
|
Update of /cvsroot/mxbb/mx_kb In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11223/modules/mx_kb Modified Files: kb.php kb_article_reader.php kb_last_article.php Log Message: Fixes for new last_article block new redirect class for direct links Index: kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** kb.php 28 Jun 2006 13:58:07 -0000 1.33 --- kb.php 28 Jun 2006 20:52:30 -0000 1.34 *************** *** 35,39 **** { define( 'IN_PORTAL', true ); ! $mx_root_path = './../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include_once( $mx_root_path . 'common.' . $phpEx ); --- 35,41 ---- { define( 'IN_PORTAL', true ); ! $mx_root_path = './../../'; ! $module_root_path = 'modules/mx_kb/'; ! $phpEx = substr(strrchr(__FILE__, '.'), 1); include_once( $mx_root_path . 'common.' . $phpEx ); *************** *** 47,66 **** if ( !isset( $HTTP_GET_VARS['print'] ) ) { ! include_once( $module_root_path . 'includes/kb_constants.' . $phpEx ); ! include_once( $module_root_path . 'includes/kb_pages.' . $phpEx ); $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; $url = ''; ! if ( empty( $article_id ) ) { ! $url = PORTAL_URL . 'index.php?page=' . $kb_pages . '&mode=cat&cat=' . $cat_id; } ! else if ( !empty( $article_id ) ) { ! $url = PORTAL_URL . 'index.php?page=' . $kb_pages . '&mode=article&k=' . $article_id; } ! if ( !empty( $url ) && !$kb_error ) { if ( !empty( $db ) ) --- 49,69 ---- if ( !isset( $HTTP_GET_VARS['print'] ) ) { ! include_once( $mx_root_path . $module_root_path . 'kb/includes/kb_pages.' . $phpEx ); ! $mx_get_page = new kb_pages(); ! $mx_get_page->init('kb.php'); $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; $url = ''; ! if ( empty( $mx_get_page->item_id ) ) { ! $url = PORTAL_URL . 'index.php?page=' . $mx_get_page->page_id . '&mode=cat&cat=' . $mx_get_page->cat_id; } ! else if ( !empty( $mx_get_page->item_id ) ) { ! $url = PORTAL_URL . 'index.php?page=' . $mx_get_page->page_id . '&mode=article&k=' . $mx_get_page->item_id; } ! if ( !empty( $url ) && !$mx_get_page->error ) { if ( !empty( $db ) ) *************** *** 97,100 **** --- 100,108 ---- else { + if( !defined('IN_PORTAL') || !is_object($mx_block)) + { + die("Hacking attempt"); + } + define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.' . $phpEx ) ); Index: kb_last_article.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb_last_article.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_last_article.php 28 Jun 2006 13:58:07 -0000 1.1 --- kb_last_article.php 28 Jun 2006 20:52:30 -0000 1.2 *************** *** 40,44 **** $align = $mx_block->get_parameters( 'Last_Article_Align' ); $display_forum = $mx_block->get_parameters( 'Last_Article_Display_Cat' ); ! $forum_lst_msg = $mx_block->get_parameters( 'Last_Article_Cat' ); if( empty($PostNumber) ) $PostNumber = 5; --- 40,50 ---- $align = $mx_block->get_parameters( 'Last_Article_Align' ); $display_forum = $mx_block->get_parameters( 'Last_Article_Display_Cat' ); ! ! // ! // Temp rewrite for getting KB categories ! // ! $kb_last_article_cat_var = $mx_block->get_parameters( 'Last_Article_Cat' ); ! $kb_last_article_cat_data = ( !empty( $kb_last_article_cat_var ) ) ? unserialize( $kb_last_article_cat_var ) : array(); ! $forum_lst_msg = count($kb_last_article_cat_data) > 0 ? implode(',', $kb_last_article_cat_data) : ''; if( empty($PostNumber) ) $PostNumber = 5; *************** *** 48,51 **** --- 54,60 ---- $display_icon_view = $mx_block->get_parameters( 'Last_Article_Display_Icon_View' ); + $kb_article_mode = $mx_block->get_parameters( 'Last_Article_Mode' ); + $kb_block_target = $kb_article_mode == 'KB_Reader' ? 'kb_article_reader.' : 'kb.'; + // // no limit, last day, 2 days, 3 days, week, 2 weeks, 3 weeks, month, 2 months, 3 months, 6 months, i year, *************** *** 196,200 **** $message = $postrow[$row_count]['article_title']; ! $url = append_sid(PHPBB_URL . 'viewtopic.php?t=' . $postrow[$row_count]['article_id'] ); $folder = $images['kb_last_article_folder']; --- 205,209 ---- $message = $postrow[$row_count]['article_title']; ! $url = append_sid($mx_root_path . $module_root_path . $kb_block_target . $phpEx . "?mode=article&k=" . $postrow[$row_count]['article_id']); $folder = $images['kb_last_article_folder']; *************** *** 256,270 **** } ! $forum_url = append_sid(PHPBB_URL . 'viewforum.php?f=' . $postrow[$row_count]['article_id']); } else { $forum_name = ''; - $forum_url = ''; } if ( $display_icon_view == "TRUE" ) { ! $last_post_url = '<a href="' . append_sid(PHPBB_URL . "viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$row_count]['topic_last_post_id']) . '#' . $postrow[$row_count]['topic_last_post_id'] . '"><img src="' . $images['kb_icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" /></a>'; } else --- 265,279 ---- } ! $forum_name = $kb_article_mode != 'KB_Reader' ? '<a href="' . append_sid($mx_root_path . $module_root_path . $kb_block_target . $phpEx . "?mode=cat&cat=" . $postrow[$row_count]['article_category_id']) . '" target="'.$target.'" class="gensmall">'.$forum_name.'</a>' : $forum_name; ! } else { $forum_name = ''; } if ( $display_icon_view == "TRUE" ) { ! $last_post_url = '<a href="' . append_sid($mx_root_path . $module_root_path . $kb_block_target . $phpEx . "?mode=article&k=" . $postrow[$row_count]['article_id']) . '"><img src="' . $images['kb_icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" /></a>'; } else *************** *** 282,286 **** 'FORUM_NAME_ALT' => $forum_name_alt, 'U_LAST_MSG' => $url, - 'U_FORUM' => $forum_url, 'LAST_POST_IMG' => $last_post_url, 'FOLDER_IMG' => $folder_image, --- 291,294 ---- Index: kb_article_reader.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb_article_reader.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** kb_article_reader.php 28 Jun 2006 13:58:07 -0000 1.16 --- kb_article_reader.php 28 Jun 2006 20:52:30 -0000 1.17 *************** *** 35,39 **** { define( 'IN_PORTAL', true ); ! $mx_root_path = './../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include_once( $mx_root_path . 'common.' . $phpEx ); --- 35,41 ---- { define( 'IN_PORTAL', true ); ! $mx_root_path = './../../'; ! $module_root_path = 'modules/mx_kb/'; ! $phpEx = substr(strrchr(__FILE__, '.'), 1); include_once( $mx_root_path . 'common.' . $phpEx ); *************** *** 47,66 **** if ( !isset( $HTTP_GET_VARS['print'] ) ) { ! include_once( $module_root_path . 'includes/kb_constants.' . $phpEx ); ! include_once( $module_root_path . 'includes/kb_pages.' . $phpEx ); $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; $url = ''; ! if ( empty( $article_id ) ) { ! $url = PORTAL_URL . 'index.php?page=' . $kb_pages . '&mode=cat&cat=' . $cat_id; } ! else if ( !empty( $article_id ) ) { ! $url = PORTAL_URL . 'index.php?page=' . $kb_pages . '&mode=article&k=' . $article_id; } ! if ( !empty( $url ) && !$kb_error ) { if ( !empty( $db ) ) --- 49,69 ---- if ( !isset( $HTTP_GET_VARS['print'] ) ) { ! include_once( $mx_root_path . $module_root_path . 'kb/includes/kb_pages.' . $phpEx ); ! $mx_get_page = new kb_pages(); ! $mx_get_page->init('kb_article_reader.php'); $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; $url = ''; ! if ( empty( $mx_get_page->item_id ) ) { ! $url = PORTAL_URL . 'index.php?page=' . $mx_get_page->page_id . '&mode=cat&cat=' . $mx_get_page->cat_id; } ! else if ( !empty( $mx_get_page->item_id ) ) { ! $url = PORTAL_URL . 'index.php?page=' . $mx_get_page->page_id . '&mode=article&k=' . $mx_get_page->item_id; } ! if ( !empty( $url ) && !$mx_get_page->error ) { if ( !empty( $db ) ) *************** *** 97,100 **** --- 100,108 ---- else { + if( !defined('IN_PORTAL') || !is_object($mx_block)) + { + die("Hacking attempt"); + } + define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.' . $phpEx ) ); |