I am Brazilian guy and of an aid.
How to modify script below to show the visited categories more?
they forgive for the bad English
<?php
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('SCRIPT_URL', 'http://mygallery');
define('ROOT_PATH', './');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
function is_remote($file_name) {
return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}
echo'<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100">
<tr>';
$sql = "SELECT a.image_id, a.cat_id, a.image_active, a.image_thumb_file, a.image_name, a.image_hits
FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
WHERE a.image_active=1
AND a.cat_id = b.cat_id
AND b.auth_viewcat=".AUTH_ALL."
AND b.auth_viewimage=".AUTH_ALL."
ORDER BY image_hits DESC
LIMIT 3";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$image_name = $row['image_name'];
$image_hits = $row['image_hits'];
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo "<td align=\"center\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"135\">
<tr>
<td bgcolor=\"#E1E1E1\" align=\"center\" height=\"10\">
<p align=\"left\"><b>$image_name</b></p>
</td>
</tr>
<tr>
<td bgcolor=\"#EFEFEF\" align=\"center\" height=\"75\" background=\"./arquivo/templates/default/images/img_fundo_thumb.gif\">
<p><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=_parent><img src=\"".$thumb_src."\" border=\"0\" vspace=\"3\" hspace=\"3\"></a></p>
</td>
</tr>
<tr>
<td bgcolor=\"#EFEFEF\" align=\"left\" height=\"10\" width=\"125\">
<p>Visualizações: $image_hits</p>
</td>
</tr>
</table>
</td>";}
echo '</tr>
</table>';
?>