|
From: FlorinCB <ory...@us...> - 2008-10-04 07:07:37
|
Update of /cvsroot/mxbb/core/includes/sessions/phpbb2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv30073/includes/sessions/phpbb2 Modified Files: core.php login.php Added Files: bbcode.php Log Message: new Mx_BBcode merged in one backend file Index: core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/phpbb2/core.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** core.php 30 Sep 2008 07:04:40 -0000 1.17 --- core.php 4 Oct 2008 07:04:25 -0000 1.18 *************** *** 23,31 **** // - // Now load some bbcodes, to be extended for this backend (see below) - // - include_once($mx_root_path . 'includes/mx_functions_bbcode.' . $phpEx); // BBCode associated functions - - // // Finally, load some backend specific functions // --- 23,26 ---- *************** *** 568,572 **** function page_header($mode = false) { ! global $db, $mx_root_path, $phpbb_root_path, $userdata, $mx_user, $lang, $images, $phpEx, $board_config, $gen_simple_header, $layouttemplate, $mx_page; switch ($mode) --- 563,568 ---- function page_header($mode = false) { ! global $db, $mx_root_path, $phpbb_root_path, $userdata, $mx_user, $lang, $images, $phpEx; ! global $phpBB2, $board_config, $gen_simple_header, $layouttemplate, $mx_page; switch ($mode) *************** *** 862,1001 **** } ! /** ! * MXP BBcodes ! * @package MX-Publisher ! */ ! class mx_bbcode extends bbcode_base ! { ! var $smiley_path_url = ''; ! var $smiley_root_path = ''; ! ! var $smiley_url = 'smile_url'; ! var $smiley_id = 'smilies_id'; ! var $emotion = 'emoticon'; ! ! function mx_bbcode() ! { ! global $phpbb_root_path; ! ! $this->smiley_path_url = PHPBB_URL; //change this to PORTAL_URL when shared folder will be removed ! $this->smiley_root_path = $phpbb_root_path; //same here ! } ! ! /** ! * Generate smilies. ! * ! * Hacking generate_smilies from phpbb/includes/functions_post(ing).php ! * ! * @param string $mode ! * @param integer $page_id ! * ! * Fill smiley templates (or just the variables) with smilies, either in a window or inline ! */ ! function generate_smilies($mode, $forum_id) ! { ! global $mx_page, $board_config, $template, $mx_root_path, $phpbb_root_path, $phpEx; ! global $db, $lang, $images, $theme; ! global $user_ip, $session_length, $starttime; ! global $userdata, $phpbb_auth, $mx_user; ! ! $inline_columns = 4; ! $inline_rows = 5; ! $window_columns = 8; ! ! if ($mode == 'window') ! { ! $mx_user->init($user_ip, PAGE_INDEX); ! ! $gen_simple_header = TRUE; ! $page_title = $lang['Emoticons']; ! ! include($mx_root_path . 'includes/page_header.'.$phpEx); ! ! $template->set_filenames(array( ! 'smiliesbody' => 'posting_smilies.tpl') ! ); ! } ! ! $sql = "SELECT emoticon, code, smile_url ! FROM " . SMILIES_TABLE . " ! ORDER BY smilies_id"; ! if ($result = $db->sql_query($sql)) ! { ! $num_smilies = 0; ! $rowset = array(); ! while ($row = $db->sql_fetchrow($result)) ! { ! if (empty($rowset[$row['smile_url']])) ! { ! $rowset[$row['smile_url']]['code'] = str_replace("'", "\\'", str_replace('\\', '\\\\', $row['code'])); ! $rowset[$row['smile_url']]['emoticon'] = $row['emoticon']; ! $num_smilies++; ! } ! } ! ! if ($num_smilies) ! { ! $smilies_count = ($mode == 'inline') ? min(19, $num_smilies) : $num_smilies; ! $smilies_split_row = ($mode == 'inline') ? $inline_columns - 1 : $window_columns - 1; ! ! $s_colspan = 0; ! $row = 0; ! $col = 0; ! ! while (list($smile_url, $data) = @each($rowset)) ! { ! if (!$col) ! { ! $template->assign_block_vars('smilies_row', array()); ! } ! ! $template->assign_block_vars('smilies_row.smilies_col', array( ! 'SMILEY_CODE' => $data['code'], ! 'SMILEY_IMG' => $this->smiley_path_url . $board_config['smilies_path'] . '/' . $smile_url, ! 'SMILEY_DESC' => $data['emoticon']) ! ); ! ! $s_colspan = max($s_colspan, $col + 1); ! ! if ($col == $smilies_split_row) ! { ! if ($mode == 'inline' && $row == $inline_rows - 1) ! { ! break; ! } ! $col = 0; ! $row++; ! } ! else ! { ! $col++; ! } ! } ! ! if ($mode == 'inline' && $num_smilies > $inline_rows * $inline_columns) ! { ! $template->assign_block_vars('switch_smilies_extra', array()); ! ! $template->assign_vars(array( ! 'L_MORE_SMILIES' => $lang['More_emoticons'], ! 'U_MORE_SMILIES' => mx3_append_sid(PHPBB_URL . "posting.$phpEx", "mode=smilies")) ! ); ! } ! ! $template->assign_vars(array( ! 'L_EMOTICONS' => $lang['Emoticons'], ! 'L_CLOSE_WINDOW' => $lang['Close_window'], ! 'S_SMILIES_COLSPAN' => $s_colspan) ! ); ! } ! } ! ! if ($mode == 'window') ! { ! $template->pparse('smiliesbody'); ! include($mx_root_path . 'includes/page_tail.'.$phpEx); ! } ! } ! } ?> \ No newline at end of file --- 858,864 ---- } ! // ! // Now load some bbcodes, to be extended for this backend (see below) ! // ! include_once($mx_root_path . 'includes/sessions/phpbb2/bbcode.' . $phpEx); // BBCode associated functions ?> \ No newline at end of file --- NEW FILE: bbcode.php --- <?php /** * * @package Functions_phpBB * @version $Id: bbcode.php,v 1.1 2008/10/04 07:04:25 orynider Exp $ * @copyright (c) 2002-2008 MX-Publisher Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://www.mx-publisher.com * */ if (!defined('IN_PORTAL')) { exit; } // // Here comes a mxp version of original phpbb2 bbcode.php // Last in file are the mxp wrapper functions [...987 lines suppressed...] 'U_MORE_SMILIES' => mx3_append_sid(PHPBB_URL . "posting.$phpEx", "mode=smilies")) ); } $template->assign_vars(array( 'L_EMOTICONS' => $lang['Emoticons'], 'L_CLOSE_WINDOW' => $lang['Close_window'], 'S_SMILIES_COLSPAN' => $s_colspan) ); } } if ($mode == 'window') { $template->pparse('smiliesbody'); include($mx_root_path . 'includes/page_tail.'.$phpEx); } } } ?> |