[geeklog-cvs] Geeklog-1.x/system/classes story.class.php, 1.11, 1.12

Oliver ospiess at qs1489.pair.com
Thu Aug 9 03:58:23 EDT 2007


Update of /usr/home/geeklog2/cvsroot/geeklog/Geeklog-1.x/system/classes
In directory qs1489.pair.com:/tmp/cvs-serv37264/classes

Modified Files:
	story.class.php 
Log Message:
float images left and right instead of align="left" so they can be specifically aditionally formatted with CSS and a layout switch can change the floating

Index: story.class.php
===================================================================
RCS file: /usr/home/geeklog2/cvsroot/geeklog/Geeklog-1.x/system/classes/story.class.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** story.class.php	30 Apr 2007 19:20:41 -0000	1.11
--- story.class.php	9 Aug 2007 07:58:21 -0000	1.12
***************
*** 710,714 ****
              return STORY_NO_ACCESS_PARAMS;
          }
!         
          /* Load up the topic name and icon */
          $topic = DB_Query("SELECT topic, imageurl FROM {$_TABLES['topics']} WHERE tid='{$this->_tid}'");
--- 710,714 ----
              return STORY_NO_ACCESS_PARAMS;
          }
! 
          /* Load up the topic name and icon */
          $topic = DB_Query("SELECT topic, imageurl FROM {$_TABLES['topics']} WHERE tid='{$this->_tid}'");
***************
*** 857,861 ****
          $tmptid = addslashes(COM_sanitizeID($this->_tid));
  
!         $result = DB_query('SELECT group_id,perm_owner,perm_group,perm_members,perm_anon FROM ' . 
                              "{$_TABLES['topics']} WHERE tid = '{$tmptid}'" .
                              COM_getTopicSQL('AND'));
--- 857,861 ----
          $tmptid = addslashes(COM_sanitizeID($this->_tid));
  
!         $result = DB_query('SELECT group_id,perm_owner,perm_group,perm_members,perm_anon FROM ' .
                              "{$_TABLES['topics']} WHERE tid = '{$tmptid}'" .
                              COM_getTopicSQL('AND'));
