[geeklog-cvs] geeklog-1.3/public_html article.php,1.34,1.35 comment.php,1.45,1.46 lib-common.php,1.259,1.260
geeklog-cvs-admin at lists.geeklog.net
geeklog-cvs-admin at lists.geeklog.net
Sun Sep 14 05:07:57 EDT 2003
Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory geeklog_prod:/tmp/cvs-serv21392/public_html
Modified Files:
article.php comment.php lib-common.php
Log Message:
Let Story Admins delete comments (bug #27).
Index: article.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/article.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** article.php 1 Jul 2003 15:03:44 -0000 1.34
--- article.php 14 Sep 2003 09:07:54 -0000 1.35
***************
*** 184,190 ****
// Display the comments, if there are any ..
if ($A['commentcode'] >= 0) {
$story_template->set_var ('commentbar',
COM_userComments ($story, $A['title'], 'article',
! $order, $mode));
}
$display .= $story_template->finish ($story_template->parse ('output', 'article'));
--- 184,191 ----
// Display the comments, if there are any ..
if ($A['commentcode'] >= 0) {
+ $delete_option = ($access == 3 ? true : false);
$story_template->set_var ('commentbar',
COM_userComments ($story, $A['title'], 'article',
! $order, $mode, $delete_option));
}
$display .= $story_template->finish ($story_template->parse ('output', 'article'));
Index: comment.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/comment.php,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** comment.php 17 Aug 2003 09:38:01 -0000 1.45
--- comment.php 14 Sep 2003 09:07:54 -0000 1.46
***************
*** 145,149 ****
$thecomments = COM_getComment ($HTTP_POST_VARS, 'flat', $type,
! 'ASC', true );
$start->set_var( 'comments', $thecomments );
--- 145,149 ----
$thecomments = COM_getComment ($HTTP_POST_VARS, 'flat', $type,
! 'ASC', false, true );
$start->set_var( 'comments', $thecomments );
Index: lib-common.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.259
retrieving revision 1.260
diff -C2 -d -r1.259 -r1.260
*** lib-common.php 13 Sep 2003 15:34:59 -0000 1.259
--- lib-common.php 14 Sep 2003 09:07:54 -0000 1.260
***************
*** 2523,2531 ****
* @param string $type Type of item (article, poll, etc.)
* @param string $order How to order the comments 'ASC' or 'DESC'
* @param boolean $preview Preview display (for edit) or not
* @return string HTML Formated Comment
*
*/
! function COM_getComment( $A, $mode, $type, $order, $preview = false )
{
global $_CONF, $_TABLES, $LANG01, $query;
--- 2523,2532 ----
* @param string $type Type of item (article, poll, etc.)
* @param string $order How to order the comments 'ASC' or 'DESC'
+ * @param boolean $delete_option if current user can delete comments
* @param boolean $preview Preview display (for edit) or not
* @return string HTML Formated Comment
*
*/
! function COM_getComment( $A, $mode, $type, $order, $delete_option = false, $preview = false )
{
global $_CONF, $_TABLES, $LANG01, $query;
***************
*** 2616,2621 ****
}
// NOTE: the following check is nonsense (but fully 1.3.8 compatible ;-)
! else if( SEC_hasAccess( $A['owner_id'], $A['group_id'], $A['perm_owner'],
! $A['perm_group'], $A['perm_members'], $A['perm_anon'] ) == 3 )
{
$template->set_var( 'delete_option', '| <a href="' . $_CONF['site_url']
--- 2617,2621 ----
}
// NOTE: the following check is nonsense (but fully 1.3.8 compatible ;-)
! else if( $delete_option )
{
$template->set_var( 'delete_option', '| <a href="' . $_CONF['site_url']
***************
*** 2670,2674 ****
while( $A = DB_fetchArray( $result ))
{
! $retval .= COM_getComment( $A, $mode, $type, $order );
}
--- 2670,2674 ----
while( $A = DB_fetchArray( $result ))
{
! $retval .= COM_getComment( $A, $mode, $type, $order, $delete_option );
}
***************
*** 2689,2693 ****
* @param string $order How to order the comments 'ASC' or 'DESC'
* @param string $mode comment mode (nested, flat, etc.)
! * @param int $pid Parent ID
* @see function COM_commentBar
* @see function COM_commentChildren
--- 2689,2693 ----
* @param string $order How to order the comments 'ASC' or 'DESC'
* @param string $mode comment mode (nested, flat, etc.)
! * @param boolean $delete_option if current user can delete comments
* @see function COM_commentBar
* @see function COM_commentChildren
***************
*** 2695,2699 ****
*
*/
! function COM_userComments( $sid, $title, $type='article', $order='', $mode='', $pid=0 )
{
global $_CONF, $_TABLES, $_USER, $LANG01;
--- 2695,2699 ----
*
*/
! function COM_userComments( $sid, $title, $type='article', $order='', $mode='', $delete_option = false )
{
global $_CONF, $_TABLES, $_USER, $LANG01;
***************
*** 2756,2760 ****
while ($A = DB_fetchArray( $result ))
{
! $thecomments .= COM_getComment( $A, $mode, $type, $order );
}
--- 2756,2761 ----
while ($A = DB_fetchArray( $result ))
{
! $thecomments .= COM_getComment( $A, $mode, $type, $order,
! $delete_option );
}
More information about the geeklog-cvs
mailing list