|
From: Florin C B. <ory...@us...> - 2014-05-09 07:52:06
|
Update of /cvsroot/mxbb/core/includes/sessions/internal In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32556/internal Modified Files: bbcode.php constants.php core.php session.php Log Message: some fixes to the internal BACKEND, plus some support for other backends compatible in the future versions Index: core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/internal/core.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** core.php 28 Jun 2013 15:33:47 -0000 1.17 --- core.php 9 May 2014 07:52:03 -0000 1.18 *************** *** 35,41 **** class mx_backend { - // // XS Template - use backend db settings - // var $edit_db = false; --- 35,39 ---- *************** *** 52,65 **** global $table_prefix, $phpEx, $tplEx; - // // Define relative path to "phpBB", and validate - // $phpbb_root_path = $mx_root_path . 'includes/shared/phpbb2/'; str_replace("//", "/", $phpbb_root_path); $portal_backend_valid_file = @file_exists($phpbb_root_path . "includes/functions.$phpEx"); - // // Define backend template extension - // $tplEx = 'tpl'; --- 50,59 ---- *************** *** 94,101 **** define('PHPBB_URL', $server_url_phpbb); ! // ! // Now sync Configs ! // In phpBB mode, we rely on native phpBB configs, thus we need to sync mxp and phpbb settings ! // $this->sync_configs(); } --- 88,95 ---- define('PHPBB_URL', $server_url_phpbb); ! /* ! * Now sync Configs ! * In phpBB mode, we rely on native phpBB configs, thus we need to sync mxp and phpbb settings ! */ $this->sync_configs(); } *************** *** 226,234 **** case 'internal': case 'phpbb2': $path = $mx_root_path . 'includes/shared/phpbb2/includes/'; ! break; case 'phpbb3': $path = $mx_root_path . 'includes/shared/phpbb3/includes/'; ! break; } return $path; --- 220,235 ---- case 'internal': case 'phpbb2': + case 'smf2': + case 'mybb': $path = $mx_root_path . 'includes/shared/phpbb2/includes/'; ! break; case 'phpbb3': + case 'olympus': + case 'ascraeus': $path = $mx_root_path . 'includes/shared/phpbb3/includes/'; ! break; ! case 'rhea': ! $path = $mx_root_path . 'includes/shared/phpbb3/includes/'; ! break; } return $path; *************** *** 299,310 **** $s_last_visit = ( $userdata['session_logged_in'] ) ? phpBB2::create_date($board_config['default_dateformat'], $userdata['user_lastvisit'], $board_config['board_timezone']) : ''; ! ! // // Obtain number of new private messages // if user is logged in - // if ( ($userdata['session_logged_in']) && (empty($gen_simple_header)) ) { ! if ( $userdata['user_new_privmsg'] ) { $l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms']; --- 300,309 ---- $s_last_visit = ( $userdata['session_logged_in'] ) ? phpBB2::create_date($board_config['default_dateformat'], $userdata['user_lastvisit'], $board_config['board_timezone']) : ''; ! // Obtain number of new private messages // if user is logged in if ( ($userdata['session_logged_in']) && (empty($gen_simple_header)) ) { ! if (isset($userdata['user_new_privmsg'])) { $l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms']; *************** *** 340,344 **** } ! if ( $userdata['user_unread_privmsg'] ) { $l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms']; --- 339,343 ---- } ! if (isset($userdata['user_unread_privmsg'])) { $l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms']; Index: constants.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/internal/constants.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** constants.php 28 Jun 2013 15:33:47 -0000 1.4 --- constants.php 9 May 2014 07:52:03 -0000 1.5 *************** *** 16,158 **** // Debug Level ! //define('DEBUG', 1); // Debugging on ! define('DEBUG', 0); // Debugging off // User Levels <- Do not change the values of USER or ADMIN ! define('DELETED', -1); ! define('ANONYMOUS', -1); ! define('USER', 0); ! define('ADMIN', 1); ! define('MOD', 2); // User related ! define('USER_ACTIVATION_NONE', 0); ! define('USER_ACTIVATION_SELF', 1); ! define('USER_ACTIVATION_ADMIN', 2); ! define('USER_AVATAR_NONE', 0); ! define('USER_AVATAR_UPLOAD', 1); ! define('USER_AVATAR_REMOTE', 2); ! define('USER_AVATAR_GALLERY', 3); // Group settings ! define('GROUP_OPEN', 0); ! define('GROUP_CLOSED', 1); ! define('GROUP_HIDDEN', 2); // Forum state ! define('FORUM_UNLOCKED', 0); ! define('FORUM_LOCKED', 1); // Topic status ! define('TOPIC_UNLOCKED', 0); ! define('TOPIC_LOCKED', 1); ! define('TOPIC_MOVED', 2); ! define('TOPIC_WATCH_NOTIFIED', 1); ! define('TOPIC_WATCH_UN_NOTIFIED', 0); // Topic types ! define('POST_NORMAL', 0); ! define('POST_STICKY', 1); ! define('POST_ANNOUNCE', 2); ! define('POST_GLOBAL_ANNOUNCE', 3); // SQL codes ! define('BEGIN_TRANSACTION', 1); ! define('END_TRANSACTION', 2); // Error codes ! define('GENERAL_MESSAGE', 200); ! define('GENERAL_ERROR', 202); ! define('CRITICAL_MESSAGE', 203); ! define('CRITICAL_ERROR', 204); // Private messaging ! define('PRIVMSGS_READ_MAIL', 0); ! define('PRIVMSGS_NEW_MAIL', 1); ! define('PRIVMSGS_SENT_MAIL', 2); ! define('PRIVMSGS_SAVED_IN_MAIL', 3); ! define('PRIVMSGS_SAVED_OUT_MAIL', 4); ! define('PRIVMSGS_UNREAD_MAIL', 5); // URL PARAMETERS ! define('POST_TOPIC_URL', 't'); ! define('POST_CAT_URL', 'c'); ! define('POST_FORUM_URL', 'f'); ! define('POST_USERS_URL', 'u'); ! define('POST_POST_URL', 'p'); ! define('POST_GROUPS_URL', 'g'); // Session parameters ! define('SESSION_METHOD_COOKIE', 100); ! define('SESSION_METHOD_GET', 101); // Page numbers for session handling ! define('PAGE_INDEX', 0); ! define('PAGE_LOGIN', -1); ! define('PAGE_SEARCH', -2); ! define('PAGE_REGISTER', -3); ! define('PAGE_PROFILE', -4); ! define('PAGE_VIEWONLINE', -6); ! define('PAGE_VIEWMEMBERS', -7); ! define('PAGE_FAQ', -8); ! define('PAGE_POSTING', -9); ! define('PAGE_PRIVMSGS', -10); ! define('PAGE_GROUPCP', -11); ! define('PAGE_TOPIC_OFFSET', 5000); // Auth settings ! define('AUTH_LIST_ALL', 0); ! define('AUTH_ALL', 0); ! define('AUTH_REG', 1); ! define('AUTH_ACL', 2); ! define('AUTH_MOD', 3); ! define('AUTH_ADMIN', 5); ! define('AUTH_VIEW', 1); ! define('AUTH_READ', 2); ! define('AUTH_POST', 3); ! define('AUTH_REPLY', 4); ! define('AUTH_EDIT', 5); ! define('AUTH_DELETE', 6); ! define('AUTH_ANNOUNCE', 7); ! define('AUTH_STICKY', 8); ! define('AUTH_POLLCREATE', 9); ! define('AUTH_VOTE', 10); ! define('AUTH_ATTACH', 11); // Table names ! //define('CONFIRM_TABLE', $table_prefix.'confirm'); ! //define('AUTH_ACCESS_TABLE', $table_prefix.'auth_access'); ! //define('BANLIST_TABLE', $table_prefix.'banlist'); ! //define('CATEGORIES_TABLE', $table_prefix.'categories'); ! //define('CONFIG_TABLE', $table_prefix.'config'); ! //define('DISALLOW_TABLE', $table_prefix.'disallow'); ! //define('FORUMS_TABLE', $table_prefix.'forums'); ! define('GROUPS_TABLE', $mx_table_prefix.'groups'); ! //define('POSTS_TABLE', $table_prefix.'posts'); ! //define('POSTS_TEXT_TABLE', $table_prefix.'posts_text'); ! //define('PRIVMSGS_TABLE', $table_prefix.'privmsgs'); ! //define('PRIVMSGS_TEXT_TABLE', $table_prefix.'privmsgs_text'); ! //define('PRIVMSGS_IGNORE_TABLE', $table_prefix.'privmsgs_ignore'); ! //define('PRUNE_TABLE', $table_prefix.'forum_prune'); ! //define('RANKS_TABLE', $table_prefix.'ranks'); ! //define('SEARCH_TABLE', $table_prefix.'search_results'); ! //define('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist'); ! //define('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch'); ! define('SESSIONS_TABLE', $mx_table_prefix.'sessions'); ! define('SESSIONS_KEYS_TABLE', $mx_table_prefix.'sessions_keys'); ! define('SMILIES_TABLE', $mx_table_prefix.'smilies'); ! //define('THEMES_TABLE', $table_prefix.'themes'); ! //define('THEMES_NAME_TABLE', $table_prefix.'themes_name'); ! //define('TOPICS_TABLE', $table_prefix.'topics'); ! //define('TOPICS_WATCH_TABLE', $table_prefix.'topics_watch'); ! define('USER_GROUP_TABLE', $mx_table_prefix.'user_group'); ! define('USERS_TABLE', $mx_table_prefix.'users'); ! define('WORDS_TABLE', $mx_table_prefix.'words'); ! //define('VOTE_DESC_TABLE', $table_prefix.'vote_desc'); ! //define('VOTE_RESULTS_TABLE', $table_prefix.'vote_results'); ! //define('VOTE_USERS_TABLE', $table_prefix.'vote_voters'); ?> \ No newline at end of file --- 16,158 ---- // Debug Level ! //@define('DEBUG', 1); // Debugging on ! @define('DEBUG', 0); // Debugging off // User Levels <- Do not change the values of USER or ADMIN ! @define('DELETED', -1); ! @define('ANONYMOUS', -1); ! @define('USER', 0); ! @define('ADMIN', 1); ! @define('MOD', 2); // User related ! @define('USER_ACTIVATION_NONE', 0); ! @define('USER_ACTIVATION_SELF', 1); ! @define('USER_ACTIVATION_ADMIN', 2); ! @define('USER_AVATAR_NONE', 0); ! @define('USER_AVATAR_UPLOAD', 1); ! @define('USER_AVATAR_REMOTE', 2); ! @define('USER_AVATAR_GALLERY', 3); // Group settings ! @define('GROUP_OPEN', 0); ! @define('GROUP_CLOSED', 1); ! @define('GROUP_HIDDEN', 2); // Forum state ! @define('FORUM_UNLOCKED', 0); ! @define('FORUM_LOCKED', 1); // Topic status ! @define('TOPIC_UNLOCKED', 0); ! @define('TOPIC_LOCKED', 1); ! @define('TOPIC_MOVED', 2); ! @define('TOPIC_WATCH_NOTIFIED', 1); ! @define('TOPIC_WATCH_UN_NOTIFIED', 0); // Topic types ! @define('POST_NORMAL', 0); ! @define('POST_STICKY', 1); ! @define('POST_ANNOUNCE', 2); ! @define('POST_GLOBAL_ANNOUNCE', 3); // SQL codes ! @define('BEGIN_TRANSACTION', 1); ! @define('END_TRANSACTION', 2); // Error codes ! @define('GENERAL_MESSAGE', 200); ! @define('GENERAL_ERROR', 202); ! @define('CRITICAL_MESSAGE', 203); ! @define('CRITICAL_ERROR', 204); // Private messaging ! @define('PRIVMSGS_READ_MAIL', 0); ! @define('PRIVMSGS_NEW_MAIL', 1); ! @define('PRIVMSGS_SENT_MAIL', 2); ! @define('PRIVMSGS_SAVED_IN_MAIL', 3); ! @define('PRIVMSGS_SAVED_OUT_MAIL', 4); ! @define('PRIVMSGS_UNREAD_MAIL', 5); // URL PARAMETERS ! @define('POST_TOPIC_URL', 't'); ! @define('POST_CAT_URL', 'c'); ! @define('POST_FORUM_URL', 'f'); ! @define('POST_USERS_URL', 'u'); ! @define('POST_POST_URL', 'p'); ! @define('POST_GROUPS_URL', 'g'); // Session parameters ! @define('SESSION_METHOD_COOKIE', 100); ! @define('SESSION_METHOD_GET', 101); // Page numbers for session handling ! @define('PAGE_INDEX', 0); ! @define('PAGE_LOGIN', -1); ! @define('PAGE_SEARCH', -2); ! @define('PAGE_REGISTER', -3); ! @define('PAGE_PROFILE', -4); ! @define('PAGE_VIEWONLINE', -6); ! @define('PAGE_VIEWMEMBERS', -7); ! @define('PAGE_FAQ', -8); ! @define('PAGE_POSTING', -9); ! @define('PAGE_PRIVMSGS', -10); ! @define('PAGE_GROUPCP', -11); ! @define('PAGE_TOPIC_OFFSET', 5000); // Auth settings ! @define('AUTH_LIST_ALL', 0); ! @define('AUTH_ALL', 0); ! @define('AUTH_REG', 1); ! @define('AUTH_ACL', 2); ! @define('AUTH_MOD', 3); ! @define('AUTH_ADMIN', 5); ! @define('AUTH_VIEW', 1); ! @define('AUTH_READ', 2); ! @define('AUTH_POST', 3); ! @define('AUTH_REPLY', 4); ! @define('AUTH_EDIT', 5); ! @define('AUTH_DELETE', 6); ! @define('AUTH_ANNOUNCE', 7); ! @define('AUTH_STICKY', 8); ! @define('AUTH_POLLCREATE', 9); ! @define('AUTH_VOTE', 10); ! @define('AUTH_ATTACH', 11); // Table names ! //@define('CONFIRM_TABLE', $table_prefix.'confirm'); ! //@define('AUTH_ACCESS_TABLE', $table_prefix.'auth_access'); ! //@define('BANLIST_TABLE', $table_prefix.'banlist'); ! //@define('CATEGORIES_TABLE', $table_prefix.'categories'); ! //@define('CONFIG_TABLE', $table_prefix.'config'); ! //@define('DISALLOW_TABLE', $table_prefix.'disallow'); ! //@define('FORUMS_TABLE', $table_prefix.'forums'); ! @define('GROUPS_TABLE', $mx_table_prefix.'groups'); ! //@define('POSTS_TABLE', $table_prefix.'posts'); ! //@define('POSTS_TEXT_TABLE', $table_prefix.'posts_text'); ! //@define('PRIVMSGS_TABLE', $table_prefix.'privmsgs'); ! //@define('PRIVMSGS_TEXT_TABLE', $table_prefix.'privmsgs_text'); ! //@define('PRIVMSGS_IGNORE_TABLE', $table_prefix.'privmsgs_ignore'); ! //@define('PRUNE_TABLE', $table_prefix.'forum_prune'); ! //@define('RANKS_TABLE', $table_prefix.'ranks'); ! //@define('SEARCH_TABLE', $table_prefix.'search_results'); ! //@define('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist'); ! //@define('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch'); ! @define('SESSIONS_TABLE', $mx_table_prefix.'sessions'); ! @define('SESSIONS_KEYS_TABLE', $mx_table_prefix.'sessions_keys'); ! @define('SMILIES_TABLE', $mx_table_prefix.'smilies'); ! //@define('THEMES_TABLE', $table_prefix.'themes'); ! //@define('THEMES_NAME_TABLE', $table_prefix.'themes_name'); ! //@define('TOPICS_TABLE', $table_prefix.'topics'); ! //@define('TOPICS_WATCH_TABLE', $table_prefix.'topics_watch'); ! @define('USER_GROUP_TABLE', $mx_table_prefix.'user_group'); ! @define('USERS_TABLE', $mx_table_prefix.'users'); ! @define('WORDS_TABLE', $mx_table_prefix.'words'); ! //@define('VOTE_DESC_TABLE', $table_prefix.'vote_desc'); ! //@define('VOTE_RESULTS_TABLE', $table_prefix.'vote_results'); ! //@define('VOTE_USERS_TABLE', $table_prefix.'vote_voters'); ?> \ No newline at end of file Index: session.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/internal/session.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** session.php 28 Jun 2013 15:33:47 -0000 1.19 --- session.php 9 May 2014 07:52:03 -0000 1.20 *************** *** 56,71 **** global $portal_config; ! $this->data = $this->session_pagestart($this->user_ip, - ( MX_PORTAL_PAGES_OFFSET + $this->page_id )); - // // Simulate the user lang setting - // $this->data['user_lang'] = $portal_config['default_lang']; ! $this->data['user_dateformat'] = $portal_config['user_dateformat']; ! $this->data['user_timezone'] = $portal_config['user_timezone']; - // // Populate session_id - // $this->session_id = $this->data['session_id']; } --- 56,68 ---- global $portal_config; ! $this->data = $this->session_pagestart($this->user_ip, - (MX_PORTAL_PAGES_OFFSET + $this->page_id)); // Simulate the user lang setting $this->data['user_lang'] = $portal_config['default_lang']; ! $this->data['user_dateformat'] = $portal_config['default_dateformat']; ! $this->data['user_timezone'] = $portal_config['board_timezone']; ! $this->data['user_dst'] = 1; // Populate session_id $this->session_id = $this->data['session_id']; } *************** *** 94,98 **** { $sessiondata = array(); ! $session_id = $mx_request_vars->get('sid', mztnt); $sessionmethod = SESSION_METHOD_GET; } --- 91,95 ---- { $sessiondata = array(); ! $session_id = $mx_request_vars->get('sid', MX_TYPE_NO_TAGS); $sessionmethod = SESSION_METHOD_GET; } *************** *** 620,624 **** { global $db, $template, $board_config, $userdata, $phpbb_auth, $phpEx, $phpbb_root_path, $mx_root_path, $mx_cache; ! global $mx_request_vars, $portal_config; //added for mxp $lang_set = !$lang_set ? (defined('IN_ADMIN') ? 'lang_admin' : 'lang_main') : $lang_set; --- 617,621 ---- { global $db, $template, $board_config, $userdata, $phpbb_auth, $phpEx, $phpbb_root_path, $mx_root_path, $mx_cache; ! global $mx_request_vars, $portal_config, $shared_lang_path; //added for mxp $lang_set = !$lang_set ? (defined('IN_ADMIN') ? 'lang_admin' : 'lang_main') : $lang_set; *************** *** 628,632 **** $this->date_format = $board_config['default_dateformat']; ! $this->timezone = $board_config['user_timezone'] * 3600; $this->dst = $this->data['user_dst'] * 3600; --- 625,629 ---- $this->date_format = $board_config['default_dateformat']; ! $this->timezone = $board_config['board_timezone'] * 3600; $this->dst = $this->data['user_dst'] * 3600; Index: bbcode.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/internal/bbcode.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bbcode.php 28 Jun 2013 15:33:47 -0000 1.3 --- bbcode.php 9 May 2014 07:52:03 -0000 1.4 *************** *** 15,22 **** } ! // // 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 /** --- 15,25 ---- } ! /* ! * Here comes a mxp version of original phpbb2 bbcode.php ! * Last in file are the mxp wrapper functions ! */ ! // Now load some bbcodes, to be extended for this backend (see below) ! require($mx_root_path . 'includes/mx_functions_bbcode.' . $phpEx); // BBCode associated functions /** *************** *** 43,47 **** --- 46,60 ---- var $template_bitfield; var $template_filename = ''; + + var $site_url = ''; + var $document_id = ''; + var $access_key = ''; + var $height = 0; + var $width = 0; + /** + * Constructor + * Init bbcode cache entries if bitfield is specified + */ function mx_bbcode($bitfield = '') { *************** *** 56,60 **** $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 ! $this->smilies_path = str_replace("//", "/", $board_config['smilies_path']); } --- 69,73 ---- $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 ! $board_config['smilies_path'] = str_replace("smiles", "smilies", $board_config['smilies_path']); //Added by OryNider $this->smilies_path = str_replace("//", "/", $board_config['smilies_path']); } |