• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP xoops_gethandler函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中xoops_gethandler函数的典型用法代码示例。如果您正苦于以下问题:PHP xoops_gethandler函数的具体用法?PHP xoops_gethandler怎么用?PHP xoops_gethandler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了xoops_gethandler函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: xoonips_session_regenerate

function xoonips_session_regenerate()
{
    $old_sessid = session_id();
    session_regenerate_id();
    $new_sessid = session_id();
    session_id($old_sessid);
    session_destroy();
    $old_session = $_SESSION;
    session_id($new_sessid);
    $sess_handler =& xoops_gethandler('session');
    session_set_save_handler(array(&$sess_handler, 'open'), array(&$sess_handler, 'close'), array(&$sess_handler, 'read'), array(&$sess_handler, 'write'), array(&$sess_handler, 'destroy'), array(&$sess_handler, 'gc'));
    session_start();
    $_SESSION = array();
    foreach (array_keys($old_session) as $key) {
        $_SESSION[$key] = $old_session[$key];
    }
    // write and close session for xnp_is_valid_session_id()
    session_write_close();
    // restart session
    session_set_save_handler(array(&$sess_handler, 'open'), array(&$sess_handler, 'close'), array(&$sess_handler, 'read'), array(&$sess_handler, 'write'), array(&$sess_handler, 'destroy'), array(&$sess_handler, 'gc'));
    session_start();
    $_SESSION = array();
    foreach (array_keys($old_session) as $key) {
        $_SESSION[$key] = $old_session[$key];
    }
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:26,代码来源:session.php


示例2: fetchSummary

 function fetchSummary($external_link_id)
 {
     $db =& Database::getInstance();
     $myts =& MyTextsanitizer::getInstance();
     $module_handler =& xoops_gethandler('module');
     $module =& $module_handler->getByDirname($this->mydirname);
     $storyid = intval($external_link_id);
     $mydirname = $this->mydirname;
     if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
         die('Invalid mydirname');
     }
     $mytrustdirpath = dirname(dirname(__FILE__));
     require_once dirname(dirname(__FILE__)) . '/class/bulletin.php';
     if (Bulletin::isPublishedExists($mydirname, $storyid)) {
         $article = new Bulletin($mydirname, $storyid);
         $subject4assign = $article->getVar('title');
         $summary = $article->getVar('hometext');
         if (function_exists('easiestml')) {
             $summary = easiestml($summary);
         }
         $summary4assign = htmlspecialchars(xoops_substr($this->unhtmlspecialchars(strip_tags($summary)), 0, 255), ENT_QUOTES);
     } else {
         $subject4assign = '';
         $summary4assign = '';
     }
     return array('dirname' => $mydirname, 'module_name' => $module->getVar('name'), 'subject' => $subject4assign, 'uri' => XOOPS_URL . '/modules/' . $mydirname . '/index.php?page=article&storyid=' . $storyid, 'summary' => $summary4assign);
 }
开发者ID:nouphet,项目名称:rata,代码行数:27,代码来源:BulletinD3commentStory.class.php


