Update of /cvsroot/mxbb/mx_forum In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2687/modules/mx_forum Modified Files: db_install.php db_uninstall.php db_upgrade.php groupcp.php index.php mx_forum.pak viewforum.php viewtopic.php Added Files: mx_forum.php Log Message: Making the phpBB integration module ready for mxBB 2.8 Index: index.php =================================================================== RCS file: /cvsroot/mxbb/mx_forum/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.php 15 Jan 2005 23:45:37 -0000 1.4 --- index.php 15 Sep 2005 17:59:19 -0000 1.5 *************** *** 20,34 **** * ***************************************************************************/ ! //+mx_forum if( !defined('IN_PORTAL') ) { die("Hacking attempt !!!"); } ! include_once($mx_root_path . "modules/mx_forum/includes/forum_hack.$phpEx"); ! include_once($mx_root_path . "modules/mx_forum/includes/forum_constants.$phpEx"); ! //-mx_forum ! //+mx_forum /* define('IN_PHPBB', true); --- 20,32 ---- * ***************************************************************************/ ! //+mxbb_module if( !defined('IN_PORTAL') ) { die("Hacking attempt !!!"); } ! //-mxbb_module ! //+mxbb_module /* define('IN_PHPBB', true); *************** *** 37,84 **** include($phpbb_root_path . 'common.'.$phpEx); */ ! //-mx_forum // // Start session management // ! //+mx_forum /* $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); */ ! //-mx_forum // // End session management // - // Newssuite operation mode? - //------------------------------------------------------------------------- - $total_blockk = count( $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id]['blocks'] ); - - $phpbb2_config['news_mode_operate'] = ''; - for($blockk = 0; $blockk < $total_blockk; $blockk++) - { - if ( $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_source_switch']['parameter_value'] == 'phpbb' && $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_mode_operate']['parameter_value'] == 'Source' ) - { - $newssuite_select_par = $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_type_select']['parameter_value']; - - // Extract 'what posts to view info', the cool Array ;) - $news_type_select_data = array(); - $news_type_select_temp = $newssuite_select_par; - $news_type_select_temp = stripslashes($news_type_select_temp); - $news_type_select_data = eval("return " . $news_type_select_temp . ";"); - $phpbb2_config['news_mode_operate'] = true; - } - else - { - $phpbb2_config['news_mode_operate'] = ''; - } - } - - $phpbb_type_select_data = $mx_forum->phpbb_type_select_data; - - $title = $mx_forum->title; - //------------------------------------------------------------------------- - $viewcat = ( !empty($HTTP_GET_VARS[POST_CAT_URL]) ) ? $HTTP_GET_VARS[POST_CAT_URL] : -1; --- 35,53 ---- include($phpbb_root_path . 'common.'.$phpEx); */ ! //-mxbb_module // // Start session management // ! //+mxbb_module /* $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); */ ! //-mxbb_module // // End session management // $viewcat = ( !empty($HTTP_GET_VARS[POST_CAT_URL]) ) ? $HTTP_GET_VARS[POST_CAT_URL] : -1; *************** *** 99,108 **** if( $userdata['session_logged_in'] ) { ! $set_phpbb_cookie = true; ! // setcookie($board_config['cookie_name'] . '_f_all', time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); ! } ! else ! { ! $set_phpbb_cookie = 0; } --- 68,72 ---- if( $userdata['session_logged_in'] ) { ! setcookie($board_config['cookie_name'] . '_f_all', time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); } *************** *** 111,123 **** ); ! if ( $set_phpbb_cookie ) ! { ! $temp = "set_phpbb_cookie('". $board_config['cookie_name'] . "_f_all" ."', '".time()."', '0', '".$board_config['cookie_path']."', '".$board_config['cookie_domain']."', '".$board_config['cookie_path']."');"; ! } ! ! $message = '<img src="images/spacer.gif" onLoad="'.$temp.'">' . ! $lang['Forums_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . $mx_forum->append_sid("index.$phpEx?f=".$HTTP_GET_VARS['f']) . '">', '</a> '); ! message_die(GENERAL_MESSAGE, $message); } --- 75,81 ---- ); ! $message = $lang['Forums_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . $mx_forum->append_sid("index.$phpEx?f=".$HTTP_GET_VARS['f']) . '">', '</a> '); ! mx_message_die(GENERAL_MESSAGE, $message); } *************** *** 174,178 **** if( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql); } --- 132,136 ---- if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql); } *************** *** 223,227 **** if ( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql); } --- 181,185 ---- if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql); } *************** *** 235,239 **** if ( !($total_forums = count($forum_data)) ) { ! message_die(GENERAL_MESSAGE, $lang['No_forums']); } --- 193,197 ---- if ( !($total_forums = count($forum_data)) ) { ! mx_message_die(GENERAL_MESSAGE, $lang['No_forums']); } *************** *** 251,255 **** if ( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql); } --- 209,213 ---- if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql); } *************** *** 277,281 **** if ( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql); } --- 235,239 ---- if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql); } *************** *** 298,302 **** if ( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql); } --- 256,260 ---- if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql); } *************** *** 318,324 **** define('SHOW_ONLINE', true); $page_title = $lang['Index']; ! //+mx_forum //include($phpbb_root_path . 'includes/page_header.'.$phpEx); ! //-mx_forum $template->set_filenames(array( 'body' => 'index_body.tpl') --- 276,282 ---- define('SHOW_ONLINE', true); $page_title = $lang['Index']; ! //+mxBB_module //include($phpbb_root_path . 'includes/page_header.'.$phpEx); ! //-mxBB_module $template->set_filenames(array( 'body' => 'index_body.tpl') *************** *** 348,353 **** 'L_MODERATOR' => $lang['Moderators'], 'L_FORUM_LOCKED' => $lang['Forum_is_locked'], ! 'L_MARK_FORUMS_READ' => $lang['Mark_all_forums']) ! ); // --- 306,315 ---- 'L_MODERATOR' => $lang['Moderators'], 'L_FORUM_LOCKED' => $lang['Forum_is_locked'], ! 'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'], ! ! //+mxBB_module ! //'U_MARK_READ' => append_sid("index.$phpEx?mark=forums") ! //-mxBB_module ! )); // *************** *** 366,379 **** if ( $is_auth_ary[$forum_data[$j]['forum_id']]['auth_view'] && $forum_data[$j]['cat_id'] == $cat_id && phpbb2_auth_cat($forum_data[$j]['forum_id'])) { ! // MX forum $val_forum_id = $forum_data[$j]['forum_id']; ! // End $display_forums = true; } } $template->assign_vars(array( 'U_MARK_READ' => $mx_forum->append_sid("index.$phpEx?mark=forums&f=" . $val_forum_id) )); // --- 328,343 ---- if ( $is_auth_ary[$forum_data[$j]['forum_id']]['auth_view'] && $forum_data[$j]['cat_id'] == $cat_id && phpbb2_auth_cat($forum_data[$j]['forum_id'])) { ! //+mxBB_module $val_forum_id = $forum_data[$j]['forum_id']; ! //-mxBB_module $display_forums = true; } } + //+mxBB_module $template->assign_vars(array( 'U_MARK_READ' => $mx_forum->append_sid("index.$phpEx?mark=forums&f=" . $val_forum_id) )); + //-mxBB_module // *************** *** 397,400 **** --- 361,365 ---- $forum_id = $forum_data[$j]['forum_id']; + //+mxBB_module - forum subselect if ( $is_auth_ary[$forum_id]['auth_view'] && phpbb2_auth_cat($forum_id) ) { *************** *** 454,459 **** } ! // MX ADDON ! // Get number of articles in cat - newssuite addon if ( $phpbb2_config['news_mode_operate'] ) { --- 419,424 ---- } ! //+mxBB_module ! // Get number of post in forum - newssuite addon if ( $phpbb2_config['news_mode_operate'] ) { *************** *** 461,470 **** FROM " . TOPICS_TABLE . " WHERE "; ! // newssuite addon ! if ( $phpbb2_config['news_mode_operate'] ) ! { ! $phpbb_types_list = phpbb2_auth_item($forum_id); ! $sql_num .= " topic_type IN " . $phpbb_types_list . ' AND'; ! } $sql_num .= " forum_id = " . $forum_id; if ( !($result_num = $db->sql_query($sql_num)) ) --- 426,430 ---- FROM " . TOPICS_TABLE . " WHERE "; ! $sql_num .= " forum_id = " . $forum_id; if ( !($result_num = $db->sql_query($sql_num)) ) *************** *** 484,493 **** FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p WHERE "; ! // newssuite addon ! if ( $phpbb2_config['news_mode_operate'] ) ! { ! $phpbb_types_list = phpbb2_auth_item($forum_id); ! $sql_num .= " t.topic_type IN " . $phpbb_types_list . ' AND'; ! } $sql_num .= " t.forum_id = " . $forum_id . ' AND'; $sql_num .= " p.forum_id = " . $forum_id . ' AND'; --- 444,448 ---- FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p WHERE "; ! $sql_num .= " t.forum_id = " . $forum_id . ' AND'; $sql_num .= " p.forum_id = " . $forum_id . ' AND'; *************** *** 511,514 **** --- 466,470 ---- $topics = $forum_data[$j]['forum_topics']; } + //-mxBB_module if ( $forum_data[$j]['forum_last_post_id'] ) *************** *** 547,552 **** --- 503,510 ---- 'FORUM_NAME' => $forum_data[$j]['forum_name'], 'FORUM_DESC' => $forum_data[$j]['forum_desc'], + //+mxBB_module 'POSTS' => $posts, 'TOPICS' => $topics, + //-mxBB_module 'LAST_POST' => $last_post, 'MODERATORS' => $moderator_list, *************** *** 567,580 **** else { ! message_die(GENERAL_MESSAGE, $lang['No_forums']); } ! // MX $template->assign_vars(array( - 'LL_INDEX' => $mx_forum->title, - 'U_INDEX' => '', 'UU_INDEX' => $phpbb_root_path . 'index.php?f=' . $val_forum_id, ! )); ! // END // --- 525,537 ---- else { ! mx_message_die(GENERAL_MESSAGE, $lang['No_forums']); } ! //+mxBB_module ! // we need to add forum id to return link $template->assign_vars(array( 'UU_INDEX' => $phpbb_root_path . 'index.php?f=' . $val_forum_id, ! )); ! //-mxBB_module // Index: viewtopic.php =================================================================== RCS file: /cvsroot/mxbb/mx_forum/viewtopic.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** viewtopic.php 6 Mar 2005 01:12:18 -0000 1.6 --- viewtopic.php 15 Sep 2005 17:59:19 -0000 1.7 *************** *** 20,24 **** * ***************************************************************************/ ! // Printer topic mod if(isset($HTTP_GET_VARS['printertopic'])) { --- 20,24 ---- * ***************************************************************************/ ! //+mxbb_module - Printer topic mod if(isset($HTTP_GET_VARS['printertopic'])) [...1037 lines suppressed...] include($mx_root_path . 'includes/page_tail.'.$phpEx); } ! //+mx_forum //include($phpbb_root_path . 'includes/page_tail.'.$phpEx); return; ! //-mx_forum ?> \ No newline at end of file --- 1483,1491 ---- include($mx_root_path . 'includes/page_tail.'.$phpEx); } + //-mxbb_module ! //+mxbb_module //include($phpbb_root_path . 'includes/page_tail.'.$phpEx); return; ! //-mxbb_module ?> \ No newline at end of file Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_forum/db_install.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** db_install.php 6 Mar 2005 01:12:17 -0000 1.6 --- db_install.php 15 Sep 2005 17:59:19 -0000 1.7 *************** *** 2,12 **** /** * * ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * - * description : * ------------------------------------------------------------------------- * --- 2,11 ---- /** * * ------------------------------------------------------------------------ ! * subject : mxBB-Portal - CMS & portal * begin : june, 2002 ! * copyright : (C) 2002-2005 mxBB-Portal * email : jon...@ho... * project site : www.mx-system.com * * ------------------------------------------------------------------------- * *************** *** 20,37 **** * (at your option) any later version. */ ! define( 'IN_PORTAL', true ); - - $mx_module_version = 'mxBB phpBB Module 1.0.0'; - $mx_module_copy = 'Based on <a href="http://www.phpbb.com/" target="_phpbb">phpBB</a>'; - if ( !defined( 'IN_ADMIN' ) ) { ! $mx_root_path = '../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); - // Start session management - $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); --- 19,30 ---- * (at your option) any later version. */ ! define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { ! $mx_root_path = './../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); *************** *** 39,54 **** if ( !$userdata['session_logged_in'] ) { ! die( "Hacking attempt(3)" ); } if ( $userdata['user_level'] != ADMIN ) { ! die( "Hacking attempt(4)" ); } - // End session management - } // If fresh install --- 32,48 ---- if ( !$userdata['session_logged_in'] ) { ! die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { ! die( "Hacking attempt(2)" ); } // End session management } + $mx_module_version = 'mxBB phpBB Module 1.0.0'; + $mx_module_copy = 'Based on <a href="http://www.phpbb.com/" target="_phpbb">phpBB</a>'; + // If fresh install Index: groupcp.php =================================================================== RCS file: /cvsroot/mxbb/mx_forum/groupcp.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** groupcp.php 6 Mar 2005 01:12:17 -0000 1.3 --- groupcp.php 15 Sep 2005 17:59:19 -0000 1.4 *************** *** 26,30 **** } include_once($mx_root_path . "modules/mx_forum/includes/forum_hack.$phpEx"); - include_once($mx_root_path . "modules/mx_forum/includes/forum_constants.$phpEx"); include_once($mx_root_path . "modules/mx_forum/includes/phpbb_constants.$phpEx"); --- 26,29 ---- Index: viewforum.php =================================================================== RCS file: /cvsroot/mxbb/mx_forum/viewforum.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** viewforum.php 15 Jan 2005 23:45:37 -0000 1.4 --- viewforum.php 15 Sep 2005 17:59:19 -0000 1.5 *************** *** 21,34 **** ***************************************************************************/ ! //+mx_forum if( !defined('IN_PORTAL') ) { die("Hacking attempt !!!"); } ! include_once($mx_root_path . "modules/mx_forum/includes/forum_hack.$phpEx"); ! include_once($mx_root_path . "modules/mx_forum/includes/forum_constants.$phpEx"); ! //-mx_forum ! //+mx_forum /* define('IN_PHPBB', true); --- 21,32 ---- ***************************************************************************/ ! //+mxbb_module if( !defined('IN_PORTAL') ) { die("Hacking attempt !!!"); } ! //-mxbb_module ! //+mxbb_module /* define('IN_PHPBB', true); *************** *** 37,70 **** include($phpbb_root_path . 'common.'.$phpEx); */ ! //-mx_forum ! - // Newssuite operation mode? - //------------------------------------------------------------------------- - $total_blockk = count( $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id]['blocks'] ); - - for($blockk = 0; $blockk < $total_blockk; $blockk++) - { - if ( $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_source_switch']['parameter_value'] == 'phpbb' && $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_mode_operate']['parameter_value'] == 'Source' ) - { - $newssuite_select_par = $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_type_select']['parameter_value']; - - // Extract 'what posts to view info', the cool Array ;) - $news_type_select_data = array(); - $news_type_select_temp = $newssuite_select_par; - $news_type_select_temp = stripslashes($news_type_select_temp); - $news_type_select_data = eval("return " . $news_type_select_temp . ";"); - $phpbb2_config['news_mode_operate'] = true; - } - else - { - $phpbb2_config['news_mode_operate'] = ''; - } - } - $phpbb_type_select_data = $mx_forum->phpbb_type_select_data; - $title = $mx_forum->title; - - //------------------------------------------------------------------------- - // // Start initial var setup --- 35,40 ---- include($phpbb_root_path . 'common.'.$phpEx); */ ! //-mxbb_module // // Start initial var setup *************** *** 101,104 **** --- 71,76 ---- // If not give them a nice error page. // + //+mxbb_module + // forum sub select if ( !empty($forum_id) && phpbb2_auth_cat($forum_id)) { *************** *** 108,117 **** if ( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql); } } else { ! message_die(GENERAL_MESSAGE, 'Forum_not_exist'); } --- 80,89 ---- if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql); } } else { ! mx_message_die(GENERAL_MESSAGE, 'Forum_not_exist'); } *************** *** 122,126 **** if ( !($forum_row = $db->sql_fetchrow($result)) ) { ! message_die(GENERAL_MESSAGE, 'Forum_not_exist'); } --- 94,98 ---- if ( !($forum_row = $db->sql_fetchrow($result)) ) { ! mx_message_die(GENERAL_MESSAGE, 'Forum_not_exist'); } *************** *** 128,137 **** // Start session management // ! //+mx_forum /* $userdata = session_pagestart($user_ip, $forum_id); init_userprefs($userdata); */ ! //-mx_forum // // End session management --- 100,109 ---- // Start session management // ! //+mxbb_module /* $userdata = session_pagestart($user_ip, $forum_id); init_userprefs($userdata); */ ! //-mxbb_module // // End session management *************** *** 156,160 **** $message = ( !$is_auth['auth_view'] ) ? $lang['Forum_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']); ! message_die(GENERAL_MESSAGE, $message); } // --- 128,132 ---- $message = ( !$is_auth['auth_view'] ) ? $lang['Forum_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']); ! mx_message_die(GENERAL_MESSAGE, $message); } // *************** *** 174,178 **** if ( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql); } --- 146,150 ---- if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql); } *************** *** 190,201 **** if ( $row['last_post'] > $userdata['user_lastvisit'] ) { - $set_phpbb_cookie = true; $tracking_forums[$forum_id] = time(); ! // setcookie($board_config['cookie_name'] . '_f', serialize($tracking_forums), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); ! } ! else ! { ! $set_phpbb_cookie = 0; } } --- 162,168 ---- if ( $row['last_post'] > $userdata['user_lastvisit'] ) { $tracking_forums[$forum_id] = time(); ! setcookie($board_config['cookie_name'] . '_f', serialize($tracking_forums), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); } } *************** *** 206,216 **** } ! if ( $set_phpbb_cookie ) ! { ! $temp = "set_phpbb_cookie('". $board_config['cookie_name'] . "_f" ."', '".serialize($tracking_forums)."', '0', '".$board_config['cookie_path']."', '".$board_config['cookie_domain']."', '".$board_config['cookie_path']."');"; ! } ! $message = '<img src="images/spacer.gif" onLoad="'.$temp.'">' . ! $lang['Topics_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . $mx_forum->append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a> '); ! message_die(GENERAL_MESSAGE, $message); } // --- 173,178 ---- } ! $message = $lang['Topics_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . $mx_forum->append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a> '); ! mx_message_die(GENERAL_MESSAGE, $message); } // *************** *** 253,257 **** if ( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql); } --- 215,219 ---- if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql); } *************** *** 274,278 **** if ( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql); } --- 236,240 ---- if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql); } *************** *** 307,311 **** if ( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not obtain limited topics count information', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); --- 269,273 ---- if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain limited topics count information', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); *************** *** 347,375 **** AND p.poster_id = u2.user_id AND t.topic_type = " . POST_ANNOUNCE; ! // newssuite addon ! if ( $phpbb2_config['news_mode_operate'] ) ! { ! $phpbb_types_list = phpbb2_auth_item($forum_id); ! $sql .= " AND t.topic_type IN " . $phpbb_types_list; ! } ! // topic icon addon $sql .= " AND ( (t.topic_type_active = ic.topic_type_id AND t.topic_type_active <> '0') OR (t.topic_type_active = ic.topic_type_id AND t.topic_type_active = '0' AND ic.topic_type_name = 'announce') )"; ! $sql .= " ORDER BY t.topic_last_post_id DESC "; if ( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql); } $topic_rowset = array(); $total_announcements = 0; while( $row = $db->sql_fetchrow($result) ) { - // Newssuite op addon - if ( phpbb2_auth_item($row['forum_id'], $row['topic_type']) ) - { $topic_rowset[] = $row; $total_announcements++; - } } --- 309,330 ---- AND p.poster_id = u2.user_id AND t.topic_type = " . POST_ANNOUNCE; ! ! //+mxbb_module - topic icon mod $sql .= " AND ( (t.topic_type_active = ic.topic_type_id AND t.topic_type_active <> '0') OR (t.topic_type_active = ic.topic_type_id AND t.topic_type_active = '0' AND ic.topic_type_name = 'announce') )"; ! //-mxbb_module - topic icon mod ! $sql .= " ORDER BY t.topic_last_post_id DESC "; if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql); } $topic_rowset = array(); $total_announcements = 0; + while( $row = $db->sql_fetchrow($result) ) { $topic_rowset[] = $row; $total_announcements++; } *************** *** 388,400 **** AND u2.user_id = p2.poster_id AND t.topic_type <> " . POST_ANNOUNCE; - // newssuite addon - if ( $phpbb2_config['news_mode_operate'] ) - { - $phpbb_types_list = phpbb2_auth_item($forum_id); - $sql .= " AND t.topic_type IN " . $phpbb_types_list; - } - // topic icon addon - $sql .= " AND ( (t.topic_type_active = ic.topic_type_id AND t.topic_type_active <> '0') OR (t.topic_type_active = ic.topic_type_id AND t.topic_type_active = '0' AND ic.topic_type_name = 'announce') )"; $sql .= $limit_topics_time . " ORDER BY t.topic_type DESC, t.topic_last_post_id DESC --- 343,351 ---- AND u2.user_id = p2.poster_id AND t.topic_type <> " . POST_ANNOUNCE; + //+mxbb_module - topic icon mod + $sql .= " AND ( (t.topic_type_active = ic.topic_type_id AND t.topic_type_active <> '0') OR (t.topic_type_active = ic.topic_type_id AND t.topic_type_active = '0' AND ic.topic_type_name = 'announce') )"; + //-mxbb_module - topic icon mod + $sql .= $limit_topics_time . " ORDER BY t.topic_type DESC, t.topic_last_post_id DESC *************** *** 402,406 **** if ( !($result = $db->sql_query($sql)) ) { ! message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql); } --- 353,357 ---- if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql); } *************** *** 408,417 **** while( $row = $db->sql_fetchrow($result) ) { - // Newssuite op addon - if ( phpbb2_auth_item($row['forum_id'], $row['topic_type']) ) - { $topic_rowset[] = $row; $total_topics++; - } } --- 359,364 ---- *************** *** 469,475 **** define('SHOW_ONLINE', true); $page_title = $lang['View_forum'] . ' - ' . $forum_row['forum_name']; ! //+mx_forum //include($phpbb_root_path . 'includes/page_header.'.$phpEx); ! //-mx_forum $template->set_filenames(array( 'body' => 'viewforum_body.tpl') --- 416,422 ---- define('SHOW_ONLINE', true); $page_title = $lang['View_forum'] . ' - ' . $forum_row['forum_name']; ! //+mxbb_module //include($phpbb_root_path . 'includes/page_header.'.$phpEx); ! //-mxbb_module $template->set_filenames(array( 'body' => 'viewforum_body.tpl') *************** *** 479,484 **** $template->assign_vars(array( // MX ! 'LL_INDEX' => $mx_forum->title, ! 'UU_INDEX' => "?f=$forum_id", // END 'FORUM_ID' => $forum_id, --- 426,430 ---- $template->assign_vars(array( // MX ! 'UU_INDEX' => $phpbb_root_path . 'index.php?f=' . $forum_id, // END 'FORUM_ID' => $forum_id, *************** *** 720,724 **** --- 666,672 ---- $views = $topic_rowset[$i]['topic_views']; + //+mxbb_module - topic icon mod $topic_icon = !empty($topic_rowset[$i]['topic_type_image']) ? '<img align="absmiddle" src="' . PORTAL_URL . $module_root_path . TEMPLATE_ROOT_PATH .'images/topic_icons/' . $topic_rowset[$i]['topic_type_image'] . '" alt="'.$topic_rowset[$i]['topic_type_name'].'">': ''; + //-mxbb_module - topic icon mod $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; *************** *** 730,735 **** 'FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, ! // Topic_icon addon 'TOPIC_ICON' => $topic_icon, 'TOPIC_FOLDER_IMG' => $folder_image, 'TOPIC_AUTHOR' => $topic_author, --- 678,684 ---- 'FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, ! //+mxbb_module - topic icon mod 'TOPIC_ICON' => $topic_icon, + //-mxbb_module - topic icon mod 'TOPIC_FOLDER_IMG' => $folder_image, 'TOPIC_AUTHOR' => $topic_author, *************** *** 751,780 **** } ! // MX ADDON ! // Get number of articles in cat - newssuite addon ! if ( $phpbb2_config['news_mode_operate'] ) ! { ! $sql_num = "SELECT count(topic_id) AS total ! FROM " . TOPICS_TABLE . " ! WHERE "; ! // newssuite addon ! if ( $phpbb2_config['news_mode_operate'] ) ! { ! $phpbb_types_list = phpbb2_auth_item($forum_id); ! $sql_num .= " topic_type IN " . $phpbb_types_list . ' AND'; ! } ! $sql_num .= " forum_id = " . $forum_id; ! if ( !($result_num = $db->sql_query($sql_num)) ) ! { ! mx_message_die(GENERAL_ERROR, 'Error getting total postss', '', __LINE__, __FILE__, $sql_num); ! } ! if ( $total = $db->sql_fetchrow($result_num) ) ! { ! $topics_count = $total['total']; ! } ! } $topics_count -= $total_announcements; $topics_count = ($topics_count) ? $topics_count : 1 ; $template->assign_vars(array( --- 700,728 ---- } ! //+mxbb_module ! // Get number of articles in cat - newssuite addon ! if ( $phpbb2_config['news_mode_operate'] ) ! { ! $sql_num = "SELECT count(topic_id) AS total ! FROM " . TOPICS_TABLE . " ! WHERE "; ! ! $sql_num .= " forum_id = " . $forum_id; ! if ( !($result_num = $db->sql_query($sql_num)) ) ! { ! mx_message_die(GENERAL_ERROR, 'Error getting total postss', '', __LINE__, __FILE__, $sql_num); ! } ! if ( $total = $db->sql_fetchrow($result_num) ) ! { ! $topics_count = $total['total']; ! } ! } ! //-mxbb_module - topic icon mod $topics_count -= $total_announcements; + + //+mxbb_module $topics_count = ($topics_count) ? $topics_count : 1 ; + //-mxbb_module $template->assign_vars(array( *************** *** 808,815 **** // Page footer // ! //+mx_forum //include($phpbb_root_path . 'includes/page_tail.'.$phpEx); return; ! //-mx_forum ?> \ No newline at end of file --- 756,763 ---- // Page footer // ! //+mxbb_module //include($phpbb_root_path . 'includes/page_tail.'.$phpEx); return; ! //-mxbb_module ?> \ No newline at end of file --- NEW FILE: mx_forum.php --- <?php /*************************************************************************** * mx_index.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: mx_forum.php,v 1.1 2005/09/15 17:59:19 jonohlsson Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ if( !defined('IN_PORTAL') ) { die("Hacking attempt !!!"); } include_once($mx_root_path . "modules/mx_forum/includes/forum_hack.$phpEx"); include_once($mx_root_path . "modules/mx_forum/includes/phpbb_constants.$phpEx"); $phpbb_type_select_data = ( !empty( $mx_block->block_parameters['Source_phpBB_Forums']['parameter_value'] ) ) ? unserialize($mx_block->block_parameters['Source_phpBB_Forums']['parameter_value']) : array(); switch ( $mx_forum->phpbb_script ) { case 'index': include($mx_root_path . "modules/mx_forum/index.$phpEx"); break; case 'viewforum': include($mx_root_path . "modules/mx_forum/viewforum.$phpEx"); break; case 'viewtopic': include($mx_root_path . "modules/mx_forum/viewtopic.$phpEx"); break; } ?> Index: db_uninstall.php =================================================================== RCS file: /cvsroot/mxbb/mx_forum/db_uninstall.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** db_uninstall.php 16 Jan 2005 01:02:02 -0000 1.4 --- db_uninstall.php 15 Sep 2005 17:59:19 -0000 1.5 *************** *** 2,12 **** /** * * ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * - * description : * ------------------------------------------------------------------------- * --- 2,11 ---- /** * * ------------------------------------------------------------------------ ! * subject : mxBB-Portal - CMS & portal * begin : june, 2002 ! * copyright : (C) 2002-2005 mxBB-Portal * email : jon...@ho... * project site : www.mx-system.com * * ------------------------------------------------------------------------- * *************** *** 24,33 **** if ( !defined( 'IN_ADMIN' ) ) { ! $mx_root_path = '../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); - // Start session management - $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); --- 23,30 ---- if ( !defined( 'IN_ADMIN' ) ) { ! $mx_root_path = './../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); *************** *** 35,59 **** if ( !$userdata['session_logged_in'] ) { ! die( "Hacking attempt(3)" ); } if ( $userdata['user_level'] != ADMIN ) { ! die( "Hacking attempt(4)" ); } - // End session management - } $sql = array( "DROP TABLE IF EXISTS " . $mx_table_prefix . "phpbb_plugin_config", ); - $message .= mx_do_install_upgrade( $sql ); - echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstalling Information - module specific db tables</th></tr>"; ! echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . $message . "</span></td></tr>"; echo "</table><br />"; --- 32,53 ---- if ( !$userdata['session_logged_in'] ) { ! die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { ! die( "Hacking attempt(2)" ); } // End session management } + $sql = array( "DROP TABLE IF EXISTS " . $mx_table_prefix . "phpbb_plugin_config", ); echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstalling Information - module specific db tables</th></tr>"; ! echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . mx_do_install_upgrade( $sql ) . "</span></td></tr>"; echo "</table><br />"; Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_forum/db_upgrade.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** db_upgrade.php 6 Mar 2005 01:12:17 -0000 1.5 --- db_upgrade.php 15 Sep 2005 17:59:19 -0000 1.6 *************** *** 2,12 **** /** * * ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * - * description : * ------------------------------------------------------------------------- * --- 2,11 ---- /** * * ------------------------------------------------------------------------ ! * subject : mxBB-Portal - CMS & portal * begin : june, 2002 ! * copyright : (C) 2002-2005 mxBB-Portal * email : jon...@ho... * project site : www.mx-system.com * * ------------------------------------------------------------------------- * *************** *** 22,37 **** define( 'IN_PORTAL', true ); - - $mx_module_version = 'mxBB phpBB Module 1.0.0'; - $mx_module_copy = 'Based on <a href="http://www.phpbb.com/" target="_phpbb" >phpBB</a>'; - if ( !defined( 'IN_ADMIN' ) ) { ! $mx_root_path = '../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); - // Start session management - $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); --- 21,30 ---- define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { ! $mx_root_path = './../../'; include( $mx_root_path . 'extension.inc' ); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); *************** *** 39,54 **** if ( !$userdata['session_logged_in'] ) { ! die( "Hacking attempt(3)" ); } if ( $userdata['user_level'] != ADMIN ) { ! die( "Hacking attempt(4)" ); } - // End session management - } $sql = array(); --- 32,48 ---- if ( !$userdata['session_logged_in'] ) { ! die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { ! die( "Hacking attempt(2)" ); } // End session management } + $mx_module_version = 'mxBB phpBB Module 1.0.0'; + $mx_module_copy = 'Based on <a href="http://www.phpbb.com/" target="_phpbb" >phpBB</a>'; + $sql = array(); Index: mx_forum.pak =================================================================== RCS file: /cvsroot/mxbb/mx_forum/mx_forum.pak,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mx_forum.pak 18 Feb 2005 10:06:52 -0000 1.4 --- mx_forum.pak 15 Sep 2005 17:59:19 -0000 1.5 *************** *** 2,7 **** New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:51=+:82=+:phpBB: FAQ (Forum)=+:=+:faq.php=+: - parameter=+:82=+:165=+:mode=+:Text=+:faq=+: - option=+:0=+:0=+:0=+:endoflist=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - phpBB: FAQ (Forum)=+:Demo block=+:82=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 --- 2,5 ---- *************** *** 11,17 **** block=+:=+:Demo - phpBB: GroupCP=+:Demo block=+:83=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:51=+:84=+:phpBB: Index=+:=+:index.php=+:modules/mx_forum/admin/phpbb_config.php ! parameter=+:84=+:166=+:phpbb_type_select=+:Text=+:array('init'=>'1')=+: ! option=+:0=+:0=+:0=+:endoflist=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - phpBB: Index=+:Demo block=+:84=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 --- 9,14 ---- block=+:=+:Demo - phpBB: GroupCP=+:Demo block=+:83=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:51=+:84=+:phpBB: Index=+:=+:index.php=+: ! parameter=+:84=+:166=+:phpbb_type_select=+:phpbb_type_select=+:=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - phpBB: Index=+:Demo block=+:84=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 *************** *** 45,51 **** block=+:=+:Demo - phpBB: Search=+:Demo block=+:91=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:51=+:92=+:phpBB: ViewForum=+:=+:viewforum.php=+:modules/mx_forum/admin/phpbb_config.php ! parameter=+:92=+:167=+:phpbb_type_select=+:Text=+:array('init'=>'1')=+: ! option=+:0=+:0=+:0=+:endoflist=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - phpBB: ViewForum=+:Demo block=+:92=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 --- 42,47 ---- block=+:=+:Demo - phpBB: Search=+:Demo block=+:91=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:51=+:92=+:phpBB: ViewForum=+:=+:viewforum.php=+: ! parameter=+:92=+:167=+:phpbb_type_select=+:phpbb_type_select=+:=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - phpBB: ViewForum=+:Demo block=+:92=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 *************** *** 55,61 **** block=+:=+:Demo - phpBB: ViewOnline=+:Demo block=+:93=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:51=+:94=+:phpBB: ViewTopic=+:=+:viewtopic.php=+:modules/mx_forum/admin/phpbb_config.php ! parameter=+:94=+:316=+:phpbb_type_select=+:Text=+:array('init'=>'1')=+: ! option=+:0=+:0=+:0=+:endoflist=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - phpBB: ViewTopic=+:Demo block=+:94=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 --- 51,56 ---- block=+:=+:Demo - phpBB: ViewOnline=+:Demo block=+:93=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:51=+:94=+:phpBB: ViewTopic=+:=+:viewtopic.php=+: ! parameter=+:94=+:316=+:phpbb_type_select=+:phpbb_type_select=+:=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - phpBB: ViewTopic=+:Demo block=+:94=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 |