Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - vanish

Pages: 1 2 [3] 4 5
31
Clickstream included in header not shown.

32
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>

33
2 Vano: this solution don't working

34
Somebody has found the correct solution?

35
I want to say, what "CLOSING BRACKET" in two cases (with and without MOD  "Auto Image Resizing ") not the same. That's all.

36
Quote
Step 1.3.
Find Code:
Code: [Select]
     }


    if (!$uploaderror) {

but
Code: [Select]
     }

-------------- Here is placed code from your MOD "Auto Image Resizing "---------------------------

    if (!$uploaderror) {

many people will have a troubles  8)

37
What about Step 1.3 if "Auto Image Resizing " is installed?

38
Discussion & Troubleshooting / Re: Some pictures not displayed
« on: April 10, 2005, 10:49:30 PM »
2V@no: Of course  :), only for first comment:
Quote
some pictures can just not be found, e.g.:
- The button that should be displayed under "Comments" (Kommentare) right under a picture
- In the details view of a picture the 4 buttons to flip between the images

39
In your template file whos_online.html after {lang_user_online_detail} you can see ":". Remove it!

Also I highly recommend you protect directories on your web-server. I can easy browse its content and download your template files and pictures.

40
Discussion & Troubleshooting / Re: Some pictures not displayed
« on: April 10, 2005, 10:33:37 PM »
This is problem with images which is displayed on page many times. To resolve this you must preload this images.
Include in template files this script:
Code: [Select]
<script language="javascript" type="text/javascript">
<!--
if (document.images) {
pic1 = new Image ();
pic1.src = "{template_url}/images/pic1";
pic2 = new Image ();
pic2.src = "{template_url}/images/pic2";
...
}

41
but NOW there is a ":" too much

What does it mean - "Too much"?

1. in main.php:
Code: [Select]
$lang['user_online_detail'] = "There are currently <b>{num_registered_online}</b> registered user(s) ({num_invisible_online} among them invisible) and <b>{num_guests_online}</b> guest(s) online{user_online_end}";

2. in sessions.php as mentioned above.

42
1. instead
Code: [Select]
"user_online_end" => ($user_online_list) ? ":" : ".",
find
Code: [Select]
  $site_template->register_vars(array(
    "num_total_online" => $num_total_online,

and insert above
Code: [Select]
$user_online_end = ($user_online_list) ? ":" : ".";
2. find
Code: [Select]
    "lang_user_online_detail" => str_replace(array('{num_registered_online}','{num_invisible_online}','{num_guests_online}'), array($num_registered_online,$num_invisible_online,$num_guests_online), $lang['user_online_detail']),

replace
Code: [Select]
    "lang_user_online_detail" => str_replace(array('{num_registered_online}','{num_invisible_online}','{num_guests_online}','{user_online_end}'), array($num_registered_online,$num_invisible_online,$num_guests_online,$user_online_end), $lang['user_online_detail']),

43
V@no where are u? Why do u keep silent?

44
Also after changes in image_utils.php I see problem after upload file...
Another image you can see on screen after upload procedure: Added one file (right file name), on screen -  another file

45
For example:
image - 580x700
1. Resize by width - set width 500 (not change height-1024), check correct radio button(by wigth) - GO! - correct new size in table (500x603) - GO!:
Result - fine! Picture is 500x603. Super...
continue with this picture...
2. Resize by height - set height 600 (not change width-1024), check correct radio button(by height) - GO! - correct new size in table (498x600) - GO!:
Result - WRONG! Picture is 849x1024. Bad...

3.If I set new height < image height and, check radio button proportionally images not changed

Pages: 1 2 [3] 4 5