DESCRIPCION:Este mod muestra una Tabla adicional en el HOME de tu página (y / o cualquier otra página) de tu galería, con la miniatura del ganador de cada categoría - Lo más valorados, votados, comentados, visto y descargado.
CAPTURAimage hostingAUTOR: Silly Little Lamer (sll@dalnet.ru) y V@ano (
http://come.no-ip.com)
Modificado por Geycer Paredes M. (
http://artecristiano.org)
1. Crea un archivo llamado "mini_top.php" y súbelo a la raiz principal<?php
define('GET_CACHES', 1);
define('ROOT_PATH', './');
$user_access = get_permission();
$imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
$imgtable_width .= "%";
}
$mini_top_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
$mini_top_images .= "<tr class=\"imagerow1\">\n";
$selection = array('rating', 'votes', 'hits', 'comments', 'downloads');
$selection_alt = array('votes DESC', 'rating DESC', 'name ASC', 'name ASC', 'name ASC');
# $selection_cutoff = array(' AND i.image_votes > 10', '', '', '', '');
$num_of_cells = $config['image_cells'];
$num_of_cells = $num_of_cells > count($selection) ? count($selection) : $num_of_cells;
for ($cnt = 0; $cnt < $num_of_cells; $cnt++) {
$mini_top_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", 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 c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")".$selection_cutoff[$cnt]."
ORDER BY i.image_".$selection[$cnt]." DESC, i.image_".$selection_alt[$cnt];
$result = $site_db->query_firstrow($sql);
show_image($result);
$site_template->register_vars("lang_mini_top_mode", $lang['mini_top_'.$selection[$cnt]]);
$mini_top_images .= $site_template->parse_template("mini_top_bit");
$mini_top_images .= "\n</td>\n";
}
$mini_top_images .= "</tr>\n";
$mini_top_images .= "</table>\n";
$site_template->register_vars(array(
"mini_top_images" => $mini_top_images,
"lang_hits" => $lang['hits'],
"lang_downloads" => $lang['downloads'],
"lang_mini_top_title" => $lang['mini_top_title']
));
unset($mini_top_images);
?>2. Crea un archivo llamado "mini_top_bit.html" y súbelo a la raiz de tu thema<center>{thumbnail}<br />
<b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new}
<br />
<a href="{cat_url}">{cat_name}</a><br />
{if allow_votes}{lang_votes} Votos {image_votes}{endif allow_votes}<br />
{if allow_comments}{lang_comments} {image_comments}{endif allow_comments}<br />
{if allow_downloads}{lang_downloads} Descargas {image_downloads}{endif allow_downloads}<br />
{if allow_hits}{lang_hits} Visitas {image_hits}{endif allow_hits}<br />
<b>{lang_mini_top_mode}</b>
</center>3. ABRIR "index.php" y buscar: require(ROOT_PATH.'includes/sessions.php');Agregar luego
include(ROOT_PATH.'mini_top.php');4. ABRIR /lang/spanish/main.php ...agregar al final//-----------------------------------------------------
//--- Mini-Top ----------------------------------------
//-----------------------------------------------------
$lang['mini_top_title'] = "Más Popular";
$lang['mini_top_rating'] = "Mejor Evaluado";
$lang['mini_top_votes'] = "Más Votado";
$lang['mini_top_comments'] = "Más Comentado";
$lang['mini_top_downloads'] = "Más Descargado";
$lang['mini_top_hits'] = "Más Visto";5. ABRIR /template/xxxx/home.htmlInserte el siguiente cuadro en el lugar, donde le gustaría mostrar Mini-Top, por ejemplo, después de nuevas imágenes:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head1">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="head1" valign="top">{lang_mini_top_title}</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="head1">{mini_top_images}</td>
</tr>
</table>
<br />
Muy Sencillo......