|
From: Jon O. <jon...@us...> - 2006-07-01 21:32:22
|
Update of /cvsroot/mxbb/mx_linkdb In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv10721/modules/mx_linkdb Modified Files: linkdb.php Log Message: Ok. Moving files. Renaming files. Adding code... Index: linkdb.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** linkdb.php 30 Jun 2006 19:54:14 -0000 1.9 --- linkdb.php 1 Jul 2006 21:32:18 -0000 1.10 *************** *** 9,59 **** */ ! if ( !function_exists( 'read_block_config' ) ) { define( 'IN_PORTAL', true ); ! $mx_root_path = '../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); ! include_once( $mx_root_path . 'common.' . $phpEx ); - // // Start session management ! // ! $mx_user->init($user_ip, PAGE_INDEX); ! $block_id = ( !empty( $HTTP_GET_VARS['block_id'] ) ) ? $HTTP_GET_VARS['block_id'] : $HTTP_POST_VARS['id']; ! if ( empty( $block_id ) ) { ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'linkdb' LIMIT 1"; ! if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Could not query Smartor_Album module information", "", __LINE__, __FILE__, $sql ); } ! $row = $db->sql_fetchrow( $result ); ! $block_id = $row['block_id']; } ! $is_block = false; ! } ! else ! { ! if( !defined('IN_PORTAL') || !is_object($mx_block)) { ! die("Hacking attempt"); ! } ! // ! // Read Block Settings ! // ! $title = $mx_block->block_info['block_title']; ! $desc = $mx_block->block_info['block_desc']; ! $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); ! $is_block = true; ! global $images; } // // Include the common file // ! include( $module_root_path . 'linkdb/includes/linkdb_common.' . $phpEx ); // --- 9,104 ---- */ ! if ( file_exists( './viewtopic.php' ) ) // -------------------------------------------- phpBB MOD MODE { + define( 'MXBB_MODULE', false ); + define( 'IN_PHPBB', true ); define( 'IN_PORTAL', true ); ! define( 'IN_DOWNLOAD', 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 ); ! ! include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); ! ! define( 'PAGE_DOWNLOAD', -501 ); // If this id generates a conflict with other mods, change it ;) // Start session management ! $userdata = session_pagestart( $user_ip, PAGE_DOWNLOAD ); ! init_userprefs( $userdata ); ! // End session management ! } ! else ! { ! define( 'MXBB_MODULE', true ); ! if ( !function_exists( 'read_block_config' ) ) { ! if( isset($_REQUEST['action']) && $_REQUEST['action'] == 'download' ) { ! define('MX_GZIP_DISABLED', true); } ! ! define( 'IN_PORTAL', true ); ! $mx_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 ! ! $block_id = ( !empty( $HTTP_GET_VARS['block_id'] ) ) ? $HTTP_GET_VARS['block_id'] : $HTTP_POST_VARS['id']; ! if ( empty( $block_id ) ) ! { ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'linkdb' LIMIT 1"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not query PafileDB module information", "", __LINE__, __FILE__, $sql ); ! } ! $row = $db->sql_fetchrow( $result ); ! $block_id = $row['block_id']; ! } ! $is_block = false; } ! else { ! if( !defined('IN_PORTAL') || !is_object($mx_block)) ! { ! die("Hacking attempt"); ! } ! // ! // Read Block Settings ! // ! $title = $mx_block->block_info['block_title']; ! $desc = $mx_block->block_info['block_desc']; ! $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); ! $is_block = true; ! global $images; ! } ! define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.php' ) ); } + // ------------------------------------------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------------------------------------------------------- + // Start + // ------------------------------------------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------------------------------------------------------- + + // =================================================== + // ? + // =================================================== + list( $trash, $mx_script_name_temp ) = split ( trim( $board_config['server_name'] ), PORTAL_URL ); + $mx_script_name = preg_replace( '#^\/?(.*?)\/?$#', '\1', trim( $mx_script_name_temp ) ); + // // Include the common file // ! include( $module_root_path . 'linkdb/linkdb_common.' . $phpEx ); // *************** *** 62,65 **** --- 107,125 ---- $action = ( isset( $_REQUEST['action'] ) ) ? htmlspecialchars( $_REQUEST['action'] ) : 'main'; + // =================================================== + // 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( $pafiledb_config['module_enable'] ) ) + { + mx_message_die( GENERAL_MESSAGE, $lang['pafiledb_disable'] ); + } + */ + // // an array of all expected actions *************** *** 76,81 **** // Lets Build the page // - $linkdb->module( $actions[$action] ); - $linkdb->modules[$actions[$action]]->main( $action ); if ( !$is_block ) { --- 136,139 ---- *************** *** 83,135 **** } ! // ! // page header for linkdb ! // ! if ( $action == 'category' ) ! { ! $upload_url = append_sid( linkdb_this_mxurl( "action=user_upload&cat_id={$_REQUEST['cat_id']}" ) ); ! } ! else ! { ! $upload_url = append_sid( linkdb_this_mxurl( "action=user_upload" ) ); ! } ! ! if ( !$linkdb_config['lock_submit_site'] || $userdata['user_level'] == ADMIN ) ! { ! $template->assign_block_vars( 'ADD_LINK', array() ); ! } ! ! $template->set_filenames( array( 'pa_header' => "pa_header.tpl" )); ! ! $template->assign_vars( array( ! 'L_TITLE' => $title, ! // BEGIN linkdb ! 'LINKS' => $lang['Links_Title'], ! 'U_LINK' => append_sid( linkdb_this_mxurl() ), ! // END linkdb ! 'L_SEARCH' => $lang['Link_Search'], ! 'L_UPLOAD' => $lang['AddLink'], ! 'L_VIEW_ALL' => $lang['Viewall'], ! 'L_DESCEND_BY_HITS' => $lang['Descend_by_hits'], ! 'L_DESCEND_BY_JOIN' => $lang['Descend_by_joindate'], ! ! 'L_STATS_MOST_POPULAR' => $lang['Link_most_popular'], ! 'L_STATS_LATEST' => $lang['Link_latest'], ! 'L_STATS_TOPRATED' => $lang['Link_toprated'], ! ! 'U_PASEARCH' => append_sid( linkdb_this_mxurl( "action=search" ) ), ! 'U_UPLOAD' => $upload_url, ! 'U_VIEW_ALL' => append_sid( linkdb_this_mxurl( "action=viewall" ) ), ! 'U_DESCEND_BY_HITS' => append_sid( linkdb_this_mxurl( "action=viewall&&sort_method=link_hits&sort_order=DESC" ) ), ! 'U_DESCEND_BY_JOIN' => append_sid( linkdb_this_mxurl( "action=viewall&sort_method=link_time&sort_order=DESC" ) ), ! 'U_DESCEND_BY_RATINGS' => append_sid( linkdb_this_mxurl( "action=viewall&sort_method=rating&sort_order=DESC" ) ), ! ! 'L_JUMP' => $lang['Jump'], ! 'JUMPMENU' => $linkdb->modules[$linkdb->module_name]->jumpmenu_option(), ! 'S_JUMPBOX_ACTION' => append_sid( "index." . $phpEx ), ! 'U_PORTAL_PAGE' => $page_id ! )); ! $template->pparse( 'pa_header' ); // --- 141,148 ---- } ! $linkdb->module( $actions[$action] ); ! $linkdb->modules[$actions[$action]]->main( $action ); ! linkdb_page_header(); // *************** *** 140,156 **** $template->pparse( 'body' ); ! // ! // page footer for linkdb ! // ! $template->set_filenames( array( 'pa_footer' => "pa_footer.tpl" ) ); ! ! $template->assign_vars( array( ! 'S_TIMEZONE' => sprintf( $lang['All_times'], $lang[number_format( $board_config['board_timezone'] )] ), ! 'LINKDB_VERSION' => $linkdb_config['linkdb_versions'] ! ) ); ! ! $linkdb->modules[$linkdb->module_name]->_linkdb(); ! ! $template->pparse( 'pa_footer' ); if ( !$is_block ) --- 153,157 ---- $template->pparse( 'body' ); ! linkdb_page_footer(); if ( !$is_block ) |