This mod will add to user's profile user's images top (most rated, most commented, most viewed, most downloaded).
If all user's images have most value (hits, rating, e.g.) = 0, no image will displayed for this value.
1. in the file member.php
find
else {
$user_email = REPLACE_EMPTY;
$user_email_save = REPLACE_EMPTY;
$user_mailform_link = REPLACE_EMPTY;
$user_email_button = REPLACE_EMPTY;
}
add below
// ----------------------------------- USER'S IMAGES TOP ----------------------------------
$user_images_top = "";
$most_value_array = array("image_rating", "image_hits", "image_comments", "image_downloads");
$most_value_image = "";
foreach ($most_value_array as $key) {
$additional_sql = "";
if ($key == "image_rating") {
$additional_sql .= "AND image_rating = (SELECT MAX(image_rating) ";
$most_value = $lang['most_rate'];
}
elseif ($key == "image_hits") {
$additional_sql .= "AND image_hits = (SELECT MAX(image_hits) ";
$most_value = $lang['most_hits'];
}
elseif ($key == "image_comments") {
$additional_sql .= "AND image_comments = (SELECT MAX(image_comments) ";
$most_value = $lang['most_comments'];
}
elseif ($key == "image_downloads") {
$additional_sql .= "AND image_downloads = (SELECT MAX(image_downloads) ";
$most_value = $lang['most_downloads'];
}
$sql = "SELECT image_id, cat_id, image_name, image_thumb_file, image_comments, image_downloads, image_rating, image_hits
FROM ".IMAGES_TABLE." a
WHERE user_id = $user_id AND image_active = 1 $additional_sql
FROM ".IMAGES_TABLE." b
WHERE a.user_id = b.user_id)
GROUP BY image_date";
$most_value_row = $site_db->query_firstrow($sql);
if ($most_value_row[$key] != 0 && !empty($most_value_row[$key])) {
$most_value_image .= "<td align=\"center\"><b>".$most_value." (".$most_value_row[$key].")</b><br>\n";
$most_value_image .= "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$most_value_row['image_id'])."\"><img src=\"".get_file_path($most_value_row['image_thumb_file'], "thumb", $most_value_row['cat_id'], 0, 1)."\" border=\"0\" alt=\"\" title=\"".$most_value_row['image_name']."\" /><br>\n";
$most_value_image .= $most_value_row['image_name']."</a><br></td>\n";
}
}
if ($most_value_image != "") {
$user_images_top .= "<table border=\"0\" cellpading=\"0\" cellspasing=\"0\">\n<tr>\n";
$user_images_top .= $most_value_image."</tr>\n</table>\n";
}
// ---------------------------------------------------------------------------------------
1.1 find
"user_name" => (isset($user_row['user_name'])) ? format_text($user_row['user_name'], 2) : REPLACE_EMPTY,
add below
"user_images_top" => $user_images_top,
2. in the file lang/your_lang/main.php
add before ?>
$lang['most_rate'] = "Most rated";
$lang['most_hits'] = "Most viewed";
$lang['most_comments'] = "Most commented";
$lang['most_downloads'] = "Most downloaded";
3. in the file member_profile.html
use
{if user_images_top}{user_images_top}{endif user_images_top}