Posted 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 ) |
¥
Trackback URL (right click and copy shortcut/link location)
Trackback url for this post
Note : This trackback url is time limited so use it within 30 minutes or the SpamHound will snarl at you.
http://waffleson.co.uk/z/?k=31722602633103238c2f04e57ab22033560efe23ca731e4be
Posts : 845
Joined : 10/05/05
Comments are closed for this post.
Posts : 2
Joined : 11/26/06