• [Mod] Toplist altered 5 0 5 1
Currently:  

Author Topic: [Mod] Toplist altered  (Read 234667 times)

0 Members and 1 Guest are viewing this topic.

Offline Mec4D

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.mec4d.com
[Mod] Toplist altered
« Reply #15 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!
Catharina

Offline Vraxor

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • http://tc-revolution.net
[Mod] Toplist altered
« Reply #16 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

Offline Mec4D

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.mec4d.com
[Mod] Toplist altered
« Reply #17 on: November 06, 2002, 06:43:49 PM »
thank you very much!!!

I got this now :)

Hugs!
Catharina

Offline dabri

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • http://www.12geschworene.de
[Mod] Toplist altered
« Reply #18 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

Offline Vraxor

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • http://tc-revolution.net
[Mod] Toplist altered
« Reply #19 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] = "--";
  }
}

Offline dabri

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • http://www.12geschworene.de
[Mod] Toplist altered
« Reply #20 on: November 06, 2002, 07:39:28 PM »
Sorry, but it didnīt work.

May be another solution?

Thanks Daniel

Offline Vraxor

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • http://tc-revolution.net
[Mod] Toplist altered
« Reply #21 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.

Offline Mec4D

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.mec4d.com
[Mod] Toplist altered
« Reply #22 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
Catharina

Offline sprokop

  • Newbie
  • *
  • Posts: 25
    • View Profile
[Mod] Toplist altered
« Reply #23 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
--
   __O
 _-\<,_     Why drive when you can bike?
(_)/ (_)

Offline Vraxor

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • http://tc-revolution.net
[Mod] Toplist altered
« Reply #24 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Toplist altered
« Reply #25 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?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sprokop

  • Newbie
  • *
  • Posts: 25
    • View Profile
[Mod] Toplist altered
« Reply #26 on: November 08, 2002, 05:12:14 AM »
Dunno? that's a good question for Jan!!

Good Luck
Sam
--
   __O
 _-\<,_     Why drive when you can bike?
(_)/ (_)

Offline cyber

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
[Mod] Toplist altered
« Reply #27 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.

Offline limes

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
question
« Reply #28 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

Offline threelum

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • http://www.threelum.com/imagenation/
[Mod] Toplist altered
« Reply #29 on: November 16, 2002, 07:41:05 PM »
thanks Vraxor  :D  :D  :D

it works fine with v1.7