![]() |
Here is an update to my stars hack - this one allows you different colored stars for admins/moderators
edit showthread.php find: Code:
$userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemail,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid"); Edit that line listed above and add Code:
usergroupid, Code:
$userinfo=$DB_site->query_first("SELECT usergroupid,userid, (...) etc etr Code:
$userpostcount=$userinfo[posts]; Code:
// --- Stars Hack by rangersfan You need to supply your own stars names "star.gif" and "star2.gif". "star2.gif" is for admins/moderators. Put them in forums/images. To modify how many stars correspond to how many posts you will need to change the if ($userpostcount > ..) parts. If you don't want stars, but galagas or such, change the parts that say '$stars .= $starsgif . $starsgif . $starsgif . $starsgif . $starsgif;' to something like '$stars .= (path to my image for x number of posts);' Edit the postbit template and put $stars where you want them to appear. [Edited by freddie on 11-04-2000 at 04:56 PM] |
Why not just add the html into custom user titles from the control panel?
~Chris |
I think it is something that should be included by default with vB, with a toggle of course. |
OK i see now ;) I was just curious
~Chris |
Excellent! This is exactly what I was looking for! I was about to try making my own, but decided to take another look through the forums and see if somebody had already made one. Thanks, and well done :)
BTW, does anyone know where I can get some star images? Preferably gold and silver. I'm afraid of what might happen if I attempt to make my own... lol. -Tom |
Quote:
|
Good idea! hehe. That site has some gold stars... I don't really care for the red ones.. I'll try to change the color to blue or silver I guess :) Thanks!
-Tom |
A slightly different way, utilizing the options in the control panel is something I wrote a while back:
Add this in place of the hard coded ratings in the if( .. ) blocks. Code:
Add this after the "Styles Options" in options.php -- should be right up at the top around line 68. Code:
<li><a href=\"#stars\">Stars Options</a></li> Code:
<!--/// Stars stuff--> Code:
<IMG SRC = "etc."> Also, the formula is something like this: 0;19;99;399;1999 So users with more than one post but less than 19 will get one star, users in between 19 and 99 will get two, etc. And if you want to add another star level, just add another number to the end! example: 0;19;99;399;1999;9999 But, if it seems harder to do, then don't worry about it -- I just thought I'd share it with people who are looking for this type of hack and might not want to mess with editing PHP files to find the right "formula" -- it took me a while to find a good balance, and if I had to keep uploading a PHP file I'd go crazy! :) |
For some reason, I can't get Rangersfan's code to work on my board. I followed the instructions exactly and didn't change any of the code except for the image names and image sizes. Has anyone else had any problems getting this working? or is there something I have to do after editing showthread.php? Here's what my code looks like after I add the hack:
Code:
$userinfo=$DB_site->query_first("SELECT usergroupid,userid,email,username,usertitle,signature,showemail,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid"); |
Edit the postbit template and put $stars where you want them to appear.
|
Doh! Feeling pretty dumb now...
Hehehe. Thanks RangersFan ;) -Tom |
Hm... I've run into another problem, and I'm not quite sure what's wrong. I changed the code a little so if the user is Admin/Mod it automatically gives them 5 yellow stars, and if it's just a regular user, it gives them blue stars depending on how many posts they have. For some reason though, it's only giving the Administrator the yellow stars, and not the moderators (who are actually Super Moderators). Does it not work with Super Moderators?
-Tom |
Change this line
if (($moderator[usergroupid] == $s_usergroup)||($s_usergroup==6)) to if (($moderator[usergroupid] == $s_usergroup)||($s_usergroup==6)||($s_usergroup==5 )) |
I have installed this hack and it works great! thanks a lot.
But I want to have it do mods get 9 silver stars and supper mods get 9 gold stars and admins get 10 gold how can I do this? I have beed trying and i can't get it to work. |
Con_Man I have changed the code above and if check you will see it now has sections of Mod/SuperMod and Admin. Just put the stars you want for each into each section.
I will optimize the SQL in this hack when v2.0 is released if there are no stars in v2.0 by default. [Edited by freddie on 11-04-2000 at 05:03 PM] |
Quote:
|
thanx.
great hack. i changed it a little. i added that admins get 8 stars and mods 7, no matter how many posts they have. |
i get this when i upload the updated showthread.php
There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser. An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists. We apologise for any inconvenience. any ideas? |
Throughout the entire showthread.php file I did not find
Code:
$userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemail,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid"); |
Line changed in 1.1.5.
Look for $posts=$DB_site->query_first.......... Hope I'm correct. :) |
Tragical Error!
There appears to be something wrong with the Database please e-mail the Technical Staff! Something along these lines! Couldn't you release a New Hack that has everything needed in it! And for 1.1.4 because I can't upgrade for some reasons my templates hae been changed and it won't do it! |
Sorry buy a license and upgrade.
|
I have a license and I CAN'T upgrade!
I tried and I got a MAJOR error! IT screwed everything up so I had to go back to 1.1.4! A simple No, Sorry would hae sufficed! Maybe if I was a PHP genius like you people it would be easier! |
Templates will not stop you from being able to upgrade. Sorry not really a valid excuse.
The only problems being encountered are if you have an older version of MySQL, the code needs to be changed a little. If your PHP version is older than 3.0.9 the new script won't work either. Or if you have a heavily hacked board you may have to back out some of the hacks. |
Thats what I am saying! I have added several of the HACKs to the board. I thought that was EDITED Templates! SheesH!
Its not my fault that the only way to get a great vB is to hack it up and down like a TREE! |
All times are GMT. The time now is 03:21 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|