4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Bodyworks on May 11, 2003, 12:09:22 AM

Title: Allow user to edit their own comments (not only ...)
Post by: Bodyworks 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
Title: Allow user to edit their own comments (not only ...)
Post by: V@no 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
Title: Allow user to edit their own comments (not only ...)
Post by: Bodyworks 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
Title: Allow user to edit their own comments (not only ...)
Post by: V@no 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>";
Title: Doesn't Work
Post by: Bodyworks 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
Title: Re: Allow user to edit their own comments (not only ...)
Post by: bine 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?
Title: Re: Allow user to edit their own comments (not only ...)
Post by: V@no 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.
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Volker 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 )
Title: Re: Allow user to edit their own comments (not only ...)
Post by: V@no 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.
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Volker 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]
Title: Re: Allow user to edit their own comments (not only ...)
Post by: V@no 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.
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Volker 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 )
Title: Re: Allow user to edit their own comments (not only ...)
Post by: V@no 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
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Volker 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 )
Title: Re: Allow user to edit their own comments (not only ...)
Post by: vanish on April 19, 2005, 10:22:02 AM
Somebody has found the correct solution?
Title: Re: Allow user to edit their own comments (not only ...)
Post by: HorrorCrafT on April 19, 2005, 01:19:36 PM
also mein englisch ist furchtbar ... geht auch deutsch?  :D mich würde diese funktion auch sehr interessieren ... aber halt nur wenn sie auch funktioniert  :wink: :D
vor allem wär natürlich sehr wichtig, dass ich wirklich nur MEINE kommentare bearbeiten/löschen kann und nicht jene von anderen usern, bloß weil diese unter einem von meinen bildern stehen!
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Volker on April 19, 2005, 11:06:59 PM
Also deutsch ist für mich kein Problem (ganz im Gegensatz zu meinem Englisch  :wink: ). Die Lösung dagen schon eher...
Der Code von V@no ist m.E. eine gute Ausgangsbasis, denn er bringt zumindest die richtigen Funktionen an der richtigen Stelle zur Anzeige. Einzig und allein die Funktion selbst ist noch nicht gegeben (zumindest bei mir), deshalb denke ich das hier noch irgendetwas zu tun ist. Nur was ?  :roll:

Viele Grüße

Volker
( www.bahrenburg.de )
Title: Re: Allow user to edit their own comments (not only ...)
Post by: vanish on April 20, 2005, 09:22:25 AM
My solution is working. You can see below code fragment from member.php and see it:
Code: [Select]
//-----------------------------------------------------
//---Show Member Comments------------------------------
//-----------------------------------------------------

