本文整理汇总了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;
//.........这里部分代码省略.........
示例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;
}
示例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;
}