4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Stoleti on January 20, 2006, 09:26:39 PM
-
Its possible show in user profile the total of votes (from your own images) , and show it on profile , or show the total rate?
Total Votes : 321 vote(s)
or
User Rate : 6.21 ...
showing on each profile the stats of votes/rate of user ? :mrgreen:
-
showing on each profile the stats of votes/rate of user ?
This has been asked several times in the past as the answer is still no.
-
I'm confused...
1) first question I understood is to show total votes/rating for the images that user own (uploaded)
2) second question is kind of little different that I understood as votes/rating the user casted on the site...
If your question is "1)" then the answer is yes, you can, but if its "2)", then no you can not, UNLESS you've installed [MOD] Votes saved in DB (http://www.4homepages.de/forum/index.php?topic=6123.0).
-
I'm confused...
1) first question I understood is to show total votes/rating for the images that user own (uploaded)
2) second question is kind of little different that I understood as votes/rating the user casted on the site...
If your question is "1)" then the answer is yes, you can, but if its "2)", then no you can not, UNLESS you've installed [MOD] Votes saved in DB (http://www.4homepages.de/forum/index.php?topic=6123.0).
Yes i've [MOD] Votes saved in DB installed 8)
:mrgreen:
-
So, which question is it? total votes for the images that the user own (votes made by others) or total votes casted by that user?
-
So, which question is it? total votes for the images that the user own (votes made by others) or total votes casted by that user?
yes ideia its count how many votes that user have got from another users in your own images (not my votes,but yes from another user in my images) and the other option its taken from this votes a "rate" :
example : 370 vote(s) => Give a "7.80 v"
one of both options ill be nice make avaliable :P , always made by others in my images :)
-
To show how many total votes and average rating the images owned by specific member received in member.php find:
if (!empty($user_row['user_email']) && (!isset($user_row['user_showemail']) || (isset($user_row['user_showemail']) && $user_row['user_showemail'] == 1))) {
Insert above:$lang['num_votes'] = "Image votes";
$lang['avg_rating'] = "Image average rating";
$sql = "SELECT SUM(image_votes) num_votes, AVG(image_rating) avg_rating
FROM ".IMAGES_TABLE."
WHERE ".get_user_table_field("", "user_id")." = ".$user_id." AND image_rating > 0";
$result = $site_db->query_firstrow($sql);
$result['num_votes'] = ($result['num_votes']) ? $result['num_votes'] : 0;
$result['avg_rating'] = ($result['avg_rating']) ? sprintf("%.2f", $result['avg_rating']) : 0;
$site_template->register_vars(array(
"num_votes" => $result['num_votes'],
"avg_rating" => $result['avg_rating'],
"lang_num_votes" => $lang['num_votes'],
"lang_avg_rating" => $lang['avg_rating'],
));
In member_profile.html template you can use these tags:
{lang_num_votes}
{num_votes}
{lang_avg_rating}
{avg_rating}
(you can move $lang['num_votes'] = "Images votes";
$lang['avg_rating'] = "Images average rating";
into your main.php language file)
Note, this will work with default 4images, no extra mod required.
-
This doesn't work, i mean doesn't show (Lang) and (Votes) on profile , note i'm using the version A of MOD Votes saved in DB 8)
-
Then you inserted it in a wrong please, for example it wont work if you insert it below and not above.
I've tested on fresh 4images v1.7.1 without any mods.
-
i've added again and this is working :) , following the ideia, its possible create a top with this (top 10) of user with more votes or more high rating ? (by user and not by image) ? :wink:
-
i've added again and this is working :) , following the ideia, its possible create a top with this (top 10) of user with more votes or more high rating ? (by user and not by image) ? :wink:
This is what I meant about the earlier requests. It has never been done before (no one would do it. :() but I still second that though. ;)
@V@no :
In the mean time, may I ask why these two arrays :
$lang['num_votes'] = "Image votes";
$lang['avg_rating'] = "Image average rating";
has been added on top of your routine and not in main.php file ?
-
but must be possible following the the ideia of default code of top.php , but i'm not php coder, so let php experts think on it :mrgreen:
-
@V@no :
In the mean time, may I ask why these two arrays :
$lang['num_votes'] = "Image votes";
$lang['avg_rating'] = "Image average rating";
has been added on top of your routine and not in main.php file ?
Just to simplyfy the installation instructions, less steps and besides not everyone is using multi-language feature :)
-
make things simply its always a good thing :wink: , but about added a table on top.php of top 10 more rated/more votes users ill be great, maybe to increase more popularity to site :wink:
-
The MOD is more or less working, but it shows just the votes the admin mades, it doesnt count the votes from normal users. I log in under a normal user, vote, but the number in my profile isn't increasing *but the vote itself is being accepted*
whats wrong?
-
I think you are missunderstanding meaning of this topic. Its not how many votes a member made, but how many votes member's images (the images the member have uploaded) received from other members.
-
resuming this MOD just count the votes and average rate from votes from "another" users in your IMAGES , only this :) simply this !! :wink:
-
Oh no :twisted: I'am sittin' ours trying to solve my "problem" ... thanks for the information guys - but, anyway, is it posible to show that what i'am searching for in the members profile? f.e.:
This user has rated XX images with an average voting of XX
Possible?
-
only with this mod:
http://www.4homepages.de/forum/index.php?topic=6123.0
I think I've posted code for that somewhere in the replys of that mod.
-
Its ... how many votes member's images (the images the member have uploaded) received from other members.
... it's important to know for a description ...
... for more clarity in member_profile.html the language-code in lang/<your_language>/main.php should be ...
... (http://img517.imageshack.us/img517/7821/eng9tu.gif) ...
$lang['num_votes'] = "Votes - received for the own images";
$lang['avg_rating'] = "Images average rating - for the own images";
... (http://img517.imageshack.us/img517/1378/deu8yc.gif) ...
$lang['num_votes'] = "Bildbewertungen - erhalten für die eigenen Bilder";
$lang['avg_rating'] = "Bewertungsdurchschnitt - für die eigenen Bilder";
... btw. a nice fetuare ... thanks V@no ... :!:
mawenzi
-
only with this mod:
http://www.4homepages.de/forum/index.php?topic=6123.0
I think I've posted code for that somewhere in the replys of that mod.
Do you mean this *http://www.4homepages.de/forum/index.php?topic=6123.msg57740#msg57740* code? If yes, how and where have i to include it to get the total votes/average rating for the user in his profile?
-
@ trez
... like this : http://www.4homepages.de/forum/index.php?topic=11242.msg58027#msg58027
... but it is only the count of user votes ...
-
@ trez
... like this : http://www.4homepages.de/forum/index.php?topic=11242.msg58027#msg58027
... but it is only the count of user votes ...
so when i want to show the total votes the member made, in his profile i should add
wrong
and then show the results by {user_num_votes} etc., in the profile.html? If iam wrong, can you explain me how to do it right? Kannst auch auf deutsch posten ;)
-
and then show the results by {user_num_votes} etc., in the profile.html? If iam wrong, can you explain me how to do it right?
Actually. You're going on the right track. However, under your templates/<your_template>/member_profile.html file, these are the four tags you need to add :
{user_num_votes}
{user_avg_rating}
{user_lang_num_votes}
{user_lang_avg_rating}
;)
-
If iam wrong, can you explain me how to do it right? Kannst auch auf deutsch posten ;)
... Ja, du liegst falsch ... :!:
... du hast oben gefragt, wo du den von dir angegeben Code (siehe Link) einfügen sollst und nicht was ...
... der Code für die vom User abgegebenen Stimmen in member.php --- Show Profile --- sieht etwa so aus :
//--- Nummer der abgegebenen Stimmen im Profil ---
$lang['user_votes'] = "Abgegebene Bewertungen:";
$lang['vot'] = "Bewertungen";
$sql = "SELECT user_v_images, user_id FROM ".USERS_TABLE." WHERE user_id = $user_id";
$row = $site_db->query_firstrow($sql);
$user_votes = $row['user_v_images'];
$lang_user_votes = $lang['user_votes'];
$lang_vot = $lang['vot'];
$site_template->register_vars(array(
"user_votes" => $user_votes,
"lang_user_votes" => $lang_user_votes,
"lang_vot" => $lang_vot,
));
//--- Nummer der abgegebenen Stimmen im Profil ---
jetzt kannst du in deiner member_profile.html folgende Tags verwenden :
<b>{user_lang_votes}</b> {user_votes} {vot}
PS. Voraussetzung ist aber : http://www.4homepages.de/forum/index.php?topic=6123.0 Varinate B
PPS. Deinen Code kannst du löschen, da er andere User nur verwirren wird !
mawenzi
-
mawenzi, vielen dank fuer deine muehe, allerdings habe ich die Avariante installiert, kann man den code irgendwie aendern so dass er mit der A variante funzt? :)
mawenzi, thanks for your help, but i have installed the A version of that mod - anyway to make thinks work?
-
... und auf speziellen Wunsch ...
... der Code für die vom User abgegebenen Stimmen in member.php --- Show Profile --- ....
... in Anlehnung an : http://www.4homepages.de/forum/index.php?topic=6123.msg57740#msg57740
... Voraussetzung hierfür : http://www.4homepages.de/forum/index.php?topic=6123.0 Varinate A
//--- Nummer der abgegebenen Stimmen im Profil ---
$lang['user_votes'] = "Abgegebene Bewertungen:";
$lang['vot'] = "Bewertungen";
$sql = "SELECT COUNT(vote) AS user_votes FROM ".VOTED_TABLE." WHERE user_id = ".$user_id;
$result = $site_db->query_firstrow($sql);
$user_votes = $result['user_votes'];
$lang_user_votes = $lang['user_votes'];
$lang_vot = $lang['vot'];
$site_template->register_vars(array(
"user_votes" => $user_votes,
"lang_user_votes" => $lang_user_votes,
"lang_vot" => $lang_vot,
));
//--- Nummer der abgegebenen Stimmen im Profil ---
jetzt kannst du in deiner member_profile.html folgende Tags verwenden :
<b>{user_lang_votes}</b> {user_votes} {vot}
PS. ist aber ungetestet, da ich auch die Struktur der Tabelle nicht weiter kenne ... !
mawenzi
-
FUNZT! Vielen vielen dank ;)