Update of /cvsroot/mxbb/mx_smartor/album_mod/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10881/album_mod/includes Modified Files: album_bbcode.php album_constants.php album_functions.php album_hierarchy_sql.php Added Files: album_header.php album_tail.php Log Message: Upgrade --- NEW FILE: album_header.php --- <?php /** * * @package MX-Publisher Core * @version $Id: album_header.php,v 1.1 2008/08/29 05:58:23 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 * @internal * */ if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } define('HEADER_INC', true); /********** NOTE: The following code related to GZIP initialization has been moved to the new mx_session_start() function, declared in mx_functions.php // // gzip_compression // $do_gzip_compress = FALSE; if ( $board_config['gzip_compress'] ) { $phpver = phpversion(); $useragent = (isset($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT'); if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) ) { if ( extension_loaded('zlib') ) { ob_end_clean(); ob_start('ob_gzhandler'); } } else if ( $phpver > '4.0' ) { if ( strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') ) { if ( extension_loaded('zlib') ) { $do_gzip_compress = TRUE; ob_start(); ob_implicit_flush(0); header('Content-Encoding: gzip'); } } } } **********/ // // If MX-Publisher frame template is not set, instantiate it // if ( is_object($layouttemplate) == FALSE ) { // // Initialize template // $layouttemplate = new mx_Template( $mx_root_path . 'templates/'. $theme['template_name'], $board_config, $db ); } // // If MX-Publisher page is not set, instantiate it // if (!isset($mx_page->page_navigation_block)) { // // Load and instatiate page and block classes // - temp fix to instatiate mx_page for the login page // $mx_page->init( '1' ); } // // Parse and show the overall header. // $layouttemplate->set_filenames(array( 'overall_header' => "album_header.$tplEx") ); // // Generate logged in/logged out status // switch (PORTAL_BACKEND) { case 'internal': case 'phpbb2': if ( $userdata['session_logged_in'] ) { $is_logged = true; $u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id']; $l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]'; } else { $is_logged = false; $u_login_logout = 'login.'.$phpEx; $l_login_logout = $lang['Login']; } $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']; $l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']); if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] ) { $sql = "UPDATE " . USERS_TABLE . " SET user_last_privmsg = " . $userdata['user_lastvisit'] . " WHERE user_id = " . $userdata['user_id']; if ( !$db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql); } $s_privmsg_new = 1; $icon_pm = $images['pm_new_msg']; } else { $s_privmsg_new = 0; $icon_pm = $images['pm_no_new_msg']; } $mx_priv_msg = $lang['Private_Messages'] . ' (' . $userdata['user_new_privmsg'] . ')'; } else { $l_privmsgs_text = $lang['No_new_pm']; $s_privmsg_new = 0; $icon_pm = $images['pm_no_new_msg']; $mx_priv_msg = $lang['Private_Messages']; } if ( $userdata['user_unread_privmsg'] ) { $l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms']; $l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']); } else { $l_privmsgs_text_unread = $lang['No_unread_pm']; } } else { $icon_pm = $images['pm_no_new_msg']; $l_privmsgs_text = $lang['Login_check_pm']; $l_privmsgs_text_unread = ''; $s_privmsg_new = 0; $mx_priv_msg = $lang['Private_Messages']; } break; case 'phpbb3': if ( $mx_user->data['user_id'] != 1 ) { $is_logged = true; $u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $mx_user->data['session_id']; $l_login_logout = $lang['Logout'] . ' [ ' . $mx_user->data['username'] . ' ]'; } else { $is_logged = false; $u_login_logout = 'login.'.$phpEx; $l_login_logout = $lang['Login']; } $s_last_visit = ( $mx_user->data['session_logged_in'] ) ? phpBB2::create_date($board_config['default_dateformat'], $mx_user->data['user_lastvisit'], $board_config['board_timezone']) : ''; // // Obtain number of new private messages // if user is logged in // if ( ($mx_user->data['session_logged_in']) && (empty($gen_simple_header)) ) { if ( $mx_user->data['user_new_privmsg'] ) { $l_message_new = ( $mx_user->data['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms']; $l_privmsgs_text = sprintf($l_message_new, $mx_user->data['user_new_privmsg']); if ( $mx_user->data['user_last_privmsg'] > $mx_user->data['user_lastvisit'] ) { $sql = "UPDATE " . USERS_TABLE . " SET user_last_privmsg = " . $mx_user->data['user_lastvisit'] . " WHERE user_id = " . $mx_user->data['user_id']; if ( !$db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql); } $s_privmsg_new = 1; $icon_pm = $images['pm_new_msg']; } else { $s_privmsg_new = 0; $icon_pm = $images['pm_no_new_msg']; } $mx_priv_msg = $lang['Private_Messages'] . ' (' . $mx_user->data['user_new_privmsg'] . ')'; } else { $l_privmsgs_text = $lang['No_new_pm']; $s_privmsg_new = 0; $icon_pm = $images['pm_no_new_msg']; $mx_priv_msg = $lang['Private_Messages']; } if ( $mx_user->data['user_unread_privmsg'] ) { $l_message_unread = ( $mx_user->data['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms']; $l_privmsgs_text_unread = sprintf($l_message_unread, $mx_user->data['user_unread_privmsg']); } else { $l_privmsgs_text_unread = $lang['No_unread_pm']; } } else { $icon_pm = $images['pm_no_new_msg']; $l_privmsgs_text = $lang['Login_check_pm']; $l_privmsgs_text_unread = ''; $s_privmsg_new = 0; $mx_priv_msg = $lang['Private_Messages']; } break; } // // Generate HTML required for Mozilla Navigation bar // if ( !isset( $nav_links ) ) { $nav_links = array(); } $nav_links_html = ''; $nav_link_proto = '<link rel="%s" href="%s" title="%s" />' . "\n"; while( list($nav_item, $nav_array) = @each($nav_links) ) { if ( !empty($nav_array['url']) ) { $nav_links_html .= sprintf($nav_link_proto, $nav_item, mx_append_sid($nav_array['url']), $nav_array['title']); } else { // We have a nested array, used for items like <link rel='chapter'> that can occur more than once. while( list(,$nested_array) = each($nav_array) ) { $nav_links_html .= sprintf($nav_link_proto, $nav_item, $nested_array['url'], $nested_array['title']); } } } // // Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility // $l_timezone = explode( '.', $board_config['board_timezone'] ); $l_timezone = ( count( $l_timezone ) > 1 && $l_timezone[count( $l_timezone )-1] != 0 ) ? $lang[sprintf( '%.1f', $board_config['board_timezone'] )] : $lang[number_format( $board_config['board_timezone'] )]; if (empty($mx_page->page_alt_icon)) { $page_icon_img = ( !empty($mx_page->page_icon) && $mx_page->page_icon != 'none' && file_exists($mx_root_path . $images['mx_graphics']['page_icons'] . '/' . $mx_page->page_icon) ) ? '<img valign="middle" src="' . PORTAL_URL . $images['mx_graphics']['page_icons'] . '/' . $mx_page->page_icon . '" alt="" /> ' : ''; } else { $page_icon_img = '<img valign="middle" src="' . $mx_page->page_alt_icon . '" alt="" /> '; } $search_page_id_pafiledb = get_page_id('dload.' . $phpEx, true); $search_page_id_kb = get_page_id('kb.' . $phpEx, true); $search_page_id_site = get_page_id('mx_search.' . $phpEx, true); $option_search_site = !empty($search_page_id_site) ? '<option value="site">' . $lang['Mx_search_site'] . '</option>' : ''; $option_search_forum = '<option value="forum">' . $lang['Mx_search_forum'] . '</option>'; $option_search_kb = !empty($search_page_id_kb) ? '<option value="kb">' . $lang['Mx_search_kb'] . '</option>' : ''; $option_search_pafiledb = !empty($search_page_id_pafiledb) ? '<option value="pafiledb">' . $lang['Mx_search_pafiledb'] . '</option>' : ''; $option_search_google = '<option value="google">' . $lang['Mx_search_google'] . '</option>'; // // Generate list of additional css files to include (defined by modules) // $mx_addional_css_files = ''; if ( count($mx_page->mxbb_css_addup) > 0 ) { foreach($mx_page->mxbb_css_addup as $key => $mx_css_path) { $mx_addional_css_files .= "\n".'<link rel="stylesheet" href="'. PORTAL_URL . $mx_css_path . '" type="text/css" >'; } } // // Generate list of additional js files to include (defined by modules) // $mx_addional_js_files = ''; if ( count($mx_page->mxbb_js_addup) > 0 ) { foreach($mx_page->mxbb_js_addup as $key => $mx_js_path) { $mx_addional_js_files .= "\n".'<script language="javascript" type="text/javascript" src="'. PORTAL_URL . $mx_js_path . '"></script>'; } } // // Generate additional header code (defined by modules) // $mx_addional_header_text = ''; if ( count($mx_page->mxbb_header_addup) > 0 ) { foreach($mx_page->mxbb_header_addup as $key => $mx_header_text) { $mx_addional_header_text .= "\n"."\n".$mx_header_text; } } // Definitions of main navigation links switch (PORTAL_BACKEND) { case 'internal': case 'phpbb2': $u_register = 'profile.'.$phpEx.'?mode=register' ; $u_profile = 'profile.'.$phpEx.'?mode=editprofile'; $u_privatemsgs = 'privmsg.'.$phpEx.'?folder=inbox'; $u_privatemsgs_popup = 'privmsg.'.$phpEx.'?mode=newpm'; $u_search = 'search.'.$phpEx; $u_memberlist = 'memberlist.'.$phpEx; $u_modcp = 'modcp.'.$phpEx; $u_faq = 'faq.'.$phpEx; $u_viewonline = 'viewonline.'.$phpEx; $u_group_cp = 'groupcp.'.$phpEx; break; case 'phpbb3': $u_register = 'ucp.'.$phpEx.'?mode=register'; $u_profile = 'ucp.'.$phpEx; $u_privatemsgs = 'ucp.'.$phpEx.'?i=pm&folder=inbox'; $u_privatemsgs_popup ='ucp.'.$phpEx.'?i=pm&mode=popup'; $u_search = 'search.'.$phpEx; $u_memberlist = 'memberlist.'.$phpEx; $u_modcp = 'mcp.'.$phpEx; $u_faq = 'faq.'.$phpEx; $u_viewonline = 'viewonline.'.$phpEx; $u_group_cp = 'ucp.'.$phpEx.'?i=167'; break; } $useragent = (isset($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT'); $layouttemplate->assign_vars(array( 'SITENAME' => $board_config['sitename'], 'SITE_DESCRIPTION' => $board_config['site_desc'], 'PAGE_TITLE' => ($page_title) ? $page_title : $mx_page->page_title, 'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit), 'CURRENT_TIME' => sprintf($lang['Current_time'], phpBB2::create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])), 'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], phpBB2::create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])), 'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text, 'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread, 'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new, 'PRIVMSG_IMG' => $icon_pm, 'L_USERNAME' => $lang['Username'], 'L_PASSWORD' => $lang['Password'], 'L_LOGIN_LOGOUT' => $l_login_logout, 'L_LOGIN' => $lang['Login'], 'L_LOG_ME_IN' => $lang['Log_me_in'], 'L_AUTO_LOGIN' => $lang['Log_me_in'], 'L_INDEX' => $board_config['sitename'], 'L_REGISTER' => $lang['Register'], 'L_PROFILE' => $lang['Profile'], 'L_SEARCH' => $lang['Search'], 'L_PRIVATEMSGS' => $mx_priv_msg, 'L_WHO_IS_ONLINE' => $lang['Who_is_Online'], 'L_MEMBERLIST' => $lang['Memberlist'], 'L_FAQ' => $lang['FAQ'], 'L_USERGROUPS' => $lang['Usergroups'], 'L_SEARCH_NEW' => $lang['Search_new'], 'L_SEARCH_UNANSWERED' => $lang['Search_unanswered'], 'L_SEARCH_SELF' => $lang['Search_your_posts'], 'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'), 'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'), 'L_BACK_TO_TOP' => $lang['Back_to_top'], 'U_SEARCH_UNANSWERED' => mx_append_sid(PHPBB_URL . 'search.'.$phpEx.'?search_id=unanswered'), 'U_SEARCH_SELF' => mx_append_sid(PHPBB_URL .'search.'.$phpEx.'?search_id=egosearch'), 'U_SEARCH_NEW' => mx_append_sid(PHPBB_URL .'search.'.$phpEx.'?search_id=newposts'), 'U_REGISTER' => mx_append_sid(PHPBB_URL . $u_register), 'U_PROFILE' => mx_append_sid(PHPBB_URL . $u_profile), 'U_PRIVATEMSGS' => mx_append_sid(PHPBB_URL . $u_privatemsgs), 'U_PRIVATEMSGS_POPUP' => mx_append_sid(PHPBB_URL . $u_privatemsgs_popup), 'U_SEARCH' => mx_append_sid(PHPBB_URL . $u_search), 'U_MEMBERLIST' =>mx_append_sid(PHPBB_URL . $u_memberlist), 'U_MODCP' => mx_append_sid(PHPBB_URL . $u_modcp), 'U_FAQ' => mx_append_sid(PHPBB_URL . $u_faq), 'U_VIEWONLINE' => mx_append_sid(PHPBB_URL . $u_viewonline), 'U_LOGIN_LOGOUT' => mx_append_sid(PORTAL_URL . $u_login_logout), 'U_GROUP_CP' => mx_append_sid(PHPBB_URL . $u_group_cp), 'LOGO' => $images['mx_logo'], 'THEME_GRAPHICS' => $images['theme_graphics'], 'NAV_IMAGES_HOME' => $images['mx_nav_home'], 'NAV_IMAGES_FORUM' => $images['mx_nav_forum'], 'NAV_IMAGES_PROFILE' => $images['mx_nav_profile'], 'NAV_IMAGES_FAQ' => $images['mx_nav_faq'], 'NAV_IMAGES_SEARCH' => $images['mx_nav_search'], 'NAV_IMAGES_MEMBERS' => $images['mx_nav_members'], 'NAV_IMAGES_GROUPS' => $images['mx_nav_groups'], 'NAV_IMAGES_PRIVMSG' => $images['mx_nav_mail'], 'NAV_IMAGES_LOGIN_LOGOUT' => $images['mx_nav_login'], 'NAV_IMAGES_REGISTER' => $images['mx_nav_register'], 'S_CONTENT_DIRECTION' => $lang['DIRECTION'], 'S_CONTENT_ENCODING' => $lang['ENCODING'], 'S_CONTENT_DIR_LEFT' => $lang['LEFT'], 'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'], 'S_USER_LANG' => $mx_user->lang['default_lang'], 'S_TIMEZONE' => sprintf($lang['All_times'], $l_timezone), 'S_LOGIN_ACTION' => mx_append_sid(PORTAL_URL . 'login.'.$phpEx), // // These theme variables are not used for MX-Publisher, since MX-Publisher require a theme.css file // 'T_HEAD_STYLESHEET' => $theme['head_stylesheet'], 'T_BODY_BACKGROUND' => $theme['body_background'], 'T_BODY_BGCOLOR' => '#'.$theme['body_bgcolor'], 'T_BODY_TEXT' => '#'.$theme['body_text'], 'T_BODY_LINK' => '#'.$theme['body_link'], 'T_BODY_VLINK' => '#'.$theme['body_vlink'], 'T_BODY_ALINK' => '#'.$theme['body_alink'], 'T_BODY_HLINK' => '#'.$theme['body_hlink'], 'T_TR_COLOR1' => '#'.$theme['tr_color1'], 'T_TR_COLOR2' => '#'.$theme['tr_color2'], 'T_TR_COLOR3' => '#'.$theme['tr_color3'], 'T_TR_CLASS1' => $theme['tr_class1'], 'T_TR_CLASS2' => $theme['tr_class2'], 'T_TR_CLASS3' => $theme['tr_class3'], 'T_TH_COLOR1' => '#'.$theme['th_color1'], 'T_TH_COLOR2' => '#'.$theme['th_color2'], 'T_TH_COLOR3' => '#'.$theme['th_color3'], 'T_TH_CLASS1' => $theme['th_class1'], 'T_TH_CLASS2' => $theme['th_class2'], 'T_TH_CLASS3' => $theme['th_class3'], 'T_TD_COLOR1' => '#'.$theme['td_color1'], 'T_TD_COLOR2' => '#'.$theme['td_color2'], 'T_TD_COLOR3' => '#'.$theme['td_color3'], 'T_TD_CLASS1' => $theme['td_class1'], 'T_TD_CLASS2' => $theme['td_class2'], 'T_TD_CLASS3' => $theme['td_class3'], 'T_FONTFACE1' => $theme['fontface1'], 'T_FONTFACE2' => $theme['fontface2'], 'T_FONTFACE3' => $theme['fontface3'], 'T_FONTSIZE1' => $theme['fontsize1'], 'T_FONTSIZE2' => $theme['fontsize2'], 'T_FONTSIZE3' => $theme['fontsize3'], 'T_FONTCOLOR1' => '#'.$theme['fontcolor1'], 'T_FONTCOLOR2' => '#'.$theme['fontcolor2'], 'T_FONTCOLOR3' => '#'.$theme['fontcolor3'], 'T_SPAN_CLASS1' => $theme['span_class1'], 'T_SPAN_CLASS2' => $theme['span_class2'], 'T_SPAN_CLASS3' => $theme['span_class3'], //+ MX-Publisher 'U_PORTAL_ROOT_PATH' => PORTAL_URL, 'U_PHPBB_ROOT_PATH' => PHPBB_URL, 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, 'L_HOME' => $lang['MX_home'], 'L_FORUM' => $lang['MX_forum'], 'U_INDEX_FORUM' => mx_append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=2'), 'U_INDEX' => mx_append_sid(PORTAL_URL . 'index.' . $phpEx), 'U_SEARCH_SITE' => mx_append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $search_page_id_site . '&mode=results&search_terms=all'), 'U_SEARCH_KB' => mx_append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $search_page_id_kb . '&mode=search&search_terms=all'), 'U_SEARCH_PAFILEDB' => mx_append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $search_page_id_pafiledb . '&action=search&search_terms=all'), 'PAGE_ICON' => $page_icon_img, 'L_SEARCH_SITE' => $option_search_site, 'L_SEARCH_FORUM' => $option_search_forum, 'L_SEARCH_KB' => $option_search_kb, 'L_SEARCH_PAFILEDB' => $option_search_pafiledb, 'L_SEARCH_GOOGLE' => $option_search_google, 'T_PHPBB_STYLESHEET' => $theme['head_stylesheet'], 'T_MXBB_STYLESHEET' => $theme['head_stylesheet'], 'T_GECKO_STYLESHEET' => 'gecko.css', 'MX_ADDITIONAL_CSS_FILES' => $mx_addional_css_files, 'MX_ADDITIONAL_JS_FILES' => $mx_addional_js_files, 'MX_ADDITIONAL_HEADER_TEXT' => $mx_addional_header_text, 'MX_ICON_CSS' => $images['mx_graphics']['icon_style'], //- MX-Publisher 'NAV_LINKS' => $nav_links_html, // swithes for logged in users? 'USER_LOGGED_IN' => $userdata['session_logged_in'], 'USER_LOGGED_OUT' => !$userdata['session_logged_in'], 'IS_ADMIN' => $userdata['session_logged_in'] && $userdata['user_level'] == ADMIN, // Backend 'PHPBB' => PORTAL_BACKEND != 'internal', // Show phpbb stats? 'PHPBB_STATS' => $mx_page->phpbb_stats && PORTAL_BACKEND != 'internal', // Allow autologin? 'ALLOW_AUTOLOGIN' => !$userdata['session_logged_in'] && (!isset($board_config['allow_autologin']) || $board_config['allow_autologin']) && PORTAL_BACKEND != 'internal', // phpBB PM 'ENABLE_PM_POPUP' => $userdata['session_logged_in'] && !empty($userdata['user_popup_pm']) && PORTAL_BACKEND != 'internal', // Do NOT set basedir when in EDIT mode 'SET_BASE' => !$mx_request_vars->is_request('portalpage'), // Additional css for gecko browsers 'GECKO' => strstr($useragent, 'Gecko'), )); // // Login box & swithes for logged in users? // /* if ( !$userdata['session_logged_in'] ) { $layouttemplate->assign_block_vars('switch_user_logged_out', array()); // // Allow autologin? // if (!isset($board_config['allow_autologin']) || $board_config['allow_autologin'] ) { $layouttemplate->assign_block_vars('switch_allow_autologin', array()); $layouttemplate->assign_block_vars('switch_user_logged_out.switch_allow_autologin', array()); } // // Show phpbb stats? // if ( $mx_page->phpbb_stats ) { $layouttemplate->assign_block_vars('phpbb_stats', array()); $layouttemplate->assign_block_vars('phpbb_stats.switch_user_logged_out', array()); } } else { $layouttemplate->assign_block_vars('switch_user_logged_in', array()); if ( !empty($userdata['user_popup_pm']) ) { $layouttemplate->assign_block_vars('switch_enable_pm_popup', array()); } // // Show phpbb stats? // if ( $mx_page->phpbb_stats ) { $layouttemplate->assign_block_vars('phpbb_stats', array()); $layouttemplate->assign_block_vars('phpbb_stats.switch_user_logged_in', array()); } } // // Handy switch for Admin // if ( $userdata['session_logged_in'] && $userdata['user_level'] == ADMIN ) { $layouttemplate->assign_block_vars('is_admin', array()); } // // Do NOT set basedir when in EDIT mode // if ( !$mx_request_vars->is_request('portalpage')) { $layouttemplate->assign_block_vars('switch_set_base', array()); } // // Determine if user have gecko/opera browser // $useragent = (isset($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT'); if ( strstr($useragent, 'Gecko') ) { $layouttemplate->assign_block_vars('switch_gecko', array()); } */ // // Navigation Menu in overall_header // if ($mx_page->auth_view || $mx_page->auth_mod) { if (!is_object($mx_block)) { $mx_block = new mx_block(); } $block_id = $mx_page->page_navigation_block; if(!empty($block_id) ) { define('MX_OVERALL_NAVIGATION', true); $mx_block->init( $block_id ); $mx_module_path = $module_root_path; // // Define $module_root_path, to be used within blocks // $module_root_path = $mx_root_path . $mx_block->module_root_path; $template = new mx_Template($mx_root_path . 'templates/'. $theme['template_name']); // // Include block file and cache output // ob_start(); include($module_root_path . $mx_block->block_file); $overall_navigation_menu = ob_get_contents(); ob_end_clean(); // // Output Block contents // $layouttemplate->assign_vars(array( 'OVERALL_NAVIGATION' => $overall_navigation_menu) ); if ( ( ( $mx_block->auth_view && $mx_block->auth_edit && $mx_block->show_block ) || $mx_block->auth_mod ) ) { $mx_block->output_cp_button(true); } $module_root_path = $mx_module_path; } } // Add no-cache control for cookies if they are set //$c_no_cache = (isset($_COOKIE[$board_config['cookie_name'] . '_sid']) || isset($_COOKIE[$board_config['cookie_name'] . '_data'])) ? 'no-cache="set-cookie", ' : ''; // Work around for "current" Apache 2 + PHP module which seems to not // cope with private cache control setting if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2')) { header ('Cache-Control: no-cache, pre-check=0, post-check=0'); } else { header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); } header ('Expires: 0'); header ('Pragma: no-cache'); $icongif = 'favicon.gif'; include($mx_root_path . 'mx_meta.inc'); $meta_str = '<meta name="title" content="' . $title .'" />' . "\n"; $meta_str .= '<meta name="author" content="' . $author .'" />' . "\n"; $meta_str .= '<meta name="copyright" content="' . $copyright .'" />' . "\n"; $meta_str .= '<meta name="keywords" content="' . $keywords .'" />' . "\n"; $meta_str .= '<meta name="description" lang="' . $langcode .'" content="'. $description .'" />' . "\n"; $meta_str .= '<link rel="shortcut icon" href="' . $icon .'" />' . "\n"; if (file_exists($mx_root_path . $icongif)) { $meta_str .= '<link rel="icon" href="' . $icongif .'" type="image/gif" />' . "\n"; } $meta_str .= '<meta name="category" content="' . $rating .'" />' . "\n"; $meta_str .= '<meta name="robots" content="' . $index . ',' . $follow .'" />' . "\n"; $meta_str .= $header . "\n"; $layouttemplate->assign_vars(array( 'META' => $meta_str) ); $layouttemplate->pparse('overall_header'); ?> Index: album_constants.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/includes/album_constants.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** album_constants.php 27 Mar 2008 14:31:01 -0000 1.9 --- album_constants.php 29 Aug 2008 05:58:23 -0000 1.10 *************** *** 175,178 **** define('ALBUM_WM_CACHE_PATH', $module_root_path . 'upload/wm_cache/'); define('ALBUM_WM_FILE', $module_root_path . 'album_mod/mark_fap.png'); ! } ?> \ No newline at end of file --- 175,178 ---- define('ALBUM_WM_CACHE_PATH', $module_root_path . 'upload/wm_cache/'); define('ALBUM_WM_FILE', $module_root_path . 'album_mod/mark_fap.png'); ! } ?> \ No newline at end of file Index: album_hierarchy_sql.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/includes/album_hierarchy_sql.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** album_hierarchy_sql.php 27 Mar 2008 14:31:01 -0000 1.4 --- album_hierarchy_sql.php 29 Aug 2008 05:58:23 -0000 1.5 *************** *** 774,778 **** // Write the Date ! $info = create_date2($board_config['default_dateformat'], $row['pic_time'], $board_config['board_timezone']); $info .= '<br />'; --- 774,778 ---- // Write the Date ! $info = album_create_date($board_config['default_dateformat'], $row['pic_time'], $board_config['board_timezone']); $info .= '<br />'; *************** *** 797,801 **** else { ! $info .= $lang['Pic_Poster'] . ': <a href="' . mx_append_sid(PHPBB_URL . 'profile.' . $phpEx . '?mode=viewprofile&' . POST_USERS_URL . '=' . $row['user_id']) . '">' . $row['username'] . '</a>'; } } --- 797,801 ---- else { ! $info .= $lang['Pic_Poster'] . ': ' . album_get_profile_url('full', $row['user_id'], $row['username'], false); } } *************** *** 936,940 **** $db->sql_freeresult($result); ! $info = create_date2($board_config['default_dateformat'], $row['comment_time'], $board_config['board_timezone']); $info .= '<br />' . $lang['Pic_Poster'] . ': '; --- 936,940 ---- $db->sql_freeresult($result); ! $info = album_create_date($board_config['default_dateformat'], $row['comment_time'], $board_config['board_timezone']); $info .= '<br />' . $lang['Pic_Poster'] . ': '; *************** *** 958,962 **** else { ! $info .= '<a href="' . mx_append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $row['user_id']) . '">' . $row['username'] . '</a>'; } } --- 958,962 ---- else { ! $info .= album_get_profile_url('full', $row['user_id'], $row['username'], false); } } *************** *** 1221,1225 **** else { ! $pic_poster = '<a href="'. mx_append_sid(PHPBB_URL . 'profile.' . $phpEx . '?mode=viewprofile&' . POST_USERS_URL .'='. $picrow[$j]['user_id']) .'">'. $picrow[$j]['username'] .'</a>'; } --- 1221,1225 ---- else { ! $pic_poster = album_get_profile_url('full', $picrow[$j]['user_id'], $picrow[$j]['username'], false); } *************** *** 1239,1243 **** 'TITLE' => '<a href = "' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $picrow[$j]['pic_id'])) . '">' . $picrow[$j]['pic_title'] . '</a>', 'POSTER' => $pic_poster, ! 'TIME' => create_date2($board_config['default_dateformat'], $picrow[$j]['pic_time'], $board_config['board_timezone']), 'VIEW' => $picrow[$j]['pic_view_count'], --- 1239,1243 ---- 'TITLE' => '<a href = "' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $picrow[$j]['pic_id'])) . '">' . $picrow[$j]['pic_title'] . '</a>', 'POSTER' => $pic_poster, ! 'TIME' => album_create_date($board_config['default_dateformat'], $picrow[$j]['pic_time'], $board_config['board_timezone']), 'VIEW' => $picrow[$j]['pic_view_count'], *************** *** 1255,1259 **** 'LOCK' => ($auth_data['moderator']) ? '<a href="'. mx_append_sid(this_smartor_mxurl("smartor_mode=album_modcp&mode=" . (($picrow[$j]['pic_lock'] == 0) ? 'lock' : 'unlock') . '&pic_id=' . $picrow[$j]['pic_id'])) .'">'. (($picrow[$j]['pic_lock'] == 0) ? $lang['Lock'] : $lang['Unlock']) .'</a>' : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . decode_ip2($picrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip2($picrow[$j]['pic_user_ip']) .'</a><br />' : '', 'AVATAR_PIC' => ( ($album_config['personal_allow_avatar_gallery'] == 1) && ($userdata['user_id'] == $picrow[$j]['pic_user_id']) ) ? '<br /><a href="'. mx_append_sid(this_smartor_mxurl("smartor_mode=album_avatar&pic_id=" . $picrow[$j]['pic_id'])) . '">' . $lang['Avatar_Set'] . '</a>' : '', --- 1255,1259 ---- 'LOCK' => ($auth_data['moderator']) ? '<a href="'. mx_append_sid(this_smartor_mxurl("smartor_mode=album_modcp&mode=" . (($picrow[$j]['pic_lock'] == 0) ? 'lock' : 'unlock') . '&pic_id=' . $picrow[$j]['pic_id'])) .'">'. (($picrow[$j]['pic_lock'] == 0) ? $lang['Lock'] : $lang['Unlock']) .'</a>' : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . album_decode_ip($picrow[$j]['pic_user_ip']) . '" target="_blank">' . album_decode_ip($picrow[$j]['pic_user_ip']) .'</a><br />' : '', 'AVATAR_PIC' => ( ($album_config['personal_allow_avatar_gallery'] == 1) && ($userdata['user_id'] == $picrow[$j]['pic_user_id']) ) ? '<br /><a href="'. mx_append_sid(this_smartor_mxurl("smartor_mode=album_avatar&pic_id=" . $picrow[$j]['pic_id'])) . '">' . $lang['Avatar_Set'] . '</a>' : '', *************** *** 1421,1425 **** else { ! $recent_poster = '<a href="'. mx_append_sid(PHPBB_URL. 'profile.' . $phpEx . '?mode=viewprofile&' . POST_USERS_URL .'='. $recentrow[$j]['user_id']) .'">'. $recentrow[$j]['username'] .'</a>'; } --- 1421,1425 ---- else { ! $recent_poster = album_get_profile_url('full', $recentrow[$j]['user_id'], $recentrow[$j]['username'], false); } *************** *** 1435,1439 **** 'TITLE' => '<a href = "' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $recentrow[$j]['pic_id'])) . '">' . $recentrow[$j]['pic_title'] . '</a>', 'POSTER' => $recent_poster, ! 'TIME' => create_date2($board_config['default_dateformat'], $recentrow[$j]['pic_time'], $board_config['board_timezone']), 'VIEW' => $recentrow[$j]['pic_view_count'], --- 1435,1439 ---- 'TITLE' => '<a href = "' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $recentrow[$j]['pic_id'])) . '">' . $recentrow[$j]['pic_title'] . '</a>', 'POSTER' => $recent_poster, ! 'TIME' => album_create_date($board_config['default_dateformat'], $recentrow[$j]['pic_time'], $board_config['board_timezone']), 'VIEW' => $recentrow[$j]['pic_view_count'], *************** *** 1443,1447 **** 'COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $recentrow[$j]['pic_id'])) . '">' . $lang['Comments'] . '</a>: ' . $image_comment . '<br />') : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . decode_ip2($recentrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip2($recentrow[$j]['pic_user_ip']) .'</a><br />' : '' ) ); --- 1443,1447 ---- 'COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $recentrow[$j]['pic_id'])) . '">' . $lang['Comments'] . '</a>: ' . $image_comment . '<br />') : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . album_decode_ip($recentrow[$j]['pic_user_ip']) . '" target="_blank">' . album_decode_ip($recentrow[$j]['pic_user_ip']) .'</a><br />' : '' ) ); *************** *** 1594,1598 **** else { ! $highest_poster = '<a href="' . mx_append_sid(PHPBB_URL . 'profile.' . $phpEx . '?mode=viewprofile&' . POST_USERS_URL . '=' . $highestrow[$j]['user_id']) . '">' . $highestrow[$j]['username'] . '</a>'; } --- 1594,1598 ---- else { ! $highest_poster = album_get_profile_url('full', $highestrow[$j]['user_id'], $highestrow[$j]['username'], false); } *************** *** 1611,1615 **** 'H_TITLE' => '<a href = "' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $highestrow[$j]['pic_id'])) . '">' . $highestrow[$j]['pic_title'] . '</a>', 'H_POSTER' => $highest_poster, ! 'H_TIME' => create_date2($board_config['default_dateformat'], $highestrow[$j]['pic_time'], $board_config['board_timezone']), 'H_VIEW' => $highestrow[$j]['pic_view_count'], --- 1611,1615 ---- 'H_TITLE' => '<a href = "' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $highestrow[$j]['pic_id'])) . '">' . $highestrow[$j]['pic_title'] . '</a>', 'H_POSTER' => $highest_poster, ! 'H_TIME' => album_create_date($board_config['default_dateformat'], $highestrow[$j]['pic_time'], $board_config['board_timezone']), 'H_VIEW' => $highestrow[$j]['pic_view_count'], *************** *** 1619,1623 **** 'H_COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $highestrow[$j]['pic_id'])) . '">' . $lang['Comments'] . '</a>: ' . $image_comment . '<br />') : '', ! 'H_IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . decode_ip2($highestrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip2($highestrow[$j]['pic_user_ip']) .'</a><br />' : '' ) ); --- 1619,1623 ---- 'H_COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $highestrow[$j]['pic_id'])) . '">' . $lang['Comments'] . '</a>: ' . $image_comment . '<br />') : '', ! 'H_IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . album_decode_ip($highestrow[$j]['pic_user_ip']) . '" target="_blank">' . album_decode_ip($highestrow[$j]['pic_user_ip']) .'</a><br />' : '' ) ); *************** *** 1760,1764 **** else { ! $mostviewed_poster = '<a href="' . mx_append_sid(PHPBB_URL . 'profile.' . $phpEx . '?mode=viewprofile&' . POST_USERS_URL . '=' . $mostviewed[$j]['user_id']) . '">' . $mostviewed[$j]['username'] . '</a>'; } --- 1760,1764 ---- else { ! $mostviewed_poster = album_get_profile_url('full', $mostviewed[$j]['user_id'], $mostviewed[$j]['username'], false); } *************** *** 1774,1778 **** 'H_TITLE' => '<a href = "' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $mostviewed[$j]['pic_id'])) . '">' . $mostviewed[$j]['pic_title'] . '</a>', 'H_POSTER' => $mostviewed_poster, ! 'H_TIME' => create_date2($board_config['default_dateformat'], $mostviewed[$j]['pic_time'], $board_config['board_timezone']), 'H_VIEW' => $mostviewed[$j]['pic_view_count'], --- 1774,1778 ---- 'H_TITLE' => '<a href = "' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $mostviewed[$j]['pic_id'])) . '">' . $mostviewed[$j]['pic_title'] . '</a>', 'H_POSTER' => $mostviewed_poster, ! 'H_TIME' => album_create_date($board_config['default_dateformat'], $mostviewed[$j]['pic_time'], $board_config['board_timezone']), 'H_VIEW' => $mostviewed[$j]['pic_view_count'], *************** *** 1782,1786 **** 'H_COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $mostviewed[$j]['pic_id'])) . '">' . $lang['Comments'] . '</a>: ' . $image_comment . '<br />') : '', ! 'H_IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . decode_ip2($mostviewed[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip2($mostviewed[$j]['pic_user_ip']) .'</a><br />' : '' ) ); --- 1782,1786 ---- 'H_COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $mostviewed[$j]['pic_id'])) . '">' . $lang['Comments'] . '</a>: ' . $image_comment . '<br />') : '', ! 'H_IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . album_decode_ip($mostviewed[$j]['pic_user_ip']) . '" target="_blank">' . album_decode_ip($mostviewed[$j]['pic_user_ip']) .'</a><br />' : '' ) ); *************** *** 1916,1920 **** else { ! $rand_poster = '<a href="' . mx_append_sid(PHPBB_URL . 'profile.' . $phpEx . '?mode=viewprofile&' . POST_USERS_URL . '=' . $randrow[$j]['user_id']) . '">' . $randrow[$j]['username'] . '</a>'; } --- 1916,1920 ---- else { ! $rand_poster = album_get_profile_url('full', $randrow[$j]['user_id'], $randrow[$j]['username'], false); } *************** *** 1930,1934 **** 'TITLE' => '<a href = "' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $randrow[$j]['pic_id'])) . '">' . $randrow[$j]['pic_title'] . '</a>', 'POSTER' => $rand_poster, ! 'TIME' => create_date2($board_config['default_dateformat'], $randrow[$j]['pic_time'], $board_config['board_timezone']), 'VIEW' => $randrow[$j]['pic_view_count'], --- 1930,1934 ---- 'TITLE' => '<a href = "' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $randrow[$j]['pic_id'])) . '">' . $randrow[$j]['pic_title'] . '</a>', 'POSTER' => $rand_poster, ! 'TIME' => album_create_date($board_config['default_dateformat'], $randrow[$j]['pic_time'], $board_config['board_timezone']), 'VIEW' => $randrow[$j]['pic_view_count'], *************** *** 1938,1942 **** 'COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $randrow[$j]['pic_id'])) . '">' . $lang['Comments'] . '</a>: ' . $image_comment . '<br />') : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . decode_ip2($randrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip2($randrow[$j]['pic_user_ip']) .'</a><br />' : '' ) ); --- 1938,1942 ---- 'COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $randrow[$j]['pic_id'])) . '">' . $lang['Comments'] . '</a>: ' . $image_comment . '<br />') : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . album_decode_ip($randrow[$j]['pic_user_ip']) . '" target="_blank">' . album_decode_ip($randrow[$j]['pic_user_ip']) .'</a><br />' : '' ) ); *************** *** 2048,2052 **** else { ! $poster = '<a href="' . mx_append_sid(PHPBB_URL . 'profile.' . $phpEx . '?mode=viewprofile&' . POST_USERS_URL . '=' . $commentsrow[$i]['user_id']) . '">' . $commentsrow[$i]['username'] . '</a>'; } --- 2048,2052 ---- else { ! $poster = '<a href="' . album_get_profile_url('full', $commentsrow[$i]['user_id'], $commentsrow[$i]['username'], false); } *************** *** 2130,2138 **** 'TITLE' => '<a href = "' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $commentsrow[$i]['pic_id'])) . '">' . $commentsrow[$i]['pic_title'] . '</a>', 'POSTER' => $poster, ! 'TIME' => create_date2($board_config['default_dateformat'], $commentsrow[$i]['comment_time'], $board_config['board_timezone']), 'VIEW' => $commentsrow[$i]['pic_view_count'], 'RATING' => ($album_config['rate'] == 1) ? ( '<a href="'. mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $commentsrow[$i]['pic_id'])) . '" ' . $image_rating_link_style .'>' . $lang['Rating'] . '</a>: ' . $image_rating . '<br />') : '', 'COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $commentsrow[$i]['pic_id'])) . '">' . $lang['Comments'] . '</a>: ' . $image_comment . '<br />') : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . decode_ip2($commentsrow[$i]['pic_user_ip']) . '" target="_blank">' . decode_ip2($commentsrow[$i]['pic_user_ip']) .'</a><br />' : '' ) ); --- 2130,2138 ---- 'TITLE' => '<a href = "' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $commentsrow[$i]['pic_id'])) . '">' . $commentsrow[$i]['pic_title'] . '</a>', 'POSTER' => $poster, ! 'TIME' => album_create_date($board_config['default_dateformat'], $commentsrow[$i]['comment_time'], $board_config['board_timezone']), 'VIEW' => $commentsrow[$i]['pic_view_count'], 'RATING' => ($album_config['rate'] == 1) ? ( '<a href="'. mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $commentsrow[$i]['pic_id'])) . '" ' . $image_rating_link_style .'>' . $lang['Rating'] . '</a>: ' . $image_rating . '<br />') : '', 'COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="' . mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage&pic_id=" . $commentsrow[$i]['pic_id'])) . '">' . $lang['Comments'] . '</a>: ' . $image_comment . '<br />') : '', ! 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://whois.sc/' . album_decode_ip($commentsrow[$i]['pic_user_ip']) . '" target="_blank">' . album_decode_ip($commentsrow[$i]['pic_user_ip']) .'</a><br />' : '' ) ); Index: album_functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/includes/album_functions.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** album_functions.php 27 Mar 2008 14:31:01 -0000 1.4 --- album_functions.php 29 Aug 2008 05:58:23 -0000 1.5 *************** *** 20,60 **** ! if(!function_exists(create_date2)) { ! if(!function_exists(create_date)) { ! function create_date2($format, $gmepoch, $tz) { ! return phpBB2::create_date($format, $gmepoch, $tz); } } else { ! function create_date2($format, $gmepoch, $tz) ! { ! return create_date($format, $gmepoch, $tz); ! } } } ! if(!function_exists(decode_ip2)) { ! if(!function_exists(decode_ip)) { ! function decode_ip2($int_ip) ! { ! return phpBB2::decode_ip($int_ip); ! } } else { ! function decode_ip2($int_ip) { ! return decode_ip($int_ip); } } } - // ---------------------------------------------------------------------------- // This function will return the access data of the current user for a category --- 20,339 ---- ! function album_encode_ip($dotquad_ip) { ! $ip_sep = @explode('.', $dotquad_ip); ! return sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]); ! } ! ! function album_decode_ip($int_ip) ! { ! $hexipbang = @explode('.', chunk_split($int_ip, 2, '.')); ! return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]); ! } ! ! // ! // Create date/time from format and timezone ! // ! function album_create_date($format, $gmepoch, $tz) ! { ! global $board_config, $lang; ! static $translate; ! ! if ( empty($translate) && $board_config['default_lang'] != 'english' ) { ! @reset($lang['datetime']); ! while ( list($match, $replace) = @each($lang['datetime']) ) { ! $translate[$match] = $replace; } } + + return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz)); + } + + /** + * Get userdata + * + * Get Userdata, $user can be username or user_id. If force_str is true, the username will be forced. + * Cached sql, since this function is used for every block. + * + * @param unknown_type $user id or name + * @param boolean $force_str force clean_username + * @return array + */ + function album_get_userdata($user, $force_str = false) + { + global $db; + + if (!is_numeric($user) || $force_str) + { + $user = phpBB2::phpbb_clean_username($user); + } else { ! $user = intval($user); } + + $sql = "SELECT * + FROM " . USERS_TABLE . " + WHERE "; + $sql .= ( ( is_integer($user) ) ? "user_id = $user" : "username = '" . str_replace("\'", "''", $user) . "'" ) . " AND user_id <> " . ANONYMOUS; + if ( !($result = $db->sql_query($sql, 120)) ) + { + mx_message_die(GENERAL_ERROR, 'Tried obtaining data for a non-existent user', '', __LINE__, __FILE__, $sql); + } + + $return = ($row = $db->sql_fetchrow($result)) ? $row : false; + $db->sql_freeresult($result); + return $return; } ! function album_get_username_string($mode, $user_id, $username, $username_colour = '') { ! global $phpbb_root_path, $phpEx, $mx_user, $phpbb_auth; ! ! $profile_url = ''; ! $username_colour = ($username_colour) ? '#' . $username_colour : ''; ! ! if ($guest_username === false) { ! $username = ($username) ? $username : $mx_user->lang['GUEST']; } else { ! $username = ($user_id && $user_id != ANONYMOUS) ? $username : ((!empty($guest_username)) ? $guest_username : $mx_user->lang['GUEST']); ! } ! ! // Only show the link if not anonymous ! if ($user_id && $user_id != ANONYMOUS) ! { ! $profile_url = mx3_append_sid(PHPBB_URL . "memberlist.$phpEx", 'mode=viewprofile&u=' . (int) $user_id); ! } ! else ! { ! $profile_url = ''; ! } ! ! switch ($mode) ! { ! case 'profile': ! return $profile_url; ! break; ! ! case 'username': ! return $username; ! break; ! ! case 'colour': ! return $username_colour; ! break; ! ! case 'full': ! default: ! ! $tpl = ''; ! if (!$profile_url && !$username_colour) ! { ! $tpl = '{USERNAME}'; ! } ! else if (!$profile_url && $username_colour) ! { ! $tpl = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>'; ! } ! else if ($profile_url && !$username_colour) ! { ! $tpl = '<a href="{PROFILE_URL}">{USERNAME}</a>'; ! } ! else if ($profile_url && $username_colour) ! { ! $tpl = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>'; ! } ! ! return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), $tpl); ! break; ! } ! } ! ! function album_get_profile_url($mode, $user_id, $username = false, $user_color = false) ! { ! global $userdata; ! ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! ! $album_userdata = album_get_userdata($user_id, false); ! $username = ($username) ? $username : $album_userdata['username']; ! ! if ($album_userdata['user_level'] == ADMIN) ! { ! $user_color = $theme['fontcolor3']; ! $user_style = 'style="color:#' . $user_color . '; font-weight : bold;"'; ! } ! else if ($album_userdata['user_level'] == MOD) ! { ! $user_color = $theme['fontcolor2']; ! $user_style = 'style="color:#' . $user_color . '; font-weight : bold;"'; ! } ! else ! { ! $user_colour = $theme['fontcolor1']; ! $topic_poster_style = 'style="font-weight : bold;"'; ! } ! ! $profile_url = ''; ! ! $full_url = ($user_id == ANONYMOUS) ? '<span ' . $topic_poster_style . '>' . $lang['Guest'] . '</span>' : '<span ' . $topic_poster_style . '>' . $username . '</span>'; ! ! break; ! ! case 'phpbb2': ! ! $album_userdata = album_get_userdata($user_id, false); ! ! $username = ($username) ? $username : $album_userdata['username']; ! ! if ($album_userdata['user_level'] == ADMIN) ! { ! $user_color = $theme['fontcolor3']; ! $user_style = 'style="color:#' . $user_color . '; font-weight : bold;"'; ! } ! else if ($album_userdata['user_level'] == MOD) ! { ! $user_color = $theme['fontcolor2']; ! $user_style = 'style="color:#' . $user_color . '; font-weight : bold;"'; ! } ! else ! { ! $user_colour = $theme['fontcolor1']; ! $topic_poster_style = 'style="font-weight : bold;"'; ! } ! ! // Only show the link if not anonymous ! if ($user_id && $user_id != ANONYMOUS) ! { ! $profile_url = mx3_append_sid(PHPBB_URL . "profile.$phpEx", 'mode=viewprofile&u=' . (int) $user_id); ! $full_url = '<a href="' . $profile_url . '"><span ' . $topic_poster_style . '>' . $username . '</span></a>'; ! } ! else ! { ! $profile_url = $lang['Guest']; ! $full_url = $lang['Guest']; ! } ! ! ! break; ! ! case 'phpbb3': ! ! if (($username == false) || ($user_color == false)) ! { ! $album_userdata = album_get_userdata($user_id, false); ! $user_id = $album_userdata['user_id']; ! $username = $album_userdata['username']; ! $user_colour = $album_userdata['user_colour']; ! } ! $full_url = album_get_username_string('full', $user_id, $username, $user_colour); ! $profile_url = album_get_username_string('profile', $user_id, $username, $user_colour); ! break; ! } ! ! switch ($mode) ! { ! case 'profile': ! return $profile_url; ! break; ! ! case 'username': ! return $username; ! break; ! ! case 'colour': ! return $user_colour; ! break; ! ! case 'full': ! default: ! return $full_url; ! break; ! } ! } ! ! function album_comment_sql_smilies($auth_data) ! { ! global $db, $template, $board_config; ! ! $inline_columns = 6; ! $max_smilies = 42; ! ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! $smiley_path_url = PHPBB_URL; //change this to PORTAL_URL when shared folder will be removed ! $fields = 'smilies'; ! $smiley_url = 'smile_url'; ! $emotion = 'emoticon'; ! $table = SMILIES_TABLE; ! break; ! case 'phpbb2': ! $smiley_path_url = PHPBB_URL; ! $fields = 'smilies'; ! $smiley_url = 'smile_url'; ! $emotion = 'emoticon'; ! $table = SMILIES_TABLE; ! break; ! case 'phpbb3': ! $smiley_path_url = PHPBB_URL; ! $fields = 'smiley'; ! $smiley_url = 'smiley_url'; ! $emotion = 'emotion'; ! $table = SMILIES_TABLE; ! $board_config['smilies_path'] = str_replace("smiles", "smilies", $board_config['smilies_path']); ! break; ! } ! ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! case 'phpbb2': ! $sql = 'SELECT * ! FROM ' . $table . ' ! GROUP BY ' . $smiley_url . ' ! ORDER BY smilies_id'; ! break; ! ! case 'phpbb3': ! $sql = 'SELECT * ! FROM ' . $table . ' ! GROUP BY code ! ORDER BY smiley_order'; ! break; ! } ! ! if (!$result = $db->sql_query_limit($sql, $max_smilies)) ! { ! mx_message_die(GENERAL_ERROR, "Couldn't retrieve smilies list", '', __LINE__, __FILE__, $sql); ! } ! $smilies_count = $db->sql_numrows($result); ! $smilies_data = $db->sql_fetchrowset($result); ! ! if ($auth_data == true) ! { ! for ($i = 1; $i < $smilies_count + 1; $i++) { ! $template->assign_block_vars('switch_comment_post.smilies', array( ! 'CODE' => $smilies_data[$i - 1]['code'], ! 'URL' => $smiley_path_url . $board_config['smilies_path'] . '/' . $smilies_data[$i - 1][$smiley_url], ! 'DESC' => $smilies_data[$i - 1][$emotion] ! )); ! if ( is_integer($i / $inline_columns) ) ! { ! $template->assign_block_vars('switch_comment_post.smilies.new_col', array()); ! } } } + } // ---------------------------------------------------------------------------- // This function will return the access data of the current user for a category *************** *** 753,791 **** } ! //to have smilies window popup ! function generate_smilies_album($mode, $page_id) //borrowed from phpbbforums...modified to work with album { ! global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path, $mx_root_path; ! global $user_ip, $session_length, $starttime; ! global $userdata; ! // Vars needed for CH 2.1.4 ! global $config, $user, $censored_words, $icons, $navigation, $themes, $smilies; ! ! $inline_columns = 4; $inline_rows = 5; $window_columns = 8; ! if ($mode == 'window') ! { ! //$userdata = session_pagestart( $user_ip, $page_id ); ! //init_userprefs( $userdata ); ! ! $gen_simple_header = true; ! ! $page_title = "Smilies"; ! if ( !$is_block) ! { ! include($mx_root_path . 'includes/page_header.'.$phpEx); ! } ! $template->set_filenames(array( ! 'smiliesbody' => 'album_posting_smilies.tpl') ! ); } - $sql = "SELECT emoticon, code, smile_url - FROM " . SMILIES_TABLE . " - ORDER BY smilies_id"; if ($result = $db->sql_query($sql)) { --- 1032,1106 ---- } ! /** ! * Generate phpBB 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_album($mode, $forum_id) { ! global $mx_page, $board_config, $template, $mx_root_path, $phpbb_root_path, $phpEx; ! global $db, $lang, $images, $theme, $layouttemplate, $mx_request_vars, $module_root_path; ! global $user_ip, $session_length, $starttime, $tplEx; ! global $userdata, $phpbb_auth, $mx_user, $mx_backend; ! ! $inline_columns = 9; $inline_rows = 5; $window_columns = 8; + $page_title = 'Emoticons'; + + include_once($module_root_path . 'album_mod/includes/album_header.'.$phpEx); ! $template->set_filenames(array( ! 'smiliesbody' => 'album_posting_smilies.'.$tplEx) ! ); ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! $smiley_path_url = PHPBB_URL; //change this to PORTAL_URL when shared folder will be removed ! $fields = 'smilies'; ! $smiley_url = 'smile_url'; ! $emotion = 'emoticon'; ! $table = SMILIES_TABLE; ! break; ! case 'phpbb2': ! $smiley_path_url = PHPBB_URL; ! $fields = 'smilies'; ! $smiley_url = 'smile_url'; ! $emotion = 'emoticon'; ! $table = SMILIES_TABLE; ! break; ! case 'phpbb3': ! $smiley_path_url = PHPBB_URL; ! $fields = 'smiley'; ! $smiley_url = 'smiley_url'; ! $emotion = 'emotion'; ! $table = SMILIES_TABLE; ! $board_config['smilies_path'] = str_replace("smiles", "smilies", $board_config['smilies_path']); ! break; ! } ! ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! case 'phpbb2': ! $sql = 'SELECT * ! FROM ' . $table . ' ! GROUP BY ' . $smiley_url . ' ! ORDER BY smilies_id'; ! break; ! case 'phpbb3': ! $sql = 'SELECT * ! FROM ' . $table . ' ! ORDER BY smiley_order'; ! break; } if ($result = $db->sql_query($sql)) { *************** *** 794,801 **** 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++; } --- 1109,1116 ---- while ($row = $db->sql_fetchrow($result)) { ! if (empty($rowset[$row[$smiley_url]])) { ! $rowset[$row[$smiley_url]]['code'] = str_replace("'", "\\'", str_replace('\\', '\\\\', $row['code'])); ! $rowset[$row[$smiley_url]][$emotion] = $row[$emotion]; $num_smilies++; } *************** *** 820,825 **** $template->assign_block_vars('smilies_row.smilies_col', array( 'SMILEY_CODE' => $data['code'], ! 'SMILEY_IMG' => $phpbb_root_path . $board_config['smilies_path'] . '/' . $smile_url, ! 'SMILEY_DESC' => $data['emoticon']) ); --- 1135,1140 ---- $template->assign_block_vars('smilies_row.smilies_col', array( 'SMILEY_CODE' => $data['code'], ! 'SMILEY_IMG' => $smiley_path_url . $board_config['smilies_path'] . '/' . $smile_url, ! 'SMILEY_DESC' => $data[$emoticon]) ); *************** *** 828,832 **** if ($col == $smilies_split_row) { ! if ( ($mode == 'inline') && ($row == $inline_rows - 1) ) { break; --- 1143,1147 ---- if ($col == $smilies_split_row) { ! if ($mode == 'inline' && $row == $inline_rows - 1) { break; *************** *** 841,845 **** } ! if ( ($mode == 'inline') && ($num_smilies > $inline_rows * $inline_columns) ) { $template->assign_block_vars('switch_smilies_extra', array()); --- 1156,1160 ---- } ! if ($mode == 'inline' && $num_smilies > $inline_rows * $inline_columns) { $template->assign_block_vars('switch_smilies_extra', array()); *************** *** 847,851 **** $template->assign_vars(array( 'L_MORE_SMILIES' => $lang['More_emoticons'], ! 'U_MORE_SMILIES' => mx_append_sid($phpbb_root_path . "posting.$phpEx?mode=smilies")) ); } --- 1162,1166 ---- $template->assign_vars(array( 'L_MORE_SMILIES' => $lang['More_emoticons'], ! 'U_MORE_SMILIES' => mx3_append_sid(PHPBB_URL . "posting.$phpEx", "mode=smilies")) ); } *************** *** 861,872 **** if ($mode == 'window') { ! $template->pparse('smiliesbody'); ! ! if ( !$is_block) ! { ! include($mx_root_path . 'includes/page_tail.'.$phpEx); ! } ! } } --- 1176,1187 ---- if ($mode == 'window') { ! $template->pparse('smiliesbody'); ! } ! else ! { ! die("Mode is $mode and not 'window' ..."); } + + include_once($module_root_path . 'album_mod/includes/album_tail.'.$phpEx); } *************** *** 935,938 **** --- 1250,1295 ---- } + /** + * Enter description here... + * + */ + function album_page_header() + { + global $album_config, $lang, $template, $userdata, $images, $mx_user, $mx_request_vars; + global $template, $db, $theme, $gen_simple_header, $starttime, $phpEx, $tplEx, $board_config, $user_ip; + global $admin_level, $level_prior, $tree, $do_gzip_compress, $album_root_path; + global $phpbb_root_path, $mx_root_path, $module_root_path, $is_block, $title, $mx_block, $mx_page; + global $mode, $page_title; + + if (($mode != 'album_download') || ($mode != 'album_rss') || ($mode != 'album_rdf') || ($mode != 'album_pic') || ($mode != 'album_picm') || ($mode != 'album_thumbnail')) + { + if (!$is_block) + { + $gen_simple_header = true; + include_once($album_root_path . "includes/album_header.$phpEx"); + } + } + } + + /** + * Enter description here... + * + */ + function album_page_footer() + { + global $album_config, $lang, $template, $board_config, $userdata; + global $phpEx, $tplEx, $template, $do_gzip_compress, $debug, $db, $album_root_path, $starttime; + global $phpbb_root_path, $mx_root_path, $module_root_path, $is_block, $page_id, $mx_block, $mx_page; + global $mode; + + if (($mode != 'album_download') || ($mode != 'album_rss') || ($mode != 'album_rdf') || ($mode != 'album_pic') || ($mode != 'album_picm') || ($mode != 'album_thumbnail')) + { + if (!$is_block) + { + include_once($album_root_path . "includes/album_tail.$phpEx"); + } + } + } + // +------------------------------------------------------+ // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | --- NEW FILE: album_tail.php --- <?php /** * * @package page_tail * @version $Id: album_tail.php,v 1.1 2008/08/29 05:58:23 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 * @internal * */ if ( !defined('IN_PORTAL') ) { die('Hacking attempt'); } global $do_gzip_compress; $template->set_filenames(array( 'overall_footer' => "album_footer.$tplEx" )); $mxbb_footer_text = $lang['mx_about_title']; $mxbb_footer_text_url = PORTAL_URL . 'index.' . $phpEx . '?sid=' . $userdata['session_id'] . '&mx_copy=true'; $template->assign_vars(array( 'U_PORTAL_ROOT_PATH' => PORTAL_URL, 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, 'MXBB_EXTRA' => $mxbb_footer_text, 'MXBB_EXTRA_URL' => $mxbb_footer_text_url, 'SITENAME' => $board_config['sitename'], 'POWERED_BY' => $lang['Powered_by'], 'MX_VERSION' => ($userdata['user_level'] == ADMIN && $userdata['user_id'] != ANONYMOUS) ? PORTAL_VERSION : '' )); $template->pparse('overall_footer'); // // Close the mx_page class // $mx_page->_core(); // // Unload cache, must be done before the DB connection is closed // if (!empty($mx_cache)) { $mx_cache->unload(); } // // Close our DB connection. // $db->sql_close(); exit; ?> Index: a... [truncated message content] |