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

Pages: [1]
1
Hello, all!
I used this  --> [MOD] Show user images in profile

I make new file details_user.php and copy in this  -> code from details.php
Please, help with NEXT PREV thumbs only from USER (Not category)

Please, Help !
My code:
Code:  
Code: [Select]
$act_key = array_search($image_id, $image_id_cache);
$next_image_id = (isset($image_id_cache[$act_key + 1])) ? $image_id_cache[$act_key + 1] : 0;
$next1_image_id = (isset($image_id_cache[$act_key + 2])) ? $image_id_cache[$act_key + 2] : 0;
$prev_image_id = (isset($image_id_cache[$act_key - 1])) ? $image_id_cache[$act_key - 1] : 0;
$prev1_image_id = (isset($image_id_cache[$act_key - 2])) ? $image_id_cache[$act_key - 2] : 0;
unset($image_id_cache);

// Get next and previous image
if (!empty($next_prev_cache[$next_image_id])) {
  $next_image_name = format_text($next_prev_cache[$next_image_id]['image_name'], 2);
  $next_image_url = $site_sess->url("/profile/pic".$next_image_id.((!empty($mode)) ? "&mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    $next_image_file = ICON_PATH."/404.gif";
  }
  else {
    $next_image_file = get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    $next_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next_image_id]['image_media_file']).".gif";
  }
  else {
    $next_thumb_file = get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
}
else {
  $next_image_name = REPLACE_EMPTY;
  $next_image_url = REPLACE_EMPTY;
  $next_image_file = REPLACE_EMPTY;
  $next_thumb_file = REPLACE_EMPTY;
}

if (!empty($next_prev_cache[$next1_image_id])) {
  $next1_image_name = format_text($next_prev_cache[$next1_image_id]['image_name'], 2);
  $next1_image_url = $site_sess->url("/profile/pic".$next1_image_id.((!empty($mode)) ? "&mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$next1_image_id]['image_media_file'], "media", $next_prev_cache[$next1_image_id]['cat_id'], 0, 0)) {
    $next1_image_file = ICON_PATH."/404.gif";
  }
  else {
    $next1_image_file = get_file_path($next_prev_cache[$next1_image_id]['image_media_file'], "media", $next_prev_cache[$next1_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$next1_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next1_image_id]['cat_id'], 0, 0)) {
    $next1_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next1_image_id]['image_media_file']).".gif";
  }
  else {
    $next1_thumb_file = get_file_path($next_prev_cache[$next1_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next1_image_id]['cat_id'], 0, 1);
  }
}
else {
  $next1_image_name = REPLACE_EMPTY;
  $next1_image_url = REPLACE_EMPTY;
  $next1_image_file = REPLACE_EMPTY;
  $next1_thumb_file = REPLACE_EMPTY;
}


if (!empty($next_prev_cache[$prev_image_id])) {
  $prev_image_name = format_text($next_prev_cache[$prev_image_id]['image_name'], 2);
  $prev_image_url = $site_sess->url("/profile/pic".$prev_image_id.((!empty($mode)) ? "&mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    $prev_image_file = ICON_PATH."/404.gif";
  }
  else {
    $prev_image_file = get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    $prev_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev_image_id]['image_media_file']).".gif";
  }
  else {
    $prev_thumb_file = get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
}
else {
  $prev_image_name = REPLACE_EMPTY;
  $prev_image_url = REPLACE_EMPTY;
  $prev_image_file = REPLACE_EMPTY;
  $prev_thumb_file = REPLACE_EMPTY;
}

