当前位置: 首页>>代码示例>>PHP>>正文


PHP MEMBER::existsID方法代码示例

本文整理汇总了PHP中MEMBER::existsID方法的典型用法代码示例。如果您正苦于以下问题:PHP MEMBER::existsID方法的具体用法?PHP MEMBER::existsID怎么用?PHP MEMBER::existsID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MEMBER的用法示例。


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

示例1: _setOption

 /**
  * Update an option in the database table plugin_option
  * 		 
  * returns: 1 on success, 0 on failure
  * private
  */
 function _setOption($context, $contextid, $name, $value)
 {
     global $manager;
     $oid = $this->_getOID($context, $name);
     if (!$oid) {
         return 0;
     }
     // check if context id exists
     switch ($context) {
         case 'member':
             if (!MEMBER::existsID($contextid)) {
                 return 0;
             }
             break;
         case 'blog':
             if (!$manager->existsBlogID($contextid)) {
                 return 0;
             }
             break;
         case 'category':
             if (!$manager->existsCategory($contextid)) {
                 return 0;
             }
             break;
         case 'item':
             if (!$manager->existsItem($contextid, true, true)) {
                 return 0;
             }
             break;
         case 'global':
             if ($contextid != 0) {
                 return 0;
             }
             break;
     }
     // update plugin_option
     sql_query('DELETE FROM ' . sql_table('plugin_option') . ' WHERE oid=' . intval($oid) . ' and ocontextid=' . intval($contextid));
     sql_query('INSERT INTO ' . sql_table('plugin_option') . ' (ovalue, oid, ocontextid) VALUES (\'' . sql_real_escape_string($value) . '\', ' . intval($oid) . ', ' . intval($contextid) . ')');
     // update cache
     $this->_aOptionValues[$oid . '_' . $contextid] = $value;
     return 1;
 }
开发者ID:hatone,项目名称:Nucleus-v3.64,代码行数:48,代码来源:PLUGIN.php

示例2: selector


//.........这里部分代码省略.........
        if (!$blogid) {
            doError(_ERROR_NOSUCHBLOG);
        }
    } elseif ($query) {
        global $startpos;
        $type = 'search';
        $query = stripslashes($query);
        if (preg_match("/^(¡{2}|ã€{2}| )+\$/", $query)) {
            $type = 'index';
        }
        //		$order = (_CHARSET == 'EUC-JP') ? 'EUC-JP, UTF-8,' : 'UTF-8, EUC-JP,';
        //		$query = mb_convert_encoding($query, _CHARSET, $order . ' JIS, SJIS, ASCII');
        switch (strtolower(_CHARSET)) {
            case 'utf-8':
                $order = 'ASCII, UTF-8, EUC-JP, JIS, SJIS, EUC-CN, ISO-8859-1';
                break;
            case 'gb2312':
                $order = 'ASCII, EUC-CN, EUC-JP, UTF-8, JIS, SJIS, ISO-8859-1';
                break;
            case 'shift_jis':
                // Note that shift_jis is only supported for output.
                // Using shift_jis in DB is prohibited.
                $order = 'ASCII, SJIS, EUC-JP, UTF-8, JIS, EUC-CN, ISO-8859-1';
                break;
            default:
                // euc-jp,iso-8859-x,windows-125x
                $order = 'ASCII, EUC-JP, UTF-8, JIS, SJIS, EUC-CN, ISO-8859-1';
                break;
        }
        $query = mb_convert_encoding($query, _CHARSET, $order);
        if (is_numeric($blogid)) {
            $blogid = intVal($blogid);
        } else {
            $blogid = getBlogIDFromName($blogid);
        }
        if (!$blogid) {
            doError(_ERROR_NOSUCHBLOG);
        }
    } elseif ($memberid) {
        $type = 'member';
        if (!MEMBER::existsID($memberid)) {
            doError(_ERROR_NOSUCHMEMBER);
        }
        $memberinfo = $manager->getMember($memberid);
    } elseif ($imagepopup) {
        // media object (images etc.)
        $type = 'imagepopup';
        // TODO: check if media-object exists
        // TODO: set some vars?
    } else {
        // show regular index page
        global $startpos;
        $type = 'index';
    }
    // any type of skin with catid
    if ($catid && !$blogid) {
        $blogid = getBlogIDFromCatID($catid);
    }
    // decide which blog should be displayed
    if (!$blogid) {
        $blogid = $CONF['DefaultBlog'];
    }
    $b =& $manager->getBlog($blogid);
    $blog = $b;
    // references can't be placed in global variables?
    if (!$blog->isValid) {
        doError(_ERROR_NOSUCHBLOG);
    }
    // set catid if necessary
    if ($catid) {
        // check if the category is valid
        if (!$blog->isValidCategory($catid)) {
            doError(_ERROR_NOSUCHCATEGORY);
        } else {
            $blog->setSelectedCategory($catid);
        }
    }
    // decide which skin should be used
    if ($skinid != '' && $skinid == 0) {
        selectSkin($skinid);
    }
    if (!$skinid) {
        $skinid = $blog->getDefaultSkin();
    }
    //$special = requestVar('special'); //get at top of file as global
    if (!empty($special) && isValidShortName($special)) {
        $type = strtolower($special);
    }
    $skin = new SKIN($skinid);
    if (!$skin->isValid) {
        doError(_ERROR_NOSUCHSKIN);
    }
    // set global skinpart variable so can determine quickly what is being parsed from any plugin or phpinclude
    global $skinpart;
    $skinpart = $type;
    // parse the skin
    $skin->parse($type);
    // check to see we should throw JustPosted event
    $blog->checkJustPosted();
}
开发者ID:hatone,项目名称:Nucleus-v3.64,代码行数:101,代码来源:globalfunctions.php


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