4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Vraxor on November 05, 2002, 10:08:02 AM

Title: [Mod] Toplist altered
Post by: Vraxor on November 05, 2002, 10:08:02 AM
Yesterday I started changing the code of 4 images for the first time and with succes. I altered the Toplist to show a top 10 of Most commented images.

I also added some lines to the top.php file to show the thumbnails, this last edit took me many hours since I do not have any programming skills yet, I'm a quick learner so I will be able to mange soon enough I think ;-)

Feel free to take a look and if enough people love the way I changed the toplist I might write a tutorial here.

to view the toplist: http://haunter.student.utwente.nl/Terrarevolution/galleries/top.php

Cheers,
Vraxor
Title: [Mod] Toplist altered
Post by: Jaap12 on November 05, 2002, 10:52:28 AM
very cool!!! please tell how you did this !! i'm very intrested in your modification. Can you please email the source?

Or tell how you did this?

Dutch :)

Zou je kunnen vertellen hoe je dit hebt gedaan? Ik heb er echt heel veel belangstelling voor. Is dit ook mogelijk om op andere pagina's weer te geven?
Title: [Mod] Toplist altered
Post by: Vraxor on November 05, 2002, 11:28:06 AM
Hi Xippix,

I will keep this in english although I know you are Dutch too.

I have absolutely no knowledge of coding (whatever language) so I just tried and tried and succeeded. Now comes the problem I guess and that is that I use version 1.6.1 instead of 1.7

This is because I had some problems with gettig the 1.7 version to work a 100% correct. I do not yet know if the toplist code is the same or not, but we can always try. if you have some basic knowlegde of php I will just hand over some of the code I added to the top.php file and maybe you can check if this works for 1.7 too.

Cheers,
Vraxor
Title: [Mod] Toplist altered
Post by: Jaap12 on November 05, 2002, 12:06:36 PM
Hi Vraxor,

Ok we will keep it in english  :)

I can't test it, i use 1.6 to :)

I have the same probs with 1.7.
Please send the code or share it with us.

Regards,

Bas
info@xippix.nl
Title: [Mod] Toplist altered
Post by: Vraxor on November 05, 2002, 12:32:16 PM
Ok,

I'm at work right now, but I will see if I can find some time later, maybe this evening to post the code. I will also write a tutorial later on in how to edit the toplist to your own liking, it isn't really hard to do and maybe one of the best pages to edit if you like to see direct results of your actions.

Cheers,
Vraxor
Title: [Mod] Toplist altered
Post by: Jaap12 on November 05, 2002, 02:15:28 PM
ok i'm looking forward

if you have time, please mail the script to me

info@xippix.nl i can take a closer look at it.
Title: [Mod] Toplist altered
Post by: Vraxor on November 05, 2002, 07:25:17 PM
Here I post the Top.php code I altered. You should be able to create the needed changes in the Top template and add a new line in the English and german language main.php file.

Code: [Select]
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name
        FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_votes DESC
        LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 20; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    $register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
    $register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
  }
  else {
    $register_array['image_rating_'.$i] = "--";
    $register_array['image_rating_user_'.$i] = "--";
    $register_array['image_rating_cat_'.$i] = "--";
    $register_array['image_rating_number_'.$i] = "--";
    $register_array['image_rating_thumb_'.$i] = "--";
  }
}

// Votes
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name
        FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
        ORDER BY i.image_votes DESC, i.image_name ASC
        LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 20; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_votes_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_votes_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    $register_array['image_votes_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    $register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
    $register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
  }
  else {
    $register_array['image_votes_'.$i] = "--";
    $register_array['image_votes_user_'.$i] = "--";
    $register_array['image_votes_cat_'.$i] = "--";
    $register_array['image_votes_number_'.$i] = "--";
    $register_array['image_votes_thumb_'.$i] = "--";
  }
}

// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_hits, c.cat_name, u.user_name
        FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
        ORDER BY i.image_hits DESC, i.image_name ASC
        LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 20; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_hits_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_hits_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    $register_array['image_hits_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    $register_array['image_hits_number_'.$i] = "<b>".$top_list[$i]['image_hits']."</b>";
    $register_array['image_hits_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
  }
  else {
    $register_array['image_hits_'.$i] = "--";
    $register_array['image_hits_user_'.$i] = "--";
    $register_array['image_hits_cat_'.$i] = "--";
    $register_array['image_hits_number_'.$i] = "--";
    $register_array['image_hits_thumb_'.$i] = "--";
  }
}

// Downloads
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_downloads, c.cat_name, u.user_name
        FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
        ORDER BY i.image_downloads DESC, i.image_name ASC
        LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 20; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_downloads_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_downloads_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    $register_array['image_downloads_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    $register_array['image_downloads_number_'.$i] = "<b>".$top_list[$i]['image_downloads']."</b>";
    $register_array['image_downloads_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
  }
  else {
    $register_array['image_downloads_'.$i] = "--";
    $register_array['image_downloads_user_'.$i] = "--";
    $register_array['image_downloads_cat_'.$i] = "--";
    $register_array['image_downloads_number_'.$i] = "--";
    $register_array['image_downloads_thumb_'.$i] = "--";
  }
}

// Comments
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, c.cat_name, u.user_name
        FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
        ORDER BY i.image_comments DESC, i.image_votes DESC
        LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 20; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_comments_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_comments_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_comments_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    $register_array['image_comments_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    $register_array['image_comments_number_'.$i] = "<b>".$top_list[$i]['image_comments']."</b>";
    $register_array['image_comments_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";


  }
  else {
    $register_array['image_comments_'.$i] = "--";
    $register_array['image_comments_user_'.$i] = "--";
    $register_array['image_comments_cat_'.$i] = "--";
    $register_array['image_comments_number_'.$i] = "--";
    $register_array['image_comments_thumb_'.$i] = "--";
  }
}


As you can see I copied almost the entire Top.php file and I leave it up to you to find the things I changed.

Note that this is only a part of the code from top.php and I do not know if this will be compatible with 4images 1.7 since I use 1.6.1

If there are any questions, please feel free to ask me and I will see if I can help.

Cheers,
Vraxor
http://Http://Terra.2ya.com
Title: [Mod] Toplist altered
Post by: Jaap12 on November 05, 2002, 08:00:28 PM
well, what i need to do?

paste the code in a php document and call it top.php?

i have do that, and replace it but i get this error:

Fatal error: Call to a member function on a non-object in /home/zippie/HTML/top.php on line 8


what can i do to fix it?
Title: [Mod] Toplist altered
Post by: Vraxor on November 05, 2002, 08:03:33 PM
I already said that this was only part of the top.php file, so you have to past this code inside the top.php file, but only replace the code covered by the code I posted above. In this case I will send you my top.php file so that you can see what I did.

to see any difference you also need to edit the top.html template to let it use the new comments top and show the thumbnails.

Cheers,
Vraxor
Title: [Mod] Toplist altered
Post by: Jaap12 on November 05, 2002, 08:06:41 PM
thx, i will wait for the mail. Plz send the top.html file to.
Title: [Mod] Toplist altered
Post by: Jaap12 on November 05, 2002, 09:05:55 PM
mm i install it, but i get some errors

Code: [Select]

Parse error: parse error in /home/zippie/HTML/top.php on line 61


do you know what it is?
Title: [Mod] Toplist altered
Post by: Vraxor on November 05, 2002, 09:07:53 PM
This should be the line on row 61:

Code: [Select]
   $register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);

Please compare
Title: Yes, it's compatible with 1.7
Post by: Chris on November 06, 2002, 02:33:44 AM
Quote from: Vraxor
Here I post the Top.php code I altered. You should be able to create the needed changes in the Top template and add a new line in the English and german language mail.php file.

Code: [Select]
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file,


As you can see I copied almost the entire Top.php file and I leave it up to you to find the things I changed.

Note that this is only a part of the code from top.php and I do not know if this will be compatible with 4images 1.7 since I use 1.6.1

I just tried this myself and found adding the thumbs to top.html in this manner works perfectly with 4images 1.7

Bravo!  Thanks for a super mod.  It's just so much better to have the thumbnails in the top list as it makes using the top list more appealing.  Hopefully Jan will take this up as a feature in the next release.
Title: [Mod] Toplist altered
Post by: Vraxor on November 06, 2002, 06:15:47 AM
Thanks Chris,

I thought so too, but it would be even better if seperated thumbnail where made for the top. At this moment I use the already existing thumbnails. Those have a width of 100x*, but I resize them in html to 48x36. This only effects the way the top looks, but everybody is still loading the entire range of thumbnails.

I was at first planning to just let te toplist show more then 10 images. For example I wanted a top 50. I soon figured out that each section of top.php was seperate so it was possible to create a top 50 of best rankings and a top 100 of most hits. the only thing needed to change in order to show more images in the top is to change the following values in each section:

Code: [Select]
ORDER BY i.image_rating DESC, i.image_votes DESC
        LIMIT 20";

Code: [Select]
for ($i = 1; $i <= 20; $i++) {
  if (isset($top_list[$i])) {

If you change the value (in the example I have made a top 20, so change the 20 in both lines)

I plan about explaining the way you can edit the toplist more in a tutorial so that everybody can edit the toplist him/herself and of course it would be great if Jan implemented the changes I made in the 1.8 version.

Cheers,
Vraxor
Title: [Mod] Toplist altered
Post by: Jaap12 on November 06, 2002, 11:34:17 AM
mm strange? why it doesn't work here?

i get some line errors. see post above
Title: [Mod] Toplist altered
Post by: Mec4D on November 06, 2002, 05:23:47 PM
Hey It is really great idea..can you please help me and tell me what you ad to the top.html template

what I need to ad to the every line in the top.html ?

Code: [Select]
<tr>
                            <td valign="top" class="row1" align="center"><b>1</b></td>
                            <td valign="top" class="row1">{image_rating_1}</td>
                            <td valign="top" class="row1">{image_rating_user_1}</td>
                            <td valign="top" class="row1">{image_rating_cat_1}</td>
                            <td valign="top" class="row1" nowrap="nowrap">{image_rating_number_1}</td>
                          </tr>
                         


I try but this don't show anything and the top.php was reworked correct.

Thank you for your help

Groetjes!
Title: [Mod] Toplist altered
Post by: Vraxor on November 06, 2002, 06:34:53 PM
ok, this should help you on your way:

Code: [Select]
{image_comments_thumb_1}

I kep the same style as the original files I just created my own top for comments and by using the template call above you show the first thumbnail in the Comments top.

The rest of the template should be altered using similar strings.

Cheers,
Vraxor
Title: [Mod] Toplist altered
Post by: Mec4D on November 06, 2002, 06:43:49 PM
thank you very much!!!

I got this now :)

Hugs!
Title: [Mod] Toplist altered
Post by: dabri on November 06, 2002, 07:28:22 PM
I use 4images 1.7 und want to add this feature.

I add the following code:

Code: [Select]

// Comments
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, 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 i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_comments DESC, i.image_votes ASC
        LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_comments_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_comments_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_comments_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    $register_array['image_comments_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    $register_array['image_comments_number_'.$i] = "<b>".$top_list[$i]['image_comments']."</b>";
    $register_array['image_comments_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";


  }
  else {
    $register_array['image_comments_'.$i] = "--";
    $register_array['image_comments_user_'.$i] = "--";
    $register_array['image_comments_cat_'.$i] = "--";
    $register_array['image_comments_number_'.$i] = "--";
    $register_array['image_comments_thumb_'.$i] = "--";
  }
}


But I have this error:

Code: [Select]

DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, c.cat_name, u.username FROM 4images_images i, 4images_categories c LEFT JOIN phpbb_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id ORDER BY i.image_comments DESC, i.image_votes ASC LIMIT 10
The table 'SQL1e2ee38_0' is full


You can check this:

http://www.brinkmann-online.de/umleitung/4images/top3.php

Where is the fault, can yomebody help me

Thanks Daniel
Title: [Mod] Toplist altered
Post by: Vraxor on November 06, 2002, 07:34:33 PM
try replacing the code you gave by this:

Code: [Select]
// Comments
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, c.cat_name, u.user_name
        FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
        ORDER BY i.image_comments DESC, i.image_votes DESC
        LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_comments_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_comments_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_comments_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    $register_array['image_comments_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    $register_array['image_comments_number_'.$i] = "<b>".$top_list[$i]['image_comments']."</b>";
    $register_array['image_comments_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";


  }
  else {
    $register_array['image_comments_'.$i] = "--";
    $register_array['image_comments_user_'.$i] = "--";
    $register_array['image_comments_cat_'.$i] = "--";
    $register_array['image_comments_number_'.$i] = "--";
    $register_array['image_comments_thumb_'.$i] = "--";
  }
}
Title: [Mod] Toplist altered
Post by: dabri on November 06, 2002, 07:39:28 PM
Sorry, but it didn´t work.

May be another solution?

Thanks Daniel
Title: [Mod] Toplist altered
Post by: Vraxor on November 06, 2002, 07:40:45 PM
then the error is probably not in the code you gave,

sorry but I use version 1.6.1 so I do not know about any differences
Hope someone else could help you out.
Title: [Mod] Toplist altered
Post by: Mec4D on November 06, 2002, 10:07:29 PM
I use 1.7 and all works as well without any problems..

I see from you message that your MQSL have little problem:

( LIMIT 10 The table 'SQL1e2ee38_0' is full ) so this have nothing to do with the bad code only your MQSL
Title: [Mod] Toplist altered
Post by: sprokop on November 07, 2002, 04:55:37 AM
Man,

It worked right ou of the box!!!! no plug and pray  :wink: . Fantastic mod and for sure it has to make its way in the new release!

I just see a little bug! :cry: well just an oversee I think. If you display other media types on your gallery the thumbnails for these are stored somewhere else (different directory)! and in that case when the value pairs get built  the URL for the media type is wrong resulting in a broken link/image. Not a huge deal, I need to look in your mod to find out where it is. It might be as easy as copying the other media type gif thumbs into each categories directories? dunno yet!   -- Remember to always BACKUP! before you try a mod!!

Thanks a lot!
Sam
Title: [Mod] Toplist altered
Post by: Vraxor on November 07, 2002, 06:08:47 AM
well, you are right about that.

and I now see the error myself. You will have to look for this string in each part of top.php. Since I only work with jpg files I did not see the bug, but in here I hardcoded the path to the thumbnails.

Code: [Select]
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";

There should be a way to keep it dynamic, but I just don't know how yet.

Cheers,
Vraxor
Title: [Mod] Toplist altered
Post by: V@no on November 08, 2002, 04:08:55 AM
and now it shows different images in "top 10 images by rating" with same rating. does script changed sequense of choosing images with same rating?
Title: [Mod] Toplist altered
Post by: sprokop on November 08, 2002, 05:12:14 AM
Dunno? that's a good question for Jan!!

Good Luck
Sam
Title: [Mod] Toplist altered
Post by: cyber on November 15, 2002, 04:17:06 PM
Hi..
I SEE the module on your page and it is fantastic.. Great Job.
Dude it is possible to pub on the web a "tutorial" with we need to do, add... but a tutorial complete..
Tks.
Title: question
Post by: limes on November 16, 2002, 10:20:46 AM
hi,

great mod, but it will not work at my page.

what must an in the English and german language mail.php file?

thx
markus oeder
Title: [Mod] Toplist altered
Post by: threelum on November 16, 2002, 07:41:05 PM
thanks Vraxor  :D  :D  :D

it works fine with v1.7
Title: hm?
Post by: limes on November 17, 2002, 12:11:51 AM
you wrote at the first page of the thread:

"... Here I post the Top.php code I altered. You should be able to create the needed changes in the Top template and add a new line in the English and german language mail.php file..."

i can't find am "mail.php"-file. what file do you mean?
Title: Typo
Post by: Chris on November 17, 2002, 02:35:50 AM
Vraxor meant "main.php"  You can find this file under each language pack directory.
Title: [Mod] Toplist altered
Post by: Vraxor on November 17, 2002, 08:31:25 AM
:o , sorry now I understand what you meant by Mail.php  :oops:

yes, this should be main.php, I really have a problem with typing  :)

Cheers,
Vraxor
Title: aha
Post by: limes on November 17, 2002, 10:33:01 AM
ok, thank you  :D

but, what " ... new line in the English and german language main.php file ..." i have to insert???
Title: [Mod] Toplist altered
Post by: threelum on November 17, 2002, 06:27:37 PM
look at the code,

you have now 5 categories in the top.php and the new one is comments. you must add the new comment tag in the ../lang/english(deutsch)/main.php. It is only for the new comments header {lang_top_image_comments} in the top.html and you must modify in all language packs you are use.

1. add the comments description in the image details

Code: [Select]

//-----------------------------------------------------
//--- Image Details --------------------------------
//-----------------------------------------------------

$lang['hits'] = "Hits:";
$lang['downloads'] = "Downloads:";
$lang['rating'] = "Rating:";
$lang['votes'] = "Vote(s)";
$lang['comments']="Comments";


