[geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.322,1.323

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Sat May 15 12:11:30 EDT 2004


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

Modified Files:
	lib-common.php 
Log Message:
Hide 'Reply to This' link in comments from anonymous users if they can't post replies.


Index: lib-common.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.322
retrieving revision 1.323
diff -C2 -d -r1.322 -r1.323
*** lib-common.php	13 May 2004 18:50:55 -0000	1.322
--- lib-common.php	15 May 2004 16:11:26 -0000	1.323
***************
*** 2710,2715 ****
  function COM_getComment( &$comments, $mode, $type, $order, $delete_option = false, $preview = false )
  {
!     global $_CONF, $_TABLES, $LANG01, $query;
!     
      $indent = 0;  // begin with 0 indent
      $level = array(); // used to track depth
--- 2710,2715 ----
  function COM_getComment( &$comments, $mode, $type, $order, $delete_option = false, $preview = false )
  {
!     global $_CONF, $_TABLES, $_USER, $LANG01, $query;
! 
      $indent = 0;  // begin with 0 indent
      $level = array(); // used to track depth
***************
*** 2719,2723 ****
      $template->set_file( array( 'comment' => 'comment.thtml',
                                  'thread'  => 'thread.thtml'  ));
!                                 
      // generic template variables
      $template->set_var( 'site_url', $_CONF['site_url'] );
--- 2719,2723 ----
      $template->set_file( array( 'comment' => 'comment.thtml',
                                  'thread'  => 'thread.thtml'  ));
! 
      // generic template variables
      $template->set_var( 'site_url', $_CONF['site_url'] );
***************
*** 2728,2732 ****
      $template->set_var( 'lang_on', $LANG01[36] );
      $template->set_var( 'order', $order );    
!     
      // Make sure we have a default value for comment indentation
      if( !isset( $_CONF['comment_indent'] ))
--- 2728,2732 ----
      $template->set_var( 'lang_on', $LANG01[36] );
      $template->set_var( 'order', $order );    
! 
      // Make sure we have a default value for comment indentation
      if( !isset( $_CONF['comment_indent'] ))
***************
*** 2734,2738 ****
          $_CONF['comment_indent'] = 25;
      }
!     
      if ( $preview )
      {
--- 2734,2738 ----
          $_CONF['comment_indent'] = 25;
      }
! 
      if ( $preview )
      {
***************
*** 2744,2753 ****
          $A = DB_fetchArray($comments);
      }
!     
      if ( empty( $A ) )
      {
          return '';
      }
!     
      do
      {
--- 2744,2753 ----
          $A = DB_fetchArray($comments);
      }
! 
      if ( empty( $A ) )
      {
          return '';
      }
! 
      do
      {
***************
*** 2757,2766 ****
              $indent = ($A['indent'] - $A['pindent']) * $_CONF['comment_indent'];
          }
!         
          // comment variables
          $template->set_var( 'indent', $indent );
          $template->set_var( 'author', $A['username'] );
          $template->set_var( 'author_id', $A['uid'] );
!         
          if( $A['uid'] > 1 )
          {
--- 2757,2766 ----
              $indent = ($A['indent'] - $A['pindent']) * $_CONF['comment_indent'];
          }
! 
          // comment variables
          $template->set_var( 'indent', $indent );
          $template->set_var( 'author', $A['username'] );
          $template->set_var( 'author_id', $A['uid'] );
! 
          if( $A['uid'] > 1 )
          {
***************
*** 2775,2779 ****
                  $alttext = $A['fullname'];
              }
!             
              if( !empty( $A['photo'] ))
              {
--- 2775,2779 ----
                  $alttext = $A['fullname'];
              }
! 
              if( !empty( $A['photo'] ))
              {
***************
*** 2787,2791 ****
                  $template->set_var( 'author_photo', '' );
              }
!             
              $template->set_var( 'start_author_anchortag', '<a href="'
                      . $_CONF['site_url'] . '/users.php?mode=profile&uid='
--- 2787,2791 ----
                  $template->set_var( 'author_photo', '' );
              }
! 
              $template->set_var( 'start_author_anchortag', '<a href="'
                      . $_CONF['site_url'] . '/users.php?mode=profile&uid='
***************
*** 2800,2806 ****
              $template->set_var( 'end_author_anchortag', '' );
          }
!     
          // this will hide HTML that should not be viewed in preview mode
!         if( $preview )
          {
              $template->set_var( 'hide_if_preview', 'style="display:none"' );
--- 2800,2813 ----
              $template->set_var( 'end_author_anchortag', '' );
          }
! 
!         // hide reply link from anonymous users if they can't post replies
!         $hidefromanon = false;
!         if( empty( $_USER['username'] ) && (( $_CONF['loginrequired'] == 1 ) || ( $_CONF['commentsloginrequired'] == 1 )))
!         {
!             $hidefromanon = true;
!         }
! 
          // this will hide HTML that should not be viewed in preview mode
!         if( $preview || $hidefromanon )
          {
              $template->set_var( 'hide_if_preview', 'style="display:none"' );
***************
*** 2810,2814 ****
              $template->set_var( 'hide_if_preview', '' );
          }
!     
          // for threaded mode, add a link to comment parent
          if( $mode == 'threaded' && $A['pid'] != 0 )
--- 2817,2821 ----
              $template->set_var( 'hide_if_preview', '' );
          }
! 
          // for threaded mode, add a link to comment parent
          if( $mode == 'threaded' && $A['pid'] != 0 )
***************
*** 2818,2822 ****
              $plink = $_CONF['site_url'] . '/comment.php?mode=display&sid='
                     . $A['sid'] . '&title=' . rawurlencode( $P['title'] )
!                    . '&type=' . $type . '&order=' . $order . '&pid=' 
                     . $P['pid'];
              $template->set_var( 'parent_link', "| <a href=\"$plink\">{$LANG01[44]}</a>");
--- 2825,2829 ----
              $plink = $_CONF['site_url'] . '/comment.php?mode=display&sid='
                     . $A['sid'] . '&title=' . rawurlencode( $P['title'] )
!                    . '&type=' . $type . '&order=' . $order . '&pid='
                     . $P['pid'];
              $template->set_var( 'parent_link', "| <a href=\"$plink\">{$LANG01[44]}</a>");
***************
*** 2826,2830 ****
              $template->set_var( 'parent_link', '');
          }
