Author Topic: Allow user to edit their own comments (not only ...)  (Read 42533 times)

0 Members and 1 Guest are viewing this topic.

Offline Bodyworks

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://www.digitalfotos-online.de
Allow user to edit their own comments (not only ...)
« on: May 11, 2003, 12:09:22 AM »
Hi together,
i need a MOD to allow users to edit or delete their given comments. Not only restricted to comments concerning their own pictures, like in control panel possible.
Users might correct their type mismatches, when they are recognized after posting. Up to now there is no possibility to correct their comment or to delete it. Only admin can do that.

I think this is a little effort to do that but i'm not familiar to php.  :cry:
Could anybody give me an advice?

It would be great to alter comment_bit.html in that way:
Code: [Select]
{if allow_user_editcomment}{user_editcomment}{endif allow_user_editcomment}

There also should be a section in admin control panel to switch this functionality on and off.
Section: Allow users to edit/delete their comments generally.

Thanks a lot.  :lol:

Bodyworks
Regards
Bodyworks

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Allow user to edit their own comments (not only ...)
« Reply #1 on: May 11, 2003, 12:33:00 AM »
it's not that simple ;)
but try what I posted here:
http://4homepages.de/forum/viewtopic.php?t=5490
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Bodyworks

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://www.digitalfotos-online.de
Allow user to edit their own comments (not only ...)
« Reply #2 on: May 11, 2003, 12:48:09 AM »
Quote from: V@no
it's not that simple ;)
but try what I posted here:
http://4homepages.de/forum/viewtopic.php?t=5490


Ooops,
this is really a very complex MOD which i don't need, because i won't give registered users that amount of freedom.
Would it be possible for you V@no to extract the neccessary pieces of code in member.php to manage what i want.

Thank you in advance.

Bodyworks
Regards
Bodyworks

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Allow user to edit their own comments (not only ...)
« Reply #3 on: May 11, 2003, 01:19:43 AM »
then, try this:
open /member.php
find 4 times:
Code: [Select]
$user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN
*this is just a part of lines, all u need to find ;)
replace with:
Code: [Select]
$user_info['user_id'] != $comment_row['user_id'] && $user_info['user_id'] != $comment_row['comment_user_id'] && $user_info['user_level'] != ADMIN
*as I said above, this should be found/replaced 4 times ;)

open /details.php
find:
Code: [Select]
     elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";

*there is another part very simular to this, make sure this is the one ;)
replace it with:
Code: [Select]
     elseif ($is_image_owner || $comment_user_id == $user_info['user_id'] && $user_info['user_level'] >= USER) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Bodyworks

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://www.digitalfotos-online.de
Doesn't Work
« Reply #4 on: May 11, 2003, 02:01:14 AM »
Hi V@no,

I changed all code as you told but it doesn't work.
The Links (edit / delete) appear in comment box (like admin_links), but when the user who has posted the comment clicks either on edit or delete, nothing happens. Only the screen is refreshed.

There must be a mistake.
Have you any idea?

Regards
Bodyworks
Regards
Bodyworks

Offline bine

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • art-stylers free Stockphotos,  Website-Templates and e-cards
Re: Allow user to edit their own comments (not only ...)
« Reply #5 on: April 04, 2005, 04:18:34 PM »

All code changes are well done and in general-settings 'edit and delete of comments' is allowed.

But this is my reason of this modification:
1. user edit own comment under his own image: OK
1a. user delete own comment under his own image:  OK

2. when a user try to edit or delete a comment under an image of another user:
when clicking the edit or delete link, the site refreshes to the index-page :(

3. I don't like the function that I can edit or delete comments from other users under my own images.

I like that users can edit or delete their comments under every image, but not comments from other users under their own image and I thought this is possible with this mod? Am I wrong?
:) bine


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Allow user to edit their own comments (not only ...)
« Reply #6 on: April 04, 2005, 11:49:01 PM »
I like that users can edit or delete their comments under every image, but not comments from other users under their own image and I thought this is possible with this mod? Am I wrong?
actualy that how it works by default...
members can edit their own comments under any images, as long as its allowed by the settings.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Volker

  • Pre-Newbie
  • Posts: 9
    • View Profile
    • Volkersphäre
Re: Allow user to edit their own comments (not only ...)
« Reply #7 on: April 15, 2005, 09:02:13 PM »
Hm, i have done the MOD and get the same result as Bodyworks write above  :?
Is there a change in the chmod´s of files or directories on the server  required ?

kind regards

Volker

( www.bahrenburg.de )

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Allow user to edit their own comments (not only ...)
« Reply #8 on: April 16, 2005, 12:13:53 AM »
did u changed 4 lines in member.php as discribed?
please post the complete changed lines from your file.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Volker

  • Pre-Newbie
  • Posts: 9
    • View Profile
    • Volkersphäre
Re: Allow user to edit their own comments (not only ...)
« Reply #9 on: April 16, 2005, 01:26:27 AM »
Yes, I´ve did it by search and replace - think it will be correct ?

Here is the complete code of my member.php :

[REMOVED]
« Last Edit: April 16, 2005, 02:21:16 AM by V@no »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Allow user to edit their own comments (not only ...)
« Reply #10 on: April 16, 2005, 02:22:39 AM »
sorry, I didnt ask for entire member.php
just the 4 lines u were u supposed to change. nothing more.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Volker

  • Pre-Newbie
  • Posts: 9
    • View Profile
    • Volkersphäre
Re: Allow user to edit their own comments (not only ...)
« Reply #11 on: April 16, 2005, 12:02:07 PM »
okay, it was my fault to post the complete code  :( sorry for that and thanks for removing  :roll:

But it seems that I´m not the only one hwo has problems with that MOD. I´ve replaced the code in the members.php 4 times and I change the details.php
After that it display the right functions, so I think it´s a good basis  :wink:
But for the user the ability to execute is still missing, so I think there is something more to do. but what?

regards

Volker
( www.bahrenburg.de )

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Allow user to edit their own comments (not only ...)
« Reply #12 on: April 16, 2005, 04:15:36 PM »
but what?
trust me, nobody knows untill u show the lines u've changed in member.php
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Volker

  • Pre-Newbie
  • Posts: 9
    • View Profile
    • Volkersphäre
Re: Allow user to edit their own comments (not only ...)
« Reply #13 on: April 17, 2005, 11:24:50 AM »
I´ve done it exactly as it is described...
In my member.php it is Line 59, 96, 141 and 189

here the code off the full line (4 times exactly the same)
Code: [Select]
  if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_id'] != $comment_row['comment_user_id'] && $user_info['user_level'] != ADMIN)) {

I think the code works well, cause it shows the edit-and-delete-command in the comments to the user. But if a user klick on "edit" nothing happen....

regards

Volker
( www.bahrenburg.de )

Offline vanish

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • White Album
Re: Allow user to edit their own comments (not only ...)
« Reply #14 on: April 19, 2005, 10:22:02 AM »
Somebody has found the correct solution?