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

PHP vB_Cache类代码示例

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

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



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

示例1: getTitles

 /**
  * fetches the help hierarchy, title phrases are included but text phrases are not
  * @return array
  *  * titles contains the hierarchy which sub-help items under the 'children' key
  *  * firstItem contains the first help item to display
  */
 public function getTitles()
 {
     $cache = vB_Cache::instance(vB_Cache::CACHE_LARGE);
     $titles = $cache->read('vb_FAQ_Titles');
     if (empty($titles)) {
         $assertor = vB::getDbAssertor();
         $phrases = $assertor->getColumn('vBForum:phrase', 'text', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT, 'fieldname' => array('faqtext', 'faqtitle'), 'languageid' => array(-1, 0, vB::getCurrentSession()->get('languageid'))), false, 'varname');
         $faqs = $assertor->getRows('vBForum:faq', array(), 'displayorder', 'faqname');
         foreach ($faqs as $faqname => &$faq) {
             if ($faqname == 'faqroot') {
                 continue;
             }
             $faq['title_phrase'] = $faq['faqname'] . '_gfaqtitle';
             $faq['text_phrase'] = $faq['faqname'] . '_gfaqtext';
             $faq['title'] = $phrases[$faq['title_phrase']];
             $faq['text'] = $phrases[$faq['text_phrase']];
             $parentPath = '';
             $parent = $faq['faqparent'];
             while ($parent != 'faqroot' and isset($faqs[$parent])) {
                 $parentPath = $faqs[$parent]['faqname'] . '/' . $parentPath;
                 $parent = $faqs[$parent]['faqparent'];
             }
             $faq['path'] = $parentPath . $faq['faqname'];
             $faqs[$faq['faqparent']]['children'][$faq['faqname']] =& $faq;
         }
         $titles = $faqs['faqroot']['children'];
         $cache->write('vb_FAQ_Titles', $titles, 300, 'vB_FAQ_chg');
     }
     return array('titles' => $titles, 'firstItem' => $this->findFirst($titles));
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:36,代码来源:help.php


