当前位置: 首页>>代码示例>>PHP>>正文


PHP Articles::_fillArticleInformation方法代码示例

本文整理汇总了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;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:34,代码来源:plugintopreadposts.class.php

示例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;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:19,代码来源:pluginrecenttrackbacks.class.php

示例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;
 }
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:26,代码来源:searchengine.class.php


注:本文中的Articles::_fillArticleInformation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。