if ($action == "showcomments") {
 if (isset($HTTP_GET_VARS[URL_USER_ID]) || isset($HTTP_POST_VARS[URL_USER_ID])) {
   $user_id = (isset($HTTP_GET_VARS[URL_USER_ID])) ? intval($HTTP_GET_VARS[URL_USER_ID]) : intval($HTTP_POST_VARS[URL_USER_ID]);
   if (!$user_id) {
     $num_comments = "";
     $user_id = GUEST;
   }
   if (isset($HTTP_POST_VARS['commentsetperpage']) || isset($HTTP_GET_VARS['commentsetperpage'])) {
   $commentsetperpage = (intval($HTTP_POST_VARS['commentsetperpage']) ) ? intval($HTTP_POST_VARS['commentsetperpage']) : intval($HTTP_GET_VARS['commentsetperpage']);
    if ($commentsetperpage) {
      $site_sess->set_session_var("commentperpage", $commentsetperpage);
      $session_info['commentperpage'] = $commentsetperpage;
    }
   }

   if (isset($session_info['commentperpage'])) {
     $commentperpage = $session_info['commentperpage'];
   }
   else {
     $commentperpage = 5;
   }
   $commentsperpage_dropdown = "\n<select name=\"commentsetperpage\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['commentsperpage'].submit() }\" class=\"select\">\n";
    for($i = 1; $i <= 4; $i++) {
      $setvalue = 5 * $i;
      $commentsperpage_dropdown .= "<option value=\"".$setvalue."\"";
        if ($setvalue == $commentperpage) {
        $commentsperpage_dropdown .= " selected=\"selected\"";
      }
      $commentsperpage_dropdown .= ">";
      $commentsperpage_dropdown .= $setvalue;
      $commentsperpage_dropdown .= "</option>\n";
    }
    $commentsperpage_dropdown .= "</select>\n";

    $site_template->register_vars("commentsperpage_dropdown", $commentsperpage_dropdown);
$site_template->register_vars("lang_comments_per_page", $lang['comments_per_page']);
    $commentsperpage_dropdown_form = $site_template->parse_template("commentsperpage_dropdown_form");
    $site_template->register_vars("commentsperpage_dropdown_form", $commentsperpage_dropdown_form);

 $sql = "SELECT COUNT(user_id) AS comments
     FROM ".COMMENTS_TABLE."
     WHERE user_id = ".$user_id;
$result = $site_db->query_firstrow($sql);
$num_comments = $result['comments'];
$site_db->free_result();
$num_rows_all = (isset($num_comments)) ? $num_comments : 0;
    $link_arg = $site_sess->url(ROOT_PATH."last.php?show");
    include(ROOT_PATH.'includes/paging.php');
    $getpaging = new Paging($page, $commentperpage, $num_rows_all, $link_arg, $lang['comment_stats'], "comments");
    $offset = $getpaging->get_offset();
    $site_template->register_vars(array(
      "paging" => $getpaging->get_paging(),
  "paging_stats" => ($num_rows_all > $commentperpage) ? $getpaging->get_paging_stats() : ""
));

 $additional_sql = "";
 $table_fields = $site_db->get_table_fields(USERS_TABLE);
 foreach ($additional_user_fields as $key => $val) {
   if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
     $additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
   }
 }

 $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq").$additional_sql."
         FROM ".COMMENTS_TABLE." c
         LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
         WHERE c.user_id = $user_id
         ORDER BY c.comment_date DESC, c.image_id ASC
         LIMIT $offset, $commentperpage";
 $result = $site_db->query($sql);

 $comment_row = array();
 while ($row = $site_db->fetch_array($result)) {
   $comment_row[] = $row;
 }
 $site_db->free_result($result);
 $num_comments = sizeof($comment_row);
 }
 else {
   $num_comments = "";
 }

 if (!$num_comments) {
   $content = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\" class=\"bordercolor\"><tr><td class=\"commentrow1\">".$lang['member_no_comments']."</td></tr></table>";
 }
 else {
    $content = "";
    for ($i = 0; $i < $num_comments; $i++) {
        $image_id = $comment_row[$i]['image_id'];
        $sql = "SELECT i.image_id, i.cat_id, i.image_name, i.image_date, c.cat_name, i.image_media_file, i.image_thumb_file, i.image_allow_comments
                FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
                LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
                WHERE i.image_id = $image_id AND c.cat_id = i.cat_id";
        $image_row = $site_db->query_firstrow($sql);
        $cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;
$image_allow_comments = (check_permission("auth_readcomment", $cat_id)) ? $image_row['image_allow_comments'] : 0;
if ($image_allow_comments == 1){
$same = ($current != $comment_row[$i]['image_id']) ? 1 : 0;
        $comment_user_name = htmlspecialchars($comment_row[$i]['comment_user_name']);
        $comment_user_id = $comment_row[$i]['user_id'];
        $user_row_comment = get_user_info($comment_user_id);
        $comment_user_profile_link = "";
        if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
          $comment_user_name = htmlspecialchars($comment_row[$i][$user_table_fields['user_name']]);
          $comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$comment_user_id);
        }
          $comment_user_profile_link = ($comment_user_profile_link) ? "<a href=\"".$comment_user_profile_link."\">".$comment_user_name."</a>" : $comment_user_name;
       
      if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0)) {
        $thumb_file = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
      }else {
        $thumb_file = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
      }
      $thumb_info = @getimagesize($thumb_file);
      $width = $thumb_info[0];
      $height = $thumb_info[1];
      $dimension = 80;
      $ratio = $width / $height;
      if ($ratio > 1) {
        $new_width = $dimension;
        $new_height = floor(($dimension/$width) * $height);
      }else {
        $new_width = floor(($dimension/$height) * $width);
        $new_height = $dimension;
      }   
      $admin_links = "";
      if ($user_info['user_level'] == ADMIN) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif ($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>";
      }
  $is_new = ($image_row['image_date'] >= (time() - 60 * 60 * 24 * $config['new_cutoff'])) ? 1 : 0;
      $row_bg_number = ($row_bg_number == 2) ? 1 : 2;
      $site_template->register_vars(array(     
          "comment_image_thumb" => (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id)) ? "
  <img src=\"".$thumb_file."\" width=\"".$new_width."\" height=\"".$new_height."\" onClick=\"alert('".$lang['members_only']."');\" border=\"".$config['image_border']."\">" : "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i]['image_id'].((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">
  <img src=\"".$thumb_file."\" width=\"".$new_width."\" height=\"".$new_height."\" border=\"".$config['image_border']."\"></a>",
          "comment_image_name" => (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id)) ? $image_row['image_name'] : "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i]['image_id'].((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$image_row['image_name']."</a>",
          "comment_cat_name" => (!check_permission("auth_viewcat", $cat_id)) ? $image_row['cat_name'] : "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id)."\">".$image_row['cat_name']."</a>",
          "comment_user_name" => $comment_user_profile_link,
          "comment_headline" => format_text($comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
          "comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
          "comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']),
      "admin_links" => $admin_links,
      "image_is_new" => $is_new,
      "lang_new" => $lang['new'],
      "row_bg_number" => $row_bg_number
        ));
        $content .= $site_template->parse_template("member_comment_bit");
      }
    } // end while
  } //end else
 $txt_clickstream = $lang['member_comments']." ".$comment_user_name;
 $txt_clickstream_nohtml = $txt_clickstream;
}