if (!empty($next_prev_cache[$prev1_image_id])) {
  $prev1_image_name = format_text($next_prev_cache[$prev1_image_id]['image_name'], 2);
  $prev1_image_url = $site_sess->url("/profile/pic".$prev1_image_id.((!empty($mode)) ? "&mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$prev1_image_id]['image_media_file'], "media", $next_prev_cache[$prev1_image_id]['cat_id'], 0, 0)) {
    $prev1_image_file = ICON_PATH."/404.gif";
  }
  else {
    $prev1_image_file = get_file_path($next_prev_cache[$prev1_image_id]['image_media_file'], "media", $next_prev_cache[$prev1_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$prev1_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev1_image_id]['cat_id'], 0, 0)) {
    $prev1_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev1_image_id]['image_media_file']).".gif";
  }
  else {
    $prev1_thumb_file = get_file_path($next_prev_cache[$prev1_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev1_image_id]['cat_id'], 0, 1);
  }
}
else {
  $prev1_image_name = REPLACE_EMPTY;
  $prev1_image_url = REPLACE_EMPTY;
  $prev1_image_file = REPLACE_EMPTY;
  $prev1_thumb_file = REPLACE_EMPTY;
}

$site_template->register_vars(array(
  "next_image_id" => $next_image_id,
  "next_image_name" => $next_image_name,
  "next_image_url" => $next_image_url,
  "next_image_file" => $next_image_file,
  "next_thumb_file" => $next_thumb_file,
  "next1_image_id" => $next1_image_id,
  "next1_image_name" => $next1_image_name,
  "next1_image_url" => $next1_image_url,
  "next1_image_file" => $next1_image_file,
  "next1_thumb_file" => $next1_thumb_file,
  "prev_image_id" => $prev_image_id,
  "prev_image_name" => $prev_image_name,
  "prev_image_url" => $prev_image_url,
  "prev_image_file" => $prev_image_file,
  "prev_thumb_file" => $prev_thumb_file,
  "prev1_image_id" => $prev1_image_id,
  "prev1_image_name" => $prev1_image_name,
  "prev1_image_url" => $prev1_image_url,
  "prev1_image_file" => $prev1_image_file,
  "prev1_thumb_file" => $prev1_thumb_file
));
unset($next_prev_cache);

Who know this problem?

2
Mods & Plugins (Releases & Support) / Re: [MOD] Show user images in profile
« on: December 14, 2009, 10:25:43 PM »
2 V@no!

Hello, all!
I used this  --> [MOD] Show user images in profile

I make new file details_user.php and copy in this  -> code from details.php
Please, help with NEXT PREV thumbs only from USER (Not category)

Please, Help !
My code:
Code: 
Code: [Select]
$act_key = array_search($image_id, $image_id_cache);
$next_image_id = (isset($image_id_cache[$act_key + 1])) ? $image_id_cache[$act_key + 1] : 0;
$next1_image_id = (isset($image_id_cache[$act_key + 2])) ? $image_id_cache[$act_key + 2] : 0;
$prev_image_id = (isset($image_id_cache[$act_key - 1])) ? $image_id_cache[$act_key - 1] : 0;
$prev1_image_id = (isset($image_id_cache[$act_key - 2])) ? $image_id_cache[$act_key - 2] : 0;
unset($image_id_cache);

// Get next and previous image
if (!empty($next_prev_cache[$next_image_id])) {
  $next_image_name = format_text($next_prev_cache[$next_image_id]['image_name'], 2);
  $next_image_url = $site_sess->url("/profile/pic".$next_image_id.((!empty($mode)) ? "&mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    $next_image_file = ICON_PATH."/404.gif";
  }
  else {
    $next_image_file = get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    $next_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next_image_id]['image_media_file']).".gif";
  }
  else {
    $next_thumb_file = get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
}
else {
  $next_image_name = REPLACE_EMPTY;
  $next_image_url = REPLACE_EMPTY;
  $next_image_file = REPLACE_EMPTY;
  $next_thumb_file = REPLACE_EMPTY;
}

