[geeklog-cvs] Geeklog-1.x/public_html lib-common.php,1.722,1.723

Michael Jervis mjervis at qs1489.pair.com
Sat Aug 16 13:44:31 EDT 2008


Update of /cvsroot/geeklog/Geeklog-1.x/public_html
In directory qs1489.pair.com:/tmp/cvs-serv98409/public_html

Modified Files:
	lib-common.php 
Log Message:
Bug 0000698, right blocks called twice.

Index: lib-common.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/lib-common.php,v
retrieving revision 1.722
retrieving revision 1.723
diff -C2 -d -r1.722 -r1.723
*** lib-common.php	14 Aug 2008 15:14:45 -0000	1.722
--- lib-common.php	16 Aug 2008 17:44:29 -0000	1.723
***************
*** 1276,1295 ****
      global $_CONF, $_TABLES, $LANG01, $_PAGE_TIMER, $topic, $LANG_BUTTONS;
  
-     // use the right blocks here only if not in header already
-     if ($_CONF['right_blocks_in_footer'] == 1)
-     {
-         if( $rightblock < 0)
-         {
-             if( isset( $_CONF['show_right_blocks'] ))
-             {
-                 $rightblock = $_CONF['show_right_blocks'];
-             }
-             else
-             {
-                 $rightblock = false;
-             }
-         }
-     }
- 
      // If the theme implemented this for us then call their version instead.
  
--- 1276,1279 ----
***************
*** 1353,1410 ****
      $footer->set_var( 'button_directory', $LANG_BUTTONS[11] );
  
!     /* Check if an array has been passed that includes the name of a plugin
!      * function or custom function.
!      * This can be used to take control over what blocks are then displayed
       */
!     if( is_array( $custom ))
      {
!         $function = $custom['0'];
!         if( function_exists( $function ))
          {
!             $rblocks = $function( $custom['1'], 'right' );
          }
      }
!     elseif( $rightblock )
!     {
!         $rblocks = COM_showBlocks( 'right', $topic );
!     }
! 
!     if( $_CONF['left_blocks_in_footer'] == 1 )
      {
-         $lblocks = '';
- 
          /* Check if an array has been passed that includes the name of a plugin
!          * function or custom function
           * This can be used to take control over what blocks are then displayed
           */
          if( is_array( $custom ))
          {
!             $function = $custom[0];
              if( function_exists( $function ))
              {
!                 $lblocks = $function( $custom[1], 'left' );
              }
          }
!         else
!         {
!             $lblocks = COM_showBlocks( 'left', $topic );
!         }
! 
!         if( empty( $lblocks ))
          {
-             $footer->set_var( 'left_blocks', '' );
              $footer->set_var( 'geeklog_blocks', '');
!         }
!         else
!         {
!             $footer->set_var( 'geeklog_blocks', $lblocks);
!             $footer->parse( 'left_blocks', 'leftblocks', true );
              $footer->set_var( 'geeklog_blocks', '');
          }
      }
  
!     if( $_CONF['right_blocks_in_footer'] == 1 && $rightblock)
      {
!         $rblocks = '';
  
          /* Check if an array has been passed that includes the name of a plugin
--- 1337,1409 ----
      $footer->set_var( 'button_directory', $LANG_BUTTONS[11] );
  
!     /* Right blocks. Argh. Don't talk to me about right blocks...
!      * Right blocks will be displayed if Right_blocks_in_footer is set [1],
!      * AND (this function has been asked to show them (first param) OR the
!      * show_right_blocks conf variable has been set to override what the code
!      * wants to do.
!      *
!      * If $custom sets an array (containing functionname and first argument)
!      * then this is used instead of the default (COM_showBlocks) to render
!      * the right blocks (and left).
!      *
!      * [1] - if it isn't, they'll be in the header already.
!      *
       */
!     $displayRightBlocks = true;
!     if ($_CONF['right_blocks_in_footer'] == 1)
      {
!         if( $rightblock < 0)
          {
!             if( isset( $_CONF['show_right_blocks'] ) )
!             {
!                 $displayRightBlocks = $_CONF['show_right_blocks'];
!             }
!             else
!             {
!                 $displayRightBlocks = false;
!             }
!         } else {
!             $displayRightBlocks = true;
          }
+     } else {
+         $displayRightBlocks = false;
      }
!     
!     if ($displayRightBlocks)
      {
          /* Check if an array has been passed that includes the name of a plugin
!          * function or custom function.
           * This can be used to take control over what blocks are then displayed
           */
          if( is_array( $custom ))
          {
!             $function = $custom['0'];
              if( function_exists( $function ))
              {
!                 $rblocks = $function( $custom['1'], 'right' );
!             } else {
!                 $rblocks = COM_showBlocks( 'right', $topic );
              }
+         } else {
+             $rblocks = COM_showBlocks( 'right', $topic );
          }
!         
!         if( empty( $rblocks ))
          {
              $footer->set_var( 'geeklog_blocks', '');
!             $footer->set_var( 'right_blocks', '' );
!         } else {
!             $footer->set_var( 'geeklog_blocks', $rblocks);
!             $footer->parse( 'right_blocks', 'rightblocks', true );
              $footer->set_var( 'geeklog_blocks', '');
          }
+     } else {
+         $footer->set_var( 'geeklog_blocks', '');
+         $footer->set_var( 'right_blocks', '' );
      }
  
!     if( $_CONF['left_blocks_in_footer'] == 1 )
      {
!         $lblocks = '';
  
          /* Check if an array has been passed that includes the name of a plugin
***************
*** 1412,1442 ****
           * This can be used to take control over what blocks are then displayed
           */
!         if( isset( $what) && is_array( $what ))
          {
!             $function = $what[0];
              if( function_exists( $function ))
              {
!                 $rblocks = $function( $what[1], 'right' );
!             }
!             else
!             {
!                 $rblocks = COM_showBlocks( 'right', $topic );
              }
          }
!         else if( !isset( $what ) || ( $what <> 'none' ))
          {
!             // Now show any blocks -- need to get the topic if not on home page
!             $rblocks = COM_showBlocks( 'right', $topic );
          }
  
!         if( empty( $rblocks ))
          {
              $footer->set_var( 'geeklog_blocks', '');
-             $footer->set_var( 'right_blocks', '' );
          }
          else
          {
!             $footer->set_var( 'geeklog_blocks', $rblocks);
!             $footer->parse( 'right_blocks', 'rightblocks', true );
              $footer->set_var( 'geeklog_blocks', '');
          }
--- 1411,1436 ----
           * This can be used to take control over what blocks are then displayed
           */
!         if( is_array( $custom ))
          {
!             $function = $custom[0];
              if( function_exists( $function ))
              {
!                 $lblocks = $function( $custom[1], 'left' );
              }
          }
!         else
          {
!             $lblocks = COM_showBlocks( 'left', $topic );
          }
  
!         if( empty( $lblocks ))
          {
+             $footer->set_var( 'left_blocks', '' );
              $footer->set_var( 'geeklog_blocks', '');
          }
          else
          {
!             $footer->set_var( 'geeklog_blocks', $lblocks);
!             $footer->parse( 'left_blocks', 'leftblocks', true );
              $footer->set_var( 'geeklog_blocks', '');
          }




More information about the geeklog-cvs mailing list