member_comment_bit.html:

Code: [Select]
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td>
<table cellpadding="1" cellspacing="0" border="0">
<tr><td rowspan=2 width="100" valign="top">
{comment_image_thumb}
</td><td colspan="3" width="656" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td valign="top"><b>{comment_image_name}</b>{if image_is_new} <SUP class=new>{lang_new}</SUP>{endif image_is_new}
&nbsp;|&nbsp;{comment_cat_name}</td>
<td valign="top" align="right">
{comment_date}
</td></tr></table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td bgcolor="#dddddd" colspan=2 height="1"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td></tr>
<tr><td>
<b>{comment_headline}</b>
</td><td valign="top" align="right">
{if admin_links}{admin_links}{endif admin_links}{if user_loggedin} {comment_quote}{endif user_loggedin}
</td></tr>
<tr><td bgcolor="#dddddd" colspan=2 height="1"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td></tr></table>
<div class=vert2>&nbsp;</div>
{comment_text}
</td></tr>
</table></td></tr>
<tr><td><hr class="dotted"></td></tr>
</table>
Title: Re: Allow user to edit their own comments (not only ...)
Post by: HorrorCrafT on April 20, 2005, 11:11:15 AM
na gut, ich werde heute abend mal versuchen diesen code (und den auf der 1. seite) zu implementieren und poste dann die info ob es funktioniert hat ... kann das jetzt jemand V@n auf englisch übersetzen?  :wink: :D mir ist es zu peinlich es zu versuchen  :oops:
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Michael on July 12, 2005, 09:59:21 AM
Quote
vor allem wär natürlich sehr wichtig, dass ich wirklich nur MEINE kommentare bearbeiten/löschen kann und nicht jene von anderen usern, bloß weil diese unter einem von meinen bildern stehen!

ist das denn nun gelösst???
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Egly on September 15, 2005, 07:15:26 PM
Got somebody this one working??
For me, it doesnt work...

It would be cool, if somebody could fix that..
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Romson on October 04, 2005, 06:30:35 PM
bei mir funktioniert der von v@no gepostete code ohne probleme

