Member
Member
ahoglund   2005-09-22, 16:13
#1
I have been looking for a way to remove the option for people to comment. Is there an easy way to do this?
Member
Member
ahoglund   2005-09-22, 16:19
#2
nevermind.

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

this program rocks!!! thank you soooo much!!!
Developer
Developer
trisweb   2005-09-22, 20:58
#3
Yep, that'll work for now. In the future, a switch (for the entire gallery and per album) will be in the control panel.
Member
Member
Castro   2005-10-15, 17:45
#4
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
Member
Member
nathan   2005-10-16, 00:45
#5
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)
Member
Member
nathan   2005-10-16, 01:13
#6
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) ? "" : ("Comments ($num)"); ?>

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

<div class="comment">

<div class="commentmeta">

<?php printCommentAuthorLink(); ?> says:





<?=getCommentBody();?>





<?=getCommentDate();?>

,

<?=getCommentTime();?>

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



</div>

<?php endwhile; ?>



<!-- If comments are on for this image AND album... -->

Add a comment:

<form id="commentform" action="#" method="post">

<div><input type="hidden" name="comment" value="1" />

<input type="hidden" name="remember" value="1" />

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

<table border="0">

<tr>

<td><label for="name">Name:</label></td>

<td><input type="text" id="name" name="name" size="20" value="<?=$stored[0];?>" class="inputbox" />

</td>

</tr>

<tr>

<td><label for="email">E-Mail:</label></td>

<td><input type="text" id="email" name="email" size="20" value="<?=$stored[1];?>" class="inputbox" />

</td>

</tr>

<tr>

<td><label for="website">Site:</label></td>

<td><input type="text" id="website" name="website" size="40" value="<?=$stored[2];?>" class="inputbox" /></td>

</tr>

</table>

<textarea name="comment" rows="6" cols="40"></textarea>




<input type="submit" value="Add Comment" class="pushbutton" /></div>

</form>

</div>

</div>`

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

I hope that helps. Let me know if you need any more assistance.
Member
Member
Castro   2005-10-16, 08:03
#7
Oh! Yeah that does the trick!

Thanks a lot!!!

Castro
Member
Member
Castro   2005-10-16, 08:04
#8
Oh! Yeah that does the trick!

Thanks a lot!!!

Castro
Member
Member
nathan   2005-10-16, 09:51
#9
Not a problem.
Member
Member
sonicparke   2007-01-25, 20:17
#10
This was helpful. I just commented it out but I used php & css comments (maybe c++ too).

` <?php /*



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

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

<div class="comment">

<div class="commentmeta">

<?php printCommentAuthorLink(); ?> says:





<?php echo getCommentBody();?>





<?php echo getCommentDate();?>

,

<?php echo getCommentTime();?>

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



</div>

<?php endwhile; ?>



<!-- If comments are on for this image AND album... -->

Add a comment:

<form id="commentform" action="#" method="post">

<div><input type="hidden" name="comment" value="1" />

<input type="hidden" name="remember" value="1" />

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

<table border="0">

<tr>

<td><label for="name">Name:</label></td>

<td><input type="text" id="name" name="name" size="20" value="<?php echo $stored[0];?>" class="inputbox" />

</td>

</tr>

<tr>

<td><label for="email">E-Mail:</label></td>

<td><input type="text" id="email" name="email" size="20" value="<?php echo $stored[1];?>" class="inputbox" />

</td>

</tr>

<tr>

<td><label for="website">Site:</label></td>

<td><input type="text" id="website" name="website" size="40" value="<?php echo $stored[2];?>" class="inputbox" /></td>

</tr>

</table>

<textarea name="comment" rows="6" cols="40"></textarea>

<input type="submit" value="Add Comment" class="pushbutton" /></div>

</form>

</div>

</div>

*/ ?>

`

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.
Member
Member
lovenara   2008-11-21, 08:41
#11
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
Member
Member
sbillard   2008-11-22, 00:39
#12
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.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.