***************
*** 925,929 ****
      {
          global $_CONF, $_TABLES, $LANG24;
!         
          // Grab member vars into locals:
          $intro = $this->_introtext;
--- 925,929 ----
      {
          global $_CONF, $_TABLES, $LANG24;
! 
          // Grab member vars into locals:
          $intro = $this->_introtext;
***************
*** 972,978 ****
                  // are used, so we will then go and replace them
                  if (count($errors) == 0) {
!                     
                      $imgpath = '';
!                     
                      // If we are storing images on a "standard path" i.e. is
                      // available to the host web server, then the url to this
--- 972,978 ----
                  // are used, so we will then go and replace them
                  if (count($errors) == 0) {
! 
                      $imgpath = '';
! 
                      // If we are storing images on a "standard path" i.e. is
                      // available to the host web server, then the url to this
***************
*** 989,999 ****
                          $imgSrc = $_CONF['site_url'] . '/getimage.php?mode=articles&image=' . $A['ai_filename'];
                      }
!                     
                      // Build image tags for each flavour of the image:
                      $img_noalign = '<img ' . $sizeattributes . 'src="' . $imgSrc . '" alt="">';
!                     $img_leftalgn = '<img ' . $sizeattributes . 'align="left" src="' . $imgSrc . '" alt="">';
!                     $img_rightalgn = '<img ' . $sizeattributes . 'align="right" src="' . $imgSrc . '" alt="">';
!                     
!                     
                      // Are we keeping unscaled images?
                      if ($_CONF['keep_unscaled_image'] == 1) {
--- 989,999 ----
                          $imgSrc = $_CONF['site_url'] . '/getimage.php?mode=articles&image=' . $A['ai_filename'];
                      }
! 
                      // Build image tags for each flavour of the image:
                      $img_noalign = '<img ' . $sizeattributes . 'src="' . $imgSrc . '" alt="">';
!                     $img_leftalgn = '<img ' . $sizeattributes . 'class="floatleft" src="' . $imgSrc . '" alt="">';
!                     $img_rightalgn = '<img ' . $sizeattributes . 'class="floatright" src="' . $imgSrc . '" alt="">';
! 
! 
                      // Are we keeping unscaled images?
                      if ($_CONF['keep_unscaled_image'] == 1) {
***************
*** 1004,1008 ****
                          $lFilename_large_complete = $_CONF['path_images'] . 'articles/' .
                                                          $lFilename_large;
!                         
                          // We need to map that filename to the right location
                          // or the fetch script:
--- 1004,1008 ----
                          $lFilename_large_complete = $_CONF['path_images'] . 'articles/' .
                                                          $lFilename_large;
! 
                          // We need to map that filename to the right location
                          // or the fetch script:
***************
*** 1015,1024 ****
                                                      $lFilename_large;
                          }
!                         
                          // And finally, replace the [imagex_mode] tags with the image and it's
                          // hyperlink:
                          $lLink_url = $lFilename_large_URL;
                          $lLink_attr = array('title' => $LANG24[57]);
!     
                          $intro = str_replace($norm,  COM_createLink($img_noalign,   $lLink_url, $lLink_attr), $intro);
                          $body  = str_replace($norm,  COM_createLink($img_noalign,   $lLink_url, $lLink_attr), $body);
--- 1015,1024 ----
                                                      $lFilename_large;
                          }
! 
                          // And finally, replace the [imagex_mode] tags with the image and it's
                          // hyperlink:
                          $lLink_url = $lFilename_large_URL;
                          $lLink_attr = array('title' => $LANG24[57]);
! 
                          $intro = str_replace($norm,  COM_createLink($img_noalign,   $lLink_url, $lLink_attr), $intro);
                          $body  = str_replace($norm,  COM_createLink($img_noalign,   $lLink_url, $lLink_attr), $body);
***************
*** 1026,1030 ****
                          $body  = str_replace($left,  COM_createLink($img_leftalgn,  $lLink_url, $lLink_attr), $body);
                          $intro = str_replace($right, COM_createLink($img_rightalgn, $lLink_url, $lLink_attr), $intro);
!                         $body  = str_replace($right, COM_createLink($img_rightalgn, $lLink_url, $lLink_attr), $body);                        
                      } else {
                          // We aren't wrapping our image tags in hyperlinks, so
--- 1026,1030 ----
                          $body  = str_replace($left,  COM_createLink($img_leftalgn,  $lLink_url, $lLink_attr), $body);
                          $intro = str_replace($right, COM_createLink($img_rightalgn, $lLink_url, $lLink_attr), $intro);
!                         $body  = str_replace($right, COM_createLink($img_rightalgn, $lLink_url, $lLink_attr), $body);
                      } else {
                          // We aren't wrapping our image tags in hyperlinks, so
***************
*** 1035,1039 ****
                          $body  = str_replace($left,  $img_leftalgn,  $body);
                          $intro = str_replace($right, $img_rightalgn, $intro);
!                         $body  = str_replace($right, $img_rightalgn, $body); 
                      }
  
--- 1035,1039 ----
                          $body  = str_replace($left,  $img_leftalgn,  $body);
                          $intro = str_replace($right, $img_rightalgn, $intro);
!                         $body  = str_replace($right, $img_rightalgn, $body);
                      }
  
***************
*** 1061,1065 ****
              }
          }
!         
          $this->_introtext = $intro;
          $this->_bodytext  = $body;
--- 1061,1065 ----
              }
          }
! 
          $this->_introtext = $intro;
          $this->_bodytext  = $body;
***************
*** 1105,1127 ****
              $count = count($this->_storyImages);
          }
