This is the archived version of my b2evolution code blog.
If you require any help regarding b2evolution then
visit it's support forums
You can find my current blogs here
Code : {@link : WafflesOn}
Personal : {@link : InnerVisions}
| « Control your children | 1.9beta skin changes » |
Posted on 26th Nov 2006 in : Hacks
This hack has now been replaced with a plugin
Backup any files that you play with first huh?
Find this bit of code :-
Code:
// Comment form: | |
if( $disp_comment_form && $Item->can_comment() ) | |
{ // We want to display the comments form and the item can be commented on: |
and replace it with this bit of code :-
Code:
if( is_logged_in() ) | |
{ | |
$Item->comment_status = 'open'; | |
} | |
else | |
{ | |
$Item->comment_status = 'closed'; | |
echo '<h4>Sorry, you need to be a registered member to leave a comment</h4>'; | |
} | |
| |
| |
| |
// Comment form: | |
if( $disp_comment_form && $Item->can_comment( NULL) ) | |
{ // We want to display the comments form and the item can be commented on: |
Find this bit of code :-
Code:
// Getting GET or POST parameters: | |
param( 'comment_post_ID', 'integer', true ); // required | |
| |
$commented_Item = & $ItemCache->get_by_ID( $comment_post_ID ); | |
| |
if( ! $commented_Item->can_comment( NULL ) ) | |
{ | |
$Messages->add( T_('You cannot leave comments on this post!'), 'error' ); | |
} |
and replace it with this :-
Code:
// Getting GET or POST parameters: | |
param( 'comment_post_ID', 'integer', true ); // required | |
| |
$commented_Item = & $ItemCache->get_by_ID( $comment_post_ID ); | |
| |
if( is_logged_in() ) | |
{ | |
$commented_Item->comment_status = 'open'; | |
} | |
else | |
{ | |
$commented_Item->comment_status = 'closed'; | |
} | |
| |
if( ! $commented_Item->can_comment( NULL ) ) | |
{ | |
$Messages->add( T_('Sorry, you need to be a registered member to leave a comment'), 'error' ); | |
} |
Find this line (approx 456 in 1.9beta and line 402 in 1.8.5 and probably somewhere in the 400's for other versions) and change the open to closed
Code:
if( $Request->param( 'post_comment_status', 'string', 'closed' ) !== NULL ) |
¥
Page archived : 11th Nov 2009