|
From: Jon O. <jon...@us...> - 2007-06-02 19:57:00
|
Update of /cvsroot/mxbb/mx_kb In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8824 Modified Files: db_install.php db_upgrade.php Added Files: kb_app.php Log Message: new block - kb_app Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/db_upgrade.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** db_upgrade.php 30 Jan 2007 16:26:09 -0000 1.42 --- db_upgrade.php 2 Jun 2007 19:56:52 -0000 1.43 *************** *** 30,34 **** } ! $mx_module_version = '2.2.0'; $mx_module_copy = 'Original phpBB <i>Knowledge Base</i> MOD by <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=89202" target="_phpbb" >wGEric/Jon</a> :: Adapted for mxBB by <a href="http://www.mxbb.net" target="_blank">Jon</a>'; --- 30,34 ---- } ! $mx_module_version = '2.2.2'; $mx_module_copy = 'Original phpBB <i>Knowledge Base</i> MOD by <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=89202" target="_phpbb" >wGEric/Jon</a> :: Adapted for mxBB by <a href="http://www.mxbb.net" target="_blank">Jon</a>'; Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/db_install.php,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** db_install.php 28 Apr 2007 19:59:03 -0000 1.50 --- db_install.php 2 Jun 2007 19:56:52 -0000 1.51 *************** *** 30,34 **** } ! $mx_module_version = '2.2.0'; $mx_module_copy = 'Original phpBB <i>Knowledge Base</i> MOD by <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=89202" target="_phpbb" >wGEric/Jon</a> :: Adapted for mxBB by <a href="http://www.mxbb.net" target="_blank">Jon</a>'; --- 30,34 ---- } ! $mx_module_version = '2.2.2'; $mx_module_copy = 'Original phpBB <i>Knowledge Base</i> MOD by <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=89202" target="_phpbb" >wGEric/Jon</a> :: Adapted for mxBB by <a href="http://www.mxbb.net" target="_blank">Jon</a>'; --- NEW FILE: kb_app.php --- <?php /** * * @package mxBB Portal Module - mx_kb * @version $Id: kb_app.php,v 1.1 2007/06/02 19:56:52 jonohlsson Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson, Mohd Basri, wGEric, PHP Arena, pafileDB, CRLin] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( file_exists( './viewtopic.' . $phpEx ) ) // -------------------------------------------- phpBB MOD MODE { define( 'MXBB_MODULE', false ); define( 'IN_PHPBB', true ); define( 'IN_PORTAL', true ); // When run as a phpBB mod these paths are identical ;) $phpbb_root_path = $module_root_path = $mx_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include( $phpbb_root_path . 'common.' . $phpEx ); define( 'PAGE_KB', -501 ); // If this id generates a conflict with other mods, change it ;) // Start session management $userdata = session_pagestart( $user_ip, PAGE_KB ); init_userprefs( $userdata ); // End session management } else // --------------------------------------------------------------------------------- mxBB Module MODE { define( 'MXBB_MODULE', true ); if ( !function_exists( 'read_block_config' ) ) { define( 'IN_PORTAL', true ); $mx_root_path = './../../'; $module_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include_once( $mx_root_path . 'common.' . $phpEx ); // Start session management $mx_user->init($user_ip, PAGE_INDEX); // End session management define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.' . $phpEx ) ); include_once( $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 (isset($HTTP_GET_VARS['print'])) { $url .= '&print=true'; } if ( !empty( $url ) && !$mx_get_page->error ) { if ( !empty( $db ) ) { $db->sql_close(); } if ( @preg_match( '/Microsoft|WebSTAR|Xitami/', getenv( 'SERVER_SOFTWARE' ) ) ) { header( 'Refresh: 0; URL=' . $url ); echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' . "\n" . '<html><head>' . "\n" . '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">' . "\n" . '<meta http-equiv="refresh" content="0; url=' . $url . '">' . "\n" . '<title>Redirect</title>' . "\n" . '<script language="javascript" type="text/javascript">' . "\n" . '<!--' . "\n" . 'if( document.images ) {' . "\n" . "\t" . 'parent.location.replace("' . $url . '");' . "\n" . '} else {' . "\n" . "\t" . 'parent.location.href = "' . $url . '";' . "\n" . '}' . "\n" . '// -->' . "\n" . '</script>' . "\n" . '</head>' . "\n" . '<body>' . "\n" . '<div align="center">If your browser does not support meta redirection please click ' . '<a href="' . $url . '">HERE</a> to be redirected</div>' . "\n" . '</body></html>'; exit; } @header( 'Location: ' . $url ); } else { if( !defined('IN_PORTAL') || !is_object($mx_block)) { die("Hacking attempt"); } if ( MXBB_27x ) { mx_message_die( GENERAL_MESSAGE, $lang['Standalone_Not_Supported'] ); } else { die('No article or redirect'); } } } else { if( !defined('IN_PORTAL') || !is_object($mx_block)) { die("Hacking attempt"); } define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.' . $phpEx ) ); // // Read Block Settings (default mode) // $title = !empty( $mx_block->block_info['block_title'] ) ? $mx_block->block_info['block_title'] : $lang['KB_title']; $desc = $mx_block->block_info['block_desc']; $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); // // Extract 'what posts to view info', the cool Array ;) // $kb_type_select_var = $mx_block->get_parameters( 'kb_type_select' ); $kb_type_select_data = ( !empty( $kb_type_select_var ) ) ? unserialize( $kb_type_select_var ) : array(); $is_block = true; global $images; } } // ------------------------------------------------------------------------------------------------------------------------- // ------------------------------------------------------------------------------------------------------------------------- // Start // ------------------------------------------------------------------------------------------------------------------------- // ------------------------------------------------------------------------------------------------------------------------- // =================================================== // Include the common file // =================================================== include_once( $module_root_path . 'kb/kb_common.' . $phpEx ); // =================================================== // Get mode variables, otherwise set it to the main // =================================================== $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, 'app'); $print_version = $mx_request_vars->is_request('print', MX_TYPE_NO_TAGS, ''); $kb_config['reader_mode'] = false; // =================================================== // Is admin? // =================================================== $is_admin = ( ( $userdata['user_level'] == ADMIN ) && $userdata['session_logged_in'] ) ? true : 0; // =================================================== // if the database disabled give them a nice message // =================================================== if ( intval( $kb_config['module_enable'] ) ) { mx_message_die( GENERAL_MESSAGE, $lang['kb_disable'] ); } // =================================================== // an array of all expected actions // =================================================== $actions = array( 'app' => 'app', 'article' => 'app', 'view' => 'app', 'cat' => 'cat', 'add' => 'post', 'search' => 'search', 'edit' => 'post', 'rate' => 'rate', 'stats' => 'stats', 'mcp' => 'mcp', 'post_comment' => 'post_comment', 'main' => 'main' ); // =================================================== // Lets Build the page // =================================================== $mx_kb->module( $actions[$mode] ); $mx_kb->modules[$actions[$mode]]->main( $mode ); // // load module header // if ( !$print_version ) { //$mx_kb_functions->page_header(); } // // Some general template vars // $template->assign_vars( array( 'U_PORTAL' => $mx_root_path, 'L_PORTAL' => "<<", 'U_KB' => append_sid( $mx_kb->this_mxurl() ), 'L_KB' => $lang['KB_title'] ) ); if ( $print_version) { ob_start(); } $template->pparse( 'body' ); if ( $print_version ) { $print_contents = ob_get_contents(); ob_end_clean(); die($print_contents); } // // load module footer // if ( !$print_version ) { //$mx_kb_functions->page_footer(); } ?> |