示例3: XoopsFormSelectUser

 /**
  * Constructor
  *
  * @param string $caption
  * @param string $name
  * @param mixed $value Pre-selected value (or array of them).
  *                                                 For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item
  * @param bool $include_anon Include user "anonymous"?
  * @param int $size Number or rows. "1" makes a drop-down-list.
  * @param bool $multiple Allow multiple selections?
  */
 function XoopsFormSelectUser($caption, $name, $include_anon = false, $value = null, $size = 1, $multiple = false)
 {
     $limit = 200;
     $select_element = new XoopsFormSelect('', $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_element->addOption(0, $GLOBALS['xoopsConfig']['anonymous']);
     }
     $member_handler =& xoops_gethandler('member');
     $user_count = $member_handler->getUserCount();
     $value = is_array($value) ? $value : (empty($value) ? array() : array($value));
     if ($user_count > $limit && count($value) > 0) {
         $criteria = new CriteriaCompo(new Criteria('uid', '(' . implode(',', $value) . ')', 'IN'));
     } else {
         $criteria = new CriteriaCompo();
         $criteria->setLimit($limit);
     }
     $criteria->setSort('uname');
     $criteria->setOrder('ASC');
     $users = $member_handler->getUserList($criteria);
     $select_element->addOptionArray($users);
     if ($user_count <= $limit) {
         $this->XoopsFormElementTray($caption, "", $name);
         $this->addElement($select_element);
         return;
     }
     xoops_loadLanguage('findusers');
     $js_addusers = "<script type='text/javascript'>\r\n            function addusers(opts){\r\n                var num = opts.substring(0, opts.indexOf(':'));\r\n                opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                var sel = xoopsGetElementById('" . $name . "');\r\n                var arr = new Array(num);\r\n                for (var n=0; n < num; n++) {\r\n                    var nm = opts.substring(0, opts.indexOf(':'));\r\n                    opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                    var val = opts.substring(0, opts.indexOf(':'));\r\n                    opts = opts.substring(opts.indexOf(':')+1, opts.length);\r\n                    var txt = opts.substring(0, nm - val.length);\r\n                    opts = opts.substring(nm - val.length, opts.length);\r\n                    var added = false;\r\n                    for (var k = 0; k < sel.options.length; k++) {\r\n                        if(sel.options[k].value == val){\r\n                            added = true;\r\n                            break;\r\n                        }\r\n                    }\r\n                    if (added == false) {\r\n                        sel.options[k] = new Option(txt, val);\r\n                        sel.options[k].selected = true;\r\n                    }\r\n                }\r\n                return true;\r\n            }\r\n            </script>";
     $token = $GLOBALS['xoopsSecurity']->createToken();
     $action_tray = new XoopsFormElementTray("", " | ");
     $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="var sel = xoopsGetElementById(\'' . $name . '\');for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;">' . _MA_USER_REMOVE . "</a>"));
     $action_tray->addElement(new XoopsFormLabel('', '<a href="#" onclick="openWithSelfMain(\'' . XOOPS_URL . '/include/findusers.php?target=' . $name . '&amp;multiple=' . $multiple . '&amp;token=' . $token . '\', \'userselect\', 800, 600, null); return false;" >' . _MA_USER_MORE . "</a>" . $js_addusers));
     $this->XoopsFormElementTray($caption, '<br /><br />', $name);
     $this->addElement($select_element);
     $this->addElement($action_tray);
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:46,代码来源:formselectuser.php


示例4: getDefaultView

 function getDefaultView(&$controller, &$xoopsUser)
 {
     $dirname = xoops_getrequest('dirname');
     if (!preg_match("/^[a-zA-Z_][a-zA-Z0-9_]*\$/", $dirname)) {
         return LEGACY_FRAME_VIEW_ERROR;
     }
     if (!is_dir(XOOPS_MODULE_PATH . "/" . $dirname)) {
         return LEGACY_FRAME_VIEW_ERROR;
     }
     $moduleHandler =& xoops_gethandler('module');
     $this->mModuleObject =& $moduleHandler->getByDirname($dirname);
     //
     // If a module is installed, load modinfo and go to special displaying.
     //
     if (is_object($this->mModuleObject)) {
         $this->mModuleObject->loadAdminMenu();
         $this->mModuleObject->loadInfo($dirname);
         $this->mInstalledFlag = true;
     } else {
         $this->mModuleObject =& $moduleHandler->create();
         $this->mModuleObject->loadInfoAsVar($dirname);
         $this->mInstalledFlag = false;
     }
     return LEGACY_FRAME_VIEW_SUCCESS;
 }
开发者ID:nbuy,项目名称:legacy,代码行数:25,代码来源:ModuleInfoAction.class.php


示例5: get

 /**
  *	@public
  */
 public function get(&$userName, $uid)
 {
     $handler = xoops_gethandler('member');
     $user = $handler->getUser($uid);
     $name = $user->getShow('name');
     $userName = $name ? $name : $user->getShow('uname');
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:10,代码来源:UserName.class.php


示例6: search_album_set

function search_album_set()
{
    global $ALBUM_SET_SEARCH, $xoopsDB, $xoopsUser;
    if (is_object($xoopsUser)) {
        $usergroups = $xoopsUser->getgroups();
        $usergroup = implode(",", $usergroups);
        $buid = $xoopsUser->uid();
    } else {
        $usergroup = XOOPS_GROUP_ANONYMOUS;
        $buid = 0;
    }
    $user_cat = 10000;
    $module_handler =& xoops_gethandler('module');
    $xcgalModule = $module_handler->getByDirname('xcgal');
    $config_handler =& xoops_gethandler('config');
    $xcgalCon =& $config_handler->getConfigsByCat(0, $xcgalModule->mid());
    if (is_object($xoopsUser) && $xoopsUser->isAdmin($xcgalModule->mid())) {
        $ALBUM_SET_SEARCH = "";
    } else {
        $result = $xoopsDB->query("SELECT aid FROM " . $xoopsDB->prefix("xcgal_albums") . " WHERE visibility NOT IN ({$usergroup}, 0," . ($user_cat + $buid) . ")");
        if ($xoopsDB->getRowsNum($result)) {
            $set = '';
            while ($album = $xoopsDB->fetchArray($result)) {
                $set .= $album['aid'] . ',';
            }
            // while
            $ALBUM_SET_SEARCH .= 'AND aid NOT IN (' . substr($set, 0, -1) . ') ';
        }
        $xoopsDB->freeRecordSet($result);
    }
    return $xcgalCon;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:32,代码来源:search.php


示例7: XooNIps_Amazon_ECS40

 function XooNIps_Amazon_ECS40()
 {
     // get module config
     $mydirname = basename(dirname(dirname(__FILE__)));
     $mhandler =& xoops_gethandler('module');
     $module =& $mhandler->getByDirname($mydirname);
     $chandler =& xoops_gethandler('config');
     $mconfig = $chandler->getConfigsByCat(false, $module->mid());
     // call parent constructor
     parent::XooNIpsXMLParser();
     // set fetcher conditions
     $this->_fetch_url = 'http://ecs.amazonaws.com/onca/xml';
     $this->_fetch_arguments['Service'] = 'AWSECommerceService';
     $this->_fetch_arguments['Version'] = '2007-07-16';
     $this->_fetch_arguments['Operation'] = 'ItemLookup';
     $this->_fetch_arguments['IdType'] = 'ISBN';
     $this->_fetch_arguments['SearchIndex'] = 'Books';
     $this->_fetch_arguments['ResponseGroup'] = 'Medium';
     $this->_fetch_arguments['AWSAccessKeyId'] = $mconfig['AccessKey'];
     $this->_fetch_arguments['Timestamp'] = gmdate('Y-m-d\\TH:i:s\\Z');
     $this->_fetch_arguments['AssociateTag'] = $mconfig['AssociateTag'];
     // secret access key for amazon API
     $this->_secret_access_key = $mconfig['SecretAccessKey'];
     // set parser conditions
     $this->_parser_doctype = '';
     $this->_parser_public_id = '';
 }
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:27,代码来源:amazon.class.php


示例8: multimenu_getmoduleoption

/**
 * Returns a module's option
 *
 * Return's a module's option
 *
 * @package multimenu
 * @author Hervé Thouzard
 * @param string $option	module option's name
 * @param string $module	module's name
 */
function multimenu_getmoduleoption($option, $repmodule = 'multiMenu')
{
    global $xoopsModuleConfig, $xoopsModule;
    static $tbloptions = array();
    if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) {
        return $tbloptions[$option];
    }
    $retval = false;
    if (isset($xoopsModuleConfig) && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule && $xoopsModule->getVar('isactive'))) {
        if (isset($xoopsModuleConfig[$option])) {
            $retval = $xoopsModuleConfig[$option];
        }
    } else {
        $module_handler =& xoops_gethandler('module');
        $module =& $module_handler->getByDirname($repmodule);
        $config_handler =& xoops_gethandler('config');
        if ($module) {
            $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
            if (isset($moduleConfig[$option])) {
                $retval = $moduleConfig[$option];
            }
        }
    }
    $tbloptions[$option] = $retval;
    return $retval;
}
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:36,代码来源:functions_block.php


示例9: smarty_function_pico_category_search

function smarty_function_pico_category_search($params, &$smarty)
{
    $dir = @$params['dir'] . @$params['dirname'];
    $cat_title = @$params['title'] . @$params['cat_title'];
    $var_name = @$params['item'] . @$params['assign'];
    if (empty($var_name)) {
        echo 'error ' . __FUNCTION__ . ' [specify item]';
        return;
    }
    if (empty($dir)) {
        $dir = $smarty->get_template_vars('mydirname');
    }
    if (empty($dir)) {
        echo 'error ' . __FUNCTION__ . ' [specify dirname]';
        return;
    }
    $mydirnames = explode(',', $dir);
    $db =& Database::getInstance();
    $myts =& MyTextSanitizer::getInstance();
    $module_handler =& xoops_gethandler('module');
    $config_handler =& xoops_gethandler('config');
    $categories4assign = array();
    foreach ($mydirnames as $mydirname) {
        $module =& $module_handler->getByDirname($mydirname);
        $configs = $config_handler->getConfigList($module->getVar('mid'));
        $sql = "SELECT * FROM " . $db->prefix($mydirname . "_categories") . " c WHERE c.cat_title='" . mysql_real_escape_string($cat_title) . "'";
        $result = $db->query($sql);
        while ($cat_row = $db->fetchArray($result)) {
            $category4assign = array('mod_mid' => $module->getVar('mid'), 'mod_dirname' => $mydirname, 'mod_name' => $module->getVar('name'), 'id' => intval($cat_row['cat_id']), 'link' => pico_common_make_category_link4html($configs, $cat_row), 'title' => $myts->makeTboxData4Show($cat_row['cat_title']), 'desc' => $myts->displayTarea($cat_row['cat_desc'], 1), 'paths_raw' => pico_common_unserialize($cat_row['cat_path_in_tree']), 'paths_value' => array_values(pico_common_unserialize($cat_row['cat_path_in_tree'])), 'redundants' => pico_common_unserialize($cat_row['cat_redundants'])) + $cat_row;
            $categories4assign[] = $category4assign;
        }
    }
    $smarty->assign($var_name, $categories4assign);
}
开发者ID:nouphet,项目名称:rata,代码行数:34,代码来源:function.pico_category_search.php


示例10: prepare

 public function prepare()
 {
     $root = XCube_Root::getSingleton();
     $handler = xoops_gethandler('config');
     $xoopsMailerConfig = $handler->getConfigsByCat(XOOPS_CONF_MAILER);
     $this->reset();
     if ($xoopsMailerConfig['from'] == '') {
         $this->From = $root->mContext->mXoopsConfig['adminmail'];
     } else {
         $this->From = $xoopsMailerConfig['from'];
     }
     $this->Sender = $root->mContext->mXoopsConfig['adminmail'];
     $this->SetLanguage(LEGACY_MAIL_LANG, XOOPS_ROOT_PATH . '/class/mail/phpmailer/language/');
     $this->CharSet = LEGACY_MAIL_CHAR;
     $this->Encoding = LEGACY_MAIL_ENCO;
     switch ($xoopsMailerConfig['mailmethod']) {
         case 'smtpauth':
             $this->IsSMTP();
             $this->SMTPAuth = true;
             $this->Host = implode(';', $xoopsMailerConfig['smtphost']);
             $this->Username = $xoopsMailerConfig['smtpuser'];
             $this->Password = $xoopsMailerConfig['smtppass'];
             break;
         case 'smtp':
             $this->IsSMTP();
             $this->SMTPAuth = false;
             $this->Host = implode(';', $xoopsMailerConfig['smtphost']);
             break;
         case 'sendmail':
             $this->IsSendmail();
             $this->Sendmail = $xoopsMailerConfig['sendmailpath'];
             break;
     }
     return true;
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:35,代码来源:MyMailer.class.php


示例11: render

 public function render()
 {
     $module_handler =& xoops_gethandler('application');
     $modules =& $module_handler->getObjects(new Criteria('hasmain', 1), true);
     $options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK);
     $rtn = "<table cellpadding='2' cellspacing='1' border='0'>";
     if (count($modules) > 0) {
         foreach ($modules as $mod) {
             $rtn .= "<tr><td>" . $mod->getVar('name') . "</td><td>\n\t\t\t\t\t\t <select name='" . $this->getName() . "[" . $mod->getVar('mid') . "]' id='" . $this->getName() . "[" . $mod->getVar('mid') . "]'>";
             foreach ($options as $k => $v) {
                 $rtn .= "<option value='{$k}'";
                 $rtn .= isset($this->selected[$mod->getVar('mid')]) && $this->selected[$mod->getVar('mid')] == $k ? " selected='selected'" : "";
                 $rtn .= ">{$v}</option>";
             }
             $rtn .= "</td></tr>";
             /*$c_val = isset($currrent_val[$mid]) ? intval($currrent_val[$mid]) : null;
             		$selform = new XoopsFormSelect($modules[$mid]->getVar('name'), $config[$i]->getVar('conf_name')."[$mid]", $c_val);
             		$selform->addOptionArray($cache_options);
             		$ele->addElement($selform);
             		unset($selform);*/
         }
     } else {
         $rtn .= "<tr><td>" . _AS_SYSPREF_NOMODS . "</td></tr>";
     }
     $rtn .= "</table>";
     return $rtn;
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:27,代码来源:cachemod.class.php


示例12: execute

 function execute(&$controller, &$xoopsUser)
 {
     if (XCube_Root::getSingleton()->mContext->mRequest->getRequest('_form_control_cancel') != null) {
         return USER_FRAME_VIEW_CANCEL;
     }
     $memberHandler =& xoops_gethandler('member');
     $this->mNewUser =& $memberHandler->createUser();
     $this->mRegistForm->update($this->mNewUser);
     $this->mNewUser->set('uorder', $controller->mRoot->mContext->getXoopsConfig('com_order'), true);
     $this->mNewUser->set('umode', $controller->mRoot->mContext->getXoopsConfig('com_mode'), true);
     if ($this->mConfig['activation_type'] == 1) {
         $this->mNewUser->set('level', 1, true);
     }
     if (!$memberHandler->insertUser($this->mNewUser)) {
         $this->mRedirectMessage = _MD_USER_LANG_REGISTERNG;
         return USER_FRAME_VIEW_ERROR;
     }
     if (!$memberHandler->addUserToGroup(XOOPS_GROUP_USERS, $this->mNewUser->get('uid'))) {
         $this->mRedirectMessage = _MD_USER_LANG_REGISTERNG;
         return USER_FRAME_VIEW_ERROR;
     }
     $this->_clearRegistForm($controller);
     $this->_processMail($controller);
     $this->_eventNotifyMail($controller);
     XCube_DelegateUtils::call('Legacy.Event.RegistUser.Success', new XCube_Ref($this->mNewUser));
     return USER_FRAME_VIEW_SUCCESS;
 }
开发者ID:nouphet,项目名称:rata,代码行数:27,代码来源:UserRegister_confirmAction.class.php


示例13: fetchSummary

 function fetchSummary($external_link_id)
 {
     $myts =& MyTextsanitizer::getInstance();
     $module_handler =& xoops_gethandler('module');
     $module =& $module_handler->getByDirname($this->mydirname);
     $config_handler =& xoops_gethandler('config');
     $configs = $config_handler->getConfigList($module->mid());
     // external_link_id means $content_id
     $content_id = intval($external_link_id);
     $mydirname = $this->mydirname;
     if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
         die('Invalid mydirname');
     }
     // get categoryObject and contentObject
     list($categoryObj, $contentObj) = pico_common_get_objects_from_content_id($mydirname, $content_id);
     // existence check
     if (!is_object($categoryObj) || !is_object($contentObj)) {
         return '';
     }
     // permission check
     $content_data = $contentObj->getData();
     if (empty($content_data['can_read'])) {
         return '';
     }
     // dare to convert it irregularly
     $summary = str_replace('&amp;', '&', htmlspecialchars(xoops_substr(strip_tags($content_data['body_cached']), 0, 255), ENT_QUOTES));
     return array('dirname' => $mydirname, 'module_name' => $module->getVar('name'), 'subject' => $myts->makeTboxData4Show($content_data['subject_raw'], 1, 1), 'uri' => XOOPS_URL . '/modules/' . $mydirname . '/' . pico_common_make_content_link4html($configs, $content_data), 'summary' => $summary);
 }
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:28,代码来源:PicoD3commentContent.class.php


示例14: articles_notify_iteminfo

function articles_notify_iteminfo($category, $item_id)
{
    global $xoopsModule, $xoopsModuleConfig, $xoopsConfig, $xoopsDB;
    if (empty($xoopsModule) || $xoopsModule->getVar('dirname') != 'articles') {
        $module_handler =& xoops_gethandler('module');
        $module =& $module_handler->getByDirname('articles');
        $config_handler =& xoops_gethandler('config');
        $config =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
    } else {
        $module =& $xoopsModule;
        $config =& $xoopsModuleConfig;
    }
    if ($category == 'global') {
        $item['name'] = '';
        $item['url'] = '';
        return $item;
    }
    #	if ($category=='story') {
    #		// Assume we have a valid story id
    #		$sql = 'SELECT title FROM '.$xoopsDB->prefix('stories') . ' WHERE storyid = ' . $item_id;
    #		$result = $xoopsDB->query($sql); // TODO: error check
    #		$result_array = $xoopsDB->fetchArray($result);
    #		$item['name'] = $result_array['title'];
    #		$item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/article.php?storyid=' . $item_id;
    #		return $item;
    #	}
}
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:27,代码来源:notification.inc.php


示例15: execute

 function execute(&$controller, &$xoopsUser)
 {
     //
     // Fetch request and validate.
     //
     $this->mActionForm->fetch();
     $this->mActionForm->validate();
     //
     // If error, go to re-input.
     //
     if ($this->mActionForm->hasError()) {
         return PM_FRAME_VIEW_ERROR;
     }
     //
     // Delete PM
     //
     $handler =& xoops_gethandler('privmessage');
     foreach ($this->mActionForm->getVar('msg_id') as $msg_id) {
         $pm =& $handler->get($msg_id);
         if (is_object($pm) && $pm->get('to_userid') == $xoopsUser->get('uid')) {
             $handler->delete($pm);
         }
         unset($pm);
     }
     return PM_FRAME_VIEW_SUCCESS;
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:26,代码来源:DeleteAction.class.php


示例16: safeAgent

 function safeAgent($useragent)
 {
     $part = explode('/', $useragent);
     foreach ($part as $key => $value) {
         if (strpos(strtolower($value), '.x')) {
             unset($part[$key]);
         }
     }
     $useragent = implode('/', $part);
     $ver_char = array('x.x', '*.*', 'X.X', 'x.xxx', 'x.y', 'xxx', 'xxxx', 'xxxxx', 'xxxxxx', 'vX.X.X', 'X.X.X', 'X.xx');
     foreach ($ver_char as $vc) {
         if (strpos($useragent, $vc)) {
             $useragent = str_replace($vc, '', $useragent);
         }
     }
     $modulehandler =& xoops_gethandler('module');
     $confighandler =& xoops_gethandler('config');
     $xoModule = $modulehandler->getByDirname('spiders');
     $xoConfig = $confighandler->getConfigList($xoModule->getVar('mid'), false);
     $reservedphrases = explode('|', $xoConfig['reserved_prases']);
     foreach ($reservedphrases as $id => $phrase) {
         $useragent = str_replace($phrase, '', $useragent);
     }
     return $useragent;
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:25,代码来源:modifications.php


示例17: b_dbtheme_theme_hook_show

function b_dbtheme_theme_hook_show($options)
{
    $mydirname = empty($options[0]) ? 'dbtheme' : $options[0];
    $tpl_name = empty($options[1]) ? $mydirname . '_theme.html' : $options[1];
    if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
        die('Invalid mydirname');
    }
    $tpl_name = preg_replace('/[^0-9a-zA-Z_.-]/', '', $tpl_name);
    /* if( ! file_exists( XOOPS_ROOT_PATH.'/class/smarty/plugins/resource.dbtheme.php' ) ) {
    		$ret = array( 'content' => 'resource.dbtheme.php is not set properly' ) ;
    		return $ret ;
    	} */
    if (defined('XOOPS_CUBE_LEGACY')) {
        // Cube Legacy
        @define('DBTHEME_THEME_NAME', $tpl_name);
        @define('DBTHEME_MYDIRNAME', $mydirname);
    } else {
        // X2.0.x
        $module_handler =& xoops_gethandler('module');
        $module =& $module_handler->getByDirname($mydirname);
        $config_handler =& xoops_gethandler('config');
        $mod_config =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
        if (!empty($mod_config['base_theme'])) {
            $GLOBALS['xoopsTpl']->assign(array('xoops_theme' => $mod_config['base_theme'], 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $mod_config['base_theme'] . '/', 'xoops_themecss' => XOOPS_URL . '/modules/' . $mydirname . '/?template=style.css', 'xoops_dbthemecssurl' => XOOPS_URL . '/modules/' . $mydirname . '/?template='));
        }
        $obj_serialized = serialize($GLOBALS['xoopsTpl']);
        unset($GLOBALS['xoopsTpl']);
        $obj_serialized = preg_replace('/xoopstpl/i', 'dbthmtpl', substr($obj_serialized, 0, 20)) . substr($obj_serialized, 20);
        //var_dump( $obj_serialized ) ;
        $GLOBALS['xoopsTpl'] = unserialize($obj_serialized);
        //var_dump( get_class( $GLOBALS['xoopsTpl'] ) ) ;
        $GLOBALS['xoopsConfig']['theme_set'] = 'dbtheme:' . $tpl_name . "\n";
        return array();
    }
}
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:35,代码来源:block_functions.php


示例18: _doExecute

	function _doExecute()
	{
		if ($this->mActionForm->mFormFile != null) {
			if (!$this->mActionForm->mFormFile->saveAs(XOOPS_UPLOAD_PATH)) {
				return false;
			}
			
			if ($this->mActionForm->mOldFileName != null && $this->mActionForm->mOldFileName != "blank.gif") {
				@unlink(XOOPS_UPLOAD_PATH . "/" . $this->mActionForm->mOldFileName);
				
				//
				// Change user_avatar of all users who are setting this avatar.
				//
				if (!$this->mObject->isNew()) {
					$linkHandler =& xoops_getmodulehandler('avatar_user_link');
					$criteria =new Criteria('avatar_id', $this->mObject->get('avatar_id'));
					$linkArr =& $linkHandler->getObjects($criteria);

					$userHandler =& xoops_gethandler('user');
					foreach ($linkArr as $link) {
						$user =& $userHandler->get($link->get('user_id'));

						if (is_object($user)) {
							$user->set('user_avatar', $this->mObject->get('avatar_file'));
							$userHandler->insert($user);
						}
						unset($user);
					}
				}
			}
		}
		
		return parent::_doExecute();
	}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:34,代码来源:AvatarEditAction.class.php


示例19: newbb_loadConfig

function newbb_loadConfig()
{
    global $xoopsModuleConfig;
    static $moduleConfig;
    if (isset($moduleConfig)) {
        return $moduleConfig;
    }
    if (isset($GLOBALS["xoopsModule"]) && is_object($GLOBALS["xoopsModule"]) && $GLOBALS["xoopsModule"]->getVar("dirname", "n") == "newbb") {
        if (!empty($GLOBALS["xoopsModuleConfig"])) {
            $moduleConfig = $GLOBALS["xoopsModuleConfig"];
        } else {
            return null;
        }
    } else {
        $module_handler =& xoops_gethandler('module');
        $module = $module_handler->getByDirname("newbb");
        $config_handler =& xoops_gethandler('config');
        $criteria = new CriteriaCompo(new Criteria('conf_modid', $module->getVar('mid')));
        $configs = $config_handler->getConfigs($criteria);
        foreach (array_keys($configs) as $i) {
            $moduleConfig[$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput();
        }
        unset($configs);
    }
    if ($customConfig = @(include XOOPS_ROOT_PATH . "/modules/newbb/include/plugin.php")) {
        $moduleConfig = array_merge($moduleConfig, $customConfig);
    }
    return $moduleConfig;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:29,代码来源:functions.config.php


示例20: __construct

 /**
  * Constructor
  *
  * @param    string    $caption
  * @param    string    $name
  * @param    mixed    $value            Pre-selected value (or array of them).
  *                                    For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item
  * @param    bool    $include_anon    Include user "anonymous"?
  * @param    int        $size            Number or rows. "1" makes a drop-down-list.
  * @param    bool    $multiple       Allow multiple selections?
  */
 function __construct($caption, $name, $include_anon = false, $value = null, $size = 1, $multiple = false)
 {
     $limit = 200;
     $select_element = new Xmf_Form_Element_Select("", $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_element->addOption(0, $GLOBALS["xoopsConfig"]['anonymous']);
     }
     $member_handler =& xoops_gethandler('member');
     $user_count = $member_handler->getUserCount();
     $value = is_array($value) ? $value : (empty($value) ? array() : array($value));
     if ($user_count > $limit && count($value) > 0) {
         $criteria = new CriteriaCompo(new Criteria("uid", "(" . implode(",", $value) . ")", "IN"));
     } else {
         $criteria = new CriteriaCompo();
         $criteria->setLimit($limit);
     }
     $criteria->setSort('uname');
     $criteria->setOrder('ASC');
     $users = $member_handler->getUserList($criteria);
     $select_element->addOptionArray($users);
     if ($user_count <= $limit) {
         parent::__construct($caption, "", $name);
         $this->addElement($select_element);
         return;
     }
     xoops_loadLanguage("findusers");
     $js_addusers = "<script type=\"text/javascript\">\r\n            function addusers(opts){\r\n                var num = opts.substring(0, opts.indexOf(\":\"));\r\n                opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                var sel = xoopsGetElementById(\"" . $name . ($multiple ? "[]" : "") . "\");\r\n                var arr = new Array(num);\r\n                for (var n=0; n < num; n++) {\r\n                    var nm = opts.substring(0, opts.indexOf(\":\"));\r\n                    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                    var val = opts.substring(0, opts.indexOf(\":\"));\r\n                    opts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n                    var txt = opts.substring(0, nm - val.length);\r\n                    opts = opts.substring(nm - val.length, opts.length);\r\n                    var added = false;\r\n                    for (var k = 0; k < sel.options.length; k++) {\r\n                        if(sel.options[k].value == val){\r\n                            added = true;\r\n                            break;\r\n                        }\r\n                    }\r\n                    if (added == false) {\r\n                        sel.options[k] = new Option(txt, val);\r\n                        sel.options[k].selected = true;\r\n                    }\r\n                }\r\n                return true;\r\n            }\r\n            </script>";
     $token = $GLOBALS['xoopsSecurity']->createToken();
     $action_tray = new Xmf_Form_Element_Tray("", " | ");
     $action_tray->addElement(new Xmf_Form_Element_Label('', "<a href='#' onclick='var sel = xoopsGetElementById(\"" . $name . ($multiple ? "[]" : "") . "\");for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;'>" . _MA_USER_REMOVE . "</a>"));
     $action_tray->addElement(new Xmf_Form_Element_Label('', "<a href='#' onclick='openWithSelfMain(\"" . XOOPS_URL . "/include/findusers.php?target={$name}&amp;multiple={$multiple}&amp;token={$token}\", \"userselect\", 800, 600, null); return false;' >" . _MA_USER_MORE . "</a>" . $js_addusers));
     parent::__construct($caption, "<br /><br />", $name);
     $this->addElement($select_element);
     $this->addElement($action_tray);
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:46,代码来源:User.php



注:本文中的xoops_gethandler函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP xoops_getmodulehandler函数代码示例发布时间:2022-05-23
下一篇:
PHP xoops_getenv函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap