|
From: Jon O. <jon...@us...> - 2008-10-31 19:02:26
|
Update of /cvsroot/mxbb/core/admin In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6817/admin Modified Files: admin_mx_module_cp.php admin_mx_page_cp.php admin_mx_portal.php admin_mx_smilies.php admin_mx_styles.php index.php page_footer_admin.php page_header_admin.php pagestart.php Log Message: http://www.mx-publisher.com/phpBB2/viewtopic.php?p=65197#65197 Massive update. Index: admin_mx_module_cp.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_module_cp.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** admin_mx_module_cp.php 4 Oct 2008 07:04:24 -0000 1.25 --- admin_mx_module_cp.php 31 Oct 2008 19:02:20 -0000 1.26 *************** *** 316,335 **** // Get the list of phpBB usergroups // ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! case 'phpbb2': ! $sql = "SELECT group_id, group_name ! FROM " . GROUPS_TABLE . " ! WHERE group_single_user <> " . TRUE . " ! ORDER BY group_name ASC"; ! break; ! case 'phpbb3': ! $sql = "SELECT group_id, group_name ! FROM " . GROUPS_TABLE . " ! WHERE group_name NOT IN ('BOTS', 'GUESTS') ! ORDER BY group_name ASC"; ! break; ! } if( !($result = $db->sql_query($sql)) ) { --- 316,321 ---- // Get the list of phpBB usergroups // ! $sql = $mx_backend->generate_group_select_sql(); ! if( !($result = $db->sql_query($sql)) ) { *************** *** 889,893 **** $block_time = !$new_block ? $block_rows[$block_count]['block_time'] : time(); ! $edit_time = $phpBB2->create_date( $board_config['default_dateformat'], $block_time, $board_config['board_timezone'] ); if ($new_block) --- 875,879 ---- $block_time = !$new_block ? $block_rows[$block_count]['block_time'] : time(); ! $edit_time = phpBB2::create_date( $board_config['default_dateformat'], $block_time, $board_config['board_timezone'] ); if ($new_block) *************** *** 1056,1065 **** { $template->assign_block_vars('module.function.block.is_block', array()); ! if ( $mx_modulecp_include_block_private ) { $template->assign_block_vars('module.function.block.is_block.include_block_private', array()); } ! if ( $mx_modulecp_include_block_quickedit ) { --- 1042,1051 ---- { $template->assign_block_vars('module.function.block.is_block', array()); ! if ( $mx_modulecp_include_block_private ) { $template->assign_block_vars('module.function.block.is_block.include_block_private', array()); } ! if ( $mx_modulecp_include_block_quickedit ) { Index: admin_mx_page_cp.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_page_cp.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** admin_mx_page_cp.php 4 Oct 2008 07:04:24 -0000 1.34 --- admin_mx_page_cp.php 31 Oct 2008 19:02:20 -0000 1.35 *************** *** 992,996 **** $editor_name_tmp = mx_get_userdata($mx_block->editor_id); $editor_name = $editor_name_tmp['username']; ! $edit_time = $phpBB2->create_date( $board_config['default_dateformat'], $mx_block->block_time, $board_config['board_timezone'] ); $mode = MX_PAGE_BLOCK_TYPE; --- 992,996 ---- $editor_name_tmp = mx_get_userdata($mx_block->editor_id); $editor_name = $editor_name_tmp['username']; ! $edit_time = phpBB2::create_date( $board_config['default_dateformat'], $mx_block->block_time, $board_config['board_timezone'] ); $mode = MX_PAGE_BLOCK_TYPE; Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/index.php,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** index.php 4 Oct 2008 07:04:24 -0000 1.55 --- index.php 31 Oct 2008 19:02:20 -0000 1.56 *************** *** 174,272 **** } ! // MX ADDON // Include PHPBB Administration // ------------------------------------------------------------------------------- ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! break; ! ! case 'phpbb2': ! ! $module_phpbb = read_admin($phpbb_root_path . 'admin/'); ! $template->assign_block_vars('module_phpbb', array( ! 'L_PHPBB' => $lang['Phpbb'], ! "L_FORUM_INDEX" => $lang['Main_index'], ! "L_PREVIEW_FORUM" => $lang['Preview_forum'], ! "U_FORUM_INDEX" => mx_append_sid(PHPBB_URL . "index.$phpEx"), ! )); ! ! ksort($module_phpbb); ! ! //+MOD: DHTML Menu for ACP ! $menu_cat_id = 0; ! //-MOD: DHTML Menu for ACP ! ! while( list($cat, $action_array) = each($module_phpbb) ) ! { ! $cat = ( !empty($lang[$cat]) ) ? $lang[$cat] : preg_replace("/_/", " ", $cat); ! ! $template->assign_block_vars('module_phpbb.catrow', array( ! //+MOD: DHTML Menu for ACP ! 'MENU_CAT_ID' => $menu_cat_id, ! 'MENU_CAT_ROWS' => count($action_array), ! //-MOD: DHTML Menu for ACP ! 'ADMIN_CATEGORY' => $cat) ! ); ! ! ksort($action_array); ! ! $row_count = 0; ! while( list($action, $file) = each($action_array) ) ! { ! $row_color = ( !($row_count%2) ) ? $theme['td_color1'] : $theme['td_color2']; ! $row_class = ( !($row_count%2) ) ? $theme['td_class1'] : $theme['td_class2']; ! ! $action = ( !empty($lang[$action]) ) ? $lang[$action] : preg_replace("/_/", " ", $action); ! ! $template->assign_block_vars('module_phpbb.catrow.modulerow', array( ! "ROW_COLOR" => "#" . $row_color, ! "ROW_CLASS" => $row_class, ! //+MOD: DHTML Menu for ACP ! 'ROW_COUNT' => $row_count, ! //-MOD: DHTML Menu for ACP ! "ADMIN_MODULE" => $action, ! "U_ADMIN_MODULE" => mx_append_sid(PHPBB_URL . 'admin/' . $file . ( ( strpos($file, '?') !== false ) ? '&sid=' : '?sid=' ) . $userdata['session_id'])) ! ); ! $row_count++; ! } ! //+MOD: DHTML Menu for ACP ! $menu_cat_id++; ! //-MOD: DHTML Menu for ACP ! } ! ! break; ! ! case 'phpbb3': ! ! $template->assign_block_vars('module_phpbb', array( ! 'L_PHPBB' => $lang['Phpbb'], ! "L_FORUM_INDEX" => $lang['Main_index'], ! "L_PREVIEW_FORUM" => $lang['Preview_forum'], ! "U_FORUM_INDEX" => mx_append_sid(PHPBB_URL . "index.$phpEx"), ! )); ! ! $menu_cat_id = 0; ! ! $template->assign_block_vars('module_phpbb.catrow', array( ! //+MOD: DHTML Menu for ACP ! 'MENU_CAT_ID' => $menu_cat_id, ! 'MENU_CAT_ROWS' => 1, ! //-MOD: DHTML Menu for ACP ! 'ADMIN_CATEGORY' => 'Olympus adminCP') ! ); ! ! $template->assign_block_vars('module_phpbb.catrow.modulerow', array( ! "ROW_COLOR" => "#" . $theme['td_color1'], ! "ROW_CLASS" => $theme['td_class1'], ! //+MOD: DHTML Menu for ACP ! 'ROW_COUNT' => 0, ! //-MOD: DHTML Menu for ACP ! "ADMIN_MODULE" => 'Go!', ! "U_ADMIN_MODULE" => mx_append_sid($phpbb_root_path . 'adm/index.php?sid='.$mx_user->session_id)) ! ); - break; - } // // Read Portal Module Configuration --- 174,182 ---- } ! // // Include PHPBB Administration // ------------------------------------------------------------------------------- ! $mx_backend->load_phpbb_acp_menu(); // // Read Portal Module Configuration *************** *** 401,612 **** ); ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! break; ! ! case 'phpbb2': ! case 'phpbb3': ! ! $template->assign_block_vars("forum_stats", array()); ! // ! // Get forum statistics ! // ! $total_posts = $phpBB2->get_db_stat('postcount'); ! $total_users = $phpBB2->get_db_stat('usercount'); ! $total_topics = $phpBB2->get_db_stat('topiccount'); ! ! $start_date = $phpBB2->create_date($board_config['default_dateformat'], $board_config['board_startdate'], $board_config['board_timezone']); ! ! $boarddays = ( time() - $board_config['board_startdate'] ) / 86400; ! ! $posts_per_day = sprintf("%.2f", $total_posts / $boarddays); ! $topics_per_day = sprintf("%.2f", $total_topics / $boarddays); ! $users_per_day = sprintf("%.2f", $total_users / $boarddays); ! ! $avatar_dir_size = 0; ! ! if ($avatar_dir = @opendir($phpbb_root_path . $board_config['avatar_path']) ) ! { ! while( $file = @readdir($avatar_dir) ) ! { ! if( $file != "." && $file != ".." ) ! { ! $avatar_dir_size += @filesize($phpbb_root_path . $board_config['avatar_path'] . "/" . $file); ! } ! } ! @closedir($avatar_dir); ! ! // ! // This bit of code translates the avatar directory size into human readable format ! // Borrowed the code from the PHP.net annoted manual, origanally written by: ! // Jesse (je...@je...) ! // ! if($avatar_dir_size >= 1048576) ! { ! $avatar_dir_size = round($avatar_dir_size / 1048576 * 100) / 100 . " MB"; ! } ! else if($avatar_dir_size >= 1024) ! { ! $avatar_dir_size = round($avatar_dir_size / 1024 * 100) / 100 . " KB"; ! } ! else ! { ! $avatar_dir_size = $avatar_dir_size . " Bytes"; ! } ! } ! else ! { ! // Couldn't open Avatar dir. ! $avatar_dir_size = $lang['Not_available']; ! } ! ! if($posts_per_day > $total_posts) ! { ! $posts_per_day = $total_posts; ! } ! ! if($topics_per_day > $total_topics) ! { ! $topics_per_day = $total_topics; ! } ! ! if($users_per_day > $total_users) ! { ! $users_per_day = $total_users; ! } ! ! // ! // DB size ... MySQL only ! // ! // This code is heavily influenced by a similar routine ! // in phpMyAdmin 2.2.0 ! // ! if( preg_match("/^mysql/", SQL_LAYER) ) ! { ! $sql = "SELECT VERSION() AS mysql_version"; ! if($result = $db->sql_query($sql)) ! { ! $row = $db->sql_fetchrow($result); ! $version = $row['mysql_version']; ! ! if( preg_match("/^(3\.23|4\.|5\.)/", $version) ) ! { ! $db_name = ( preg_match("/^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)|(5\.)/", $version) ) ? "`$dbname`" : $dbname; ! ! $sql = "SHOW TABLE STATUS ! FROM " . $db_name; ! if($result = $db->sql_query($sql)) ! { ! $tabledata_ary = $db->sql_fetchrowset($result); ! ! $dbsize = 0; ! for($i = 0; $i < count($tabledata_ary); $i++) ! { ! if( $tabledata_ary[$i]['Type'] != "MRG_MyISAM" ) ! { ! if( $table_prefix != "" ) ! { ! if( strstr($tabledata_ary[$i]['Name'], $table_prefix) ) ! { ! $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length']; ! } ! } ! else ! { ! $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length']; ! } ! } ! } ! } // Else we couldn't get the table status. ! } ! else ! { ! $dbsize = $lang['Not_available']; ! } ! } ! else ! { ! $dbsize = $lang['Not_available']; ! } ! $db->sql_freeresult($result); ! } ! else if( preg_match("/^mssql/", SQL_LAYER) ) ! { ! $sql = "SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize ! FROM sysfiles"; ! if( $result = $db->sql_query($sql) ) ! { ! $dbsize = ( $row = $db->sql_fetchrow($result) ) ? intval($row['dbsize']) : $lang['Not_available']; ! } ! else ! { ! $dbsize = $lang['Not_available']; ! } ! $db->sql_freeresult($result); ! } ! else ! { ! $dbsize = $lang['Not_available']; ! } ! ! if ( is_integer($dbsize) ) ! { ! if( $dbsize >= 1048576 ) ! { ! $dbsize = sprintf("%.2f MB", ( $dbsize / 1048576 )); ! } ! else if( $dbsize >= 1024 ) ! { ! $dbsize = sprintf("%.2f KB", ( $dbsize / 1024 )); ! } ! else ! { ! $dbsize = sprintf("%.2f Bytes", $dbsize); ! } ! } ! ! $template->assign_vars(array( ! "NUMBER_OF_POSTS" => $total_posts, ! "NUMBER_OF_TOPICS" => $total_topics, ! "NUMBER_OF_USERS" => $total_users, ! "START_DATE" => $start_date, ! "POSTS_PER_DAY" => $posts_per_day, ! "TOPICS_PER_DAY" => $topics_per_day, ! "USERS_PER_DAY" => $users_per_day, ! "AVATAR_DIR_SIZE" => $avatar_dir_size, ! "DB_SIZE" => $dbsize, ! "GZIP_COMPRESSION" => ( $board_config['gzip_compress'] ) ? $lang['ON'] : $lang['OFF']) ! ); ! // ! // End forum statistics ! // ! break; ! } // // Get users online information. // ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! case 'phpbb2': ! $sql = "SELECT u.*, s.* ! FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE . " s ! WHERE s.session_logged_in = " . TRUE . " ! AND u.user_id = s.session_user_id ! AND u.user_id <> " . ANONYMOUS . " ! AND s.session_time >= " . ( time() - 300 ) . " ! ORDER BY u.user_session_time DESC"; ! break; ! case 'phpbb3': ! $sql = "SELECT u.*, s.*, s.session_time AS user_session_time ! FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE . " s ! WHERE u.user_id <> " . ANONYMOUS . " ! AND u.user_id = s.session_user_id ! AND s.session_time >= " . ( time() - 300 ) . " ! ORDER BY s.session_time DESC"; ! break; ! } if(!$result = $db->sql_query($sql)) --- 311,320 ---- ); ! $mx_backend->load_forum_stats(); // // Get users online information. // ! $sql = $mx_backend->generate_session_online_sql(); if(!$result = $db->sql_query($sql)) *************** *** 614,639 **** mx_message_die(GENERAL_ERROR, "Couldn't obtain regd user/online information.", "", __LINE__, __FILE__, $sql); } $onlinerow_reg = $db->sql_fetchrowset($result); $db->sql_freeresult($result); ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! case 'phpbb2': ! $sql = "SELECT * ! FROM " . SESSIONS_TABLE . " ! WHERE session_logged_in = 0 ! AND session_time >= " . ( time() - 300 ) . " ! ORDER BY session_time DESC"; ! break; ! case 'phpbb3': ! $sql = "SELECT u.*, s.* ! FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE . " s ! WHERE u.user_id = " . ANONYMOUS . " ! AND u.user_id = s.session_user_id ! AND s.session_time >= " . ( time() - 300 ) . " ! ORDER BY s.session_time DESC"; ! break; ! } if(!$result = $db->sql_query($sql)) { --- 322,331 ---- mx_message_die(GENERAL_ERROR, "Couldn't obtain regd user/online information.", "", __LINE__, __FILE__, $sql); } + $onlinerow_reg = $db->sql_fetchrowset($result); $db->sql_freeresult($result); ! $sql = $mx_backend->generate_session_online_sql(true); ! if(!$result = $db->sql_query($sql)) { *************** *** 643,678 **** $db->sql_freeresult($result); - - switch (PORTAL_BACKEND) - { - case 'internal': - break; - - case 'phpbb2': - - $sql = "SELECT forum_name, forum_id - FROM " . FORUMS_TABLE; - - if($forums_result = $db->sql_query($sql)) - { - while($forumsrow = $db->sql_fetchrow($forums_result)) - { - $forum_data[$forumsrow['forum_id']] = $forumsrow['forum_name']; - } - } - else - { - mx_message_die(GENERAL_ERROR, "Couldn't obtain user/online forums information.", "", __LINE__, __FILE__, $sql); - } - - $db->sql_freeresult($result); - break; - - case 'phpbb3': - // To-do - break; - - } - $reg_userid_ary = array(); --- 335,338 ---- *************** *** 720,745 **** $location_url = "index.$phpEx?pane=right"; break; - case PAGE_PROFILE: - $location = $lang['Viewing_profile']; - $location_url = "index.$phpEx?pane=right"; - break; - case PAGE_VIEWONLINE: - $location = $lang['Viewing_online']; - $location_url = "index.$phpEx?pane=right"; - break; - case PAGE_VIEWMEMBERS: - $location = $lang['Viewing_member_list']; - $location_url = "index.$phpEx?pane=right"; - break; - case PAGE_PRIVMSGS: - $location = $lang['Viewing_priv_msgs']; - $location_url = "index.$phpEx?pane=right"; - break; - case PAGE_FAQ: - $location = $lang['Viewing_FAQ']; - $location_url = "index.$phpEx?pane=right"; - break; default: - //+MOD: ViewOnline extension for MX-Publisher Pages $mx_viewonline_info = mx_get_viewonline_info($onlinerow_reg[$i]['user_session_page']); if( $mx_viewonline_info !== false ) --- 380,384 ---- *************** *** 748,759 **** break; } - //-MOD: ViewOnline extension for MX-Publisher Pages - $location = $lang['Forum_index']; - $location_url = "index.$phpEx?pane=right"; } } else { - //+MOD: ViewOnline extension for MX-Publisher Pages $mx_viewonline_info = mx_get_viewonline_info($onlinerow_reg[$i]['user_session_page']); if( $mx_viewonline_info !== false ) --- 387,394 ---- *************** *** 762,785 **** break; } - //-MOD: ViewOnline extension for MX-Publisher Pages - $location_url = mx_append_sid(PHPBB_URL . "admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=" . $onlinerow_reg[$i]['user_session_page']); - $location = $forum_data[$onlinerow_reg[$i]['user_session_page']]; } $row_color = ( $registered_users % 2 ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( $registered_users % 2 ) ? $theme['td_class1'] : $theme['td_class2']; - - switch (PORTAL_BACKEND) - { - case 'internal': - case 'phpbb2': - $reg_ip = $phpBB2->decode_ip($onlinerow_reg[$i]['session_ip']); - break; - - case 'phpbb3': - $reg_ip = $onlinerow_reg[$i]['session_ip']; - break; ! } $template->assign_block_vars("reg_user_row", array( --- 397,406 ---- break; } } $row_color = ( $registered_users % 2 ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( $registered_users % 2 ) ? $theme['td_class1'] : $theme['td_class2']; ! $reg_ip = $mx_backend->decode_ip($onlinerow_reg[$i]['session_ip']); $template->assign_block_vars("reg_user_row", array( *************** *** 787,792 **** "ROW_CLASS" => $row_class, "USERNAME" => $username, ! "STARTED" => $phpBB2->create_date($board_config['default_dateformat'], $onlinerow_reg[$i]['session_start'], $board_config['board_timezone']), ! "LASTUPDATE" => $phpBB2->create_date($board_config['default_dateformat'], $onlinerow_reg[$i]['user_session_time'], $board_config['board_timezone']), "FORUM_LOCATION" => $location, "IP_ADDRESS" => $reg_ip, --- 408,413 ---- "ROW_CLASS" => $row_class, "USERNAME" => $username, ! "STARTED" => phpBB2::create_date($board_config['default_dateformat'], $onlinerow_reg[$i]['session_start'], $board_config['board_timezone']), ! "LASTUPDATE" => phpBB2::create_date($board_config['default_dateformat'], $onlinerow_reg[$i]['user_session_time'], $board_config['board_timezone']), "FORUM_LOCATION" => $location, "IP_ADDRESS" => $reg_ip, *************** *** 838,863 **** $location_url = "index.$phpEx?pane=right"; break; - case PAGE_PROFILE: - $location = $lang['Viewing_profile']; - $location_url = "index.$phpEx?pane=right"; - break; - case PAGE_VIEWONLINE: - $location = $lang['Viewing_online']; - $location_url = "index.$phpEx?pane=right"; - break; - case PAGE_VIEWMEMBERS: - $location = $lang['Viewing_member_list']; - $location_url = "index.$phpEx?pane=right"; - break; - case PAGE_PRIVMSGS: - $location = $lang['Viewing_priv_msgs']; - $location_url = "index.$phpEx?pane=right"; - break; - case PAGE_FAQ: - $location = $lang['Viewing_FAQ']; - $location_url = "index.$phpEx?pane=right"; - break; default: - //+MOD: ViewOnline extension for MX-Publisher Pages $mx_viewonline_info = mx_get_viewonline_info($onlinerow_guest[$i]['session_page']); if( $mx_viewonline_info !== false ) --- 459,463 ---- *************** *** 866,895 **** break; } - //-MOD: ViewOnline extension for MX-Publisher Pages - $location = $lang['Forum_index']; - $location_url = "index.$phpEx?pane=right"; } } - else - { - $location_url = mx_append_sid(PHPBB_URL . "admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=" . $onlinerow_guest[$i]['session_page']); - $location = $forum_data[$onlinerow_guest[$i]['session_page']]; - } $row_color = ( $guest_users % 2 ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( $guest_users % 2 ) ? $theme['td_class1'] : $theme['td_class2']; - - switch (PORTAL_BACKEND) - { - case 'internal': - case 'phpbb2': - $guest_ip = $phpBB2->decode_ip($onlinerow_guest[$i]['session_ip']); - break; ! case 'phpbb3': ! $guest_ip = $onlinerow_guest[$i]['session_ip']; ! break; ! ! } $template->assign_block_vars("guest_user_row", array( --- 466,476 ---- break; } } } $row_color = ( $guest_users % 2 ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( $guest_users % 2 ) ? $theme['td_class1'] : $theme['td_class2']; ! $guest_ip = $mx_backend->decode_ip($onlinerow_guest[$i]['session_ip']); $template->assign_block_vars("guest_user_row", array( *************** *** 897,902 **** "ROW_CLASS" => $row_class, "USERNAME" => $lang['Guest'], ! "STARTED" => $phpBB2->create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_start'], $board_config['board_timezone']), ! "LASTUPDATE" => $phpBB2->create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_time'], $board_config['board_timezone']), "FORUM_LOCATION" => $location, "IP_ADDRESS" => $guest_ip, --- 478,483 ---- "ROW_CLASS" => $row_class, "USERNAME" => $lang['Guest'], ! "STARTED" => phpBB2::create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_start'], $board_config['board_timezone']), ! "LASTUPDATE" => phpBB2::create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_time'], $board_config['board_timezone']), "FORUM_LOCATION" => $location, "IP_ADDRESS" => $guest_ip, *************** *** 915,1027 **** /* Begin phpBB version check code block */ ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! ! case 'phpbb2': ! ! $current_phpbb_version = explode('.', '2' . $board_config['version']); ! $minor_phpbb_revision = (int) $current_phpbb_version[2]; ! break; ! ! case 'phpbb3': ! ! $current_phpbb_version = explode('.', '' . $board_config['version']); ! $minor_phpbb_revision = (int) $current_phpbb_version[3]; ! break; ! } ! ! $errno = 0; ! $errstr = $phpbb_version_info = ''; ! ! if ($fsock = @fsockopen('www.phpbb.com', 80, $errno, $errstr, 10)) ! { ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! ! break; ! ! case 'phpbb2': ! ! @fputs($fsock, "GET /updatecheck/20x.txt HTTP/1.1\r\n"); ! @fputs($fsock, "HOST: www.phpbb.com\r\n"); ! @fputs($fsock, "Connection: close\r\n\r\n"); ! ! $get_info = false; ! while (!@feof($fsock)) ! { ! if ($get_info) ! { ! $phpbb_version_info .= @fread($fsock, 1024); ! } ! else ! { ! if (@fgets($fsock, 1024) == "\r\n") ! { ! $get_info = true; ! } ! } ! } ! @fclose($fsock); ! $phpbb_version_info = explode("\n", $phpbb_version_info); ! $latest_phpbb_head_revision = (int) $phpbb_version_info[0]; ! $latest_phpbb_minor_revision = (int) $phpbb_version_info[2]; ! $latest_phpbb_version = (int) $phpbb_version_info[0] . '.' . (int) $phpbb_version_info[1] . '.' . (int) $phpbb_version_info[2]; ! ! if ($latest_phpbb_head_revision == 2 && $minor_phpbb_revision == $latest_phpbb_minor_revision) ! { ! $phpbb_version_info = '<p style="color:green">' . $lang['Version_up_to_date'] . '</p>'; ! } ! else ! { ! $phpbb_version_info = '<p style="color:red">' . $lang['Version_not_up_to_date']; ! $phpbb_version_info .= '<br />' . sprintf($lang['Latest_version_info'], $latest_phpbb_version) . sprintf($lang['Current_version_info'], '2' . $board_config['version']) . '</p>'; ! } ! break; ! ! case 'phpbb3': ! ! $phpbb_version_info = mx_get_remote_file('www.phpbb.com', '/updatecheck', ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno); ! if ($info === false) ! { ! trigger_error($errstr, E_USER_WARNING); ! } ! ! $phpbb_version_info = explode("\n", $phpbb_version_info); ! ! $announcement_url = trim($info[1]); ! //$update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update'); ! $latest_phpbb_head_revision = trim($phpbb_version_info[0]); ! $latest_phpbb_minor_revision = trim($phpbb_version_info[2]); ! $latest_phpbb_version = trim($phpbb_version_info[0]) . '.' . trim($phpbb_version_info[1]) . '.' . trim($phpbb_version_info[2]); ! ! if ($latest_phpbb_head_revision == 3 && $minor_phpbb_revision == $latest_phpbb_minor_revision) ! { ! $phpbb_version_info = '<p style="color:green">' . $lang['Version_up_to_date'] . '</p>'; ! } ! else ! { ! $phpbb_version_info = '<p style="color:red">' . $lang['Version_not_up_to_date']; ! $phpbb_version_info .= '<br />' . sprintf($lang['Latest_version_info'], $latest_phpbb_version) . sprintf($lang['Current_version_info'], $board_config['version']) . '</p>'; ! } ! break; ! } ! } ! else ! { ! if ($errstr) ! { ! $phpbb_version_info = '<p style="color:red">' . sprintf($lang['Connect_socket_error'], $errstr) . '</p>'; ! } ! else ! { ! $phpbb_version_info = '<p>' . $lang['Socket_functions_disabled'] . '</p>'; ! } ! } ! ! $phpbb_version_info .= '<p>' . $lang['Mailing_list_subscribe_reminder'] . '</p>'; ! ! /* End phpBB version check code block */ /* Begin MX-Publisher version check code block */ --- 496,500 ---- /* Begin phpBB version check code block */ ! $phpbb_version_info = $mx_backend->phpbb_version_check(); /* Begin MX-Publisher version check code block */ *************** *** 1086,1091 **** $mxbb_version_info .= '<p>' . $lang['mxBB_Mailing_list_subscribe_reminder'] . '</p>'; - /* End MX-Publisher version check code block */ - $template->assign_vars(array( 'MXBB_VERSION_INFO' => $mxbb_version_info, --- 559,562 ---- Index: page_header_admin.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/page_header_admin.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** page_header_admin.php 4 Oct 2008 07:04:24 -0000 1.29 --- page_header_admin.php 31 Oct 2008 19:02:20 -0000 1.30 *************** *** 80,84 **** 'S_LOGIN_ACTION' => mx_append_sid('../login.'.$phpEx), 'S_JUMPBOX_ACTION' => mx_append_sid('../viewforum.'.$phpEx), ! 'S_CURRENT_TIME' => sprintf($lang['Current_time'], $phpBB2->create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])), 'S_CONTENT_DIRECTION' => $lang['DIRECTION'], 'S_CONTENT_ENCODING' => $lang['ENCODING'], --- 80,84 ---- 'S_LOGIN_ACTION' => mx_append_sid('../login.'.$phpEx), 'S_JUMPBOX_ACTION' => mx_append_sid('../viewforum.'.$phpEx), ! 'S_CURRENT_TIME' => sprintf($lang['Current_time'], phpBB2::create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])), 'S_CONTENT_DIRECTION' => $lang['DIRECTION'], 'S_CONTENT_ENCODING' => $lang['ENCODING'], Index: admin_mx_smilies.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_smilies.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** admin_mx_smilies.php 4 Oct 2008 07:04:24 -0000 1.21 --- admin_mx_smilies.php 31 Oct 2008 19:02:20 -0000 1.22 *************** *** 91,117 **** $smiley_path_url = PHPBB_URL; //change this to PORTAL_URL when shared folder will be removed $smiley_root_path = $phpbb_root_path; //same here ! $fields = 'smilies'; $smiley_url = 'smile_url'; $emotion = 'emoticon'; $table = SMILIES_TABLE; ! $delimeter = '=+:'; break; case 'phpbb2': $smiley_path_url = PHPBB_URL; $smiley_root_path = $phpbb_root_path; ! $fields = 'smilies'; $smiley_url = 'smile_url'; $emotion = 'emoticon'; $table = SMILIES_TABLE; ! $delimeter = '=+:'; break; case 'phpbb3': $smiley_path_url = PHPBB_URL; $smiley_root_path = $phpbb_root_path; ! $fields = 'smiley'; $smiley_url = 'smiley_url'; $emotion = 'emotion'; $table = SMILIES_TABLE; ! $delimeter = ', '; $board_config['smilies_path'] = str_replace("smiles", "smilies", $board_config['smilies_path']); break; --- 91,117 ---- $smiley_path_url = PHPBB_URL; //change this to PORTAL_URL when shared folder will be removed $smiley_root_path = $phpbb_root_path; //same here ! $fields = 'smilies'; $smiley_url = 'smile_url'; $emotion = 'emoticon'; $table = SMILIES_TABLE; ! $delimeter = '=+:'; break; case 'phpbb2': $smiley_path_url = PHPBB_URL; $smiley_root_path = $phpbb_root_path; ! $fields = 'smilies'; $smiley_url = 'smile_url'; $emotion = 'emoticon'; $table = SMILIES_TABLE; ! $delimeter = '=+:'; break; case 'phpbb3': $smiley_path_url = PHPBB_URL; $smiley_root_path = $phpbb_root_path; ! $fields = 'smiley'; $smiley_url = 'smiley_url'; $emotion = 'emotion'; $table = SMILIES_TABLE; ! $delimeter = ', '; $board_config['smilies_path'] = str_replace("smiles", "smilies", $board_config['smilies_path']); break; *************** *** 125,129 **** while($file = @readdir($dir)) { ! if( !@is_dir($phpBB2->phpbb_realpath($smiley_root_path . $board_config['smilies_path'] . '/' . $file)) ) { $img_size = @getimagesize($smiley_root_path . $board_config['smilies_path'] . '/' . $file); --- 125,129 ---- while($file = @readdir($dir)) { ! if( !@is_dir(phpBB2::phpbb_realpath($smiley_root_path . $board_config['smilies_path'] . '/' . $file)) ) { $img_size = @getimagesize($smiley_root_path . $board_config['smilies_path'] . '/' . $file); *************** *** 190,194 **** } } ! $smiley_order = 0; --- 190,194 ---- } } ! $smiley_order = 0; *************** *** 201,205 **** for($i = 0; $i < count($fcontents); $i++) ! { switch (PORTAL_BACKEND) { --- 201,205 ---- for($i = 0; $i < count($fcontents); $i++) ! { switch (PORTAL_BACKEND) { *************** *** 207,221 **** case 'phpbb2': $smile_data = explode($delimeter, trim(addslashes($fcontents[$i]))); ! $count_data = 2; break; case 'phpbb3': $smile_data = explode($delimeter, trim($fcontents[$i])); ! $smile_data = str_replace("'", "", $smile_data); $smile_data = str_replace(",", "", $smile_data); ! $count_data = 5; break; ! } ! for($j = $count_data; $j < count($smile_data); $j++) { --- 207,221 ---- case 'phpbb2': $smile_data = explode($delimeter, trim(addslashes($fcontents[$i]))); ! $count_data = 2; break; case 'phpbb3': $smile_data = explode($delimeter, trim($fcontents[$i])); ! $smile_data = str_replace("'", "", $smile_data); $smile_data = str_replace(",", "", $smile_data); ! $count_data = 5; break; ! } ! for($j = $count_data; $j < count($smile_data); $j++) { *************** *** 226,230 **** $smile_data[$j] = str_replace(">", ">", $smile_data[$j]); $k = $smile_data[$j]; ! // Stripslash here because it got addslashed before... (on export) $smile_url = stripslashes($smile_data[0]); --- 226,230 ---- $smile_data[$j] = str_replace(">", ">", $smile_data[$j]); $k = $smile_data[$j]; ! // Stripslash here because it got addslashed before... (on export) $smile_url = stripslashes($smile_data[0]); *************** *** 237,241 **** $smile_emotion = stripslashes($smile_data[4]); $smile_code = stripslashes($smile_data[5]); ! } if( $smiles[$k] == 1 ) --- 237,241 ---- $smile_emotion = stripslashes($smile_data[4]); $smile_code = stripslashes($smile_data[5]); ! } if( $smiles[$k] == 1 ) *************** *** 249,259 **** $sql = "UPDATE " . $table . " SET smile_url = '" . str_replace("\'", "''", $smile_data[0]) . "', emoticon = '" . str_replace("\'", "''", $smile_data[1]) . "' ! WHERE code = '" . str_replace("\'", "''", $smile_data[$j]) . "'"; ! $result = $db->sql_query($sql); break; case 'phpbb3': $sql = array( ! 'emotion' => $smile_emotion, $fields . '_url' => $smile_url, $fields . '_height' => (int) $smiley_height, --- 249,259 ---- $sql = "UPDATE " . $table . " SET smile_url = '" . str_replace("\'", "''", $smile_data[0]) . "', emoticon = '" . str_replace("\'", "''", $smile_data[1]) . "' ! WHERE code = '" . str_replace("\'", "''", $smile_data[$j]) . "'"; ! $result = $db->sql_query($sql); break; case 'phpbb3': $sql = array( ! 'emotion' => $smile_emotion, $fields . '_url' => $smile_url, $fields . '_height' => (int) $smiley_height, *************** *** 265,271 **** $sql = "UPDATE $table SET " . $db->sql_build_array('UPDATE', $sql) . " WHERE code = '" . $db->sql_escape($smile_code) . "'"; ! $result = $db->sql_query($sql); break; ! } } else --- 265,271 ---- $sql = "UPDATE $table SET " . $db->sql_build_array('UPDATE', $sql) . " WHERE code = '" . $db->sql_escape($smile_code) . "'"; ! $result = $db->sql_query($sql); break; ! } } else *************** *** 282,291 **** $sql = "INSERT INTO " . $table . " (code, smile_url, emoticon) VALUES('" . str_replace("\'", "''", $smile_data[$j]) . "', '" . str_replace("\'", "''", $smile_data[0]) . "', '" . str_replace("\'", "''", $smile_data[1]) . "')"; ! $result = $db->sql_query($sql); break; case 'phpbb3': ++$smiley_order; ! $sql = array( $fields . '_url' => $smile_url, $fields . '_height' => (int) $smiley_height, --- 282,291 ---- $sql = "INSERT INTO " . $table . " (code, smile_url, emoticon) VALUES('" . str_replace("\'", "''", $smile_data[$j]) . "', '" . str_replace("\'", "''", $smile_data[0]) . "', '" . str_replace("\'", "''", $smile_data[1]) . "')"; ! $result = $db->sql_query($sql); break; case 'phpbb3': ++$smiley_order; ! $sql = array( $fields . '_url' => $smile_url, $fields . '_height' => (int) $smiley_height, *************** *** 294,306 **** 'display_on_posting'=> (int) $display_on_posting, ); ! $sql = array_merge($sql, array( 'code' => $smile_code, 'emotion' => $smile_emotion, ! )); ! ! $result = $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql)); break; ! } } --- 294,306 ---- 'display_on_posting'=> (int) $display_on_posting, ); ! $sql = array_merge($sql, array( 'code' => $smile_code, 'emotion' => $smile_emotion, ! )); ! ! $result = $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql)); break; ! } } *************** *** 368,372 **** { //$gen_simple_header = true; ! switch (PORTAL_BACKEND) { --- 368,372 ---- { //$gen_simple_header = true; ! switch (PORTAL_BACKEND) { *************** *** 380,387 **** $sql = 'SELECT * FROM ' . SMILIES_TABLE . ' ! ORDER BY smiley_order'; break; } ! if( !$result = $db->sql_query($sql) ) { --- 380,387 ---- $sql = 'SELECT * FROM ' . SMILIES_TABLE . ' ! ORDER BY smiley_order'; break; } ! if( !$result = $db->sql_query($sql) ) { *************** *** 390,394 **** $resultset = $db->sql_fetchrowset($result); ! $smile_pak = ""; switch (PORTAL_BACKEND) --- 390,394 ---- $resultset = $db->sql_fetchrowset($result); ! $smile_pak = ""; switch (PORTAL_BACKEND) *************** *** 410,417 **** $smile_pak .= "'" . addslashes($resultset[$i][$fields . '_width']) . "'" . $delimeter; $smile_pak .= "'" . addslashes($resultset[$i][$fields . '_height']) . "'" . $delimeter; ! $smile_pak .= "'" . addslashes($resultset[$i]['display_on_posting']) . "'" . $delimeter; $smile_pak .= "'" . addslashes($resultset[$i][$emotion]) . "'" . $delimeter; $smile_pak .= "'" . addslashes($resultset[$i]['code']) . "'" . $delimeter . "\n"; ! } break; } --- 410,417 ---- $smile_pak .= "'" . addslashes($resultset[$i][$fields . '_width']) . "'" . $delimeter; $smile_pak .= "'" . addslashes($resultset[$i][$fields . '_height']) . "'" . $delimeter; ! $smile_pak .= "'" . addslashes($resultset[$i]['display_on_posting']) . "'" . $delimeter; $smile_pak .= "'" . addslashes($resultset[$i][$emotion]) . "'" . $delimeter; $smile_pak .= "'" . addslashes($resultset[$i]['code']) . "'" . $delimeter . "\n"; ! } break; } *************** *** 435,439 **** { mx_message_die(GENERAL_MESSAGE, 'Error'); ! } } $message = sprintf($lang['export_smiles'], "<a href=\"" . mx_append_sid("admin_mx_smilies.$phpEx?export_pack=send", true) . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_smileadmin'], "<a href=\"" . mx_append_sid("admin_mx_smilies.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . mx_append_sid($mx_root_path . "admin/index.$phpEx?pane=right") . "\">", "</a>"); --- 435,439 ---- { mx_message_die(GENERAL_MESSAGE, 'Error'); ! } } $message = sprintf($lang['export_smiles'], "<a href=\"" . mx_append_sid("admin_mx_smilies.$phpEx?export_pack=send", true) . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_smileadmin'], "<a href=\"" . mx_append_sid("admin_mx_smilies.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . mx_append_sid($mx_root_path . "admin/index.$phpEx?pane=right") . "\">", "</a>"); *************** *** 469,484 **** "L_WIDTH" => $lang['Width'], "L_HEIGHT" => $lang['Height'], ! "L_ORDER" => $lang['Order'], "L_SUBMIT" => $lang['Submit'], "L_RESET" => $lang['Reset'], ! "SMILEY_IMG" => $smiley_root_path . $board_config['smilies_path'] . '/' . $smiley_images[0], ! 'SMILEY_WIDTH' => (PORTAL_BACKEND === 'phpbb3') ? '' : '', 'SMILEY_HEIGHT' => (PORTAL_BACKEND === 'phpbb3') ? '' : '', 'SMILEY_ORDER' => (PORTAL_BACKEND === 'phpbb3') ? '' : '', ! 'POSTING_CHECKED' => ($mx_request_vars->is_request('add')) ? ' checked="checked"' : '', ! "S_SMILEY_ACTION" => mx_append_sid("admin_mx_smilies.$phpEx"), --- 469,484 ---- "L_WIDTH" => $lang['Width'], "L_HEIGHT" => $lang['Height'], ! "L_ORDER" => $lang['Order'], "L_SUBMIT" => $lang['Submit'], "L_RESET" => $lang['Reset'], ! "SMILEY_IMG" => $smiley_root_path . $board_config['smilies_path'] . '/' . $smiley_images[0], ! 'SMILEY_WIDTH' => (PORTAL_BACKEND === 'phpbb3') ? '' : '', 'SMILEY_HEIGHT' => (PORTAL_BACKEND === 'phpbb3') ? '' : '', 'SMILEY_ORDER' => (PORTAL_BACKEND === 'phpbb3') ? '' : '', ! 'POSTING_CHECKED' => ($mx_request_vars->is_request('add')) ? ' checked="checked"' : '', ! "S_SMILEY_ACTION" => mx_append_sid("admin_mx_smilies.$phpEx"), *************** *** 486,490 **** "S_FILENAME_OPTIONS" => $filename_list, "S_SMILEY_BASEDIR" => $smiley_root_path . $board_config['smilies_path']) ! ); $template->pparse("body"); --- 486,490 ---- "S_FILENAME_OPTIONS" => $filename_list, "S_SMILEY_BASEDIR" => $smiley_root_path . $board_config['smilies_path']) ! ); $template->pparse("body"); *************** *** 540,549 **** case 'edit': // ! // Admin has selected to edit a smiley. // $smiley_id = $mx_request_vars->request('id', MX_TYPE_INT); $sql = "SELECT * FROM " . $table . " ! WHERE {$fields}_id = " . $smiley_id; $result = $db->sql_query($sql); --- 540,549 ---- case 'edit': // ! // Admin has selected to edit a smiley. // $smiley_id = $mx_request_vars->request('id', MX_TYPE_INT); $sql = "SELECT * FROM " . $table . " ! WHERE {$fields}_id = " . $smiley_id; $result = $db->sql_query($sql); *************** *** 581,590 **** 'SMILEY_EMOTICON' => addslashes($smile_data[$emotion]), 'S_ID' => (isset($smile_data[$fields . '_id'])) ? true : false, ! 'ID' => (isset($smile_data[$fields . '_id'])) ? $smile_data[$fields . '_id'] : 0, 'SMILEY_WIDTH' => (PORTAL_BACKEND === 'phpbb3') ? $smile_data['smiley_width'] : '', 'SMILEY_HEIGHT' => (PORTAL_BACKEND === 'phpbb3') ? $smile_data['smiley_height'] : '', 'SMILEY_ORDER' => (PORTAL_BACKEND === 'phpbb3') ? $smile_data['smiley_order'] : '', ! 'POSTING_CHECKED' => (!empty($smile_data['display_on_posting']) || $mx_request_vars->is_request('add')) ? ' checked="checked"' : '', "L_SMILEY_TITLE" => $lang['smiley_title'], --- 581,590 ---- 'SMILEY_EMOTICON' => addslashes($smile_data[$emotion]), 'S_ID' => (isset($smile_data[$fields . '_id'])) ? true : false, ! 'ID' => (isset($smile_data[$fields . '_id'])) ? $smile_data[$fields . '_id'] : 0, 'SMILEY_WIDTH' => (PORTAL_BACKEND === 'phpbb3') ? $smile_data['smiley_width'] : '', 'SMILEY_HEIGHT' => (PORTAL_BACKEND === 'phpbb3') ? $smile_data['smiley_height'] : '', 'SMILEY_ORDER' => (PORTAL_BACKEND === 'phpbb3') ? $smile_data['smiley_order'] : '', ! 'POSTING_CHECKED' => (!empty($smile_data['display_on_posting']) || $mx_request_vars->is_request('add')) ? ' checked="checked"' : '', "L_SMILEY_TITLE" => $lang['smiley_title'], *************** *** 596,600 **** "L_WIDTH" => $lang['Width'], "L_HEIGHT" => $lang['Height'], ! "L_ORDER" => $lang['Order'], "L_SUBMIT" => $lang['Submit'], "L_RESET" => $lang['Reset'], --- 596,600 ---- "L_WIDTH" => $lang['Width'], "L_HEIGHT" => $lang['Height'], ! "L_ORDER" => $lang['Order'], "L_SUBMIT" => $lang['Submit'], "L_RESET" => $lang['Reset'], *************** *** 622,638 **** $smile_code = $mx_request_vars->post('smile_code'); $smile_url = $mx_request_vars->post('smile_url', MX_TYPE_NO_TAGS); ! $smile_url = $phpBB2->phpbb_ltrim(basename($smile_url), "'"); $smile_emotion = $mx_request_vars->post('smile_emotion', MX_TYPE_NO_HTML); $smile_id = $mx_request_vars->post('smile_id', MX_TYPE_INT, 0); $smile_code = trim($smile_code); $smile_url = trim($smile_url); ! ! if (PORTAL_BACKEND === 'phpbb3') { $smiley_width = $mx_request_vars->post('smile_width', MX_TYPE_NO_HTML); $smiley_height = $mx_request_vars->post('smile_height', MX_TYPE_NO_HTML); $smiley_order = $mx_request_vars->post('smile_order', MX_TYPE_NO_HTML); ! } ! // If no code was entered complain ... --- 622,638 ---- $smile_code = $mx_request_vars->post('smile_code'); $smile_url = $mx_request_vars->post('smile_url', MX_TYPE_NO_TAGS); ! $smile_url = phpBB2::phpbb_ltrim(basename($smile_url), "'"); $smile_emotion = $mx_request_vars->post('smile_emotion', MX_TYPE_NO_HTML); $smile_id = $mx_request_vars->post('smile_id', MX_TYPE_INT, 0); $smile_code = trim($smile_code); $smile_url = trim($smile_url); ! ! if (PORTAL_BACKEND === 'phpbb3') { $smiley_width = $mx_request_vars->post('smile_width', MX_TYPE_NO_HTML); $smiley_height = $mx_request_vars->post('smile_height', MX_TYPE_NO_HTML); $smiley_order = $mx_request_vars->post('smile_order', MX_TYPE_NO_HTML); ! } ! // If no code was entered complain ... *************** *** 657,666 **** $sql = "UPDATE " . $table . " SET code = '" . str_replace("\'", "''", $smile_code) . "', smile_url = '" . str_replace("\'", "''", $smile_url) . "', emoticon = '" . str_replace("\'", "''", $smile_emotion) . "' ! WHERE smilies_id = $smile_id"; break; case 'phpbb3': $sql = array( ! 'emotion' => $smile_emotion, $fields . '_url' => $smile_url, $fields . '_height' => (int) $smiley_height, --- 657,666 ---- $sql = "UPDATE " . $table . " SET code = '" . str_replace("\'", "''", $smile_code) . "', smile_url = '" . str_replace("\'", "''", $smile_url) . "', emoticon = '" . str_replace("\'", "''", $smile_emotion) . "' ! WHERE smilies_id = $smile_id"; break; case 'phpbb3': $sql = array( ! 'emotion' => $smile_emotion, $fields . '_url' => $smile_url, $fields . '_height' => (int) $smiley_height, *************** *** 671,677 **** $sql = "UPDATE $table SET " . $db->sql_build_array('UPDATE', $sql) . " ! WHERE code = '" . $db->sql_escape($smile_code) . "'"; break; ! } if( !($result = $db->sql_query($sql)) ) --- 671,677 ---- $sql = "UPDATE $table SET " . $db->sql_build_array('UPDATE', $sql) . " ! WHERE code = '" . $db->sql_escape($smile_code) . "'"; break; ! } if( !($result = $db->sql_query($sql)) ) *************** *** 696,705 **** $smile_code = $mx_request_vars->post('smile_code'); $smile_url = $mx_request_vars->post('smile_url'); ! $smile_url = $phpBB2->phpbb_ltrim(basename($smile_url), "'"); $smile_emotion = $mx_request_vars->post('smile_emotion', MX_TYPE_NO_HTML); $smile_code = trim($smile_code); $smile_url = trim($smile_url); ! ! if (PORTAL_BACKEND === 'phpbb3') { $smiley_width = $mx_request_vars->post('smile_width', MX_TYPE_NO_HTML); --- 696,705 ---- $smile_code = $mx_request_vars->post('smile_code'); $smile_url = $mx_request_vars->post('smile_url'); ! $smile_url = phpBB2::phpbb_ltrim(basename($smile_url), "'"); $smile_emotion = $mx_request_vars->post('smile_emotion', MX_TYPE_NO_HTML); $smile_code = trim($smile_code); $smile_url = trim($smile_url); ! ! if (PORTAL_BACKEND === 'phpbb3') { $smiley_width = $mx_request_vars->post('smile_width', MX_TYPE_NO_HTML); *************** *** 707,711 **** $smiley_order = $mx_request_vars->post('smile_order', MX_TYPE_NO_HTML); $display_on_posting = $mx_request_vars->request('display', MX_TYPE_INT, 1); ! } // If no code was entered complain ... --- 707,711 ---- $smiley_order = $mx_request_vars->post('smile_order', MX_TYPE_NO_HTML); $display_on_posting = $mx_request_vars->request('display', MX_TYPE_INT, 1); ! } // If no code was entered complain ... *************** *** 730,734 **** $sql = "INSERT INTO " . $table . " (code, smile_url, emoticon) VALUES ('" . str_replace("\'", "''", $smile_code) . "', '" . str_replace("\'", "''", $smile_url) . "', '" . str_replace("\'", "''", $smile_emotion) . "')"; ! $result = $db->sql_query($sql); break; --- 730,734 ---- $sql = "INSERT INTO " . $table . " (code, smile_url, emoticon) VALUES ('" . str_replace("\'", "''", $smile_code) . "', '" . str_replace("\'", "''", $smile_url) . "', '" . str_replace("\'", "''", $smile_emotion) . "')"; ! $result = $db->sql_query($sql); break; *************** *** 736,740 **** $sql = array( 'code' => $smile_code, ! 'emotion' => $smile_emotion, $fields . '_url' => $smile_url, $fields . '_height' => (int) $smiley_height, --- 736,740 ---- $sql = array( 'code' => $smile_code, ! 'emotion' => $smile_emotion, $fields . '_url' => $smile_url, $fields . '_height' => (int) $smiley_height, *************** *** 743,751 **** 'display_on_posting'=> (int) $display_on_posting, ); ! $result = $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql)); break; ! } - if( !$result ) { --- 743,751 ---- 'display_on_posting'=> (int) $display_on_posting, ); ! $result = $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql)); break; ! } ! if( !$result ) { *************** *** 774,785 **** $result = $db->sql_query($sql); break; ! case 'phpbb3': $sql = 'SELECT * FROM ' . $table . ' ORDER BY smiley_order'; ! $result = $db->sql_query($sql); break; ! } if( !$result ) { --- 774,785 ---- $result = $db->sql_query($sql); break; ! case 'phpbb3': $sql = 'SELECT * FROM ' . $table . ' ORDER BY smiley_order'; ! $result = $db->sql_query($sql); break; ! } if( !$result ) { *************** *** 804,808 **** 'L_WIDTH' => $lang['Width'], 'L_HEIGHT' => $lang['Height'], ! 'L_ORDER' => $lang['Order'], "L_SMILE" => $lang['Smile'], "L_IMPORT_PACK" => $lang['import_smile_pack'], --- 804,808 ---- 'L_WIDTH' => $lang['Width'], 'L_HEIGHT' => $lang['Height'], ! 'L_ORDER' => $lang['Order'], "L_SMILE" => $lang['Smile'], "L_IMPORT_PACK" => $lang['import_smile_pack'], *************** *** 834,841 **** "CODE" => $smilies[$i]['code'], "EMOT" => $smilies[$i][$emotion], ! 'WIDTH' => (PORTAL_BACKEND === 'phpbb3') ? $smilies[$i]['smiley_width'] : '', 'HEIGHT' => (PORTAL_BACKEND === 'phpbb3') ? $smilies[$i]['smiley_height'] : '', ! 'ORDER' => (PORTAL_BACKEND === 'phpbb3') ? $smilies[$i]['smiley_order'] : '', "U_SMILEY_EDIT" => mx_append_sid("admin_mx_smilies.$phpEx?mode=edit&id=" . $smilies[$i][$fields . '_id']), --- 834,841 ---- "CODE" => $smilies[$i]['code'], "EMOT" => $smilies[$i][$emotion], ! 'WIDTH' => (PORTAL_BACKEND === 'phpbb3') ? $smilies[$i]['smiley_width'] : '', 'HEIGHT' => (PORTAL_BACKEND === 'phpbb3') ? $smilies[$i]['smiley_height'] : '', ! 'ORDER' => (PORTAL_BACKEND === 'phpbb3') ? $smilies[$i]['smiley_order'] : '', "U_SMILEY_EDIT" => mx_append_sid("admin_mx_smilies.$phpEx?mode=edit&id=" . $smilies[$i][$fields . '_id']), Index: admin_mx_styles.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_styles.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** admin_mx_styles.php 4 Oct 2008 07:04:24 -0000 1.8 --- admin_mx_styles.php 31 Oct 2008 19:02:20 -0000 1.9 *************** *** 97,103 **** while( $sub_dir = @readdir($dir) ) { ! if( !is_file($phpBB2->phpbb_realpath($mx_root_path . 'templates/' .$sub_dir)) && !is_link($phpBB2->phpbb_realpath($mx_root_path . 'templates/' .$sub_dir)) && $sub_dir != "." && $sub_dir != ".." && $sub_dir != "CVS" ) { ! if( @file_exists(@$phpBB2->phpbb_realpath($mx_root_path. "templates/" . $sub_dir . "/$sub_dir.cfg")) ) { @include($mx_root_path. "templates/" . $sub_dir . "/$sub_dir.cfg"); --- 97,103 ---- while( $sub_dir = @readdir($dir) ) { ! if( !is_file(phpBB2::phpbb_realpath($mx_root_path . 'templates/' .$sub_dir)) && !is_link(phpBB2::phpbb_realpath($mx_root_path . 'templates/' .$sub_dir)) && $sub_dir != "." && $sub_dir != ".." && $sub_dir != "CVS" ) { ! if( @file_exists(@phpBB2::phpbb_realpath($mx_root_path. "templates/" . $sub_dir . "/$sub_dir.cfg")) ) { @include($mx_root_path. "templates/" . $sub_dir . "/$sub_dir.cfg"); Index: page_footer_admin.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/page_footer_admin.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** page_footer_admin.php 4 Feb 2008 15:44:45 -0000 1.19 --- page_footer_admin.php 31 Oct 2008 19:02:20 -0000 1.20 *************** *** 28,45 **** $stime = ( $endtime[1] + $endtime[0] ) - $mx_starttime; ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! ! case 'phpbb2': ! ! $current_phpbb_version = '2' . $board_config['version']; ! break; ! ! case 'phpbb3': ! ! $current_phpbb_version = $board_config['version']; ! break; ! } $execution_stats = sprintf($lang['Execution_Stats'], $db->num_queries, round($stime, 4)); --- 28,32 ---- $stime = ( $endtime[1] + $endtime[0] ) - $mx_starttime; ! $current_phpbb_version -> $mx_backend->get_phpbb_version(); $execution_stats = sprintf($lang['Execution_Stats'], $db->num_queries, round($stime, 4)); Index: pagestart.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/pagestart.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** pagestart.php 15 Jul 2008 22:02:43 -0000 1.39 --- pagestart.php 31 Oct 2008 19:02:20 -0000 1.40 *************** *** 39,51 **** $mx_user->init($user_ip, PAGE_INDEX); - // - // Temp fix for loading the olympus stylish adminCP - // - if (PORTAL_BACKEND == 'phpbb3') - { - $phpbb_auth->acl($mx_user->data); - $mx_user->setup('acp/common', false); //Include phpBB3 AdminCP common language file - } - if ( !$userdata['session_logged_in'] ) { --- 39,42 ---- *************** *** 58,91 **** } ! //Do we realy need this? ! switch (PORTAL_BACKEND) { ! case 'internal': ! case 'phpbb2': ! if ($mx_request_vars->get('sid', MX_TYPE_NO_TAGS) != $userdata['session_id']) ! { ! $url = str_replace(preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name'])), '', $_SERVER['REQUEST_URI']); ! $url = str_replace(preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path'])), '', $url); ! $url = str_replace('//', '/', $url); ! $url = preg_replace('/sid=([^&]*)(&?)/i', '', $url); ! $url = preg_replace('/\?$/', '', $url); ! $url .= ((strpos($url, '?')) ? '&' : '?') . 'sid=' . $userdata['session_id']; ! ! mx_redirect($url); ! } ! break; ! case 'phpbb3': ! if ($mx_request_vars->get('sid', MX_TYPE_NO_TAGS) != $mx_user->session_id) ! { ! $url = str_replace(preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name'])), '', $_SERVER['REQUEST_URI']); ! $url = str_replace(preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path'])), '', $url); ! $url = str_replace('//', '/', $url); ! $url = preg_replace('/sid=([^&]*)(&?)/i', '', $url); ! $url = preg_replace('/\?$/', '', $url); ! $url .= ((strpos($url, '?')) ? '&' : '?') . 'sid=' . $mx_user->session_id; ! mx_redirect($url); ! } ! break; } --- 49,63 ---- } ! // Ensure $mx_user->session_id is populated... ! if ($mx_request_vars->get('sid', MX_TYPE_NO_TAGS) != $mx_user->session_id) { ! $url = str_replace(preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name'])), '', $_SERVER['REQUEST_URI']); ! $url = str_replace(preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path'])), '', $url); ! $url = str_replace('//', '/', $url); ! $url = preg_replace('/sid=([^&]*)(&?)/i', '', $url); ! $url = preg_replace('/\?$/', '', $url); ! $url .= ((strpos($url, '?')) ? '&' : '?') . 'sid=' . $mx_user->session_id; ! mx_redirect($url); } Index: admin_mx_portal.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_portal.php,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** admin_mx_portal.php 6 Oct 2008 04:37:41 -0000 1.47 --- admin_mx_portal.php 31 Oct 2008 19:02:20 -0000 1.48 *************** *** 93,97 **** $new['smtp_username'] = $mx_request_vars->post('smtp_username', MX_TYPE_NO_TAGS, '0'); $new['smtp_password'] = $mx_request_vars->post('smtp_password', MX_TYPE_NO_TAGS, '0'); ! $sql = "UPDATE " . PORTAL_TABLE . " SET " . $db->sql_build_array('UPDATE', utf8_normalize_nfc($new)); --- 93,97 ---- $new['smtp_username'] = $mx_request_vars->post('smtp_username', MX_TYPE_NO_TAGS, '0'); $new['smtp_password'] = $mx_request_vars->post('smtp_password', MX_TYPE_NO_TAGS, '0'); ! $sql = "UPDATE " . PORTAL_TABLE . " SET " . $db->sql_build_array('UPDATE', utf8_normalize_nfc($new)); *************** *** 101,105 **** mx_message_die(GENERAL_ERROR, "Failed to update portal configuration ", "", __LINE__, __FILE__, $sql); } ! $message = update_portal_backend($new['portal_backend']) ? "The CMS configuration file was upgraded ...<br /><br />" : update_portal_backend($new['portal_backend']); --- 101,105 ---- mx_message_die(GENERAL_ERROR, "Failed to update portal configuration ", "", __LINE__, __FILE__, $sql); } ! $message = update_portal_backend($new['portal_backend']) ? "The CMS configuration file was upgraded ...<br /><br />" : update_portal_backend($new['portal_backend']); *************** *** 107,111 **** $message .= $lang['Portal_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_portal_config'], "<a href=\"" . mx_append_sid("admin_mx_portal.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . mx_append_sid("index.$phpEx?pane=right") . "\">", "</a>"); ! mx_message_die(GENERAL_MESSAGE, $message); } --- 107,111 ---- $message .= $lang['Portal_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_portal_config'], "<a href=\"" . mx_append_sid("admin_mx_portal.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . mx_append_sid("index.$phpEx?pane=right") . "\">", "</a>"); ! mx_message_die(GENERAL_MESSAGE, $message); } *************** *** 128,150 **** $timezone_select = mx_tz_select($portal_config['board_timezone'], 'board_timezone'); ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! ! case 'phpbb2': ! ! $current_phpbb_version = '2' . $board_config['version']; ! break; ! ! case 'phpbb3': ! ! $current_phpbb_version = $board_config['version']; ! break; ! } // // Valid portal backend // ! $valid_backend_text = PORTAL_BACKEND == $portal_config['portal_backend'] ? $lang['Portal_config_valid_true'] : $lang['Portal_config_valid_false']; $template->assign_vars(array( --- 128,137 ---- $timezone_select = mx_tz_select($portal_config['board_timezone'], 'board_timezone'); ! $current_phpbb_version = $mx_backend->get_phpbb_version(); // Empty if mxp is used standalone // // Valid portal backend // ! $valid_backend_text = $mx_backend->confirm_backend() ? $lang['Portal_config_valid_true'] : $lang['Portal_config_valid_false']; $template->assign_vars(array( *************** *** 374,400 **** "PORTAL_VERSION" => $portal_config['portal_version'], ! // ! // Old ! // ! //"L_PORTAL_URL" => $lang['Portal_Url'] . "<br />" . $lang['Portal_url_explain'], ! //"L_PORTAL_PHPBB_URL" => $lang['Portal_PHPBB_Url'] . "<br />" . $lang['Phpbb_url_explain'], ! //"PORTAL_URL" => $portal_config['portal_url'], ! //"PORTAL_PHPBB_URL" => $portal_config['portal_phpbb_url'], ! ! 'PHPBB_BACKEND' => PORTAL_BACKEND != 'internal', )); - switch (PORTAL_BACKEND) - { - case 'internal': - break; - - case 'phpbb2': - case 'phpbb3': - $template->assign_block_vars('phpbb_backend', array()); - break; - } - $template->pparse('admin_portal'); include_once('page_footer_admin.' . $phpEx); --- 361,368 ---- "PORTAL_VERSION" => $portal_config['portal_version'], ! 'PHPBB_BACKEND' => !empty($mx_backend->get_phpbb_version()), )); $template->pparse('admin_portal'); include_once('page_footer_admin.' . $phpEx); |