本文整理汇总了PHP中Articles::_fillArticleInformation方法的典型用法代码示例。如果您正苦于以下问题:PHP Articles::_fillArticleInformation方法的具体用法?PHP Articles::_fillArticleInformation怎么用?PHP Articles::_fillArticleInformation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Articles
的用法示例。
在下文中一共展示了Articles::_fillArticleInformation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTopReadPosts
/**
* Returns the top read posts object of current blog
*/
function getTopReadPosts($maxPosts = 0, $based = 'BLOG')
{
$articles = new Articles();
$blogId = $this->blogInfo->getId();
if ($based == 'BLOG') {
$query = "SELECT * FROM " . $this->prefix . "articles";
$query .= " WHERE blog_id = " . $blogId . " AND status = 1";
$query .= " ORDER BY num_reads DESC";
} elseif ($based == 'SITE') {
$query = "SELECT * FROM " . $this->prefix . "articles";
$query .= " WHERE status = 1";
$query .= " ORDER BY num_reads DESC";
} else {
return false;
}
if ($maxPosts > 0) {
$query .= " LIMIT " . $maxPosts;
} else {
$query .= " LIMIT " . $this->maxPosts;
}
$result = $articles->_db->Execute($query);
if (!$result) {
return false;
}
$topreadposts = array();
while ($row = $result->FetchRow()) {
$article = $articles->_fillArticleInformation($row);
array_push($topreadposts, $article);
}
return $topreadposts;
}
示例2: getArticle
function getArticle($artId)
{
$articles = new Articles();
$blogId = $this->blogInfo->getId();
$query = "SELECT * FROM " . $this->prefix . "articles WHERE id = " . $artId;
$query .= " AND blog_id = " . $blogId;
$query .= ";";
// we send the query and then fetch the first array with the result
$result = $articles->_db->Execute($query);
if ($result == false) {
return false;
}
if ($result->RecordCount() == 0) {
return false;
}
$row = $result->FetchRow($result);
$article = $articles->_fillArticleInformation($row);
return $article;
}
示例3: array
/**
*
* @param query
* @param queryType Whether we got these results searching in the articles, comments,
* or custom fields.
* @private
* @return
*/
function _getQueryResults($query, $queryType)
{
$result = $this->_db->Execute($query);
// return an empty array if nothing available
if (!$result) {
return array();
}
$results = array();
$articles = new Articles();
while ($row = $result->FetchRow()) {
$article = $articles->_fillArticleInformation($row);
$searchResult = new SearchResult($row["relevance"], $article, $queryType);
// print_r(array_keys($row));
// print "<hr />";
array_push($results, $searchResult);
}
return $results;
}