if (!empty($next_prev_cache[$next1_image_id])) {
  $next1_image_name = format_text($next_prev_cache[$next1_image_id]['image_name'], 2);
  $next1_image_url = $site_sess->url("/profile/pic".$next1_image_id.((!empty($mode)) ? "&mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$next1_image_id]['image_media_file'], "media", $next_prev_cache[$next1_image_id]['cat_id'], 0, 0)) {
    $next1_image_file = ICON_PATH."/404.gif";
  }
  else {
    $next1_image_file = get_file_path($next_prev_cache[$next1_image_id]['image_media_file'], "media", $next_prev_cache[$next1_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$next1_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next1_image_id]['cat_id'], 0, 0)) {
    $next1_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next1_image_id]['image_media_file']).".gif";
  }
  else {
    $next1_thumb_file = get_file_path($next_prev_cache[$next1_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next1_image_id]['cat_id'], 0, 1);
  }
}
else {
  $next1_image_name = REPLACE_EMPTY;
  $next1_image_url = REPLACE_EMPTY;
  $next1_image_file = REPLACE_EMPTY;
  $next1_thumb_file = REPLACE_EMPTY;
}


if (!empty($next_prev_cache[$prev_image_id])) {
  $prev_image_name = format_text($next_prev_cache[$prev_image_id]['image_name'], 2);
  $prev_image_url = $site_sess->url("/profile/pic".$prev_image_id.((!empty($mode)) ? "&mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    $prev_image_file = ICON_PATH."/404.gif";
  }
  else {
    $prev_image_file = get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    $prev_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev_image_id]['image_media_file']).".gif";
  }
  else {
    $prev_thumb_file = get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
}
else {
  $prev_image_name = REPLACE_EMPTY;
  $prev_image_url = REPLACE_EMPTY;
  $prev_image_file = REPLACE_EMPTY;
  $prev_thumb_file = REPLACE_EMPTY;
}

if (!empty($next_prev_cache[$prev1_image_id])) {
  $prev1_image_name = format_text($next_prev_cache[$prev1_image_id]['image_name'], 2);
  $prev1_image_url = $site_sess->url("/profile/pic".$prev1_image_id.((!empty($mode)) ? "&mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$prev1_image_id]['image_media_file'], "media", $next_prev_cache[$prev1_image_id]['cat_id'], 0, 0)) {
    $prev1_image_file = ICON_PATH."/404.gif";
  }
  else {
    $prev1_image_file = get_file_path($next_prev_cache[$prev1_image_id]['image_media_file'], "media", $next_prev_cache[$prev1_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$prev1_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev1_image_id]['cat_id'], 0, 0)) {
    $prev1_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev1_image_id]['image_media_file']).".gif";
  }
  else {
    $prev1_thumb_file = get_file_path($next_prev_cache[$prev1_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev1_image_id]['cat_id'], 0, 1);
  }
}
else {
  $prev1_image_name = REPLACE_EMPTY;
  $prev1_image_url = REPLACE_EMPTY;
  $prev1_image_file = REPLACE_EMPTY;
  $prev1_thumb_file = REPLACE_EMPTY;
}

$site_template->register_vars(array(
  "next_image_id" => $next_image_id,
  "next_image_name" => $next_image_name,
  "next_image_url" => $next_image_url,
  "next_image_file" => $next_image_file,
  "next_thumb_file" => $next_thumb_file,
  "next1_image_id" => $next1_image_id,
  "next1_image_name" => $next1_image_name,
  "next1_image_url" => $next1_image_url,
  "next1_image_file" => $next1_image_file,
  "next1_thumb_file" => $next1_thumb_file,
  "prev_image_id" => $prev_image_id,
  "prev_image_name" => $prev_image_name,
  "prev_image_url" => $prev_image_url,
  "prev_image_file" => $prev_image_file,
  "prev_thumb_file" => $prev_thumb_file,
  "prev1_image_id" => $prev1_image_id,
  "prev1_image_name" => $prev1_image_name,
  "prev1_image_url" => $prev1_image_url,
  "prev1_image_file" => $prev1_image_file,
  "prev1_thumb_file" => $prev1_thumb_file
));
unset($next_prev_cache);

Who know this problem?

