Hi!
1.) search in details.php:
//-----------------------------------------------------
//--- Clickstream -------------------------------------
insert above:
//#################### Random Images Start ########################
$num_random_images = 5; // how many Images
$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, 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 NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").") AND i.cat_id = $cat_id AND i.image_id not in($image_id)
ORDER BY RAND()
LIMIT $num_random_images ";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
if(!$num_rows){
$random_images = $site_template->parse_template("random_image");
}
else{
$random_images ="";
while ($image_row = $site_db->fetch_array($result)){
$site_template->register_vars(array(
"rand_thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode,1),
"rand_image_name" => format_text($image_row['image_name'], 2),
"rand_user_name" => $image_row['user_name'],
"lang_comments" => $lang['comments'],
"rand_image_comments" => ($image_row['image_allow_comments'] == 1) ? $image_row['image_comments'] : "",
));
$random_images .= $site_template->parse_template("more_random_image");
} // end while
} // end else
$site_template->register_vars("random_cat_image", $random_images);
unset($random_images);
//#################### Random Images END ########################
2.) create a new flie call it "more_random_image.html" and store it in your template folder:
{rand_thumbnail}<br>{rand_image_name}{if image_is_new} <sup class="new">{lang_new}</sup>{endif image_is_new}<br>
{if allow_comments}{lang_comments} {rand_image_comments}{endif allow_comments}<br>{rand_user_name}<br><br>
3.) now you can, where ever you want, write in details.html "{random_cat_image}"
mfg Andi