[pLog-svn] r5372 - in plog/branches/lifetype-1.2: class/action/admin class/dao class/view/admin locale/admin templates/admin
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Wed May 2 08:41:08 EDT 2007
Author: jondaley
Date: 2007-05-02 08:41:07 -0400 (Wed, 02 May 2007)
New Revision: 5372
Modified:
plog/branches/lifetype-1.2/class/action/admin/adminupdateblogsettingsaction.class.php
plog/branches/lifetype-1.2/class/dao/articles.class.php
plog/branches/lifetype-1.2/class/view/admin/adminblogsettingsview.class.php
plog/branches/lifetype-1.2/locale/admin/locale_ca_ES.php
plog/branches/lifetype-1.2/locale/admin/locale_de_DE.php
plog/branches/lifetype-1.2/locale/admin/locale_en_UK.php
plog/branches/lifetype-1.2/locale/admin/locale_es_ES.php
plog/branches/lifetype-1.2/locale/admin/locale_fr_FR.php
plog/branches/lifetype-1.2/locale/admin/locale_it_IT.php
plog/branches/lifetype-1.2/locale/admin/locale_nl_NL.php
plog/branches/lifetype-1.2/locale/admin/locale_zh_CN.php
plog/branches/lifetype-1.2/locale/admin/locale_zh_TW.php
plog/branches/lifetype-1.2/templates/admin/blogsettings.template
Log:
articles can now be sorted oldest or newest first. Mantis issue 1086. Some people like to 'read a blog like a book'
Modified: plog/branches/lifetype-1.2/class/action/admin/adminupdateblogsettingsaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminupdateblogsettingsaction.class.php 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/class/action/admin/adminupdateblogsettingsaction.class.php 2007-05-02 12:41:07 UTC (rev 5372)
@@ -39,6 +39,7 @@
$this->registerFieldValidator( "blogTemplate", new StringValidator());
$this->registerFieldValidator( "blogCategory", new IntegerValidator());
$this->registerFieldValidator( "blogNumCommentsPerPage", $val );
+ $this->registerFieldValidator( "blogArticlesOrder", new IntegerValidator());
$this->registerField( "blogAbout" );
$this->registerField( "blogShowMoreEnabled" );
$this->registerField( "blogEnableHtmlarea" );
@@ -130,6 +131,7 @@
$blogSettings->setValue( "show_comments_max", $this->_request->getValue( "blogNumCommentsPerPage" ));
//$blogSettings->setValue( "comment_only_auth_users", Textfilter::checkboxToBoolean($this->_request->getValue( "blogCommentOnlyRegisteredUsers" )));
$blogSettings->setValue( "comments_order", $this->_request->getValue( "blogCommentsOrder" ));
+ $blogSettings->setValue( "articles_order", $this->_request->getValue( "blogArticlesOrder" ));
$blogSettings->setValue( "default_send_notification", $this->_request->getValue( "blogSendNotification" ));
$this->_blogInfo->setAbout( Textfilter::filterAllHTML($this->_request->getValue( "blogAbout" )));
$this->_blogInfo->setBlog( Textfilter::filterAllHTML($this->_request->getValue( "blogName" )));
Modified: plog/branches/lifetype-1.2/class/dao/articles.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/articles.class.php 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/class/dao/articles.class.php 2007-05-02 12:41:07 UTC (rev 5372)
@@ -460,7 +460,17 @@
$query .= " ORDER BY relevance";
}
else {
- $query .= " ORDER BY a.date DESC";
+ // check article order preference, default to newest first
+ lt_include( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
+ $blogs = new Blogs();
+ $blogInfo = $blogs->getBlogInfo( $blogId );
+ $blogSettings = $blogInfo->getSettings();
+
+ if($blogSettings->getValue( "articles_order" ) == 1) {
+ $query .= " ORDER BY a.date ASC";
+ } else {
+ $query .= " ORDER BY a.date DESC";
+ }
}
// we don't need limits if we're getting the posts for a given day
Modified: plog/branches/lifetype-1.2/class/view/admin/adminblogsettingsview.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/view/admin/adminblogsettingsview.class.php 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/class/view/admin/adminblogsettingsview.class.php 2007-05-02 12:41:07 UTC (rev 5372)
@@ -40,6 +40,7 @@
$this->setValue( "blogFirstDayOfWeek", $blogSettings->getValue( "first_day_of_week", $locale->firstDayOfWeek() ));
$this->setValue( "blogEnableAutosaveDrafts", $blogSettings->getValue( "new_drafts_autosave_enabled" ));
$this->setValue( "blogCommentsOrder", $blogSettings->getValue( "comments_order" ));
+ $this->setValue( "blogArticlesOrder", $blogSettings->getValue( "articles_order" ));
$this->setValue( "blogCategory", $this->_blogInfo->getBlogCategoryId());
$this->setValue( "blogShowInSummary", $this->_blogInfo->getShowInSummary());
$this->setValue( "blogSendNotification", $blogSettings->getValue( "default_send_notification" ));
Modified: plog/branches/lifetype-1.2/locale/admin/locale_ca_ES.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_ca_ES.php 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/locale/admin/locale_ca_ES.php 2007-05-02 12:41:07 UTC (rev 5372)
@@ -377,6 +377,8 @@
$messages['enable_comments_help'] = 'Activa comentaris per defecte a tots els articles. Els comentaris poden activar-se o desactivar-se per a certs articles, creant-ne de nous o editant-los';
$messages['show_future_posts'] = 'Visualitza els articles futurs al calendari';
$messages['show_future_posts_help'] = 'Els articles que tinguin una data futura seran visibles pels usuaris';
+$messages['articles_order'] = 'Articles order';
+$messages['articles_order_help'] = 'Order in which articles should be displayed.';
$messages['comments_order'] = 'Ordre dels comentaris';
$messages['comments_order_help'] = 'Ordre amb què els comentaris es mostraran a la pàgina principal';
$messages['oldest_first'] = 'Els més antic primer';
Modified: plog/branches/lifetype-1.2/locale/admin/locale_de_DE.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_de_DE.php 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/locale/admin/locale_de_DE.php 2007-05-02 12:41:07 UTC (rev 5372)
@@ -396,6 +396,8 @@
$messages['enable_comments_help'] = 'Erlaubt oder verbietet das Kommentieren für alle Artikel dieses Blogs.';
$messages['show_future_posts'] = 'Zukünftige Artikel im Kalender anzeigen.';
$messages['show_future_posts_help'] = 'Wählen Sie, ob Artikel mit in der Zukunft liegendem Veröffentlichungsdatum im Kalender angezeigt und so für jeden Besucher sichtbar sein sollen.';
+$messages['articles_order'] = 'Articles order';
+$messages['articles_order_help'] = 'Order in which articles should be displayed.';
$messages['comments_order'] = 'Reihenfolge der Kommentare';
$messages['comments_order_help'] = 'Reihenfolge, in der die Kommentare auf der Übersichtsseite angezeigt werden.';
$messages['oldest_first'] = 'älteste zuerst';
Modified: plog/branches/lifetype-1.2/locale/admin/locale_en_UK.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_en_UK.php 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/locale/admin/locale_en_UK.php 2007-05-02 12:41:07 UTC (rev 5372)
@@ -398,6 +398,8 @@
$messages['show_future_posts_help'] = 'Whether posts which have a date in the future should appear in the calendar and visible to users.';
$messages['comments_order'] = 'Comments order';
$messages['comments_order_help'] = 'Order in which comments should be displayed in the front page.';
+$messages['articles_order'] = 'Articles order';
+$messages['articles_order_help'] = 'Order in which articles should be displayed.';
$messages['oldest_first'] = 'Oldest first';
$messages['newest_first'] = 'Newest first';
$messages['categories_order'] = 'Categories order';
Modified: plog/branches/lifetype-1.2/locale/admin/locale_es_ES.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_es_ES.php 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/locale/admin/locale_es_ES.php 2007-05-02 12:41:07 UTC (rev 5372)
@@ -387,6 +387,8 @@
$messages['enable_comments_help'] = 'Permite comentarios en todos los artículos por defecto, aunque los comentarios se pueden activar o desactivar a voluntad específicamente para cada artículo';
$messages['show_future_posts'] = 'Mostrar los artículos con fecha en el futuro';
$messages['show_future_posts_help'] = 'Muestra los artículos que tengan fetcha futura en el calendario y en la página principal';
+$messages['articles_order'] = 'Articles order';
+$messages['articles_order_help'] = 'Order in which articles should be displayed.';
$messages['comments_order'] = 'Ordern de los comentarios';
$messages['comments_order_help'] = 'Orden en que los comentarios de un artículo deben ser mostrados';
$messages['oldest_first'] = 'Los antiguos primero';
Modified: plog/branches/lifetype-1.2/locale/admin/locale_fr_FR.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_fr_FR.php 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/locale/admin/locale_fr_FR.php 2007-05-02 12:41:07 UTC (rev 5372)
@@ -401,6 +401,8 @@
$messages["enable_comments_help"] = "Active les commentaires pour tous les articles par défaut. Les commentaires pourront être activés ou désactivés pour un article particulier à sa création ou à son édition.";
$messages["show_future_posts"] = "Montre les articles futurs dans le calendrier.";
$messages["show_future_posts_help"] = "Les articles dont la date de publication n'est pas passée pourront apparaître dans le calendrier et donc seront visibles par les visiteurs.";
+$messages['articles_order'] = 'Articles order';
+$messages['articles_order_help'] = 'Order in which articles should be displayed.';
$messages["comments_order"] = "Ordre des commentaires";
$messages["comments_order_help"] = "Ordre dans lequel les commentaires apparaîtront sur la page principale.";
$messages["oldest_first"] = "Les plus anciens en premier";
Modified: plog/branches/lifetype-1.2/locale/admin/locale_it_IT.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_it_IT.php 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/locale/admin/locale_it_IT.php 2007-05-02 12:41:07 UTC (rev 5372)
@@ -394,6 +394,8 @@
$messages['enable_comments_help'] = 'Abilita i commenti in tutti gli articoli in maniera predefinita. I commenti possono comunque essere abilitati e disabilitati per i singoli articoli, alla loro creazione o modifica';
$messages['show_future_posts'] = 'Mostra gli articoli nel futuro nel calendario';
$messages['show_future_posts_help'] = 'Decide se gli articoli che hanno una data nel futuro devono apparire nel calendario ed essere visibili agli utenti';
+$messages['articles_order'] = 'Articles order';
+$messages['articles_order_help'] = 'Order in which articles should be displayed.';
$messages['comments_order'] = 'Ordine dei commenti';
$messages['comments_order_help'] = 'Ordine nel quale i commenti devono apparire nella pagina principale';
$messages['oldest_first'] = 'I più vecchi in cima';
Modified: plog/branches/lifetype-1.2/locale/admin/locale_nl_NL.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_nl_NL.php 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/locale/admin/locale_nl_NL.php 2007-05-02 12:41:07 UTC (rev 5372)
@@ -427,6 +427,8 @@
$messages['enable_comments_help'] = 'Maak commentaar standaard beschikbaar voor alle berichten. Dit kan later per bericht aan- of uitgeschakeld worden voor nieuwe of bestaande berichten';
$messages['show_future_posts'] = 'Toon toekomstige berichten in de kalender';
$messages['show_future_posts_help'] = 'Zorgt ervoor dat berichten met een plaatsingsdatum in de toekomst in de kalender zichtbaar zijn voor gebruikers';
+$messages['articles_order'] = 'Articles order';
+$messages['articles_order_help'] = 'Order in which articles should be displayed.';
$messages['comments_order'] = 'Volgorde commentaar';
$messages['comments_order_help'] = 'Volgorde waarop commentaar op de voorpagina getoond wordt';
$messages['oldest_first'] = 'Oude berichten eerst';
Modified: plog/branches/lifetype-1.2/locale/admin/locale_zh_CN.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_zh_CN.php 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/locale/admin/locale_zh_CN.php 2007-05-02 12:41:07 UTC (rev 5372)
@@ -397,6 +397,8 @@
$messages['enable_comments_help'] = 'å¦æè®¾ç½®ä¸ºâæ¯âï¼é£ä¹æ¨ä¾¿å¯ä»¥è®©å
¶ä»ç¨æ·é对æ¨çæç« å表è¯è®ºçè¨ãè¿ä¸ªè®¾ç½®ä¼å¥ç¨å°æ¨çå
¨é¨æç« ä¸ã';
$messages['show_future_posts'] = '卿¥åæ¾ç¤ºæªæ¥æç« ã';
$messages['show_future_posts_help'] = 'å¦æè®¾ç½®ä¸ºâæ¯âï¼é£ä¹åè¡¨æ¥æè®¾ç½®å¨æªæ¥çæç« å°ä¼åºç°å¨æ¥åä¸ã';
+$messages['articles_order'] = 'Articles order';
+$messages['articles_order_help'] = 'Order in which articles should be displayed.';
$messages['comments_order'] = 'è¯è®ºçè¨æåºæ¹å¼';
$messages['comments_order_help'] = '妿æ¨è®¾ç½®æâæ§çå¨åâï¼é£ä¹çè¨å°±ä¼ä»æ§å°æ°æåºï¼å¦æè®¾ç½®æâæ°çå¨åâï¼ååä¹ï¼çè¨ä»æ°å°æ§æåºåºç°ã';
$messages['oldest_first'] = 'æ§çå¨å';
Modified: plog/branches/lifetype-1.2/locale/admin/locale_zh_TW.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_zh_TW.php 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/locale/admin/locale_zh_TW.php 2007-05-02 12:41:07 UTC (rev 5372)
@@ -397,6 +397,8 @@
$messages['enable_comments_help'] = '妿è¨å®çºãæ¯ãï¼é£éº¼æ¨ä¾¿å¯ä»¥è®å
¶ä»ä½¿ç¨è
éå°æ¨çæç« ç¼è¡¨è¿´é¿çè¨ãéåè¨å®æå¥ç¨å°æ¨çå
¨é¨æç« ä¸ã';
$messages['show_future_posts'] = '卿¥æé¡¯ç¤ºæªä¾æç« ã';
$messages['show_future_posts_help'] = '妿è¨å®çºãæ¯ãï¼é£éº¼ç¼è¡¨æ¥æè¨å®å¨æªä¾çæç« å°æåºç¾å¨æ¥æä¸ã';
+$messages['articles_order'] = 'Articles order';
+$messages['articles_order_help'] = 'Order in which articles should be displayed.';
$messages['comments_order'] = 'è¿´é¿çè¨æåºæ¹å¼';
$messages['comments_order_help'] = '妿æ¨è¨å®æãèçå¨åãï¼é£éº¼çè¨å°±æå¾èå°æ°æåºï¼å¦æè¨å®æãæ°çå¨åãï¼ååä¹ï¼çè¨å¾æ°å°èæåºåºç¾ã';
$messages['oldest_first'] = 'èçå¨å';
Modified: plog/branches/lifetype-1.2/templates/admin/blogsettings.template
===================================================================
--- plog/branches/lifetype-1.2/templates/admin/blogsettings.template 2007-05-01 15:44:57 UTC (rev 5371)
+++ plog/branches/lifetype-1.2/templates/admin/blogsettings.template 2007-05-02 12:41:07 UTC (rev 5372)
@@ -180,6 +180,15 @@
</div>
<div class="field">
+ <label for="blogArticlesOrder">{$locale->tr("articles_order")}</label>
+ <div class="formHelp">{$locale->tr("articles_order_help")}</div>
+ <select name="blogArticlesOrder" id="blogArticlesOrder">
+ <option value="1" {if $blogArticlesOrder == 1 } selected="selected" {/if}>{$locale->tr("oldest_first")}</option>
+ <option value="2" {if $blogArticlesOrder == 2 } selected="selected" {/if}>{$locale->tr("newest_first")}</option>
+ </select>
+ </div>
+
+ <div class="field">
<label for="blogCommentsOrder">{$locale->tr("comments_order")}</label>
<div class="formHelp">{$locale->tr("comments_order_help")}</div>
<select name="blogCommentsOrder" id="blogCommentsOrder">
More information about the pLog-svn
mailing list