3
Mods & Plugins (Releases & Support) / Re: [MOD] Show user images in profile
« on: November 17, 2009, 09:32:43 PM »
2 V@no;
thanks, it`s my mistake, Thanx, Great 4images!

4
Mods & Plugins (Releases & Support) / Re: [MOD] Show user images in profile
« on: November 15, 2009, 11:18:15 PM »
Hello All

I used this code on  user_name=username   but paging in this code don`t working, if  i want to see pictures in structure

/member.php?action=showprofile&user_name=ataka

PLEASE, administrators and users help me!


Code: [Select]
//-----------------------------------------------------
//--- START Show user images in profile ---------------
//-----------------------------------------------------
$imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
  $imgtable_width .= "%";
}

$additional_sql = "";
if (!empty($additional_image_fields)) {
  foreach ($additional_image_fields as $key => $val) {
    $additional_sql .= ", i.".$key;
  }
}

$sql1 = "SELECT COUNT(*) as user_count_images
        FROM ".IMAGES_TABLE."
        WHERE user_id = $user_id";
        $row = $site_db->query_firstrow($sql1);
        $user_total_images = $row['user_count_images'];

$site_template->register_vars($lang['user_profile_images'] = preg_replace("/".$site_template->start."user_total_images".$site_template->end."/siU", $user_total_images, $lang['user_profile_images']));
unset($user_total_images);

$user_images = 10; // SET HERE HOW MUCH IMAGES SHOULD BE SHOWN

    $user_name = (isset($HTTP_POST_VARS['user_name']) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_name'])) : (isset($HTTP_GET_VARS['user_name']) ? un_htmlspecialchars(trim($HTTP_GET_VARS['user_name'])) : ""));

$sql2 = "SELECT COUNT(i.user_id) AS images
        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_active = 1 AND c.cat_id = i.cat_id AND i.user_id = $user_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")";

  $result = $site_db->query_firstrow($sql2);
  $num_images = $result['images'];
$site_db->free_result();
$num_rows_all = (isset($num_images)) ? $num_images : 0;
$link_arg = $site_sess->url(ROOT_PATH."member.php?action=showprofile&user_name=$user_name");
include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $user_images, $num_rows_all, $link_arg);
$offset = $getpaging->get_offset();
$site_template->register_vars(array("paging" => $getpaging->get_paging(),"paging_stats" => $getpaging->get_paging_stats()
));

$sql3 = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
       WHERE ".get_user_table_field("", "user_name")." = '".strtolower($user_name)."' AND  i.image_active = 1 AND c.cat_id = i.cat_id
        ORDER BY i.image_date DESC
        LIMIT $offset, $user_images";

$result = $site_db->query($sql3);
$num_rows = $site_db->get_numrows($result);

if (!$num_rows)  {
  $user_profile_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $user_profile_images .= $lang['no_new_images'];
  $user_profile_images .= "</td></tr></table>";
}
else  {
  $user_profile_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  $count = 0;
  $bgcounter = 0;
  while ($image_row = $site_db->fetch_array($result)){
    $user_named = format_text($image_row['user_name'], 2);
    if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $user_profile_images .= "\n";
    }
    $user_profile_images .= "\n";

    show_image($image_row);
    $user_profile_images .= $site_template->parse_template("thumbnail_bit");
    $user_profile_images .= "\n";
    $count++;
    if ($count == $config['image_cells']) {
      $user_profile_images .= "\n";
      $count = 0;
    }
  } // end while
 
  if ($count > 0)  {
    $leftover = ($config['image_cells'] - $count);
    if ($leftover >= 1) {
      for ($f = 0; $f < $leftover; $f++) {
        $user_profile_images .= "\n";
      }
      $user_profile_images .= "\n";
    }
  }
  $user_profile_images .= "\n";
} // end else


$site_template->register_vars("user_profile_images", $user_profile_images);
$site_template->register_vars("lang_user_profile_images", $lang['user_profile_images']);
unset($user_profile_images);
//-----------------------------------------------------
//--- END Show user images in profile -----------------
//----------------------------------------------------- 

Pages: [1]