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

PHP xoops_getHandler函数代码示例

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

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



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

示例1: eventBoot

 function eventBoot()
 {
     $registry =& MymenusRegistry::getInstance();
     $member_handler =& xoops_getHandler('member');
     $user = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser'] : null;
     if (!$user) {
         $user = $member_handler->createUser();
         $user->setVar('uid', 0);
         $user->setVar('uname', $GLOBALS['xoopsConfig']['anonymous']);
     }
     $ownerid = isset($_GET['uid']) ? intval($_GET['uid']) : null;
     $owner = $member_handler->getUser($ownerid);
     //if uid > 0 but user does not exists
     if (!is_object($owner)) {
         //create new user
         $owner = $member_handler->createUser();
     }
     if ($owner->isNew()) {
         $owner->setVar('uid', 0);
         $owner->setVar('uname', $GLOBALS['xoopsConfig']['anonymous']);
     }
     $registry->setEntry('user', $user->getValues());
     $registry->setEntry('owner', $owner->getValues());
     $registry->setEntry('user_groups', $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : array(XOOPS_GROUP_ANONYMOUS));
     $registry->setEntry('user_uid', $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getVar('uid') : 0);
     $registry->setEntry('get_uid', isset($_GET['uid']) ? intval($_GET['uid']) : 0);
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:27,代码来源:mymenus.php


示例2: smarty_function_xoInboxCount

/**
 * @param $params
 * @param $smarty
 * @return null
 */
function smarty_function_xoInboxCount($params, &$smarty)
{
    global $xoopsUser;
    if (!isset($xoopsUser) || !is_object($xoopsUser)) {
        return null;
    }
    $time = time();
    if (isset($_SESSION['xoops_inbox_count']) && @$_SESSION['xoops_inbox_count_expire'] > $time) {
        $count = (int) $_SESSION['xoops_inbox_count'];
    } else {
        $pm_handler = xoops_getHandler('privmessage');
        $xoopsPreload = XoopsPreload::getInstance();
        $xoopsPreload->triggerEvent('core.class.smarty.xoops_plugins.xoinboxcount', array($pm_handler));
        $criteria = new CriteriaCompo(new Criteria('read_msg', 0));
        $criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
        $count = (int) $pm_handler->getCount($criteria);
        $_SESSION['xoops_inbox_count'] = $count;
        $_SESSION['xoops_inbox_count_expire'] = $time + 60;
    }
    if (!@empty($params['assign'])) {
        $smarty->assign($params['assign'], $count);
    } else {
        echo $count;
    }
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:30,代码来源:function.xoInboxCount.php


示例3: __construct

 /**
  * Constructor
  *
  * @param XoopsTpl $tpl
  * @param boolean  $use_icons
  * @param boolean  $do_iconcheck
  *
  */
 public function __construct(XoopsTpl $tpl, $use_icons = true, $do_iconcheck = false)
 {
     $this->_tpl = $tpl;
     $this->_useIcons = (bool) $use_icons;
     $this->_doIconCheck = (bool) $do_iconcheck;
     $this->_memberHandler = xoops_getHandler('member');
     $this->_statusText = array(XOOPS_COMMENT_PENDING => '<span style="text-decoration: none; font-weight: bold; color: #00ff00;">' . _CM_PENDING . '</span>', XOOPS_COMMENT_ACTIVE => '<span style="text-decoration: none; font-weight: bold; color: #ff0000;">' . _CM_ACTIVE . '</span>', XOOPS_COMMENT_HIDDEN => '<span style="text-decoration: none; font-weight: bold; color: #0000ff;">' . _CM_HIDDEN . '</span>');
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:16,代码来源:commentrenderer.php


示例4: authenticate

 /**
  * Authenticate user
  *
  * @param  string $uname
  * @param  string $pwd
  * @return bool
  */
 public function authenticate($uname, $pwd = null)
 {
     $member_handler = xoops_getHandler('member');
     $user = $member_handler->loginUser($uname, $pwd);
     if ($user == false) {
         $this->setErrors(1, _US_INCORRECTLOGIN);
     }
     return $user;
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:16,代码来源:auth_xoops.php


示例5: check_profile

	/**
	 * Check if user profile table already converted
	 *
	 */
	function check_profile()
	{
		$module_handler =& xoops_getHandler('module');
		if (!$profile_module = $module_handler->getByDirname('profile')) return true;
		$sql = "SHOW COLUMNS FROM " . $GLOBALS['xoopsDB']->prefix("users") . " LIKE 'posts'";
		$result = $GLOBALS['xoopsDB']->queryF($sql);
		if (!$result) return false;
		if ($GLOBALS['xoopsDB']->getRowsNum($result) == 0) return false;
		return true;
	}
开发者ID:nao-pon,项目名称:impresscms,代码行数:14,代码来源:index.php


示例6: validate

 /**
  * @return bool
  */
 public static function validate()
 {
     $module_handler = xoops_getHandler('module');
     if ($admin_module = $module_handler->getByDirname('thadmin')) {
         if ($admin_module->getVar('isactive')) {
             return true;
         }
     }
     return false;
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:13,代码来源:thadmin.php


示例7: __construct

 /**
  * Authentication Service constructor
  * @param XoopsDatabase $dao
  */
 public function __construct(XoopsDatabase $dao = null)
 {
     $this->_dao = $dao;
     // The config handler object allows us to look at the configuration options that are stored in the database
     $config_handler = xoops_getHandler('config');
     $config = $config_handler->getConfigsByCat(XOOPS_CONF_AUTH);
     $confcount = count($config);
     foreach ($config as $key => $val) {
         $this->{$key} = $val;
     }
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:15,代码来源:auth_ldap.php


示例8: __construct

 /**
  * Constructor
  *
  * @param string $caption
  * @param string $name
  * @param mixed  $value    Pre-selected value (or array of them).
  */
 public function __construct($caption, $name, $value = null)
 {
     /** @var XoopsMemberHandler $member_handler */
     $member_handler = xoops_getHandler('member');
     $userGroups = $member_handler->getGroupList();
     parent::__construct($caption, $name, $value);
     $this->columns = 3;
     foreach ($userGroups as $group_id => $group_name) {
         $this->addOption($group_id, $group_name);
     }
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:18,代码来源:formselectcheckgroup.php


示例9: __construct

 /**
  * @param     $target
  * @param int $subCatsCount
  */
 public function __construct(&$target, $subCatsCount = 4)
 {
     $this->publisher =& PublisherPublisher::getInstance();
     $this->targetObject =& $target;
     $this->subCatsCount = $subCatsCount;
     $memberHandler =& xoops_getHandler('member');
     $this->userGroups = $memberHandler->getGroupList();
     parent::__construct(_AM_PUBLISHER_CATEGORY, 'form', xoops_getenv('PHP_SELF'));
     $this->setExtra('enctype="multipart/form-data"');
     $this->createElements();
     $this->createButtons();
 }
开发者ID:trabisdementia,项目名称:publisher,代码行数:16,代码来源:category.php


示例10: protector_notify_base

 /**
  * @param $mydirname
  * @param $category
  * @param $item_id
  *
  * @return mixed
  */
 function protector_notify_base($mydirname, $category, $item_id)
 {
     include_once __DIR__ . '/include/common_functions.php';
     $db = XoopsDatabaseFactory::getDatabaseConnection();
     $module_handler = xoops_getHandler('module');
     $module = $module_handler->getByDirname($mydirname);
     if ($category === 'global') {
         $item['name'] = '';
         $item['url'] = '';
         return $item;
     }
     return null;
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:20,代码来源:notification.php


示例11: altsys_set_module_config

function altsys_set_module_config()
{
    global $altsysModuleConfig, $altsysModuleId;
    $module_handler = xoops_getHandler('module');
    $module = $module_handler->getByDirname('altsys');
    if (is_object($module)) {
        $config_handler = xoops_getHandler('config');
        $altsysModuleConfig = $config_handler->getConfigList($module->getVar('mid'));
        $altsysModuleId = $module->getVar('mid');
    } else {
        $altsysModuleConfig = array();
        $altsysModuleId = 0;
    }
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:14,代码来源:altsys_functions.php


示例12: getForm

 /**
  * @return XoopsThemeForm
  */
 public function getForm()
 {
     if ($this->isNew()) {
         $blank_img = 'blank.gif';
     } else {
         $blank_img = str_replace('avatars/', '', $this->getVar('avatar_file', 'e'));
     }
     // Get User Config
     $config_handler = xoops_getHandler('config');
     $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
     // New and edit form
     $form = new XoopsThemeForm(_AM_SYSTEM_AVATAR_ADD, 'avatar_form', 'admin.php', 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     // Name
     $form->addElement(new XoopsFormText(_IMAGENAME, 'avatar_name', 50, 255, $this->getVar('avatar_name', 'e')), true);
     // Name description
     $maxpixel = '<div>' . _US_MAXPIXEL . '&nbsp;:&nbsp;' . $xoopsConfigUser['avatar_width'] . ' x ' . $xoopsConfigUser['avatar_height'] . '</div>';
     $maxsize = '<div>' . _US_MAXIMGSZ . '&nbsp;:&nbsp;' . $xoopsConfigUser['avatar_maxsize'] . '</div>';
     // Upload part
     $imgtray_img = new XoopsFormElementTray(_IMAGEFILE, '<br>');
     $imgtray_img->setDescription($maxpixel . $maxsize);
     $imageselect_img = new XoopsFormSelect(sprintf(_AM_SYSTEM_AVATAR_USE_FILE, XOOPS_UPLOAD_PATH . '/avatars/'), 'avatar_file', $blank_img);
     $image_array_img = XoopsLists::getImgListAsArray(XOOPS_UPLOAD_PATH . '/avatars');
     $imageselect_img->addOption("{$blank_img}", $blank_img);
     foreach ($image_array_img as $image_img) {
         $imageselect_img->addOption("{$image_img}", $image_img);
     }
     $imageselect_img->setExtra("onchange='showImgSelected(\"xo-avatar-img\", \"avatar_file\", \"avatars\", \"\", \"" . XOOPS_UPLOAD_URL . "\")'");
     $imgtray_img->addElement($imageselect_img, false);
     $imgtray_img->addElement(new XoopsFormLabel('', "<br><img src='" . XOOPS_UPLOAD_URL . '/avatars/' . $blank_img . "' name='image_img' id='xo-avatar-img' alt='' />"));
     $fileseltray_img = new XoopsFormElementTray('<br>', '<br><br>');
     $fileseltray_img->addElement(new XoopsFormFile(_AM_SYSTEM_AVATAR_UPLOAD, 'avatar_file', 500000), false);
     $imgtray_img->addElement($fileseltray_img);
     $form->addElement($imgtray_img);
     // Weight
     $form->addElement(new XoopsFormText(_IMGWEIGHT, 'avatar_weight', 3, 4, $this->getVar('avatar_weight', 'e')));
     // Display
     $form->addElement(new XoopsFormRadioYN(_IMGDISPLAY, 'avatar_display', $this->getVar('avatar_display', 'e'), _YES, _NO));
     // Hidden
     if ($this->isNew()) {
         $form->addElement(new XoopsFormHidden('avatar_type', 's'));
     }
     $form->addElement(new XoopsFormHidden('op', 'save'));
     $form->addElement(new XoopsFormHidden('fct', 'avatars'));
     $form->addElement(new XoopsFormHidden('avatar_id', $this->getVar('avatar_id', 'e')));
     // Button
     $form->addElement(new XoopsFormButton('', 'avt_button', _SUBMIT, 'submit'));
     return $form;
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:52,代码来源:avatar.php


示例13: user_index

function user_index($start = 0)
{
    global $xoopsTpl, $xoopsUser, $xoopsConfig, $limit;
    $myts =& MyTextSanitizer::getInstance();
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    $this_handler =& xoops_getModuleHandler('user', 'subscribers');
    $module_handler =& xoops_getHandler('module');
    $query = isset($_POST['query']) ? $_POST['query'] : null;
    $xoopsTpl->assign('query', $query);
    $criteria = null;
    if (!is_null($query)) {
        $criteria = new Criteria('user_email', $myts->addSlashes($query) . '%', 'LIKE');
    }
    $count = $this_handler->getCount($criteria);
    $xoopsTpl->assign('count', $count);
    $mHandler =& xoops_getHandler('member');
    $users_count = $mHandler->getUserCount(new Criteria('level', 0, '>'));
    $xoopsTpl->assign('users_count', $users_count);
    $xoopsTpl->assign('total_count', $users_count + $count);
    $criteria = new CriteriaCompo($criteria);
    $criteria->setSort('user_id');
    $criteria->setOrder('DESC');
    $criteria->setStart($start);
    $criteria->setLimit($limit);
    $objs = $this_handler->getObjects($criteria);
    unset($criteria);
    if ($count > 0) {
        if ($count > $limit) {
            include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
            $nav = new XoopsPageNav($count, $limit, $start, 'start', 'op=list');
            $xoopsTpl->assign('pag', '<div style="float:left; padding-top:2px;" align="center">' . $nav->renderNav() . '</div>');
        } else {
            $xoopsTpl->assign('pag', '');
        }
    } else {
        $xoopsTpl->assign('pag', '');
    }
    include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
    $countries = XoopsLists::getCountryList();
    foreach ($objs as $obj) {
        $objArray = $obj->toArray();
        $objArray['user_country'] = $countries[$objArray['user_country']];
        $xoopsTpl->append('objs', $objArray);
        unset($objArray);
    }
    $xoopsTpl->assign('add_form', user_form());
    return $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/subscribers/templates/static/subscribers_admin_user.html');
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:48,代码来源:admin_user.php


示例14: getOwner_uids

 function getOwner_uids()
 {
     $member_handler = xoops_getHandler('member');
     $sql = 'SELECT DISTINCT uid AS uid FROM ' . $this->table;
     $result = $this->db->query($sql);
     while ($uid = $this->db->fetchArray($result)) {
         $owner_uidsArray[] = $uid['uid'];
     }
     $criteria = new CriteriaCompo();
     $criteria->add(new Criteria('uid', '(' . implode(', ', $owner_uidsArray) . ')', 'IN'));
     $usersArray = $member_handler->getUserList($criteria);
     $ret = array();
     $ret['default'] = _XUUPS_ANY;
     foreach ($usersArray as $k => $v) {
         $ret[$k] = $v;
     }
     return $ret;
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:18,代码来源:post.php


示例15: mod_fetchConfig

 /**
  * Fetch configs of a module from database
  *
  *
  * @param    string $dirname module dirname
  * @return    array
  */
 function mod_fetchConfig($dirname = '')
 {
     if (empty($dirname)) {
         return null;
     }
     $module_handler = xoops_getHandler('module');
     if (!($module = $module_handler->getByDirname($dirname))) {
         trigger_error("Module '{$dirname}' does not exist", E_USER_WARNING);
         return null;
     }
     $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($module, $configs);
     return $moduleConfig;
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:26,代码来源:functions.config.php


示例16: install_acceptUser

/**
 * See the enclosed file license.txt for licensing information.
 * If you did not receive this file, get it at http://www.gnu.org/licenses/gpl-2.0.html
 *
 * @copyright    (c) 2000-2016 XOOPS Project (www.xoops.org)
 * @license          GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package          installer
 * @since            2.3.0
 * @author           Haruki Setoyama  <[email protected]>
 * @author           Kazumi Ono <[email protected]>
 * @author           Skalpa Keo <[email protected]>
 * @author           Taiwen Jiang <[email protected]>
 * @author           DuGris (aka L. JEN) <[email protected]>
 * @param string $hash
 * @return bool
 */
function install_acceptUser($hash = '')
{
    $GLOBALS['xoopsUser'] = null;
    $assertClaims = array('sub' => 'xoopsinstall');
    $claims = \Xmf\Jwt\TokenReader::fromCookie('install', 'xo_install_user', $assertClaims);
    if (false === $claims || empty($claims->uname)) {
        return false;
    }
    $uname = $claims->uname;
    $memberHandler = xoops_getHandler('member');
    $user = array_pop($memberHandler->getUsers(new Criteria('uname', $uname)));
    if (is_object($GLOBALS['xoops']) && method_exists($GLOBALS['xoops'], 'acceptUser')) {
        $res = $GLOBALS['xoops']->acceptUser($uname, true, '');
        return $res;
    }
    $GLOBALS['xoopsUser'] = $user;
    $_SESSION['xoopsUserId'] = $GLOBALS['xoopsUser']->getVar('uid');
    $_SESSION['xoopsUserGroups'] = $GLOBALS['xoopsUser']->getGroups();
    return true;
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:36,代码来源:functions.php


示例17: getAuthConnection

 /**
  * Get a reference to the only instance of authentication class
  *
  * if the class has not been instantiated yet, this will also take
  * care of that
  *
  * @static
  *
  * @param $uname used to lookup in LDAP bypass config
  *
  * @return object Reference to the only instance of authentication class
  */
 public static function getAuthConnection($uname)
 {
     static $auth_instance;
     if (!isset($auth_instance)) {
         $config_handler = xoops_getHandler('config');
         $authConfig = $config_handler->getConfigsByCat(XOOPS_CONF_AUTH);
         include_once $GLOBALS['xoops']->path('class/auth/auth.php');
         if (empty($authConfig['auth_method'])) {
             // If there is a config error, we use xoops
             $xoops_auth_method = 'xoops';
         } else {
             $xoops_auth_method = $authConfig['auth_method'];
         }
         // Verify if uname allow to bypass LDAP auth
         if (in_array($uname, $authConfig['ldap_users_bypass'])) {
             $xoops_auth_method = 'xoops';
         }
         $ret = (include_once $GLOBALS['xoops']->path('class/auth/auth_' . $xoops_auth_method . '.php'));
         if ($ret == false) {
             return false;
         }
         $class = 'XoopsAuth' . ucfirst($xoops_auth_method);
         if (!class_exists($class)) {
             $GLOBALS['xoopsLogger']->triggerError($class, _XO_ER_CLASSNOTFOUND, __FILE__, __LINE__, E_USER_ERROR);
             return false;
         }
         switch ($xoops_auth_method) {
             case 'xoops':
                 $dao = XoopsDatabaseFactory::getDatabaseConnection();
                 break;
             case 'ldap':
                 $dao = null;
                 break;
             case 'ads':
                 $dao = null;
                 break;
         }
         $auth_instance = new $class($dao);
     }
     return $auth_instance;
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:53,代码来源:authfactory.php


示例18: update_system_v211

/**
 * @param $module
 *
 * @return bool
 */
function update_system_v211($module)
{
    global $xoopsDB;
    $result = $xoopsDB->query('SELECT t1.tpl_id FROM ' . $xoopsDB->prefix('tplfile') . ' t1, ' . $xoopsDB->prefix('tplfile') . ' t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id');
    $tplids = array();
    while (list($tplid) = $xoopsDB->fetchRow($result)) {
        $tplids[] = $tplid;
    }
    if (count($tplids) > 0) {
        $tplfile_handler = xoops_getHandler('tplfile');
        $duplicate_files = $tplfile_handler->getObjects(new Criteria('tpl_id', '(' . implode(',', $tplids) . ')', 'IN'));
        if (count($duplicate_files) > 0) {
            foreach (array_keys($duplicate_files) as $i) {
                $tplfile_handler->delete($duplicate_files[$i]);
            }
        }
    }
    $sql = 'SHOW INDEX FROM ' . $xoopsDB->prefix('tplfile') . " WHERE KEY_NAME = 'tpl_refid_module_set_file_type'";
    if (!($result = $xoopsDB->queryF($sql))) {
        xoops_error($this->db->error() . '<br>' . $sql);
        return false;
    }
    $ret = array();
    while ($myrow = $xoopsDB->fetchArray($result)) {
        $ret[] = $myrow;
    }
    if (!empty($ret)) {
        $module->setErrors("'tpl_refid_module_set_file_type' unique index is exist. Note: check 'tplfile' table to be sure this index is UNIQUE because XOOPS CORE need it.");
        return true;
    }
    $sql = 'ALTER TABLE ' . $xoopsDB->prefix('tplfile') . ' ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )';
    if (!($result = $xoopsDB->queryF($sql))) {
        xoops_error($xoopsDB->error() . '<br>' . $sql);
        $module->setErrors("'tpl_refid_module_set_file_type' unique index is not added to 'tplfile' table. Warning: do not use XOOPS until you add this unique index.");
        return false;
    }
    return true;
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:43,代码来源:update.php


示例19: load

 /**
  * @param $ts
  * @param $text
  *
  * @return mixed|string
  */
 public function load($ts, $text)
 {
     static $censorConf;
     if (!isset($censorConf)) {
         $config_handler = xoops_getHandler('config');
         $censorConf = $config_handler->getConfigsByCat(XOOPS_CONF_CENSOR);
         $config = parent::loadConfig(__DIR__);
         //merge and allow config override
         $censorConf = array_merge($censorConf, $config);
     }
     if (empty($censorConf['censor_enable'])) {
         return $text;
     }
     if (empty($censorConf['censor_words'])) {
         return $text;
     }
     if (empty($censorConf['censor_admin']) && $GLOBALS['xoopsUserIsAdmin']) {
         return $text;
     }
     $replacement = $censorConf['censor_replace'];
     foreach ($censorConf['censor_words'] as $bad) {
         $bad = trim($bad);
         if (!empty($bad)) {
             if (false === strpos($text, $bad)) {
                 continue;
             }
             if (!empty($censorConf['censor_terminate'])) {
                 trigger_error('Censor words found', E_USER_ERROR);
                 $text = '';
                 return $text;
             }
             $patterns[] = "/(^|[^0-9a-z_]){$bad}([^0-9a-z_]|\$)/siU";
             $replacements[] = "\\1{$replacement}\\2";
             $text = preg_replace($patterns, $replacements, $text);
         }
     }
     return $text;
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:44,代码来源:censor.php


示例20: __construct

 /**
  * Instantiate a XoopsModule object for the helper to use.
  * The module is determined as follows:
  * - if null is passed, use the current module
  * - if a string is passed, use as dirname to load
  *
  * @param string|null $dirname dirname
  */
 public function __construct($dirname = null)
 {
     $this->module = null;
     if (empty($dirname)) {
         // nothing specified, use current module
         // check if we are running in 2.6
         if (class_exists('Xoops', false)) {
             $xoops = \Xoops::getInstance();
             if ($xoops->isModule()) {
                 $this->module = $xoops->module;
             }
         } else {
             $this->module = $GLOBALS['xoopsModule'];
         }
     } else {
         // assume dirname specified, try to get a module object
         $moduleHandler = xoops_getHandler('module');
         $this->module = $moduleHandler->getByDirname($dirname);
     }
     if (is_object($this->module)) {
         $this->init();
     }
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:31,代码来源:AbstractHelper.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP xoops_getMailer函数代码示例发布时间:2022-05-23
下一篇:
PHP xoops_footer函数代码示例发布时间: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