[pLog-svn] r2758 - in plog/trunk: class/action class/action/admin class/config class/dao class/net class/view/admin locale templates/admin

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Fri Jan 6 03:45:00 GMT 2006


Author: jondaley
Date: 2006-01-06 03:44:59 +0000 (Fri, 06 Jan 2006)
New Revision: 2758

Added:
   plog/trunk/locale/locale_ko_KR.php
Modified:
   plog/trunk/class/action/addcommentaction.class.php
   plog/trunk/class/action/admin/adminnewpostaction.class.php
   plog/trunk/class/config/properties.class.php
   plog/trunk/class/dao/trackbackclient.class.php
   plog/trunk/class/net/baserequestgenerator.class.php
   plog/trunk/class/view/admin/adminnewpostview.class.php
   plog/trunk/class/view/admin/adminpostslistview.class.php
   plog/trunk/templates/admin/newpost.template
Log:
merged revs 2732 to 2757 from 1.0.3 branch.  It always amazes me how easy this is.

Modified: plog/trunk/class/action/addcommentaction.class.php
===================================================================
--- plog/trunk/class/action/addcommentaction.class.php	2006-01-06 03:36:17 UTC (rev 2757)
+++ plog/trunk/class/action/addcommentaction.class.php	2006-01-06 03:44:59 UTC (rev 2758)
@@ -215,6 +215,7 @@
 			
 			// calculate the final URL
 			$rg = $this->_blogInfo->getBlogRequestGenerator();
+			$rg->setXHTML( false );
 			$postPermalink = $rg->postPermalink( $article );
 						
 			// and pass it to the redirect view to perform the redirection