2. add the comments tag the top images details and if you have set more then 10 Top images you must change this to your prefer (5,20,50,?). look to the top.html here is the {lang_top_image_comments}

Code: [Select]

//-----------------------------------------------------
//--- Top Images --------------------------------------
//-----------------------------------------------------
$lang['top_image_hits'] = "Top 10 images by hits";
$lang['top_image_downloads'] = "Top 10 images by downloads";
$lang['top_image_rating'] = "Top 10 images by rating";
$lang['top_image_votes'] = "Top 10 images by votes";
$lang['top_image_comments'] = "Top 10 images by comments";


3. change of top.html for the new thumbnails

add a new tablerow for the thumbnails. in the new cells you write the thumb tag {image_hits_thumb_1} {image_downloads_thumb_1} {image_rating_thumb_1} {image_votes_thumb_1} and so on (_2, _3, _4,...) for the different top categories.

4. change the top.html for the new comment category

add new tablecells for the new top comments category. in the header you write {lang_top_image_comments} and in the cells you write the same as in the hits, downloads, rating,... but modifying the new comments tag z.B. {image_comments_thumb_1} {image_comments_1} {image_comments_user_1} {image_comments_cat_1} {image_comments_number_1} and so on (_2, _3, _4,...).

 i hope it's clear
 
 much fun threelum
Title: [Mod] Toplist altered
Post by: V@no on January 02, 2003, 08:08:08 PM
finaly got it work... :D
but... :?  how about media files? it displays bronken picture.
Title: [Mod] Toplist altered
Post by: V@no on January 02, 2003, 08:48:25 PM
ok, fixed that.
if anyone need it I'll post the code. :wink:
Title: i need the code
Post by: limes on January 02, 2003, 08:50:57 PM
hi,

ich need the code:
macho@imperium.de
thx
markus
Title: help
Post by: Jasondavis on January 03, 2003, 01:25:56 AM
V@no if it's possible could u send me your files that r edited? Im lost on this mod but I want it
Title: Yes please
Post by: Chris on January 03, 2003, 02:50:35 AM
Quote from: V@no
ok, fixed that.
if anyone need it I'll post the code. :wink:


Please post it.  Thanks.
Title: [Mod] Toplist altered
Post by: V@no on January 03, 2003, 04:03:16 AM
Ok, there is not much to change in the Vraxor's code
I will show on example of RATING code.
so, here it goes:
1. u need add i.image_media_file in $sql line, in each part for RATING, VOTES, DOWNLOADS, HITS:
Quote
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_media_file, i.image_rating, i.image_votes, c.cat_name, u.user_name

