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: $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?