4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: thunderstrike on January 03, 2008, 05:24:25 PM

Title: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 03, 2008, 05:24:25 PM
Wooooh  8O
I like :)

// Step 1

In top.php file,

in // Rating block -

find:

Code: [Select]
".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"

replace:

Code: [Select]
".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."&top_list_rating=1&top_list_position=" . $i . "\"

in // Votes block -

find:

Code: [Select]
".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"

replace:

Code: [Select]
".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."&top_list_votes=1&top_list_position=" . $i . "\"

in // Hits block -

find:

Code: [Select]
".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"

replace:

Code: [Select]
".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."&top_list_hits=1&top_list_position=" . $i . "\"

in // Downloads block -

find:

Code: [Select]
".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"

replace:

Code: [Select]
".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."&top_list_downloads=1&top_list_position=" . $i . "\"

// Step 2

In details.php file,

find:

Code: [Select]
if (!$image_id) {
    redirect($url);
}

add after:

Code: [Select]
if (preg_match("/top.php/", $url)) {
   if (isset($HTTP_GET_VARS['top_list_rating']) || isset($HTTP_POST_VARS['top_list_rating'])) {
      $top_list_rating = (isset($HTTP_GET_VARS['top_list_rating'])) ? intval(trim($HTTP_GET_VARS['top_list_rating'])) : intval(trim($HTTP_POST_VARS['top_list_rating']));
   } else {
      $top_list_rating = 0;
   }

   if (isset($HTTP_GET_VARS['top_list_votes']) || isset($HTTP_POST_VARS['top_list_votes'])) {
      $top_list_votes = (isset($HTTP_GET_VARS['top_list_votes'])) ? intval(trim($HTTP_GET_VARS['top_list_votes'])) : intval(trim($HTTP_POST_VARS['top_list_votes']));
   } else {
      $top_list_votes = 0;
   }

   if (isset($HTTP_GET_VARS['top_list_hits']) || isset($HTTP_POST_VARS['top_list_hits'])) {
      $top_list_hits = (isset($HTTP_GET_VARS['top_list_hits'])) ? intval(trim($HTTP_GET_VARS['top_list_hits'])) : intval(trim($HTTP_POST_VARS['top_list_hits']));
   } else {
      $top_list_hits = 0;
   }

   if (isset($HTTP_GET_VARS['top_list_downloads']) || isset($HTTP_POST_VARS['top_list_downloads'])) {
      $top_list_downloads = (isset($HTTP_GET_VARS['top_list_downloads'])) ? intval(trim($HTTP_GET_VARS['top_list_downloads'])) : intval(trim($HTTP_POST_VARS['top_list_downloads']));
   } else {
      $top_list_downloads = 0;
   }

   if (isset($HTTP_GET_VARS['top_list_position']) || isset($HTTP_POST_VARS['top_list_position'])) {
      $top_list_position = (isset($HTTP_GET_VARS['top_list_position'])) ? intval(trim($HTTP_GET_VARS['top_list_position'])) : intval(trim($HTTP_POST_VARS['top_list_position']));
   } else {
      $top_list_position = 0;
   }
}

// Step 3

In includes/functions.php file,

find:

Code: [Select]
global $self_url,

add after (same line):

Code: [Select]
$top_list_rating, $top_list_votes, $top_list_hits, $top_list_downloads, $top_list_position,

find:

Code: [Select]
"thumbnail_openwindow" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, 1),

add after:

