Hide Comments from Anon
Re: Hide Comments from Anon
Posted:Mon 07 of Dec, 2009 (18:51 UTC)While far from a perfect solution; I have fixed this.
Editing: bitweaver / wiki / display_bitpage_inc.php
This works but leaves a blank Comments title for anon users.
Original
// Comments engine! if( $gBitSystem->isFeatureActive( 'wiki_comments' )) { $comments_vars = array( 'page' ); $comments_prefix_var = 'wiki page:'; $comments_object_var = 'page'; $commentsParentId = $gContent->mContentId; $comments_return_url = WIKI_PKG_URL.'index.php?page_id='.$gContent->mPageId; # Support displaying comments on their own page instead of on content page if( isset( $_REQUEST["comments_page"] ) && ( $_REQUEST["comments_page"] == '1' ) || !empty( $_REQUEST['view_comment_id'] )) { $gBitSmarty->assign( 'comments_page', 1 ); $comments_on_separate_page = 1; $comments_return_url = WIKI_PKG_URL.'index.php?page_id='.$gContent->mPageId.'&comments_page=1'; if ( !empty($_REQUEST['view_comment_id']) ) { $comments_return_url .= '&comments_maxComments=1'; } } include_once( LIBERTY_PKG_PATH.'comments_inc.php' ); }
Modified
// Comments engine! if( $gBitUser->hasPermission( 'p_liberty_read_comments' ) ) { if( $gBitSystem->isFeatureActive( 'wiki_comments' )) { $comments_vars = array( 'page' ); $comments_prefix_var = 'wiki page:'; $comments_object_var = 'page'; $commentsParentId = $gContent->mContentId; $comments_return_url = WIKI_PKG_URL.'index.php?page_id='.$gContent->mPageId; # Support displaying comments on their own page instead of on content page if( isset( $_REQUEST["comments_page"] ) && ( $_REQUEST["comments_page"] == '1' ) || !empty( $_REQUEST['view_comment_id'] )) { $gBitSmarty->assign( 'comments_page', 1 ); $comments_on_separate_page = 1; $comments_return_url = WIKI_PKG_URL.'index.php?page_id='.$gContent->mPageId.'&comments_page=1'; if ( !empty($_REQUEST['view_comment_id']) ) { $comments_return_url .= '&comments_maxComments=1'; } } include_once( LIBERTY_PKG_PATH.'comments_inc.php' ); } }