[pLog-svn] r3214 - plog/trunk/class/summary/action
mark at devel.lifetype.net
mark at devel.lifetype.net
Mon Apr 10 07:36:15 GMT 2006
Author: mark
Date: 2006-04-10 07:36:15 +0000 (Mon, 10 Apr 2006)
New Revision: 3214
Modified:
plog/trunk/class/summary/action/summarydefaultaction.class.php
Log:
If we just need "a" random blog, I don't think we need to pass the siteblog to template, and we also don't need to get "ALL" blog and pick up one.
We can just pick up 1 using the getAllBlogs with page and itemPerPage.
Modified: plog/trunk/class/summary/action/summarydefaultaction.class.php
===================================================================
--- plog/trunk/class/summary/action/summarydefaultaction.class.php 2006-04-10 07:26:10 UTC (rev 3213)
+++ plog/trunk/class/summary/action/summarydefaultaction.class.php 2006-04-10 07:36:15 UTC (rev 3214)
@@ -40,10 +40,7 @@
$registerTopic = $this->_locale->tr( "register_default_article_topic" );
$registerText = $this->_locale->tr( "register_default_article_text" );
$recentPosts = $stats->getRecentArticles( $this->_numPosts, $registerTopic, $registerText );
- // get all the blogs
- $siteBlogs = $blogs->getAllBlogs( true );
$recentBlogs = $stats->getRecentBlogs( $this->_numPosts );
-
$activeBlogs = $stats->getMostActiveBlogs( $this->_numPosts);
$commentedPosts = $stats->getMostCommentedArticles( $this->_numPosts, $registerTopic, $registerText );
$readestBlogs = $stats->getMostReadArticles( $this->_numPosts, $registerTopic, $registerText );
@@ -55,13 +52,12 @@
$this->_view->setValue( "activeBlogs", $activeBlogs );
$this->_view->setValue( "commentedPosts", $commentedPosts );
$this->_view->setValue( "readestBlogs", $readestBlogs );
- $this->_view->setValue( "blogs", $siteBlogs );
//
// :KLUDGE:
// we just need a random blog so... we'll get one :)
//
- $randomBlog = array_pop($siteBlogs);
+ $randomBlog = array_pop( $blogs->getAllBlogs( BLOG_STATUS_ACTIVE, "", 1, 1) );
$url = $randomBlog->getBlogRequestGenerator();
$this->_view->setValue( "url", $url );
More information about the pLog-svn
mailing list