Author Topic: Top hits ranking - modification  (Read 7594 times)

0 Members and 1 Guest are viewing this topic.

Offline MaK_86

  • Pre-Newbie
  • Posts: 3
    • View Profile
Top hits ranking - modification
« on: August 06, 2012, 10:21:58 AM »
Hi...

I'm making a little mods in my site. In the /top.php
I wanna to show only the top hits, because the voting I have turned off a while ago.

More of that. I wanna to make Top Image Hits from 10 to 25. A have make the modification, but the is a problem, because the placeses from 11 to 25 is clear.

xxx: xxx: maku. szczecin. pl/galeriakolejowa/top. php

Is there some mods that I have to do?
I'm guessing the general index.php

Can someone tell me what & where the mods I have to do?

Hearing from PL.

Edit:
I have made it.
Need to modificate top.php in the mail folder.

from:
$site_db->free_result(); for ($i 1$i <= 10$i++)

to:$site_db->free_result(); for ($i 1$i <= 25$i++)

and also
from:
image_hits DESCi.image_name ASC         LIMIT 10";
to:
image_hits DESCi.image_name ASC         LIMIT 25";
« Last Edit: August 06, 2012, 04:02:20 PM by MaK_86 »

Rembrandt

  • Guest
Re: Top hits ranking - modification
« Reply #1 on: August 06, 2012, 06:43:42 PM »
Welcome to the Forum!
....I have made it.
....

The problem is the HTML, they make dynamic HTML.

Try this:

1.) the new top.php:

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: top.php                                              *
 *        Copyright: (C) 2002-2010 Jan Sorgalla                           *
 *            Email: jan@4homepages.de                                    * 
 *              Web: http://www.4homepages.de                             * 
 *    Scriptversion: 1.7.10                                               *
 *                                                                        *
 *    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''./');
define('MAIN_SCRIPT'__FILE__);
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
$num_rating 25;
$start_num_rating 1;
$start_sql_rating $start_num_rating -1;//do not edit this line
$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_rating DESC, i.image_name ASC
        LIMIT 
$start_sql_rating$num_rating";
$result $site_db->query($sql);
$top_list = array();
$i $start_num_rating;

while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();
$rating="";
for (
$i $start_num_rating$i <= $num_rating$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'], 2)."</a>" format_text($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] = "--";
  }
  
  
$row_bg_number = ($i == 0) ? 1;
  
 
$my ="";
   if(
$top_list[$i][$user_table_fields['user_id']] == $user_info['user_id']){
    
$my "<span style='color:red;'><b> *</b></span>";
  } else{
   
$my "<span style='color:red;'><b>&nbsp;&nbsp;&nbsp;</b></span>";
  }
  
$rating .=  "<tr > 
                <td class=\"row"
.$row_bg_number."\" style=\"width:5%;\"align=\"center\"><b>".$i."</b>
                <td class=\"row"
.$row_bg_number."\" width=\"25%\">".$register_array['image_rating_'.$i]."</td>
                <td class=\"row"
.$row_bg_number."\" width=\"25%\">".$register_array['image_rating_user_'.$i]."</td>
                <td class=\"row"
.$row_bg_number."\" width=\"25%\">".$register_array['image_rating_cat_'.$i]."</td>
                <td class=\"row"
.$row_bg_number."\" nowrap>".$register_array['image_rating_number_'.$i]."</td>
              </tr>"
;
}
$site_template->register_vars(array(
"num_rating" => $num_rating,
"lang_top_image_rating" => preg_replace("/{num_rating}/" ,$num_rating$lang['top_image_rating']),
"rating" => $rating,
));

// Votes
$num_votes 25;
$start_num_votes 1;
$start_sql_votes $start_num_votes -1;//do not edit this line
$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 
$start_sql_votes$num_votes";
$result $site_db->query($sql);
$top_list = array();
$i $start_num_votes;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();
$votes ="";
for (
$i $start_num_votes$i <= $num_votes$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_votes']."</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] = "--";
  }
  
  
$row_bg_number = ($i == 0) ? 1;
  
$votes .=  "<tr> 
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" width=\"5%\"align=\"center\"><b>".$i."</b></td>
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" width=\"25%\">".$register_array['image_votes_'.$i]."</td>
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" width=\"25%\">".$register_array['image_votes_user_'.$i]."</td>
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" width=\"25%\">".$register_array['image_votes_cat_'.$i]."</td>
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" nowrap>".$register_array['image_votes_number_'.$i]."</td>
              </tr>"