2. add after line in each part for RATING, VOTES, DOWNLOADS, HITS:
Code: [Select]
for ($i = 1; $i <= 20; $i++) {
this code:
Code: [Select]
 if (isset($top_list[$i])) {
           if (empty($top_list[$i]['image_thumb_file'])) {
                  $thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
         }else {
                   $thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
         }
}

3. change this:
Code: [Select]
   $register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";to this:
Code: [Select]
   $register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"".$thumb_file."\" width=\"48\" height=\"36\" border=\"1\" alt=\"\" />";
so, basicaly all u need is to change in last code - "<img src=....>"
Code: [Select]
<img src=\"".$thumb_file."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />
for VOTES, DOWNLOADS, HITS u'll need change in step 3. :
image_rating_thumb_
to:
image_votes_thumb_
image_downloads_thumb_
image_hits_thumb_
hope that's understandable...;)
Title: [Mod] Toplist altered
Post by: Amosnet on January 07, 2003, 01:16:56 PM
I get an "not found" Error, if i have no Thumbnail set for a picture.
For Example if a Video File ist locatet in the TOp Script, you have
no standart Thumbnail. Then you get: (http://www.amosnet.de/4images/data/thumbnails/69/)

Anyone a idea?

http://www.amosnet.de/4images/top.php
Title: [Mod] Toplist altered
Post by: V@no on January 07, 2003, 08:39:10 PM
did u missed my post above?  8O
Title: [Mod] Toplist altered
Post by: limes on January 12, 2003, 11:46:31 PM
i get a broken image if i have no Thumbnail set for a picture.

when i add after line in each part for RATING, VOTES, DOWNLOADS, HITS: Code:

Code: [Select]
for ($i = 1; $i <= 20; $i++) {
 
this code: Code:
  if (isset($top_list[$i])) {
           if (empty($top_list[$i]['image_thumb_file'])) {
                  $thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
         }else {
                   $thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
         }  


i get a php error.
Title: [Mod] Toplist altered
Post by: Amosnet on January 17, 2003, 02:35:54 PM
Can somebody please post the code for the broken link problem please?
Title: MOD Tutorial
Post by: te-ga on January 19, 2003, 06:42:00 PM
Hello guys!!!

I took me about 30 minutes to find out how to intstall this MOD, I tried reading all 3 pages, finally gave up and made a new way of changing files based on the code of Vraxor.

The main file to be changed is top.php. There are 4 sections there named

Code: [Select]
// Rating
// Votes
// Hits
// Downloads


They are all the same, just have different setting for showing photos - Rating sorts images by rating and so on.

So all we need to do is:

1. In each section find:

Code: [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id,

at the end of the line ADD:

Code: [Select]
, i.image_thumb_file

Note that you should do this for all 4 sections of the top.php file.

2. After in the //Rating part of the file you should find

Code: [Select]
$register_array['image_rating_number_'.$i]

and add add the new line below this line:

Code: [Select]
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";

then find

Code: [Select]
$register_array['image_rating_number_'.$i] = "--";

and add below this line:

Code: [Select]
$register_array['image_rating_thumb_'.$i] = "--";

You are now finished with the //Rating part of the top.php file.

Now you have 3 more parts to finish:

Code: [Select]

// Votes
// Hits
// Downloads


Do the same as stated in 2. but don't forget to change way sorting is done. Just the //Rating part we were adding ['image_rating_thumg_'.$i], so in //Votes part we should add ['image_votes_part_'.$i] and so on. Don't forget to change it all the rest 3 parts!

3. In the top.html file you should add 1 column in the tables and paste this code to the corresponding parts:

Code: [Select]
{image_hits_thumb_1}
{image_downloads_thumb_1}
{image_rating_thumb_1}
{image_votes_thumb_1}


For each new row don't forget to change _1 to _2 and so on...

You can also play with the size of the thumbnails. Just find the width= in your code and put the setting you need.



Hope this helps!!!!


With deep respect to the 4homepages.de Gallery Author and site users,

Te-Ga.

------------------

Just in case you still can't figure out how to change the top.php file I am including the 1.7 version top.php file.


Code: [Select]

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File&#58; top.php                                              *
 *        Copyright&#58; &#40;C&#41; 2002 Jan Sorgalla                                *
 *            Email&#58; jan@4homepages.de                                    *
 *              Web&#58; http&#58;//www.4homepages.de                             *
 *    Scriptversion&#58; 1.7                                                  *
 *                                                                        *
 *    Never released without support from&#58; Nicky &#40;http&#58;//www.nicky.net&#41;   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen &#40;Lizenz.txt&#41; für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    &#40;Licence.txt&#41; for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 'top';

define&#40;'GET_CACHES', 1&#41;;
define&#40;'ROOT_PATH', './'&#41;;
include&#40;ROOT_PATH.'global.php'&#41;;
require&#40;ROOT_PATH.'includes/sessions.php'&#41;;
$user_access get_permission&#40;&#41;;
include&#40;ROOT_PATH.'includes/page_header.php'&#41;;

$cat_match_sql = &#40;$cat_id && check_permission&#40;"auth_viewcat", $cat_id&#41;&#41; ? "AND i.cat_id = '$cat_id' " &#58; "";
$register_array = array&#40;&#41;;

$cat_id_sql get_auth_cat_sql&#40;"auth_viewcat", "NOTIN"&#41;;

// Rating
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field&#40;", u.", "user_name"&#41;.", i.image_thumb_file
        
FROM ".IMAGES_TABLE." i".CATEGORIES_TABLE." 
        LEFT JOIN 
".USERS_TABLE." u ON &#40;".get_user_table_field&#40;"u.", "user_id"&#41;." = i.user_id&#41; 
        
WHERE i.image_active AND i.cat_id NOT IN &#40;$cat_id_sql&#41; AND i.cat_id = c.cat_id 
        
$cat_match_sql 
        ORDER BY i
.image_rating DESCi.image_name ASC
        LIMIT 10
";
$result = $site_db->query&#40;$sql&#41;;
$top_list = array&#40;&#41;;
$i = 1;
while &#40;
$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;
  
$top_list[$i&#93; = $row;
  
$i++;
&#125;
$site_db->free_result&#40;&#41;;

for &#40;
$i = 1; $i <= 10; $i++&#41; &#123;
  if &#40;isset&#40;
$top_list[$i&#93;&#41;&#41; &#123;
    
$register_array['image_rating_'.$i&#93; = &#40;check_permission&#40;"auth_viewimage", $top_list[$i&#93;['cat_id'&#93;&#41;&#41; ? "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i&#93;['image_id'&#93;&#41;."\">".htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;."</a>" &#58; htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;;
    
$register_array['image_rating_openwindow_'.$i&#93; = &#40;check_permission&#40;"auth_viewimage", $top_list[$i&#93;['cat_id'&#93;&#41;&#41; ? "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i&#93;['image_id'&#93;&#41;."\" onclick=\"opendetailwindow&#40;&#41;\" target=\"detailwindow\">".htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;."</a>" &#58; htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;;
    
if &#40;isset&#40;$top_list[$i&#93;[$user_table_fields['user_name'&#93;&#93;&#41; && $top_list[$i&#93;['user_id'&#93; != GUEST&#41; &#123;
      
$user_profile_link = &#40;!empty&#40;$url_show_profile&#41;&#41; ? preg_replace&#40;"/&#123;user_id&#125;/", $top_list[$i&#93;['user_id'&#93;, $url_show_profile&#41; &#58; ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i&#93;['user_id'&#93;;
      
$register_array['image_rating_user_'.$i&#93; = "<a href=\"".$site_sess->url&#40;$user_profile_link&#41;."\">".htmlspecialchars&#40;$top_list[$i&#93;[$user_table_fields['user_name'&#93;&#93;&#41;."</a>";
    
&#125;
    
else &#123;
      
$register_array['image_rating_user_'.$i&#93; = $lang['userlevel_guest'&#93;;
    
&#125;
    
$register_array['image_rating_cat_'.$i&#93; = "<a href=\"".$site_sess->url&#40;ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i&#93;['cat_id'&#93;&#41;."\">".htmlspecialchars&#40;$top_list[$i&#93;['cat_name'&#93;&#41;."</a>";
    
$register_array['image_rating_number_'.$i&#93; = "<b>".$top_list[$i&#93;['image_rating'&#93;."</b> &#40;".$top_list[$i&#93;['image_votes'&#93;." ".$lang['votes'&#93;."&#41;";
    
$register_array['image_rating_thumb_'.$i&#93; = "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i&#93;['image_id'&#93;&#41;."\"><img src=\"data/thumbnails/".$top_list[$i&#93;['cat_id'&#93;."/".$top_list[$i&#93;['image_thumb_file'&#93;."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />"; 
  
&#125;
  
else &#123;
    
$register_array['image_rating_'.$i&#93; = "--";
    
$register_array['image_rating_user_'.$i&#93; = "--";
    
$register_array['image_rating_cat_'.$i&#93; = "--";
    
$register_array['image_rating_number_'.$i&#93; = "--";
    
$register_array['image_rating_thumb_'.$i&#93; = "--";
  
&#125;
&#125;

// Votes
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field&#40;", u.", "user_name"&#41;.", i.image_thumb_file
        
FROM ".IMAGES_TABLE." i".CATEGORIES_TABLE." 
        LEFT JOIN 
".USERS_TABLE." u ON &#40;".get_user_table_field&#40;"u.", "user_id"&#41;." = i.user_id&#41; 
        
WHERE i.image_active AND i.cat_id NOT IN &#40;$cat_id_sql&#41; AND i.cat_id = c.cat_id 
        
$cat_match_sql 
        ORDER BY i
.image_votes DESCi.image_name ASC 
        LIMIT 10
";
$result = $site_db->query&#40;$sql&#41;;
$top_list = array&#40;&#41;;
$i = 1;
while &#40;
$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;
  
$top_list[$i&#93; = $row;
  
$i++;
&#125;
$site_db->free_result&#40;&#41;;

for &#40;
$i = 1; $i <= 10; $i++&#41; &#123;
  if &#40;isset&#40;
$top_list[$i&#93;&#41;&#41; &#123;
    
$register_array['image_votes_'.$i&#93; = &#40;check_permission&#40;"auth_viewimage", $top_list[$i&#93;['cat_id'&#93;&#41;&#41; ? "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i&#93;['image_id'&#93;&#41;."\">".htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;."</a>" &#58; htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;;
    
$register_array['image_votes_openwindow_'.$i&#93; = &#40;check_permission&#40;"auth_viewimage", $top_list[$i&#93;['cat_id'&#93;&#41;&#41; ? "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i&#93;['image_id'&#93;&#41;."\" onclick=\"opendetailwindow&#40;&#41;\" target=\"detailwindow\">".htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;."</a>" &#58; htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;;
    
if &#40;isset&#40;$top_list[$i&#93;[$user_table_fields['user_name'&#93;&#93;&#41; && $top_list[$i&#93;['user_id'&#93; != GUEST&#41; &#123;
      
$user_profile_link = &#40;!empty&#40;$url_show_profile&#41;&#41; ? preg_replace&#40;"/&#123;user_id&#125;/", $top_list[$i&#93;['user_id'&#93;, $url_show_profile&#41; &#58; ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i&#93;['user_id'&#93;;
      
$register_array['image_votes_user_'.$i&#93; = "<a href=\"".$site_sess->url&#40;$user_profile_link&#41;."\">".htmlspecialchars&#40;$top_list[$i&#93;[$user_table_fields['user_name'&#93;&#93;&#41;."</a>";
    
&#125;
    
else &#123;
      
$register_array['image_votes_user_'.$i&#93; = $lang['userlevel_guest'&#93;;
    
&#125;
    
$register_array['image_votes_cat_'.$i&#93; = "<a href=\"".$site_sess->url&#40;ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i&#93;['cat_id'&#93;&#41;."\">".htmlspecialchars&#40;$top_list[$i&#93;['cat_name'&#93;&#41;."</a>";
    
$register_array['image_votes_number_'.$i&#93; = "<b>".$top_list[$i&#93;['image_rating'&#93;."</b> &#40;".$top_list[$i&#93;['image_votes'&#93;." ".$lang['votes'&#93;."&#41;";
    
$register_array['image_votes_thumb_'.$i&#93; = "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i&#93;['image_id'&#93;&#41;."\"><img src=\"data/thumbnails/".$top_list[$i&#93;['cat_id'&#93;."/".$top_list[$i&#93;['image_thumb_file'&#93;."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />"; 
  
&#125;
  
else &#123;
    
$register_array['image_votes_'.$i&#93; = "--";
    
$register_array['image_votes_user_'.$i&#93; = "--";
    
$register_array['image_votes_cat_'.$i&#93; = "--";
    
$register_array['image_votes_number_'.$i&#93; = "--";
    
$register_array['image_votes_thumb_'.$i&#93; = "--";
  
&#125;
&#125;

// Hits
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, c.cat_name".get_user_table_field&#40;", u.", "user_name"&#41;.", i.image_thumb_file
        
FROM ".IMAGES_TABLE." i".CATEGORIES_TABLE." 
        LEFT JOIN 
".USERS_TABLE." u ON &#40;".get_user_table_field&#40;"u.", "user_id"&#41;." = i.user_id&#41; 
        
WHERE i.image_active AND i.cat_id NOT IN &#40;$cat_id_sql&#41; AND i.cat_id = c.cat_id 
        
$cat_match_sql 
        ORDER BY i
.image_hits DESCi.image_name ASC 
        LIMIT 10
";
$result = $site_db->query&#40;$sql&#41;;
$top_list = array&#40;&#41;;
$i = 1;
while &#40;
$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;
  
$top_list[$i&#93; = $row;
  
$i++;
&#125;
$site_db->free_result&#40;&#41;;

for &#40;
$i = 1; $i <= 10; $i++&#41; &#123;
  if &#40;isset&#40;
$top_list[$i&#93;&#41;&#41; &#123;
    
$register_array['image_hits_'.$i&#93; = &#40;check_permission&#40;"auth_viewimage", $top_list[$i&#93;['cat_id'&#93;&#41;&#41; ? "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i&#93;['image_id'&#93;&#41;."\">".htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;."</a>" &#58; htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;;
    
$register_array['image_hits_openwindow_'.$i&#93; = &#40;check_permission&#40;"auth_viewimage", $top_list[$i&#93;['cat_id'&#93;&#41;&#41; ? "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i&#93;['image_id'&#93;&#41;."\" onclick=\"opendetailwindow&#40;&#41;\" target=\"detailwindow\">".htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;."</a>" &#58; htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;;
    
if &#40;isset&#40;$top_list[$i&#93;[$user_table_fields['user_name'&#93;&#93;&#41; && $top_list[$i&#93;['user_id'&#93; != GUEST&#41; &#123;
      
$user_profile_link = &#40;!empty&#40;$url_show_profile&#41;&#41; ? preg_replace&#40;"/&#123;user_id&#125;/", $top_list[$i&#93;['user_id'&#93;, $url_show_profile&#41; &#58; ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i&#93;['user_id'&#93;;
      
$register_array['image_hits_user_'.$i&#93; = "<a href=\"".$site_sess->url&#40;$user_profile_link&#41;."\">".htmlspecialchars&#40;$top_list[$i&#93;[$user_table_fields['user_name'&#93;&#93;&#41;."</a>";
    
&#125;
    
else &#123;
      
$register_array['image_hits_user_'.$i&#93; = $lang['userlevel_guest'&#93;;
    
&#125;
    
$register_array['image_hits_cat_'.$i&#93; = "<a href=\"".$site_sess->url&#40;ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i&#93;['cat_id'&#93;&#41;."\">".htmlspecialchars&#40;$top_list[$i&#93;['cat_name'&#93;&#41;."</a>";
    
$register_array['image_hits_number_'.$i&#93; = "<b>".$top_list[$i&#93;['image_hits'&#93;."</b>";
    
$register_array['image_hits_thumb_'.$i&#93; = "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i&#93;['image_id'&#93;&#41;."\"><img src=\"data/thumbnails/".$top_list[$i&#93;['cat_id'&#93;."/".$top_list[$i&#93;['image_thumb_file'&#93;."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />"; 
  
&#125;
  
else &#123;
    
$register_array['image_hits_'.$i&#93; = "--";
    
$register_array['image_hits_user_'.$i&#93; = "--";
    
$register_array['image_hits_cat_'.$i&#93; = "--";
    
$register_array['image_hits_number_'.$i&#93; = "--";
    
$register_array['image_hits_thumb_'.$i&#93; = "--";
  
&#125;
&#125;

// Downloads
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, c.cat_name".get_user_table_field&#40;", u.", "user_name"&#41;.", i.image_thumb_file
        
FROM ".IMAGES_TABLE." i".CATEGORIES_TABLE." 
        LEFT JOIN 
".USERS_TABLE." u ON &#40;".get_user_table_field&#40;"u.", "user_id"&#41;." = i.user_id&#41; 
        
WHERE i.image_active AND i.cat_id NOT IN &#40;$cat_id_sql&#41; AND i.cat_id = c.cat_id 
        
$cat_match_sql 
        ORDER BY i
.image_downloads DESCi.image_name ASC 
        LIMIT 10
";
$result = $site_db->query&#40;$sql&#41;;
$top_list = array&#40;&#41;;
$i = 1;
while &#40;
$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;
  
$top_list[$i&#93; = $row;
  
$i++;
&#125;
$site_db->free_result&#40;&#41;;

for &#40;
$i = 1; $i <= 10; $i++&#41; &#123;
  if &#40;isset&#40;
$top_list[$i&#93;&#41;&#41; &#123;
    
$register_array['image_downloads_'.$i&#93; = &#40;check_permission&#40;"auth_viewimage", $top_list[$i&#93;['cat_id'&#93;&#41;&#41; ? "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i&#93;['image_id'&#93;&#41;."\">".htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;."</a>" &#58; htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;;
    
$register_array['image_downloads_openwindow_'.$i&#93; = &#40;check_permission&#40;"auth_viewimage", $top_list[$i&#93;['cat_id'&#93;&#41;&#41; ? "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i&#93;['image_id'&#93;&#41;."\" onclick=\"opendetailwindow&#40;&#41;\" target=\"detailwindow\">".htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;."</a>" &#58; htmlspecialchars&#40;$top_list[$i&#93;['image_name'&#93;&#41;;
    
if &#40;isset&#40;$top_list[$i&#93;[$user_table_fields['user_name'&#93;&#93;&#41; && $top_list[$i&#93;['user_id'&#93; != GUEST&#41; &#123;
      
$user_profile_link = &#40;!empty&#40;$url_show_profile&#41;&#41; ? preg_replace&#40;"/&#123;user_id&#125;/", $top_list[$i&#93;['user_id'&#93;, $url_show_profile&#41; &#58; ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i&#93;['user_id'&#93;;
      
$register_array['image_downloads_user_'.$i&#93; = "<a href=\"".$site_sess->url&#40;$user_profile_link&#41;."\">".htmlspecialchars&#40;$top_list[$i&#93;[$user_table_fields['user_name'&#93;&#93;&#41;."</a>";
    
&#125;
    
else &#123;
      
$register_array['image_downloads_user_'.$i&#93; = $lang['userlevel_guest'&#93;;
    
&#125;
    
$register_array['image_downloads_cat_'.$i&#93; = "<a href=\"".$site_sess->url&#40;ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i&#93;['cat_id'&#93;&#41;."\">".htmlspecialchars&#40;$top_list[$i&#93;['cat_name'&#93;&#41;."</a>";
    
$register_array['image_downloads_number_'.$i&#93; = "<b>".$top_list[$i&#93;['image_downloads'&#93;."</b>";
    
$register_array['image_downloads_thumb_'.$i&#93; = "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i&#93;['image_id'&#93;&#41;."\"><img src=\"data/thumbnails/".$top_list[$i&#93;['cat_id'&#93;."/".$top_list[$i&#93;['image_thumb_file'&#93;."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />"; 
  
&#125;
  
else &#123;
    
$register_array['image_downloads_'.$i&#93; = "--";
    
$register_array['image_downloads_user_'.$i&#93; = "--";
    
$register_array['image_downloads_cat_'.$i&#93; = "--";
    
$register_array['image_downloads_number_'.$i&#93; = "--";
    
$register_array['image_downloads_thumb_'.$i&#93; = "--";
    
  
&#125;
&#125;

$site_template->register_vars&#40;$register_array&#41;;

//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream "<span><a href=\"".$site_sess->url&#40;ROOT_PATH."index.php"&#41;."\">".$lang['home'&#93;."</a>".$config['category_separator'&#93;;
if &#40;$cat_id && isset&#40;$cat_cache[$cat_id&#93;&#41;&#41; &#123;
  
$clickstream .= get_category_path&#40;$cat_id, 1&#41;.$config['category_separator'&#93;;
&#125;
$clickstream .= $lang['top_images'&#93;."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars&#40;array&#40;
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"lang_top_image_hits" => $lang['top_image_hits'&#93;,
  
"lang_top_image_downloads" => $lang['top_image_downloads'&#93;,
  
"lang_top_image_rating" => $lang['top_image_rating'&#93;,
  
"lang_top_image_votes" => $lang['top_image_votes'&#93;
&#41;&#41;;
$site_template->print_template&#40;$site_template->parse_template&#40;$main_template&#41;&#41;;
include&#40;ROOT_PATH.'includes/page_footer.php'&#41;;
?>

Title: [Mod] Toplist altered
Post by: V@no on January 19, 2003, 06:49:56 PM
it's about the same.
but still your code wont show thumbnails for media files such as .zip, .mpeg, .mp3 and so on.
http://4homepages.de/forum/viewtopic.php?p=13855#13855
Title: to see any difference you also need to edit the top.html ...
Post by: pavka on February 04, 2003, 01:59:58 AM
What should i add to top.html? and where? Big THX!
Best Regards,
Title: [Mod] Toplist altered
Post by: helluvaguy on February 15, 2003, 12:42:19 AM
Quote from: limes
i get a broken image if i have no Thumbnail set for a picture.

when i add after line in each part for RATING, VOTES, DOWNLOADS, HITS: Code:

Code: [Select]
for ($i = 1; $i <= 20; $i++) {
 
this code: Code:
  if (isset($top_list[$i])) {
           if (empty($top_list[$i]['image_thumb_file'])) {
                  $thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
         }else {
                   $thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
         }  


i get a php error.

I've got the same problem here. The funny thing about this is that the parse error occurs on the last line of top.php wher there is only ?>.
Any solution to this?
Title: [Mod] Toplist altered
Post by: V@no on February 15, 2003, 01:00:10 AM
Quote from: helluvaguy
I've got the same problem here. The funny thing about this is that the parse error occurs on the last line of top.php wher there is only ?>.
Any solution to this?


that probably because u either lost somewhere closing " or }
check your code again.
Title: [Mod] Toplist altered
Post by: helluvaguy on February 15, 2003, 01:27:32 AM
As usual you were right, but... because I used copy and past, it's been your fault ;) for your code on page 3 lacks the closing }.

... and it's much too late here for me to count brackets reliable 8O
Title: [Mod] Toplist altered
Post by: V@no on February 15, 2003, 01:32:11 AM
ops  :oops:
sry about that... :?
corrected.
Title: [Mod] Toplist altered
Post by: Shap on February 19, 2003, 06:05:27 AM
without reading all the posts....

Is there a working version yet.?
Title: [Mod] Toplist altered
Post by: helluvaguy on February 19, 2003, 12:02:03 PM
yes there is.

just read te-ga's post on top of this page and add v@no's comments about the thumbs from 03.01.2003, 04:03 on page 3
Title: [Mod] Toplist altered
Post by: Ernesto Taseffa on February 25, 2003, 04:02:09 PM
.
Title: [Mod] Toplist altered
Post by: helluvaguy on February 25, 2003, 04:22:32 PM
Hi seffern,

did you change the top.html in your template? If you haven't added tables for the comments stuff, you won't see any differnce.  :wink:
Title: [Mod] Toplist altered
Post by: Ernesto Taseffa on February 26, 2003, 06:21:49 PM
.
Title: [Mod] Toplist altered
Post by: V@no on February 26, 2003, 06:36:06 PM
Quote from: seffern
... I just copied the complete top.html which was published here and overwrote my old one. I did not do any further modifications to this then new file. Should I add additionnally something?

If yes, what and where?

Dirk

mmmm....where did u get top.html from?  8O
the script posted here is top.php that must be uploaded in root of your 4images dir.
besides that code, u'll need update your top.html template.
Title: [Mod] Toplist altered
Post by: Ernesto Taseffa on February 26, 2003, 07:15:45 PM
.
Title: [Mod] Toplist altered
Post by: helluvaguy on February 26, 2003, 08:05:37 PM
What template are you using?
Title: [Mod] Toplist altered
Post by: Ernesto Taseffa on February 26, 2003, 08:30:05 PM
.
Title: [Mod] Toplist altered
Post by: helluvaguy on February 26, 2003, 09:31:01 PM
OK, all you have to do is insert the following code
Code: [Select]

                         <tr>
                            <td class="head1" valign="top" colspan="5">{lang_top_image_comments}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1" align="center"><b>1</b></td>
                            <td valign="top" class="row1">{image_comments_1}</td>
                            <td valign="top" class="row1">{image_comments_user_1}</td>
                            <td valign="top" class="row1">{image_comments_cat_1}</td>
                            <td valign="top" class="row1" nowrap>{image_comments_number_1}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2" align="center"><b>2</b></td>
                            <td valign="top" class="row2">{image_comments_2}</td>
                            <td valign="top" class="row2">{image_comments_user_2}</td>
                            <td valign="top" class="row2">{image_comments_cat_2}</td>
                            <td valign="top" class="row2" nowrap>{image_comments_number_2}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1" align="center"><b>3</b></td>
                            <td valign="top" class="row1">{image_comments_3}</td>
                            <td valign="top" class="row1">{image_comments_user_3}</td>
                            <td valign="top" class="row1">{image_comments_cat_3}</td>
                            <td valign="top" class="row1" nowrap>{image_comments_number_3}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2" align="center"><b>4</b></td>
                            <td valign="top" class="row2">{image_comments_4}</td>
                            <td valign="top" class="row2">{image_comments_user_4}</td>
                            <td valign="top" class="row2">{image_comments_cat_4}</td>
                            <td valign="top" class="row2" nowrap>{image_comments_number_4}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1" align="center"><b>5</b></td>
                            <td valign="top" class="row1">{image_comments_5}</td>
                            <td valign="top" class="row1">{image_comments_user_5}</td>
                            <td valign="top" class="row1">{image_comments_cat_5}</td>
                            <td valign="top" class="row1" nowrap>{image_comments_number_5}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2" align="center"><b>6</b></td>
                            <td valign="top" class="row2">{image_comments_6}</td>
                            <td valign="top" class="row2">{image_comments_user_6}</td>
                            <td valign="top" class="row2">{image_comments_cat_6}</td>
                            <td valign="top" class="row2" nowrap>{image_comments_number_6}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1" align="center"><b>7</b></td>
                            <td valign="top" class="row1">{image_comments_7}</td>
                            <td valign="top" class="row1">{image_comments_user_7}</td>
                            <td valign="top" class="row1">{image_comments_cat_7}</td>
                            <td valign="top" class="row1" nowrap>{image_comments_number_7}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2" align="center"><b>8</b></td>
                            <td valign="top" class="row2">{image_comments_8}</td>
                            <td valign="top" class="row2">{image_comments_user_8}</td>
                            <td valign="top" class="row2">{image_comments_cat_8}</td>
                            <td valign="top" class="row2" nowrap>{image_comments_number_8}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1" align="center"><b>9</b></td>
                            <td valign="top" class="row1">{image_comments_9}</td>
                            <td valign="top" class="row1">{image_comments_user_9}</td>
                            <td valign="top" class="row1">{image_comments_cat_9}</td>
                            <td valign="top" class="row1" nowrap>{image_comments_number_9}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2" align="center"><b>10</b></td>
<td valign="top" class="row2">{image_comments_10}</td>
                            <td valign="top" class="row2">{image_comments_user_10}</td>
                            <td valign="top" class="row2">{image_comments_cat_10}</td>
                            <td valign="top" class="row2" nowrap>{image_comments_number_10}</td>
                          </tr>

Where you put it, depends on where you would like it to appear - meaning:
if you want the comments to be on top of the Top10 page above all others, look for
Code: [Select]

                          <tr>
                            <td class="head1" valign="top" colspan="5">{lang_top_image_rating}</td>
                          </tr>
and add it before this.
 
If you want it to be below highest votes look for
Code: [Select]

                         <tr>
                            <td class="head1" valign="top" colspan="5">{lang_top_image_votes}</td>
                          </tr>
and add it before this.

If you want it to be below most votes, look for
Code: [Select]

                          <tr>
                            <td class="head1" valign="top" colspan="5">{lang_top_image_hits}</td>
                          </tr>
and add it before this.

If you want it below most hits, look for
Code: [Select]

                          <tr>
                            <td class="head1" valign="top" colspan="5">{lang_top_image_downloads}</td>
                          </tr>
and add it before this.

If you want it at the bottom, look for
Code: [Select]

                          <tr>
                            <td valign="top" class="row2" align="center"><b>10</b></td>
                            <td valign="top" class="row2">{image_downloads_10}</td>
                            <td valign="top" class="row2">{image_downloads_user_10}</td>
                            <td valign="top" class="row2">{image_downloads_cat_10}</td>
                            <td valign="top" class="row2" nowrap>{image_downloads_number_10}</td>
                          </tr>
and add it after this.
Title: Image URL
Post by: uny on March 07, 2003, 07:09:40 PM
what if I'm using some URL to represent a image.
I got image broken link. here is the HTMl it generated, how can I fix it?

<img src="data/thumbnails/73/http://..........image.jpg" width="48" height="36" border="0" alt="" /></td>
Title: [Mod] Toplist altered
Post by: V@no on March 08, 2003, 01:45:13 PM
is that what u got? data/thumbnails/73/http://..........image.jpg
it seems u mess something up during the installation.
Title: [Mod] Toplist altered
Post by: uny on March 08, 2003, 04:31:52 PM
ya, that's what I got. It's not something wrong with the Installation. It is because I used image URL, no image is been uploaded to the server. I used URL. so when it request the Thumbnail, it get it from the URL instead get from the Data folder.
Title: the correct order?
Post by: limes on March 08, 2003, 05:43:01 PM
hi,

step one

i changed the code in "top.php" - posting thread-page 4 from te-ga - 19.01.2003, 18:42    

step two

i changed the code - posting thread-page 3 from V@no - 03.01.2003, 04:03
and now i get a php-error - bla bla bla in line 69

what is the correct order or can someone post his top.php?
thx
markus oeder
www.chauvi-seite.de
Title: [Mod] Toplist altered
Post by: rustynet on March 23, 2003, 02:44:01 PM
Maybe somebody can help me,
i try to integrate my 4Image with Invisionsboard.

Everything works just fine.

I like to use this Mod (Toplist Altered).

Thank you  :D

boti.(sorry for my english)
Title: [Mod] Toplist altered
Post by: rustynet on March 24, 2003, 03:00:59 PM
Quote from: boti
Maybe somebody can help me,
i try to integrate my 4Image with Invisionsboard.

Everything works just fine.

I like to use this Mod (Toplist Altered).

Thank you  :D

boti.(sorry for my english)


O.K. i just did it, it works.
Title: [Mod] Toplist altered
Post by: Neo1 on March 26, 2003, 04:29:07 PM
I only got remote images. I try all things in this thread but nothing works.
I always got the wrong path to the images. Now i have changed this line:
 
Code: [Select]
<img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />"

to this:
Code: [Select]
<img src=\"".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";

and this works with remote images.
Title: [Mod] Toplist altered
Post by: Neo1 on March 26, 2003, 05:03:06 PM
If someone like to show details from the toplist-thumbs in new window, just let me know (also for random image). I post the code then.
Title: [Mod] Toplist altered
Post by: matthew on March 28, 2003, 11:22:28 PM
Great Stuff!

Just added this to my gallery and have to say it really adds flavour to the page.

Thanks to all involved in it!

Matt
Title: [Mod] Toplist altered
Post by: aymanati on April 02, 2003, 07:30:44 AM
hi,
I am totally lost between the 5 pages.
Could any body refer me to the well working code that should we use.
What about the other media files, will their thumbnails be shown?

My version is 1.7.

Thanks
Title: [Mod] Toplist altered
Post by: V@no on April 02, 2003, 01:23:19 PM
media files fix:
http://4homepages.de/forum/viewtopic.php?p=13855#13855
Title: media files
Post by: limes on April 14, 2003, 02:19:54 PM
Quote from: V@no
media files fix:
http://4homepages.de/forum/viewtopic.php?p=13855#13855


->  What about the other media files, will their thumbnails be shown?
thx
elimes
Title: Re: media files
Post by: V@no on April 14, 2003, 10:50:07 PM
Quote from: limes
->  What about the other media files, will their thumbnails be shown?

What are the others? :?
By media files I ment any files that dont have thumbnails and uses media icons.
Title: Re: media files
Post by: limes on April 14, 2003, 11:06:42 PM
Quote from: V@no
Quote from: limes
->  What about the other media files, will their thumbnails be shown?

What are the others? :?
By media files I ment any files that dont have thumbnails and uses media icons.


my problem was, that i get a broken image if i have no Thumbnail set for a picture. and i am totally lost between the 5 pages, like aymanati.
cu
markus
Title: [Mod] Toplist altered
Post by: M@2T on April 16, 2003, 08:49:29 PM
Super mod!!.......realy make the top list page look so much better.

But I have one question.......many of my images are different sizes, some landscape and some portraite etc....

I have found in the code the "width" & "height" variables, is there a way to set the width and have the hight set proportionaly? so that the image will not be streched?  this is the case when the thumbnails are created normaly.

Many Thanks!
Title: [Mod] Toplist altered
Post by: V@no on April 16, 2003, 10:52:04 PM
Quote from: M@2T
I have found in the code the "width" & "height" variables, is there a way to set the width and have the hight set proportionaly? so that the image will not be streched?

I'm not gonna post changes for original code, just for this fix:
http://4homepages.de/forum/viewtopic.php?p=13855#13855

So, in that fix, replace changes in step 2. to this:
Code: [Select]
  if (empty($top_list[$i]['image_thumb_file'])) {
  $thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
  $thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
      $thumb_info = @getimagesize($thumb_file);
      $width = $thumb_info[0];
      $height = $thumb_info[1];
      $dimension = 48;
      $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;
      }

then, changee width=\"48\" to width=\"$new_width\"
same for height.
Repeat for each section.
Title: [Mod] Toplist altered
Post by: M@2T on April 18, 2003, 07:00:58 PM
Superb!!! Worked like a charm!!  Many Many thanx for this, looks so cool.

Cheers V@no & Vraxor :D Super V's :P
Title: [Mod] Toplist altered
Post by: Bomba on April 24, 2003, 04:14:18 AM
i can't get this to set proportionaly :(

i only accept .jpg files in my gallery, and i see that this fix has mentioned something about .gif. can this be the reason?

i can post my top.php code if needed
i envy M@2T gallery topimages page... it's so good lucking with that thumbnails ok...   :cry:

please help me
Thanks
Title: [Mod] Toplist altered
Post by: V@no on April 24, 2003, 03:34:51 PM
Quote from: Bomba
i can't get this to set proportionaly :(

i only accept .jpg files in my gallery, and i see that this fix has mentioned something about .gif. can this be the reason?

i can post my top.php code if needed
i envy M@2T gallery topimages page... it's so good lucking with that thumbnails ok...   :cry:

please help me
Thanks

so, where the problem?
the .gif files are actualy the media icons that shows when no thumbnail available.
Title: [Mod] Toplist altered
Post by: Bomba on April 24, 2003, 03:47:08 PM
but i don't accept any media files, i only accept .jpg files
can't this be the problem? cause im inserting that code refering that i might be using media files, when i don't.
Title: [Mod] Toplist altered
Post by: V@no on April 24, 2003, 04:00:18 PM
Quote from: Bomba
but i don't accept any media files, i only accept .jpg files
can't this be the problem? cause im inserting that code refering that i might be using media files, when i don't.

there is nothing to do what u accept and what u dont.
for every image/media/whatever when THUMBNAIL doesnt exist, will be showed an ICON acording tipe of the file, that calls MEDIA ICONS.
even if u accept only .jpg files and one of your picture doesnt have thumbnail, instead of showing red X it will display media icon (/templates/<yourtemplate>/media/jpg.gif)
Title: Tiling the top.html
Post by: balu on May 15, 2003, 08:19:59 PM
Hi, there
I just added the "thumbnails" in my toplist - now the site is very long - I now want to tile this page in 4 pages - top 10 votes, top 10 downloads, top 10 visits...
how must I change the page_header.php to do this?

thx for helping a newbie in php!
Title: [Mod] Toplist altered
Post by: Chris on May 16, 2003, 04:10:40 AM
You don't.  You edit the top.html template instead.  :wink:
Title: [Mod] Toplist altered
Post by: balu on May 16, 2003, 07:46:41 AM
thx - already done - i added 4 new top.php´s and 4 new top.html´s and i included them in the page_header - now you  switch between 4 toplists!
Title: [Mod] Toplist altered
Post by: V@no on May 16, 2003, 07:50:48 AM
Quote from: balu
i added 4 new top.php´s and 4 new top.html´s and i included them in the page_header - now you  switch between 4 toplists!

u must be kidding! right?? 8O 8O 8O 8O
do u show your "TOP" images on each page? 8O 8O 8O
Title: [Mod] Toplist altered
Post by: balu on May 16, 2003, 07:57:08 AM
no - now i have 4 pages:
Top downloads
top hits
top ranking
top votes

not all in one page

have a look: http://www.coverengine.de/4images/
Title: [Mod] Toplist altered
Post by: balu on May 16, 2003, 07:58:57 AM
... but btw I have a problem with my memberlist - it don´t work correctly - maybe you be so kind to have look at this

thx
Title: Re: [Mod] Toplist altered
Post by: artpapa on May 17, 2003, 10:03:28 PM
Quote from: Vraxor
Yesterday I started changing the code of 4 images for the first time and with succes. I altered the Toplist to show a top 10 of Most commented images.

I also added some lines to the top.php file to show the thumbnails, this last edit took me many hours since I do not have any programming skills yet, I'm a quick learner so I will be able to mange soon enough I think ;-)

Feel free to take a look and if enough people love the way I changed the toplist I might write a tutorial here.

to view the toplist: http://haunter.student.utwente.nl/Terrarevolution/galleries/top.php

Cheers,
Vraxor


Hi, Vraxor.
I cannot writ those scripts at all, but I can follow directions.
What do you think it will be possible to do and how difficult it will be to modify your script something like this: instead text links- a pictures, instead ten best -one best?
This little JPG will explain better what I mean:

http://www.artpapa.com/best.jpg

And one more nave question: do you think it will be possible to display this script in the static HTML, or it supposed to be PHP?

Thank you

Alexei

www.artpapa.com
Title: Re: [Mod] Toplist altered
Post by: V@no on May 17, 2003, 11:56:37 PM
Quote from: artpapa
This little JPG will explain better what I mean:

http://www.artpapa.com/best.jpg

its about what POTD (Picture Of The Day) MOD does...

Quote from: artpapa
And one more nave question: do you think it will be possible to display this script in the static HTML, or it supposed to be PHP?

yes, but if u just rename your .html file to .php it will do the same, absolute no difference.
Title: Re: [Mod] Toplist altered
Post by: artpapa on May 18, 2003, 04:40:34 AM
Quote from: V@no

Quote from: artpapa
And one more nave question: do you think it will be possible to display this script in the static HTML, or it supposed to be PHP?

yes, but if u just rename your .html file to .php it will do the same, absolute no difference.


thank you I  install "Picture Of The Day" MOD, but I cannot executives from any file I create myself hear is few examples: http://www.artpapa.com/gallery/templates/default_wide/pod.php
http://www.artpapa.com/gallery/templates/default_wide/potd_image.php

can I use SSI or a eframe? or that's supposed to be something else in order to executive php?
Alexei
Title: Thumb in Topliste
Post by: sammy on May 23, 2003, 07:57:30 AM
bei mir funktioniert es leider nicht, vielleicht könnte jemand eine deutsche Übersetzung geben oder hat eine einfachere Lösung parat
Title: Thumb in Topliste
Post by: sammy on May 23, 2003, 07:58:25 AM
bei mir funktioniert es leider nicht, vielleicht könnte jemand eine deutsche Übersetzung geben oder hat eine einfachere Lösung parat
Title: [Mod] Toplist altered
Post by: artpapa on May 23, 2003, 09:34:08 AM
èçâèíèòå íå ïîíÿë
Title: [Mod] Toplist altered
Post by: V@no on May 23, 2003, 10:20:27 AM
Quote from: artpapa
èçâèíèòå íå ïîíÿë

well, u can not just take that script out the 4images without modification and put it outside of your 4images....
u must change it in a way "Random Image" MOD works.
also, let's move this discussion under the POTD mod, it will make more sence then discuss it here ;) (here is "Top Images" mod, remmeber ;) :D)
Title: [Mod] Toplist altered
Post by: artpapa on May 24, 2003, 06:40:38 AM
Thank you.
I don't think it's necessary to continue my question in this topic .

I think I can come up with  something useful for this community, can you tell me please wear to display my small  addition.
It is simple JavaScript which is let you change image background on the fly without reloading a page.
You can take a look at this in the my gallery. http://www.artpapa.com/gallery/  
just click on any image to get detail page.

Alexei.
Title: Re: [Mod] Toplist altered
Post by: ascanio on April 05, 2005, 04:27:07 AM
can anyone pm the top.php (altered) for 1.7.1?
Title: Re: [Mod] Toplist altered
Post by: V@no on April 05, 2005, 04:32:06 AM
it doesnt work with v1.7.1? :?
Title: Re: [Mod] Toplist altered
Post by: ascanio on April 05, 2005, 05:08:02 AM
I don't know but I get confused with how the creator of the mod explained it ... so if some one has the top.php please send it to me orpost it here I would be very happy :)
Title: Re: [Mod] Toplist altered
Post by: ascanio on April 05, 2005, 06:26:44 AM
i don't know where to start
Title: Re: [Mod] Toplist altered
Post by: sargent01 on May 17, 2005, 05:59:16 AM
ok this is the mod i want and have tryed to sort through the posts but the thread has become very confusing can somone please post the mod to display thumnails in the top list instead of the file name for ver 1.7.1

thanks
Title: Re: [Mod] Toplist altered
Post by: Guerillia on May 28, 2005, 11:40:23 PM
First Topic on Page 4:  http://www.4homepages.de/forum/index.php?topic=2544.45

A easy Step-by-Step Description..

Works also with 1.7.1

--------

Auf Seite 4 ist das im ersten Beitrag sehr einfach beschrieben:  http://www.4homepages.de/forum/index.php?topic=2544.45

Einfach Schritt für Schritt genau nachvollziehen, funktioniert bei mir auch mit Version 1.7.1

-----------

There is only a little Mistake in the Code
Im Code ist ein kleiner Fehler:

Unter 2. ist der Code
Replace Code unter 2.
Quote
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";

zu ersetzen durch
with:
Quote
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" /></a>";


or just place an </a> at the End of the Code
Oder füge einfahc am Ende ein </a> ein.
Title: Re: [Mod] Toplist altered
Post by: Tiburon on June 27, 2005, 03:55:59 PM
New question

What I want to do is to alter the Toplist in a way that I can do something like

1 page - Top Downloads 01-10
2 page - Top Downloads 11-20
3 page - Top Downloads 21-30
4 page - Top Downloads 31-40
5 page - Top Downloads 41-50

I tried to do this with an iframe but this did not work.

Yes I could make Top Downloads 01-50 on one page, no problem, but page needs very long time to load
and therefore it would be easier to have 5 pages with only 10 images to load. Any idea  :?: :?:

Would sth. like paging would work in top.php ????
Title: Re: [Mod] Toplist altered
Post by: Tiburon on June 30, 2005, 08:50:33 AM
Noone an idea  8O ??
Has anyone realized this ??
Title: Re: [Mod] Toplist altered
Post by: Matthias70 on July 28, 2005, 04:51:21 PM
A nice addon for the toplist is
top 10 by lightbox.

A script by v@no

http://www.4homepages.de/forum/index.php?topic=9033.0

Matthias
Title: Re: [Mod] Toplist altered
Post by: NYChack on August 05, 2005, 10:24:32 PM
I am getting the following data base errors with my site which is integrated with vBulletin and is sharing the same data base.

errors:
Code: [Select]
DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name FROM actors_images i, actors_categories c, user u WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id AND i.user_id = u.user_id ORDER BY i.image_rating DESC, i.image_votes DESC LIMIT 20
Unknown column 'u.user_name' in 'field list'

DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name FROM actors_images i, actors_categories c, user u WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id AND i.user_id = u.user_id ORDER BY i.image_votes DESC, i.image_name ASC LIMIT 20
Unknown column 'u.user_name' in 'field list'

DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_hits, c.cat_name, u.user_name FROM actors_images i, actors_categories c, user u WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id AND i.user_id = u.user_id ORDER BY i.image_hits DESC, i.image_name ASC LIMIT 20
Unknown column 'u.user_name' in 'field list'

DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_downloads, c.cat_name, u.user_name FROM actors_images i, actors_categories c, user u WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id AND i.user_id = u.user_id ORDER BY i.image_downloads DESC, i.image_name ASC LIMIT 20
Unknown column 'u.user_name' in 'field list'

DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, c.cat_name, u.user_name FROM actors_images i, actors_categories c, user u WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id AND i.user_id = u.user_id ORDER BY i.image_comments DESC, i.image_votes DESC LIMIT 20
Unknown column 'u.user_name' in 'field list'

Here is my site info:

I have successfully applied this mode:  "4images Gallery 1.7 + vB 3.0.x"  
http://www.vbulletin.org/forum/showthread.php?t=66335&page=1&pp=15&highlight=4images

Versions I am using:

4images 1.7.1
vBulletin Version 3.0.7


As part of the integration with vBulletin my 4images data base has a prefix of "actors_" and is in the same data base as vBulletin which has no prefix. So, my 4images is using vBulletin's user table. Which results in my users registering and signing in once to use the forum and picture gallery.

My data base:

"actors_categories"        <---4images
"actors_comments"       <---4images
"actors_groupaccess"     <---4images
adminhelp                    <---vBulletin (no prefix)
user                            <---vBulletin (no prefix)
useractivation               <---vBulletin (no prefix)
etc..

I am wondering if this could be fixed easily or has the integration with vBulletin made this mod unsalable?

thanks - Jason



Title: Re: [Mod] Toplist altered
Post by: BartAfterDark on September 23, 2005, 12:16:36 PM
Could someone edit the first post so it shows you how to edit the top images page? (It’s darn hard to look on 8 pages and not knowing what code I exactly should use)
Title: Re: [Mod] Toplist altered
Post by: wydmuch on December 27, 2005, 02:30:33 PM
I agree to Bart,
it is quite hard and time comsuming for a rookie to read 8 pages of discussion and error-tracking and fault finding.
It would be nice, if a mod has been seen as working error-free, to attach it somewhere for downloading.

To be honest, I also would like to use this thumb funtion, but I am not sure what to do and don't want to damage my working gallery :-(
Title: Re: [Mod] Toplist altered
Post by: BartAfterDark on December 27, 2005, 02:42:45 PM
I got it sorted out with thumbnails :)

top.html
add this to your top.html file
Code: [Select]
<table width="100%" border="0" cellpadding="3" cellspacing="0">
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">#</span></b></td>
    <td valign="middle" class="row1"><div align="center"></div></td>
    <td valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Name</span></b></div></td>
    <td valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">By</span></b></div></td>
    <td valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Category</span></b></div></td>
    <td valign="middle" class="row1" nowrap="nowrap"><div align="center"><b><span id="topsite" class="bluetext">Hits</span></b></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">1</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_1}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_1}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_1}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_1}</span></div></td>
    <td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_1}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">2</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_2}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_2}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_2}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_2}</span></div></td>
    <td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_2}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">3</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_3}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_3}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_3}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_3}</span></div></td>
    <td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_3}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">4</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_4}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_4}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_4}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_4}</span></div></td>
    <td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_4}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">5</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_5}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_5}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_5}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_5}</span></div></td>
    <td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_5}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">6</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_6}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_6}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_6}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_6}</span></div></td>
    <td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_6}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">7</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_7}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_7}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_7}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_7}</span></div></td>
    <td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_7}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">8</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_8}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_8}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_8}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_8}</span></div></td>
    <td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_8}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">9</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_9}</span></div></td>
    <td valign="middle" class="row1"><span id="topsite" class="bluetext">
      <div align="center"><span id="topsite" class="bluetext">{image_hits_9}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_9}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_9}</span></div></td>
    <td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_9}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">10</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_10}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_10}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_10}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_10}</span></div></td>
    <td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_10}</span></div></td>
  </tr>
</table>
</div>
<div class="maincontent2">
<!-- baren med titlen af boxen -->
<div class="barmain">
{lang_top_image_rating}
</div>
<!-- div til indholdet af boxen -->
<table width="100%" border="0" cellpadding="3" cellspacing="0">
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">#</span></b></td>
    <td valign="middle" class="row1"><div align="center"></div></td>
    <td valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Name</span></b></div></td>
    <td valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">By</span></b></div></td>
    <td valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Category</span></b></div></td>
    <td valign="middle" class="row1" nowrap><div align="center"><b><span id="topsite" class="bluetext">Rating</span></b></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">1</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_1}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_1}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_1}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_1}</span></div></td>
    <td valign="middle" class="row1" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_1}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">2</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_2}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_2}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_2}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_2}</span></div></td>
    <td valign="middle" class="row2" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_2}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">3</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_3}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_3}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_3}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_3}</span></div></td>
    <td valign="middle" class="row1" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_3}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">4</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_4}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_4}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_4}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_4}</span></div></td>
    <td valign="middle" class="row2" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_4}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">5</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_5}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_5}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_5}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_5}</span></div></td>
    <td valign="middle" class="row1" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_5}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">6</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_6}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_6}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_6}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_6}</span></div></td>
    <td valign="middle" class="row2" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_6}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">7</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_7}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_7}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_7}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_7}</span></div></td>
    <td valign="middle" class="row1" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_7}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">8</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_8}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_8}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_8}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_8}</span></div></td>
    <td valign="middle" class="row2" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_8}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">9</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_9}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_9}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_9}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_9}</span></div></td>
    <td valign="middle" class="row1" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_9}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">10</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_10}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_10}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_10}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_10}</span></div></td>
    <td valign="middle" class="row2" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_10}</span></div></td>
  </tr>
  <tr>
</table>
</div>
<div class="maincontent2">
<!-- baren med titlen af boxen -->
<div class="barmain">
{lang_top_image_votes}
</div>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
  <tr>
    <td width="3%" valign="middle" class="row1"><b><span id="topsite" class="bluetext">#</span></b></td>
    <td width="17%" valign="middle" class="row1"><div align="center"></div></td>
    <td width="19%" valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Name</span></b></div></td>
    <td width="20%" valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">By</span></b></div></td>
    <td width="19%" valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Category</span></b></div></td>
    <td width="22%" valign="middle" nowrap="nowrap" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Rating</span></b></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">1</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_1}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_1}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_1}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_1}</span></div></td>
    <td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_1}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">2</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_2}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_2}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_2}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_2}</span></div></td>
    <td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_2}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">3</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_3}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_3}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_3}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_3}</span></div></td>
    <td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_3}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">4</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_4}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_4}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_4}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_4}</span></div></td>
    <td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_4}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">5</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_5}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_5}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_5}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_5}</span></div></td>
    <td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_5}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">6</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_6}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_6}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_6}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_6}</span></div></td>
    <td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_6}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">7</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_7}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_7}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_7}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_7}</span></div></td>
    <td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_7}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">8</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_8}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_8}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_8}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_8}</span></div></td>
    <td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_8}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row1"><b><span id="topsite" class="bluetext">9</span></b></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_9}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_9}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_9}</span></div></td>
    <td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_9}</span></div></td>
    <td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_9}</span></div></td>
  </tr>
  <tr>
    <td valign="middle" class="row2"><b><span id="topsite" class="bluetext">10</span></b></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_10}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_10}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_10}</span></div></td>
    <td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_10}</span></div></td>
    <td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_10}</span></div></td>
  </tr>
</table>
I can't remember what I changed in top.php so i'm going to post the whole file.

top.php
[code]<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: top.php                                              *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.1                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template = 'top';

define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');

$cache_id = create_cache_id(
  'top',
  array(
    $user_info[$user_table_fields['user_id']],
    $cat_id,
    $config['template_dir'],
    $config['language_dir']
  )
);

if (!$cache_page_top || !$content = get_cache_file($cache_id)) {
if ($cache_page_top) {
  // Always append session id if cache is enabled
  $old_session_mode = $site_sess->mode;
  $site_sess->mode = 'get';
}

ob_start();

$cat_match_sql = ($cat_id && check_permission("auth_viewcat", $cat_id)) ? "AND i.cat_id = '$cat_id' " : "";
$register_array = array();

$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");

// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_thumb_file, i.image_name, i.image_rating, i.image_votes, 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 i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      $register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      $register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
    }
    $register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
   $register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" border=\"0\" alt=\"\" />";
  }
  else {
    $register_array['image_rating_'.$i] = "--";
    $register_array['image_rating_user_'.$i] = "--";
    $register_array['image_rating_cat_'.$i] = "--";
    $register_array['image_rating_number_'.$i] = "--";
   $register_array['image_rating_thumb_'.$i] = "--";
  }
}

// Votes
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_thumb_file, i.image_name, i.image_rating, i.image_votes, 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 i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_votes DESC, i.image_name ASC
        LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_votes_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_votes_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      $register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      $register_array['image_votes_user_'.$i] = $lang['userlevel_guest'];
    }
    $register_array['image_votes_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    $register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
   $register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" border=\"0\" alt=\"\" />";
  }
  else {
    $register_array['image_votes_'.$i] = "--";
    $register_array['image_votes_user_'.$i] = "--";
    $register_array['image_votes_cat_'.$i] = "--";
    $register_array['image_votes_number_'.$i] = "--";
   $register_array['image_votes_thumb_'.$i] = "--";
  }
}

// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_thumb_file, i.image_name, i.image_hits, 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 i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_hits DESC, i.image_name ASC
        LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_hits_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_hits_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      $register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      $register_array['image_hits_user_'.$i] = $lang['userlevel_guest'];
    }
    $register_array['image_hits_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    $register_array['image_hits_number_'.$i] = "<b>".$top_list[$i]['image_hits']."</b>";
   $register_array['image_hits_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"/data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file
Title: Re: [Mod] Toplist altered
Post by: TheOracle on December 27, 2005, 03:17:44 PM
@BartAfterDark :

The problem is, by posting the whole top.php file, it could affect some MODs that users might of installed seperately which amended modifications to that file. ;)

The best way to remember where you did your modifications is by specifying "uncommented text"

like this for example :

Quote

// Top List Altered Starts here.

your codes . . .


Then, at the end ;

Quote

// Top List Altered Ends here.


This way, it will avoid questionnings from users on why they could encounter difficulties to manage their top page. ;)
Title: Re: [Mod] Toplist altered
Post by: BartAfterDark on December 27, 2005, 04:03:15 PM
Thats true.
But he/they could allways post here again, if it isn't working :)

@BartAfterDark :

The problem is, by posting the whole top.php file, it could affect some MODs that users might of installed seperately which amended modifications to that file. ;)

The best way to remember where you did your modifications is by specifying "uncommented text"

like this for example :

Quote

// Top List Altered Starts here.

your codes . . .


Then, at the end ;

Quote

// Top List Altered Ends here.


This way, it will avoid questionnings from users on why they could encounter difficulties to manage their top page. ;)
Title: Re: [Mod] Toplist altered
Post by: egozent on February 22, 2006, 06:33:03 PM
Ich erhalte folgende Fehlermeldung / I get this error message:
Code: [Select]
Fatal error: Call to undefined function: create_cache_id() in /www/htdocs/xxx/top.php on line 35 :(
Title: Re: [Mod] Toplist altered
Post by: egozent on March 06, 2006, 06:01:35 PM
Thank you! It works fine!  :D
Title: Re: [Mod] Toplist altered
Post by: boerdi on April 11, 2006, 11:28:31 AM
i got following message
.Parse error: parse error in /usr/local/sites/prodersdorfat/public_html/album/top.php on line 171

have you post your full php-code???
because the last code is ......top_list[$i]['image_thumb_file&#03    end thats not the end, or yes????#

please help..thanks
Title: Re: [Mod] Toplist altered
Post by: IWS_steffen on April 18, 2006, 06:44:14 PM
cooler MOD

Thank you! It works fine! 

Steffen
Title: Re: [Mod] Toplist altered
Post by: PartyPix on April 19, 2006, 05:15:38 PM
Hey
i have try to make the imagesize proportionaly how V@no describe but i became this ERROR Message : Parse error: syntax error, unexpected '}' in /usr/export/www/vhosts/funnetwork/hosting/funchecks/top.php on line 277

I will post my code here but Line 277 is by me not where, where i change anything. I change only the Rating part because i use only the Rating Part on the toplist.

Here is my code and where is the mistake ? Please Help me !


Code: [Select]
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name
       FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
       WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
       ORDER BY i.image_rating DESC, i.image_votes DESC
       LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
 $top_list[$i] = $row;
 $i++;
}
$site_db->free_result();

if (empty($top_list[$i]['image_thumb_file'])) {
  $thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
  $thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
     $thumb_info = @getimagesize($thumb_file);
     $width = $thumb_info[0];
     $height = $thumb_info[1];
     $dimension = 48;
     $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;
     }
if (isset($top_list[$i])) {
   $register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
   $register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
   $register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
   $register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
   $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
   $register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"$new_width\" height=\"$new_height\" border=\"0\" alt=\"\" />";
 }
 else {
   $register_array['image_rating_'.$i] = "--";
   $register_array['image_rating_user_'.$i] = "--";
   $register_array['image_rating_cat_'.$i] = "--";
   $register_array['image_rating_number_'.$i] = "--";
   $register_array['image_rating_thumb_'.$i] = "--";
 }
}
Title: Re: [Mod] Toplist altered
Post by: mawenzi on April 19, 2006, 05:20:52 PM
@ PartyPix

... try to delete '}' in line ... (I think your latest '}' in your post)  ...  :wink:
Title: Re: [Mod] Toplist altered
Post by: PartyPix on April 19, 2006, 05:23:32 PM
Quote
@ PartyPix

... try to delete '}' in line 277 ...  


That will go but now i have this error message:

Warning: Division by zero in /usr/export/www/vhosts/funnetwork/hosting/funchecks/top.php on line 84

Warning: Division by zero in /usr/export/www/vhosts/funnetwork/hosting/funchecks/top.php on line 89


and the Thumbnails will not show :(

What is now the problem ?


//EDIT

I have fix my problem. I Have forgot one line to copy ;)
Title: Re: [Mod] Toplist altered
Post by: shakit on June 07, 2006, 01:20:21 AM
if a category has under 10 pictures, this error message comes:
categorie with 9 images:

Warning: Division by zero in xxx/top.php on line 85
Warning: Division by zero in xxx/top.php on line 90
Warning: Division by zero in xxx/top.php on line 135
Warning: Division by zero in xxx/top.php on line 140
Warning: Division by zero in xxx/top.php on line 185
Warning: Division by zero in xxx/top.php on line 190
Warning: Division by zero in xxx/top.php on line 235
Warning: Division by zero in xxx/top.php on line 240
Warning: Division by zero in xxx/top.php on line 285
Warning: Division by zero in xxx/top.php on line 290

line 85:      $ratio = $width / $height;
line 90:      $new_width = floor(($dimension/$height) * $width);
line 135:     $ratio = $width / $height;
...

http://www.shakit.de/gallery/top.php?cat_id=48

what is wrong?
Title: Re: [Mod] Toplist altered
Post by: Vincent on June 12, 2006, 08:29:56 PM
http://www.foto-kocher.com/top.php?cat_id=96
in my case there is no error coming out - maybe the error is to find between the version 1.6 and 1.6.2
sincerly
vincent
Title: Re: [Mod] Toplist altered
Post by: Partyfinger on July 04, 2006, 11:09:51 AM
Hallo zusammen.
Würde auch gerne dies Bilderfunktion bei meinen TOP Bilder einsetzen.
habe was auf Seite 3 gefunden.
Leider komme ich nicht klar.
Geht dies überhaupt mit der Version 1.7.2 ?
Habe schon Probleme wenn ich Schritt eins durchführen soll.
Finde nix im HTML Code.
Kann mir bitte jemand mit einer deutschen Anleitung helfen?
Gruß Stephan


look at the code,

you have now 5 categories in the top.php and the new one is comments. you must add the new comment tag in the ../lang/english(deutsch)/main.php. It is only for the new comments header {lang_top_image_comments} in the top.html and you must modify in all language packs you are use.

1. add the comments description in the image details


Code:

//-----------------------------------------------------
//--- Image Details --------------------------------
//-----------------------------------------------------

$lang['hits'] = "Hits:";
$lang['downloads'] = "Downloads:";
$lang['rating'] = "Rating:";
$lang['votes'] = "Vote(s)";
$lang['comments']="Comments";


2. add the comments tag the top images details and if you have set more then 10 Top images you must change this to your prefer (5,20,50,?). look to the top.html here is the {lang_top_image_comments}


Code:

//-----------------------------------------------------
//--- Top Images --------------------------------------
//-----------------------------------------------------
$lang['top_image_hits'] = "Top 10 images by hits";
$lang['top_image_downloads'] = "Top 10 images by downloads";
$lang['top_image_rating'] = "Top 10 images by rating";
$lang['top_image_votes'] = "Top 10 images by votes";
$lang['top_image_comments'] = "Top 10 images by comments";


3. change of top.html for the new thumbnails

add a new tablerow for the thumbnails. in the new cells you write the thumb tag {image_hits_thumb_1} {image_downloads_thumb_1} {image_rating_thumb_1} {image_votes_thumb_1} and so on (_2, _3, _4,...) for the different top categories.

4. change the top.html for the new comment category

add new tablecells for the new top comments category. in the header you write {lang_top_image_comments} and in the cells you write the same as in the hits, downloads, rating,... but modifying the new comments tag z.B. {image_comments_thumb_1} {image_comments_1} {image_comments_user_1} {image_comments_cat_1} {image_comments_number_1} and so on (_2, _3, _4,...).

 i hope it's clear
Title: Re: [Mod] Toplist altered
Post by: Partyfinger on July 04, 2006, 11:11:15 AM
am besten , Schritt für Schritt.

Danke
Title: Re: [Mod] Toplist altered
Post by: Partyfinger on July 07, 2006, 06:31:08 PM
Kann mir keiner helfen?
Title: Re: [Mod] Toplist altered
Post by: Ch*yeuk on July 13, 2006, 04:03:54 AM
Thanks for sharing! I've changed my toplist to show only thumbnails and it looks great.
Title: Re: [Mod] Toplist altered
Post by: slime on July 18, 2006, 11:20:13 PM
bei mir klappt das auch bißher noch nicht .....wenn du es hinbekomen hast partyfinger wäre nett wenn du es nochmal posten könntest was du gemacht hat weil bei mir klappt es einfach nicht !!
Title: Re: [Mod] Toplist altered
Post by: ahmad6 on August 10, 2006, 01:45:47 PM
HI

dear friends

Please help me i want show image in top image but only name image show

Please help me
Title: Re: [Mod] Toplist altered
Post by: Brainwrek on August 21, 2006, 08:52:54 AM
Hello.  I have followed this tutorial very carefully (several times), and I am having a troubling problem with it.

Thumbs are only being shown on the ODD numbers (#1, #3, #5, #7, #9).  The even numbered thumbs are not being displayed.  In fact, the even numbered template variables (example: {image_rating_thumb_2}) are not being parsed at all.  So I end up with a page that looks like this:

|----------------------|
|----------------------|
|----------------------|
|-----THUMB #1 ----|
|----------------------|
|----------------------|
|----------------------|

{image_rating_thumb_2}

|----------------------|
|----------------------|
|----------------------|
|-----THUMB #3 ----|
|----------------------|
|----------------------|
|----------------------|

{image_rating_thumb_4}

|----------------------|
|----------------------|
|----------------------|
|-----THUMB #5 ----|
|----------------------|
|----------------------|
|----------------------|

{image_rating_thumb_6}

|----------------------|
|----------------------|
|----------------------|
|-----THUMB #7 ----|
|----------------------|
|----------------------|
|----------------------|

{image_rating_thumb_8}

|----------------------|
|----------------------|
|----------------------|
|-----THUMB #9 ----|
|----------------------|
|----------------------|
|----------------------|

{image_rating_thumb_10}


Here is a sample of the code I am using:

Code: [Select]
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name, i.image_thumb_file".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 i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
    $register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
    if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      $register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      $register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
    }
    $register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
    $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
  }
  else {
    $register_array['image_rating_'.$i] = "--";
    $register_array['image_rating_user_'.$i] = "--";
    $register_array['image_rating_cat_'.$i] = "--";
    $register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
  }
}


BTW... I'm running v1.7.2
Anyone have a clue what's going on here?

Thanks!
Title: Re: [Mod] Toplist altered
Post by: Brainwrek on August 23, 2006, 11:05:59 PM
Ahum... any ideas on my previous post?  This is really strange.
Title: Re: [Mod] Toplist altered
Post by: slime on September 03, 2006, 07:02:07 PM
gibst diesen mod auch komplett zusammen gefasst das man ihn auch verstehen kan sind einfach zuviel seiten !
Kann bitte den jemand mal zusammen fassen das man ihn versteht ?????? Bitte
Title: Re: [Mod] Toplist altered
Post by: V@no on September 16, 2006, 02:15:50 AM
http://4homepages.de/forum/index.php?topic=2544.msg13855#msg13855
you missed step 1
Title: Re: [Mod] Toplist altered
Post by: V@no on September 20, 2006, 03:11:46 AM
you do something wrong, that all I can guess...these errors should not be showed if you are using the original code with image dimention addon.
Title: Re: [Mod] Toplist altered
Post by: chull on September 25, 2006, 11:15:59 PM
Hello,

I've installed the Mod with succes. Very nice!!! But I've also installed the Popup- message mod.(http://www.4homepages.de/forum/index.php?topic=3304.0). When I click now on a picture in the Toplist, the Popup didn't appear. Please Help!!!

Thanks and Greetz

Chull
Title: Re: [Mod] Toplist altered
Post by: Partyfinger on December 08, 2006, 01:40:18 PM
Leider klappt es nicht.   :cry:
Werde jetzt einfach warten bis das nächste Update 1.7.5 erscheint und hoffen das man dann diese „Bildanzeig-Funktion“ und „Top 20 Anzeige“ auf der TOP Seite , einfach über die Control Panel Seite einstellen kann.

Gruß Partyfinger.de
Title: Re: [Mod] Toplist altered
Post by: mikum on January 16, 2007, 02:17:23 PM
Hi *,

at first thanx for the mod. It works well on my page http://www.picspack.de/top.php.

However there is a little problem with the sorting:

In the first section 'highest rating' it sorts all photos with max. rate alphabetically. But I think it would make more sence if it would sort photos with the same rating for the most rates.

Cheers,
mikum
Title: Re: [Mod] Toplist altered
Post by: medo007 on February 15, 2007, 03:59:54 AM
I have the same error as ivan!

Where exacly I have put this code:

Code: [Select]
  if (empty($top_list[$i]['image_thumb_file'])) {
    $thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
    }else {
    $thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
    }
    $thumb_info = @getimagesize($thumb_file);
    $width = $thumb_info[0];
    $height = $thumb_info[1];
    $dimension = 40;
    $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;
    }

Thanks
Title: Re: [Mod] Toplist altered
Post by: medo007 on February 15, 2007, 04:16:56 AM
It's ok now, I fixed it!

bye
Title: Re: [Mod] Toplist altered
Post by: sbsreddy on March 25, 2007, 09:31:37 PM
dear sirs,
i am a new to all coding etc. I have gone through the threads for hours and altered my codes. but i was not successful. Any body PLEASE write step by step guide to change the code to display top images in thumb nails in all 5 categories. This is very much useful feature and it should have been included in version 1.7.4 which i use currently.. Thnaks in advance.

Reddy
Title: Re: [Mod] Toplist altered
Post by: Hallo2007 on June 17, 2007, 10:04:31 AM
Vielleicht könnte mal jemand der hier noch einen Überblick hat, eine Anleitung reinstellen wie man was machen muss. Blick hier überhaupt nicht mehr durch. Funktioniert die Anleitung auf Seite 4??
Title: Re: [Mod] Toplist altered
Post by: musicsurfer on November 03, 2007, 10:36:21 AM
Vielleicht könnte mal jemand der hier noch einen Überblick hat, eine Anleitung reinstellen wie man was machen muss. Blick hier überhaupt nicht mehr durch. Funktioniert die Anleitung auf Seite 4??

Mir geht es genauso

Welchen Code muss man denn jetzt nehmen ?

Gruss
Title: Re: [Mod] Toplist altered
Post by: KurtW on November 03, 2007, 10:43:29 AM
Tja, ich würd halt mal den code aus posting #6
für die top.php nehmen und für die top.html
z.B. posting #16 ( hier als beispiel aufgeführt für die comments, muss man halt umbenennen für die anderen top1)

Kurt
Title: Re: [Mod] Toplist altered
Post by: musicsurfer on November 03, 2007, 11:10:42 AM
Ah habe den Fehler gefunden :)

Ich hatte die Zeile

$site_template->register_vars($register_array);

mit auskommentiert

Dabke für die Hilfe
Title: Re: [Mod] Toplist altered
Post by: musicsurfer on November 03, 2007, 11:38:21 AM
Hallo

Ist es denn nun auch möglich sich nicht die gesante Zeit anzeigen zu lassen, sondern auch die meisten Klicks in der Woche oder am Tag ?

Gruss
Title: Re: [Mod] Toplist altered
Post by: fast on November 14, 2007, 08:36:51 PM
ich bekomme folgende fehlermeldung:

Parse error: syntax error, unexpected T_VARIABLE in /mnt/web2/31/55/51656455/htdocs/gallery/top.php on line 78

line 78 ist das hier:
Code: [Select]
    $register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);

weiss jemand was zu ändern ist? Ich habe version 1.74 installiert...

Title: Re: [Mod] Toplist altered
Post by: thunderstrike on November 14, 2007, 08:54:57 PM
Try this:

Code: [Select]
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);
Title: Re: [Mod] Toplist altered
Post by: fast on November 14, 2007, 08:59:33 PM
doesn't help, still the same error :(
Title: Re: [Mod] Toplist altered
Post by: thunderstrike on November 14, 2007, 09:03:02 PM
I no can reproduce ...

Please read step 1-2-3 of my signature and post.
Title: Re: [Mod] Toplist altered
Post by: fast on November 14, 2007, 09:09:15 PM
i get this error:

Parse error: syntax error, unexpected T_VARIABLE in /mnt/web2/31/55/51656455/htdocs/gallery/top.php on line 78

the code for the rating part is this:
Code: [Select]
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
        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 i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url
    $register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
    $register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
    if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      $register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      $register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
    }
    $register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
    $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
  }
  else {
    $register_array['image_rating_'.$i] = "--";
    $register_array['image_rating_user_'.$i] = "--";
    $register_array['image_rating_cat_'.$i] = "--";
    $register_array['image_rating_number_'.$i] = "--";
    $register_array['image_rating_thumb_'.$i] = "--";
  }
}

i use version 1.74, php version 4.4.7 ans mysql 4.0.27
Title: Re: [Mod] Toplist altered
Post by: thunderstrike on November 14, 2007, 09:10:22 PM
I see old code. You no replace for my code. :?
Title: Re: [Mod] Toplist altered
Post by: fast on November 14, 2007, 09:11:17 PM
but with your new code its the same error

Code: [Select]
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
        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 i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url
    $register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);
    $register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
    if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      $register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      $register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
    }
    $register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
    $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
  }
  else {
    $register_array['image_rating_'.$i] = "--";
    $register_array['image_rating_user_'.$i] = "--";
    $register_array['image_rating_cat_'.$i] = "--";
    $register_array['image_rating_number_'.$i] = "--";
    $register_array['image_rating_thumb_'.$i] = "--";
  }
}

Title: Re: [Mod] Toplist altered
Post by: thunderstrike on November 14, 2007, 09:17:18 PM
Quote
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url

This line - no full.
Title: Re: [Mod] Toplist altered
Post by: fast on November 14, 2007, 09:31:37 PM
yep, you are right. with the complete code it works, but there comes up a new error, when i embedd the tag in the template file, a thumbnail shows up, but also a little bit of code.

this is the the rating code in top.php:
Code: [Select]
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
        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 i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
    $register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);
    $register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
    if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      $register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      $register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
    }
    $register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
    $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
  }
  else {
    $register_array['image_rating_'.$i] = "--";
    $register_array['image_rating_user_'.$i] = "--";
    $register_array['image_rating_cat_'.$i] = "--";
    $register_array['image_rating_number_'.$i] = "--";
    $register_array['image_rating_thumb_'.$i] = "--";
  }
}

and after the thumbnail at the front end it shows this: ./details.php?image_id=719">(name of the file)
Title: Re: [Mod] Toplist altered
Post by: thunderstrike on November 14, 2007, 09:39:59 PM
@ivan:

Image width and height is no suppose for 0 ... $image_info[0] and $image_info[1] is show width and height (for image size). If no see image size, is $thumb_file problem.
Is no see filename of local or remote. ;)

yep, you are right. with the complete code it works, but there comes up a new error, when i embedd the tag in the template file, a thumbnail shows up, but also a little bit of code.

this is the the rating code in top.php:
Code: [Select]
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
        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 i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
    $register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);
    $register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
    if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      $register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      $register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
    }
    $register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
    $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
  }
  else {
    $register_array['image_rating_'.$i] = "--";
    $register_array['image_rating_user_'.$i] = "--";
    $register_array['image_rating_cat_'.$i] = "--";
    $register_array['image_rating_number_'.$i] = "--";
    $register_array['image_rating_thumb_'.$i] = "--";
  }
}

and after the thumbnail at the front end it shows this: ./details.php?image_id=719">(name of the file)

Please post exact error message.
Title: Re: [Mod] Toplist altered
Post by: thunderstrike on November 14, 2007, 09:45:40 PM
You use remote or local image ?
Title: Re: [Mod] Toplist altered
Post by: thunderstrike on November 14, 2007, 09:48:40 PM
In FTP - see filename in data/<<cat_id>>/<<image_id>>/<<filename>> ?
Title: Re: [Mod] Toplist altered
Post by: thunderstrike on November 14, 2007, 09:58:40 PM
Is CHMOD 777 for data (and subfolder) ?
If click on banner of signature I see this: englisch: No access on bildergallery.com!
Title: Re: [Mod] Toplist altered
Post by: fast on November 14, 2007, 10:05:52 PM
i don't get an error msg. it shows the thumbnail but also parts of the url.

this is the code i used:

Code: [Select]
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
        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 i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
    $register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);
    $register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
    if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      $register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      $register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
    }
    $register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
    $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
  }
  else {
    $register_array['image_rating_'.$i] = "--";
    $register_array['image_rating_user_'.$i] = "--";
    $register_array['image_rating_cat_'.$i] = "--";
    $register_array['image_rating_number_'.$i] = "--";
    $register_array['image_rating_thumb_'.$i] = "--";
  }
}


