Here is the showvotes.php file i saved this in my root directory
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: index.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.6.1 *
* *
* 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. *
* *
*************************************************************************/
$templates_used = 'thumbnail_bit2';
$main_template = 'votes';
define('GET_CACHES', 1);
define('ROOT_PATH', 'gallery/');
define('GET_USER_ONLINE', 1);
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
if (isset($HTTP_GET_VARS['template']) || isset($HTTP_POST_VARS['template'])) {
$template = (isset($HTTP_GET_VARS['template'])) ? stripslashes(trim($HTTP_GET_VARS['template'])) : stripslashes(trim($HTTP_POST_VARS['template']));
if (!file_exists(TEMPLATE_PATH."/".$template.".".$site_template->template_extension)) {
$template = "";
}
else {
$main_template = $template;
}
}
else {
$template = "";
}
if (!empty($template)) {
$clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator'].str_replace("_", " ", ucfirst($template));
$site_template->register_vars("clickstream", $clickstream);
$site_template->print_template($site_template->parse_template($main_template));
}
//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------
$imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
$imgtable_width .= "%";
}
$cat_id_sql = 0;
foreach ($cat_cache as $key => $val) {
if (!check_permission("auth_viewcat", $key)) {
$cat_id_sql .= ", ".$key;
}
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
$num_new_images = $config['image_cells'];
$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.", u.user_name, c.cat_name
FROM ".IMAGES_TABLE." i, ".USERS_TABLE." u, ".CATEGORIES_TABLE." c
WHERE i.image_active = 1 AND u.user_id = i.user_id AND c.cat_id = i.cat_id AND i.cat_id NOT IN ($cat_id_sql)
ORDER BY i.image_votes DESC
LIMIT $num_new_images";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
if (!$num_rows) {
$new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
$new_images .= $lang['no_new_images'];
$new_images .= "</td></tr></table>";
}
else {
$new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
$count = 0;
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)){
if ($count == 0) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
$new_images .= "<td width=\"".$imgtable_width."\" valign=\"bottom\">\n";
show_image($image_row);
$new_images .= $site_template->parse_template("thumbnail_bit2");
$new_images .= "\n</td>\n";
$count++;
if ($count == $config['image_cells']) {
$new_images .= "</tr>\n";
$count = 0;
}
} // end while
if ($count > 0) {
$leftover = ($config['image_cells'] - $count);
if ($leftover >= 1) {
for ($f = 0; $f < $leftover; $f++) {
$new_images .= "<td width=\"".$imgtable_width."\">\n </td>\n";
}
$new_images .= "</tr>\n";
}
}
$new_images .= "</table>\n";
} // end else
$site_template->register_vars("new_images", $new_images);
unset($new_images);
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"lang_rating" => $lang['rating'],
"lang_votes" => $lang['votes']
));
$site_template->print_template($site_template->parse_template($main_template));
?>
here is the template (thumbnail_bit2) which has to be saved into the template directory of 4images
<script language="JavaScript" type="text/javascript">
<!--
function opendetailwindow() {
window.open('','detailwindow','toolbar=yes,scrollbars=yes,resizable=yes,width=700,height=500');
}
function right(e) {
if (navigator.appName == 'Netscape' && (e.which == 2 || e.which == 3)) {
alert('© Copyright by {site_name}');
return false;
}
else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button==2 || event.button == 3)) {
alert('© Copyright by {site_name}');
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
// -->
</script>
<script language="JavaScript">
<!--
function reqWin(desktopURL){
desktop =window.open(desktopURL,"name","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=700,height=500,resizable=yes");
}
// -->
</script>
<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
<style>
a { color:#666666; text-decoration:none; } /* Link Defaults: Dark Blue, Gray Hover */
a:link { color:#666666; font size:10;}
a:visited { color:#666666; }
a:hover { background-color:#eeeeee; color:#FF6600; }
a img { border:none; }
</style>
<table width="100" height="100" border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="100" height="100" align="center" valign="middle" bgcolor="#F3F3F3">{thumbnail_openwindow}</td>
</tr>
<tr>
<td height="10" align="center" valign="middle" bgcolor="#F3F3F3"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Rating
{image_rating}{image_votes}</font></td>
</tr>
</table>
i used a iframe on my index.php to include the showvotes.php, and thats it..
-T