[geeklog-cvs] geeklog-1.3/public_html/admin story.php,1.105,1.106

geeklog-cvs-admin at lists.geeklog.net geeklog-cvs-admin at lists.geeklog.net
Thu Sep 11 15:06:33 EDT 2003


Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin
In directory geeklog_prod:/tmp/cvs-serv12251

Modified Files:
	story.php 
Log Message:
Avoid SELECT *


Index: story.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/story.php,v
retrieving revision 1.105
retrieving revision 1.106
diff -C2 -d -r1.105 -r1.106
*** story.php	7 Sep 2003 17:41:40 -0000	1.105
--- story.php	11 Sep 2003 19:06:30 -0000	1.106
***************
*** 582,588 ****
  function replace_images($sid, $intro, $body)
  {
!     global $_TABLES, $_CONF, $LANG24;
!     
!     $result = DB_query("SELECT * FROM {$_TABLES['article_images']} WHERE ai_sid = '$sid' ORDER BY ai_img_num");
      $nrows = DB_numRows($result);
      for ($i = 1; $i <= $nrows; $i++) {
--- 582,588 ----
  function replace_images($sid, $intro, $body)
  {
!     global $_CONF, $_TABLES, $LANG24;
! 
!     $result = DB_query("SELECT ai_filename FROM {$_TABLES['article_images']} WHERE ai_sid = '$sid' ORDER BY ai_img_num");
      $nrows = DB_numRows($result);
      for ($i = 1; $i <= $nrows; $i++) {
***************
*** 623,632 ****
          $body = str_replace($right, '[' . $LANG24[48] . $i . '_' . $LANG24[49] . ']', $body);
      }
      return array($intro, $body);
  }
!     
  /**
! * Replaces simple image syntax with actual HTML in the intro and body.  If errors occur
! * it will return all errors in $error
  *
  * @param    string      $sid    ID for story to parse
--- 623,633 ----
          $body = str_replace($right, '[' . $LANG24[48] . $i . '_' . $LANG24[49] . ']', $body);
      }
+ 
      return array($intro, $body);
  }
! 
  /**
! * Replaces simple image syntax with actual HTML in the intro and body.
! * If errors occur it will return all errors in $error
  *
  * @param    string      $sid    ID for story to parse
***************
*** 638,647 ****
  function insert_images($sid, $intro, $body)
  {
!     global $_TABLES, $_CONF, $LANG24;
!     
!     $result = DB_query("SELECT * FROM {$_TABLES['article_images']} WHERE ai_sid = '$sid' ORDER BY ai_img_num");
      $nrows = DB_numRows($result);
      $errors = array();
!     
      for ($i = 1; $i <= $nrows; $i++) {
          $A = DB_fetchArray($result);
--- 639,648 ----
  function insert_images($sid, $intro, $body)
  {
!     global $_CONF, $_TABLES, $LANG24;
! 
!     $result = DB_query("SELECT ai_filename FROM {$_TABLES['article_images']} WHERE ai_sid = '$sid' ORDER BY ai_img_num");
      $nrows = DB_numRows($result);
      $errors = array();
! 
      for ($i = 1; $i <= $nrows; $i++) {
          $A = DB_fetchArray($result);





More information about the geeklog-cvs mailing list