and this is how it shows up, see attached pic

Title: Re: [Mod] Toplist altered
Post by: thunderstrike on November 14, 2007, 10:08:10 PM
Find:

Code: [Select]
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);

replace:

Code: [Select]
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" /></a>" : format_text(trim($top_list[$i]['image_name']), 2);
Title: Re: [Mod] Toplist altered
Post by: fast on November 14, 2007, 10:16:04 PM
Find:

Code: [Select]
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);

replace:

Code: [Select]
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" /></a>" : format_text(trim($top_list[$i]['image_name']), 2);

works, thank you very much!

Title: Re: [Mod] Toplist altered
Post by: thunderstrike on November 15, 2007, 06:57:49 PM
@ivan:

You no reply for question:

http://www.4homepages.de/forum/index.php?topic=2544.msg104859#msg104859
Title: Re: [Mod] Toplist altered
Post by: thunderstrike on November 15, 2007, 08:32:36 PM
You use IP ban for my IP ? If so, sorry - no support for you.
Title: Re: [Mod] Toplist altered
Post by: UFOSWORLD on December 02, 2007, 11:52:30 PM
Wollte das mit den meisten Kommentaren pro Bild einbaun... aber ich blick bei den 12 Seiten postings nicht mehr durch...
kann mir mal jemand was zuschicken... welche Schritte ich in welcher Reihenfolge machen muss das bei den TOP 10 Listen die meist kommentierten Bilder auftauchen?
Thumbnails von den Fotos müssen nicht zwingend sein.  Es reicht ein Link zu dem entsprechenden Fotos....

