[geeklog-cvs] geeklog: Replace Wiki-style formatting in the Daily Digest and w...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Fri Apr 10 17:33:22 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6566283deb9f
changeset: 6914:6566283deb9f
user:      Dirk Haun <dirk at haun-online.de>
date:      Fri Apr 10 23:33:02 2009 +0200
description:
Replace Wiki-style formatting in the Daily Digest and when emailing a story to a friend (bug #0000837, patch provided by Pawel Szczur)

diffstat:

3 files changed, 22 insertions(+), 9 deletions(-)
public_html/docs/history   |    2 ++
public_html/lib-common.php |   12 ++++++++----
public_html/profiles.php   |   17 ++++++++++++-----

diffs (75 lines):

diff -r 2a13f4520557 -r 6566283deb9f public_html/docs/history
--- a/public_html/docs/history	Fri Apr 10 23:23:21 2009 +0200
+++ b/public_html/docs/history	Fri Apr 10 23:33:02 2009 +0200
@@ -11,6 +11,8 @@
 + Comment moderation and editable comments, by Jared Wenerd
 
 Other changes:
+- Replace Wiki-style formatting in the Daily Digest and when emailing a story
+  to a friend (bug #0000837, patch provided by Pawel Szczur)
 - New plugin API function PLG_configChange (feature request #0000694) [Dirk]
 - Fixed layout of Batch Add and Batch Admin options of the User Manager [Dirk]
 - On a login failure, the user registration form showed up even when new user
diff -r 2a13f4520557 -r 6566283deb9f public_html/lib-common.php
--- a/public_html/lib-common.php	Fri Apr 10 23:23:21 2009 +0200
+++ b/public_html/lib-common.php	Fri Apr 10 23:33:02 2009 +0200
@@ -4022,9 +4022,9 @@
         $U = DB_fetchArray( $users );
 
         $storysql = array();
-        $storysql['mysql'] = "SELECT sid,uid,date AS day,title,introtext,bodytext";
-
-        $storysql['mssql'] = "SELECT sid,uid,date AS day,title,CAST(introtext AS text) AS introtext,CAST(bodytext AS text) AS introtext";
+        $storysql['mysql'] = "SELECT sid,uid,date AS day,title,introtext,postmode";
+
+        $storysql['mssql'] = "SELECT sid,uid,date AS day,title,CAST(introtext AS text) AS introtext,postmode";
 
         $commonsql = " FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() AND date >= '{$lastrun}'";
 
@@ -4100,7 +4100,11 @@
 
             if( $_CONF['emailstorieslength'] > 0 )
             {
-                $storytext = COM_undoSpecialChars( strip_tags( PLG_replaceTags( stripslashes( $S['introtext'] ))));
+                if($S['postmode']==='wikitext'){
+                    $storytext = COM_undoSpecialChars( strip_tags( COM_renderWikiText ( stripslashes( $S['introtext'] ))));
+                } else {
+                    $storytext = COM_undoSpecialChars( strip_tags( PLG_replaceTags( stripslashes( $S['introtext'] ))));
+                }
 
                 if( $_CONF['emailstorieslength'] > 1 )
                 {
diff -r 2a13f4520557 -r 6566283deb9f public_html/profiles.php
--- a/public_html/profiles.php	Fri Apr 10 23:23:21 2009 +0200
+++ b/public_html/profiles.php	Fri Apr 10 23:33:02 2009 +0200
@@ -300,7 +300,7 @@
         return $retval;
     }
 
-    $sql = "SELECT uid,title,introtext,bodytext,commentcode,UNIX_TIMESTAMP(date) AS day FROM {$_TABLES['stories']} WHERE sid = '$sid'";
+    $sql = "SELECT uid,title,introtext,bodytext,commentcode,UNIX_TIMESTAMP(date) AS day,postmode FROM {$_TABLES['stories']} WHERE sid = '$sid'";
     $result = DB_query ($sql);
     $A = DB_fetchArray ($result);
     $shortmsg = COM_stripslashes ($shortmsg);
@@ -325,10 +325,17 @@
         $author = COM_getDisplayName ($A['uid']);
         $mailtext .= $LANG01[1] . ' ' . $author . LB;
     }
-    $mailtext .= LB
-        . COM_undoSpecialChars(stripslashes(strip_tags($A['introtext']))).LB.LB
-        . COM_undoSpecialChars(stripslashes(strip_tags($A['bodytext']))).LB.LB
-        . '------------------------------------------------------------'.LB;
+    if($A['postmode']==='wikitext'){
+        $mailtext .= LB
+            . COM_undoSpecialChars(stripslashes(strip_tags(COM_renderWikiText($A['introtext'])))).LB.LB
+            . COM_undoSpecialChars(stripslashes(strip_tags(COM_renderWikiText($A['bodytext'])))).LB.LB
+            . '------------------------------------------------------------'.LB;
+    } else {
+        $mailtext .= LB
+            . COM_undoSpecialChars(stripslashes(strip_tags($A['introtext']))).LB.LB
+            . COM_undoSpecialChars(stripslashes(strip_tags($A['bodytext']))).LB.LB
+            . '------------------------------------------------------------'.LB;
+    }
     if ($A['commentcode'] == 0) { // comments allowed
         $mailtext .= $LANG08[24] . LB
                   . COM_buildUrl ($_CONF['site_url'] . '/article.php?story='



More information about the geeklog-cvs mailing list