!         
          // If the article has any images, remove them back to [image] tags.
          for ($i = 0; $i < $count; $i++) {
              $A = $this->_storyImages[$i];
!             
              $imageX = '[image' . ($i + 1) . ']';
              $imageX_left = '[image' . ($i + 1) . '_left]';
              $imageX_right = '[image' . ($i + 1) . '_right]';
!         
              $sizeattributes = COM_getImgSizeAttributes($_CONF['path_images'] . 'articles/' . $A['ai_filename']);
!         
              $lLinkPrefix = '';
              $lLinkSuffix = '';
!         
              if ($_CONF['keep_unscaled_image'] == 1) {
                  $lFilename_large = substr_replace($A['ai_filename'],
                  '_original.', strrpos($A['ai_filename'], '.'), 1);
                  $lFilename_large_complete = $_CONF['path_images'] . 'articles/' . $lFilename_large;
!         
                  if ($stdImageLoc) {
                      $imgpath = substr($_CONF['path_images'], strlen($_CONF['path_html']));
--- 1105,1127 ----
              $count = count($this->_storyImages);
          }
! 
          // If the article has any images, remove them back to [image] tags.
          for ($i = 0; $i < $count; $i++) {
              $A = $this->_storyImages[$i];
! 
              $imageX = '[image' . ($i + 1) . ']';
              $imageX_left = '[image' . ($i + 1) . '_left]';
              $imageX_right = '[image' . ($i + 1) . '_right]';
! 
              $sizeattributes = COM_getImgSizeAttributes($_CONF['path_images'] . 'articles/' . $A['ai_filename']);
! 
              $lLinkPrefix = '';
              $lLinkSuffix = '';
! 
              if ($_CONF['keep_unscaled_image'] == 1) {
                  $lFilename_large = substr_replace($A['ai_filename'],
                  '_original.', strrpos($A['ai_filename'], '.'), 1);
                  $lFilename_large_complete = $_CONF['path_images'] . 'articles/' . $lFilename_large;
! 
                  if ($stdImageLoc) {
                      $imgpath = substr($_CONF['path_images'], strlen($_CONF['path_html']));
***************
*** 1131,1135 ****
                                             . $lFilename_large;
                  }
!         
                  if (file_exists($lFilename_large_complete)) {
                      $lLinkPrefix = '<a href="' . $lFilename_large_URL . '" title="' . $LANG24[57] . '">';
--- 1131,1135 ----
                                             . $lFilename_large;
                  }
! 
                  if (file_exists($lFilename_large_complete)) {
                      $lLinkPrefix = '<a href="' . $lFilename_large_URL . '" title="' . $LANG24[57] . '">';
***************
*** 1146,1154 ****
  
              $norm = $lLinkPrefix . '<img ' . $sizeattributes . 'src="' . $imgSrc . '" alt="">' . $lLinkSuffix;
!             $left = $lLinkPrefix . '<img ' . $sizeattributes . 'align="left" src="' . $imgSrc . '" alt="">'
                      . $lLinkSuffix;
!             $right = $lLinkPrefix . '<img ' . $sizeattributes . 'align="right" src="' . $imgSrc . '" alt="">'
                      . $lLinkSuffix;
!                     
              $text = str_replace($norm, $imageX, $text);
              $text = str_replace($left, $imageX_left, $text);
--- 1146,1154 ----
  
              $norm = $lLinkPrefix . '<img ' . $sizeattributes . 'src="' . $imgSrc . '" alt="">' . $lLinkSuffix;
!             $left = $lLinkPrefix . '<img ' . $sizeattributes . 'class="floatleft" src="' . $imgSrc . '" alt="">'
                      . $lLinkSuffix;
!             $right = $lLinkPrefix . '<img ' . $sizeattributes . 'class="floatright" src="' . $imgSrc . '" alt="">'
                      . $lLinkSuffix;
! 
              $text = str_replace($norm, $imageX, $text);
              $text = str_replace($left, $imageX_left, $text);
***************
*** 1524,1528 ****
  
          $out = $this->replaceImages($in);
!         
          if ($this->_postmode == 'plaintext') {
              $out = COM_undoClickableLinks($out);
--- 1524,1528 ----
  
          $out = $this->replaceImages($in);
! 
          if ($this->_postmode == 'plaintext') {
              $out = COM_undoClickableLinks($out);




More information about the geeklog-cvs mailing list