Remove Comments Functionality

I have been looking for a way to remove the option for people to comment. Is there an easy way to do this?

Comments

  • nevermind.

    i just deleted the code from the image.php file in my theme. is that sufficient?

    this program rocks!!! thank you soooo much!!!
  • trisweb Administrator
    Yep, that'll work for now. In the future, a switch (for the entire gallery and per album) will be in the control panel.
  • Hi, I want to disable the comments to but I can't find the image.php ?

    And what's the code I need to remove exaclty ?

    Thanks for your help!!

    Castro
  • The image.php file is in the theme folder of the theme you are using.

    I am not sure of what code to remove, but that should be a start.

    (I'll post exactly what to remove in about 20 mins)
  • Assuming you are using hte default theme, delete or 'comment out' the following code from the image.php file within the default theme folder.

    `


    <?php $num = getCommentCount(); echo ($num == 0) ? "" : ("<h3>Comments ($num)"); ?>

    <?php while (next_comment()): ?>





    <?php printCommentAuthorLink(); ?> says:





    <?=getCommentBody();?>





    <?=getCommentDate();?>

    ,

    <?=getCommentTime();?>

    <?php printEditCommentLink('Edit', ' | ', ''); ?>





    <?php endwhile; ?>



    Add a comment:







    <?php if (isset($error)) { ?>
    There was an error submitting your comment. Name, a valid e-mail address, and a comment are required.
    <?php } ?>

    Name:
    " class="inputbox" />

    E-Mail:
    " class="inputbox" />

    Site:
    " class="inputbox" />












    `

    This starts at line 45 and ends at line 93 (inclusive)

    I hope that helps. Let me know if you need any more assistance.
  • Oh! Yeah that does the trick!

    Thanks a lot!!!

    Castro
  • Oh! Yeah that does the trick!

    Thanks a lot!!!

    Castro
  • Not a problem.
  • This was helpful. I just commented it out but I used php & css comments (maybe c++ too).

    ` <?php /*<br />


    <?php $num = getCommentCount(); echo ($num == 0) ? "" : ("<h3>Comments ($num)"); ?>

    <?php while (next_comment()): ?>





    <?php printCommentAuthorLink(); ?> says:





    <?php echo getCommentBody();?>





    <?php echo getCommentDate();?>

    ,

    <?php echo getCommentTime();?>

    <?php printEditCommentLink('Edit', ' | ', ''); ?>





    <?php endwhile; ?>



    Add a comment:







    <?php if (isset($error)) { ?>
    There was an error submitting your comment. Name, a valid e-mail address, and a comment are required.
    <?php } ?> Name:
    " class="inputbox" />

    E-Mail:
    " class="inputbox" />

    Site:
    " class="inputbox" />











    */ ?>

    `

    It works great and I didn't have to delete the code in case I want to put it back nor did I use an html comment and clutter up the client side code.

    So I had an idea too. Is there any reason you could just add a simple check box to disable comments in the admin and use a variable to control whether or not this code is displayed or not?

    I did it very simply in part of my site where I used a variable to determine if it was a one or two column layout. If it was set to one then the proper id was set on the div and sidebar code was also prevented from displaying. Seems like this would be pretty easy to add as a global setting. Maybe not for individual albums though.
  • Hi
    i deleted it and it didnt work maybe it's old now for the present version?
    "sonicpark"I wonder wherer to put your code in the image.php
    thn
  • You might pay attention to the date on postings. You have posted to two threads which are quite old. The current zenphoto distributed themes all have an allow comments option. When that is not set you get no comments block.
Sign In or Register to comment.