Update of /cvsroot/mxbb/core/includes In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32488/includes Modified Files: mx_functions_bbcode.php mx_functions_core.php mx_functions_emailer.php mx_functions_style.php mx_functions_tools.php page_header.php Log Message: some fixes to the internal BACKEND, plus some support for other backends compatible in the future versions Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.139 retrieving revision 1.140 diff -C2 -d -r1.139 -r1.140 *** mx_functions_core.php 4 Jul 2013 00:26:48 -0000 1.139 --- mx_functions_core.php 9 May 2014 07:51:42 -0000 1.140 *************** *** 105,109 **** // Get MX-Publisher config settings $portal_config = $this->obtain_mxbb_config(); ! // Check some vars if (!$portal_config['portal_version']) --- 105,109 ---- // Get MX-Publisher config settings $portal_config = $this->obtain_mxbb_config(); ! //print_r($portal_config); // Check some vars if (!$portal_config['portal_version']) *************** *** 1907,1910 **** --- 1907,1912 ---- global $userdata, $lang; + $is_admin = ($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ? true : 0; + // Weird rewrite for php5 - anyone explaining why wins a medal ;) $temp_row = isset($this->block_config[$this->block_id]) ? $this->block_config[$this->block_id] : false; *************** *** 1924,1928 **** $this->auth_view = $this->_auth_ary['auth_view']; $this->auth_edit = $this->_auth_ary['auth_edit']; ! $this->auth_mod = $this->_auth_ary['auth_mod']; $this->block_time = $this->block_info['block_time']; --- 1926,1930 ---- $this->auth_view = $this->_auth_ary['auth_view']; $this->auth_edit = $this->_auth_ary['auth_edit']; ! $this->auth_mod = isset($this->_auth_ary['auth_mod']) ? $this->_auth_ary['auth_mod'] : $is_admin; $this->block_time = $this->block_info['block_time']; *************** *** 3592,3597 **** global $mx_block, $tplEx, $_GET; ! $this->info = $this->page_config[$this->page_id]['page_info']; ! /* * IP filter --- 3594,3601 ---- global $mx_block, $tplEx, $_GET; ! $this->info = &$this->page_config[$this->page_id]['page_info']; ! ! $is_admin = ($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ? true : 0; ! /* * IP filter *************** *** 3624,3633 **** $this->page_navigation_block = $this->info['page_navigation_block'] == 0 ? $portal_config['navigation_block'] : $this->info['page_navigation_block']; - // // Set the public view auth - // $this->_auth_ary = $this->auth(); $this->auth_view = $this->_auth_ary['auth_view']; ! $this->auth_mod = $this->_auth_ary['auth_mod']; $this->auth_ip = $mx_ip->auth($this->info['ip_filter']); --- 3628,3636 ---- $this->page_navigation_block = $this->info['page_navigation_block'] == 0 ? $portal_config['navigation_block'] : $this->info['page_navigation_block']; // Set the public view auth $this->_auth_ary = $this->auth(); $this->auth_view = $this->_auth_ary['auth_view']; ! //$this->auth_mod = $this->_auth_ary['auth_mod']; ! $this->auth_mod = isset($this->_auth_ary['auth_mod']) ? $this->_auth_ary['auth_mod'] : $is_admin; $this->auth_ip = $mx_ip->auth($this->info['ip_filter']); *************** *** 3635,3639 **** $this->total_column = count($this->columns); ! $this->blocks = $this->page_config[$this->page_id]['blocks']; $this->total_block = count($this->blocks); --- 3638,3642 ---- $this->total_column = count($this->columns); ! $this->blocks = &$this->page_config[$this->page_id]['blocks']; $this->total_block = count($this->blocks); *************** *** 3996,4000 **** public function auth($auth_data = '', $group_data = '', $moderator_data = '') { ! global $db, $lang, $userdata; $auth_label = array('auth_view'); --- 3999,4003 ---- public function auth($auth_data = '', $group_data = '', $moderator_data = '') { ! global $db, $lang, $mx_user, $userdata; $auth_label = array('auth_view'); *************** *** 4002,4013 **** $auth_fields_groups = array('page_auth_view_group'); ! $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? TRUE : 0; ! $auth_user = array(); for( $i = 0; $i < count($auth_fields); $i++ ) { - // // Fix for making this method useful also other pages, not only current one. - // $auth_data = !empty($auth_data) ? $auth_data : $this->info[$auth_fields[$i]]; $group_data = !empty($group_data) ? $group_data : $this->info[$auth_fields_groups[$i]]; --- 4005,4015 ---- $auth_fields_groups = array('page_auth_view_group'); ! $is_admin = ($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ? TRUE : 0; ! $auth_user['auth_mod'] = $is_admin; ! $auth_user = array(); for( $i = 0; $i < count($auth_fields); $i++ ) { // Fix for making this method useful also other pages, not only current one. $auth_data = !empty($auth_data) ? $auth_data : $this->info[$auth_fields[$i]]; $group_data = !empty($group_data) ? $group_data : $this->info[$auth_fields_groups[$i]]; *************** *** 4022,4041 **** case AUTH_REG: ! $auth_user[$auth_label[$i]] = ( $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$auth_label[$i] . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: ! $auth_user[$auth_label[$i]] = ( ! $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$auth_label[$i] . '_type'] = $lang['Auth_Anonymous_Users']; break; case AUTH_ACL: // PRIVATE ! $auth_user[$auth_label[$i]] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($group_data) || $is_admin : 0; $auth_user[$auth_label[$i] . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $auth_user[$auth_label[$i]] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($moderator_data) || $is_admin : 0; $auth_user[$auth_label[$i] . '_type'] = $lang['Auth_Moderators']; break; --- 4024,4043 ---- case AUTH_REG: ! $auth_user[$auth_label[$i]] = ($userdata['session_logged_in']) ? TRUE : 0; $auth_user[$auth_label[$i] . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: ! $auth_user[$auth_label[$i]] = (!$userdata['session_logged_in']) ? TRUE : 0; $auth_user[$auth_label[$i] . '_type'] = $lang['Auth_Anonymous_Users']; break; case AUTH_ACL: // PRIVATE ! $auth_user[$auth_label[$i]] = ($userdata['session_logged_in']) ? mx_is_group_member($group_data) || $is_admin : 0; $auth_user[$auth_label[$i] . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $auth_user[$auth_label[$i]] = ($userdata['session_logged_in']) ? mx_is_group_member($moderator_data) || $is_admin : 0; $auth_user[$auth_label[$i] . '_type'] = $lang['Auth_Moderators']; break; *************** *** 4051,4058 **** } } - - // // Is user a moderator? ! $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_is_group_member($moderator_data) || $is_admin : 0; return $auth_user; --- 4053,4058 ---- } } // Is user a moderator? ! $auth_user['auth_mod'] = ($userdata['session_logged_in']) ? mx_is_group_member($moderator_data) || $is_admin : 0; return $auth_user; Index: mx_functions_bbcode.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_bbcode.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** mx_functions_bbcode.php 28 Jun 2013 15:32:38 -0000 1.21 --- mx_functions_bbcode.php 9 May 2014 07:51:42 -0000 1.22 *************** *** 31,41 **** mt_srand( (double) microtime() * 1000000); - class bbcode_base { - function bbcode() { ! $this->bbcode_uid = $this->make_bbcode_uid(); } --- 31,39 ---- mt_srand( (double) microtime() * 1000000); class bbcode_base { function bbcode() { ! $this->bbcode_uid = $this->make_bbcode_uid(); } *************** *** 55,73 **** $tpl_filename = $template->make_filename('bbcode.tpl'); $tpl = fread(fopen($tpl_filename, 'r'), filesize($tpl_filename)); ! // replace \ with \\ and then ' with \'. $tpl = str_replace('\\', '\\\\', $tpl); $tpl = str_replace('\'', '\\\'', $tpl); ! // strip newlines. $tpl = str_replace("\n", '', $tpl); ! // Turn template blocks into PHP assignment statements for the values of $bbcode_tpls.. $tpl = preg_replace('#<!-- BEGIN (.*?) -->(.*?)<!-- END (.*?) -->#', "\n" . '$bbcode_tpls[\'\\1\'] = \'\\2\';', $tpl); ! $bbcode_tpls = array(); ! eval($tpl); ! return $bbcode_tpls; } --- 53,71 ---- $tpl_filename = $template->make_filename('bbcode.tpl'); $tpl = fread(fopen($tpl_filename, 'r'), filesize($tpl_filename)); ! // replace \ with \\ and then ' with \'. $tpl = str_replace('\\', '\\\\', $tpl); $tpl = str_replace('\'', '\\\'', $tpl); ! // strip newlines. $tpl = str_replace("\n", '', $tpl); ! // Turn template blocks into PHP assignment statements for the values of $bbcode_tpls.. $tpl = preg_replace('#<!-- BEGIN (.*?) -->(.*?)<!-- END (.*?) -->#', "\n" . '$bbcode_tpls[\'\\1\'] = \'\\2\';', $tpl); ! $bbcode_tpls = array(); ! eval($tpl); ! return $bbcode_tpls; } *************** *** 86,105 **** function prepare_bbcode_template($bbcode_tpl) { global $lang; $bbcode_tpl['olist_open'] = str_replace('{LIST_TYPE}', '\\1', $bbcode_tpl['olist_open']); - $bbcode_tpl['color_open'] = str_replace('{COLOR}', '\\1', $bbcode_tpl['color_open']); - $bbcode_tpl['size_open'] = str_replace('{SIZE}', '\\1', $bbcode_tpl['size_open']); ! ! $bbcode_tpl['quote_open'] = str_replace('{L_QUOTE}', $lang['Quote'], $bbcode_tpl['quote_open']); ! $bbcode_tpl['quote_username_open'] = str_replace('{L_QUOTE}', $lang['Quote'], $bbcode_tpl['quote_username_open']); $bbcode_tpl['quote_username_open'] = str_replace('{L_WROTE}', $lang['wrote'], $bbcode_tpl['quote_username_open']); $bbcode_tpl['quote_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['quote_username_open']); - $bbcode_tpl['code_open'] = str_replace('{L_CODE}', $lang['Code'], $bbcode_tpl['code_open']); - $bbcode_tpl['img'] = str_replace('{URL}', '\\1', $bbcode_tpl['img']); --- 84,98 ---- function prepare_bbcode_template($bbcode_tpl) { + global $document_id, $access_key, $height, $width; global $lang; $bbcode_tpl['olist_open'] = str_replace('{LIST_TYPE}', '\\1', $bbcode_tpl['olist_open']); $bbcode_tpl['color_open'] = str_replace('{COLOR}', '\\1', $bbcode_tpl['color_open']); $bbcode_tpl['size_open'] = str_replace('{SIZE}', '\\1', $bbcode_tpl['size_open']); ! $bbcode_tpl['quote_open'] = str_replace('{L_QUOTE}', $lang['Quote'], $bbcode_tpl['quote_open']); $bbcode_tpl['quote_username_open'] = str_replace('{L_QUOTE}', $lang['Quote'], $bbcode_tpl['quote_username_open']); $bbcode_tpl['quote_username_open'] = str_replace('{L_WROTE}', $lang['wrote'], $bbcode_tpl['quote_username_open']); $bbcode_tpl['quote_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['quote_username_open']); $bbcode_tpl['code_open'] = str_replace('{L_CODE}', $lang['Code'], $bbcode_tpl['code_open']); $bbcode_tpl['img'] = str_replace('{URL}', '\\1', $bbcode_tpl['img']); *************** *** 118,125 **** $bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']); //Start more bbcode $bbcode_tpl['stream'] = str_replace('{URL}', '\\1', $bbcode_tpl['stream']); - $bbcode_tpl['web'] = str_replace('{URL}', '\\1', $bbcode_tpl['web']); $bbcode_tpl['flash'] = str_replace('{WIDTH}', '\\1', $bbcode_tpl['flash']); $bbcode_tpl['flash'] = str_replace('{HEIGHT}', '\\2', $bbcode_tpl['flash']); --- 111,136 ---- $bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']); + + // bbcode_box Mod + $bbcode_tpl['align_open'] = str_replace('{ALIGN}', '\\1', $bbcode_tpl['align_open']); + // $bbcode_tpl['stream'] = str_replace('{URL}', '\\1', $bbcode_tpl['stream']); + $bbcode_tpl['ram'] = str_replace('{URL}', '\\1', $bbcode_tpl['ram']); + $bbcode_tpl['marq_open'] = str_replace('{MARQ}', '\\1', $bbcode_tpl['marq_open']); + $bbcode_tpl['table_open'] = str_replace('{TABLE}', '\\1', $bbcode_tpl['table_open']); + $bbcode_tpl['cell_open'] = str_replace('{CELL}', '\\1', $bbcode_tpl['cell_open']); + $bbcode_tpl['web'] = str_replace('{URL}', '\\1', $bbcode_tpl['web']); + //$bbcode_tpl['center_open'] = str_replace('{CENTER}', '\\1', $bbcode_tpl['center_open']); + //$bbcode_tpl['flash'] = str_replace('{WIDTH}', '\\1', $bbcode_tpl['flash']); + //$bbcode_tpl['flash'] = str_replace('{HEIGHT}', '\\2', $bbcode_tpl['flash']); + //$bbcode_tpl['flash'] = str_replace('{URL}', '\\3', $bbcode_tpl['flash']); + //$bbcode_tpl['video'] = str_replace('{URL}', '\\3', $bbcode_tpl['video']); + //$bbcode_tpl['video'] = str_replace('{WIDTH}', '\\1', $bbcode_tpl['video']); + //$bbcode_tpl['video'] = str_replace('{HEIGHT}', '\\2', $bbcode_tpl['video']); + $bbcode_tpl['font_open'] = str_replace('{FONT}', '\\1', $bbcode_tpl['font_open']); + $bbcode_tpl['poet_open'] = str_replace('{POET}', '\\1', $bbcode_tpl['poet_open']); + // bbcode_box Mod //Start more bbcode $bbcode_tpl['stream'] = str_replace('{URL}', '\\1', $bbcode_tpl['stream']); $bbcode_tpl['flash'] = str_replace('{WIDTH}', '\\1', $bbcode_tpl['flash']); $bbcode_tpl['flash'] = str_replace('{HEIGHT}', '\\2', $bbcode_tpl['flash']); *************** *** 132,149 **** $bbcode_tpl['youtube'] = str_replace('{YOUTUBEID}', '\\1', $bbcode_tpl['youtube']); $bbcode_tpl['youtube'] = str_replace('{YOUTUBELINK}', $lang['Link'], $bbcode_tpl['youtube']); $bbcode_tpl['ipaper'] = str_replace('{IPAPERID}', '\\1', $bbcode_tpl['ipaper']); ! $bbcode_tpl['ipaper'] = str_replace('{IPAPERKEY}', '\\2', $bbcode_tpl['ipaper']); ! $bbcode_tpl['ipaper'] = str_replace('{HEIGHT}', '\\3', $bbcode_tpl['ipaper']); ! $bbcode_tpl['ipaper'] = str_replace('{WIDTH}', '\\4', $bbcode_tpl['ipaper']); ! $bbcode_tpl['ipaper'] = str_replace('{IPAPERLINK}', $lang['Link'], $bbcode_tpl['ipaper']); $bbcode_tpl['scribd'] = str_replace('{SCRIBDURL}', $lang['Link'], $bbcode_tpl['scribd']); //Stop more bbcode ! define("BBCODE_TPL_READY", true); ! return $bbcode_tpl; } /** * Does second-pass bbencoding. This should be used before displaying the message in * a thread. Assumes the message is already first-pass encoded, and we are given the --- 143,176 ---- $bbcode_tpl['youtube'] = str_replace('{YOUTUBEID}', '\\1', $bbcode_tpl['youtube']); $bbcode_tpl['youtube'] = str_replace('{YOUTUBELINK}', $lang['Link'], $bbcode_tpl['youtube']); + $bbcode_tpl['youtube'] = str_replace('{WIDTH}', '\\3', $bbcode_tpl['youtube']); + $bbcode_tpl['youtube'] = str_replace('{HEIGHT}', '\\4', $bbcode_tpl['youtube']); $bbcode_tpl['ipaper'] = str_replace('{IPAPERID}', '\\1', $bbcode_tpl['ipaper']); ! $bbcode_tpl['ipaper'] = str_replace('{IPAPERKEY}', '\\2', $bbcode_tpl['ipaper']); ! $bbcode_tpl['ipaper'] = str_replace('{WIDTH}', '\\3', $bbcode_tpl['ipaper']); ! $bbcode_tpl['ipaper'] = str_replace('{HEIGHT}', '\\4', $bbcode_tpl['ipaper']); ! $bbcode_tpl['ipaper'] = str_replace('{IPAPERLINK}', '\\5', $bbcode_tpl['ipaper']); ! //$bbcode_tpl['scribd'] = str_replace('{WIDTH}', '\\1', $bbcode_tpl['scribd']); ! //$bbcode_tpl['scribd'] = str_replace('{HEIGHT}', '\\2', $bbcode_tpl['scribd']); ! $bbcode_tpl['scribd'] = str_replace('{SCRIBDID}', '\\1', $bbcode_tpl['scribd']); $bbcode_tpl['scribd'] = str_replace('{SCRIBDURL}', $lang['Link'], $bbcode_tpl['scribd']); //Stop more bbcode ! define("BBCODE_TPL_READY", true); ! return $bbcode_tpl; } /** + * custom version of nl2br which takes custom BBCodes into account + */ + function bbcode_nl2br($text) + { + // custom BBCodes might contain carriage returns so they + // are not converted into <br /> so now revert that + $text = str_replace(array("\n", "\r"), array('<br />', "\n"), $text); + return $text; + } + + /** * Does second-pass bbencoding. This should be used before displaying the message in * a thread. Assumes the message is already first-pass encoded, and we are given the *************** *** 151,158 **** * This a temporary function */ ! function bbencode_second_pass($text, $uid) { global $lang, $bbcode_tpl; $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); --- 178,206 ---- * This a temporary function */ ! function bbencode_second_pass($text, $uid = '', $bitfield = false) { global $lang, $bbcode_tpl; + + if ($uid) + { + $this->bbcode_uid = $uid; + } + + if ($bitfield !== false) + { + $this->bbcode_bitfield = $bitfield; + // Init those added with a new bbcode_bitfield (already stored codes will not get parsed again) + $this->bbcode_cache_init(); + } + + //Check if it's a phpBB3 block + if ($bitfield) + { + $this->bbcode_second_pass($text, $uid, $bitfield); + } + + //$text = str_replace(array("\n", "\r"), array('<br />', "\n"), $text); + $text = str_replace(array("\n", "\r"), array('<br />', ""), $text); $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); *************** *** 178,185 **** $bbcode_tpl = $this->prepare_bbcode_template($bbcode_tpl); } ! // [CODE] and [/CODE] for posting code (HTML, PHP, C etc etc) in your posts. $text = $this->bbencode_second_pass_code($text, $uid, $bbcode_tpl); ! // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff. $text = str_replace("[quote:$uid]", $bbcode_tpl['quote_open'], $text); --- 226,236 ---- $bbcode_tpl = $this->prepare_bbcode_template($bbcode_tpl); } ! // [CODE] and [/CODE] for posting code (HTML, PHP, C etc etc) in your posts. $text = $this->bbencode_second_pass_code($text, $uid, $bbcode_tpl); ! ! // [IPAPER] and [/IPAPER] for posting iPaper in your posts. ! $text = $this->bbencode_ipaper_pass_render($text, $uid, $bbcode_tpl); ! // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff. $text = str_replace("[quote:$uid]", $bbcode_tpl['quote_open'], $text); *************** *** 254,282 **** //Strat more bbcode $text = preg_replace($patterns, $replacements, $text); ! // align ! $text = preg_replace("/\[align=(left|right|center|justify):$uid\]/si", $bbcode_tpl['align_open'], $text); ! $text = str_replace("[/align:$uid]", $bbcode_tpl['align_close'], $text); ! // marquee ! $text = preg_replace("/\[marq=(left|right|up|down):$uid\]/si", $bbcode_tpl['marq_open'], $text); ! $text = str_replace("[/marq:$uid]", $bbcode_tpl['marq_close'], $text); ! // table ! $text = preg_replace("/\[table=(.*?):$uid\]/si", $bbcode_tpl['table_open'], $text); ! $text = str_replace("[/table:$uid]", $bbcode_tpl['table_close'], $text); ! // cell ! $text = preg_replace("/\[cell=(.*?):$uid\]/si", $bbcode_tpl['cell_open'], $text); ! $text = str_replace("[/cell:$uid]", $bbcode_tpl['cell_close'], $text); ! // center ! $text = preg_replace("/\[center:$uid\]/si", $bbcode_tpl['center_open'], $text); ! $text = str_replace("[/center:$uid]", $bbcode_tpl['center_close'], $text); ! // font ! $text = preg_replace("/\[font=(.*?):$uid\]/si", $bbcode_tpl['font_open'], $text); ! $text = str_replace("[/font:$uid]", $bbcode_tpl['font_close'], $text); ! // poet ! $text = preg_replace("/\[poet(.*?):$uid\]/si", $bbcode_tpl['poet_open'], $text); ! $text = str_replace("[/poet:$uid]", $bbcode_tpl['poet_close'], $text); ! //[hr] ! $text = str_replace("[hr:$uid]", $bbcode_tpl['hr'], $text); ! ! // bbcode_box Mod // [fade] and [/fade] for faded text. $text = str_replace("[fade:$uid]", $bbcode_tpl['fade_open'], $text); --- 305,332 ---- //Strat more bbcode $text = preg_replace($patterns, $replacements, $text); ! // align ! $text = preg_replace("/\[align=(left|right|center|justify):$uid\]/si", $bbcode_tpl['align_open'], $text); ! $text = str_replace("[/align:$uid]", $bbcode_tpl['align_close'], $text); ! // marquee ! $text = preg_replace("/\[marq=(left|right|up|down):$uid\]/si", $bbcode_tpl['marq_open'], $text); ! $text = str_replace("[/marq:$uid]", $bbcode_tpl['marq_close'], $text); ! // table ! $text = preg_replace("/\[table=(.*?):$uid\]/si", $bbcode_tpl['table_open'], $text); ! $text = str_replace("[/table:$uid]", $bbcode_tpl['table_close'], $text); ! // cell ! $text = preg_replace("/\[cell=(.*?):$uid\]/si", $bbcode_tpl['cell_open'], $text); ! $text = str_replace("[/cell:$uid]", $bbcode_tpl['cell_close'], $text); ! // center ! $text = preg_replace("/\[center:$uid\]/si", $bbcode_tpl['center_open'], $text); ! $text = str_replace("[/center:$uid]", $bbcode_tpl['center_close'], $text); ! // font ! $text = preg_replace("/\[font=(.*?):$uid\]/si", $bbcode_tpl['font_open'], $text); ! $text = str_replace("[/font:$uid]", $bbcode_tpl['font_close'], $text); ! // poet ! $text = preg_replace("/\[poet(.*?):$uid\]/si", $bbcode_tpl['poet_open'], $text); ! $text = str_replace("[/poet:$uid]", $bbcode_tpl['poet_close'], $text); ! //[hr] ! $text = str_replace("[hr:$uid]", $bbcode_tpl['hr'], $text); ! // bbcode_box Mod // [fade] and [/fade] for faded text. $text = str_replace("[fade:$uid]", $bbcode_tpl['fade_open'], $text); *************** *** 941,959 **** * @return string */ ! function decode($bbtext, $bbcode_uid, $smilies_on = true) { global $mx_root_path, $phpbb_root_path, $phpEx, $mx_page; ! ! $mytext = stripslashes($bbtext); if (!empty($bbcode_uid)) { ! $mytext = $this->bbencode_second_pass($mytext, $bbcode_uid); } ! if ($smilies_on) { $mytext = $this->smilies_pass($mytext); } ! $mytext = str_replace("\n", "\n<br />\n", $mytext); ! return $this->make_clickable($mytext); } --- 991,1035 ---- * @return string */ ! function decode($mytext, $bbcode_uid, $smilies_on = true, $bbcode_bitfield = false) { global $mx_root_path, $phpbb_root_path, $phpEx, $mx_page; ! ! if (!$mytext) ! { ! return ''; ! } ! ! $mytext = mx_censor_text($mytext); ! ! //Do some checks ! $phpbb3_text = $bbcode_bitfield ? true : false; ! $bbcode_bitfield = ($bbcode_bitfield && (strlen($bbcode_bitfield) < 2)) ? false : $bbcode_bitfield; ! if (!empty($bbcode_uid)) { ! $mytext = $this->bbencode_second_pass($mytext, $bbcode_uid, $bbcode_bitfield); } ! ! $mytext = str_replace(array("\n", "\r"), array('<br />', "\n"), $mytext); ! $mytext = $this->bbcode_nl2br($mytext); ! ! //$mytext = smiley_text($mytext, !($flags & OPTION_FLAG_SMILIES)); ! if ($smilies_on && $phpbb3_text) ! { ! $mytext = $this->smilies3_pass($mytext); ! } ! else if ($smilies_on) { $mytext = $this->smilies_pass($mytext); } ! ! //$mytext = str_replace("\n", "\n<br />\n", $mytext); ! ! if ($mytext != '') ! { ! $mytext = $this->make_clickable($mytext); ! } ! ! return $mytext; } *************** *** 1075,1079 **** return $message; } - } ?> \ No newline at end of file --- 1151,1154 ---- Index: mx_functions_emailer.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_emailer.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mx_functions_emailer.php 28 Jun 2013 15:32:38 -0000 1.4 --- mx_functions_emailer.php 9 May 2014 07:51:42 -0000 1.5 *************** *** 258,263 **** case 'internal': case 'phpbb3': ! if (!$board_config['board_email']) { --- 258,267 ---- case 'internal': + case 'smf2': + case 'mybb': case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': if (!$board_config['board_email']) { Index: mx_functions_tools.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_tools.php,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** mx_functions_tools.php 2 Jul 2013 02:24:03 -0000 1.66 --- mx_functions_tools.php 9 May 2014 07:51:42 -0000 1.67 *************** *** 1905,1916 **** { case 'internal': ! case 'phpbb2': - $attach_sig = $userdata['user_attachsig']; break; ! case 'phpbb3': ! $attach_sig = ($board_config['allow_sig'] && $mx_user->data['user_sig']) ? TRUE : 0; break; --- 1905,1918 ---- { case 'internal': ! case 'smf2': ! case 'mybb': case 'phpbb2': $attach_sig = $userdata['user_attachsig']; break; ! case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': $attach_sig = ($board_config['allow_sig'] && $mx_user->data['user_sig']) ? TRUE : 0; break; *************** *** 1970,1976 **** { case 'internal': ! case 'phpbb2': ! $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time FROM " . PRIVMSGS_TABLE . " --- 1972,1979 ---- { case 'internal': ! case 'smf2': ! case 'mybb': case 'phpbb2': ! $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time FROM " . PRIVMSGS_TABLE . " *************** *** 1980,1985 **** AND privmsgs_to_userid = " . $to_userdata['user_id']; break; ! case 'phpbb3': $sql = 'SELECT t.msg_id, COUNT(t.msg_id) as inbox_items, SUM(t.pm_unread) as oldest_post_time --- 1983,1991 ---- AND privmsgs_to_userid = " . $to_userdata['user_id']; break; ! case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': $sql = 'SELECT t.msg_id, COUNT(t.msg_id) as inbox_items, SUM(t.pm_unread) as oldest_post_time *************** *** 2041,2069 **** { case 'internal': ! ! case 'phpbb2': ! $sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $privmsg_subject) . "', " . $this->from_id . ", " . $to_userdata['user_id'] . ", $msg_time, '$user_ip', $this->html_on, $this->bbcode_on, $this->smilies_on, $attach_sig)"; - if ( !($result = $db->sql_query($sql_info)) ) { mx_message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info); } - $privmsg_sent_id = $db->sql_nextid(); ! ! $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text) ! VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("\'", "''", $privmsg_message) . "')"; ! ! if ( !$db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql); ! } ! ! ! // // Add to the users new pm counter - // $sql = "UPDATE " . USERS_TABLE . " SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . " --- 2047,2067 ---- { case 'internal': ! case 'smf2': ! case 'mybb': ! case 'phpbb2': $sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $privmsg_subject) . "', " . $this->from_id . ", " . $to_userdata['user_id'] . ", $msg_time, '$user_ip', $this->html_on, $this->bbcode_on, $this->smilies_on, $attach_sig)"; if ( !($result = $db->sql_query($sql_info)) ) { mx_message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info); } $privmsg_sent_id = $db->sql_nextid(); ! $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text) VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("\'", "''", $privmsg_message) . "')"; ! if ( !$db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql); ! } ! // Add to the users new pm counter $sql = "UPDATE " . USERS_TABLE . " SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . " *************** *** 2075,2079 **** } - if ( $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active'] ) { --- 2073,2076 ---- *************** *** 2083,2122 **** $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/'; ! ! // // Include and initiate emailer - // include_once($mx_root_path . 'includes/mx_functions_emailer.'.$phpEx); $emailer = new mx_emailer($board_config['smtp_delivery']); ! $emailer->from($board_config['board_email']); $emailer->replyto($board_config['board_email']); ! $emailer->use_template('privmsg_notify', $to_userdata['user_lang']); $emailer->email_address($to_userdata['user_email']); $emailer->set_subject($lang['Notification_subject']); ! $emailer->assign_vars(array( 'USERNAME' => $to_username, 'SITENAME' => $board_config['sitename'], 'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', ! 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox') ); ! $emailer->send(); $emailer->reset(); } ! ! //return; ! ! $msg = $lang['Message_sent'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . mx_append_sid("privmsg.$phpEx?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . mx_append_sid("index.$phpEx") . '">', '</a>'); ! ! mx_message_die(GENERAL_MESSAGE, $msg); break; ! ! case 'phpbb3': ! if (!class_exists('parse_message')) { --- 2080,2117 ---- $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/'; ! // Include and initiate emailer include_once($mx_root_path . 'includes/mx_functions_emailer.'.$phpEx); $emailer = new mx_emailer($board_config['smtp_delivery']); ! $emailer->from($board_config['board_email']); $emailer->replyto($board_config['board_email']); ! $emailer->use_template('privmsg_notify', $to_userdata['user_lang']); $emailer->email_address($to_userdata['user_email']); $emailer->set_subject($lang['Notification_subject']); ! $emailer->assign_vars(array( 'USERNAME' => $to_username, 'SITENAME' => $board_config['sitename'], 'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', ! 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox') ); ! $emailer->send(); $emailer->reset(); } ! //return; ! $msg = $lang['Message_sent'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . mx_append_sid("privmsg.$phpEx?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . mx_append_sid("index.$phpEx") . '">', '</a>'); ! mx_message_die(GENERAL_MESSAGE, $msg); break; ! ! case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': ! if (!class_exists('parse_message')) { *************** *** 2125,2129 **** $message_parser = new parse_message($privmsg_message); ! $message_parser->message = $privmsg_message; $message_parser->parse(true, true, true, false, false, true, true); --- 2120,2124 ---- $message_parser = new parse_message($privmsg_message); ! $message_parser->message = $privmsg_message; $message_parser->parse(true, true, true, false, false, true, true); *************** *** 2373,2399 **** { case 'internal': - case 'phpbb2': ! $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_level = '$admin_type'"; break; ! case 'phpbb3': ! $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_type = 1"; break; ! } ! ! ! if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain author data", '', __LINE__, __FILE__, $sql ); } ! $user_ids_array = array(); while( $row = $db->sql_fetchrow( $result ) ) --- 2368,2396 ---- { case 'internal': case 'phpbb2': ! case 'smf2': ! case 'mybb': ! $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_level = '$admin_type'"; break; ! case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': ! $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_type = 1"; break; ! } ! if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain author data", '', __LINE__, __FILE__, $sql ); } ! $user_ids_array = array(); while( $row = $db->sql_fetchrow( $result ) ) *************** *** 2408,2412 **** } } - return $user_ids_array; } --- 2405,2408 ---- *************** *** 3909,3923 **** { case 'internal': break; case 'phpbb2': ! $sql = "SELECT topic_first_post_id, topic_last_post_id FROM " . TOPICS_TABLE . " WHERE topic_id = '$topic_id'"; break; ! case 'phpbb3': ! $sql = 'SELECT p.post_approved, t.topic_first_post_id, t.topic_last_post_id, t.topic_type, t.topic_replies, t.topic_replies_real, t.topic_approved FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p --- 3905,3923 ---- { case 'internal': + case 'smf2': + case 'mybb': break; case 'phpbb2': ! $sql = "SELECT topic_first_post_id, topic_last_post_id FROM " . TOPICS_TABLE . " WHERE topic_id = '$topic_id'"; break; ! case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': $sql = 'SELECT p.post_approved, t.topic_first_post_id, t.topic_last_post_id, t.topic_type, t.topic_replies, t.topic_replies_real, t.topic_approved FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p *************** *** 3953,3957 **** case 'phpbb3': ! $data['topic_approved'] = $topic_row['topic_approved']; $data['post_approved'] = $topic_row['post_approved']; --- 3953,3959 ---- case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': $data['topic_approved'] = $topic_row['topic_approved']; $data['post_approved'] = $topic_row['post_approved']; *************** *** 3978,3983 **** { case 'internal': break; ! case 'phpbb2': // --- 3980,3987 ---- { case 'internal': + case 'smf2': + case 'mybb': break; ! case 'phpbb2': // *************** *** 3993,3999 **** $topic_id = $mode == 'newtopic' ? $db->sql_nextid() : $topic_id; break; - - case 'phpbb3': /* if (!function_exists('submit_post')) --- 3997,4005 ---- $topic_id = $mode == 'newtopic' ? $db->sql_nextid() : $topic_id; break; + case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': /* if (!function_exists('submit_post')) *************** *** 4100,4105 **** { case 'internal': break; ! case 'phpbb2': $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $user_id . ", '$username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $user_attach_sig)"; --- 4106,4113 ---- { case 'internal': + case 'smf2': + case 'mybb': break; ! case 'phpbb2': $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $user_id . ", '$username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $user_attach_sig)"; *************** *** 4112,4115 **** --- 4120,4126 ---- case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': /* $sql_data = array( *************** *** 4171,4174 **** --- 4182,4187 ---- { case 'internal': + case 'smf2': + case 'mybb': break; *************** *** 4191,4195 **** case 'phpbb3': ! //$topic_id = $this->submit_phpbb_post($post_mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message); break; --- 4204,4210 ---- case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': //$topic_id = $this->submit_phpbb_post($post_mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message); break; *************** *** 4245,4248 **** --- 4260,4265 ---- { case 'internal': + case 'smf2': + case 'mybb': break; *************** *** 4251,4255 **** --- 4268,4276 ---- break; + case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': //To do break; *************** *** 4300,4310 **** mx_message_die( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); } ! ! // // Add search words - // switch (PORTAL_BACKEND) { case 'internal': break; --- 4321,4331 ---- mx_message_die( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); } ! // Add search words switch (PORTAL_BACKEND) { case 'internal': + case 'smf2': + case 'mybb': break; *************** *** 4314,4317 **** --- 4335,4341 ---- break; case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': //To do break; *************** *** 5253,5265 **** { case 'internal': ! case 'phpbb2': ! break; case 'phpbb3': ! $topic_update_sql .= ', topic_last_view_time = ' . $current_time; ! break; } --- 5277,5292 ---- { case 'internal': ! case 'smf2': ! case 'mybb': case 'phpbb2': ! break; case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': $topic_update_sql .= ', topic_last_view_time = ' . $current_time; ! break; } *************** *** 5284,5290 **** $is_last_post = ($last_post_id == $post_id) ? true : false; - // // Start delete - // $sql = "DELETE FROM " . POSTS_TABLE . " WHERE post_id = $post_id"; --- 5311,5315 ---- *************** *** 5298,5302 **** { case 'internal': ! case 'phpbb2': --- 5323,5330 ---- { case 'internal': ! case 'smf2': ! case 'mybb': ! break; ! case 'phpbb2': *************** *** 5307,5315 **** mx_message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql); } ! break; case 'phpbb3': ! ! break; } --- 5335,5345 ---- mx_message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql); } ! break; case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': ! break; } Index: page_header.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/page_header.php,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** page_header.php 28 Jun 2013 15:32:38 -0000 1.76 --- page_header.php 9 May 2014 07:51:42 -0000 1.77 *************** *** 164,167 **** --- 164,169 ---- { case 'internal': + case 'smf2': + case 'mybb': case 'phpbb2': $admin = ($userdata['session_logged_in'] && $userdata['user_level'] == ADMIN) ? true : false; *************** *** 169,172 **** --- 171,177 ---- case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': global $phpbb_auth; $admin = (!$phpbb_auth->acl_get('a_') && $mx_user->data['user_id'] != ANONYMOUS) ? true : false; *************** *** 233,237 **** //Login page or box constants 'S_AUTOLOGIN_ENABLED' => ($board_config['allow_autologin']) ? true : false, ! 'S_BOARD_DISABLED' => ($board_config['board_disable']) ? true : false, //To Do - configurable in AdminCP --- 238,242 ---- //Login page or box constants 'S_AUTOLOGIN_ENABLED' => ($board_config['allow_autologin']) ? true : false, ! 'S_BOARD_DISABLED' => ($board_config['portal_status']) ? true : false, //To Do - configurable in AdminCP *************** *** 304,308 **** 'T_PHPBB_STYLESHEET' => $mx_user->theme['head_stylesheet'], ! 'T_STYLESHEET_LINK' => (!isset($mx_user->theme['theme_storedb'])) ? "{$phpbb_root_path}styles/" . $mx_user->theme['template_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$mx_user->session_id&id=" . $mx_user->theme['style_id'] . '&lang=' . $mx_user->encode_lang($board_config['default_lang']), 'T_MXBB_STYLESHEET' => isset($mx_user->theme['head_stylesheet']) ? $mx_user->theme['head_stylesheet'] : $mx_user->template_name.'.css', 'T_GECKO_STYLESHEET' => 'gecko.css', --- 309,313 ---- 'T_PHPBB_STYLESHEET' => $mx_user->theme['head_stylesheet'], ! 'T_STYLESHEET_LINK' => (!isset($mx_user->theme['theme_storedb'])) ? "{$phpbb_root_path}styles/" . $mx_user->template_name . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$mx_user->session_id&id=" . $mx_user->theme['style_id'] . '&lang=' . $mx_user->encode_lang($board_config['default_lang']), 'T_MXBB_STYLESHEET' => isset($mx_user->theme['head_stylesheet']) ? $mx_user->theme['head_stylesheet'] : $mx_user->template_name.'.css', 'T_GECKO_STYLESHEET' => 'gecko.css', Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.139 retrieving revision 1.140 diff -C2 -d -r1.139 -r1.140 *** mx_functions_style.php 27 Aug 2013 06:30:49 -0000 1.139 --- mx_functions_style.php 9 May 2014 07:51:42 -0000 1.140 *************** *** 114,120 **** global $module_root_path, $mx_root_path, $phpbb_root_path, $theme, $mx_user, $mx_block; - // // ? - // if($this->subtemplates) { --- 114,118 ---- *************** *** 122,128 **** } - // // Check replacements list - // if(!$xs_include && isset($this->replace[$filename])) { --- 120,124 ---- *************** *** 132,138 **** $style_path = $mx_user->template_name; - // // Also search for "the other" file extension - // $filename2 = substr_count($filename, 'html') ? str_replace(".html", ".tpl", $filename) : str_replace(".tpl", ".html", $filename); --- 128,132 ---- *************** *** 203,210 **** switch (PORTAL_BACKEND) { - // // Look at phpBB2-Root folder... - // case 'internal': case 'phpbb2': $this->debug_paths .= '<br>phpbb2'; --- 197,204 ---- switch (PORTAL_BACKEND) { // Look at phpBB2-Root folder... case 'internal': + case 'smf2': + case 'mybb': case 'phpbb2': $this->debug_paths .= '<br>phpbb2'; *************** *** 221,229 **** } ! break; ! // // Look at phpBB3-Root folder... - // case 'phpbb3': $this->debug_paths .= '<br>phpbb3'; $fileSearch = array(); --- 215,223 ---- } ! break; // Look at phpBB3-Root folder... case 'phpbb3': + case 'olympus': + case 'ascraeus': $this->debug_paths .= '<br>phpbb3'; $fileSearch = array(); *************** *** 301,306 **** return $temppath; } ! break; } --- 295,327 ---- return $temppath; } + + break; + case 'rhea': + $this->debug_paths .= '<br>phpbb4'; + $fileSearch = array(); + $fileSearch[] = $style_path . '/' . 'template'; // First check current template + $fileSearch[] = $mx_user->cloned_template_name . '/' . 'template'; // Then check Cloned template + $fileSearch[] = $mx_user->default_template_name . '/' . 'template'; // Then check Default template + $fileSearch[] = './'; + $temppath = $this->doFileSearch($fileSearch, $filename, $filename2, 'styles/', $phpbb_root_path, false); + + /* + * This doesn't fit in...so left as is. + */ + if(@file_exists($phpbb_root_path . 'adm/style/' . $filename) ) + { + /* + * First check ACP template + */ + $this->module_template_path = $phpbb_root_path . 'adm/style/'; + $temppath = $phpbb_root_path . 'adm/style/' . $filename; + } ! if (!empty($this->module_template_path)) ! { ! return $temppath; ! } ! ! break; } *************** *** 728,742 **** { case 'internal': ! case 'phpbb3': ! $shared_lang_path = $mx_root_path . 'includes/shared/phpbb2/language/'; //$template_path = 'styles/'; ! break; ! ! case 'phpbb2': ! $shared_lang_path = $phpbb_root_path . 'language/'; ! break; } --- 749,765 ---- { case 'internal': ! case 'smf2': ! case 'mybb': case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': $shared_lang_path = $mx_root_path . 'includes/shared/phpbb2/language/'; //$template_path = 'styles/'; ! break; ! ! case 'phpbb2': $shared_lang_path = $phpbb_root_path . 'language/'; ! break; } *************** *** 879,882 **** --- 902,907 ---- { case 'internal': + case 'smf2': + case 'mybb': $sql = "SELECT themes_id, style_name FROM " . MX_THEMES_TABLE . " *************** *** 892,895 **** --- 917,923 ---- break; case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': $sql = "SELECT mxt.themes_id, bbt.style_id, bbt.style_name FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt *************** *** 914,917 **** --- 942,947 ---- { case 'internal': + case 'smf2': + case 'mybb': $sql = "SELECT themes_id, style_name FROM " . MX_THEMES_TABLE . " *************** *** 927,930 **** --- 957,963 ---- break; case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': $sql = "SELECT mxt.themes_id, bbt.style_id, bbt.style_name FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt *************** *** 1009,1024 **** { case 'internal': $sql = 'SELECT * FROM ' . MX_THEMES_TABLE; ! break; case 'phpbb2': $sql = 'SELECT * FROM ' . THEMES_TABLE; ! break; case 'phpbb3': $sql = "SELECT bbt.*, stt.* FROM " . MX_THEMES_TABLE . " mxt, " . STYLES_TABLE . " bbt, " . STYLES_TEMPLATE_TABLE . " stt WHERE mxt.template_name = stt.template_path"; ! break; } if ( !($result = $db->sql_query_limit($sql, 1)) ) --- 1042,1062 ---- { case 'internal': + case 'smf2': + case 'mybb': $sql = 'SELECT * FROM ' . MX_THEMES_TABLE; ! break; case 'phpbb2': $sql = 'SELECT * FROM ' . THEMES_TABLE; ! break; case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': $sql = "SELECT bbt.*, stt.* FROM " . MX_THEMES_TABLE . " mxt, " . STYLES_TABLE . " bbt, " . STYLES_TEMPLATE_TABLE . " stt WHERE mxt.template_name = stt.template_path"; ! break; } if ( !($result = $db->sql_query_limit($sql, 1)) ) *************** *** 1041,1054 **** { case 'internal': case 'phpbb2': $this->template_name = $row['template_name']; $this->style_name = $row['template_name']; $style = $row['themes_id']; ! break; case 'phpbb3': $this->template_name = $row['template_path']; $this->style_name = $row['style_name']; $style = $row['style_id']; ! break; } --- 1079,1097 ---- { case 'internal': + case 'smf2': + case 'mybb': case 'phpbb2': $this->template_name = $row['template_name']; $this->style_name = $row['template_name']; $style = $row['themes_id']; ! break; case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': $this->template_name = $row['template_path']; $this->style_name = $row['style_name']; $style = $row['style_id']; ! break; } *************** *** 1087,1099 **** { case 'internal': foreach($template_config_row as $key => $value) { $row[$key] = $value; } ! break; case 'phpbb3': $row['style_copy'] = $template_config_row['template_copy']; $row['head_stylesheet'] = $row['template_path'] . '.css'; ! break; } --- 1130,1147 ---- { case 'internal': + case 'smf2': + case 'mybb': foreach($template_config_row as $key => $value) { $row[$key] = $value; } ! break; case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': $row['style_copy'] = $template_config_row['template_copy']; $row['head_stylesheet'] = $row['template_path'] . '.css'; ! break; } *************** *** 1116,1121 **** $this->_load_mxbb_images(); break; ! case 'internal': case 'phpbb3': $this->_load_mxbb_images(); break; --- 1164,1174 ---- $this->_load_mxbb_images(); break; ! case 'internal': ! case 'smf2': ! case 'mybb': case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': $this->_load_mxbb_images(); break; *************** *** 1150,1153 **** --- 1203,1208 ---- { case 'internal': + case 'smf2': + case 'mybb': $sql = "SELECT * FROM " . MX_THEMES_TABLE . " *************** *** 1163,1166 **** --- 1218,1224 ---- break; case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': $sql = "SELECT t . * , s . * FROM " . MX_THEMES_TABLE . " AS m, " . STYLES_TABLE . " AS s, " . STYLES_TEMPLATE_TABLE . " AS t, " . STYLES_THEME_TABLE . " AS c, " . STYLES_IMAGESET_TABLE . " i *************** *** 1209,1216 **** --- 1267,1279 ---- { case 'internal': + case 'smf2': + case 'mybb': case 'phpbb2': $phpbb_images = $images; break; case 'phpbb3': + case 'olympus': + case 'ascraeus': + case 'rhea': $phpbb_images = $this->_load_phpbb_images(); break; *************** *** 1276,1279 **** --- 1339,1344 ---- { case 'internal': + case 'smf2': + case 'mybb': @define(TEMPLATE_CONFIG, TRUE); break; *************** *** 1314,1318 **** } break; ! case 'phpbb3': /* * Load phpBB Template configuration data --- 1379,1386 ---- } break; ! case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': /* * Load phpBB Template configuration data *************** *** 1566,1576 **** { case 'internal': @define(TEMPLATE_CONFIG, TRUE); ! break; ! case 'phpbb2': ! break; ! case 'phpbb3': ! /**/ // Here we overwrite phpBB images from the template configuration file with images from database --- 1634,1649 ---- { case 'internal': + case 'smf2': + case 'mybb': @define(TEMPLATE_CONFIG, TRUE); ! break; ! case 'phpbb2': ! break; ! ! case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': /**/ // Here we overwrite phpBB images from the template configuration file with images from database *************** *** 1638,1641 **** --- 1711,1715 ---- $images['voting_graphic'] = $this->images('voting_graphic'); /**/ + break; } *************** *** 1899,1906 **** { case 'internal': break; case 'phpbb2': ! case 'phpbb3': $this->_load_phpbb_images(); break; --- 1973,1985 ---- { case 'internal': + case 'smf2': + case 'mybb': break; case 'phpbb2': ! case 'phpbb3': ! case 'olympus': ! case 'ascraeus': ! case 'rhea': $this->_load_phpbb_images(); break; |