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

PHP vB_Types类代码示例

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

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



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

示例1: _init_index_map

 protected static function _init_index_map()
 {
     // init index map
     $vb_types = vB_Types::instance();
     self::$_sphinx_index_map = array($vb_types->getContentTypeId('vBForum_Post') => array('ThreadPostMain', 'ThreadPostDelta'), $vb_types->getContentTypeId('vBForum_SocialGroupMessage') => array('DiscussionMessageMain', 'DiscussionMessageDelta'), $vb_types->getContentTypeId('vBForum_SocialGroup') => array('SocialGroupMain', 'SocialGroupDelta'), $vb_types->getContentTypeId('vBBlog_BlogEntry') => array('BlogEntryMain', 'BlogEntryDelta'), $vb_types->getContentTypeId('vBBlog_BlogComment') => array('BlogCommentMain', 'BlogCommentDelta'), $vb_types->getContentTypeId('vBCms_Article') => array('CMSArticlesMain', 'CMSArticlesDelta'), $vb_types->getContentTypeId('vBForum_VisitorMessage') => array('VisitorMessageMain', 'VisitorMessageDelta'));
     return true;
 }
开发者ID:rcdesign,项目名称:vb-sphinx_search,代码行数:7,代码来源:core.php


示例2: output

 public function output()
 {
     global $vbulletin;
     if (!isset($vbulletin->userinfo['permissions']['cms'])) {
         vBCMS_Permissions::getUserPerms();
     }
     $publishlist = implode(', ', vB::$vbulletin->userinfo['permissions']['cms']['canpublish']);
     $viewlist = implode(', ', vB::$vbulletin->userinfo['permissions']['cms']['allview']);
     $rst = vB::$vbulletin->db->query_read_slave("SELECT node.nodeid, node.parentnode, node.url, node.permissionsfrom,\n\t\t\tnode.setpublish, node.publishdate, node.noderight, info.title FROM " . TABLE_PREFIX . "cms_node AS node INNER JOIN " . TABLE_PREFIX . "cms_nodeinfo AS info ON info.nodeid = node.nodeid\n\t\t\t WHERE node.contenttypeid = " . vB_Types::instance()->getContentTypeID("vBCms_Section") . "  AND\n\t\t((node.permissionsfrom IN ({$viewlist})  AND node.hidden = 0 ) OR (node.permissionsfrom IN ({$publishlist})))\n\t\t\t ORDER BY node.nodeleft");
     $nodes = array();
     $noderight = 0;
     while ($record = vB::$vbulletin->db->fetch_array($rst)) {
         if (!in_array($record['permissionsfrom'], vB::$vbulletin->userinfo['permissions']['cms']['canedit']) and !(in_array($record['permissionsfrom'], vB::$vbulletin->userinfo['permissions']['cms']['canview']) and $record['setpublish'] == '1' and $record['publishdate'] < TIMENOW) or $record['noderight'] < $noderight) {
             //We need to skip this record and all its children
             $noderight = $record['permissionsfrom'];
             continue;
         }
         $nodes[] = $record;
     }
     if (count($nodes)) {
         reset($nodes);
         $nodes = $this->setNavArray($nodes);
         return $nodes;
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:25,代码来源:api_cmssectionlist.php


示例3: getNewRouteInfo

 protected function getNewRouteInfo()
 {
     $arguments =& $this->arguments;
     $param =& $this->queryParameters;
     $keys = array_keys($param);
     $idkey = array('t', 'threadid');
     if (empty($param['do'])) {
         $param['do'] = 'showsmilies';
     }
     switch ($param['do']) {
         case 'bbcode':
             $this->anchor = 'bbcode_reference/bbcode_why';
             return 'help';
         case 'showrules':
             $this->anchor = 'community_overview/general_tos';
             return 'help';
         case 'showsmilies':
             $this->anchor = 'bbcode_reference/bbcode_smilies';
             return 'help';
         case 'whoposted':
             if ($set = array_intersect($keys, $idkey) and $pid = intval($param[reset($set)])) {
                 $oldid = $pid;
                 $oldcontenttypeid = vB_Types::instance()->getContentTypeID(array('package' => 'vBForum', 'class' => 'Thread'));
                 $node = vB::getDbAssertor()->getRow('vBForum:node', array('oldid' => $oldid, 'oldcontenttypeid' => $oldcontenttypeid));
                 if (!empty($node)) {
                     $arguments['nodeid'] = $node['nodeid'];
                     return $node['routeid'];
                 }
             }
         default:
             throw new vB_Exception_404('invalid_page');
     }
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:33,代码来源:misc.php


示例4: fetchChannelNodes

 protected function fetchChannelNodes($parent, $page, $perpage, $depth = 3, $contentype = 0, $options = false)
 {
     $api = Api_InterfaceAbstract::instance();
     $optionsArray = array();
     if (!$contentype) {
         $contentype = vB_Types::instance()->getContentTypeID('vBForum_Channel');
     }
     $params = array('parentid' => $parent, 'page' => $page, 'perpage' => $perpage, 'depth' => $depth, 'contenttypeid' => $contentype, 'options' => $options);
     return $api->callApi('node', 'listNodeFullContent', $params);
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:10,代码来源:activity.php


示例5: output

 public function output()
 {
     global $vbulletin, $db, $show, $VB_API_REQUESTS;
     if (!$VB_API_REQUESTS['api_c']) {
         // The client doesn't have an ID yet. So we need to generate a new one.
         $vbulletin->input->clean_array_gpc('r', array('clientname' => TYPE_STR, 'clientversion' => TYPE_STR, 'platformname' => TYPE_STR, 'platformversion' => TYPE_STR, 'uniqueid' => TYPE_STR));
         // All params are required.
         // uniqueid is the best to be a permanent unique id such as hardware ID (CPU ID,
         // Harddisk ID or Mobile IMIE). Some client can not get a such a uniqueid,
         // so it needs to generate an unique ID and save it in its local storage. If it
         // requires the client ID and Secret again, pass the same unique ID.
         if (!$vbulletin->GPC['clientname'] or !$vbulletin->GPC['clientversion'] or !$vbulletin->GPC['platformname'] or !$vbulletin->GPC['platformversion'] or !$vbulletin->GPC['uniqueid']) {
             return $this->error('apiclientinfomissing', 'Miss required client information');
         }
         // Gererate clienthash.
         $clienthash = md5($vbulletin->GPC['clientname'] . $vbulletin->GPC['platformname'] . $vbulletin->GPC['uniqueid']);
         // Generate a new secret
         $secret = fetch_random_password(32);
         // If the same clienthash exists, return secret back to the client.
         $client = $db->query_first_slave("SELECT *\n\t\t\t\tFROM " . TABLE_PREFIX . "apiclient\n\t\t\t\tWHERE clienthash = '" . $db->escape_string($clienthash) . "'\n\t\t\t\tLIMIT 1\n\t\t\t");
         $apiclientid = $client['apiclientid'];
         if ($apiclientid) {
             // Update secret
             // Also remove userid so it will logout previous loggedin and remembered user. (VBM-553)
             $db->query_write("UPDATE " . TABLE_PREFIX . "apiclient SET\n\t\t\t\t\tsecret = '" . $db->escape_string($secret) . "',\n\t\t\t\t\tapiaccesstoken = '" . $db->escape_string($vbulletin->session->vars['apiaccesstoken']) . "',\n\t\t\t\t\tlastactivity = " . TIMENOW . ",\n\t\t\t\t\tclientversion = '" . $db->escape_string($vbulletin->GPC['clientversion']) . "',\n\t\t\t\t\tplatformversion = '" . $db->escape_string($vbulletin->GPC['platformversion']) . "',\n\t\t\t\t\tuserid = 0\n\t\t\t\t\tWHERE apiclientid = {$apiclientid}");
         } else {
             // Create a new client
             $db->query_write("\n\t\t\t\t\tINSERT INTO " . TABLE_PREFIX . "apiclient (\n\t\t\t\t\t\tsecret, clienthash, clientname, clientversion, platformname,\n\t\t\t\t\t\tplatformversion, uniqueid, initialipaddress, apiaccesstoken,\n\t\t\t\t\t\tdateline, lastactivity\n\t\t\t\t\t)\n\t\t\t\t\tVALUES (\n\t\t\t\t\t\t'" . $db->escape_string($secret) . "', " . "'" . $db->escape_string($clienthash) . "', " . "'" . $db->escape_string($vbulletin->GPC['clientname']) . "', " . "'" . $db->escape_string($vbulletin->GPC['clientversion']) . "', " . "'" . $db->escape_string($vbulletin->GPC['platformname']) . "', " . "'" . $db->escape_string($vbulletin->GPC['platformversion']) . "', " . "'" . $db->escape_string($vbulletin->GPC['uniqueid']) . "', " . "'" . $db->escape_string($vbulletin->alt_ip) . "', " . "'" . $db->escape_string($vbulletin->session->vars['apiaccesstoken']) . "', " . TIMENOW . ", " . TIMENOW . "\n\t\t\t\t\t)\n\t\t\t\t");
             $apiclientid = $db->insert_id();
         }
         // Set session client ID
         $vbulletin->session->set('apiclientid', $apiclientid);
     } else {
         // api_c and api_sig are verified in init.php so we don't need to verify here again.
         $apiclientid = intval($VB_API_REQUESTS['api_c']);
         // Update lastactivity
         $db->query_write("UPDATE " . TABLE_PREFIX . "apiclient SET\n\t\t\t\tlastactivity = " . TIMENOW . "\n\t\t\t\tWHERE apiclientid = {$apiclientid}");
     }
     $contenttypescache = vB_Types::instance()->getContentTypes();
     foreach ($contenttypescache as $contenttype) {
         $contenttypes[$contenttype['class']] = $contenttype['id'];
     }
     // Check the status of CMS and Blog
     $blogenabled = $vbulletin->products['vbblog'] == '1';
     $cmsenabled = $vbulletin->products['vbcms'] == '1';
     $data = array('apiversion' => VB_API_VERSION, 'apiaccesstoken' => $vbulletin->session->vars['apiaccesstoken'], 'bbtitle' => $vbulletin->options['bbtitle'], 'bburl' => $vbulletin->options['bburl'], 'bbactive' => $vbulletin->options['bbactive'], 'forumhome' => $vbulletin->options['forumhome'], 'vbulletinversion' => $vbulletin->options['templateversion'], 'contenttypes' => $contenttypes, 'features' => array('blogenabled' => $blogenabled, 'cmsenabled' => $cmsenabled, 'pmsenabled' => (bool) $vbulletin->options['enablepms'], 'searchesenabled' => (bool) $vbulletin->options['enablesearches'], 'groupsenabled' => (bool) ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_groups']), 'albumsenabled' => (bool) ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_albums']), 'friendsenabled' => (bool) ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_friends']), 'visitor_trackingenabled' => (bool) ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_visitor_tracking']), 'visitor_messagingenabled' => (bool) ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_visitor_messaging']), 'multitypesearch' => true, 'taggingenabled' => (bool) $vbulletin->options['threadtagging'], 'paidsubs' => $this->paidSubs()), 'permissions' => $vbulletin->userinfo['permissions'], 'show' => $show);
     if (!$vbulletin->options['bbactive']) {
         $data['bbclosedreason'] = $vbulletin->options['bbclosedreason'];
     }
     $data['apiclientid'] = $apiclientid;
     if (!$VB_API_REQUESTS['api_c']) {
         $data['secret'] = $secret;
     }
     return $data;
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:55,代码来源:api_init.php


示例6: populate

 public function populate()
 {
     $typeid = vB::$vbulletin->activitystream['socialgroup_photocomment']['typeid'];
     $this->delete($typeid);
     if (!vB::$vbulletin->activitystream['socialgroup_photocomment']['enabled']) {
         return;
     }
     $contenttypeid = vB_Types::instance()->getContentTypeID('vBForum_SocialGroup');
     $timespan = TIMENOW - vB::$vbulletin->options['as_expire'] * 60 * 60 * 24;
     vB::$db->query_write("\n\t\t\tINSERT INTO " . TABLE_PREFIX . "activitystream\n\t\t\t\t(userid, dateline, contentid, typeid, action)\n\t\t\t\t(SELECT\n\t\t\t\t\tpostuserid, dateline, commentid, '{$typeid}', 'create'\n\t\t\t\tFROM " . TABLE_PREFIX . "picturecomment\n\t\t\t\tWHERE\n\t\t\t\t\tdateline >= {$timespan}\n\t\t\t\t\t\tAND\n\t\t\t\t\tsourcecontenttypeid = {$contenttypeid}\n\t\t\t\t)\n\t\t");
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:11,代码来源:photocomment.php


示例7: getNewRouteInfo

 protected function getNewRouteInfo()
 {
     $oldid = $this->captureOldId();
     $node = vB::getDbAssertor()->getRow('vBForum:fetchLegacyPostIds', array('oldids' => $oldid, 'postContentTypeId' => vB_Types::instance()->getContentTypeID('vBForum_Post')));
     if (empty($node)) {
         throw new vB_Exception_404('invalid_page');
     }
     $this->arguments['nodeid'] = $node['starter'];
     $this->arguments['innerPost'] = $node['nodeid'];
     return $node['routeid'];
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:11,代码来源:post.php


示例8: deleteExpiredRedirects

 /**
  * Deletes all expired redirects
  *
  */
 public function deleteExpiredRedirects()
 {
     $timenow = vB::getRequest()->getTimeNow();
     $contenttypeid = vB_Types::instance()->getContentTypeId($this->contenttype);
     $assertor = vB::getDbAssertor();
     $expiredRedirects = $assertor->getRows('vBForum:node', array(vB_dB_Query::CONDITIONS_KEY => array(array('field' => 'contenttypeid', 'value' => $contenttypeid, vB_Db_Query::OPERATOR_KEY => vB_Db_Query::OPERATOR_EQ), array('field' => 'unpublishdate', 'value' => $timenow, vB_Db_Query::OPERATOR_KEY => vB_Db_Query::OPERATOR_LTE))));
     $redirectids = array();
     foreach ($expiredRedirects as $redirect) {
         $redirectids[] = $redirect['nodeid'];
     }
     $assertor->delete('vBForum:redirect', array(array('field' => 'nodeid', 'value' => $redirectids, vB_Db_Query::OPERATOR_KEY => vB_Db_Query::OPERATOR_EQ)));
     $assertor->delete('vBForum:node', array(array('field' => 'nodeid', 'value' => $redirectids, vB_Db_Query::OPERATOR_KEY => vB_Db_Query::OPERATOR_EQ)));
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:17,代码来源:redirect.php


示例9: populate

 public function populate()
 {
     if (!vB::$vbulletin->products['vbcms']) {
         return;
     }
     $typeid = vB::$vbulletin->activitystream['cms_article']['typeid'];
     $this->delete($typeid);
     if (!vB::$vbulletin->activitystream['cms_article']['enabled']) {
         return;
     }
     $contenttypeid = vB_Types::instance()->getContentTypeID('vBCms_Article');
     $timespan = TIMENOW - vB::$vbulletin->options['as_expire'] * 60 * 60 * 24;
     vB::$db->query_write("\n\t\t\tINSERT INTO " . TABLE_PREFIX . "activitystream\n\t\t\t\t(userid, dateline, contentid, typeid, action)\n\t\t\t\t(SELECT\n\t\t\t\t\tuserid, publishdate, nodeid, '{$typeid}', 'create'\n\t\t\t\tFROM " . TABLE_PREFIX . "cms_node AS cms_node\n\t\t\t\tWHERE\n\t\t\t\t\tpublishdate >= {$timespan}\n\t\t\t\t\t\tAND\n\t\t\t\t\tcontenttypeid = {$contenttypeid}\n\t\t\t\t)\n\t\t");
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:14,代码来源:article.php


示例10: getNewRouteInfo

 protected function getNewRouteInfo()
 {
     $param =& $this->queryParameters;
     if (isset($param['p']) and $oldid = intval($param['p']) or isset($param['postid']) and $oldid = intval($param['postid'])) {
         $node = vB::getDbAssertor()->getRow('vBForum:fetchLegacyPostIds', array('oldids' => $oldid, 'postContentTypeId' => vB_Types::instance()->getContentTypeID('vBForum_Post')));
         if (empty($node)) {
             throw new vB_Exception_404('invalid_page');
         }
         $this->arguments['nodeid'] = $node['starter'];
         $this->arguments['innerPost'] = $node['nodeid'];
         return $node['routeid'];
     }
     $this->oldcontenttypeid = vB_Types::instance()->getContentTypeID(array('package' => 'vBForum', 'class' => 'Thread'));
     return parent::getNewRouteInfo();
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:15,代码来源:thread.php


示例11: validateAndCleanNotificationData

 protected function validateAndCleanNotificationData($notificationData)
 {
     // Very similar to the vB_Notification_Content, but has to skip the "channel" check since
     // VM's go to their own channel. Instead, there's a isVisitorMessage() check.
     $newData = parent::validateAndCleanNotificationData($notificationData);
     unset($notificationData);
     if (!isset($newData['sentbynodeid'])) {
         throw new Exception("Missing Notification Data: sentbynodeid");
     }
     $nodeid = $newData['sentbynodeid'];
     $node = vB_Library::instance('node')->getNode($nodeid, false, true);
     // we need to get the full content, to ensure 'channeltype' is there.
     if (!isset($node['nodeid'])) {
         throw new Exception("Invalid Notification Data: sentbynodeid");
     }
     if (!isset($node['setfor'])) {
         throw new Exception("Invalid Node Data: setfor");
     }
     // only explictly specified content types are allowed to send notifications
     $topLevelContentTypes = array('Gallery' => 1, 'Link' => 1, 'Poll' => 1, 'Text' => 1, 'Video' => 1);
     $contenttypeclass = vB_Types::instance()->getContentTypeClass($node['contenttypeid']);
     if (!isset($topLevelContentTypes[$contenttypeclass])) {
         throw new Exception("Cannot send this notification for the node's content type.");
     }
     // Only allow visitor messages.
     /*
     // node lib's fetchClosureParent() does not seem functional for the 2nd param that content lib's isVisitorMessage()
     // relies on, VBV-14367. Let's just check the closure table directly for now.
     $contentLib = vB_Library::instance('Content_' . vB_Types::instance()->getContentTypeClass($node['contenttypeid']));
     if (!$contentLib->isVisitorMessage($nodeid))
     {
     	throw new Exception("Not a visitor message.");
     }
     */
     $vmChannel = vB_Library::instance('node')->fetchVMChannel();
     $closureCheck = vB::getDbAssertor()->getRows('vBForum:closure', array('child' => $nodeid, 'parent' => $vmChannel));
     if (empty($closureCheck)) {
         throw new Exception("Not a visitor message.");
     }
     // We're good if we got to this point.
     $newData['sentbynodeid'] = (int) $node['nodeid'];
     if (!isset($node['userid'])) {
         throw new Exception("Invalid Notification Data: sentbynodeid");
     }
     $newData['sender'] = (int) $node['userid'];
     return $newData;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:47,代码来源:visitormessage.php


示例12: verify_attachment

	/**
	 * Verify permissions of a single attachment
	 *
	 * @return	bool
	*/
	public function verify_attachment()
	{
		if (!$this->verify_attachment_specific('vBCms_Article'))
		{
			return false;
		}

		//Now we need to get a content id. It could come from several places
		if (!isset($this->contentid))
		{
			vB::$vbulletin->input->clean_array_gpc('r', array(
				'f'            => vB_Input::TYPE_UINT,
				'attachmentid' => vB_Input::TYPE_UINT
				));
		}

		if (vB::$vbulletin->GPC_exists['values'] and isset(vB::$vbulletin->GPC['values']['f']))
		{
			$this->contentid = vB::$vbulletin->GPC['values']['f'];
		}
		else if (vB::$vbulletin->GPC_exists['attachmentid'] AND $this->vbulletininfo['contentid'])
		{
			$this->contentid = $this->vbulletininfo['contentid'];
		}
		else if (vB::$vbulletin->GPC_exists['attachmentid'] AND intval(vB::$vbulletin->GPC['attachmentid']))
		{
			if ($record = vB::$db->query_first("SELECT contentid, contenttypeid FROM " . TABLE_PREFIX . "attachment
			where attachmentid = " . vB::$vbulletin->GPC['attachmentid']))
			{
				if ($record['contenttypeid'] == vB_Types::instance()->getContentTypeID("vBCms_Article"))
				{
					$this->contentid = $record['contentid'];
				}
			}
		}

		//If we have a contentid, we can check the permissions
		if (isset($this->contentid))
		{
			return vBCMS_Permissions::canDownload($this->contentid);
		}
		return false;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:48,代码来源:article.php


示例13: getNewRouteInfo

 protected function getNewRouteInfo()
 {
     // go to home page if path is exactly like prefix
     if (count($this->matches) == 1 and empty($this->queryParameters)) {
         $forumHomeChannel = vB_Library::instance('content_channel')->getForumHomeChannel();
         return $forumHomeChannel['routeid'];
     }
     // capture old id
     $argument =& $this->arguments;
     $oldid = $argument['oldid'];
     // calculate old contenttypeid
     $oldtype = array('t' => 'Thread', 'f' => 'Forum');
     $oldcontenttypeid = vB_Types::instance()->getContentTypeID(array('package' => 'vBForum', 'class' => $oldtype[$this->matches['nodetype']]));
     $node = vB::getDbAssertor()->getRow('vBForum:node', array('oldid' => $oldid, 'oldcontenttypeid' => $oldcontenttypeid));
     if (empty($node)) {
         throw new vB_Exception_404('invalid_page');
     }
     $argument['nodeid'] = $node['nodeid'];
     return $node['routeid'];
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:20,代码来源:archive.php


示例14: getNewRouteInfo

 protected function getNewRouteInfo()
 {
     $oldtype = array('cat' => 9988, 'groupid' => vB_Types::instance()->getContentTypeID('vBForum_SocialGroup'), 'discussionid' => vB_Types::instance()->getContentTypeID('vBForum_SocialGroupDiscussion'));
     $argument =& $this->arguments;
     $param =& $this->queryParameters;
     foreach ($oldtype as $key => $oldcontenttypeid) {
         if (!empty($param[$key]) and $oldid = intval($param[$key])) {
             $node = vB::getDbAssertor()->getRow('vBForum:node', array('oldid' => $oldid, 'oldcontenttypeid' => $oldcontenttypeid));
             if (empty($node)) {
                 throw new vB_Exception_404('invalid_page');
             }
             $argument['nodeid'] = $node['nodeid'];
             return $node['routeid'];
         }
     }
     $sgChannelId = vB_Api::instance('socialgroup')->getSGChannel();
     $sgChannel = vB::getDbAssertor()->getRow('vBForum:node', array('nodeid' => $sgChannelId));
     $argument['nodeid'] = $sgChannel['nodeid'];
     return $sgChannel['routeid'];
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:20,代码来源:group.php


示例15: getNewRouteInfo

 protected function getNewRouteInfo()
 {
     $param =& $this->queryParameters;
     $search = array();
     // pull the parameter that still compatible with vb5 and discard others
     if (isset($param['userid'])) {
         $user = vB_User::fetchUserinfo($param['userid']);
         if ($user !== false) {
             $search['author'] = $user['username'];
         }
     }
     if (isset($param['starteronly'])) {
         $search['starter_only'] = $param['starteronly'];
     }
     if (isset($param['forumchoice'])) {
         $oldcontenttypeid = vB_Types::instance()->getContentTypeID(array('package' => 'vBForum', 'class' => 'Forum'));
         foreach ($param['forumchoice'] as $oldid) {
             $node = vB::getDbAssertor()->getRow('vBForum:node', array('oldid' => $oldid, 'oldcontenttypeid' => $oldcontenttypeid));
             $search['channel'][] = $node['nodeid'];
         }
     }
     if (isset($param['do'])) {
         switch ($param['do']) {
             case 'finduser':
                 if (!empty($search)) {
                     $searchJSON = json_encode($search);
                 }
                 break;
             case 'getdaily':
             case 'getnew':
                 $searchJSON = '{"date":"lastVisit","view":"topic","unread_only":1,"sort":{"lastcontent":"desc"},"exclude_type":["vBForum_PrivateMessage"]}';
                 break;
             default:
         }
     }
     $param = array();
     if (!empty($searchJSON)) {
         $param['searchJSON'] = $searchJSON;
     }
     return 'search';
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:41,代码来源:search.php


示例16: getNewRouteInfo

 protected function getNewRouteInfo()
 {
     $argument =& $this->arguments;
     $param =& $this->queryParameters;
     $keys = array_keys($param);
     $tidkey = array('t', 'threadid');
     $pidkey = array('p', 'postid');
     if ($set = array_intersect($keys, $tidkey) and $pid = intval($param[reset($set)])) {
         $oldid = $pid;
         $node = vB::getDbAssertor()->getRow('vBForum:node', array('oldid' => $oldid, 'oldcontenttypeid' => vB_Types::instance()->getContentTypeID(array('package' => 'vBForum', 'class' => 'Thread'))));
     } else {
         if ($set = array_intersect($keys, $pidkey) and $pid = intval($param[reset($set)])) {
             $oldid = $pid;
             $node = vB::getDbAssertor()->getRow('vBForum:fetchLegacyPostIds', array('oldids' => $oldid, 'postContentTypeId' => vB_Types::instance()->getContentTypeID('vBForum_Post')));
         }
     }
     if (empty($node)) {
         throw new vB_Exception_404('invalid_page');
     }
     $this->arguments['nodeid'] = $node['starter'];
     return $node['routeid'];
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:22,代码来源:threadprint.php


示例17: pre_save

 /**
  * Format the data for saving
  *
  * @param	bool
  *
  * @return 	boolean	Function result
  */
 function pre_save($doquery = true)
 {
     if ($this->presave_called !== null) {
         return $this->presave_called;
     }
     if (!$this->fetch_field('contenttypeid')) {
         if ($this->info['contenttype']) {
             $this->set('contenttypeid', vB_Types::instance()->getContentTypeID($this->info['contenttype']));
         }
     }
     if (!$this->fetch_field('dateline')) {
         $this->set('dateline', TIMENOW);
     }
     if (!$this->fetch_field('ipid')) {
         $this->set('ipid', 0);
     }
     $return_value = true;
     if (!$this->hook_presave) {
         ($hook = vBulletinHook::fetch_hook('contentread_presave')) ? eval($hook) : false;
     }
     $this->presave_called = $return_value;
     return $return_value;
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:30,代码来源:class_dm_content_read.php


示例18: getNewRouteInfo

 protected function getNewRouteInfo()
 {
     $argument =& $this->arguments;
     $param =& $this->queryParameters;
     if (!empty($param['u'])) {
         $argument['userid'] = intval($param['u']);
         $argument['tab'] = 'media';
         return 'profile';
     } else {
         if (!empty($param['albumid'])) {
             $oldid = intval($param['albumid']);
             $oldcontenttypeid = vB_Types::instance()->getContentTypeID('vBForum_Album');
             $node = vB::getDbAssertor()->getRow('vBForum:node', array('oldid' => $oldid, 'oldcontenttypeid' => $oldcontenttypeid));
             if (empty($node)) {
                 throw new vB_Exception_404('invalid_page');
             }
             $argument['nodeid'] = $node['nodeid'];
             return 'album';
         } else {
             throw new vB_Exception_404('invalid_page');
         }
     }
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:23,代码来源:album.php


示例19: validateAndCleanNotificationData

 protected function validateAndCleanNotificationData($notificationData)
 {
     $newData = parent::validateAndCleanNotificationData($notificationData);
     unset($notificationData);
     if (!isset($newData['sentbynodeid'])) {
         throw new Exception("Missing Notification Data: sentbynodeid");
     }
     $nodeid = $newData['sentbynodeid'];
     $node = vB_Library::instance('node')->getNode($nodeid, false, true);
     // we need to get the full content, to ensure 'channeltype' is there.
     if (!isset($node['nodeid'])) {
         throw new Exception("Invalid Notification Data: sentbynodeid");
     }
     // Don't send notification if it's not visible to a "regular" user.
     if (!($node['showpublished'] and $node['showapproved'])) {
         throw new Exception("Invalid Notification Data: showpublished or showapproved");
     }
     // The sentbynodeid MUST BE A POLL TYPE
     $topLevelContentTypes = array('Poll' => 1);
     $contenttypeclass = vB_Types::instance()->getContentTypeClass($node['contenttypeid']);
     if (!isset($topLevelContentTypes[$contenttypeclass])) {
         throw new Exception("Cannot send this notification for the node's content type.");
     }
     // Let's restrict it to certain channel types, just in case we can create polls anywhere.
     // Keep this in sync with vB_Channel::$channelTypes
     $allowedChannelTypes = array('forum' => 1, 'blog' => 1, 'article' => 1, 'group' => 1);
     if (!isset($allowedChannelTypes[$node['channeltype']])) {
         throw new Exception("Cannot send this notification for the node's channel type.");
     }
     // We're good if we got to this point.
     $newData['sentbynodeid'] = (int) $node['nodeid'];
     // Sender must be specified when constructing this type. Set by parent::validateAndCleanNotificationData()
     if (!isset($newData['sender'])) {
         throw new Exception("Invalid Notification Data: sender");
     }
     return $newData;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:37,代码来源:pollvote.php


示例20: validateAndCleanNotificationData

 /**
  * Validates the notification data, checks the context to see if we should send this
  * notification type, and throws exceptions if we should not or cannot send this notification
  * type. If all is okay, it may set additional notification data specific to this notification type.
  *
  * @param	Array	$notificationData
  *
  * @throws Exception()	If for some reason this notification type cannot be sent given
  *						the context data in $notificationData
  *
  * @access protected
  */
 protected function validateAndCleanNotificationData($notificationData)
 {
     $newData = parent::validateAndCleanNotificationData($notificationData);
     unset($notificationData);
     if (!isset($newData['sentbynodeid'])) {
         throw new Exception("Missing Notification Data: sentbynodeid");
     }
     $nodeid = $newData['sentbynodeid'];
     $node = vB_Library::instance('node')->getNode($nodeid, false, true);
     // we need to get the full content, to ensure 'channeltype' is there.
     if (!isset($node['nodeid'])) {
         throw new Exception("Invalid Notification Data: sentbynodeid");
     }
     // Don't send notification if it's not visible to a "regular" user.
     if (!($node['showpublished'] and $node['showapproved'])) {
         throw new Exception("Invalid Notification Data: showpublished or showapproved");
     }
     // only explictly specified content types are allowed to send notifications
     $topLevelContentTypes = array('Gallery' => 1, 'Link' => 1, 'Poll' => 1, 'Text' => 1, 'Video' => 1);
     $contenttypeclass = vB_Types::instance()->getContentTypeClass($node['contenttypeid']);
     if (!isset($topLevelContentTypes[$contenttypeclass])) {
         throw new Exception("Cannot send this notification for the node's content type.");
     }
     // Similar to above, but for channeltypes. Keep this in sync with vB_Channel::$channelTypes
     $allowedChannelTypes = array('forum' => 1, 'blog' => 1, 'article' => 1, 'group' => 1);
     if (!isset($allowedChannelTypes[$node['channeltype']])) {
         throw new Exception("Cannot send this notification for the node's channel type.");
     }
     // We're good if we got to this point.
     $newData['sentbynodeid'] = (int) $node['nodeid'];
     if (!isset($node['userid'])) {
         throw new Exception("Invalid Notification Data: sentbynodeid");
     }
     $newData['sender'] = (int) $node['userid'];
     return $newData;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:48,代码来源:content.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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