PDA

View Full Version : Star rating by post count?


Tigerdude
04-29-2003, 04:28 AM
I know there has to be several hacks for this but I can't find em.

I just want a simple hack that will use a 1-5 star graphic under the member's name to indicate their general post total. ie 1-25 posts= 1 star. 25-100 posts= 2 stars, etc.

I'm using version 2.3 and I would really prefer one that is simple and stable as opposed to a hack that is loaded with options and buggy.

Can anyone help?

Thanks.

flup
04-29-2003, 08:09 AM
These have been released many times.

Just use an if-else-then statement

flup
04-29-2003, 08:12 AM
This is made by lesane in another post [USE SEARCH FUNCTION :D]

_________________________________________________
In functions.php find:


eval("\$post[buddy] = \"".gettemplate("postbit_buddy")."\";");


After it add:
if ($post[posts]<30) {
$post[stars] = "<img src=\"images/stars/1.gif\" border=\"0\">";
} elseif ($post[posts]<100) {
$post[stars] = "<img src=\"images/stars/2.gif\" border=\"0\"><img src=\"images/stars/2.gif\" border=\"0\">";
} elseif ($post[posts]<250) {
$post[stars] = "<img src=\"images/stars/3.gif\" border=\"0\"><img src=\"images/stars/3.gif\" border=\"0\"><img src=\"images/stars/3.gif\" border=\"0\">";
} elseif ($post[posts]<500) {
$post[stars] = "<img src=\"images/stars/4.gif\" border=\"0\"><img src=\"images/stars/4.gif\" border=\"0\"><img src=\"images/stars/4.gif\" border=\"0\"><img src=\"images/stars/4.gif\" border=\"0\">";
} elseif ($post[posts]<1000) {
$post[stars] = "<img src=\"images/stars/5.gif\" border=\"0\"><img src=\"images/stars/5.gif\" border=\"0\"><img src=\"images/stars/5.gif\" border=\"0\"><img src=\"images/stars/5.gif\" border=\"0\"><img src=\"images/stars/5.gif\" border=\"0\">";
} elseif ($post[posts]<2000) {
$post[stars] = "<img src=\"images/stars/6.gif\" border=\"0\"><img src=\"images/stars/6.gif\" border=\"0\"><img src=\"images/stars/6.gif\" border=\"0\"><img src=\"images/stars/6.gif\" border=\"0\"><img src=\"images/stars/6.gif\" border=\"0\"><img src=\"images/stars/6.gif\" border=\"0\">";
} elseif ($post[posts]>2000) {
$post[stars] = "<img src=\"images/stars/7.gif\" border=\"0\"><img src=\"images/stars/7.gif\" border=\"0\"><img src=\"images/stars/7.gif\" border=\"0\"><img src=\"images/stars/7.gif\" border=\"0\"><img src=\"images/stars/7.gif\" border=\"0\"><img src=\"images/stars/7.gif\" border=\"0\"><img src=\"images/stars/7.gif\" border=\"0\">";
}


You need to edit the path to the stars images though. And you could also edit the post amounts wich the user must have to display the stars.

Then you can put $post[stars] in your postbit to show the stars.

Goodluck

Boofo
04-29-2003, 09:55 AM
Flup, can you give me the link to that by Lesane?

Erwin
04-29-2003, 10:06 AM
No need to hack - just put this in the Member's Title section of Admin CP:

Normal Member<br><img src="http://yoursite.com/images/star1.gif">

HTML works. :)

Boofo
04-29-2003, 10:31 AM
That'll work. Thank you, sir. ;)

EvilLS1
04-29-2003, 02:17 PM
Today at 12:06 PM Erwin said this in Post #5 (https://vborg.vbsupport.ru/showthread.php?postid=388826#post388826)
No need to hack - just put this in the Member's Title section of Admin CP:

Normal Member<br><img src="http://yoursite.com/images/star1.gif">

HTML works. :)


Actually that won't work if your users have custom titles (about 70% of my users do).

The way that flup posted (using if & else statements) will work even with custom titles. I posted a mini-hack to do this which includes a set of rank images a few months ago. Look in my profile for "simple rank images hack".

If you don't like those rank images you can find alot more here: http://www.forumimages.com/

Dewayne

flup
04-29-2003, 07:48 PM
Hahah this is kinda lol.
When someone posted this question to, i answerd with Erwins answer, and lesane with mine, and also EvilS1 answered that it would work with custom titles.

And Boofo:
Search this forum @ Starhack