Social Web CMS
February 09, 2010, 06:42:04 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: For the latest news and updates, please follow us on Twitter! http://twitter.com/HotaruCMS
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Close Comments Module v.0.1  (Read 1098 times)
Nick
Administrator
Hero Member
*****
Offline Offline

Posts: 668



View Profile WWW
« on: January 24, 2009, 10:40:24 am »

Close Comments v0.1

Created by: Nick Ramsay (longcountdown)
Created on: 2009/01/24
Requires: None

Description
Adds the ability to close the comment form on all or individual stories, displaying "The comment form is closed" instead.

Instructions
Upload 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:

Code:
$main_smarty->assign('story',getmyurl('story', $link->link_id));

Below it, add this:

Code:
$vars=array('link' => $link, 'author' => $author);
check_actions('linkadmin_action_main', $vars);

/libs/comment.php:

Find:

Code:
$smarty->assign('comment_form_label', $vars['comment_form_label]);

Below it, add this:

Code:
$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:

Code:
{php}
Global $db, $main_smarty, $rows, $offset;
do_pages($rows, 25, '');
{/php}

<br/>

Below it, add this:

Code:
{checkActionsTpl location=tpl_admin_comments_post_pagination"}

/templates/your_template/admin_templates/linkadmin_main.tpl:

Find:

Code:
<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:

Code:
{checkActionsTpl location=tpl_linkadmin_main_link_details"}

/templates/your_template/comment_show.tpl:

Find:

Code:
{* display comment form if replying to a comment *}
<div class="comment-info">
.
.
.
</div>

Above it, add this:

Code:
{if $comment_form_status ne "closed"}

Below it, add this:

Code:
{/if} {* close comment_form_status if *}

/templates/your_template/story_center.tpl:

Find:

Code:
{if $user_authenticated neq ""}
{include file=$the_template."/comment_form.tpl"}
{else}
.
.
.
{/if}

Above it, add this:

Code:
{if $comment_form_status ne "closed"}


Below it, add this:

Code:
{else}
{checkActionsTpl location=tpl_story_center_comment_form_closed"}
{/if}

 
Usage
1. 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 History
v0.1 2009/01/09 LongCountdown - First version.

* close_comments.zip (18.21 KB - downloaded 55 times.)
Logged

Reinventing SWCMS at HotaruCMS.org - testers, designers and developers wanted!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!