|
From: Jon O. <jon...@us...> - 2008-03-14 20:42:44
|
Update of /cvsroot/mxbb/mx_news/mx_news/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2452/includes Modified Files: functions.php functions_admin.php functions_comment.php functions_mx_news.php mx_news_constants.php Log Message: Now virtual page compatible Lots of code cleanup Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_news/mx_news/includes/functions.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functions.php 13 Mar 2008 20:19:55 -0000 1.4 --- functions.php 14 Mar 2008 20:42:37 -0000 1.5 *************** *** 56,60 **** $mx_news_config[$config_name] = $config_value; $mx_news_cache->put( 'config', $mx_news_config ); - } --- 56,59 ---- *************** *** 217,298 **** function page_header() { - global $mx_news_config, $lang, $userdata, $images, $action; - global $mx_news; - global $template, $db, $theme, $gen_simple_header, $starttime, $phpEx, $board_config, $user_ip, $phpbb_root_path; - global $admin_level, $level_prior, $tree, $do_gzip_compress; - global $mx_root_path, $module_root_path, $is_block, $title; - - /* - // - // page header for mx_news - // - if ( $action == 'category' ) - { - if ( $mx_news->modules[$mx_news->module_name]->auth_user[$_REQUEST['cat_id']]['auth_post'] || $mx_news->modules[$mx_news->module_name]->auth_user[$_REQUEST['cat_id']]['auth_mod'] ) - { - $upload_url = mx_append_sid( $mx_news->this_mxurl( "action=user_upload&cat_id={$_REQUEST['cat_id']}" ) ); - if ( !$mx_news_config['lock_submit_site'] ) - { - $template->assign_block_vars( 'ADD_LINK', array() ); - } - } - $mcp_url = mx_append_sid( $mx_news->this_mxurl( "action=mcp&cat_id={$_REQUEST['cat_id']}" ) ); - if ( $mx_news->modules[$mx_news->module_name]->auth_user[$_REQUEST['cat_id']]['auth_mod'] ) - { - $template->assign_block_vars( 'MCP', array() ); - } - } - else - { - $upload_url = mx_append_sid( $mx_news->this_mxurl( "action=user_upload" ) ); - } - - $template->set_filenames( array( 'mx_news_header' => "link_header.tpl" )); - - $template->assign_vars( array( - 'L_TITLE' => $title, - // BEGIN mx_news - 'LINKS' => $lang['Links_Title'], - 'U_LINK' => mx_append_sid( $mx_news->this_mxurl() ), - // END mx_news - 'L_SEARCH' => $lang['Link_Search'], - 'L_UPLOAD' => $lang['AddLink'], - 'L_MCP' => $lang['MCP_title'], - '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' => mx_append_sid( $mx_news->this_mxurl( "action=search" ) ), - 'U_UPLOAD' => $upload_url, - 'U_MCP' => $mcp_url, - 'U_VIEW_ALL' => mx_append_sid( $mx_news->this_mxurl( "action=viewall" ) ), - 'U_DESCEND_BY_HITS' => mx_append_sid( $mx_news->this_mxurl( "action=viewall&&sort_method=link_hits&sort_order=DESC" ) ), - 'U_DESCEND_BY_JOIN' => mx_append_sid( $mx_news->this_mxurl( "action=viewall&sort_method=link_time&sort_order=DESC" ) ), - 'U_DESCEND_BY_RATINGS' => mx_append_sid( $mx_news->this_mxurl( "action=viewall&sort_method=rating&sort_order=DESC" ) ), - - 'U_PORTAL_PAGE' => $page_id - )); - - // - // Ratings enabled for any category ? - // - if ( !empty( $mx_news->modules[$mx_news->module_name]->cat_rowset ) ) - { - foreach( $mx_news->modules[$mx_news->module_name]->cat_rowset as $cat_id => $cat_row ) - { - if ( $mx_news->modules[$mx_news->module_name]->ratings[$cat_id]['activated'] ) - { - $template->assign_block_vars( 'switch_toprated', array() ); - break; - } - } - } - $template->pparse( 'mx_news_header' ); - */ } --- 216,220 ---- *************** *** 303,333 **** function page_footer() { ! global $lang, $board_config, $userdata, $phpbb_root_path, $mx_root_path, $module_root_path, $is_block, $phpEx, $page_id; ! global $mx_news_cache, $mx_news; ! global $phpEx, $template, $do_gzip_compress, $debug, $db, $starttime; ! ! // ! // page footer for mx_news ! // ! /* ! $template->set_filenames( array( 'link_footer' => "link_footer.tpl" ) ); ! ! $template->assign_vars( array( ! 'L_JUMP' => $lang['Jump'], ! 'JUMPMENU' => $mx_news->modules[$mx_news->module_name]->generate_jumpbox( 0, 0, array( $_GET['cat_id'] => 1, true, true, 'auth_view' ) ), ! 'S_JUMPBOX_ACTION' => mx_append_sid( $mx_news->this_mxurl() ), ! 'MX_PAGE' => $page_id, ! ! 'S_HIDDEN_VARS' => $s_hidden_vars, ! ! 'S_TIMEZONE' => sprintf( $lang['All_times'], $lang[number_format( $board_config['board_timezone'] )] ), ! ! ) ); ! ! $mx_news->modules[$mx_news->module_name]->_mx_news(); ! ! $template->pparse( 'link_footer' ); ! */ ! $mx_news_cache->unload(); } --- 225,229 ---- function page_footer() { ! global $mx_news_cache; $mx_news_cache->unload(); } *************** *** 343,347 **** global $mx_request_vars; ! if ($mx_request_vars->is_request('virtual')) { $key = -1000 - $block_id; // We support 8999 virtual blocks and unlimited virtual ids --- 239,243 ---- global $mx_request_vars; ! if ($mx_request_vars->is_request('virtual') && $mx_request_vars->request('virtual', MX_TYPE_INT, '0') > 0) { $key = -1000 - $block_id; // We support 8999 virtual blocks and unlimited virtual ids *************** *** 413,456 **** $this->langs['edited_item_info'] = $lang['Edited_Link_info']; - /* - switch ( SQL_LAYER ) - { - case 'oracle': - $sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_link) AS total_votes, u.user_id, u.username - FROM " . LINKS_TABLE . " AS f, " . LINK_VOTES_TABLE . " AS r, " . USERS_TABLE . " AS u, " . LINK_CATEGORIES_TABLE . " AS c - WHERE f.link_id = r.votes_link(+) - AND f.user_id = u.user_id(+) - AND c.cat_id = a.link_catid - AND f.link_id = '" . $item_id . "' - GROUP BY f.link_id "; - break; - - default: - $sql = "SELECT f.*, AVG(r.rate_point) AS rating, COUNT(r.votes_link) AS total_votes, u.user_id, u.username - FROM " . LINKS_TABLE . " AS f - LEFT JOIN " . LINK_CATEGORIES_TABLE . " AS cat ON f.link_catid = cat.cat_id - LEFT JOIN " . LINK_VOTES_TABLE . " AS r ON f.link_id = r.votes_link - LEFT JOIN " . USERS_TABLE . " AS u ON f.user_id = u.user_id - WHERE f.link_id = '" . $item_id . "' - GROUP BY f.link_id "; - break; - } - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt Query link info', '', __LINE__, __FILE__, $sql ); - } - - // =================================================== - // file doesn't exist' - // =================================================== - if ( !$item_data = $db->sql_fetchrow( $result ) ) - { - mx_message_die( GENERAL_MESSAGE, $this->langs['Item_not_exist'] ); - } - - $db->sql_freeresult( $result ); - */ - unset($this->data); --- 309,312 ---- Index: mx_news_constants.php =================================================================== RCS file: /cvsroot/mxbb/mx_news/mx_news/includes/mx_news_constants.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mx_news_constants.php 17 Feb 2008 19:20:28 -0000 1.4 --- mx_news_constants.php 14 Mar 2008 20:42:38 -0000 1.5 *************** *** 25,29 **** define( 'PHPBB_URL', PORTAL_URL ); - //$kb_config['news_operate_mode'] = false; $mx_table_prefix = $table_prefix; $is_block = false; --- 25,28 ---- *************** *** 62,65 **** --- 61,65 ---- $mx_page->add_copyright( 'mxBB News Module' ); + $mx_page->add_css_file( ); } ?> \ No newline at end of file Index: functions_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_news/mx_news/includes/functions_comment.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions_comment.php 17 Feb 2008 19:30:36 -0000 1.2 --- functions_comment.php 14 Mar 2008 20:42:38 -0000 1.3 *************** *** 35,53 **** } - /* - if (!is_array($item_data) && !empty($item_data)) - { - $sql = 'SELECT * - FROM ' . LINKS_TABLE . " - WHERE link_id = $item_data"; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info', '', __LINE__, __FILE__, $sql ); - } - - $item_data = $db->sql_fetchrow( $result ); - } - */ $item_data['link_catid'] = $mx_news->modules[$mx_news->module_name]->block_id; $item_data['link_id'] = $mx_news->modules[$mx_news->module_name]->block_id; --- 35,38 ---- Index: functions_mx_news.php =================================================================== RCS file: /cvsroot/mxbb/mx_news/mx_news/includes/functions_mx_news.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions_mx_news.php 13 Mar 2008 20:19:58 -0000 1.2 --- functions_mx_news.php 14 Mar 2008 20:42:38 -0000 1.3 *************** *** 48,52 **** $this->block_id = $mx_news_functions->generate_virtualId($mx_block->block_id); - //$this->block_id = $mx_block->block_id; // --- 48,51 ---- *************** *** 208,235 **** global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars; - // - // Ensure we have article_data defined - // - /* - if (!is_array($link_data) && !empty($item_id) && $item_id > 0) - { - $sql = "SELECT * - FROM " . LINKS_TABLE . " - WHERE link_id = '" . $item_id . "'"; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt select link', '', __LINE__, __FILE__, $sql ); - } - - if ( !$link_data = $db->sql_fetchrow( $result ) ) - { - mx_message_die( GENERAL_MESSAGE, $lang['Link_not_exsist'] ); - } - - $db->sql_freeresult( $result ); - } - */ - $link_data['link_catid'] = $this->block_id; --- 207,210 ---- *************** *** 311,340 **** } } - - if ( !$this->comments[$link_data['link_catid']]['internal_comments'] ) - { - /* - - // - // Update the item data itself - // - if ($file_data['topic_id'] == 0 ) - { - // - // Update item with new topic_id - // - $sql = "UPDATE " . LINKS_TABLE . " - SET topic_id = '" . $return_data['topic_id'] . "' - WHERE link_id = ". $item_id; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldnt update item', '', __LINE__, __FILE__, $sql ); - } - - $db->sql_freeresult( $result ); - } - */ - } } --- 286,289 ---- *************** *** 367,388 **** foreach($fileIdsArray as $fileId) { - /* - $sql = "SELECT link_catid - FROM " . LINKS_TABLE . " - WHERE link_id = '" . $fileId . "'"; - - if ( !$result = $db->sql_query( $sql ) ) - { - mx_message_die( GENERAL_ERROR, 'Couldn\'t get link info', '', __LINE__, __FILE__, $sql ); - } - - $row = $db->sql_fetchrow( $result ); - $catId = $row['link_catid']; - */ - // // Notification // - //if ( $this->notification[$catId]['activated'] > 0 ) // -1, 0, 1, 2 if ( $this->notification[$block_id]['activated'] > 0 ) // -1, 0, 1, 2 { --- 316,322 ---- Index: functions_admin.php =================================================================== RCS file: /cvsroot/mxbb/mx_news/mx_news/includes/functions_admin.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** functions_admin.php 8 Feb 2008 21:58:20 -0000 1.1 --- functions_admin.php 14 Mar 2008 20:42:38 -0000 1.2 *************** *** 93,97 **** return $forumlist; } - } ?> \ No newline at end of file --- 93,96 ---- |