It's a great MOD, but will get performance problems (if you are not using your own cache). This post is for people with performance problems.
I removed the paging (since when you click on "show all images by XXX" it shows you all images with paging anyway). And I get rid of all the $row calculations,
since it really slows down anything (not just here, I would suggest you get rid of it anywhere).
So the best solution to solve performance problems is placing your thumbnails into <div> containers like this:
1. The modified PHP
//-----------------------------------------------------
//--- START Show user images in profile ---------------
//-----------------------------------------------------
$sql3 = "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.user_id = $user_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
ORDER BY i.image_date DESC
LIMIT 5";
$result = $site_db->query($sql3);
$num_rows = $site_db->get_numrows($result);
if (!$num_rows) {
$user_profile_images .= $lang['no_new_images'];
}
else {
while ($image_row = $site_db->fetch_array($result)){
show_image($image_row);
$user_profile_images .= $site_template->parse_template("thumbnail_bit_profile");
} // end while
} // end else
$site_template->register_vars("user_profile_images", $user_profile_images);
$site_template->register_vars("lang_user_profile_images", $lang['user_profile_images']);
unset($user_profile_images);
//-----------------------------------------------------
//--- END Show user images in profile -----------------
//-----------------------------------------------------
Less code --> Less Queries --> More performance
Then create a thumbnail_bit_profile with <div>'s
(just an example)
<div style="float: left; padding-left: 32px; padding-bottom: 20px;">
<div style="width: 210px; border: 1px solid #dddddd; padding: 1px;">
<div class="imgteaser">
<a href="details.php?image_id={image_id}&mode=search"><img src="data/thumbnails/{cat_id}/{thumbnail_file_name}" width="210" height="210">
</a>
</div>
</div>
</div>
and finally use {user_profile_images} inside a table in your member_profile.html