Author Topic: [MOD] Sign Detail-Image if it is in Top-List  (Read 30307 times)

0 Members and 1 Guest are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
[MOD] Sign Detail-Image if it is in Top-List
« 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}

;)
« Last Edit: February 18, 2011, 02:01:45 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
[MOD] Sign Detail-Image if it is in Top-List
« Reply #1 on: January 03, 2008, 05:46:13 PM »
I fix full post. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

skiemor

  • Guest
[MOD] Sign Detail-Image if it is in Top-List
« Reply #2 on: January 03, 2008, 06:41:16 PM »
;-(((( is not shown!

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
[MOD] Sign Detail-Image if it is in Top-List
« Reply #3 on: January 03, 2008, 06:45:54 PM »
And ... what you use in details.html file ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

skiemor

  • Guest
[MOD] Sign Detail-Image if it is in Top-List
« Reply #4 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

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
[MOD] Sign Detail-Image if it is in Top-List
« Reply #5 on: January 03, 2008, 06:48:51 PM »
You click in top.php file for see image and try this ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
[MOD] Sign Detail-Image if it is in Top-List
« Reply #6 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 ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

skiemor

  • Guest
[MOD] Sign Detail-Image if it is in Top-List
« Reply #7 on: January 03, 2008, 06:55:40 PM »
Works, Thunderstrike, you are the greatest :thumbup: !!!
And quickly realized!!!!

Best Chris.

skiemor

  • Guest
[MOD] Sign Detail-Image if it is in Top-List
« Reply #8 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???

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
[MOD] Sign Detail-Image if it is in Top-List
« Reply #9 on: January 03, 2008, 07:06:55 PM »
Quote
should be 4 signs???

1 of each for user click image.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

skiemor

  • Guest
[MOD] Sign Detail-Image if it is in Top-List
« Reply #10 on: January 03, 2008, 07:16:01 PM »
Hi Thunderstrike, I changed "downloads" to "comments", is that enough? Because not works for comments ;-)
« Last Edit: January 03, 2008, 07:33:24 PM by skiemor »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
[MOD] Sign Detail-Image if it is in Top-List
« Reply #11 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:
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Sign Detail-Image if it is in Top-List
« Reply #12 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.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

skiemor

  • Guest
Re: [MOD] Sign Detail-Image if it is in Top-List
« Reply #13 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


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Sign Detail-Image if it is in Top-List
« Reply #14 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:
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?