[pLog-svn] r839 - in plog/trunk: class/summary/action locale
templates/summary
oscar at devel.plogworld.net
oscar at devel.plogworld.net
Tue Jan 25 19:22:34 GMT 2005
Author: oscar
Date: 2005-01-25 19:22:34 +0000 (Tue, 25 Jan 2005)
New Revision: 839
Added:
plog/trunk/templates/summary/post.template
Modified:
plog/trunk/class/summary/action/blogprofileaction.class.php
plog/trunk/locale/locale_en_UK.php
plog/trunk/templates/summary/blogprofile.template
plog/trunk/templates/summary/blogslist.template
plog/trunk/templates/summary/header.template
plog/trunk/templates/summary/index.template
plog/trunk/templates/summary/recent.template
Log:
now the "blog profile" page also shows the 5 most recent posts from a blog
Modified: plog/trunk/class/summary/action/blogprofileaction.class.php
===================================================================
--- plog/trunk/class/summary/action/blogprofileaction.class.php 2005-01-25 18:26:42 UTC (rev 838)
+++ plog/trunk/class/summary/action/blogprofileaction.class.php 2005-01-25 19:22:34 UTC (rev 839)
@@ -2,7 +2,13 @@
include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" );
include_once( PLOG_CLASS_PATH."class/summary/dao/summarystats.class.php" );
- include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+ include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+ include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
+
+ /**
+ * by default, how many posts show as recent from this blog
+ */
+ define( "SUMMARY_DEFAULT_RECENT_BLOG_POSTS", 5 );
/**
* shows a user profile
@@ -47,8 +53,22 @@
return false;
}
+ // fetch the blog latest posts
+ $posts = Array();
+ $articles = new Articles();
+ $t = new Timestamp();
+ $posts = $articles->getBlogArticles( $blogInfo->getId(),
+ -1,
+ SUMMARY_DEFAULT_RECENT_BLOG_POSTS,
+ 0,
+ POST_STATUS_PUBLISHED,
+ 0,
+ $t->getTimestamp());
+
+
$this->_view->setValue( "blog", $blogInfo );
$this->_view->setValue( "locale", $this->_locale );
+ $this->_view->setValue( "blogposts", $posts );
return true;
}
Modified: plog/trunk/locale/locale_en_UK.php
===================================================================
--- plog/trunk/locale/locale_en_UK.php 2005-01-25 18:26:42 UTC (rev 838)
+++ plog/trunk/locale/locale_en_UK.php 2005-01-25 19:22:34 UTC (rev 839)
@@ -90,14 +90,13 @@
$messages['info_about_myself'] = 'Some information about myself...';
$messages['back'] = 'Back';
-$messages['back_top'] = 'Back To Top';
-
$messages['post'] = 'post';
$messages['trackbacks_for_article'] = 'Trackbacks for the article titled';
$messages['trackback_excerpt'] = 'Excerpt';
$messages['trackback_weblog'] = 'Weblog';
+$messages['search'] = 'Search';
$messages['search_results'] = 'Search Results';
$messages['search_matching_results'] = 'The following posts match your search terms: ';
$messages['search_no_matching_posts'] = 'No matching posts were found';
@@ -106,12 +105,12 @@
$messages['read_more'] = '(More)';
-$messages['anonymous_poster'] = 'Anonymous Poster';
-
$messages['syndicate'] = 'SYNDICATE';
$messages['main'] = 'Main';
+
+
////// error messages /////
$messages['error_fetching_article'] = 'The article you specified could not be found.';
$messages['error_fetching_articles'] = 'The articles could not be fetched.';
@@ -780,4 +779,29 @@
$messages['help_search_in_custom_fields'] = 'Search also in custom fields';
$messages['help_search_in_comments'] = 'Search also in comments';
+// cleanup
+
+/// summary ///
+// front page
+$messages['summary'] = 'Summary';
+$messages['register'] = 'Register';
+$messages['summary_welcome'] = 'Welcome!';
+$messages['summary_most_active_blogs'] = 'Most Active Blogs';
+$messages['summary_most_commented_articles'] = 'Most Commented Articles';
+$messages['summary_most_read_articles'] = 'Most Read articles';
+$messages['password_forgotten'] = 'Forgot your password?';
+$messages['summary_newest_blogs'] = 'Newest Blogs';
+$messages['summary_latest_posts'] = 'Latest Posts';
+$messages['summary_search_blogs'] = 'Search Blogs';
+
+// blog list
+$messages['updated'] = 'Updated';
+$messages['total_reads'] = 'tota';
+
+// blog profile
+$messages['blog'] = 'Blog';
+$messages['latest_posts'] = 'Latest posts';
+
+// user list
+
?>
\ No newline at end of file
Modified: plog/trunk/templates/summary/blogprofile.template
===================================================================
--- plog/trunk/templates/summary/blogprofile.template 2005-01-25 18:26:42 UTC (rev 838)
+++ plog/trunk/templates/summary/blogprofile.template 2005-01-25 19:22:34 UTC (rev 839)
@@ -1,13 +1,12 @@
-{include file="summary/header.template" selected="blogslist" columns=1 section=$locale->tr("blog_profile")}
-
+{include file="summary/header.template" selected="blogslist" columns=1 section=$locale->tr("blog")}
<div id="onecolumn">
{assign var="url" value=$blog->getBlogRequestGenerator()}
- <h2><a href="{$url->blogLink()}">{$blog->getBlog()|strip_tags}</a></h2>
+ <h4><a href="{$url->blogLink()}">» {$blog->getBlog()|strip_tags}</a></h4>
{assign var="updateDate" value=$blog->getUpdateDateObject()}
{assign var="owner" value=$blog->getOwnerInfo()}
<div class="subtitle">
- {$locale->tr("summary_last_updated")} {$locale->formatDate($updateDate,"%e %B %Y")}
+ {$locale->tr("updated")} {$locale->formatDate($updateDate,"%e %B %Y")}
</div>
<p>
{$blog->getAbout()|strip_tags}
@@ -20,9 +19,14 @@
{foreach from=$blogUsers item=blogUser name=blogUsersLoop}
<a href="?op=UserProfile&userId={$owner->getId()}">{$blogUser->getUsername()}</a>{if !$smarty.foreach.blogUsersLoop.last}, {/if}
{/foreach}
- | {$blog->getTotalPosts()} {$locale->tr("summary_articles")} | {$blog->getViewedTotal()} {$locale->tr("summary_reads")}
</p>
+ <h4>» {$locale->tr("latest_posts")}</h4>
<p>
+ {foreach from=$blogposts item=post}
+ {include file="summary/post.template"}
+ {/foreach}
+ </p>
+ <p>
<a href="javascript:history.go(-1);">{$locale->tr("back")}</a>
</p>
</div>
Modified: plog/trunk/templates/summary/blogslist.template
===================================================================
--- plog/trunk/templates/summary/blogslist.template 2005-01-25 18:26:42 UTC (rev 838)
+++ plog/trunk/templates/summary/blogslist.template 2005-01-25 19:22:34 UTC (rev 839)
@@ -1,4 +1,4 @@
-{include file="summary/header.template" section=$locale->tr("summary_blog_list")}
+{include file="summary/header.template" section=$locale->tr("blogs")}
<div id="onecolumn">
{foreach from=$blogs item=blog}
{assign var="updateDate" value=$blog->getUpdateDateObject()}
@@ -10,7 +10,7 @@
<a href="?op=BlogProfile&blogId={$blog->getId()}"> ? </a>
</h3>
<div class="subtitle">
- {$locale->tr("summary_last_updated")} {$locale->formatDate($updateDate,"%e %B %Y")}
+ {$locale->tr("updated")} {$locale->formatDate($updateDate,"%e %B %Y")}
</div>
<p>
{$blog->getAbout()|strip_tags}
@@ -21,8 +21,7 @@
{assign var=blogUsers value=$blog->getUsersInfo()}
{foreach from=$blogUsers item=blogUser name=blogUsersLoop}
<a href="?op=UserProfile&userId={$owner->getId()}">{$blogUser->getUsername()}</a>{if !$smarty.foreach.blogUsersLoop.last}, {/if}
- {/foreach}
- | {$blog->getTotalPosts()} {$locale->tr("summary_articles")} | {$blog->getViewedTotal()} {$locale->tr("summary_reads")}
+ {/foreach}
</div>
{/foreach}
<div class="pager">
Modified: plog/trunk/templates/summary/header.template
===================================================================
--- plog/trunk/templates/summary/header.template 2005-01-25 18:26:42 UTC (rev 838)
+++ plog/trunk/templates/summary/header.template 2005-01-25 19:22:34 UTC (rev 839)
@@ -33,8 +33,8 @@
<ul class="menuTop">
<li class="menuOption"><a href="?op=Summary">{$locale->tr("summary")}</a></li>
<li class="menuOption"><a href="?op=RegisterStep0">{$locale->tr("register")}</a></li>
- <li class="menuOption"><a href="?op=BlogList">{$locale->tr("blog_list")}</a></li>
- <li class="menuOption"><a href="?op=UserList">{$locale->tr("user_list")}</a></li>
+ <li class="menuOption"><a href="?op=BlogList">{$locale->tr("blogs")}</a></li>
+ <li class="menuOption"><a href="?op=UserList">{$locale->tr("users")}</a></li>
</ul>
</div>
</div>
Modified: plog/trunk/templates/summary/index.template
===================================================================
--- plog/trunk/templates/summary/index.template 2005-01-25 18:26:42 UTC (rev 838)
+++ plog/trunk/templates/summary/index.template 2005-01-25 19:22:34 UTC (rev 839)
@@ -3,7 +3,7 @@
<div id="column-left">
<form id="loginForm" method="post" action="admin.php">
<fieldset class="inputField">
- <h4>{$locale->tr("summary_login")}</h4>
+ <h4>{$locale->tr("login")}</h4>
<div class="field">
<label for="userName">{$locale->tr("username")}</label>
<input type="text" tabindex="10" name="userName" id="userName" value="" maxlength="50" />
@@ -14,6 +14,7 @@
</div>
<input type="submit" class="button" name="Login" value="{$locale->tr("login")}" tabindex="12" />
<input type="hidden" name="op" value="Login" />
+ <br/>
<a href="?op=resetPasswordForm">{$locale->tr("password_forgotten")}</a>
</fieldset>
</form>
@@ -21,6 +22,7 @@
<ul class="itemList">
{foreach from=$recentBlogs item=blog}
{assign var="url" value=$blog->getBlogRequestGenerator()}
+ {** remove this if you're having problems with blogs in encondings other than iso-8859-1 **}
<li class="item"><a href="{$url->blogLink()}">{$blog->getBlog()|strip_tags}</a></li>
{/foreach}
</ul>
@@ -29,7 +31,10 @@
<div id="maincolumn">
<div id="intro">
<h4>{$locale->tr("summary_welcome")}</h4>
- {$locale->tr("summary_welcome_message")}
+ You should place here whatever welcome message you would like your users to see. Or remove
+ this one completely and rearrange the whole page. Or something :) Take a look at
+ templates/summary, that is where all template files that make up this page are stored. You are
+ free to change them in any way you like.
</div>
{include file="summary/recent.template"}
</div>
@@ -37,7 +42,7 @@
<div id="column-right">
<form id="loginForm" method="post">
<fieldset class="inputField">
- <h4>{$locale->tr("site_search")}</h4>
+ <h4>{$locale->tr("summary_search_blogs")}</h4>
<div class="field">
<label for="searchTerms">{$locale->tr("search_terms")}</label><br />
<input type="text" tabindex="20" name="searchTerms" id="searchTerms" value="" />
Added: plog/trunk/templates/summary/post.template
===================================================================
--- plog/trunk/templates/summary/post.template 2005-01-25 18:26:42 UTC (rev 838)
+++ plog/trunk/templates/summary/post.template 2005-01-25 19:22:34 UTC (rev 839)
@@ -0,0 +1,22 @@
+ {assign var="blog" value=$post->getBlogInfo()}
+ {assign var="request" value=$blog->getBlogRequestGenerator()}
+ <h5>{$post->getTopic()}</h5>
+ <div class="subtitle">
+ {$locale->tr("blog")} <a href="{$request->postPermalink($post)}">{$blog->getBlog()}</a>
+ </div>
+ <p>
+ {$post->getText()|strip_tags|truncate:200:"..."}
+ </p>
+ <div class="peu">
+
+ {assign var="postCategories" value=$post->getCategories()}
+ {assign var="postOwner" value=$post->getUserInfo()}
+ {assign var="postDate" value=$post->getDateObject()}
+ <a href="{$request->postPermalink($post)}" class="noborder">
+ <img src="imgs/post.png" width="10" height="11" alt="Permalink" />
+ </a>
+ {$locale->tr("posted_by")} {$postOwner->getUsername()}, {$locale->formatDate($postDate,"%e %B %Y")} |
+ <img src="imgs/comment.png" width="11" height="10" alt="{$locale->tr("comments")}" />
+ <a href="{$request->postPermalink($post)}#comments">{if $post->getTotalComments() eq 0}{$locale->tr("comment on this")}{else}{$post->getTotalComments()} {$locale->tr("comments")|capitalize}{/if}</a>
+ <br style="clear: both;" />
+ </div>
\ No newline at end of file
Modified: plog/trunk/templates/summary/recent.template
===================================================================
--- plog/trunk/templates/summary/recent.template 2005-01-25 18:26:42 UTC (rev 838)
+++ plog/trunk/templates/summary/recent.template 2005-01-25 19:22:34 UTC (rev 839)
@@ -2,26 +2,5 @@
<a href="{$url->getRssUrl()}?summary=1"><img src="{$url->getUrl("/imgs/rss_logo_small.gif")}" alt="RSS" /></a>
</h4>
{foreach from=$posts item=post}
- {assign var="blog" value=$post->getBlogInfo()}
- {assign var="request" value=$blog->getBlogRequestGenerator()}
- <h3>{$post->getTopic()}</h3>
- <div class="subtitle">
- {$locale->tr("summary_in")} <a href="{$request->postPermalink($post)}">{$blog->getBlog()}</a>
- </div>
- <p>
- {$post->getText()|strip_tags|truncate:200:"..."}
- </p>
- <div class="peu">
-
- {assign var="postCategories" value=$post->getCategories()}
- {assign var="postOwner" value=$post->getUserInfo()}
- {assign var="postDate" value=$post->getDateObject()}
- <a href="{$request->postPermalink($post)}" title="{$locale->tr("permalink_title")}" class="noborder">
- <img src="imgs/post.png" width="10" height="11" alt="{$locale->tr("permalink_title")}" />
- </a>
- {$locale->tr("summary_posted_by")} {$postOwner->getUsername()}, {$locale->formatDate($postDate,"%e %B %Y")} |
- <img src="imgs/comment.png" width="11" height="10" alt="{$locale->tr("comments")}" />
- <a href="{$request->postPermalink($post)}#comments" title="{$locale->tr("comment on this")}">{if $post->getTotalComments() eq 0}{$locale->tr("comment on this")}{else}{$post->getTotalComments()} {$locale->tr("comments")|capitalize}{/if}</a>
- <br style="clear: both;" />
- </div>
+ {include file="summary/post.template"}
{/foreach}
More information about the pLog-svn
mailing list