[geeklog-cvs] geeklog-1.3/public_html comment.php,1.75,1.76

vinny at iowaoutdoors.org vinny at iowaoutdoors.org
Sat Sep 25 16:08:18 EDT 2004


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

Modified Files:
	comment.php 
Log Message:
Added ability for admin's to delete comments from the view and display
modes of comment.php. Note that this will only work for polls and stories
as must independently determine if a user has permission to delete comments.
A additional plugin function may be a good idea...


Index: comment.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/comment.php,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -d -r1.75 -r1.76
*** comment.php	3 Sep 2004 19:59:56 -0000	1.75
--- comment.php	25 Sep 2004 20:08:16 -0000	1.76
***************
*** 738,749 ****
                      $format = DB_getItem( $_TABLES['usercomment'], 'commentmode', 
                                            "uid = {$_USER['uid']}" );
!                 }
!                 if ( empty($format) || $_USER['uid'] <= 1 ) {
                      $format = $_CONF['comment_mode'];
                  }
              }
              $display .= COM_userComments ($sid, $title, $type, 
                              COM_applyFilter ($_REQUEST['order']), $format, $cid,
!                             COM_applyFilter ($_REQUEST['page'], true), true);
          } else {
              $display .= COM_startBlock ($LANG_ACCESS['accessdenied'], '',
--- 738,752 ----
                      $format = DB_getItem( $_TABLES['usercomment'], 'commentmode', 
                                            "uid = {$_USER['uid']}" );
!                 } else {
                      $format = $_CONF['comment_mode'];
                  }
              }
+             $delete_option = ( SEC_hasRights( 'story.edit' ) &&
+                 SEC_hasAccess( $A['owner_id'], $A['group_id'],
+                 $A['perm_owner'], $A['perm_group'], $A['perm_members'],
+                 $A['perm_anon'] ) == 3 ? true : false );
              $display .= COM_userComments ($sid, $title, $type, 
                              COM_applyFilter ($_REQUEST['order']), $format, $cid,
!                             COM_applyFilter ($_REQUEST['page'], true), true, $delete_option);
          } else {
              $display .= COM_startBlock ($LANG_ACCESS['accessdenied'], '',
***************
*** 782,788 ****
                  $format = 'threaded';
              }
              $display .= COM_userComments ($sid, $title, $type,
                      COM_applyFilter ($_REQUEST['order']), $format, $pid,
!                     COM_applyFilter ($_REQUEST['page'], true));
          } else {
              $display .= COM_startBlock ($LANG_ACCESS['accessdenied'], '',
--- 785,795 ----
                  $format = 'threaded';
              }
+             $delete_option = ( SEC_hasRights( 'story.edit' ) &&
+                 SEC_hasAccess( $A['owner_id'], $A['group_id'],
+                 $A['perm_owner'], $A['perm_group'], $A['perm_members'],
+                 $A['perm_anon'] ) == 3 ? true : false );
              $display .= COM_userComments ($sid, $title, $type,
                      COM_applyFilter ($_REQUEST['order']), $format, $pid,
!                     COM_applyFilter ($_REQUEST['page'], true), false, $delete_option);
          } else {
              $display .= COM_startBlock ($LANG_ACCESS['accessdenied'], '',




More information about the geeklog-cvs mailing list