UBB.Dev
Posted By: JoshPet [6.2] Admin Selectable Ratings 1.0 - 02/24/2003 9:58 AM
I wrote this for a client this weekend, thought I'd share here, incase anyone else had a use for it.

Mod Name: Admin Selectable Ratings 1.0

Description: This allows the Admin to assign a custom rating image.
Useful for admins who want to be the one to assign ratings, or you could use to signify the level of financial support you've received from a user. I've included a series of graphics, so you can define from 1-5 gold stars for a user, then you can begin to change the stars from gold to red. Then from red to blue. Thus it's a rating system (admin or mod controlled) that allows you to go beyond just 5 stars, similar to the ebay rating system. You can add new rating images simply by uploading them to your server, they will then be instantly available to you.
Image Examples:
[]http://www.gapofrohan.com/forum/images/ratingimages/B1red4gold.gif[/]
[]http://www.gapofrohan.com/forum/images/ratingimages/B4red1gold.gif[/]
[]http://www.gapofrohan.com/forum/images/ratingimages/C2blue3red.gif[/]
[]http://www.gapofrohan.com/forum/images/ratingimages/D3green2blue.gif[/]


Author: JoshPet www.joshuapettit.com
        For discussion and bug reports go to www.ubbdev.com

Credits: Gardener for help sorting the list of images.
      Commissioned by and demo at: www.gapofrohan.com

Date: 2/24/03

Working Under: 6.2

Files Modified: /admin/showoneuser.php, /admin/dochangeuser.php, showflat.php,
showthreaded.php, showprofile.php

New Files: included images, uploaded to /images/ratingimages

Database Modifications: New field "U_RatingImage" added to the Users table.

Notes: To use, edit the user from the admin menu, and edit their profile, you'll see a pull down box at the bottom to select their rating image. When you select an image, a preview of the image will appear for you next to the menu box.


Attached File
Posted By: smilesforu Re: [6.2] Admin Selectable Ratings 1.0 - 02/24/2003 11:19 AM
Will this work with custom titles? and the profile hack?
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 02/24/2003 5:09 PM
Yup. This only replaces the ratings.
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 02/24/2003 5:10 PM
Correction.... when you say "profile hack" if you mean status bars it won't. This uses the ratings as does the profile status bar.

This could be adapted to work with it though.
Posted By: smilesforu Re: [6.2] Admin Selectable Ratings 1.0 - 02/25/2003 3:05 AM
Yes I am using your restrict profile mod so my users will fill in there profiles. Along with the user profile status bar. I also added the custom titles mod.. I would like to keep these and add this to go with them. The site is user supported and this would allow the ability to sell various levels of sponsorship.
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 02/25/2003 5:32 AM
I'll ahve to tweak this a bit then... to use this and profile status bars.

It is doable.

Unfortunately my list is pretty long right now... the stuff that I've been posting has been created for clients or myself. But when I get some time, I'll try to update this one to work with both.
Posted By: smilesforu Re: [6.2] Admin Selectable Ratings 1.0 - 02/25/2003 10:51 AM
Appreciate it... You been creating some great mods. Feel like a kid in a candy store with all these toys I got compared to the old classic. I have a hard time keeping up with all the great stuff that keeps showing up!!!

Thanks again for all the hard work.
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 02/25/2003 10:54 AM
he he

Classic has been around for a while, as has UBBDev. So we have alot to live up to, but we are growing fast here.
Posted By: jluerken Re: [6.2] Admin Selectable Ratings 1.0 - 04/12/2003 7:47 PM
Hey Josh, I wanted to use this hack to give my PREMIUM users another rating image but after installing it I have seen that also moderators are allowed to change the ratingimage. Can this be turned off?

I want to use it the following way:

Rating should be still on but if an admin gives a 'premium' user a fixed ratingimage' then this should be always should independant of what others are voting on this user.
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 04/12/2003 7:52 PM
If your Moderators are allowed to edit the users, then they'll have access to this like anything else.

In your config file, there's an option to allow Moderators to edit users. If you turn that off, then moderators won't be allowed to edit.
Posted By: jluerken Re: [6.2] Admin Selectable Ratings 1.0 - 04/12/2003 8:00 PM
I know Josh, I know.

My moderators should be able to edit users but should not be able to change their rating image. If they could do every moderator can make another user a premium user and thats not what I want
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 04/12/2003 8:14 PM
Oh. I see.

If you place the code inside an if statment like this, it'll only appear if they are an Admin:

if ($user['U_Status'] == "Administrator") {
// Put the code inside here
} // close the if statement


Then anything inside only shows to admins.
That might work.
Posted By: jluerken Re: [6.2] Admin Selectable Ratings 1.0 - 04/13/2003 1:00 PM
Hi Josh,

can I have this more detailed?

Which files to change and how?
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 04/15/2003 1:47 AM
Attached I've outlined the changes I think you'd need to make. Untested.