thx v@no !
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Michael on October 04, 2005, 08:37:12 PM
man kann lediglich seine Kommentare zu den eigenen Bildern bearbeiten oder löschen  :(

Der eigene Kommentar zu einem fremden Bild lässt sich nicht bearbeiten !
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Lesik on March 13, 2007, 09:04:06 AM
На сколько я понимаю идет речь о том что бы зарегистрированные пользователи могли править и удалять собственные комментарии. Разработчики почему то привязываются к автору фотографии (т.е. если пользователь разместил фотографию в галерее то он может редактировать все комментарии под своей фотографией но не может редактировать комментарии под чужими фотографиями)
Попробуйте сделать следующее (если в чем то я неправ подскажите):

в файле details.php
найдите:
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>";

и замените на:
Code: [Select]
     elseif ($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>";

в файле members.php
найдите:
Code: [Select]
if ($action == "editcomment") {
  if (!$comment_id || ($config['user_edit_comments'] != 1 && $user_info['user_level'] != ADMIN)) {
    redirect($url);
  }

  $sql = "SELECT c.comment_id, c.image_id, c.user_id AS comment_user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.", "user_name")."
          FROM (".COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.comment_id = $comment_id AND i.image_id = c.image_id";
  $comment_row = $site_db->query_firstrow($sql);
  if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    header("Location: ".$site_sess->url($url, "&"));
    exit;
  }

и замените на:
Code: [Select]
if ($action == "editcomment") {
  if (!$comment_id || ($config['user_edit_comments'] != 1 && $user_info['user_level'] != ADMIN)) {
    redirect($url);
  }

  $sql = "SELECT c.comment_id, c.image_id, c.user_id AS comment_user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.", "user_name")."
          FROM (".COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.comment_id = $comment_id AND i.image_id = c.image_id";
  $comment_row = $site_db->query_firstrow($sql);
  if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['comment_user_id'] && $user_info['user_level'] != ADMIN)) {
    header("Location: ".$site_sess->url($url, "&"));
    exit;
  }

найдите:
Code: [Select]
if ($action == "updatecomment") {
  if (!$comment_id || ($config['user_edit_comments'] != 1 && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }
  $sql = "SELECT c.comment_id, c.image_id, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.", "user_name")."
          FROM (".COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.comment_id = $comment_id AND i.image_id = c.image_id";
  $comment_row = $site_db->query_firstrow($sql);
  if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }

и замените на:
Code: [Select]
if ($action == "updatecomment") {
  if (!$comment_id || ($config['user_edit_comments'] != 1 && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }
  $sql = "SELECT c.comment_id, c.image_id, c.user_id AS comment_user_id, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.", "user_name")."
          FROM (".COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.comment_id = $comment_id AND i.image_id = c.image_id";
  $comment_row = $site_db->query_firstrow($sql);
  echo($user_info['user_id'].' - '.$comment_row['comment_user_id']);
  if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['comment_user_id'] && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }

Title: Re: Allow user to edit their own comments (not only ...)
Post by: woody on March 13, 2007, 08:21:56 PM
Извиняй, у меня это функционирует только при собственных(свойственных) картинах(изображениях). При чужом bild ссылку в наличии, однако, никакую функцию. Имеешь ли ты идею почему? Спасибо и извиняет перевод, является программа перевода.
Greetz Woody  :oops: :wink:
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Lesik on March 20, 2007, 01:26:00 AM
Извиняй, у меня это функционирует только при собственных(свойственных) картинах(изображениях). При чужом bild ссылку в наличии, однако, никакую функцию. Имеешь ли ты идею почему? Спасибо и извиняет перевод, является программа перевода.
Greetz Woody  :oops: :wink:

все описанное выше у меня работает на версии 1.7.4
all described above beside I work at versions 1.7.4 (apologize for translation)
Title: Re: Allow user to edit their own comments (not only ...)
Post by: woody on March 20, 2007, 11:18:20 PM
Oh,that`s the reason why  :oops:
I work with 1.7.1  :wink:
It is a pity.

Greetz Woody
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Lesik on March 21, 2007, 08:40:28 AM
Oh,that`s the reason why  :oops:
I work with 1.7.1  :wink:
It is a pity.

Greetz Woody

может стоит вам установить более свежую версию, хотя бы в целях безопасности
can cost(stand)s you to install more become cool version, in purpose of safety at least
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Yeti on July 04, 2008, 01:10:02 PM
Is there a solution working with 4_images 1.7.6? I tried all abbove without success. Even the russian way for the older version. It should be possible that comment posters edtit their own comments. :?
V@no code to show the links works propperly with 1.7.6 but the users dont have the permisson to edit  their comments.

Gibt es eine Lösung die mit der Version 1.7.6 arbeitet? Ich habe die verschiedenen Lösungen erfolglos ausprobiert. Selbst das auf russisch geschriebene, für älter Versionen. Es muß doch möglich sein das die Schreiber von Kommentaren sie auch wieder ändern.
V@no code um die Links anzuzeigen arbeitet wunderbar, aber die Kommentarschreiber haben ja nicht die Erlaubnis ihre Kommentare zu ändern.
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Yeti on July 13, 2008, 09:31:32 PM
Nobody an idea? :cry:
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Yeti on July 30, 2008, 12:01:13 PM
Is there a solution working with 4_images 1.7.6? I tried all abbove without success. Even the russian way for the older version. It should be possible that comment posters edtit their own comments. :?
V@no code to show the links works propperly with 1.7.6 but the users dont have the permisson to edit  their comments.

Gibt es eine Lösung die mit der Version 1.7.6 arbeitet? Ich habe die verschiedenen Lösungen erfolglos ausprobiert. Selbst das auf russisch geschriebene, für ältere Versionen. Es muß doch möglich sein das die Schreiber von Kommentaren diese auch wieder ändern.
V@no code um die Links anzuzeigen arbeitet wunderbar, aber die Kommentarschreiber haben ja nicht die Erlaubnis ihre Kommentare zu ändern.

Noch mal aus der Tiefe hervorholen...
Just to lift this thread to the top...
Title: Re: Allow user to edit their own comments (not only ...)
Post by: Yeti on October 29, 2008, 12:44:58 AM
nochmal hochholen... Inzwischen jemand da, der die Lösung hat?