4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 18, 2018, 08:08:09 PM

Login with username, password and session length
Search:     Advanced search
4images is now on facebook. Click here and become a fan!
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Issues / Ausgaben
| |-+  Discussion & Troubleshooting (Moderators: Acidgod, ivan, Rembrandt)
| | |-+  readcomments MOD
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: readcomments MOD  (Read 9880 times)
JensF
Addicted member
******
Offline Offline

Posts: 1028

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« on: January 23, 2006, 01:58:24 AM »

Hi there,

at a few time ago in this board where a mod that user can see new comments from his images. Today i have see that it brings me a blank page when i click on this link

http://www.terraristik-galerie.de/member.php?action=readcomments

I don┤t have find this Mod and i have no changes made in the member.php at a long time. Can anyone say me what is wrong with it??
This is the function in the member.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
if ($action == "readcomments") {
  if ($user_info['user_level'] >= GUEST) {
    header("Location: ".$site_sess->url($url, "&"));
    exit;
  }
   $txt_clickstream = "Comments";
   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 <= 15; $i++) {
     $setvalue = 1 * $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);
   $commentsperpage_dropdown_form = $site_template->parse_template("member_commentsdropdown_form");
   $site_template->register_vars("commentsperpage_dropdown_form", $commentsperpage_dropdown_form);

  $sql = "SELECT COUNT(c.comment_id) AS comments
        FROM ".COMMENTS_TABLE." c
        LEFT JOIN ".IMAGES_TABLE." i ON i.image_id = c.image_id
        WHERE i.user_id = ".$user_info['user_id']." AND c.is_read = 0";
   $result = $site_db->query_firstrow($sql);
   $site_db->free_result();
   $num_comments = $result['comments'];
   if ($action == "postcomment") {
      $page = ceil($num_comments / $commentperpage);
   }
   $num_rows_all = (isset($num_comments)) ? $num_comments : 0;
   $link_arg = $site_sess->url(ROOT_PATH."member.php?action=readcomments");
   include(ROOT_PATH.'includes/paging.php');
   $getpaging = new Paging($page, $commentperpage, $num_rows_all, $link_arg, $lang['comment_stats'], "comments");
   $offset = $getpaging->get_offset();
   $get_comment_stats = ($num_comments) ? $getpaging->get_paging_stats() : "";
   $comment_stats = preg_replace("/image/", "comment", $get_comment_stats);
   $site_template->register_vars(array(
     "paging" => $getpaging->get_paging(),
     "paging_stats" => $comment_stats
   ));
  $additional_sql = "";
  if (!empty($additional_user_fields)) {
    $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, i.image_id, i.cat_id, i.image_name, i.image_media_file, i.image_thumb_file".$additional_sql.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")."
        FROM ".COMMENTS_TABLE." c
        LEFT JOIN ".IMAGES_TABLE." i ON i.image_id = c.image_id
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
        WHERE i.user_id = ".$user_info['user_id']." AND c.is_read = 0
        ORDER BY c.comment_date 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);

  if (!$num_comments) {
    $comments = "<tr><td class=\"commentrow1\" colspan=\"2\"> Es sind keine ungelesenen Kommentare vorhanden. </td></tr>";
  }
  else {
    $comments = "";
    $bgcounter = 0;
    for ($i = 0; $i < $num_comments; $i++) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;

      $comment_user_email = "";
      $comment_user_email_save = "";
      $comment_user_mailform_link = "";
      $comment_user_email_button = "";
      $comment_user_homepage_button = "";
      $comment_user_icq_button = "";
      $comment_user_profile_button = "";
      $comment_user_status_img = REPLACE_EMPTY;
      $comment_user_name = htmlspecialchars($comment_row[$i]['comment_user_name']);
      $comment_user_info = $lang['userlevel_guest'];

      $comment_user_id = $comment_row[$i]['user_id'];

      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_button = "<a href=\"".$comment_user_profile_link."\"><img src=\"".get_gallery_image("profile.gif")."\" border=\"0\" alt=\"".$comment_user_name."\" /></a>";
       
        $comment_user_status_img = ($comment_row[$i][$user_table_fields['user_lastaction']] >= (time() - 300) && ((isset($comment_row[$i][$user_table_fields['user_invisible']]) && $comment_row[$i][$user_table_fields['user_invisible']] == 0) || $user_info['user_level'] == ADMIN)) ? "<img src=\"".get_gallery_image("user_online.gif")."\" border=\"0\" alt=\"Online\" />" : "<img src=\"".get_gallery_image("user_offline.gif")."\" border=\"0\" alt=\"Offline\" />";
       
        $comment_user_homepage = (isset($comment_row[$i][$user_table_fields['user_homepage']])) ? format_url($comment_row[$i][$user_table_fields['user_homepage']]) : "";
        if (!empty($comment_user_homepage)) {
          $comment_user_homepage_button = "<a href=\"".$comment_user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$comment_user_homepage."\" /></a>";
        }
       
        $comment_user_icq = (isset($comment_row[$i][$user_table_fields['user_icq']])) ? $comment_row[$i][$user_table_fields['user_icq']] : "";
        if (!empty($comment_user_icq)) {
          $comment_user_icq_button = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=".$comment_user_icq."\" target=\"_blank\"><img src=\"http://web.icq.com/whitepages/online?icq=".$comment_user_icq."&img=5\" width=\"18\" height=\"18\" border=\"0\" alt=\"".$comment_user_icq."\" /></a>";
        }
       
        if (!empty($comment_row[$i][$user_table_fields['user_email']]) && (!isset($comment_row[$i][$user_table_fields['user_showemail']]) || (isset($comment_row[$i][$user_table_fields['user_showemail']]) && $comment_row[$i][$user_table_fields['user_showemail']] == 1))) {
          $comment_user_email = $comment_row[$i][$user_table_fields['user_email']];
          $comment_user_email_save = str_replace("@", " at ", $comment_row[$i][$user_table_fields['user_email']]);
          if (!empty($url_mailform)) {
            $comment_user_mailform_link = $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_mailform));
          }
          else {
            $comment_user_mailform_link = $site_sess->url(ROOT_PATH."member.php?action=mailform&amp;".URL_USER_ID."=".$comment_user_id);
          }
          $comment_user_email_button = "<a href=\"".$comment_user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$comment_user_email_save."\" /></a>";
        }

        if (!isset($comment_row[$i][$user_table_fields['user_level']]) || (isset($comment_row[$i][$user_table_fields['user_level']]) && $comment_row[$i][$user_table_fields['user_level']] == USER)) {
          $comment_user_info = $lang['userlevel_user'];
        }
        elseif ($comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
          $comment_user_info = $lang['userlevel_admin'];
        }
       
        $comment_user_info .= "<br />";
        $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
        $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
      }

      $comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";
     
      $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 ($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>";
      }
      $image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i]['image_id']);
     $image_link = "<b><a href=\"".$image_url."\">".$comment_row[$i]['image_name']."</a></b>";
      $site_template->register_vars(array(
        "thumb" => "<a href=\"".$image_url."\">".get_thumbnail_code($comment_row[$i]['image_media_file'], $comment_row[$i]['image_thumb_file'], $comment_row[$i]['image_id'], $comment_row[$i]['cat_id'])."</a>",
        "count" => $i,
        "image_name" => $image_link,
        "comment_id" => $comment_row[$i]['comment_id'],
        "comment_user_id" => $comment_user_id,
        "comment_user_status_img" => $comment_user_status_img,
        "comment_user_name" => $comment_user_name,
        "comment_user_info" => $comment_user_info,
        "comment_user_profile_button" => $comment_user_profile_button,
        "comment_user_email" => $comment_user_email,
        "comment_user_email_save" => $comment_user_email_save,
        "comment_user_mailform_link" => $comment_user_mailform_link,
        "comment_user_email_button" => $comment_user_email_button,
        "comment_user_homepage_button" => $comment_user_homepage_button,
        "comment_user_icq_button" => $comment_user_icq_button,
        "comment_user_ip" => $comment_user_ip,
        "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']),
        "row_bg_number" => $row_bg_number,
        "admin_links" => $admin_links
      ));
      $comments .= $site_template->parse_template("new_comment_bit");
    } // end while
  } //end else
  $site_template->register_vars("comments", $comments);
  unset($comments); 
 
  $content = $site_template->parse_template("member_comments");
 
}
Logged

