本文整理汇总了PHP中Feed::getIdListByOwner方法的典型用法代码示例。如果您正苦于以下问题:PHP Feed::getIdListByOwner方法的具体用法?PHP Feed::getIdListByOwner怎么用?PHP Feed::getIdListByOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feed
的用法示例。
在下文中一共展示了Feed::getIdListByOwner方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
define('ROOT', '..');
include ROOT . '/lib/include.php';
$searchFeedId = $accessInfo['action'];
$searchType = 'user';
if(is_numeric($searchFeedId)) {
$user = User::getById($searchFeedId);
$searchKeyword = $user['loginid'];
$searchExtraValue = $searchFeedId;
} else {
$searchKeyword = $searchFeedId;
$user = User::getByloginId($searchKeyword);
$searchExtraValue = Feed::getIdListByOwner($user['id']);
}
include ROOT . '/lib/begin.php';
$customQuery = $event->on('Query.feedItems', '');
$pageCount = $skinConfig->postList; // ÆäÀÌÁö°¹¼ö
list($posts, $totalFeedItems) = FeedItem::getFeedItems($searchType, $searchKeyword, $searchExtraValue, $page, $pageCount, false, 0, $customQuery);
$paging = Func::makePaging($page, $pageCount, $totalFeedItems);
include ROOT . '/lib/piece/message.php';
include ROOT . '/lib/piece/postlist.php';
include ROOT . '/lib/end.php';
?>
示例2: getFeedItemsQuery
function getFeedItemsQuery($searchType, $searchKeyword, $searchExtraValue,$viewDelete = false,$owner = 0) {
global $db, $database, $config;
$sQuery = '';
if (($searchType=='tag' || $searchType=='tag+group_category') && !Validator::is_empty($searchKeyword)) {
$tagIds = array();
$tags = explode(',',$searchKeyword);
if($tagResult = $db->queryAll('SELECT id FROM '.$database['prefix'].'Tags WHERE name IN ('.Func::implode_string(',',$tags).')')) {
foreach($tagResult as $tagItem) array_push($tagIds, $tagItem['id']);
}
if (empty($tagIds)) {
return array(null,0);
} else {
if($searchType == 'tag') {
$sQuery = ' LEFT JOIN '.$database['prefix'].'TagRelations r ON (r.item = i.id AND (r.type = "feed")) WHERE r.tag IN ('.implode(',',$tagIds).')';
} else if($searchType == 'tag+group_category') {
$sQuery = ' LEFT JOIN '.$database['prefix'].'TagRelations r ON (r.item = i.id AND (r.type = "feed" || r.type = "group_category")) WHERE r.tag IN ('.implode(',',$tagIds).')';
}
}
} else if ($searchType=='blogURL' && !Validator::is_empty($searchKeyword)){
$searchKeyword = UTF8::bring($searchKeyword);
$searchFeedId = $searchExtraValue;
if(empty($searchFeedId)) {
$searchFeedId = Feed::blogURL2Id('http://'.str_replace('http://', '', $searchKeyword));
}
if(!empty($searchFeedId)) {
$sQuery = ' WHERE i.feed = '.$searchFeedId;
} else {
$sQuery = ' WHERE 1=0 ';
}
} else if ($searchType=='user' && !Validator::is_empty($searchKeyword)){
$searchKeyword = UTF8::bring($searchKeyword);
$searchFeedId = $searchExtraValue;
if(empty($searchFeedId)) {
if(is_numeric($searchKeyword)) {
$user = User::getById($searchKeyword);
} else {
$user = User::getByloginId($searchKeyword);
}
$searchFeedId = Feed::getIdListByOwner($user['id']);
}
if(!empty($searchFeedId)) {
$sQuery = ' WHERE i.feed IN ('.implode(",",$searchFeedId).')';
} else {
$sQuery = ' WHERE 1=0 ';
}
} else if ($searchType=='author' && !Validator::is_empty($searchKeyword)){
$searchKeyword = UTF8::bring($searchKeyword);
if(!empty($searchKeyword)) {
$sQuery = ' WHERE i.author = "' . $searchKeyword . '"';
} else {
$sQuery = ' WHERE 1=0 ';
}
} else if ($searchType=='title+description' && !Validator::is_empty($searchKeyword)){
$searchKeyword = UTF8::bring($searchKeyword);
$keyword = $db->escape($searchKeyword);
$sQuery = ' WHERE i.description LIKE "%'.$keyword.'%"';
} else if ($searchType=='title' && !Validator::is_empty($searchKeyword)){
$searchKeyword = UTF8::bring($searchKeyword);
$keyword = $db->escape($searchKeyword);
$sQuery = ' WHERE i.title LIKE "%'.$keyword.'%"';
} else if ($searchType=='description' && !Validator::is_empty($searchKeyword)){
$searchKeyword = UTF8::bring($searchKeyword);
$keyword = $db->escape($searchKeyword);
$sQuery = ' WHERE i.description LIKE "%'.$keyword.'%"';
} else if ($searchType=='focus'){
$sQuery = ' WHERE i.focus = "'.$searchKeyword.'"';
} else if ($searchType=='group') {
requireComponent('Bloglounge.Data.Groups');
if(!empty($searchExtraValue)) {
$tagId = $db->pick('SELECT id FROM '.$database['prefix'].'Tags WHERE name="'.$db->escape(urldecode($searchExtraValue)).'"');
if($tagId) {
$tagId = $tagId[0];
$sQuery = ' LEFT JOIN '.$database['prefix'].'TagRelations r ON (r.item = i.id AND r.type = "group_category") ';
}
}
if(!is_numeric($searchKeyword)) {
$group = Group::getByName($searchKeyword);
$searchKeyword = $group['id'];
}
if($searchKeyword) {
$feedIds = Group::getFeedIdList($searchKeyword);
$sQuery .= ' WHERE i.feed IN (' . implode(',',$feedIds) .')';
if($tagId) {
$sQuery .= ' AND r.tag="'.$tagId.'"';
}
//.........这里部分代码省略.........