Code: [Select]
"top_list_position" => (preg_match("/top.php/", $self_url) && isset($top_list_rating) && $top_list_rating == 1 || isset($top_list_votes) && $top_list_votes == 1 || isset($top_list_hits) && $top_list_hits == 1 || isset($top_list_downloads) && $top_list_downloads == 1 && isset($top_list_position) && $top_list_position > 0) ? true : false,
"lang_top_list_position_title" => $lang['top_list_position_title'],
"lang_top_list_rating" => (isset($top_list_rating) && $top_list_rating == 1 && isset($top_list_position) && $top_list_position > 0) ? preg_replace("/" . $site_template->start . "top_list_position" . $site_template->end . "/siU", $top_list_position, $lang['top_list_rating_position']) : "",
"lang_top_list_votes" => (isset($top_list_votes) && $top_list_votes == 1 && isset($top_list_position) && $top_list_position > 0) ? preg_replace("/" . $site_template->start . "top_list_position" . $site_template->end . "/siU", $top_list_position, $lang['top_list_votes_position']) : "",
"lang_top_list_hits" => (isset($top_list_hits) && $top_list_hits == 1 && isset($top_list_position) && $top_list_position > 0) ? preg_replace("/" . $site_template->start . "top_list_position" . $site_template->end . "/siU", $top_list_position, $lang['top_list_hits_position']) : "",
"lang_top_list_downloads" => (isset($top_list_downloads) && $top_list_downloads == 1 && isset($top_list_position) && $top_list_position > 0) ? preg_replace("/" . $site_template->start . "top_list_position" . $site_template->end . "/siU", $top_list_position, $lang['top_list_downloads_position']) : "",

// Step 4

In lang/english/main.php file,

add in top ?>:

Code: [Select]
$lang['top_list_position_title'] = "Image position in top list";
$lang['top_list_rating_position'] = "This image is on position: <b>{top_list_position}</b> for ranking.";
$lang['top_list_votes_position'] = "This image is on position: <b>{top_list_position}</b> for votes.";
$lang['top_list_hits_position'] = "This image is on position: <b>{top_list_position}</b> for hits.";
$lang['top_list_downloads_position'] = "This image is on position: <b>{top_list_position}</b> for downloads.";

// Step 5

In templates/your_template/details.html file, design HTML table and use this - way you want:

Code: [Select]
{if top_list_position}
{if lang_top_list_rating}{lang_top_list_rating}{endif lang_top_list_rating}
{if lang_top_list_votes}{lang_top_list_votes}{endif lang_top_list_votes}
{if lang_top_list_hits}{lang_top_list_hits}{endif lang_top_list_hits}
{if lang_top_list_downloads}{lang_top_list_downloads}{endif lang_top_list_downloads}
{endif top_list_position}

