4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: mircea on January 08, 2008, 10:03:33 PM
-
Hi,
I would like to enrich the user profile with few extra fields (thumbnails):
Best rated user picture (highest rating average)
Most popular picture (picture with the highest number of hits)
Most commented picture (picture with the highest number of comments)
Is there any MOD already created?
Thanks!!
-
Hi,
I would like to enrich the user profile with few extra fields (thumbnails):
Best rated user picture (highest rating average)
Most popular picture (picture with the highest number of hits)
Most commented picture (picture with the highest number of comments)
Is there any MOD already created?
Thanks!!
is there already a solution available for this request?
-
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}
-
Hi alekinna,
i love your signature :wink:
Kurt
-
I alekinna,
I just tried out your mod, but I get the following error message:
An unexpected error occured. Please try again later.
An unexpected error occured. Please try again later.
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /var/www/web15/html/member.php on line 1852
please help!
-
Hi,
I tried this Mod in wamp "localhost" and works nice.
But,if send to the server (online) don't works. :?
what's the problem? 8O
The server have PHP Version 5.2.3
Thanks,
Fernando
-
Anyone solve the problem with this Mod. :?:
Works nice only in localhost. :cry:
Thanks,
-
Hat das jemand getestet?
Läuft das?
-
Hat das jemand getestet?
Läuft das?
Yes,this works but only in localhost (my pc) online don't works.
You can see a example in the image in attach.
-
:evil: :evil: :evil:
An unexpected error occured. Please try again later
-
:evil: :evil: :evil:
An unexpected error occured. Please try again later
I don't have any error if is Onine.Only don't show anything! :?