!     
          $template->set_var( 'date', strftime( $_CONF['date'], $A['nice_date'] ));
          $template->set_var( 'sid', $A['sid'] );
--- 2833,2837 ----
              $template->set_var( 'parent_link', '');
          }
! 
          $template->set_var( 'date', strftime( $_CONF['date'], $A['nice_date'] ));
          $template->set_var( 'sid', $A['sid'] );
***************
*** 2868,2872 ****
              $A['comment'] = nl2br( COM_makeClickableLinks( $A['comment'] ));
          }
!     
          // highlight search terms if specified
          if( !empty( $query ))
--- 2875,2879 ----
              $A['comment'] = nl2br( COM_makeClickableLinks( $A['comment'] ));
          }
! 
          // highlight search terms if specified
          if( !empty( $query ))
***************
*** 2879,2883 ****
              }
          }
!         
          $A['comment'] = str_replace( '$', '$', $A['comment'] );
          $A['comment'] = str_replace( '{', '{', $A['comment'] );
--- 2886,2890 ----
              }
          }
! 
          $A['comment'] = str_replace( '$', '$', $A['comment'] );
          $A['comment'] = str_replace( '{', '{', $A['comment'] );
***************
*** 2899,2903 ****
          }
      } while ($A = DB_fetchArray($comments));
!     
      return $retval;
  }
--- 2906,2910 ----
          }
      } while ($A = DB_fetchArray($comments));
! 
      return $retval;
  }




More information about the geeklog-cvs mailing list