Helpful Information
 
 
Category: vBulletin.org Forum
Want some stars?

Here is the code I use for stars on v2. It gives one color stars to admins/super mods and another color for everyone else. If you want to give different stars to regular moderators than you will have to insert the ismoderator() function which is going to increase the queries on showthread. Just rename it to stars.php, put it in your forums/admin directory. Open up functions.php and put

include('stars.php');

after

// sorts through all the stuff to return the postbit template

This is a very simple hack but it is all I need for my forum. The next version of vB (the next full version, not beta) will have a more comprehensive stars function. Oh yeah and put $stars in the postbit template where you want the stars.

next version...

that brings back memories...

but seriously, is that vb2.0 final or vb2.x sort of thing? ie a couple of weeks away or a few months away?

i think stars should be included automatically in the 2.0 package, so you do not have to hack them...

it is a somewhat irritating feature not to have.

(if they already are plz dont flame me because I have not upgraded yet to find out for myself)

v2.x sort of thing...

????

Parse error: parse error in stars.php on line 3

maybe changing <? php to <?php might help?

yes that was the prob ;-) thx mate

Freddie, talk to John about getting this into 2.0 Final release. I know that there is a lot to do, but as you demonstrated, It is a very simple addition that could be revised and beefed up in the future.

But this also brings up the karma hack... Which will VB use? Stars or karma?

karma?

Or both? ranks are only based on posts while Karma is based on other's ratings of yourself.

stars should be standard, karma a hack. why stars are pretty simple and configurable everyone uses them the same way, karma is pretty complicated and is going to have to be different on pretty much most sites. Stars are what we want to start with (or little baby aliens in my case.. they are responsible for the longest (and scariest) thread on my forum!)

How about a stars hack that gives a star for every certain # posts, rather than specifying each nuber. I would like to give a star for every 50 posts.

well then just specify it at 50,100,150,200,250,300,350 etc !!!

Yes, but I dont want to have 50 lines of code specifying each step, seems like it should be easy to have it do it on its own with and just specifying one integer.

Instead of
50, star
100, star star
150, star star star
200, star star star star

do
(totalposts/50)xstar

Seems pretty simple from what I see here, wish I could write it myself.

And if someone had 1000 posts are they going to have 20 stars?

no but in my old board there where 8 stars +


first in silver and then in gold when you have 8 gold stars then it stays there thats enough i think on big boards it is good but when you have an little you can make it smaller

This one gives a star for every 50 posts up to a maximum of 8, edit the variables at the top to change that behavior.

Yes freddie, they would, but your reminded me that they would need to break every 10 or so.

I admit this probably wouldn't work for every one, I have a small board, where I would like to give stars often for the fun of it, plus with breaks there is a lot of room for those little things so 100 stars wouldn't bother the board.

As a joke I give about 100 stars to people temporarily, http://www.thzclan.com/forums/showthread.php3?threadid=214

No need to debate, just thought it would be easier to specify one number than every step you want a star. :)


*edit Ooops, posted while I posted, thanks Freddie

This one gives a star for every 50 posts and keeps on giving them but inserts <br> after every 10 stars. Again edit the top variables to change the 50/10 settings.

Thanks again, I really apprieciate that you guys can write this stuff. I can only pick out the basics.:)

Stars hack should be standard in vB 2.0 my users LOVE it on our UBB. But It shouldnt go, every 50. More like,

50 100 250 500 750 1000
Or somthing like that?

Originally posted by freddie
If you want to give different stars to regular moderators than you will have to insert the ismoderator() function which is going to increase the queries on showthread.

How exactly does that ismoderator() function work? Or to make it easier, how do i add it to the script?

Edit: I figured out i can just add an elseif and set the mods stars that way.

Im getting a weird problem with this hack. I just get like 50 lines of the stars.php repeating at the top of my pages?

Originally posted by gekko
How exactly does that ismoderator() function work? Or to make it easier, how do i add it to the script?

Same question, except I still haven't figured out a solution. And also, the admin/supermod stars aren't working.

Here's what I changed my code to (in order to have different color stars based on posts.)

If you need to make mods have seperate stars just do this:


if ($post[usergroupid]==5 || $post[usergroupid]==6)
// Admin and Supermod Stars
$starsgif = '<img src="images/stars/Admin1.gif" border=0 width="99" height="20">';
else
Change that to this:
if ($post[usergroupid]==5 || $post[usergroupid]==6)
// Admin and Supermod Stars
$starsgif = '<img src="images/stars/Admin1.gif" border=0 width="99" height="20">';
elseif ($post[usergroupid]==15)
$starsgif = '<img src="yourmodstarshere" border=0>';
else

You can also set different stars for a certain member by using $post[userid]. You can also have entirely different stars setup for mods by making $starsgif something like $starsmod, then at the bottom do something like
if ($post[usergroupid]==15)
$stars .= $starsmod
elseif ($post[posts] > 149)
$stars .= $stars8;
.....


Just use the elseif and it should work. Just make sure you have them setup so that the ones that are more specific come first. For example if you want different stars for yourself make sure it comes before the ones for the admins. If you already specify the ones for the admin it will give you those stars and ignore the ones for your userid.

I hope this helps. I have 2% PHP knowledge, but that's how i got it to work.

Moderator-specified stars still aren't being shown. The stars of Moderators are still based on their post count, as if they were regular members.

Make sure that your usergroupid for mods is correct. Mine is 15, so i put 15, but my friends' is 36. Try that.

The userid isn't 36. How can I find out which number mine is?

Another problem is, on some posts, the post-based stars are added to my admin stars. How can I prevent that?

In your CP, go to where you edit the user groups. When you highlight one the link should have something that includes &usergroupid=xxxx. Use that.

And for the rest, i'm not sure what your file looks like or what exactly you're trying to do, so i can't help ya there.

Okay, I found my moderator's ID is 7. But it's still adding post-based stars at the end of the mod or admin stars.

Here's my file:

Ok, i found your problem. I fixed it for you, and it should work now. You just specified $stars as the admin stars, mod stars, and as the stars based on posts.

Try it, then let me know if it worked.

AHHH! I have tried everything, I still get like 50 lines of text repleating whats in stars.php at the top of my threads? Whats wrong?!?

I'm not sure, are you missing <? or ?> ?

Thanks a lot. It works now.

Well I fixed my last problem. Now Im getting Parse error: parse error in /***/stars.php on line 3 and this is my stars.php

<?php

$maxstars) $numstars = $maxstars; for ($x=0; $numstars>0 && $x<$numstars ;$x++) { $stars .= $starsgif; } if (!$stars) $stars = '
'; else $stars .= '

'; ?>


Help?
Thanks!
snyx

i was wondering how to put just ordinary stars as admin and mod

we having some problem to get it to work

could somone help please

I've just upgraded to beta3, and I've lost my stars.

Sniff sniff.

Can someone please help me find them?

Is anyone else having this problem, and can we integrate this into a future version of vB?

You lost your stars? I think you just forgot that you need to include stars.php in showthread.php.

Good call gekko.

Thanks!

:) what form will the ismoderator() function look like, as for the admin it leads to a gif would i add an elseif line for this function ?? if so could you show me the line of code to add ??
Hmmm does the moderator have an Usergroupid number.??

if ($post[usergroupid]==5 || $post[usergroupid]==6)
// Admin and Supermod Stars
$starsgif = '<img src="images/star2.gif" border=0 width="11" height="10">';


Thanx
Fuzzy

Originally posted by freddie
And if someone had 1000 posts are they going to have 20 stars?
Thx!!!

forgive my ignorance, but what the heck are stars? :D

Originally posted by bira
what the heck :D


huh????:eek:

Stars are little tiny stars that can appear under your name, this hack makes it so that the more posts you make, the more stars you get.

I have replaced stars with a bar graph as you can see here. http://www.thzclan.com/forums/showthread.php3?styleid=2&threadid=1

As people post more, their bar gets longer. Look under the user title.

Hope that helps.

Originally posted by Blackjack
Stars are little tiny stars that can appear under your name, this hack makes it so that the more posts you make, the more stars you get.

I have replaced stars with a bar graph as you can see here. http://www.thzclan.com/forums/showthread.php3?styleid=2&threadid=1

As people post more, their bar gets longer. Look under the user title.

Hope that helps.

Thx :D

I have update the first post for instructions on how to install this on 2.0.2 - no other versions supported.

installed but doesn't work to me...

Here's what I get when I run my board with this hack installed. Seems that the include doesn't work. The stars.php file is in my admin directory with proper permissions. Any ideas?


Warning: Failed opening './stars.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/msports/public_html/forum/admin/functions.php on line 56










privacy (GDPR)