本文整理匯總了PHP中FeedItem::gets方法的典型用法代碼示例。如果您正苦於以下問題:PHP FeedItem::gets方法的具體用法?PHP FeedItem::gets怎麽用?PHP FeedItem::gets使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FeedItem
的用法示例。
在下文中一共展示了FeedItem::gets方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: delete
function delete($itemId) {
global $database, $db;
list($feedId, $permalink) = FeedItem::gets($itemId, 'feed,permalink');
if (!$db->execute("INSERT INTO {$database['prefix']}DeleteHistory (feed, permalink) VALUES ('$feedId', '$permalink')"))
return false;
requireComponent('LZ.PHP.Media');
Media::delete($itemId);
requireComponent('Bloglounge.Data.Category');
$result = $db->queryAll('SELECT category FROM '.$database['prefix'].'Categoryrelations WHERE item = ' . $itemId,MYSQL_ASSOC);
$categoryIds = array();
foreach($result as $item) {
array_push($categoryIds, $item['category']);
}
$categoryIds = array_unique($categoryIds);
$db->execute("DELETE FROM {$database['prefix']}CategoryRelations WHERE item = {$itemId}"); // clear CategoryRelations
requireComponent('Bloglounge.Data.Groups');
$db->execute("DELETE FROM {$database['prefix']}TagRelations WHERE item = {$itemId}"); // clear TagRelations
if ($db->execute('DELETE FROM '.$database['prefix'].'FeedItems WHERE id='.$itemId)) {
if (Validator::getBool(Settings::get('useRssOut'))) {
requireComponent('Bloglounge.Data.RSSOut');
RSSOut::refresh();
}
foreach($categoryIds as $categoryId) {
Category::rebuildCount($categoryId);
}
return true;
} else {
return false;
}
}
示例2: getTitle
function getTitle($item, $feedId, $feedItemId = null) {
$title = array();
$autoUpdate = array();
$title['result'] = $item['title'];
/*list($autoUpdate['feed'], $title['feed']) = Feed::gets($feedId, 'autoUpdate,title');
$autoUpdate['feed'] = Validator::getBool($autoUpdate['feed']);
if (!$autoUpdate['feed'] && !Validator::is_empty($title['feed']))
$title['result'] = $title['feed'];*/ // 피드의 제목을 피드아이템 제목에 덮어 씌우는일이 없도록..
if (isset($feedItemId) || ($feedItemId !== false)) { // update
requireComponent('Bloglounge.Data.FeedItems');
list($autoUpdate['item'], $title['item']) = FeedItem::gets($feedItemId, 'autoUpdate,title');
$autoUpdate['item'] = Validator::getBool($autoUpdate['item']);
if (!$autoUpdate['item'] && !Validator::is_empty($title['item']))
$title['result'] = $title['item'];
}
return $title['result'];
}