Fotoname (= Link) Fotograph Gallerie  Kommentaranzahl

Ausserdem hätte ich noch gerne ... eine Top 10 der Mitglieder die am meisten Kommentieren


kann man ausserdem noch eine Unterteilung machen...  also Kommerntare insgesamt  und aufs Monat bezogen...

das es z.b. heisst

Meist kommentierte Pics insgesamt

und aufs aktuelle Monat bezogen

Meist kommentierte Pics des Monats Dezember
Wobei sich das Monat dann jedes Monat natürlich ändern soll.

ich hätte gerne so eine TOP 10 Seite

Meist betrachtete Profile insgesamt
Meist kommentierte Pics insgesamt
Meist betrachtete Pics insgesamt
Aktivste Kommentatoren insgesamt

und das alles jeweils für das aktuelle Monat wie Beispiel oben "... des Monats Dezember"

Kann mir da jemand weiterhelfen?

gruss UFO


Title: Re: [Mod] Toplist altered
Post by: J.Lond on December 10, 2007, 09:07:41 AM
If someone like to show details from the toplist-thumbs in new window, just let me know (also for random image). I post the code then.

Please share the code.  I for one would love to see it.

Thanks
Title: Re: [Mod] Toplist altered
Post by: UFOSWORLD on December 11, 2007, 02:51:39 PM
Kann mir bei den Problemen mal bitte jemand weiterhelfen?