;
}

$site_template->register_vars(array(
"num_votes" => $num_votes,
"lang_top_image_votes" => preg_replace("/{num_votes}/" ,$num_votes$lang['top_image_votes']),
"votes" => $votes,
));

// Hits
$num_hits 25;
$start_num_hits 1;
$start_sql_hits $start_num_hits -1;//do not edit this line
$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 
$start_sql_hits,  $num_hits";
$result $site_db->query($sql);
$top_list = array();
$i $start_num_hits;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();
$hits "";
for (
$i $start_num_hits$i <= $num_hits$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] = "--";
  }
  
    
$row_bg_number = ($i == 0) ? 1;
  
$hits .=  "<tr> 
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" width=\"5%\"align=\"center\"><b>".$i."</b></td>
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" width=\"25%\">".$register_array['image_hits_'.$i]."</td>
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" width=\"25%\">".$register_array['image_hits_user_'.$i]."</td>
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" width=\"25%\">".$register_array['image_hits_cat_'.$i]."</td>
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" nowrap>".$register_array['image_hits_number_'.$i]."</td>
              </tr>"
;
}

$site_template->register_vars(array(
"num_hits" => $num_hits,
"lang_top_image_hits" => preg_replace("/{num_hits}/" ,$num_hits$lang['top_image_hits']),
"hits" => $hits,
));

// Downloads
$num_downloads 25;
$start_num_downloads 1;
$start_sql_downloads $start_num_downloads -1;//do not edit this line
$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 
$start_sql_downloads,$num_downloads";
$result $site_db->query($sql);
$top_list = array();
$i $start_num_downloads;
while (
$row $site_db->fetch_array($result)) {
  
$top_list[$i] = $row;
  
$i++;
}
$site_db->free_result();
$downloads ="";
for (
$i $start_num_downloads$i <= $num_downloads$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] = "--";
  }
      
$row_bg_number = ($i == 0) ? 1;
    
$downloads .=  "<tr> 
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" width=\"5%\"align=\"center\"><b>".$i."</b></td>
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" width=\"25%\">".$register_array['image_downloads_'.$i]."</td>
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" width=\"25%\">".$register_array['image_downloads_user_'.$i]."</td>
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" width=\"25%\">".$register_array['image_downloads_cat_'.$i]."</td>
                <td valign=\"top\" class=\"row"
.$row_bg_number."\" nowrap>".$register_array['image_downloads_number_'.$i]."</td>
              </tr>"
;
}
$site_template->register_vars(array(
"num_downloads" => $num_downloads,
"lang_top_image_downloads" => preg_replace("/{num_downloads}/" ,$num_downloads$lang['top_image_downloads']),
"downloads" => $downloads,
));

//-----------------------------------------------------
//--- 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_comments_ranking" => $lang['top_comments_ranking'],//= "Rang"; 
  
"lang_comments_user" => $lang['top_comments_user'],//= "Mitglied";
  
"lang_comments_cat" => $lang['top_comments_cat'],//= "Kommentar";
  
"lang_comments_date" => $lang['top_comments_date'],//= "Datum";
  
"lang_comments_images" => $lang['top_comments_images'],//= "Bildname";
  
"lang_comments_image" => $lang['top_comments_image'],//= "Bild";
  
"lang_comments_votes" => $lang['top_comments_votes'],//= "Bewertung";
  
"lang_votes" => $lang['votes']//= "Stimmen";
));
$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');
?>


