forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: Vargha on May 20, 2006, 10:23:31 am
-
is it possible to disable users to edit their comments
thnx guys
-
has been asked and answered only recently. Please search.
-
i found about it, but i still dont no how i can do it, im using rainy day theme
-
post a link to the thread you found, don't make supporters search as well if you already have found the proper thread.
-
this is what someone said
Hi,
The simplest way would be to edit your displayimage.php, look for
Code:
$user_can_edit = (GALLERY_ADMIN_MODE) || (USER_ID && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS) || (!USER_ID && USER_CAN_POST_COMMENTS && ($USER['ID'] == $row['author_md5_id']));
and then change that line to read
Code:
$user_can_edit = (GALLERY_ADMIN_MODE) || (USER_ID && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS);
That will remove the edit and delete permissions from anonymous users.
[[[[but i dont have those things in my displayimage.php, i dont no what to do]]]]
-
do as I suggested:
post a link to the thread you found
I didn't ask you to paste the content of the posting into your message, but I asked for a link >:(.
-
if anyone likes to remove the edit/delete button for comments for users here is the solution
simply open your theme.php, you can find it, in your themes/yourtime.theme.php
now scroll down and remove the ?> at the button of the page
then simply paste these codes after "EOT;"
// HTML template for template sys_menu buttons
$template_sys_menu_button = <<<EOT
<!-- BEGIN {BLOCK_ID} -->
<td><img src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
<td><img src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" alt="" /></td>
<td style="background-image:url(themes/rainy_day/images/button1_r1_c2.gif)">
<a href="{HREF_TGT}" title="{HREF_TITLE}">{HREF_LNK}</a>
</td>
<td><img src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" alt="" /></td>
<!-- END {BLOCK_ID} -->
EOT;
// HTML template for the display of comments
$template_image_comments = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
<tr>
<td>
<table width="100%" cellpadding="0px" cellspacing="0px">
<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="16px" height="16px" border="0px" align="middle" alt="{REPORT_COMMENT_TITLE}" /></a>
<!-- END report_comment_button -->
<!-- BEGIN buttons -->
EOT;
if (GALLERY_ADMIN_MODE) {
$template_image_comments .= <<<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;
}
$template_image_comments .= <<< EOT
<!-- 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 -->
<form name="f{MSG_ID}" method="post" action="db_input.php">
<table width="100%" cellpadding="0px" cellspacing="0px">
<tr>
<td valign="top">
<input type="text" name="msg_author" value="{MSG_AUTHOR}" class="textinput" size="25" />
<input type="hidden" name="event" value="comment_update" />
<input type="hidden" name="msg_id" value="{MSG_ID}" />
</td>
<td width="70%">
<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:99%;">{MSG_BODY_RAW}</textarea>
</td>
<td align="right">
<input type="submit" class="comment_button" name="submit" value="{OK}" />
</td>
</tr>
<tr>
<td colspan="3">
<img src="images/spacer.gif" width="1px" height="2px" />
<br />
</td>
</tr>
</table>
</form>
{SMILIES}
<!-- END edit_box_smilies -->
<!-- BEGIN edit_box_no_smilies -->
<form name="f{MSG_ID}" method="post" action="db_input.php">
<table width="100%" cellpadding="0px" cellspacing="0px">
<tr>
<td valign="top">
<input type="hidden" name="event" value="comment_update" />
<input type="hidden" name="msg_id" value="{MSG_ID}" />
<input type="text" name="msg_author" value="{MSG_AUTHOR}" class="textinput" size="25" />
</td>
<td width="70%">
<textarea cols="40" rows="2" class="textinput" name="msg_body" style="width:99%;">{MSG_BODY_RAW}</textarea>
</td>
<td align="right">
<input type="submit" class="comment_button" name="submit" value="{OK}" />
</td>
</tr>
<tr>
<td colspan="3">
<img src="images/spacer.gif" width="1px" height="2px" />
<br />
</td>
</tr>
</table>
</form>
<!-- END edit_box_no_smilies -->
</div>
</td>
</tr>
</table>
EOT;
sooo this is how it looks like,
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2006 Coppermine Dev Team
v1.1 originally written by Gregory DEMAR
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
********************************************
Coppermine version: 1.4.5
$Source: /cvsroot/coppermine/stable/themes/rainy_day/theme.php,v $
$Revision: 1.17 $
$Author: gaugau $
$Date: 2006/03/02 08:25:19 $
**********************************************/
// ------------------------------------------------------------------------- //
// This theme has had all redundant CORE items removed //
// ------------------------------------------------------------------------- //
define('THEME_HAS_RATING_GRAPHICS', 1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);
// HTML template for sys_menu
$template_sys_menu = <<<EOT
<div class="topmenu">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
{BUTTONS}
</tr>
</table>
</div>
EOT;
// HTML template for template sys_menu buttons
$template_sys_menu_button = <<<EOT
<!-- BEGIN {BLOCK_ID} -->
<td><img src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
<td><img src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" alt="" /></td>
<td style="background-image:url(themes/rainy_day/images/button1_r1_c2.gif)">
<a href="{HREF_TGT}" title="{HREF_TITLE}">{HREF_LNK}</a>
</td>
<td><img src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" alt="" /></td>
<!-- END {BLOCK_ID} -->
EOT;
// HTML template for the display of comments
$template_image_comments = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
<tr>
<td>
<table width="100%" cellpadding="0px" cellspacing="0px">
<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="16px" height="16px" border="0px" align="middle" alt="{REPORT_COMMENT_TITLE}" /></a>
<!-- END report_comment_button -->
<!-- BEGIN buttons -->
EOT;
if (GALLERY_ADMIN_MODE) {
$template_image_comments .= <<<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;
}
$template_image_comments .= <<< EOT
<!-- 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 -->
<form name="f{MSG_ID}" method="post" action="db_input.php">
<table width="100%" cellpadding="0px" cellspacing="0px">
<tr>
<td valign="top">
<input type="text" name="msg_author" value="{MSG_AUTHOR}" class="textinput" size="25" />
<input type="hidden" name="event" value="comment_update" />
<input type="hidden" name="msg_id" value="{MSG_ID}" />
</td>
<td width="70%">
<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:99%;">{MSG_BODY_RAW}</textarea>
</td>
<td align="right">
<input type="submit" class="comment_button" name="submit" value="{OK}" />
</td>
</tr>
<tr>
<td colspan="3">
<img src="images/spacer.gif" width="1px" height="2px" />
<br />
</td>
</tr>
</table>
</form>
{SMILIES}
<!-- END edit_box_smilies -->
<!-- BEGIN edit_box_no_smilies -->
<form name="f{MSG_ID}" method="post" action="db_input.php">
<table width="100%" cellpadding="0px" cellspacing="0px">
<tr>
<td valign="top">
<input type="hidden" name="event" value="comment_update" />
<input type="hidden" name="msg_id" value="{MSG_ID}" />
<input type="text" name="msg_author" value="{MSG_AUTHOR}" class="textinput" size="25" />
</td>
<td width="70%">
<textarea cols="40" rows="2" class="textinput" name="msg_body" style="width:99%;">{MSG_BODY_RAW}</textarea>
</td>
<td align="right">
<input type="submit" class="comment_button" name="submit" value="{OK}" />
</td>
</tr>
<tr>
<td colspan="3">
<img src="images/spacer.gif" width="1px" height="2px" />
<br />
</td>
</tr>
</table>
</form>
<!-- END edit_box_no_smilies -->
</div>
</td>
</tr>
</table>
EOT;
-
i fixed it, if anyone like to do it for their server simply follow this link
http://forum.coppermine-gallery.net/index.php?topic=31693.0
-
1) This is not the proper solution to get rid of users being able to edit/delete comments only. It might work on your theme, but it will break the themes of others. I understand and appreciate your readiness to share your solution, but I can't recommend it.
2) Use the code button, makes your posting readable.
3) Don't double post. Merging this thread with the original one you started. Instead of posting your solution, you should have posted a link to the thread that helped you find the solution for you