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

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

0 Members and 1 Guest are viewing this topic.

Offline medo007

  • Newbie
  • *
  • Posts: 29
  • Internet addict
    • View Profile
Re: [Mod] Toplist altered
« Reply #135 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
mEDO

Offline medo007

  • Newbie
  • *
  • Posts: 29
  • Internet addict
    • View Profile
Re: [Mod] Toplist altered
« Reply #136 on: February 15, 2007, 04:16:56 AM »
It's ok now, I fixed it!

bye
mEDO

Offline sbsreddy

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [Mod] Toplist altered
« Reply #137 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

Offline Hallo2007

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [Mod] Toplist altered
« Reply #138 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??

Offline musicsurfer

  • Full Member
  • ***
  • Posts: 184
    • View Profile
Re: [Mod] Toplist altered
« Reply #139 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

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: [Mod] Toplist altered
« Reply #140 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

Offline musicsurfer

  • Full Member
  • ***
  • Posts: 184
    • View Profile
Re: [Mod] Toplist altered
« Reply #141 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

Offline musicsurfer

  • Full Member
  • ***
  • Posts: 184
    • View Profile
Re: [Mod] Toplist altered
« Reply #142 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

Offline fast

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


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [Mod] Toplist altered
« Reply #144 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);
8 steps need when ask question -

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

Offline fast

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: [Mod] Toplist altered
« Reply #145 on: November 14, 2007, 08:59:33 PM »
doesn't help, still the same error :(

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [Mod] Toplist altered
« Reply #146 on: November 14, 2007, 09:03:02 PM »
I no can reproduce ...

Please read step 1-2-3 of my signature and post.
8 steps need when ask question -

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

Offline fast

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

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [Mod] Toplist altered
« Reply #148 on: November 14, 2007, 09:10:22 PM »
I see old code. You no replace for my code. :?
8 steps need when ask question -

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

Offline fast

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: [Mod] Toplist altered
« Reply #149 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] = "--";
  }
}