[geeklog-cvs] geeklog-1.3/public_html/admin story.php,1.136,1.137

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Sun Nov 14 09:06:15 EST 2004


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

Modified Files:
	story.php 
Log Message:
Make links in plain text stories "clickable" when the story is saved. Also fixes bug #308 (messing up image URLs).


Index: story.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/admin/story.php,v
retrieving revision 1.136
retrieving revision 1.137
diff -C2 -d -r1.136 -r1.137
*** story.php	29 Sep 2004 17:43:43 -0000	1.136
--- story.php	14 Nov 2004 14:06:13 -0000	1.137
***************
*** 146,149 ****
--- 146,153 ----
          }
          $A['old_sid'] = $A['sid'];
+         if ($A['postmode'] == 'plaintext') {
+             $A['introtext'] = COM_undoClickableLinks ($A['introtext']);
+             $A['bodytext'] = COM_undoClickableLinks ($A['bodytext']);
+         }
      } elseif (!empty($sid) && $mode == 'editsubmission') {
          $result = DB_query ("SELECT STRAIGHT_JOIN s.*, UNIX_TIMESTAMP(s.date) as unixdate, "
***************
*** 162,165 ****
--- 166,173 ----
              $A['title'] = htmlspecialchars ($A['title']);
              $A['old_sid'] = $A['sid'];
+             if ($A['postmode'] == 'plaintext') {
+                 $A['introtext'] = COM_undoClickableLinks ($A['introtext']);
+                 $A['bodytext'] = COM_undoClickableLinks ($A['bodytext']);
+             }
          } else {
              // that submission doesn't seem to be there any more (may have been
***************
*** 216,221 ****
              $A['title'] = COM_checkHTML(htmlspecialchars(COM_checkWords($A['title'])));
          } else {
!             $A['introtext'] = htmlspecialchars(COM_checkWords($A['introtext']));
!             $A['bodytext'] = htmlspecialchars(COM_checkWords($A['bodytext']));
              $A['title'] = htmlspecialchars(COM_checkWords($A['title']));
          }
--- 224,229 ----
              $A['title'] = COM_checkHTML(htmlspecialchars(COM_checkWords($A['title'])));
          } else {
!             $A['introtext'] = COM_undoClickableLinks (htmlspecialchars(COM_checkWords($A['introtext'])));
!             $A['bodytext'] = COM_undoClickableLinks (htmlspecialchars(COM_checkWords($A['bodytext'])));
              $A['title'] = htmlspecialchars(COM_checkWords($A['title']));
          }
***************
*** 243,248 ****
              $publish_hour += 12;
          }
!         $A['unixdate'] = strtotime($A['publish_year'] . '-' . $A['publish_month'] . '-' . $A['publish_day']
!             . ' ' . $publish_hour . ':' . $A['publish_minute'] . ':00');
      }
  
--- 251,257 ----
              $publish_hour += 12;
          }
!         $A['unixdate'] = strtotime ($A['publish_year'] . '-'
!             . $A['publish_month'] . '-' . $A['publish_day'] . ' '
!             . $publish_hour . ':' . $A['publish_minute'] . ':00');
      }
  
***************
*** 254,258 ****
              $A['hits'] = 0;
          }
!         $display .= STORY_renderArticle ($A, 'n');
          $display .= COM_endBlock (COM_getBlockTemplate ('_admin_block', 'footer'));
      }
--- 263,274 ----
              $A['hits'] = 0;
          }
!         if ($A['postmode'] == 'plaintext') {
!             $B = $A;
!             $B['introtext'] = COM_makeClickableLinks ($B['introtext']);
!             $B['bodytext'] = COM_makeClickableLinks ($B['bodytext']);
!             $display .= STORY_renderArticle ($B, 'n');
!         } else {
!             $display .= STORY_renderArticle ($A, 'n');
!         }
          $display .= COM_endBlock (COM_getBlockTemplate ('_admin_block', 'footer'));
      }
***************
*** 348,352 ****
  
      $story_templates->set_var('story_unixstamp', $A['unixdate']); 
!     /* Auto Story Arhive or Delete Feature */
      if ($A['expiredate'] == 0 or date('Y', $A['expiredate']) < 2000) {
          $A['expiredate'] = time();
--- 364,368 ----
  
      $story_templates->set_var('story_unixstamp', $A['unixdate']); 
!     /* Auto Story Archive or Delete Feature */
      if ($A['expiredate'] == 0 or date('Y', $A['expiredate']) < 2000) {
          $A['expiredate'] = time();
***************
*** 429,433 ****
      $story_templates->set_var('frontpage_options', COM_optionList($_TABLES['frontpagecodes'],'code,name',$A['frontpage']));
      list($newintro, $newbody) = replace_images($A['sid'], stripslashes($A['introtext']), stripslashes($A['bodytext']));
!     
      $story_templates->set_var('lang_introtext', $LANG24[16]);
      if ($A['postmode'] == 'plaintext') {
--- 445,454 ----
      $story_templates->set_var('frontpage_options', COM_optionList($_TABLES['frontpagecodes'],'code,name',$A['frontpage']));
      list($newintro, $newbody) = replace_images($A['sid'], stripslashes($A['introtext']), stripslashes($A['bodytext']));
! 
!     if ($A['postmode'] == 'plaintext') {
!         $newintro = COM_undoClickableLinks ($newintro);
!         $newbody = COM_undoClickableLinks ($newbody);
!     }
! 
      $story_templates->set_var('lang_introtext', $LANG24[16]);
      if ($A['postmode'] == 'plaintext') {
***************
*** 1081,1084 ****
--- 1102,1110 ----
          }
  
+         if ($postmode == 'plaintext') {
+             $introtext = COM_makeClickableLinks ($introtext);
+             $bodytext = COM_makeClickableLinks ($bodytext);
+         }
+ 
          if ($_CONF['maximagesperarticle'] > 0) {
              if ($delete_old_story) {




More information about the geeklog-cvs mailing list