示例2: createChannel

 /**
  * Create a blog channel.
  *
  * @param array $input
  * @param int $channelid
  * @param int $channelConvTemplateid
  * @param int $channelPgTemplateId
  * @param int $ownerSystemGroupId
  *
  * @return int The nodeid of the new blog channel
  */
 public function createChannel($input, $channelid, $channelConvTemplateid, $channelPgTemplateId, $ownerSystemGroupId)
 {
     $input['parentid'] = $channelid;
     $input['inlist'] = 1;
     // we don't want it to be shown in channel list, but we want to move them
     $input['protected'] = 0;
     if (empty($input['userid'])) {
         $input['userid'] = vB::getCurrentSession()->get('userid');
     }
     if (!isset($input['publishdate'])) {
         $input['publishdate'] = vB::getRequest()->getTimeNow();
     }
     $input['templates']['vB5_Route_Channel'] = $channelPgTemplateId;
     $input['templates']['vB5_Route_Conversation'] = $channelConvTemplateid;
     // add channel node
     $channelLib = vB_Library::instance('content_channel');
     $input['page_parentid'] = 0;
     $result = $channelLib->add($input, array('skipFloodCheck' => true, 'skipDupCheck' => true));
     //Make the current user the channel owner.
     $userApi = vB_Api::instanceInternal('user');
     $usergroup = vB::getDbAssertor()->getRow('usergroup', array('systemgroupid' => $ownerSystemGroupId));
     if (empty($usergroup) or !empty($usergroup['errors'])) {
         //This should never happen. It would mean an invalid parameter was passed
         throw new vB_Exception_Api('invalid_request');
     }
     vB_User::setGroupInTopic($input['userid'], $result['nodeid'], $usergroup['usergroupid']);
     vB_Cache::allCacheEvent(array('nodeChg_' . $this->blogChannel, "nodeChg_{$channelid}"));
     vB::getUserContext()->rebuildGroupAccess();
     vB_Channel::rebuildChannelTypes();
     // clear follow cache
     vB_Api::instanceInternal('follow')->clearFollowCache(array($input['userid']));
     return $result['nodeid'];
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:44,代码来源:blog.php


示例3: createChannel

 /**
  * Create an article category channel. This function works basically like the blog library's version
  *
  * @param array 	$input						data array, should have standard channel data like title, parentid, 
  * @param int 		$channelid					parentid that the new channel should fall under. 
  * @param int		$channelConvTemplateid		"Conversation" level pagetemplate to use. Typically vB_Page::getArticleConversPageTemplate()
  * @param int 		$channelPgTemplateId		"Channel" level pagetemplate to use. Typically  vB_Page::getArticleChannelPageTemplate()
  * @param int 		$ownerSystemGroupId
  *
  * @return int The nodeid of the new blog channel
  */
 public function createChannel($input, $channelid, $channelConvTemplateid, $channelPgTemplateId, $ownerSystemGroupId)
 {
     if (!isset($input['parentid']) or intval($input['parentid']) < 1) {
         $input['parentid'] = $channelid;
     }
     $input['inlist'] = 1;
     // we don't want it to be shown in channel list, but we want to move them
     $input['protected'] = 0;
     if (empty($input['userid'])) {
         $input['userid'] = vB::getCurrentSession()->get('userid');
     }
     if (!isset($input['publishdate'])) {
         $input['publishdate'] = vB::getRequest()->getTimeNow();
     }
     $input['templates']['vB5_Route_Channel'] = $channelPgTemplateId;
     $input['templates']['vB5_Route_Article'] = $channelConvTemplateid;
     $input['childroute'] = 'vB5_Route_Article';
     // add channel node
     $channelLib = vB_Library::instance('content_channel');
     $input['page_parentid'] = 0;
     $result = $channelLib->add($input, array('skipNotifications' => true, 'skipFloodCheck' => true, 'skipDupCheck' => true));
     //Make the current user the channel owner.
     $userApi = vB_Api::instanceInternal('user');
     $usergroup = vB::getDbAssertor()->getRow('usergroup', array('systemgroupid' => $ownerSystemGroupId));
     vB_Cache::allCacheEvent(array('nodeChg_' . $this->articleHomeChannel, "nodeChg_{$channelid}"));
     vB::getUserContext()->rebuildGroupAccess();
     vB_Channel::rebuildChannelTypes();
     // clear follow cache
     vB_Api::instanceInternal('follow')->clearFollowCache(array($input['userid']));
     return $result['nodeid'];
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:42,代码来源:article.php


示例4: parse

 public static function parse($text, $options = array(), $attachments = array(), $cacheInfo = array())
 {
     //if we have a nodeid, let's try to cache this.
     if (!empty($cacheInfo)) {
         //TODO- Find a caching method that doesn't break collapsed mode.
         if (!empty($cacheInfo['nodeid'])) {
             $cacheKey = 'vbNodeText' . $cacheInfo['nodeid'];
         } else {
             if (!empty($cacheInfo['signatureid'])) {
                 $cacheKey = 'vbSig' . $cacheInfo['signatureid'];
             }
         }
         if (!empty($cacheKey)) {
             $cacheKey .= strval($options);
             $parsed = vB_Cache::instance()->read($cacheKey);
             if ($parsed) {
                 return $parsed;
             }
         }
     }
     $result = self::parseInternal(new vB5_Template_BbCode(), $text, $options, $attachments);
     if (!empty($cacheKey)) {
         if (!empty($cacheInfo['nodeid'])) {
             $cacheEvent = 'nodeChg_' . $cacheInfo['nodeid'];
         } else {
             if (!empty($cacheInfo['signatureid'])) {
                 $cacheEvent = 'userChg_' . $cacheInfo['signatureid'];
             }
         }
         vB_Cache::instance()->write($cacheKey, $result, 86400, $cacheEvent);
     }
     return $result;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:33,代码来源:bbcode.php


示例5: getRedirect301

 /**
  * discard all query parameters
  * caches the new route and return it every time
  * this is the simplest form of redirection
  * if subclass is any complicate than this, override is needed
  */
 public function getRedirect301()
 {
     $this->queryParameters = array();
     $cache = vB_Cache::instance(vB_Cache::CACHE_STD);
     $cacheKey = get_class($this);
     $data = $cache->read($cacheKey);
     if (!$data) {
         $data = $this->getNewRouteInfo();
         $cache->write($cacheKey, $data, 86400);
     }
     return $data;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:18,代码来源:legacy.php


示例6: __construct

 /**
  * Constructor public to allow for separate automated unit testing. Actual code should use
  * vB_Cache::instance();
  * @see vB_Cache::instance()
  */
 public function __construct($cachetype)
 {
     parent::__construct($cachetype);
     $this->requestStart = vB::getRequest()->getTimeNow();
     $config = vB::getConfig();
     $this->cachetype = $cachetype;
     if (!isset($config['Cache']['fileCachePath'])) {
         throw new vB_Exception_Cache('need_filecache_location');
     }
     $this->cacheLocation = $config['Cache']['fileCachePath'];
     if (!is_dir($this->cacheLocation) or !is_writable($this->cacheLocation)) {
         throw new vB_Exception_Cache('invalid_filecache_location- ' . $this->cacheLocation);
     }
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:19,代码来源:filesystem.php


示例7: instance

 /**
  * Returns an instance of the global cache.
  * The cache type used is defined in options.
  *
  * @return vB_Cache							- Reference to instance of the cache handler
  */
 public static function instance()
 {
     if (!isset(self::$instance)) {
         // TODO: Use config to determine the cache types to use
         self::$instance = vB_Cache_Db::instance();
         // TODO: Get appropriate class from options
         self::$instance->attachObserver(vB_Cache_Observer_Db::instance(self::$instance));
         vB::$vbulletin->shutdown->add(array(self::$instance, 'shutdown'));
     }
     if (vB::$vbulletin->debug and $_REQUEST['nocache']) {
         vB::$vbulletin->options['nocache'] = 1;
     }
     return self::$instance;
 }
开发者ID:Kheros,项目名称:MMOver,代码行数:20,代码来源:cache.php


示例8: getFullCategoryList

function getFullCategoryList(&$channelInfoArray = array(), $tabsize = 1, $tabchar = "--", $tabspace = " ")
{
    $cache = vB_Cache::instance(vB_Cache::CACHE_STD);
    $cacheKey = "vBAdminCP_CMS_Categories";
    $categories = $cache->read($cacheKey);
    $writeCache = false;
    $cacheEvents = array();
    if (empty($categories)) {
        $categories = vB::getDbAssertor()->getRows('vBAdminCP:getCMSChannels', array('articleChannelId' => vB_Api::instanceInternal('node')->fetchArticleChannel(), 'channelcontenttype' => vB_Api::instanceInternal('ContentType')->fetchContentTypeIdFromClass('Channel')));
        $writeCache = true;
    }
    $categoriesList = array();
    // The query result is sorted by depth first. We have to group/sort into a hierarchical order, such that
    // children come immediately after a parent.
    $parent_position = array();
    // parentid => position
    $nodeid_index = array();
    // nodeid => search result index
    foreach ($categories as $index => $category) {
        $cacheEvents[] = 'nodeChg_' . $category['nodeid'];
        $parentid = $category['parentid'];
        $nodeid_index[$category['nodeid']] = $index;
        if (empty($parent_position)) {
            $parent_position[$category['nodeid']] = 0;
        } else {
            $position = $parent_position[$parentid] + 1;
            // increment positions of parents whose positions are after $position
            foreach ($parent_position as $pid => $pos) {
                if ($pos >= $position) {
                    $parent_position[$pid]++;
                }
            }
            // node will be positioned after its parent, but above any siblings. This is why all but the depth is sort order DESC in the query.
            $parent_position[$category['nodeid']] = $position;
        }
    }
    // sort parent_position by position
    asort($parent_position);
    foreach ($parent_position as $nodeid => $position) {
        $category = $categories[$nodeid_index[$nodeid]];
        $channelInfoArray[$category['nodeid']] = array("title" => $category['htmltitle'], "parentid" => $category['parentid'], "showpublished" => $category['showpublished'], "textcount" => $category['textcount'], "displayorder" => $category['displayorder'], "description" => $category['description']);
        $tab = str_repeat($tabchar, $category['depth'] * $tabsize) . $tabspace;
        $categoriesList[$category['nodeid']] = $tab . $category['htmltitle'];
    }
    if ($writeCache) {
        $cache->write($cacheKey, $categories, 1440, $cacheEvents);
    }
    return $categoriesList;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:49,代码来源:cms.php


示例9: getUrl

 public function getUrl()
 {
     $cache = vB_Cache::instance(vB_Cache::CACHE_FAST);
     $hashKey = 'vbRouteURLIndent_' . $this->arguments['nodeid'];
     $urlident = $cache->read($hashKey);
     if (empty($urlident)) {
         $node = vB_Library::instance('node')->getNodeBare($this->arguments['nodeid']);
         $urlident = $node['urlident'];
         $cache->write($hashKey, $urlident);
     } elseif (is_array($urlident) and !empty($urlident['urlident'])) {
         $urlident = $urlident['urlident'];
     }
     $url = '/album/' . $this->arguments['nodeid'] . '-' . $urlident;
     if (strtolower(vB_String::getCharset()) != 'utf-8') {
         $url = vB_String::encodeUtf8Url($url);
     }
     return $url;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:18,代码来源:album.php


示例10: deletePerms

 /** this deletes an existing permission
  *
  * 	@return	mixed		either permissionid(single or array), or nodeid and usergroupid. A single Nodeid is required and usergroup is optional and may be an array
  ***/
 public function deletePerms($params)
 {
     if (!empty($params['permissionid'])) {
         //We don't allow deleting permissions from page 1.
         $existing = vB::getDbAssertor()->getRow('vBForum:permission', array('permissionid' => $params['permissionid']));
         if (empty($existing) or !empty($existing['errors']) or $existing['nodeid'] == 1) {
             return false;
         }
         $qryParams['permissionid'] = $params['permissionid'];
     } else {
         if (!empty($params['nodeid']) and intval($params['nodeid'])) {
             $qryParams['nodeid'] = intval($params['nodeid']);
             if (!empty($params['groupid'])) {
                 $qryParams['groupid'] = $params['groupid'];
             }
         } else {
             return false;
         }
     }
     $qryParams[vB_dB_Query::TYPE_KEY] = vB_dB_Query::QUERY_DELETE;
     $result = vB::getDbAssertor()->assertQuery('vBForum:permission', $qryParams);
     vB_Cache::instance()->event('perms_changed');
     //force reloading the group access cache
     vB::getUserContext()->rebuildGroupAccess();
     return $result;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:30,代码来源:channelpermission.php


示例11: foreach

     }
 }
 foreach ($productcodes_versions as $version) {
     foreach ($productcodes_grouped["{$version}"] as $productcode) {
         eval($productcode['uninstallcode']);
     }
 }
 //remove some common resources that a product may have registered.
 //tags
 $db->query_write("\r\n\t\tDELETE tagcontent\r\n\t\tFROM " . TABLE_PREFIX . "package AS package JOIN\r\n\t\t\t" . TABLE_PREFIX . "contenttype AS contenttype ON\r\n\t\t\t\tcontenttype.packageid = package.packageid JOIN\r\n\t\t\t" . TABLE_PREFIX . "tagcontent AS tagcontent ON\r\n\t\t\t\tcontenttype.contenttypeid = tagcontent.contenttypeid\r\n\t\tWHERE productid = '{$safe_productid}'\r\n\t");
 // Packages, routes, actions, contenttypes
 $db->query_write("\r\n\t\tDELETE package, route, action, contenttype\r\n\t\tFROM " . TABLE_PREFIX . "package AS package\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "route AS route\r\n\t\t\tON route.packageid = package.packageid\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "action AS action\r\n\t\t\tON action.routeid = route.routeid\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "contenttype AS contenttype\r\n\t\t\tON contenttype.packageid = package.packageid\r\n\t\tWHERE productid = '{$safe_productid}'\r\n\t");
 // Clear routes from datastore
 build_datastore('routes', serialize(array()), 1);
 //clear the type cache.
 vB_Cache::instance()->purge('vb_types.types');
 // need to remove the language columns for this product as well
 require_once DIR . '/includes/class_dbalter.php';
 $db_alter = new vB_Database_Alter_MySQL($db);
 if ($db_alter->fetch_table_info('language')) {
     $phrasetypes = $db->query_read("\r\n\t\t\tSELECT fieldname\r\n\t\t\tFROM " . TABLE_PREFIX . "phrasetype\r\n\t\t\tWHERE product = '" . $db->escape_string($vbulletin->GPC['productid']) . "'\r\n\t\t");
     while ($phrasetype = $db->fetch_array($phrasetypes)) {
         $db_alter->drop_field("phrasegroup_{$phrasetype['fieldname']}");
     }
 }
 delete_product($vbulletin->GPC['productid']);
 build_all_styles();
 vBulletinHook::build_datastore($db);
 require_once DIR . '/includes/adminfunctions_language.php';
 build_language();
 build_options();
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:plugin.php


示例12: preDelete

	/**
	* Additional tasks to perform before a delete.
	*
	* Return false to indicate that the entire delete process was not a success.
	*
	* @param mixed								- The result of execDelete()
	*/
	protected function preDelete($result)
	{
		$this->assertItem();

		require_once DIR . '/includes/class_taggablecontent.php';
		$taggable = vB_Taggable_Content_Item::create(vB::$vbulletin,
			vB_Types::instance()->getContentTypeID("vBCms_Article"),
			intval($this->item->getId()));
		$taggable->delete_tag_attachments();

		vB::$db->query_write("
			DELETE FROM " . TABLE_PREFIX . "cms_nodecategory
			WHERE nodeid = " . intval($this->item->getNodeId())
		);

		vB::$db->query_write("
			DELETE FROM " . TABLE_PREFIX . "cms_article
			WHERE contentid = " . intval($this->item->getId())
		);
		vB_Cache::instance()->event('categories_updated');

		return parent::preDelete($result);
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:article.php


示例13: fetchCommonRoutes

 /** Returns a list of common routes. We check these to see if we can avoid the far most expensive selectBestRoute call
  *
  * 	#return array of string => string	map of url to route class.
  **/
 public static function fetchCommonRoutes()
 {
     if ($common = vB_Cache::instance(vB_Cache::CACHE_STD)->read('vB_CommonRoutes') and !empty($common)) {
         return $common;
     }
     $guids = array(vB_Channel::MAIN_CHANNEL, vB_Channel::DEFAULT_FORUM_PARENT, vB_Channel::MAIN_FORUM, vB_Channel::MAIN_FORUM_CATEGORY, vB_Channel::DEFAULT_BLOG_PARENT, vB_Channel::DEFAULT_SOCIALGROUP_PARENT, vB_Channel::PRIVATEMESSAGE_CHANNEL, vB_Channel::VISITORMESSAGE_CHANNEL);
     // todo, also add empty prefix channel route for when home page has been changed?
     $routes = vB::getDbAssertor()->assertQuery('vBForum:getRouteFromChGuid', array('guid' => $guids));
     $common = array();
     foreach ($routes as $route) {
         $common[$route['prefix']] = $route;
         $common[$route['prefix']]['length'] = strlen($route['prefix']);
     }
     vB_Cache::instance(vB_Cache::CACHE_STD)->write('vB_CommonRoutes', $common, 1440, 'vB_routesChgMultiple');
     return $common;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:20,代码来源:route.php


示例14: updateContentRoute

 protected static function updateContentRoute($oldRouteInfo, $newRouteInfo)
 {
     $db = vB::getDbAssertor();
     $events = array();
     // update redirect301 fields
     $updateIds = $db->assertQuery('get_update_route_301', array('oldrouteid' => $oldRouteInfo['routeid']));
     if (!empty($updateIds)) {
         $routeIds = array();
         foreach ($updateIds as $route) {
             $routeid = $route['routeid'];
             $events[] = "routeChg_{$routeid}";
             $routeIds[] = $routeid;
         }
         $db->update('routenew', array('redirect301' => $newRouteInfo['routeid'], 'name' => vB_dB_Query::VALUE_ISNULL), array('routeid' => $routeIds));
     }
     // don't modify the routeid for default pages, as it will still be used
     $updateIds = $db->assertQuery('page', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT, vB_dB_Query::COLUMNS_KEY => array('pageid'), vB_dB_Query::CONDITIONS_KEY => array('routeid' => $oldRouteInfo['routeid'], 'pagetype' => vB_Page::TYPE_CUSTOM)));
     if (!empty($updateIds)) {
         $pageIds = array();
         foreach ($updateIds as $page) {
             $pageid = $page['pageid'];
             $events[] = "pageChg_{$pageid}";
             $pageIds[] = $pageid;
         }
         $db->update('page', array('routeid' => $newRouteInfo['routeid']), array('pageid' => $pageIds));
     }
     vB_Cache::allCacheEvent($events);
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:28,代码来源:settings.php


示例15: getComments

	private static function getComments($nodeid, $userinfo, &$permissions, $associatedthreadid)
	{
		require_once DIR . '/vb/cache.php';
		if ($comments = vB_Cache::instance()->read(
			self::getStaticHash($nodeid), true))
		{
			return $comments;
		}

		$sql = "SELECT distinct post.postid, post.visible, post.dateline
			FROM " . TABLE_PREFIX .	"post AS post
			WHERE threadid = $associatedthreadid AND parentid != 0 AND visible = 1 ORDER BY post.dateline ASC";

		if (! ($rst = vB::$vbulletin->db->query_read($sql)))
		{
			return false;
		}

		$ids = array();

		//Now we compare the fields. We need to check fields from the third
		// to the end of the row. If the value is different from the previous row,
		// we add a record.
		while($row =  vB::$vbulletin->db->fetch_array($rst))
		{
			if (self::canViewPost($row, $permissions))
			{
				$ids[] = $row['postid'];
			}
		}

		if ((count($ids) == 1) and !intval($ids[0]))
		{
			$ids = false;
		}

		//Now we have a list of posts.
		vB_Cache::instance()->write(self::getStaticHash($nodeid),
			   $ids, self::$static_cache_ttl, array('cms_comments_change_' . $associatedthreadid));
		return $ids;

	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:42,代码来源:comments.php


示例16: buildStyleDatastore

 /**
  * Rebuild the style datastore.
  */
 public function buildStyleDatastore()
 {
     $this->setCssDate();
     $stylecache = $this->fetchStyles(true, false, array('themes' => true));
     foreach ($stylecache as $key => $style) {
         // VBV-4174: we don't want stylevars in the datastore
         if (isset($style['newstylevars'])) {
             unset($stylecache[$key]['newstylevars']);
         }
     }
     vB::getDatastore()->build('stylecache', serialize($stylecache), 1);
     vB_Cache::allCacheEvent('vbCachedFullPage');
     vB_Library::instance('template')->rebuildTextonlyDS();
     return $stylecache;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:18,代码来源:style.php


示例17: activateUser

 /**
  * Activate an user with an activate ID
  *
  * @param int $userid User ID
  * @param string $activateid Activate ID
  *
  * @throws vB_Exception_Api
  * @return string User status after activation. Possible values:
  *		 1) moderateuser: user is put into moderate queue
  *		 2) emailchanged: user's email address has been updated successfully
  *		 3) registration_complete: user's registration is completed
  */
 public function activateUser($userid, $activateid)
 {
     $dbassertor = vB::getDbAssertor();
     $userinfo = vB_User::fetchUserinfo($userid);
     $usercontext = vB::getUserContext($userid);
     $userid = intval($userid);
     $usergroupcache = vB::getDatastore()->getValue('usergroupcache');
     $vboptions = vB::getDatastore()->getValue('options');
     if (!$userinfo) {
         throw new vB_Exception_Api('invalidid', array(vB_Phrase::fetchSinglePhrase('user'), vB5_Route::buildUrl('contact-us|fullurl')));
     }
     if ($userid == 0) {
         throw new vB_Exception_Api('invalidactivateid', array(vB5_Route::buildUrl('activateuser|fullurl'), vB5_Route::buildUrl('activateemail|fullurl'), vB5_Route::buildUrl('contact-us|fullurl')));
     } else {
         if ($userinfo['usergroupid'] == 3) {
             // check valid activation id
             $user = $dbassertor->getRow('useractivation', array('activationid' => $activateid, 'userid' => $userid, 'type' => 0));
             if (!$user or $activateid != $user['activationid']) {
                 // send email again
                 throw new vB_Exception_Api('invalidactivateid', array(vB5_Route::buildUrl('activateuser|fullurl'), vB5_Route::buildUrl('activateemail|fullurl'), vB5_Route::buildUrl('contact-us|fullurl')));
             }
             // delete activationid
             $dbassertor->delete('useractivation', array('userid' => $userid, 'type' => 0));
             if (empty($user['usergroupid'])) {
                 $user['usergroupid'] = 2;
                 // sanity check
             }
             // ### DO THE UG/TITLE UPDATE ###
             $getusergroupid = $userinfo['displaygroupid'] != $userinfo['usergroupid'] ? $userinfo['displaygroupid'] : $user['usergroupid'];
             $user_usergroup =& $usergroupcache["{$user['usergroupid']}"];
             $display_usergroup =& $usergroupcache["{$getusergroupid}"];
             // init user data manager
             $userdata = new vB_Datamanager_User(vB_DataManager_Constants::ERRTYPE_STANDARD);
             $userdata->set_existing($userinfo);
             $userdata->set('usergroupid', $user['usergroupid']);
             $userdata->set_usertitle(!empty($user['customtitle']) ? $user['usertitle'] : '', false, $display_usergroup, $usercontext->hasPermission('genericpermissions', 'canusecustomtitle') ? true : false, $usercontext->isAdministrator() ? true : false);
             if ($userinfo['coppauser'] or $vboptions['moderatenewmembers'] and !$userinfo['posts']) {
                 // put user in moderated group
                 $userdata->save();
                 return array('moderateuser', $this->fetchUserName($userid), vB5_Route::buildUrl('home|fullurl'));
             } else {
                 // activate account
                 $userdata->save();
                 // rebuild stats so new user displays on forum home
                 require_once DIR . '/includes/functions_databuild.php';
                 build_user_statistics();
                 vB_Cache::instance(vB_Cache::CACHE_FAST)->event(array("userPerms_{$userid}", "userChg_{$userid}"));
                 vB_Cache::instance(vB_Cache::CACHE_LARGE)->event(array("userPerms_{$userid}", "userChg_{$userid}"));
                 $username = unhtmlspecialchars($userinfo['username']);
                 if (!$user['emailchange']) {
                     if ($vboptions['welcomemail']) {
                         // Send welcome mail
                         $maildata = vB_Api::instanceInternal('phrase')->fetchEmailPhrases('welcomemail', array($username, $vboptions['bbtitle']), array($vboptions['bbtitle']), isset($user['languageid']) ? $user['languageid'] : vB::getDatastore()->getOption('languageid'));
                         vB_Mail::vbmail($userinfo['email'], $maildata['subject'], $maildata['message'], true);
                     }
                     $userdata->send_welcomepm(null, $userid);
                 }
                 if ($user['emailchange']) {
                     return 'emailchanged';
                 } else {
                     return array('registration_complete', vB_String::htmlSpecialCharsUni($username), vB5_Route::buildUrl('profile|fullurl', $userinfo), vB5_Route::buildUrl('settings|fullurl', array('tab' => 'account')), vB5_Route::buildUrl('settings|fullurl', array('tab' => 'account')), vB5_Route::buildUrl('home|fullurl'));
                 }
             }
         } else {
             if ($userinfo['usergroupid'] == 4) {
                 // In Moderation Queue
                 return 'activate_moderation';
                 vB_Cache::instance(vB_Cache::CACHE_FAST)->event(array("userPerms_{$userid}", "userChg_{$userid}"));
                 vB_Cache::instance(vB_Cache::CACHE_LARGE)->event(array("userPerms_{$userid}", "userChg_{$userid}"));
             } else {
                 // Already activated
                 throw new vB_Exception_Api('activate_wrongusergroup');
             }
         }
     }
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:88,代码来源:user.php


示例18: saveData

	protected function saveData()
	{
		// collect error messages
		$errors = array();
		vB::$vbulletin->input->clean_array_gpc('p', array(
			'do' => vB_Input::TYPE_STR,
			'html' => vB_Input::TYPE_STR,
			'title' => vB_Input::TYPE_STR,
			'new_parentid' => TYPE_INT,
			'html_title' => vB_Input::TYPE_STR,
			'publicpreview' => TYPE_INT,
			'item_id' => vB_Input::TYPE_INT

		));

		if (vB::$vbulletin->GPC['do'] == 'movenode'
			and vB::$vbulletin->GPC_exists['new_parentid'] AND intval(vB::$vbulletin->GPC['new_parentid']))
		{
			vBCms_ContentManager::moveSection(array($this->content->getNodeId()), vB::$vbulletin->GPC['new_parentid']);
			$new_sectionid = vB::$vbulletin->GPC['new_parentid'];
		}

		$new_values = array();
		// create DM and save
		$dm = $this->content->getDM();
		$dm->set('contentid', $this->content->getId());
		$dm->set('item_id', $this->content->getId());

		if (vB::$vbulletin->GPC_exists['html_title'])
		{
			$new_values['html_title'] = vB::$vbulletin->GPC['html_title'];
			$dm->set('html_title', vB::$vbulletin->GPC['html_title']);
		}

		if (vB::$vbulletin->GPC_exists['html'])
		{
			$new_values['html'] = vB::$vbulletin->GPC['html'];
			$dm->set('html', vB::$vbulletin->GPC['html']);
		}

		if (vB::$vbulletin->GPC_exists['comments_enabled'])
		{
			$new_values['comments_enabled'] = vB::$vbulletin->GPC['comments_enabled'];
			$dm->set('comments_enabled', vB::$vbulletin->GPC['comments_enabled']);
		}

		if (vB::$vbulletin->GPC_exists['title'])
		{
			$new_values['title'] = vB::$vbulletin->GPC['title'];
			$dm->set('title', vB::$vbulletin->GPC['title']);
		}

		if (vB::$vbulletin->GPC_exists['publicpreview'])
		{
			$new_values['publicpreview'] = vB::$vbulletin->GPC['publicpreview'];
			$dm->set('publicpreview', vB::$vbulletin->GPC['publicpreview']);
		}

		// add node info
		$dm->setNodeTitle($title);

		// set the node segment if it's empty
		if (!$this->content->getUrlTitle())
		{
			$dm->setNodeURLSegment($title);
		}

		$success = $dm->saveFromForm($this->content->getNodeId());

		//invalidate the navigation cache.

		vB_Cache::instance()->event(array('sections_updated' ));
		vBCms_Content::cleanContentCache();

		if ($dm->hasErrors())
		{
			$fieldnames = array(
				'html' => new vB_Phrase('vbcms', 'html')
			);

			$view->errors = $dm->getErrors(array_keys($fieldnames));
			$view->error_summary = self::getErrorSummary($dm->getErrors(array_keys($fieldnames)), $fieldnames);
			$view->status = $view->error_view->title;
		}
		else
		{
			$view->status = new vB_Phrase('vbcms', 'content_saved');
			$this->cleanContentCache();
		}

		// postback content
		$view->html_title = $new_values['html_title'];
		$view->title = $new_values['title'];
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:94,代码来源:statichtml.php


示例19: array

// get usergroups who should be displayed on showgroups
// Scans too many rows. Usergroup Rows * User Rows
// VBIV-6689 Caching.
$groupcache = array();
if ($vbulletin->options['flcache']) {
    $groupcache = vB_Cache::instance()->read('showgroups.groupcache');
}
if (empty($groupcache)) {
    $users = $db->query_read_slave("\n\t\tSELECT user.*,\n\t\t\tusergroup.title,\n\t\t\tuser.options, usertextfield.buddylist,\n\t\t\t" . ($show['locationfield'] ? 'userfield.field2,' : '') . "\n\t\t\tIF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid\n\t\t\t" . ($vbulletin->options['avatarenabled'] ? ",avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,\n\t\t\tcustomavatar.width AS avwidth,customavatar.height AS avheight, customavatar.width_thumb AS avwidth_thumb, customavatar.height_thumb AS avheight_thumb, \n\t\t\tfiledata_thumb, NOT ISNULL(customavatar.userid) AS hascustom" : "") . "\n\t\t{$hook_query_fields}\n\t\tFROM " . TABLE_PREFIX . "user AS user\n\t\tLEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON(usergroup.usergroupid = user.usergroupid OR FIND_IN_SET(usergroup.usergroupid, user.membergroupids))\n\t\tLEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid=user.userid)\n\t\t" . ($vbulletin->options['avatarenabled'] ? "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) \n\t\t\tLEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)" : "") . "\n\t\t{$hook_query_joins}\n\t\tWHERE (usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['showgroup'] . ")\n\t\t{$hook_query_where}\n\t");
    while ($user = $db->fetch_array($users)) {
        $t = strtoupper($user['title']);
        $u = strtoupper($user['username']);
        $groupcache["{$t}"]["{$u}"] = $user;
    }
    if ($vbulletin->options['flcache']) {
        vB_Cache::instance()->write('showgroups.groupcache', $groupcache, $vbulletin->options['flcache']);
    }
}
$usergroups = '';
if (sizeof($groupcache) >= 1) {
    ksort($groupcache);
    // alphabetically sort usergroups
    foreach ($groupcache as $users) {
        ksort($users);
        // alphabetically sort users
        $usergroupbits = '';
        foreach ($users as $user) {
            exec_switch_bg();
            $user = process_showgroups_userinfo($user);
            if ($vbulletin->options['enablepms'] and $vbulletin->userinfo['permissions']['pmquota'] and ($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] or $user['receivepm'] and $user['permissions']['pmquota'] and (!$user['receivepmbuddies'] or can_moderate() or strpos(" {$user['buddylist']} ", ' ' . $vbulletin->userinfo['userid'] . ' ') !== false))) {
                $show['pmlink'] = true;
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:showgroups.php


示例20:

				"
			);
		}
	}

	$upgrade->execute();
}

if ($vbulletin->GPC['step'] == 3)
{
	require_once(DIR . '/includes/class_bootstrap_framework.php');
	vB_Bootstrap_Framework::init();

	//clear the cache.  There are some values that are incorrect because of code changes,
	//make sure that we don't allow those values to be used after the upgrade.
	vB_Cache::instance()->clean(false);
}

// #############################################################################
// FINAL step (notice the SCRIPTCOMPLETE define)\

//clear cache
if ($vbulletin->GPC['step'] == 4)
{
	// tell log_upgrade_step() that the script is done
	define('SCRIPTCOMPLETE', true);
}

// #############################################################################

print_next_step();
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:upgrade_404.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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