Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: allow owner of the image to edit comments on the image.  (Read 2527 times)

0 Members and 1 Guest are viewing this topic.

soltan

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
allow owner of the image to edit comments on the image.
« on: July 02, 2006, 06:58:47 am »

hi, on my page, i let people to upload their own pictures and others can write comments about it,
how can i give the owner of the image the rights to modify the comments on his/her page?
for example.
i let mr ABC to upload his own picture. now if mr DEF goes to mr ABC's page and writes him a comment, how can mr ABC delet the comments that mr DEF writes him, ( usually because of bad words used in comments )

im pretty sure this can be done with the template.php file.
i was reading this post by vargha ( http://forum.coppermine-gallery.net/index.php?topic=31685.0 )
which shows how u can remove them,
but you should be able to also add a line to it,
i think it needs to be something like the following code
--------
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}&amp;what=comment"  onclick="return confirm('{CONFIRM_DELETE}');"><img src="images/delete.gif" border="0px" align="middle" /></a>
EOT;
}
elseif (GALLERY_USER_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}&amp;what=comment"  onclick="return confirm('{CONFIRM_DELETE}');"><img src="images/delete.gif" border="0px" align="middle" /></a>
EOT;
}
----

what this line of code does is that it checks to see if you are an admin, if so you'll have a full rights to edit/ delet comments and if you are the person who posted the comment, you will still have the rights to edit/delet the post...
now what i wanna do is to write a code that checks to see if you are the owner of the image. if you are, give you the same rights as an admin.
is it possible guys?
Logged

soltan

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: allow owner of the image to edit comments on the image.
« Reply #1 on: July 06, 2006, 08:47:47 pm »

any idea on this guys? :-s
this should be very easy, i just cant figure it out :-s
Logged

Nibbler

  • Guest
Re: allow owner of the image to edit comments on the image.
« Reply #2 on: July 06, 2006, 08:53:39 pm »

This is not that simple a modification, since code needs to be altered in multiple places. It's also wide open to people abusing the system and putting whatever they like as comments 'by' someone. Coppermine already has a bad words filter, it would be easier to make good use of that than hack the code.
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.