[pLog-svn] r2006 - in plugins/trunk: . moblog/class/moblog

oscar at devel.plogworld.net oscar at devel.plogworld.net
Fri May 13 19:40:22 GMT 2005


Author: oscar
Date: 2005-05-13 19:40:22 +0000 (Fri, 13 May 2005)
New Revision: 2006

Modified:
   plugins/trunk/moblog.php
   plugins/trunk/moblog/class/moblog/moblogrequest.class.php
Log:
- minor cosmetic fixes
- now article notifications are enabled by default

Modified: plugins/trunk/moblog/class/moblog/moblogrequest.class.php
===================================================================
--- plugins/trunk/moblog/class/moblog/moblogrequest.class.php	2005-05-13 08:47:19 UTC (rev 2005)
+++ plugins/trunk/moblog/class/moblog/moblogrequest.class.php	2005-05-13 19:40:22 UTC (rev 2006)
@@ -127,8 +127,7 @@
             list($body, $sig) = explode("\n-- ", $body);
             
             MoblogLogger::log( "parseBody ---> body = $body" );
-            $body = Textfilter::autoP(trim($body));         
-            
+            $body = trim($body);            
             $this->_body .= $body;
         }
         

Modified: plugins/trunk/moblog.php
===================================================================
--- plugins/trunk/moblog.php	2005-05-13 08:47:19 UTC (rev 2005)
+++ plugins/trunk/moblog.php	2005-05-13 19:40:22 UTC (rev 2006)
@@ -2,7 +2,7 @@
 
     // define the entry point
     if (!defined( "PLOG_CLASS_PATH" )) {
-        define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
+    	define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
     }
     
     //
@@ -51,6 +51,8 @@
     // parse the message
     $request = new MoblogRequest( $message );
     
+    MoblogLogger::log("here?");
+    
     // check if it's a help message
     if( $request->isHelpRequest()) {
         $response = new MoblogResponse( $request->getReplyTo(),
@@ -247,6 +249,8 @@
     // with links to the attachments that were sent
     $rg = $blogInfo->getBlogRequestGenerator();
     $postBody = $request->getBody()."<br/>";
+    $numItems = count($resourceIds);
+    $curItem = 0;
     foreach( $resourceIds as $resId ) {
         $resource = $res->getResource( $resId );
         $markup = "<a href=\"".$rg->resourceLink( $resource )."\">";        
@@ -264,10 +268,14 @@
         else {
             $markup .= $resource->getDescription();
         }
-        $markup .= "</a><br/>";
+        $markup .= "</a>";
+        $curItem++;
+        if( $curItem < $numItems ) 
+            $markup .= "<br/><br/>";        
         MoblogLogger::log( "Adding markup $markup" );
         $postBody .= $markup;
-        $resNames .= $resource->getDescription()."\n";
+        $postBody = TextFilter::autoP( trim( $postBody ));
+        $resNames .= $resource->getDescription();        
     }
     
     // add the article
@@ -284,6 +292,10 @@
     $article->setCommentsEnabled( true );
     $result = $articles->addArticle( $article );
     
+    // add an article notification
+    $notifications = new ArticleNotifications();
+    $notifications->addNotification( $result, $blogInfo->getId(), $userInfo->getId());
+    
     // reset the cache in case it is enabled
     CacheControl::resetBlogCache( $blogInfo->getId());    
     




More information about the pLog-svn mailing list