Close Comments v0.1Created by: Nick Ramsay (longcountdown)
Created on: 2009/01/24
Requires: None
DescriptionAdds the ability to close the comment form on all or individual stories, displaying "The comment form is closed" instead.
InstructionsUpload the "close_comments" folder to your modules folder and enable it in Admin > Module Management.
You will need to make changes in the following files:
/admin/linkadmin.php:Find:
$main_smarty->assign('story',getmyurl('story', $link->link_id));
Below it, add this:
$vars=array('link' => $link, 'author' => $author);
check_actions('linkadmin_action_main', $vars);
/libs/comment.php:Find:
$smarty->assign('comment_form_label', $vars['comment_form_label]);
Below it, add this:
$vars=array('comment_form_status' => '');
check_actions('comment_form_status', $vars);
$smarty->assign('comment_form_status', $vars['comment_form_status]);
/templates/your_template/admin_templates/admin_comments_center.tpl:Find:
{php}
Global $db, $main_smarty, $rows, $offset;
do_pages($rows, 25, '');
{/php}
<br/>
Below it, add this:
{checkActionsTpl location=tpl_admin_comments_post_pagination"}
/templates/your_template/admin_templates/linkadmin_main.tpl:Find:
<b>{#PLIGG_Visual_Change_Link_Submitted_By#}:</b> {$user_login} <a href ="{$my_base_url}{$my_pligg_base}/admin/admin_users.php?mode=disable&user={$user_login}">{#PLIGG_Visual_Disable_This_USer#}</a><br />
Below it, add this:
{checkActionsTpl location=tpl_linkadmin_main_link_details"}
/templates/your_template/comment_show.tpl:Find:
{* display comment form if replying to a comment *}
<div class="comment-info">
.
.
.
</div>
Above it, add this:
{if $comment_form_status ne "closed"}
Below it, add this:
{/if} {* close comment_form_status if *}
/templates/your_template/story_center.tpl:Find:
{if $user_authenticated neq ""}
{include file=$the_template."/comment_form.tpl"}
{else}
.
.
.
{/if}
Above it, add this:
{if $comment_form_status ne "closed"}
Below it, add this:
{else}
{checkActionsTpl location=tpl_story_center_comment_form_closed"}
{/if}
Usage1. On any story, click Admin Links -> Admin: Change the status -> Close/Open comment form.
2. To close or open the comment form on all stories, go to Admin -> Comment Management and you will see the option at the bottom.
Revision Historyv0.1 2009/01/09 LongCountdown - First version.