Attached File
75708-adminsonly.txt  (170 downloads)
Posted By: jluerken Re: [6.2] Admin Selectable Ratings 1.0 - 04/16/2003 12:21 PM
[]JoshPet said:
Attached I've outlined the changes I think you'd need to make. Untested. [/]

Thanks, I think I will give it a try...
Posted By: Gardener Re: [6.2] Admin Selectable Ratings 1.0 - 07/02/2003 7:42 PM
Why does this mod remove the user rating option when it doesn't have to as far as I can see. Now, I realize that the way it is meant to work is to let admins select the rating instead of users voting, but the mod would be more versatile if the rating option wasn't removed. There could still be information on how to remove the normal rating stuff for those who want to, but for those who want to use this to have some other type of image (informational or whatever) or who wants to have both types of ratings or those who use the profile status bar it would be nice to have the option to not remove the ratings.

Now, I don't think I'll have a problem making it do what I want, but maybe others will need the help.
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 07/02/2003 9:31 PM
Yes - good point - that's how I'm using it here. (for the haxxor logos). Removing the regular rating is just how the instructions had to be written for my client. But I should modify and update for 6.3 allowing it as an additional image.
Posted By: Gardener Re: [6.2] Admin Selectable Ratings 1.0 - 07/02/2003 11:16 PM
Yeah, took me a while to find this mod since I was looking for the haxxor mod, but since this one replaced the ratings I skipped it at first. =]

Well, I've got it working at my test site now, will be going live with it as soon as I've had my graphics guy doing some graphics.
Posted By: agate Re: [6.2] Admin Selectable Ratings 1.0 - 09/06/2003 9:36 AM
Hi JoshPet,
Could you provide this mod for V6.3?

And don't replaced the rating one?
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 09/06/2003 9:54 AM
Should work fine for 6.3. We are using it here for our Team UBBDev haxxor images.
Posted By: agate Re: [6.2] Admin Selectable Ratings 1.0 - 09/06/2003 2:17 PM
Hi JoshPet,
Gardener said this one replaced the ratings mod from user right?

Could you provide the mod which keep both?
Posted By: agate Re: [6.2] Admin Selectable Ratings 1.0 - 09/06/2003 4:19 PM
I skipped it, Thanks for the help!
Posted By: BWilliams_dup1 Re: [6.2] Admin Selectable Ratings 1.0 - 09/30/2003 7:42 AM
Josh,

Is it possible to run a query to default EVERYONE back to a zero status?

Thanks,

BWilliams
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 09/30/2003 8:18 AM
This should work....

UPDATE w3t_Users
SET U_RatingImage = ''

Posted By: BWilliams_dup1 Re: [6.2] Admin Selectable Ratings 1.0 - 09/30/2003 7:59 PM
[]JoshPet said:
This should work....

UPDATE w3t_Users
SET U_RatingImage = ''

[/]
Worked PERFECTLY, thanks


Now, how can I add the rating to show on the showmembers.php page ?
Posted By: salim Re: [6.2] Admin Selectable Ratings 1.0 - 10/03/2003 6:13 PM
josh,

this is great, however i would want to disable the classic rating that comes with the software, can I do that?. So I would be the only one who gives rating to the user rather than the users themselves
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 10/03/2003 7:18 PM
Admin -> Edit Config Settings -> "Do you want to enable the User Rating System?" = "No"

Posted By: salim Re: [6.2] Admin Selectable Ratings 1.0 - 10/04/2003 8:34 AM
LOL, thanks dude, maybe I should keep my mouth shut, to avoid the embarresment
Posted By: AKD96 Re: [6.2] Admin Selectable Ratings 1.0 - 10/08/2003 5:10 PM
Instructions updated for 6.4

Attached File
Posted By: Ian_W Re: [6.2] Admin Selectable Ratings 1.0 - 10/27/2003 7:36 PM
Thanks - reposted here for 6.4
Posted By: harsh Re: [6.2] Admin Selectable Ratings 1.0 - 01/21/2004 9:16 PM
jsut got an error with this one. on showflat.php got a parse error on line 1007

// Now we can show the post
$postrow[$i]['Number'] = $Number;
} <-- this is line 1007
$postrowsize = $i;

$dbh -> finish_sth($sth);

what should i do. i didnt even touch that line when i edited the code. can someone help! it only happens when i click on a actual thread link: this is the code: Parse error: parse error in /usr/home/adultwebmasterhangout/ubbthreads/showflat.php on line 1007
Posted By: harsh Re: [6.2] Admin Selectable Ratings 1.0 - 01/21/2004 9:37 PM
o i am using 6.2.3
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 01/22/2004 6:20 AM
A parse error usually means that you've missed something. Usually it's a { or } missing somewhere.