;)
Title: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 03, 2008, 05:46:13 PM
I fix full post. ;)
Title: [MOD] Sign Detail-Image if it is in Top-List
Post by: skiemor on January 03, 2008, 06:41:16 PM
;-(((( is not shown!
Title: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 03, 2008, 06:45:54 PM
And ... what you use in details.html file ?
Title: [MOD] Sign Detail-Image if it is in Top-List
Post by: skiemor on January 03, 2008, 06:47:36 PM
{if top_list_position}
{if lang_top_list_rating}{lang_top_list_rating}{endif lang_top_list_rating}
{if lang_top_list_votes}{lang_top_list_votes}{endif lang_top_list_votes}
{if lang_top_list_hits}{lang_top_list_hits}{endif lang_top_list_hits}
{if lang_top_list_downloads}{lang_top_list_downloads}{endif lang_top_list_downloads}
{endif top_list_position}

this and I updated main.php
Title: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 03, 2008, 06:48:51 PM
You click in top.php file for see image and try this ?
Title: [MOD] Sign Detail-Image if it is in Top-List
Post by: mawenzi on January 03, 2008, 06:52:17 PM
@skiemor
... very nice idea ...

@thunderstrike
... and very exelent coding ...
... I tested your modification ... with sucess ...
... you should it published in "Mods & Plugins (Requests & Discussions)" ...
... from there I can move it to "Mods & Plugins (Releases & Support)" with your starter-name ...
Title: [MOD] Sign Detail-Image if it is in Top-List
Post by: skiemor on January 03, 2008, 06:55:40 PM
Works, Thunderstrike, you are the greatest :thumbup: !!!
And quickly realized!!!!

Best Chris.
Title: [MOD] Sign Detail-Image if it is in Top-List
Post by: skiemor on January 03, 2008, 07:06:03 PM
he, some pics are in Top-List of rating, voting, hits and comments ---> should be 4 signs???
Title: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 03, 2008, 07:06:55 PM
Quote
should be 4 signs???

1 of each for user click image.
Title: [MOD] Sign Detail-Image if it is in Top-List
Post by: skiemor on January 03, 2008, 07:16:01 PM
Hi Thunderstrike, I changed "downloads" to "comments", is that enough? Because not works for comments ;-)
Title: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 03, 2008, 07:33:30 PM
Quote
Hi Thunderstrike, I changed "downloads" to comments, is that enough? Because not works for comments

Comments is no code in top.php file by Jan. This is right. If need for change name ... you decide for this but is no use and false info to user.  :mrgreen:
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 03, 2008, 08:40:18 PM
@mawenzi:

Quote
Nicky      08:31:26 PM     Splitting the topic "Sign Detail-Image if it is in Top-List?" into two topics.

and I get first post.

Thank Nicky.
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: skiemor on January 03, 2008, 08:58:13 PM
Hi, please help.

In my toplists are:

Rating: don't work - I don't know, whhyyy!!!  :cry:
Votes: work
Hits: work
Comments: work

Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 03, 2008, 09:03:20 PM
Quote
Rating: don't work - I don't know, whhyyy!!!

Sigh - is say ? Is do for no work ?  :roll:
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: skiemor on January 03, 2008, 09:07:48 PM
Quote
Rating: don't work - I don't know, whhyyy!!!

Sigh - is say ? Is do for no work ?  :roll:

Could you check please? What do you need?
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 03, 2008, 09:08:21 PM
For you say what is don't work ... is do ? Is say ? Mawenzi is test this and report no problem . . .
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: mawenzi on January 03, 2008, 09:55:04 PM
(http://img517.imageshack.us/img517/7821/eng9tu.gif) ... a translation for lang/deutsch/main.php file ...
(http://img517.imageshack.us/img517/1378/deu8yc.gif) ... eine Übersetzung für die lang/deutsch/main.php Datei ...

Code: [Select]
$lang['top_list_position_title'] = "Position in Toplist:";
$lang['top_list_rating_position'] = "Dieses Bild ist auf Platz <b>{top_list_position}</b> nach Höhe der Bewertungen.";
$lang['top_list_votes_position'] = "Dieses Bild ist auf Platz <b>{top_list_position}</b> nach Anzahl der Stimmen.";
$lang['top_list_hits_position'] = "Dieses Bild ist auf Platz <b>{top_list_position}</b> nach Anzahl der Hits.";
$lang['top_list_downloads_position'] = "Dieses Bild ist auf Platz <b>{top_list_position}</b> nach Anzahl der Downloads.";

(http://img517.imageshack.us/img517/1378/deu8yc.gif) ... Hinweis :
Die Anzeige der Plätze der Toplist in der Detailseite funktioniert nur über den jeweiligen Link in der Toplist ! Erfolgt der Zugriff auf die Detailseite über einen anderen Link (was eigentlich der Regelfall sein sollte), dann wir an der Stelle nichts angezeigt.
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 03, 2008, 10:14:24 PM
Quote
Die Anzeige der Plätze der Toplist in der Detailseite funktioniert nur über den jeweiligen Link in der Toplist ! Erfolgt der Zugriff auf die Detailseite über einen anderen Link (was eigentlich der Regelfall sein sollte), dann wir an der Stelle nichts angezeigt.

HTML design is left by gallery master. If need for align lines, create HTML table. ;)
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: mawenzi on January 03, 2008, 11:45:50 PM
... my hint ( "Hinweis" ) has nothing to do with html design ...
... it says only the way of working of this MOD over the links in the toplist and not over other 4images links ...
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 04, 2008, 12:00:00 AM
... my hint ( "Hinweis" ) has nothing to do with html design ...
... it says only the way of working of this MOD over the links in the toplist and not over other 4images links ...

Oh ... ok thank for post ...
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: skiemor on January 04, 2008, 09:22:24 PM
Hi, please help.

In my toplists are:

Rating: don't work - I don't know, whhyyy!!!  :cry:
Votes: work
Hits: work
Comments: work



I can't found an error.  :evil:
Is there anybody who likes to checking 5 files???? ;-)))))