Mit freundlichem Gru▀
Jens Funk



-> Sorry for my bad English <-
TheOracle
Hero Member
*****
Offline Offline

Posts: 875

Thank You
-Given: 0
-Receive: 3


View Profile
« Reply #1 on: January 23, 2006, 02:12:57 AM »

Find :

Quote  [Expand]

if ($action == "readcomments") {
  if ($user_info['user_level'] >= GUEST) {
    header("Location: ".$site_sess->url($url, "&"));
    exit;
  }


replace with :

1
2
3
4
5
6
7
8
9

if ($action == "readcomments") {
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;
   }


Then, find :

Quote  [Expand]

unset($comments);
 
  $content = $site_template->parse_template("member_comments");


add below :


Wink
Logged
JensF
Addicted member
******
Offline Offline

Posts: 1028

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #2 on: January 23, 2006, 02:19:16 AM »

I think this is no help for me. You say me abou the
1
if ($action == "showcomments") {
function.

This i have over the
1
if ($action == "readcomments") {
function

This is my full member.php

Member.php
Logged

Mit freundlichem Gru▀
Jens Funk



-> Sorry for my bad English <-
TheOracle
Hero Member
*****
Offline Offline

Posts: 875

Thank You
-Given: 0
-Receive: 3


View Profile
« Reply #3 on: January 23, 2006, 02:26:53 AM »

I think this is no help for me. You say me abou the
1
if ($action == "showcomments") {
function.


I'm ... not sure what you mean exacly ... your paragraph from your first post indicates the "readcomments" and not "showcomments" ... is there something I'm missing ?

[ edit ]

The topic I have showed above, now I get it. You're right, it was looking so much similar I forgot to look at the action name. My apologize.  Embarassed

However, fortunitely, I gave you more instructions with that. Wink
Logged
TheOracle
Hero Member
*****
Offline Offline

Posts: 875

Thank You
-Given: 0
-Receive: 3


View Profile
« Reply #4 on: January 23, 2006, 03:18:30 AM »

@JensF:

Ok, I have just took a look at your entire file and it would seems this MOD is depending on other codings from other files that might of been instructed so from the original package of the " read comments " MOD. Meaning, if it cannot be found no more, on this forum, it is unlikely it could be easily resolved.  Neutral
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #5 on: January 23, 2006, 03:31:53 AM »

Here is a google cached page of that mod.

* [MOD] Show Received Comments V.2.zip (15.01 KB - downloaded 290 times.)
Logged

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)
JensF
Addicted member
******
Offline Offline

Posts: 1028

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #6 on: January 23, 2006, 11:18:38 AM »

Here is a google cached page of that mod.

HI, thanks for this. Now i have reinstall the Mod and it works....but where can i find site 2 and 3 from the Mod???

Logged

Mit freundlichem Gru▀
Jens Funk



-> Sorry for my bad English <-
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #7 on: January 23, 2006, 02:24:10 PM »

If you mean pages 2 and 3 of that mod, then I guess they are gone...Sad
Logged

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)
JensF
Addicted member
******
Offline Offline

Posts: 1028

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #8 on: January 23, 2006, 10:53:39 PM »

If you mean pages 2 and 3 of that mod, then I guess they are gone...Sad

Yes, this is what i mean. But OK.....The Mod works but without thumbnails...It┤s OK!!!
Logged

Mit freundlichem Gru▀
Jens Funk



-> Sorry for my bad English <-
Loda
Sr. Member
****
Offline Offline

Posts: 353

Thank You
-Given: 32
-Receive: 9


View Profile WWW
« Reply #9 on: January 23, 2006, 11:37:25 PM »

hallo!
thank you very much!
the mod works. I've the same problem with the thumbnails, too.
it's display the thumb of the first comment into the next followed comments.
Logged
JensF
Addicted member
******
Offline Offline

Posts: 1028

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #10 on: January 23, 2006, 11:47:29 PM »

Bei mir wird gar kein Thumb angezeigt, nur der Link Name den man dann auch anklicken kann. Bevor das Ding bei mir gechrasht ist (ich wei▀ immer noch nicht wieso) da konnte ich auch das Thumbnail sehen.....

Aber ich bin froh das es so erstmal wieder geht Smile
Logged

Mit freundlichem Gru▀
Jens Funk



-> Sorry for my bad English <-
TRAKTOR_WEB
Pre-Newbie

Offline Offline

Posts: 3

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #11 on: September 30, 2012, 08:34:30 AM »

V@no, подскажите как сделать исключение для своих комментариев, чтобы они на этой странице не отображались?
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.083 seconds with 19 queries.
Post your comments here