gruss ufo
Title: Re: [Mod] Toplist altered
Post by: UFOSWORLD on December 28, 2007, 02:32:40 AM
Ok ich hab mich mal damit beschäftigt und folgenden Code in die jeweiligen Dateien eingebaut...

Gilt für die Änderung TOP 10 Comments
Habe 4Homepages 1.7.2 am laufen.

Eventuelle Fehler könnten noch drin sein...  bitte schreibt mir dann ändere ich das und werds testen.

Top.html
Adden wo man es hin haben will. z.b. unter
Code: [Select]
  <td valign="top" class="row2" nowrap>{image_downloads_number_10}</td>
                          </tr>
folgendes einfügen
Code: [Select]
                          <tr>
                            <td class="head1" valign="top" colspan="5">{lang_top_image_comments}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1" align="center"><b>1</b></td>
                            <td valign="top" class="row1">{image_comments_1}</td>
                            <td valign="top" class="row1">{image_comments_user_1}</td>
                            <td valign="top" class="row1">{image_comments_cat_1}</td>
                            <td valign="top" class="row1" nowrap>{image_comments_number_1}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2" align="center"><b>2</b></td>
                            <td valign="top" class="row2">{image_comments_2}</td>
                            <td valign="top" class="row2">{image_comments_user_2}</td>
                            <td valign="top" class="row2">{image_comments_cat_2}</td>
                            <td valign="top" class="row2" nowrap>{image_comments_number_2}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1" align="center"><b>3</b></td>
                            <td valign="top" class="row1">{image_comments_3}</td>
                            <td valign="top" class="row1">{image_comments_user_3}</td>
                            <td valign="top" class="row1">{image_comments_cat_3}</td>
                            <td valign="top" class="row1" nowrap>{image_comments_number_3}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2" align="center"><b>4</b></td>
                            <td valign="top" class="row2">{image_comments_4}</td>
                            <td valign="top" class="row2">{image_comments_user_4}</td>
                            <td valign="top" class="row2">{image_comments_cat_4}</td>
                            <td valign="top" class="row2" nowrap>{image_comments_number_4}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1" align="center"><b>5</b></td>
                            <td valign="top" class="row1">{image_comments_5}</td>
                            <td valign="top" class="row1">{image_comments_user_5}</td>
                            <td valign="top" class="row1">{image_comments_cat_5}</td>
                            <td valign="top" class="row1" nowrap>{image_comments_number_5}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2" align="center"><b>6</b></td>
                            <td valign="top" class="row2">{image_comments_6}</td>
                            <td valign="top" class="row2">{image_comments_user_6}</td>
                            <td valign="top" class="row2">{image_comments_cat_6}</td>
                            <td valign="top" class="row2" nowrap>{image_comments_number_6}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1" align="center"><b>7</b></td>
                            <td valign="top" class="row1">{image_comments_7}</td>
                            <td valign="top" class="row1">{image_comments_user_7}</td>
                            <td valign="top" class="row1">{image_comments_cat_7}</td>
                            <td valign="top" class="row1" nowrap>{image_comments_number_7}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2" align="center"><b>8</b></td>
                            <td valign="top" class="row2">{image_comments_8}</td>
                            <td valign="top" class="row2">{image_comments_user_8}</td>
                            <td valign="top" class="row2">{image_comments_cat_8}</td>
                            <td valign="top" class="row2" nowrap>{image_comments_number_8}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1" align="center"><b>9</b></td>
                            <td valign="top" class="row1">{image_comments_9}</td>
                            <td valign="top" class="row1">{image_comments_user_9}</td>
                            <td valign="top" class="row1">{image_comments_cat_9}</td>
                            <td valign="top" class="row1" nowrap>{image_comments_number_9}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2" align="center"><b>10</b></td>
    <td valign="top" class="row2">{image_comments_10}</td>
                            <td valign="top" class="row2">{image_comments_user_10}</td>
                            <td valign="top" class="row2">{image_comments_cat_10}</td>
                            <td valign="top" class="row2" nowrap>{image_comments_number_10}</td>
                          </tr> 


