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

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

0 Members and 1 Guest are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [Mod] Toplist altered
« Reply #150 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.
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 #151 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)

Offline thunderstrike

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

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

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [Mod] Toplist altered
« Reply #153 on: November 14, 2007, 09:45:40 PM »
You use remote or local image ?
8 steps need when ask question -

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

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [Mod] Toplist altered
« Reply #154 on: November 14, 2007, 09:48:40 PM »
In FTP - see filename in data/<<cat_id>>/<<image_id>>/<<filename>> ?
8 steps need when ask question -

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

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [Mod] Toplist altered
« Reply #155 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!
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 #156 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

« Last Edit: November 14, 2007, 10:16:48 PM by fast »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [Mod] Toplist altered
« Reply #157 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);
« Last Edit: November 14, 2007, 10:09:35 PM by Nicky »
8 steps need when ask question -

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

Offline fast

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


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [Mod] Toplist altered
« Reply #159 on: November 15, 2007, 06:57:49 PM »
8 steps need when ask question -

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

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [Mod] Toplist altered
« Reply #160 on: November 15, 2007, 08:32:36 PM »
You use IP ban for my IP ? If so, sorry - no support for you.
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 UFOSWORLD

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



Offline J.Lond

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

Offline UFOSWORLD

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: [Mod] Toplist altered
« Reply #163 on: December 11, 2007, 02:51:39 PM »
Kann mir bei den Problemen mal bitte jemand weiterhelfen?

gruss ufo

Offline UFOSWORLD

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: [Mod] Toplist altered
« Reply #164 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
« Last Edit: December 28, 2007, 01:38:15 PM by UFOSWORLD »