Chris.
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 04, 2008, 10:51:06 PM
Problem fix.
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: skiemor on January 05, 2008, 10:19:52 AM
As you can see, the pic is marked with "...image_id=363&top_list_rating=1&top_list_position=1", but the line below the title in detail.html is missing.
For votes, hits and comments it works...

I think, it's an error of mine (not code-problem, mawenzi has tested is with success, everything works), but I can't fix this problem.

Best Chris.
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: Mr_LovaLove on January 05, 2008, 11:32:24 AM
Perfect :)

main.php for arabic

 :flag-sa:
Code: [Select]
$lang['top_list_position_title'] = "ترتيب الصورة في قائمة افضل الصور";
$lang['top_list_rating_position'] = "هذه الصورة تحتل رقم: <b>{top_list_position}</font> من ناحية الترتيب.";
$lang['top_list_votes_position'] = "هذه الصورة تحتل رقم: <b>{top_list_position}</b> من ناحية التصويت";
$lang['top_list_hits_position'] = "هذه الصورة تحتل رقم: <b>{top_list_position}</b> من ناحية المشاهدات";
$lang['top_list_downloads_position'] = "هذه الصورة تحتل رقم: <b>{top_list_position}</b> من ناحية التحميل";

thanks thunder :)
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: Mr_LovaLove on January 05, 2008, 02:37:56 PM
i liked the way u guyz did the mod

but can we do this :

if the image is in the top of the hits  ( number 1 )

we dont have to go to the top and click the link to see the words "$lang['top_list_hits_position'

what i want is to be shown auto in the image itself without going to toplist :S

lets assume that we have image called thunder.gif and its the top of hits

and anyone when see thunder.gif he can see "$lang['top_list_hits_position' :D

is that easy :??


and its better to say

this image is 1st in the hits top list
this image is 2nd in the hits top list


and so on
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 05, 2008, 02:57:38 PM
Quote
i liked the way u guyz did the mod

You guys ?? I only create the MOD and publish. :?

Quote
what i want is to be shown auto in the image itself without going to toplist

I no like, sorry. This is slow down gallery.

Quote
and its better to say

this image is 1st in the hits top list
this image is 2nd in the hits top list

Easy - you need edit includes/functions.php file in show_image function. ;)
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: Mr_LovaLove on January 05, 2008, 05:40:58 PM
Sorry

Code: [Select]
Quote
i liked the way u guyz did the mod


You guys ?? I only create the MOD and publish.


thanks thunder

include guyz not mean they made this MOD :P i mean the idea was from someone and the coding from u :P

anyway sorry for misunderstanding

Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 05, 2008, 06:54:30 PM
Ok, is no problem. ;)
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: skiemor on January 07, 2008, 03:45:05 PM
Hi Thunderstrike, if this installed: [Mod] Search Engine Friendly URLs aka Short URLs
http://www.4homepages.de/forum/index.php?topic=6729.msg29453#msg29453

it can't work, right?

Chris.
Title: Re: [MOD] Sign Detail-Image if it is in Top-List
Post by: thunderstrike on January 07, 2008, 07:48:25 PM
Quote
it can't work, right?

SEO URL MOD is nothing do with my MOD ... why you need work SEO with MOD ? ...