2.) the new top.html:
Code: [Select]
{header}
<table width="960" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablehead">
        <tr>
          <td width="100%" colspan="4"><table cellpadding="0" cellspacing="0" width="100%">
        <tr>
        <td width="6"><img src="{template_url}/images/header_top_left.gif" width="6" height="6" alt="" /></td>
        <td width="100%"><img src="{template_url}/images/header_top.gif" width="100%" height="6" alt="" /></td>
        <td width="6"><img src="{template_url}/images/header_top_right.gif" width="6" height="6" alt="" /></td>
        </tr>
      </table>
      </td>
        </tr>
        <tr>
          <td width="6"><img src="{template_url}/images/header_left.gif" width="6" height="60" alt="" /></td>
          <td width="100%"><img src="{template_url}/images/header_logo.gif" width="405" height="60" alt="" /></td>
          <td width="225" align="right">
            <form method="post" action="{url_search}">
              <table border="0" cellspacing="0" cellpadding="1">
                <tr>
                  <td>
                    <input type="text" name="search_keywords" size="15" class="searchinput" />
                  </td>
                  <td>
                    <input type="submit" value="{lang_search}" class="button" name="submit" />
                  </td>
                </tr>
                <tr valign="top">
                  <td colspan="2"><a href="{url_search}" class="smalltext">{lang_advanced_search}</a></td>
                </tr>
              </table>
            </form>
          </td>
          <td align="right" width="6"><img src="{template_url}/images/header_right.gif" width="6" height="60" alt="" /></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bordercolor">
      <table width="100%" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <td class="tablebgcolor">
            <table width="100%" border="0" cellspacing="1" cellpadding="0">
              <tr>
                <td class="navbar" height="23">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}</td>
                      <td align="right">
                      <a href="{url_top_images}"><b>{lang_top_images}</b></a>&nbsp;
                      <a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td  class="row2" valign="top">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_registered_user}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">{user_box}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
                  {if random_image}
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">
                      <br />
                        {random_image}
                      <br />
                        <br />
                      </td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
                  {endif random_image}
                </td>
                <td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                <td width="18" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="18" height="18" /></td>
                <td width="100%" valign="top">
                <br >
                  <span class="title">{lang_top_images}</span>
                  <hr size="1">
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                          <tr>
                            <td class="head1" valign="top" colspan="5">{lang_top_image_rating}</td>
                          </tr>
                          <tr>
                            <td  class="head1" style="width:5%;"></td>
                            <td  class="head1" style="width:12%;"></td>
                            <td  class="head1" style="width:20%;"></td>
                            <td  class="head1" style="width:25%;"></td>
                            <td  class="head1" style="width:25%;"></td>
                          </tr>
                          {rating}                          
                        </table>
                      </td>
                    </tr>
                  </table>
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                          <tr>
                            <td class="head1" valign="top" colspan="5">{lang_top_image_votes}</td>
                          </tr>
                          {votes}
                        </table>
                      </td>
                    </tr>
                  </table>
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                          <tr>
                            <td class="head1" valign="top" colspan="5">{lang_top_image_hits}</td>
                          </tr>
                          {hits}
                        </table>
                      </td>
                    </tr>
                  </table>
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                          <tr>
                            <td class="head1" valign="top" colspan="5">{lang_top_image_downloads}</td>
                          </tr>
                          {downloads}
                        </table>
                      </td>
                    </tr>
                  </table>
                      </td>
                    </tr>
                  </table>
                  <p>&nbsp;</p>
                </td>
                <td width="19" valign="top"><img src="{template_url}/images/spacer.gif" alt="" width="19" height="19" /></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablebottom">
        <tr>
          <td width="6" nowrap><img src="{template_url}/images/footer_left.gif" width="6" height="19" alt="" /></td>
          <td width="100%"></td>
          <td width="6" nowrap><img src="{template_url}/images/footer_right.gif" width="6" height="19" alt="" /></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
{footer}

3.) search in lang/english/main.php ( as example)

$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";

and replace:

$lang
['top_image_hits'] = "Top {num_hits} images by hits";
$lang['top_image_downloads'] = "Top {num_downloads} images by downloads";
$lang['top_image_rating'] = "Top {num_rating} images by rating";
$lang['top_image_votes'] = "Top {num_votes} images by votes";


now search in the php code (as example for "Rating"). Here you can set the beginning and the end:

// Rating
$num_rating 25;
$start_num_rating 1;
// Votes
$num_votes 25;
$start_num_votes 1;
// Hits
$num_hits 25;
$start_num_hits 1;
// Downloads
$num_downloads 25;
$start_num_downloads 1;


mfg Andi
« Last Edit: August 21, 2012, 04:53:14 AM by Rembrandt »

Offline FotoRalle

  • Jr. Member
  • **
  • Posts: 57
  • 4images als bestes Community-Script
    • View Profile
    • rs webregie | webdesign & webmaster
Re: Top hits ranking - modification
« Reply #2 on: September 23, 2015, 05:36:35 PM »
Thanks, it works perfect.

But: Is it possible to Show a Thumbnail of every Image in this list?