dann in der Datei top.php
unter
Code: [Select]
    $register_array['image_downloads_number_'.$i] = "--";
  }
}
folgendes einfügen
Code: [Select]
// Comments
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, c.cat_name, u.user_name
        FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
        ORDER BY i.image_comments DESC, i.image_votes DESC
        LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
  $top_list[$i] = $row;
  $i++;
}
$site_db->free_result();

for ($i = 1; $i <= 10; $i++) {
  if (isset($top_list[$i])) {
    $register_array['image_comments_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_comments_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
    $register_array['image_comments_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    $register_array['image_comments_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    $register_array['image_comments_number_'.$i] = "<b>".$top_list[$i]['image_comments']."</b>";
    $register_array['image_comments_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";


  }
  else {
    $register_array['image_comments_'.$i] = "--";
    $register_array['image_comments_user_'.$i] = "--";
    $register_array['image_comments_cat_'.$i] = "--";
    $register_array['image_comments_number_'.$i] = "--";
    $register_array['image_comments_thumb_'.$i] = "--";
  }
}


und weiter unten in der Datei top.php folgende Zeile unter
Code: [Select]
"lang_top_image_votes" => $lang['top_image_votes'],

folgendes einfügen
Code: [Select]
"lang_top_image_comments" => $lang['top_image_comments']

ACHTUNG... nicht das Komma hinter $lang['top_image_votes'] vergessen, sonst motzt er ;-) (Beim Suchen der Spalte is das Komma noch nicht vorhanden. Muss also angefügt werden ;-)

Dann in die main.php und unter
Code: [Select]
$lang['top_image_votes'] = .....
folgende Zeile hinzufügen:
Code: [Select]
$lang['top_image_comments'] = "Die 10 Bilder mit den meisten Kommentaren";

Alle Dateien Hochladen und nun müsste er bei Top Images die 10 meist kommentierten Bilder anzeigen.

Weiss jemand wie ich die Top 10 der meisten Kommentatoren herbekomme?? 


gruss UFO
Title: Re: [Mod] Toplist altered
Post by: IWS_steffen on March 24, 2008, 11:52:55 PM
Hallo,

ich habe schon zahlreiche Versuche unternommen, die Code Schnipzel in die top.php einzubinden. Leider aber erfolglos.

Es wäre toll wenn einer vielleicht die komplette geänderte top.php veröffentlichen könnte.

Danke im vorraus


Gruß Steffen
Title: Re: [Mod] Toplist altered
Post by: IWS_steffen on April 19, 2008, 01:16:46 AM
Hallo 4images Gemeinde,

habe den Fehler gefunden. Klappt jetzt alles super  :D

Gruß Steffen
http://www.urlauberschiff-fritzheckert.de/maritim/top.php (http://www.urlauberschiff-fritzheckert.de/maritim/top.php)
Title: Re: [Mod] Toplist altered
Post by: IWS_steffen on April 29, 2008, 02:36:51 PM
auf Anfrage einiger User, hier meine geändert Top.php. Ich hoffe ich kann einigen damit helfen

Gruß Steffen

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: top.php                                              *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    * 
 *              Web: http://www.4homepages.de                             * 
 *    Scriptversion: 1.7.6                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 'top';

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

$cache_id create_cache_id(
  
'page.top',
  array(
    
$user_info[$user_table_fields['user_id']],
    
$cat_id,
    
$config['template_dir'],
    
$config['language_dir']
  )
);

if (!
$cache_page_top || !$content get_cache_file($cache_id)) {
if (
$cache_page_top) {
  
// Always append session id if cache is enabled
  
$old_session_mode $site_sess->mode;
  
$site_sess->mode 'get';
}

ob_start();

$cat_match_sql = ($cat_id && check_permission("auth_viewcat"$cat_id)) ? "AND i.cat_id = '$cat_id' " "";
$register_array = array();

$cat_id_sql get_auth_cat_sql("auth_viewcat""NOTIN");

// Rating
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name
        FROM "
.IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
        WHERE i.image_active = 1 AND i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_votes DESC
        LIMIT 20"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 20$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" htmlspecialchars($top_list[$i]['image_name']);
    
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" htmlspecialchars($top_list[$i]['image_name']);
    
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
    
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
  }
  else {
    
$register_array['image_rating_'.$i] = "--";
    
$register_array['image_rating_user_'.$i] = "--";
    
$register_array['image_rating_cat_'.$i] = "--";
    
$register_array['image_rating_number_'.$i] = "--";
    
$register_array['image_rating_thumb_'.$i] = "--";
  }
}

// Votes
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name 
        FROM "
.IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u 
        WHERE i.image_active = 1 AND i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql 
        ORDER BY i.image_votes DESC, i.image_name ASC 
        LIMIT 20"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 20$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_votes_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" htmlspecialchars($top_list[$i]['image_name']);
    
$register_array['image_votes_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" htmlspecialchars($top_list[$i]['image_name']);
    
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    
$register_array['image_votes_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
    
$register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
  }
  else {
    
$register_array['image_votes_'.$i] = "--";
    
$register_array['image_votes_user_'.$i] = "--";
    
$register_array['image_votes_cat_'.$i] = "--";
    
$register_array['image_votes_number_'.$i] = "--";
    
$register_array['image_votes_thumb_'.$i] = "--";
  }
}

//--- Start Top10 nach Postkarten -----------------------------------------------
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_postcards, c.cat_name".get_user_table_field(", u.""user_name").", i.image_thumb_file, i.image_media_file 
        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 i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id 
        
$cat_match_sql 
        ORDER BY i.image_postcards DESC, i.image_name ASC 
        LIMIT 10"

$result $site_db->query($sql); 
$top_list = array(); 
$i 1
while (
$row $site_db->fetch_array($result)) { 
  
$top_list[$i] = $row
  
$i++; 

$site_db->free_result(); 

for (
$i 1$i <= 10$i++) { 
if (isset(
$top_list[$i])) { 
           if (empty(
$top_list[$i]['image_thumb_file'])) { 
                  
$thumb_file ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif"
         }else { 
                   
$thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']; 
         } 
}
  if (isset(
$top_list[$i])) { 
    
$register_array['image_postcards_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" htmlspecialchars($top_list[$i]['image_name']); 
    
$register_array['image_postcards_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" htmlspecialchars($top_list[$i]['image_name']); 
    if (isset(
$top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) { 
      
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id']; 
      
$register_array['image_postcards_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>"
    } 
    else { 
      
$register_array['image_postcards_user_'.$i] = $lang['userlevel_guest']; 
    } 
    
$register_array['image_postcards_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>"
    
$register_array['image_postcards_number_'.$i] = "<b>".$top_list[$i]['image_postcards']."</b>"

      
$register_array['image_postcards_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";

  } 
  else { 
    
$register_array['image_postcards_'.$i] = "--"
    
$register_array['image_postcards_user_'.$i] = "--"
    
$register_array['image_postcards_cat_'.$i] = "--"
    
$register_array['image_postcards_number_'.$i] = "--"
    
$register_array['image_postcards_thumb_'.$i] = "--"

  } 

//--- Ende Top10 nach Postkarten -----------------------------------------------


// Hits
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_hits, c.cat_name, u.user_name 
        FROM "
.IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u 
        WHERE i.image_active = 1 AND i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql 
        ORDER BY i.image_hits DESC, i.image_name ASC 
        LIMIT 20"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 20$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_hits_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" htmlspecialchars($top_list[$i]['image_name']);
    
$register_array['image_hits_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" htmlspecialchars($top_list[$i]['image_name']);
    
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    
$register_array['image_hits_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_hits_number_'.$i] = "<b>".$top_list[$i]['image_hits']."</b>";
    
$register_array['image_hits_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
  }
  else {
    
$register_array['image_hits_'.$i] = "--";
    
$register_array['image_hits_user_'.$i] = "--";
    
$register_array['image_hits_cat_'.$i] = "--";
    
$register_array['image_hits_number_'.$i] = "--";
    
$register_array['image_hits_thumb_'.$i] = "--";
  }
}

// Downloads
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_downloads, c.cat_name, u.user_name 
        FROM "
.IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u 
        WHERE i.image_active = 1 AND i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql 
        ORDER BY i.image_downloads DESC, i.image_name ASC 
        LIMIT 20"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 20$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_downloads_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" htmlspecialchars($top_list[$i]['image_name']);
    
$register_array['image_downloads_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" htmlspecialchars($top_list[$i]['image_name']);
    
$register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    
$register_array['image_downloads_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_downloads_number_'.$i] = "<b>".$top_list[$i]['image_downloads']."</b>";
    
$register_array['image_downloads_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
  }
  else {
    
$register_array['image_downloads_'.$i] = "--";
    
$register_array['image_downloads_user_'.$i] = "--";
    
$register_array['image_downloads_cat_'.$i] = "--";
    
$register_array['image_downloads_number_'.$i] = "--";
    
$register_array['image_downloads_thumb_'.$i] = "--";
  }
}


// Comments
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, c.cat_name, u.user_name
        FROM "
.IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
        WHERE i.image_active = 1 AND i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
        ORDER BY i.image_comments DESC, i.image_votes DESC
        LIMIT 20"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 20$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_comments_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" htmlspecialchars($top_list[$i]['image_name']);
    
$register_array['image_comments_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" htmlspecialchars($top_list[$i]['image_name']);
    
$register_array['image_comments_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
    
$register_array['image_comments_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_comments_number_'.$i] = "<b>".$top_list[$i]['image_comments']."</b>";
    
$register_array['image_comments_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";


  }
  else {
    
$register_array['image_comments_'.$i] = "--";
    
$register_array['image_comments_user_'.$i] = "--";
    
$register_array['image_comments_cat_'.$i] = "--";
    
$register_array['image_comments_number_'.$i] = "--";
    
$register_array['image_comments_thumb_'.$i] = "--";
  }
}

$site_template->register_vars($register_array);

//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if (
$cat_id && isset($cat_cache[$cat_id])) {
  
$clickstream .= get_category_path($cat_id1).$config['category_separator'];
}
$clickstream .= $lang['top_images']."</span>";
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"lang_top_image_hits" => $lang['top_image_hits'],
  
"lang_top_image_downloads" => $lang['top_image_downloads'],
  
"lang_top_image_rating" => $lang['top_image_rating'],
  
"lang_top_image_votes" => $lang['top_image_votes']
));
$site_template->print_template($site_template->parse_template($main_template));

$content ob_get_contents();
ob_end_clean();

if (
$cache_page_top) {
  
// Reset session mode
  
$site_sess->mode $old_session_mode;

  
save_cache_file($cache_id$content);
}

// end if get_cache_file()

echo $content;

include(
ROOT_PATH.'includes/page_footer.php');
?>
Title: Re: [Mod] Toplist altered
Post by: CodeMan on May 03, 2008, 08:43:50 PM
He IWS_steffen,

Really great, thanks to your top.php.
It works great. In my top.html all images are shown the way they should.
But unfortunately on the top of my webpage there is an error: "An unexpected error occurred. Please try again later".
Do you (or someone else) know this error and how I can fix it.

I’m using 4images 1.7.6

thanx!!!
Title: Re: [Mod] Toplist altered
Post by: Bob on May 14, 2008, 05:22:31 PM
Bei rechten:
thumbnail = alle
bilder = registriert

Ich will den Besucher der nicht gereggt ist bei einem Klick aufs Thumb in der Topliste zur anmeldeseite verlinken und wenn eingeloggt zum bild.

erledigt siehe Antwort #185
Title: Re: [Mod] Toplist altered
Post by: mawenzi on May 14, 2008, 06:25:37 PM
@Bob

... da {image_rating_thumb_1} bereits den Link zum Bild enthält, musst du die gewünschte Änderung direkt in der top.php vornehmen ...
... jeweils für $register_array['image_rating_thumb_'.$i] und gleichartig etwa so ...
Code: [Select]
$register_array['image_rating_thumb_'.$i] = ($user_info['user_level'] >= USER) ? " ... hier der Thumbnail-Code für eingeloggte User ... " : "  ... hier der Thumbnail-Code für nicht-eingeloggte User ... ";
Title: Re: [Mod] Toplist altered
Post by: KurtW on May 14, 2008, 06:28:47 PM
Hallo Bob,

wie sollte denn das auch funktionieren?
der tag: {image_rating_thumb_1} wird ja schon komplett generiert in top.php
suche z.B.
Code: [Select]
    $register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";esetze mit:
Code: [Select]
  if ($user_info['user_level'] >= GUEST) {
    $register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
   }else {
    $register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."register.php")."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
   }

Nicht getestet, müsste aber klappen...

############# EDIT ####################
Wieder mal zu langsam gewesen....  :wink:


Gruß
Kurt
Title: Re: [Mod] Toplist altered
Post by: mawenzi on May 14, 2008, 06:33:31 PM
@Kurt
... zwei Dumme ... ein Gedanke ...  :mrgreen:  :mrgreen:
... mein Code ist um ein paar Zeichen kürzer, aber sonst von der Funktion her gleich ... und beide Varianten sollten halt funktionieren ...
Title: Re: [Mod] Toplist altered
Post by: Bob on May 14, 2008, 07:49:17 PM
siehe Antwort #185
Title: Re: [Mod] Toplist altered
Post by: KurtW on May 15, 2008, 06:10:28 AM
Und jetzt... code aus Antwort#181


Kurt
Title: Re: [Mod] Toplist altered
Post by: Bob on May 15, 2008, 09:26:45 AM
 
Ne Kurt das geht leider auch nicht.

Ich habs aber anders gelöst:

in der top.php:
Code: [Select]
$register_array['image_rating_thumb_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"".$thumb_file."\" width=\"90\" height=\"90\" border=\"1\" alt=\"\" /></a>" : "<img src=\"".$thumb_file."\" width=\"90\" height=\"90\" border=\"1\" alt=\"\" />";
und in der top.html dann:
Code: [Select]
{if user_loggedout}
<a href="register.php">{image_rating_thumb_1}</a>
{endif user_loggedout}
{if user_loggedin}
{image_rating_thumb_1}
{endif user_loggedin}

so geht es einwandfrei :) :)

aber trotzden DANKE!!
Title: Re: [Mod] Toplist altered
Post by: CodeMan on May 21, 2008, 11:15:18 PM
Oke IWS_steffen,

I fixed the the error and now it works great.
From the top.php you have sent, I removed the 2 sections:
//--- Start Top10 nach Postkarten -------------    and      //--- Comments -----------------------------------------------

Thanx man!
Title: Re: [Mod] Toplist altered
Post by: DukeCastino on May 21, 2008, 11:59:47 PM
Hallo, habe das mit der Toplist hinbekommen nur bin ich etwas unzufrieden mit der Ausführung. Wenn ich die Bilder angezeigt bekommen möchte muss ich eine elenlange Tabelle schreiben. z.b. so:

Code: [Select]
                          <tr>
                            <td valign="top" class="row1"></td>
                            <td valign="top" class="row1">{image_rating_thumb_1}<p>{image_rating_number_1}</p><p></p></td>
                            <td valign="top" class="row1">{image_rating_thumb_2}<p>{image_rating_number_2}</p><p></p></td>
                            <td valign="top" class="row1">{image_rating_thumb_3}<p>{image_rating_number_3}</p><p></p></td>
                            <td valign="top" class="row1">{image_rating_thumb_4}<p>{image_rating_number_4}</p><p></p></td>
                            <td valign="top" class="row1">{image_rating_thumb_5}<p>{image_rating_number_5}</p><p></p></td>
                          </tr>

da müsste ich jetzt bis 30 durchzählen was wohl nicht der sinn wäre

Geht sowas nicht wie in der Search.html . dort reicht wenn man " {content} " in den Code einfügt und schon zeigt er alle neusten Bilder an
ich hätte das gerne aufs Rating bezogen. Kann mir einer das erklären weil bin net so helle :P
Title: Re: [Mod] Toplist altered
Post by: OtusDesign on July 15, 2008, 12:50:27 PM
Hi, I'm usign top.php and works perfect. But my problem is I want to use this on my home.html . I try to use iframe and its shown but after I click one of images , it will open in the iframe.
is it possible to open in a new window or _parent, _top target.
thanks in advance
Title: Re: [Mod] Toplist altered
Post by: Bob on July 15, 2008, 02:24:00 PM

Hi, OtusDesign

open top.php

you need a target in the <a href=.....> tags.

<a href=\".....\" target=\"blank\">



Title: Re: [Mod] Toplist altered
Post by: OtusDesign on July 15, 2008, 02:32:36 PM
Thanks for rapid reply, I try this but I have error. My top.php is
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: top.php                                              *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    * 
 *              Web: http://www.4homepages.de                             * 
 *    Scriptversion: 1.7.6                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 'top';

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

$cache_id create_cache_id(
  
'page.top',
  array(
    
$user_info[$user_table_fields['user_id']],
    
$cat_id,
    
$config['template_dir'],
    
$config['language_dir']
  )
);

if (!
$cache_page_top || !$content get_cache_file($cache_id)) {
if (
$cache_page_top) {
  
// Always append session id if cache is enabled
  
$old_session_mode $site_sess->mode;
  
$site_sess->mode 'get';
}

ob_start();

$cat_match_sql = ($cat_id && check_permission("auth_viewcat"$cat_id)) ? "AND i.cat_id = '$cat_id' " "";
$register_array = array();

$cat_id_sql get_auth_cat_sql("auth_viewcat""NOTIN");

// Rating
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.""user_name").", i.image_thumb_file
        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 i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id
        
$cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 10$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"200\" height=\"150\" border=\"0\" alt=\"\" /></a>" format_text(trim($top_list[$i]['image_name']), 2);

    
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    if (isset(
$top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      
$register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
    }
    
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
  }
  else {
    
$register_array['image_rating_'.$i] = "--";
    
$register_array['image_rating_user_'.$i] = "--";
    
$register_array['image_rating_cat_'.$i] = "--";
    
$register_array['image_rating_number_'.$i] = "--";
    
$register_array['image_rating_thumb_'.$i] = "--";
  }
}
// Votes
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, 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 i.image_active = 1 AND i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id
        
$cat_match_sql
        ORDER BY i.image_votes DESC, i.image_name ASC
        LIMIT 10"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 10$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_votes_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    
$register_array['image_votes_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    if (isset(
$top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      
$register_array['image_votes_user_'.$i] = $lang['userlevel_guest'];
    }
    
$register_array['image_votes_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
  }
  else {
    
$register_array['image_votes_'.$i] = "--";
    
$register_array['image_votes_user_'.$i] = "--";
    
$register_array['image_votes_cat_'.$i] = "--";
    
$register_array['image_votes_number_'.$i] = "--";
  }
}

// Hits
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, 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 i.image_active = 1 AND i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id
        
$cat_match_sql
        ORDER BY i.image_hits DESC, i.image_name ASC
        LIMIT 10"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 10$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_hits_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    
$register_array['image_hits_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    if (isset(
$top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      
$register_array['image_hits_user_'.$i] = $lang['userlevel_guest'];
    }
    
$register_array['image_hits_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_hits_number_'.$i] = "<b>".$top_list[$i]['image_hits']."</b>";
  }
  else {
    
$register_array['image_hits_'.$i] = "--";
    
$register_array['image_hits_user_'.$i] = "--";
    
$register_array['image_hits_cat_'.$i] = "--";
    
$register_array['image_hits_number_'.$i] = "--";
  }
}

// Downloads
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, 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 i.image_active = 1 AND i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id
        
$cat_match_sql
        ORDER BY i.image_downloads DESC, i.image_name ASC
        LIMIT 10"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 10$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_downloads_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    
$register_array['image_downloads_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    if (isset(
$top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      
$register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      
$register_array['image_downloads_user_'.$i] = $lang['userlevel_guest'];
    }
    
$register_array['image_downloads_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_downloads_number_'.$i] = "<b>".$top_list[$i]['image_downloads']."</b>";
  }
  else {
    
$register_array['image_downloads_'.$i] = "--";
    
$register_array['image_downloads_user_'.$i] = "--";
    
$register_array['image_downloads_cat_'.$i] = "--";
    
$register_array['image_downloads_number_'.$i] = "--";
  }
}

