function FlashChatBridge_user_showChat() { // perform permission check if (!SecurityUtil::checkPermission('FlashChatBridge::', '::', ACCESS_READ)) { return LogUtil::registerPermissionError(); } $popup = FormUtil::getPassedValue('popup', false); // Security check $render =& pnRender::getInstance('FlashChatBridge', false); $UserVars = pnUserGetVars(SessionUtil::getVar('uid')); $client_type = FormUtil::getPassedValue('client_type', 'standard'); $settings = pnModGetVar('FlashChatBridge'); $settings['init_user'] = $UserVars['uname']; $settings['init_password'] = $UserVars['pass']; if ($settings['autosize'] == 1) { $settings['width'] = "100%"; $settings['height'] = "100%"; } if ($popup) { $settings['width'] = "100%"; $settings['height'] = "100%"; $render->assign('settings', $settings); $chat = $render->fetch("flashchatbridge_user_chat_{$client_type}.htm"); $render->assign('chat', $chat); echo $render->fetch('flashchatbridge_user_popup.htm'); exit; } else { $render->assign('settings', $settings); return $render->fetch("flashchatbridge_user_chat_{$client_type}.htm"); } }
/** * display block * * @param array $blockinfo a blockinfo structure * @return output the rendered bock */ function FlashChatBridge_Bannerchatblock_display($blockinfo) { if (!SecurityUtil::checkPermission('FlashChatBridge:Bannerchatblock:', "::", ACCESS_READ)) { return false; } if (!pnModAvailable('FlashChatBridge') || !pnUserLoggedIn()) { return false; } $render = pnRender::getInstance('FlashChatBridge', false); $UserVars = pnUserGetVars(SessionUtil::getVar('uid')); $settings = pnModGetVar('FlashChatBridge'); $settings['init_user'] = $UserVars['uname']; $settings['init_password'] = $UserVars['pass']; $settings['width'] = "100%"; $settings['height'] = "150"; $render->assign('settings', $settings); $blockinfo['content'] = $render->fetch('flashchatbridge_user_chat_banner.htm'); return pnBlockThemeBlock($blockinfo); }
/** * get a user variable * * @public * @author Jim McDonald * @param name $ the name of the variable * @param uid $ the user to get the variable for * @return string the value of the user variable if successful, false otherwise */ function pnUserGetVar($name, $uid = -1) { static $vars = array(); if (empty($name)) { return; } // bug fix #1311 [landseer] if (isset($uid) && !is_numeric($uid)) { return; } if ($uid == -1) { $uid = pnSessionGetVar('uid'); } if (empty($uid)) { return; } // Get this user's variables if not already obtained if (!isset($vars[$uid])) { $vars[$uid] = pnUserGetVars($uid); } // Return the variable if (isset($vars[$uid][$name])) { return $vars[$uid][$name]; } else { return; } }
/** * 123FlashChat Admin main page * @return HTML */ function FlashChatBridge_admin_flashchatadmin() { // Security check if (!SecurityUtil::checkPermission('FlashChatBridge::', '::', ACCESS_ADMIN)) { return LogUtil::registerPermissionError(); } $render =& pnRender::getInstance('FlashChatBridge', false); $UserVars = pnUserGetVars(SessionUtil::getVar('uid')); $settings = pnModGetVar('FlashChatBridge'); $settings['init_user'] = $UserVars['uname']; $settings['init_password'] = $UserVars['pass']; if ($settings['autosize'] == 1) { $settings['width'] = "100%"; $settings['height'] = "100%"; } $render->assign('settings', $settings); return $render->fetch('flashchatbridge_admin_flashchatadmin.htm'); }
/** * add core data to the template * * This function adds some basic data to the template depending on the * current user and the PN settings. * * @param list of module names. all mod vars of these modules will be included too The mod vars of the current module will always be included * @return boolean true if ok, otherwise false * @access public */ function add_core_data() { $pncore = array(); $pncore['version_num'] = _PN_VERSION_NUM; $pncore['version_id'] = _PN_VERSION_ID; $pncore['version_sub'] = _PN_VERSION_SUB; $pncore['logged_in'] = pnUserLoggedIn(); $pncore['language'] = pnUserGetLang(); $pncore['themeinfo'] = pnThemeInfo(pnUserGetTheme()); pnThemeLoad($pncore['themeinfo']['name']); $colors = array(); $colors['bgcolor1'] = pnThemeGetVar('bgcolor1'); $colors['bgcolor2'] = pnThemeGetVar('bgcolor2'); $colors['bgcolor3'] = pnThemeGetVar('bgcolor3'); $colors['bgcolor4'] = pnThemeGetVar('bgcolor4'); $colors['bgcolor5'] = pnThemeGetVar('bgcolor5'); $colors['sepcolor'] = pnThemeGetVar('sepcolor'); $colors['textcolor1'] = pnThemeGetVar('textcolor1'); $colors['textcolor2'] = pnThemeGetVar('textcolor2'); // add userdata $pncore['user'] = pnUserGetVars(pnSessionGetVar('uid')); // add modvars of current module $pncore[$this->module] = pnModGetVar($this->module); // add mod vars of all modules supplied as parameter foreach (func_get_args() as $modulename) { // if the modulename is empty do nothing if (!empty($modulename) && !is_array($modulename) && $modulename != $this->module) { // check if user wants to have /PNConfig if ($modulename == _PN_CONFIG_MODULE) { $pnconfig = pnModGetVar(_PN_CONFIG_MODULE); foreach ($pnconfig as $key => $value) { // unserialize all config vars $pncore['pnconfig'][$key] = @unserialize($value); } } else { $pncore[$modulename] = pnModGetVar($modulename); } } } $this->assign('pncore', $pncore); $this->assign($colors); return true; }