a different / edited closecomments plugin

a different / edited closecomments plugin

Postby marcotics on Thu Sep 13, 2012 11:39 am

I installed the closecomments plugin yesterday, and it works great and easy, except for one tiny thing. Disabling the comments also hides comments already made. I think it would be nicer to just disable the < form > so no new comments can be made (spam), but the old are still visible.

Someone able to jumpstart me? I'm sure other users of the closecomments plugin experience the same feeling, or have allready made the adjustment.

Thanks!
marcotics
 
Posts: 42
Joined: Wed Mar 17, 2010 1:02 pm
LifeType Version: 1.2.11

Re: a different / edited closecomments plugin

Postby jondaley on Sun Sep 16, 2012 6:26 am

The closecomments plugin doesn't disable the comments - it is in your template. Did you write your own, or if not, which template are you using?

The {if} statements that check whether comments are allowed should not contain the existing comments, but only the comment form. You should see a
Code: Select all
{foreach ... from=$comments}
...
{/foreach}

block somewhere in your code, and that should separate from the
Code: Select all
{if $blogsettings->getValue("comments_enabled") && $post->getCommentsEnabled()==1}
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: a different / edited closecomments plugin

Postby marcotics on Sun Sep 16, 2012 1:24 pm

I'm using the Spollo template, wich uses the commentform in the default template folder. This is the template file postandcomments:
Code: Select all

{include file="$blogtemplate/header.template"}
{include file="$blogtemplate/panel.template"}

<div id="content">
   {assign var="postDate" value=$post->getDateObject()}
   {assign var="postOwner" value=$post->getUserInfo()}
   {include file="$blogtemplate/post.template"}
    <!-- {$url->postTrackbackLink($post)} -->
   {if $blogsettings->getValue("comments_enabled") && $post->getCommentsEnabled()==1}
   <h2>{$locale->tr("comments")}</h2>
   <div class="storycontent">
      <div id="comments">
      {if $comments}
         <ol>
            {foreach from=$comments item=comment}
            
               {assign var=commentText value=$comment->getText()}
               <li style="list-style-image:url(http://www.marcotics.nl/V2/templates/marcotics/imgs/comment-icon.png)" id="comment-{$comment->getId()}">
               <h3 class="commentheader">{if $comment->getTopic() != null} {$comment->getTopic()|strip_tags}{else}Re: <em>{$post->getTopic()|strip_tags}</em>{/if}</h3>
               {$commentText}
               <p><cite>
               <!-- photo -->
               {if $comment->IsPosterAuthenticated()}
                  {assign var=poster value=$comment->getUser()}
                  {if $poster->hasPicture()}
                     {assign var=posterimg value=$poster->getPicture()}
                     <img style="width:auto; height:32px; margin-right:5px" src="{$posterimg->getPreviewLink()}" alt="{$poster->getUserName()}" align="bottom" />
                  {/if}
               {/if}
               <!-- photo end -->
               {$locale->tr("posted_by")}
               {if $comment->getUserUrl() != ""}
                  <a href="{$comment->getUserUrl()}"}>{$comment->getUsername()}</a>
               {else}
                  {$comment->getUsername()}
               {/if} &#8212;
               {assign var=commentDate value=$comment->getDateObject()}
               {$locale->formatDate($commentDate, "%d %b %Y, %H:%M")}
               </cite></p>
               </li>
            {/foreach}
         </ol>
      {/if}
      </div>
   </div>
   <br style="clear: both;" />
   <h2>{$locale->tr("add_comment")}</h2>
   <div class="storycontent">
      {include file="$blogtemplate/commentform.template"}
   </div>
   {/if}
</div>
{include file="$blogtemplate/footer.template"}


my guess is that the "{if $blogsettings->getValue("comments_enabled") && $post->getCommentsEnabled()==1}" part, wich is at the top, should me more down surrounding the "{include file="$blogtemplate/commentform.template"}" part?
marcotics
 
Posts: 42
Joined: Wed Mar 17, 2010 1:02 pm
LifeType Version: 1.2.11

Re: a different / edited closecomments plugin

Postby jondaley on Mon Sep 17, 2012 10:14 am

Correct.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch


Return to General Plugin Development

cron