$site_template->register_vars($register_array);

//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if (
$cat_id && isset($cat_cache[$cat_id])) {
  
$clickstream .= get_category_path($cat_id1).$config['category_separator'];
}
$clickstream .= $lang['top_images']."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"lang_top_image_hits" => $lang['top_image_hits'],
  
"lang_top_image_downloads" => $lang['top_image_downloads'],
  
"lang_top_image_rating" => $lang['top_image_rating'],
  
"lang_top_image_votes" => $lang['top_image_votes']
));
$site_template->print_template($site_template->parse_template($main_template));

$content ob_get_contents();
ob_end_clean();

if (
$cache_page_top) {
  
// Reset session mode
  
$site_sess->mode $old_session_mode;

  
save_cache_file($cache_id$content);
}

// end if get_cache_file()

echo $content;

include(
ROOT_PATH.'includes/page_footer.php');
?>
How to add this code and where
Title: Re: [Mod] Toplist altered
Post by: Bob on July 15, 2008, 02:49:54 PM
Test it:


Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: top.php                                              *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    * 
 *              Web: http://www.4homepages.de                             * 
 *    Scriptversion: 1.7.6                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 'top';

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

$cache_id create_cache_id(
  
'page.top',
  array(
    
$user_info[$user_table_fields['user_id']],
    
$cat_id,
    
$config['template_dir'],
    
$config['language_dir']
  )
);

if (!
$cache_page_top || !$content get_cache_file($cache_id)) {
if (
$cache_page_top) {
  
// Always append session id if cache is enabled
  
$old_session_mode $site_sess->mode;
  
$site_sess->mode 'get';
}

ob_start();

$cat_match_sql = ($cat_id && check_permission("auth_viewcat"$cat_id)) ? "AND i.cat_id = '$cat_id' " "";
$register_array = array();

$cat_id_sql get_auth_cat_sql("auth_viewcat""NOTIN");

// Rating
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.""user_name").", i.image_thumb_file
        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 i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id
        
$cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 10$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" target=\"blank\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" target=\"blank\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"200\" height=\"150\" border=\"0\" alt=\"\" /></a>" format_text(trim($top_list[$i]['image_name']), 2);

    
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    if (isset(
$top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\" target=\"blank\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      
$register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
    }
    
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\" target=\"blank\">".format_text($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
  }
  else {
    
$register_array['image_rating_'.$i] = "--";
    
$register_array['image_rating_user_'.$i] = "--";
    
$register_array['image_rating_cat_'.$i] = "--";
    
$register_array['image_rating_number_'.$i] = "--";
    
$register_array['image_rating_thumb_'.$i] = "--";
  }
}
// Votes
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, 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 i.image_active = 1 AND i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id
        
$cat_match_sql
        ORDER BY i.image_votes DESC, i.image_name ASC
        LIMIT 10"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 10$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_votes_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" target=\"blank\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    
$register_array['image_votes_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    if (isset(
$top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\" target=\"blank\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      
$register_array['image_votes_user_'.$i] = $lang['userlevel_guest'];
    }
    
$register_array['image_votes_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\" target=\"blank\">".format_text($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
  }
  else {
    
$register_array['image_votes_'.$i] = "--";
    
$register_array['image_votes_user_'.$i] = "--";
    
$register_array['image_votes_cat_'.$i] = "--";
    
$register_array['image_votes_number_'.$i] = "--";
  }
}

// Hits
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, 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 i.image_active = 1 AND i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id
        
$cat_match_sql
        ORDER BY i.image_hits DESC, i.image_name ASC
        LIMIT 10"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 10$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_hits_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" target=\"blank\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    
$register_array['image_hits_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    if (isset(
$top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\" target=\"blank\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      
$register_array['image_hits_user_'.$i] = $lang['userlevel_guest'];
    }
    
$register_array['image_hits_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\" target=\"blank\">".format_text($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_hits_number_'.$i] = "<b>".$top_list[$i]['image_hits']."</b>";
  }
  else {
    
$register_array['image_hits_'.$i] = "--";
    
$register_array['image_hits_user_'.$i] = "--";
    
$register_array['image_hits_cat_'.$i] = "--";
    
$register_array['image_hits_number_'.$i] = "--";
  }
}

// Downloads
$sql "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, 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 i.image_active = 1 AND i.cat_id NOT IN (
$cat_id_sql) AND i.cat_id = c.cat_id
        
$cat_match_sql
        ORDER BY i.image_downloads DESC, i.image_name ASC
        LIMIT 10"
;
$result $site_db->query($sql);
$top_list = array();
$i 1;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();

for (
$i 1$i <= 10$i++) {
  if (isset(
$top_list[$i])) {
    
$register_array['image_downloads_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" target=\"blank\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    
$register_array['image_downloads_openwindow_'.$i] = (check_permission("auth_viewimage"$top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" format_text($top_list[$i]['image_name']);
    if (isset(
$top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
      
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$top_list[$i]['user_id'];
      
$register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\" target=\"blank\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
    }
    else {
      
$register_array['image_downloads_user_'.$i] = $lang['userlevel_guest'];
    }
    
$register_array['image_downloads_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\" target=\"blank\">".format_text($top_list[$i]['cat_name'])."</a>";
    
$register_array['image_downloads_number_'.$i] = "<b>".$top_list[$i]['image_downloads']."</b>";
  }
  else {
    
$register_array['image_downloads_'.$i] = "--";
    
$register_array['image_downloads_user_'.$i] = "--";
    
$register_array['image_downloads_cat_'.$i] = "--";
    
$register_array['image_downloads_number_'.$i] = "--";
  }
}

$site_template->register_vars($register_array);

//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if (
$cat_id && isset($cat_cache[$cat_id])) {
  
$clickstream .= get_category_path($cat_id1).$config['category_separator'];
}
$clickstream .= $lang['top_images']."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"lang_top_image_hits" => $lang['top_image_hits'],
  
"lang_top_image_downloads" => $lang['top_image_downloads'],
  
"lang_top_image_rating" => $lang['top_image_rating'],
  
"lang_top_image_votes" => $lang['top_image_votes']
));
$site_template->print_template($site_template->parse_template($main_template));

$content ob_get_contents();
ob_end_clean();

if (
$cache_page_top) {
  
// Reset session mode
  
$site_sess->mode $old_session_mode;

  
save_cache_file($cache_id$content);
}

// end if get_cache_file()

echo $content;

include(
ROOT_PATH.'includes/page_footer.php');
?>


Please Post your Url
Title: Re: [Mod] Toplist altered
Post by: OtusDesign on July 15, 2008, 02:54:51 PM
YESSSS its solved because of you Bob. I don't want to give my url now, after prepared I will show everybody  8)
Thanks a million Bob  :thumbup:
Title: Re: [Mod] Toplist altered
Post by: Sunny C. on July 15, 2008, 03:15:21 PM
Woher bekomme ich denn die Topliste?

Wieder mal was falsch gelesen  :lol: 8) :oops:
Hat sich erledigt, es handelt sich um die Top10... ^^
Title: Re: [Mod] Toplist altered
Post by: AntiNSA2 on May 15, 2009, 06:28:58 AM
Quote from: M@2T
I have found in the code the "width" & "height" variables, is there a way to set the width and have the hight set proportionaly? so that the image will not be streched?
I'm not gonna post changes for original code, just for this fix:
http://4homepages.de/forum/viewtopic.php?p=13855#13855

So, in that fix, replace changes in step 2. to this:
Code: [Select]
  if (empty($top_list[$i]['image_thumb_file'])) {
   $thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
   $thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
      $thumb_info = @getimagesize($thumb_file);
      $width = $thumb_info[0];
      $height = $thumb_info[1];
      $dimension = 48;
      $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;
      }
then, changee width=\"48\" to width=\"$new_width\"
same for height.
Repeat for each section.


Id like to set these porportionately too... but the link you posted in this answer is broken... Can you explain how to do this porportionately?

Thanks!
Title: Re: [Mod] Toplist altered
Post by: SprinterMadl on June 06, 2009, 04:31:15 PM
So. ich hab jetzt glaub ich ca. 3 Stunden gebraucht um mich in diesen Thread "einzuarbeiten", und die Schnipsel zu "installieren".

Ich gehör mit Sicherheit nicht zu denen die zu faul zum suchen sind, oder alles vorgekaut bekommen wollen, bin auch in der Lage ne Weile zu suchen bis ich das finde was ich brauche, bevor ich einen Thread auf machen, oder hier antworte.

Aber Dieser hier ist mal wieder das beste Beispiel, momentan 13 Seiten, und überall liegen Schnipsel rum, für nen Newbie ist es hier unmöglich sich Informationen zu holen und zu verarbeiten, ohne blöde Fragen zu stellen.
Title: Re: [Mod] Toplist altered
Post by: bergblume on October 12, 2009, 01:28:29 PM
servus!

also wenn du den input von UFO aus diesem Thread hier befolgst, bekommst du ohne probleme die "10 meisten Kommentare" zum Laufen => Link (http://www.4homepages.de/forum/index.php?topic=2544.msg107948#msg107948)
was brauchst du sonst noch?

gruss, bergblume
Title: Re: [Mod] Toplist altered
Post by: zakaria666 on August 11, 2010, 01:23:31 AM
@Vano

I have finally fixed this, this is the first MOD i think i tried to do but was scared and i finally did.

If u click this link Vano, http://www.4homepages.de/forum/index.php?topic=2544.75  (http://www.4homepages.de/forum/index.php?topic=2544.75) u will be directed to another page in this topic, please look at the 3 rd which is yours, u r trying to help someone with the proportionality of images in the top, i tried to click that link but the link is dead. Is there another link which u can show me to fix this proportionality issue i have.

God bless u vano and thanks again for a great help and MOD
Title: Re: [Mod] Toplist altered
Post by: V@nо on August 11, 2010, 02:24:17 AM
Yes, an old link from the times when we used phpbb forum software.
Link fixed now.

P.S.
In case you didn't know, each reply has a unique address which you can find by hovering over headline. You can use these links instead of saying which post from the top you mean.

for example: http://www.4homepages.de/forum/index.php?topic=2544.msg22107#msg22107
Title: Re: [Mod] Toplist altered
Post by: zakaria666 on August 11, 2010, 02:46:09 PM
@ Vano,

Thank u so much for the advice, its funny u mentioned it because i have spent hours trying to find out how it worked  :P and al i had to really do was to click on the header title.

1)
Sir i did exactly like u said and thank u for fixing the link, it was much appreciated. I have done it, but below is an image of what it looks like, i just wanted to know sir, is this how is suppose to look. The images up are all dummy images and some images are not in proportion to others, as u can see from the image below. I followed ur advice in proportionality

(http://i33.tinypic.com/24zfvj7.jpg)

2)
and also one more thing sir in this link http://www.4homepages.de/forum/index.php?topic=2544.msg22107#msg22107 (http://www.4homepages.de/forum/index.php?topic=2544.msg22107#msg22107) you are just missing 1 more parenthesis at the end inside the code. Sorry if i am wrong.

Thank u again Vano for great help and god bless u sir.
Title: Re: [Mod] Toplist altered
Post by: V@no on August 11, 2010, 04:03:06 PM
It seems it's resizes by height...

Since this topic pretty much messed up, what code do you use, from witch reply?
Title: Re: [Mod] Toplist altered
Post by: zakaria666 on August 11, 2010, 04:23:41 PM
Hello Vano

Im so so sorry sir, but u said that "what code do i size, from which reply", please do not be angry sir but i did not understand what u mean by this. But i assume u r saying to me show u the code tht i used for this. If i am wrong please i apologize.

Below is the code i used to bring the images on toplist to proportion..

 
Code: [Select]
if (empty($top_list[$i]['image_thumb_file'])) {
  $thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
  $thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
      $thumb_info = @getimagesize($thumb_file);
      $width = $thumb_info[0];
      $height = $thumb_info[1];
      $dimension = 48;
      $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;
      }

Sorry if this is not what u are asking of me sir.

Thank u vano
Title: Re: [Mod] Toplist altered
Post by: V@no on August 11, 2010, 04:48:16 PM
actually I said "use", not "size" ;) wanted you to point out at the reply with the code of this mod you are using, but it's ok now, don't worry about it.

Looking at your screenshot, the images are proportional and resized properly, maintaining 48 pixels width or height which ever is larger.
If you want it always maintain 48 pixels width then replace
Code: [Select]
     if ($ratio > 1) {
        $new_width = $dimension;
        $new_height = floor(($dimension/$width) * $height);
      }else {
        $new_width = floor(($dimension/$height) * $width);
        $new_height = $dimension;
      }

with:
Code: [Select]
       $new_width = $dimension;
        $new_height = floor(($dimension/$width) * $height);
Title: Re: [Mod] Toplist altered
Post by: zakaria666 on August 11, 2010, 05:12:59 PM
@VAno,

Im so very sorry, i should have read ur post more carefully, how can i confuse size with use  :P

Vano i want to thank u again, i have tremandous admiration for u. Im very glad that u r not working for google or microsoft or apple because they will not appreciate ur work like we do. To many good and amazing programmers like u are very scarce and just make companies billions each year. Its very nice to see at least 1 like ur self helping out the community and have made an amazing software which i highly respect and i for one am very appreciative for it. I have through every post said thank u to u, but like i said, no words can show how much gratitude i hold for ur help.

thank u so much vano