Im using 1.4.x version. Can anyone help me? I want to disable editng and deleting comments for users... That means normal users wouldnt edit or delete their own posts... Thanks.
edit themes/yourtheme/theme.php, find <a href="javascript:;" onclick="blocking('cbody{MSG_ID}','', 'block'); blocking('cedit{MSG_ID}','', 'block'); return false;" title="{EDIT_TITLE}"><img src="images/edit.gif" border="0px" align="middle" alt="" /></a>
<a href="delete.php?msg_id={MSG_ID}&what=comment" onclick="return confirm('{CONFIRM_DELETE}');"><img src="images/delete.gif" border="0px" align="middle" /></a>
and comment it out, or add a switch that only allows admin access.
Thank you a lot. I love coppermine... ;D
I tried to add a switch that allows use only for admin, but everytime i get some error/s. Please can you give me another advice? How to do it?
post your code and I may be able to tell you what if wrong with it. A switch in PHP looks like this:<?php
if (GALLERY_ADMIN_MODE == TRUE) {
// do something the admin only is suppossed to do
} else {
//do something the non-admin is suppossed to do/see/have
}
I have similar problem, I want to disable editing / deleting of comments for unregistered users (still, they should be able to view / add them). Trying to find solution, I found this thread. I am using rainyday -theme that comes along with coppermine, but I didn't find those lines from there from any files it icludes in its themes directory.. is there any other way to do this?
I'm struggling a little with this one...
I've basically got:
if (GALLERY_ADMIN_MODE == TRUE) {
<a href="javascript:;" onclick="blocking('cbody{MSG_ID}','', 'block'); blocking('cedit{MSG_ID}','', 'block'); return false;" title="{EDIT_TITLE}"><img src="images/edit.gif" border="0px" align="middle" alt="" /></a>
<a href="delete.php?msg_id={MSG_ID}&what=comment" onclick="return confirm('{CONFIRM_DELETE}');"><img src="images/delete.gif" border="0px" align="middle" /></a>
}
but of course that's parsing the "if" command through as html and echoing it out... (along with the edit buttons)
I don't really understand how to call the switch (how to put it in as PHP and not as HTML)
cheers
if (GALLERY_ADMIN_MODE == TRUE) {
print <<< EOT
<a href="javascript:;" onclick="blocking('cbody{MSG_ID}','', 'block'); blocking('cedit{MSG_ID}','', 'block'); return false;" title="{EDIT_TITLE}"><img src="images/edit.gif" border="0px" align="middle" alt="" /></a>
<a href="delete.php?msg_id={MSG_ID}&what=comment" onclick="return confirm('{CONFIRM_DELETE}');"><img src="images/delete.gif" border="0px" align="middle" /></a>
EOT;
}
Thanks, that one's still not working for me... I get an "Unexpected <" error on the "<!-- END buttons --> line
I tried fixing up for the quote marks:
if (GALLERY_ADMIN_MODE == TRUE) {
print <<< EOT "
<a href=\"javascript:;\" onclick=\"blocking('cbody{MSG_ID}','', 'block'); blocking('cedit{MSG_ID}','', 'block'); return false;\" title=\"{EDIT_TITLE}\"><img src=\"images/edit.gif\" border=\"0px\" align=\"middle\" alt=\"\" /></a>
<a href=\"delete.php?msg_id={MSG_ID}&what=comment\" onclick=\"return confirm('{CONFIRM_DELETE}');\"><img src=\"images/delete.gif\" border=\"0px\" align=\"middle\" /></a> "
EOT;
}
thinking that might resolve something, but it doesn't... I guess I'm not really understanding whether I'm writing in PHP or HTML in each part, and whether i'm 'breaking into' HTML to print the part, or 'breaking out of' PHP to print it... ???
cheers
You shouldn't put those quote marks !
It didn't work this way
if you already have $template_image_comments variable on your theme.php delete it then copy this code instead to themes/your theme/theme.php
if (GALLERY_ADMIN_MODE == TRUE) {
// HTML template for the display of comments to Admins
$template_image_comments = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="tableh2_compact" nowrap="nowrap">
<b>{MSG_AUTHOR}</b><a name="comment{MSG_ID}"></a>
<!-- BEGIN ipinfo -->
({IP})
<!-- END ipinfo -->
</td>
<td class="tableh2_compact" align="right" width="100%">
<!-- BEGIN report_comment_button -->
<a href="report_file.php?pid={PID}&msg_id={MSG_ID}&what=comment" title="{REPORT_COMMENT_TITLE}"><img src="images/report.gif" width="16" height="16" border="0" align="middle" alt="{REPORT_COMMENT_TITLE}" /></a>
<!-- END report_comment_button -->
<!-- BEGIN buttons -->
<a href="javascript:;" onclick="blocking('cbody{MSG_ID}','', 'block'); blocking('cedit{MSG_ID}','', 'block'); return false;" title="{EDIT_TITLE}"><img src="images/edit.gif" border="0" align="middle" /></a>
<a href="delete.php?msg_id={MSG_ID}&what=comment" onclick="return confirm('{CONFIRM_DELETE}');"><img src="images/delete.gif" border="0" align="middle" /></a>
<!-- END buttons -->
</td>
<td class="tableh2_compact" align="right" nowrap="nowrap">
<span class="comment_date">[{MSG_DATE}]</span>
</td></tr>
</table>
</td>
</tr>
<tr>
<td class="tableb_compact">
<div id="cbody{MSG_ID}" style="display:block">
{MSG_BODY}
</div>
<div id="cedit{MSG_ID}" style="display:none">
<!-- BEGIN edit_box_smilies -->
<table width="100%" cellpadding="0" cellspacing="0">
<form name="f{MSG_ID}" method="POST" action="db_input.php">
<input type="hidden" name="event" value="comment_update" />
<input type="hidden" name="msg_id" value="{MSG_ID}" />
<tr>
<td>
<input type="text" name="msg_author" value="{MSG_AUTHOR}" class="textinput" size="25" />
</td><td>
</tr>
<tr>
<td width="80%">
<textarea cols="40" rows="2" class="textinput" name="msg_body" onselect="storeCaret_f{MSG_ID}(this);" onclick="storeCaret_f{MSG_ID}(this);" onkeyup="storeCaret_f{MSG_ID}(this);" style="width: 100%;">{MSG_BODY_RAW}</textarea>
</td>
<td class="tableb_compact">
</td>
<td>
<input type="submit" class="comment_button" name="submit" value="{OK}" />
</td>
</form>
</tr>
<tr>
<td colspan="3"><img src="images/spacer.gif" width="1" height="2" /><br /></td>
</tr>
</table>
{SMILIES}
<!-- END edit_box_smilies -->
<!-- BEGIN edit_box_no_smilies -->
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<form name="f{MSG_ID}" method="POST" action="db_input.php">
<input type="hidden" name="event" value="comment_update" />
<input type="hidden" name="msg_id" value="{MSG_ID}" />
<td>
<input type="text" name="msg_author" value="{MSG_AUTHOR}" class="textinput" size="25" />
</td>
</tr>
<tr>
<td width="100%">
<textarea cols="40" rows="2" class="textinput" name="msg_body" style="width: 100%;">{MSG_BODY_RAW}</textarea>
</td>
<td class="tableb_compact">
</td>
<td>
<input type="submit" class="comment_button" name="submit" value="{OK}" />
</td>
</form>
</tr>
<tr>
<td colspan="3"><img src="images/spacer.gif" width="1" height="2" /><br /></td>
</tr>
</table>
<!-- END edit_box_no_smilies -->
</div>
</td>
</tr>
</table>
EOT;
} else {
// HTML template for the display of comments to regular users
$template_image_comments = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="tableh2_compact" nowrap="nowrap">
<b>{MSG_AUTHOR}</b><a name="comment{MSG_ID}"></a>
<!-- BEGIN ipinfo -->
({IP})
<!-- END ipinfo -->
</td>
<td class="tableh2_compact" align="right" width="100%">
<!-- BEGIN report_comment_button -->
<a href="report_file.php?pid={PID}&msg_id={MSG_ID}&what=comment" title="{REPORT_COMMENT_TITLE}"><img src="images/report.gif" width="16" height="16" border="0" align="middle" alt="{REPORT_COMMENT_TITLE}" /></a>
<!-- END report_comment_button -->
<!-- BEGIN buttons -->
<!-- END buttons -->
</td>
<td class="tableh2_compact" align="right" nowrap="nowrap">
<span class="comment_date">[{MSG_DATE}]</span>
</td></tr>
</table>
</td>
</tr>
<tr>
<td class="tableb_compact">
<div id="cbody{MSG_ID}" style="display:block">
{MSG_BODY}
</div>
<div id="cedit{MSG_ID}" style="display:none">
<!-- BEGIN edit_box_smilies -->
<table width="100%" cellpadding="0" cellspacing="0">
<form name="f{MSG_ID}" method="POST" action="db_input.php">
<input type="hidden" name="event" value="comment_update" />
<input type="hidden" name="msg_id" value="{MSG_ID}" />
<tr>
<td>
<input type="text" name="msg_author" value="{MSG_AUTHOR}" class="textinput" size="25" />
</td><td>
</tr>
<tr>
<td width="80%">
<textarea cols="40" rows="2" class="textinput" name="msg_body" onselect="storeCaret_f{MSG_ID}(this);" onclick="storeCaret_f{MSG_ID}(this);" onkeyup="storeCaret_f{MSG_ID}(this);" style="width: 100%;">{MSG_BODY_RAW}</textarea>
</td>
<td class="tableb_compact">
</td>
<td>
<input type="submit" class="comment_button" name="submit" value="{OK}" />
</td>
</form>
</tr>
<tr>
<td colspan="3"><img src="images/spacer.gif" width="1" height="2" /><br /></td>
</tr>
</table>
{SMILIES}
<!-- END edit_box_smilies -->
<!-- BEGIN edit_box_no_smilies -->
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<form name="f{MSG_ID}" method="POST" action="db_input.php">
<input type="hidden" name="event" value="comment_update" />
<input type="hidden" name="msg_id" value="{MSG_ID}" />
<td>
<input type="text" name="msg_author" value="{MSG_AUTHOR}" class="textinput" size="25" />
</td>
</tr>
<tr>
<td width="100%">
<textarea cols="40" rows="2" class="textinput" name="msg_body" style="width: 100%;">{MSG_BODY_RAW}</textarea>
</td>
<td class="tableb_compact">
</td>
<td>
<input type="submit" class="comment_button" name="submit" value="{OK}" />
</td>
</form>
</tr>
<tr>
<td colspan="3"><img src="images/spacer.gif" width="1" height="2" /><br /></td>
</tr>
</table>
<!-- END edit_box_no_smilies -->
</div>
</td>
</tr>
</table>
EOT;
}
How can I able users to delete or to edit all comments on their own albums ?
Already owner can delete all comment by editing her/his files
Editing others user's comment is not right IMO
But deleteing single comment is good
That needs a MOD
- Adding admin button for owner under theme.php
- preparing delete.php to do that
Thanks a heap sami!
that worked perfectly.. I'd say it's closed for me..
Locking thread to avoid more cross-posts and hijacking attempts.