當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FeedItem::get方法代碼示例

本文整理匯總了PHP中FeedItem::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP FeedItem::get方法的具體用法?PHP FeedItem::get怎麽用?PHP FeedItem::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FeedItem的用法示例。


在下文中一共展示了FeedItem::get方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: saveFeedItem

		function saveFeedItem($feedId,$feedVisibility,$item){
			global $database, $db, $event;

			$db->query("SELECT id FROM {$database['prefix']}DeleteHistory WHERE feed='$feedId' and permalink='{$item['permalink']}'");
			if ($db->numRows() > 0) 
				return false;
	
			if ($item['written']>gmmktime()+86400)
				return false;

			$item['title']=$db->escape($db->lessen(UTF8::correct($item['title'])));

			list($useRssOut) = Settings::gets('useRssOut');
		
			list($feedCreated,$localFilter,$localFilterType) = Feed::gets($feedId, 'created,filter,filterType');

			$tagString=$db->escape($db->lessen(UTF8::correct(implode(', ',$item['tags']))));

			list($globalFilter,$blackFilter,$globalFilterType,$blackFilterType) = Settings::gets('filter,blackfilter,filterType,blackfilterType');
			$filter = empty($globalFilter)?$localFilter:$globalFilter;
			$filterType = empty($globalFilter)?$localFilterType:$globalFilterType;


			if (!Validator::is_empty($filter)) {
				$filtered = true;				
				$allowTags = explode(',', $filter);

				if($filterType == 'tag' || $filterType == 'tag+title') {					
					foreach ($allowTags as $ftag) {
						if (Validator::enum($ftag, $tagString)) {
							$filtered = false;
							break;
						}
					}
				}

				if($filtered && ($filterType == 'title' || $filterType == 'tag+title')) {
					foreach ($allowTags as $ftag) {
						if(strpos($item['title'],$ftag)!==false) {
							$filtered = false;
							break;
						}
					}
				}

				if ($filtered) return false;
			}

			if (!Validator::is_empty($blackFilter)) {
				$filtered = false;
				$denyTags = explode(',', $blackFilter);
				if($blackFilterType == 'tag' || $blackFilterType == 'tag+title') {					
					foreach ($denyTags as $ftag) {
						if (Validator::enum($ftag, $tagString)) {
							$filtered = true;
							break;
						}
					}
				}
				if($filtered && ($filterType == 'title' || $filterType == 'tag+title')) {
					foreach ($denyTags as $ftag) {
						if(strpos($item['title'],$ftag)!==false) {
							$filtered = true;
							break;
						}
					}
				}

				if ($filtered) return false;
			}

			if (preg_match('/\((.[^\)]+)\)$/Ui', trim($item['author']), $_matches)) $item['author'] = $_matches[1];
			$item['author']=$db->escape($db->lessen(UTF8::correct($item['author'])));
			$item['permalink']=$db->escape($db->lessen(UTF8::correct($item['permalink'])));
			$item['description']=$db->escape($db->lessen(UTF8::correct(trim($item['description'])),65535));
			
			$enclosures = array();
			foreach($item['enclosures'] as $en) {
				array_push($enclosures, $en['url']);
			}

			$enclosureString=$db->escape($db->lessen(UTF8::correct(implode('|',$enclosures))));				

			$deadLine=0;
			$feedLife = Settings::get('archivePeriod');
			if ($feedLife > 0) $deadLine=gmmktime()-($feedLife*86400);

			requireComponent('Bloglounge.Data.FeedItems');

			$oldTags = null;
			$id = FeedItem::getIdByURL($item['permalink']);
			if($id === false && isset($item['guid'])) {
				$item['guid']=$db->escape($db->lessen(UTF8::correct($item['guid'])));
				$id = FeedItem::getIdByURL($item['guid']);
			}

			$item['author'] = Feed::getAuthor($item, $feedId, $id);
			$item['title'] = Feed::getTitle($item, $feedId, $id);

			$affected = 0;
//.........這裏部分代碼省略.........
開發者ID:ncloud,項目名稱:bloglounge,代碼行數:101,代碼來源:LZ.PHP.Feeder.php

示例2: _t

				$response['rank'] = Boom::getRank($itemId);

				list($boomUp,$boomDown,$boomCount) = Boom::getBoomCount($itemId);
				$response['boom_up_count'] = $boomUp;
				$response['boom_down_count'] = $boomDown;
				$response['boom_count'] = $boomCount;
			} else {
				if (!Boom::down($_POST['itemId'])) {
					$response['error'] = 1;
					$response['message'] = _t('이미 반대한 글입니다.');
				} else { // 자동숨기기, 삭제기능..
					$response['message'] = 'isBoomedDown';
					list($reactor, $limit) = Settings::gets('boomDownReactor,boomDownReactorLimit');
					if ($reactor == 'delete') {
						requireComponent('Bloglounge.Data.FeedItems');
						list($myBoomDown) = FeedItem::get($_POST['itemId'], 'boomDown');
						if ($limit < $myBoomDown) {
							FeedItem::delete($_POST['itemId']);
						}
					}				
					
					$response['rank'] = Boom::getRank($itemId);

					list($boomUp,$boomDown,$boomCount) = Boom::getBoomCount($itemId);
					$response['boom_up_count'] = $boomUp;
					$response['boom_down_count'] = $boomDown;
					$response['boom_count'] = $boomCount;
				}		
			}
			break;
	}
開發者ID:ncloud,項目名稱:bloglounge,代碼行數:31,代碼來源:index.php

示例3: getPredictionPage

		function getPredictionPage($id, $pageCount, $searchType='', $searchKeyword='',$searchExtraValue='', $viewDelete = false, $owner = 0) {
			global $db, $database;

			$page = 1;
			$sQuery = FeedItem::getFeedItemsQuery($searchType, $searchKeyword, $searchExtraValue, $viewDelete, $owner);
			$written = FeedItem::get($id,'written');

			if(!empty($written)) {
				$sQuery = str_replace('WHERE', 'WHERE (i.written > '.$written.')'.' AND ',$sQuery);
			}		
			
			$count = $db->queryCell('SELECT count(*) as count FROM '.$database['prefix'].'FeedItems i '.$sQuery.' ORDER BY i.written DESC');

			if($count > 0) {
				$page = ceil(($count + 1) / $pageCount);
			}

			return $page;
		}
開發者ID:ncloud,項目名稱:bloglounge,代碼行數:19,代碼來源:Bloglounge.Data.FeedItems.php


注:本文中的FeedItem::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。