[geeklog-cvs] geeklog-1.3/public_html comment.php,1.83,1.84 lib-common.php,1.397,1.398

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Sat Nov 13 16:42:02 EST 2004


Update of /var/cvs/geeklog-1.3/public_html
In directory www:/tmp/cvs-serv7649

Modified Files:
	comment.php lib-common.php 
Log Message:
Links in plain text comments are now made "clickable" when the comment is saved (not when it's displayed).


Index: comment.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/comment.php,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -d -r1.83 -r1.84
*** comment.php	13 Nov 2004 17:18:56 -0000	1.83
--- comment.php	13 Nov 2004 21:41:59 -0000	1.84
***************
*** 127,134 ****
--- 127,140 ----
              $commenttext = htmlspecialchars (COM_stripslashes ($comment));
  
+             $fakepostmode = $postmode;
              if ($postmode == 'html') {
                  $comment = COM_checkWords (COM_checkHTML (addslashes (COM_stripslashes ($comment))));
              } else {
                  $comment = htmlspecialchars (COM_checkWords (COM_stripslashes ($comment)));
+                 $newcomment = COM_makeClickableLinks ($comment);
+                 if (strcmp ($comment, $newcomment) != 0) {
+                     $comment = nl2br ($newcomment);
+                     $fakepostmode = 'html';
+                 }
              }
              // Replace $, {, and } with special HTML equivalents
***************
*** 145,149 ****
              $newcomment = $comment;
              if (!empty ($sig)) {
!                 if (!$postmode == 'html') {
                      $newcomment .= '<p>---<br>' . nl2br ($sig);
                  } else {
--- 151,155 ----
              $newcomment = $comment;
              if (!empty ($sig)) {
!                 if (($postmode == 'html') || ($fakepostmode == 'html')) {
                      $newcomment .= '<p>---<br>' . nl2br ($sig);
                  } else {
***************
*** 310,313 ****
--- 316,324 ----
      } else {
          $comment = htmlspecialchars (COM_checkWords (COM_stripslashes ($comment)));
+         $newcomment = COM_makeClickableLinks ($comment);
+         if (strcmp ($comment, $newcomment) != 0) {
+             $comment = nl2br ($newcomment);
+             $postmode = 'html';
+         }
      }
  
***************
*** 903,905 ****
  echo $display;
  
! ?>
\ No newline at end of file
--- 914,916 ----
  echo $display;
  
! ?>

Index: lib-common.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.397
retrieving revision 1.398
diff -C2 -d -r1.397 -r1.398
*** lib-common.php	13 Nov 2004 17:44:14 -0000	1.397
--- lib-common.php	13 Nov 2004 21:41:59 -0000	1.398
***************
*** 2917,2921 ****
          if( preg_match( '/<.*>/', $A['comment'] ) == 0 )
          {
!             $A['comment'] = nl2br( COM_makeClickableLinks( $A['comment'] ));
          }
  
--- 2917,2921 ----
          if( preg_match( '/<.*>/', $A['comment'] ) == 0 )
          {
!             $A['comment'] = nl2br( $A['comment'] );
          }
  




More information about the geeklog-cvs mailing list