Modified: plog/trunk/class/action/admin/adminnewpostaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminnewpostaction.class.php	2006-01-06 03:36:17 UTC (rev 2757)
+++ plog/trunk/class/action/admin/adminnewpostaction.class.php	2006-01-06 03:44:59 UTC (rev 2758)
@@ -29,7 +29,7 @@
         function perform()
         {
 	        $categories = new ArticleCategories();
-            $blogCategories = $categories->getBlogCategories( $this->_blogInfo->getId() );
+            $blogCategories = $categories->getBlogCategoriesAdmin( $this->_blogInfo->getId() );
             // but make sure that we have at least one!
             if( count($blogCategories) == 0) {
             	$this->_view = new AdminTemplatedView( $this->_blogInfo, "newpostcategory" );

Modified: plog/trunk/class/config/properties.class.php
===================================================================
--- plog/trunk/class/config/properties.class.php	2006-01-06 03:36:17 UTC (rev 2757)
+++ plog/trunk/class/config/properties.class.php	2006-01-06 03:44:59 UTC (rev 2758)
@@ -52,8 +52,7 @@
             if( !isset($this->_props[$key]) ) {
                 return $defaultValue;
             } else {
-			    $value = $this->_props[$key];
-                return $value;
+			    return $this->_props[$key];
             }
 		}
 

Modified: plog/trunk/class/dao/trackbackclient.class.php
===================================================================
--- plog/trunk/class/dao/trackbackclient.class.php	2006-01-06 03:36:17 UTC (rev 2757)
+++ plog/trunk/class/dao/trackbackclient.class.php	2006-01-06 03:44:59 UTC (rev 2758)
@@ -4,6 +4,7 @@
     include_once( PLOG_CLASS_PATH."class/dao/article.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
     include_once( PLOG_CLASS_PATH."class/net/requestgenerator.class.php" );
+	include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );    
 
     define( "TRACKBACK_SUCCESS", 0 );
     define( "TRACKBACK_FAILED", 1 );
@@ -128,7 +129,7 @@
         	$t =& RequestGenerator::getRequestGenerator( $blogInfo );
         	$formvars["title"]     = $article->getTopic();
         	// according to MT's implementation, the excerpt should not be longer than 255 characters.
-        	$formvars["excerpt"]   = substr( $article->getText(), 0, 252 )."...";
+        	$formvars["excerpt"]   = substr( Textfilter::filterAllHTML( $article->getText() ), 0, 252 )."...";
         	$formvars["url"]       = $t->postPermalink( $article );
         	$formvars["blog_name"] = $blogInfo->getBlog();
 

Modified: plog/trunk/class/net/baserequestgenerator.class.php
===================================================================
--- plog/trunk/class/net/baserequestgenerator.class.php	2006-01-06 03:36:17 UTC (rev 2757)
+++ plog/trunk/class/net/baserequestgenerator.class.php	2006-01-06 03:44:59 UTC (rev 2758)
@@ -78,7 +78,7 @@
 		
 			// prepare the correct url if subdomains are enabled...
 			if( $this->_subdomainsEnabled && $blogInfo != null ) {
-				$this->_subdomainsBaseUrl = str_replace( "{blogname}", Textfilter::urlize($blogInfo->getBlog()), $this->_subdomainsBaseUrl );
+				$this->_subdomainsBaseUrl = str_replace( "{blogname}", $blogInfo->getMangledBlog(), $this->_subdomainsBaseUrl );
 				$ownerInfo = $blogInfo->getOwnerInfo();
 				$this->_subdomainsBaseUrl = str_replace( "{username}", Textfilter::urlize($ownerInfo->getUsername()), $this->_subdomainsBaseUrl );
 			}

Modified: plog/trunk/class/view/admin/adminnewpostview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminnewpostview.class.php	2006-01-06 03:36:17 UTC (rev 2757)
+++ plog/trunk/class/view/admin/adminnewpostview.class.php	2006-01-06 03:44:59 UTC (rev 2758)
@@ -28,7 +28,8 @@
             $categories = new ArticleCategories();
             $blogSettings = $this->_blogInfo->getSettings();
             $categoriesOrder = $blogSettings->getValue( "categories_order" );
-            $blogCategories = $categories->getBlogCategories( $this->_blogInfo->getId(), false, $categoriesOrder );
+            $blogCategories = $categories->getBlogCategoriesAdmin( $this->_blogInfo->getId(),
+                                                              false, $categoriesOrder );
             
             // global article categories
             $globalArticleCategories = new GlobalArticleCategories();

Modified: plog/trunk/class/view/admin/adminpostslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminpostslistview.class.php	2006-01-06 03:36:17 UTC (rev 2757)
+++ plog/trunk/class/view/admin/adminpostslistview.class.php	2006-01-06 03:44:59 UTC (rev 2758)
@@ -64,30 +64,17 @@
             $archiveDateFormat = $this->_locale->tr( "archive_date_format" );
             if( $archiveDateFormat == "archive_date_format" ) $archiveDateFormat = "%B %Y";
 
+                // Add current month, even if there aren't any posts in it
+            if( $archiveStats[$curyear][$curmonth] == "") {
+                $t = new Timestamp();
+                $name = $this->_locale->formatDate( $t, $archiveDateFormat );
+                $monthStr = Array( "name" => $name, 
+                                   "date" => $this->_locale->formatDate($t, "%Y%m"));
+                array_push( $result, $monthStr );
+            }
+            
             foreach( $archiveStats as $yearName => $year) {
             	foreach( $year as $monthName => $month ) {
-            	   // the next bit is so disgustingly ugly that I am ashamed of it... 
-            	   // what I'm trying to do here is that the getNumberPostsPerMonthAdmin() method
-            	   // won't return the current month if there wasn't anything posted during it but
-            	   // we still should show the current month even if there's nothing in it, because otherwise
-            	   // when generating page where the posts are listed, it will end up saying "Date: All" 
-            	   // but no posts at all shown (it didn't have anything to show) This is a way of
-            	   // "introducing" a month in the array without fucking it up. In fact, PHP *was*
-            	   // indeed fucking it up... it didn't just want to keep the order! Oh well, it's a very
-            	   // long and stupid story but we need this hack, ok? :)
-            	    if( $archiveStats[$curyear][$curmonth] == "" && !$alreadyAdded ) {
-            	       // there goes the dirty hack :P
-            	       if( $yearName == $curyear && $monthName < $curmonth ) {
-            	            $t = new Timestamp();
-                            $name = $this->_locale->formatDate( $t, $archiveDateFormat );
-                            $monthStr = Array( "name" => $name, 
-                                       "date" => $this->_locale->formatDate($t, "%Y%m"));
-                            array_push( $result, $monthStr );
-                            $alreadyAdded = true;    
-            	       }
-            	    }
-            	
-            	
                 	// we can use the Timestamp class to help us with this...
                 	$t = new Timestamp( "" );
                     $t->setYear( $yearName );
@@ -178,7 +165,8 @@
             $categories = new ArticleCategories();
 			$blogSettings = $this->_blogInfo->getSettings();
 			$categoriesOrder = $blogSettings->getValue( "categories_order" );
-            $blogCategories = $categories->getBlogCategories( $this->_blogInfo->getId(), false, $categoriesOrder );
+            $blogCategories = $categories->getBlogCategoriesAdmin( $this->_blogInfo->getId(),
+                                                              false, $categoriesOrder );
 			$this->notifyEvent( EVENT_CATEGORIES_LOADED, Array( "categories" => &$blogCategories ));
 			
             // and all the users that belong to this blog

Copied: plog/trunk/locale/locale_ko_KR.php (from rev 2757, plog/branches/lifetype-1.0.3/locale/locale_ko_KR.php)

Modified: plog/trunk/templates/admin/newpost.template
===================================================================
--- plog/trunk/templates/admin/newpost.template	2006-01-06 03:36:17 UTC (rev 2757)
+++ plog/trunk/templates/admin/newpost.template	2006-01-06 03:44:59 UTC (rev 2758)
@@ -130,8 +130,8 @@
 		 <span class="required">*</span>
 		 <div class="formHelp">{$locale->tr("post_categories_help")}</div>
          <select name="postCategories[]" id="postCategories" size="5" multiple="multiple" style="width:100%">
-           {foreach from=$categories item=category}
-           <option value="{$category->getId()}" {foreach from=$postCategories item=categoryId}{if $category->getId() == $categoryId} selected="selected" {/if}{/foreach}>{$category->getName()}</option>
+           {foreach name=categories from=$categories item=category}
+           <option value="{$category->getId()}" {if $smarty.foreach.categories.first} selected="selected" {/if}>{$category->getName()}</option>
            {/foreach}
          </select>
         {include file="$admintemplatepath/validate.template" field=postCategories message=$locale->tr("error_no_category_selected")}	   



More information about the pLog-svn mailing list