[pLog-svn] r3189 - in plog/trunk: class/summary/action install templates/admin

mark at devel.lifetype.net mark at devel.lifetype.net
Wed Apr 5 08:58:20 GMT 2006


Author: mark
Date: 2006-04-05 08:58:19 +0000 (Wed, 05 Apr 2006)
New Revision: 3189

Modified:
   plog/trunk/class/summary/action/dofinishregister.class.php
   plog/trunk/install/defaultconfig.properties.php
   plog/trunk/templates/admin/globalsettings_general.template
Log:
Now, lifetype will assign default global article category to the first post that created by user registeration process.

Modified: plog/trunk/class/summary/action/dofinishregister.class.php
===================================================================
--- plog/trunk/class/summary/action/dofinishregister.class.php	2006-04-05 07:21:40 UTC (rev 3188)
+++ plog/trunk/class/summary/action/dofinishregister.class.php	2006-04-05 08:58:19 UTC (rev 3189)
@@ -9,6 +9,7 @@
     include_once( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
     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/dao/globalarticlecategories.class.php" );
 	include_once( PLOG_CLASS_PATH."class/summary/mail/summarymailer.class.php" );
 
     /**
@@ -131,6 +132,18 @@
             
             $this->_blogInfo = $blogInfo;
 
+            // get the default global article category id
+	        $globalArticleCategories = new GlobalArticleCategories();
+	        $globalArticleCategoryId = $this->_config->getValue("default_global_article_category_id");
+            if( !empty( $globalArticleCategoryId ) ) {
+            	$globalArticleCategory = $globalArticleCategories->getGlobalArticleCategory( $globalArticleCategoryId );
+            	if( empty( $globalArticleCategory ) )
+            		$globalArticleCategoryId = 0;
+            }	
+            else {
+				$globalArticleCategoryId = 0;
+			}
+                        
             // if the blog was created, we can add some basic information
             // add a category
             $articleCategories = new ArticleCategories();
@@ -149,6 +162,7 @@
                                     0, 
                                     Array(), 
                                     "welcome" );
+            $article->setGlobalCategoryId( $globalArticleCategoryId );  // set the default ArticleGlobalCategory id to article
             $article->setDateObject( new Timestamp());  // set it to the current date
             $article->setCommentsEnabled( true ); // enable comments
 			$article->setInSummary( false );	// no need to see these in the summary!

Modified: plog/trunk/install/defaultconfig.properties.php
===================================================================
--- plog/trunk/install/defaultconfig.properties.php	2006-04-05 07:21:40 UTC (rev 3188)
+++ plog/trunk/install/defaultconfig.properties.php	2006-04-05 08:58:19 UTC (rev 3189)
@@ -120,5 +120,7 @@
 $Inserts[117] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('urlize_word_separator', '_', 3);";
 $Inserts[118] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('summary_template_cache_lifetime', '0', 1 );";
 $Inserts[119] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('http_cache_lifetime', '1800', 1 );";
+$Inserts[120] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('blog_does_not_exist_url','{plog_base_url}',3);";
+$Inserts[121] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_global_article_category_id','1',1);";
 
 ?>
\ No newline at end of file

Modified: plog/trunk/templates/admin/globalsettings_general.template
===================================================================
--- plog/trunk/templates/admin/globalsettings_general.template	2006-04-05 07:21:40 UTC (rev 3188)
+++ plog/trunk/templates/admin/globalsettings_general.template	2006-04-05 08:58:19 UTC (rev 3189)
@@ -96,6 +96,12 @@
 	 {$locale->tr("select")}
 	</a>
    </div>
+   <!-- default_global_article_category_id -->
+   <div class="field">
+    <label for="config[default_global_article_category_id]">default_global_article_category_id</label>
+    <div class="formHelp">{$locale->tr("help_default_global_article_category_id")}</div>	
+    <input style="width:100%" type="text" name="config[default_global_article_category_id]" value="{$default_global_article_category_id}"/>
+   </div>   
    <!-- blog_does_not_exist_url -->
    <div class="field">
     <label for="config[blog_does_not_exist_url]">blog_does_not_exist_url</label>



More information about the pLog-svn mailing list