vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Star rating by post count? (https://vborg.vbsupport.ru/showthread.php?t=52309)

Tigerdude 04-29-2003 04:28 AM

Star rating by post count?
 
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:

PHP Code:

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

After it add:
PHP Code:

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

Quote:

Today at 12:06 PM Erwin said this in Post #5
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


All times are GMT. The time now is 12:30 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
  • Page Generation 0.01069 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete