[geeklog-cvs] geeklog-1.3/public_html/admin story.php,1.121,1.122

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Sat Jul 31 09:19:08 EDT 2004


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

Modified Files:
	story.php 
Log Message:
Hard-coded the names of the pseudo tags for images, so that it's always [imageX], etc. independent of the currently used language file.


Index: story.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/admin/story.php,v
retrieving revision 1.121
retrieving revision 1.122
diff -C2 -d -r1.121 -r1.122
*** story.php	31 Jul 2004 03:30:33 -0000	1.121
--- story.php	31 Jul 2004 13:19:06 -0000	1.122
***************
*** 46,54 ****
  * Geeklog commong function library
  */
! require_once('../lib-common.php');
  /**
  * Security check to ensure user even belongs on this page
  */
! require_once('auth.inc.php');
  
  // Set this to true if you want to have this code output debug messages to 
--- 46,55 ----
  * Geeklog commong function library
  */
! require_once ('../lib-common.php');
! 
  /**
  * Security check to ensure user even belongs on this page
  */
! require_once ('auth.inc.php');
  
  // Set this to true if you want to have this code output debug messages to 
***************
*** 245,249 ****
              $A['hits'] = 0;
          }
!         $display .= COM_article($A,"n");
          $display .= COM_endBlock (COM_getBlockTemplate ('_admin_block', 'footer'));
      }
--- 246,250 ----
              $A['hits'] = 0;
          }
!         $display .= COM_article ($A, 'n');
          $display .= COM_endBlock (COM_getBlockTemplate ('_admin_block', 'footer'));
      }
***************
*** 387,391 ****
      $story_templates->set_var('lang_title', $LANG24[13]);
      if ($A['postmode'] == 'plaintext') {
!         $A['title'] = str_replace('$','$',$A['title']);
      }
      
--- 388,392 ----
      $story_templates->set_var('lang_title', $LANG24[13]);
      if ($A['postmode'] == 'plaintext') {
!         $A['title'] = str_replace ('$', '$', $A['title']);
      }
      
***************
*** 449,453 ****
              for ($z = 1; $z <= $icount; $z++) {
                  $I = DB_fetchArray($result_articles);
!                 $saved_images .= $z . ') <a href="' . $_CONF['site_url'] . '/images/articles/' . $I['ai_filename'] . '" target="_blank">' . $I['ai_filename'] . '</a>';
                  $saved_images .= '   ' . $LANG24[52] . ': <input type="checkbox" name="delete[' .$I['ai_img_num'] . ']"><br>';
              }
--- 450,454 ----
              for ($z = 1; $z <= $icount; $z++) {
                  $I = DB_fetchArray($result_articles);
!                 $saved_images .= $z . ') <a href="' . $_CONF['site_url'] . '/images/articles/' . $I['ai_filename'] . '">' . $I['ai_filename'] . '</a>';
                  $saved_images .= '   ' . $LANG24[52] . ': <input type="checkbox" name="delete[' .$I['ai_img_num'] . ']"><br>';
              }
***************
*** 537,545 ****
          if( $trows > 0 )
          {
!             $excludetopics .= " WHERE (";
              for( $i = 1; $i <= $trows; $i++ )  {
                  $T = DB_fetchArray ($tresult);
                  if ($i > 1)  {
!                     $excludetopics .= " OR ";
                  }
                  $excludetopics .= "tid = '{$T['tid']}'";
--- 538,546 ----
          if( $trows > 0 )
          {
!             $excludetopics .= ' WHERE (';
              for( $i = 1; $i <= $trows; $i++ )  {
                  $T = DB_fetchArray ($tresult);
                  if ($i > 1)  {
!                     $excludetopics .= ' OR ';
                  }
                  $excludetopics .= "tid = '{$T['tid']}'";
***************
*** 550,554 ****
                  $seltopics .= '>' . $T['topic'] . '</option>' . LB;
              }
!             $excludetopics .= ") ";
          } 
      } else {
--- 551,555 ----
                  $seltopics .= '>' . $T['topic'] . '</option>' . LB;
              }
!             $excludetopics .= ') ';
          } 
      } else {
***************
*** 629,635 ****
                      . $LANG24[2] . '</a> ');
              } else {
! 	        $story_templates->set_var('nextpage_link','');
              }
!             $baseurl = $_CONF['site_admin_url'] . '/story.php?mode=list&tid=' .$current_topic;
              $numpages = ceil ($numstories / 50);
              $story_templates->set_var ('google_paging',
--- 630,636 ----
                      . $LANG24[2] . '</a> ');
              } else {
!                 $story_templates->set_var('nextpage_link','');
              }
!             $baseurl = $_CONF['site_admin_url'] . '/story.php?mode=list&tid=' .$current_topic;
              $numpages = ceil ($numstories / 50);
              $story_templates->set_var ('google_paging',
***************
*** 677,680 ****
--- 678,686 ----
      for ($i = 1; $i <= $nrows; $i++) {
          $A = DB_fetchArray($result);
+ 
+         $imageX       = '[image' . $i . ']';
+         $imageX_left  = '[image' . $i . '_left]';
+         $imageX_right = '[image' . $i . '_right]';
+ 
          $dimensions = GetImageSize($_CONF['path_images'] . 'articles/' . $A['ai_filename']);
          if (!empty($dimensions[0]) AND !empty($dimensions[1])) {
***************
*** 695,699 ****
                                   . $lFilename_large;
              } else {
!                 $lFilename_large_URL = $_CONF['site_url'] . '/getimage.php?mode=show&image='
                                   . $lFilename_large;
              }
--- 701,705 ----
                                   . $lFilename_large;
              } else {
!                 $lFilename_large_URL = $_CONF['site_url'] . '/getimage.php?mode=show&image='
                                   . $lFilename_large;
              }
***************
*** 708,712 ****
              $imgSrc = $_CONF['site_url'] . '/images/articles/' . $A['ai_filename'];
          } else {
!             $imgSrc = $_CONF['site_url'] . '/getimage.php?mode=articles&image=' . $A['ai_filename'];
          }
          $norm = $lLinkPrefix . '<img ' . $sizeattributes . 'src="' . $imgSrc . '" alt="">' . $lLinkSuffix;
--- 714,718 ----
              $imgSrc = $_CONF['site_url'] . '/images/articles/' . $A['ai_filename'];
          } else {
!             $imgSrc = $_CONF['site_url'] . '/getimage.php?mode=articles&image=' . $A['ai_filename'];
          }
          $norm = $lLinkPrefix . '<img ' . $sizeattributes . 'src="' . $imgSrc . '" alt="">' . $lLinkSuffix;
***************
*** 715,724 ****
          $fulltext = $intro . ' ' . $body;
          $count = substr_count($fulltext, $norm) + substr_count($fulltext, $left) + substr_count($fulltext, $right);
!         $intro = str_replace($norm, '[' . $LANG24[48] . $i . ']', $intro);
!         $body = str_replace($norm, '[' . $LANG24[48] . $i . ']', $body);
!         $intro = str_replace($left, '[' . $LANG24[48] . $i . '_' . $LANG24[50] . ']', $intro);
!         $body = str_replace($left, '[' . $LANG24[48] . $i . '_' . $LANG24[50] . ']', $body);
!         $intro = str_replace($right, '[' . $LANG24[48] . $i . '_' . $LANG24[49] . ']', $intro);
!         $body = str_replace($right, '[' . $LANG24[48] . $i . '_' . $LANG24[49] . ']', $body);
      }
  
--- 721,730 ----
          $fulltext = $intro . ' ' . $body;
          $count = substr_count($fulltext, $norm) + substr_count($fulltext, $left) + substr_count($fulltext, $right);
!         $intro = str_replace ($norm,  $imageX,       $intro);
!         $body  = str_replace ($norm,  $imageX,       $body);
!         $intro = str_replace ($left,  $imageX_left,  $intro);
!         $body  = str_replace ($left,  $imageX_left,  $body);
!         $intro = str_replace ($right, $imageX_right, $intro);
!         $body  = str_replace ($right, $imageX_right, $body);
      }
  
***************
*** 767,771 ****
                                   . $lFilename_large;
              } else {
!                 $lFilename_large_URL = $_CONF['site_url'] . '/getimage.php?mode=show&image='
                                   . $lFilename_large;
              }
--- 773,777 ----
                                   . $lFilename_large;
              } else {
!                 $lFilename_large_URL = $_CONF['site_url'] . '/getimage.php?mode=show&image='
                                   . $lFilename_large;
              }
***************
*** 777,783 ****
          }
  
!         $norm = '[' . $LANG24[48] . $i . ']';
!         $left = '[' . $LANG24[48] . $i . '_' . $LANG24[50] . ']';
!         $right = '[' . $LANG24[48] . $i . '_' . $LANG24[49] . ']';
          $fulltext = $intro . ' ' . $body;
          $icount = substr_count($fulltext, $norm) + substr_count($fulltext, $left) + substr_count($fulltext, $right);
--- 783,790 ----
          }
  
!         $norm  = '[image' . $i . ']';
!         $left  = '[image' . $i . '_left]';
!         $right = '[image' . $i . '_right]';
! 
          $fulltext = $intro . ' ' . $body;
          $icount = substr_count($fulltext, $norm) + substr_count($fulltext, $left) + substr_count($fulltext, $right);
***************
*** 791,795 ****
                      $imgSrc = $_CONF['site_url'] . '/images/articles/' . $A['ai_filename'];
                  } else {
!                     $imgSrc = $_CONF['site_url'] . '/getimage.php?mode=articles&image=' . $A['ai_filename'];
                  }
                  $intro = str_replace($norm, $lLinkPrefix . '<img ' . $sizeattributes . 'src="' . $imgSrc . '" alt="">' . $lLinkSuffix, $intro);
--- 798,802 ----
                      $imgSrc = $_CONF['site_url'] . '/images/articles/' . $A['ai_filename'];
                  } else {
!                     $imgSrc = $_CONF['site_url'] . '/getimage.php?mode=articles&image=' . $A['ai_filename'];
                  }
                  $intro = str_replace($norm, $lLinkPrefix . '<img ' . $sizeattributes . 'src="' . $imgSrc . '" alt="">' . $lLinkSuffix, $intro);
***************
*** 864,869 ****
          exit;
      } elseif (!empty($title) && !empty($introtext)) {
!         $date = date("Y-m-d H:i:s",$unixdate);
!         $expire = date("Y-m-d H:i:s",$expiredate);
  
          if (empty($hits)) {
--- 871,876 ----
          exit;
      } elseif (!empty($title) && !empty($introtext)) {
!         $date = date ('Y-m-d H:i:s', $unixdate);
!         $expire = date ('Y-m-d H:i:s', $expiredate);
  
          if (empty($hits)) {
***************
*** 915,919 ****
  
          // Clean up the text
!         if ($postmode == "html") {
              $introtext = addslashes(COM_checkHTML(COM_checkWords($introtext)));
              $bodytext = addslashes(COM_checkHTML(COM_checkWords($bodytext)));
--- 922,926 ----
  
          // Clean up the text
!         if ($postmode == 'html') {
              $introtext = addslashes(COM_checkHTML(COM_checkWords($introtext)));
              $bodytext = addslashes(COM_checkHTML(COM_checkWords($bodytext)));




More information about the geeklog-cvs mailing list