Double check that you copied and pasted everthing needed and didn't miss any lines.
Posted By: ChAoS_dup1 Re: [6.2] Admin Selectable Ratings 1.0 - 02/12/2004 1:03 AM
Josh it says to relace this line
Code
  SELECT t1.B_Number,t2.U_Username,t1.B_Posted,t1.B_IP,t1.B_Subject,t1.B_Body,t1.B_File,t1.B_Status,t1.B_Approved,t2.U_Picture,t1.B_Reged,t2.U_Title,t2.U_Color,t1.B_Icon,t1.B_Poll,t1.B_Parent,t2.U_Status,t2.U_Signature,t1.B_LastEdit,t1.B_LastEditBy,t2.U_Location,t2.U_TotalPosts,t2.U_Registered,t2.U_Rating,t2.U_Rates,t2.U_RealRating,t2.U_PicWidth,t2.U_PicHeight,t2.U_Number,t1.B_FileCounter,t1.B_AnonName<br /><br />


when mine actually looks like this
Code
//     SELECT t1.B_Number,t2.U_Username,t1.B_Posted,t1.B_IP,t1.B_Subject,t1.B_Body,t1.B_File,t1.B_Status,t1.B_Approved,t2.U_Picture,t1.B_Reged,t2.U_Title,t2.U_Color,t1.B_Icon,t1.B_Poll,t1.B_Parent,t2.U_Status,t2.U_Signature,t1.B_LastEdit,t1.B_LastEditBy,t2.U_Location,t2.U_TotalPosts,t2.U_Registered,t2.U_Rating,t2.U_Rates,t2.U_RealRating,t2.U_PicWidth,t2.U_PicHeight,t2.U_Number,t1.B_FileCounter,t1.B_AnonName, [:"red"]t1.B_ParentUser[/]<br />   



and I am also getting this now

SQL ERROR: Unable to do_query: // SELECT t1.B_Number,t2.U_Username,t1.B_Posted,t1.B_IP,t1.B_Subject,t1.B_Body,t1.B_File,t1.B_Status,t1.B_Approved,t2.U_Picture,t1.B_Reged,t2.U_Title,t2.U_Color,t1.B_Icon,t1.B_Poll,t1.B_Parent,t2.U_Status,t2.U_Signature,t1.B_LastEdit,t1.B_LastEditBy,t2.U_Location,t2.U_TotalPosts,t2.U_Registered,t2.U_Rating,t2.U_Rates,t2.U_RealRating,t2.U_PicWidth,t2.U_PicHeight,t2.U_Number,t1.B_FileCounter,t1.B_AnonName,t1.B_ParentUser SELECT t1.B_Number,t2.U_Username,t1.B_Posted,t1.B_IP,t1.B_Subject,t1.B_Body,t1.B_File,t1.B_Status,t1.B_Approved,t2.U_Picture,t1.B_Reged,t2.U_Title,t2.U_Color,t1.B_Icon,t1.B_Poll,t1.B_Parent,t2.U_Status,t2.U_Signature,t1.B_LastEdit,t1.B_LastEditBy,t2.U_Location,t2.U_TotalPosts,t2.U_Registered,t2.U_RatingImage,t2.U_PicWidth,t2.U_PicHeight,t2.U_Number,t1.B_FileCounter,t1.B_AnonName,t1.B_ParentUser FROM w3t_Posts AS t1, w3t_Users AS t2 WHERE t1.B_Main = 62335 AND t1.B_PosterId = t2.U_Number ORDER BY B_Number LIMIT 30
You have an error in your SQL syntax near '// SELECT t1.B_Number,t2.U_Username,t1.B_Posted,t1.B_IP,t1.B_Subject,t1.B_Bo' at line 2
Posted By: ChAoS_dup1 Re: [6.2] Admin Selectable Ratings 1.0 - 02/12/2004 1:11 AM
Ok I got rid of the SQL error,apparently it did not like the way I commented out the original line and I added this to the end of your line

t1.B_ParentUser

My new question is does this hack take away the function for users to rate each other because now Everyones stars are missing except those that I have given out.

Edit-Ok I have read this thread now in its entirety and see this question was raised before by Gardener.Can some one explain to me how to get the user ratings functional with this mod? I am using 6.3 currently
Posted By: JoshPet Re: [6.2] Admin Selectable Ratings 1.0 - 02/12/2004 2:32 AM
Yes, this one does. The latest version (the 6.4 version) allows you to have either.

https://www.ubbdev.com/forum/showflat.php/Number/104956
Posted By: ChAoS_dup1 Re: [6.2] Admin Selectable Ratings 1.0 - 02/14/2004 12:16 AM
I guess I am going to have to upgrade sooner than I planned

FYI t1.B_ParentUser must be from a mod that I installed that added the "in reply to" function. Its not working at the moment so I assume I must have accidentily edited some of it out when installing the user ratings mod *sigh*
© UBB.Developers