vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Want a graphic to show instead of point value.. HELP!! (https://vborg.vbsupport.ru/showthread.php?t=57049)

Big J 09-13-2003 04:05 PM

Want a graphic to show instead of point value.. HELP!!
 
I'm using the Lesane store hack, and I'm trying to figure out how to make different graphics appear in place of the point value that appears under the users avatars based on their number of points. Anyone know how to do this?

Example - If the user has 100 points, 1 star will appear. 200 points then 2 stars will appear, and so on.

Thanks!!!

Dean C 09-13-2003 05:46 PM

You'll need to edit the part of functions.php.

A start:

PHP Code:

if($bbuserinfo['storep'] < 100)
{
        
$userstars '<img src="{imagesfolder}/1stars.gif" border="0" alt="" />';


It would probably be easiest to do it with a switch statement but hey :)

Big J 09-13-2003 07:26 PM

Thanks! I'll start working on it.

Big J 09-13-2003 07:44 PM

Ok, I have no idea where to go from here.

Big J 09-21-2003 05:08 PM

Bump again!

Also, does anyone have an add-on for the store where you can add a comment as to why you Approved/disapproved the persons post that you rated?

Lesane 09-27-2003 07:37 AM

Quote:

Originally Posted by Mist
You'll need to edit the part of functions.php.

A start:

PHP Code:

if($bbuserinfo['storep'] < 100)
{
        
$userstars '<img src="{imagesfolder}/1stars.gif" border="0" alt="" />';


It would probably be easiest to do it with a switch statement but hey :)

Mist, $bbuserinfo['storep'] will display the points of the user wich is viewing the post (you) and not the points of the author of the post. ;)

Big J, open admin/functions.php and find:

PHP Code:

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

Add after it:

PHP Code:

if ($post[storep]<100) {
    
$post[storestar] = "<img src=\"images/stars/1.gif\" border=\"0\">";
    } elseif (
$post[storep]<200) {
    
$post[storestar] = "<img src=\"images/stars/2.gif\" border=\"0\"><img src=\"images/stars/2.gif\" border=\"0\">";
    } elseif (
$post[storep]<300) {
    
$post[storestar] = "<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[storep]<400) {
    
$post[storestar] = "<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[storep]<500) {
    
$post[storestar] = "<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[storep]<600) {
    
$post[storestar] = "<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[storep]<700) {
    
$post[storestar] = "<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\">";
    } 

Play with it. Put $post[storestar] in your postbit template to display the stars.

Dean C 09-27-2003 09:50 AM

Oops - that's what you get for not paying attention ;)

Don't forget to single quote your key strings though Lesane :p

assassingod 09-27-2003 10:11 AM

The stars are messed up, lesane, you only need to use 2/3/4/5 star once - otherwise the use will end up with 16 stars.
and since by default there isnt 6/7 stars and they arent in a folder called strats,
try this:

PHP Code:

if ($post['storep']<100) { 
    
$post['storestar'] = "<img src=\"{imagesfolder}/1stars.gif\" border=\"0\">"
    } elseif (
$post['storep']<200) { 
    
$post['storestar'] = "<img src=\"{imagesfolder}/2stars.gif\" border=\"0\">"
    } elseif (
$post['storep']<300) { 
    
$post['storestar'] = "<img src=\"{imagesfolder}/3stars.gif\" border=\"0\">"
    } elseif (
$post['storep']<400) { 
    
$post['storestar'] = "<img src=\"{imagesfolder}/4stars.gif\" border=\"0\">"
    } elseif (
$post['storep']<500) { 
    
$post['storestar'] = "<img src=\"{imagesfolder}/5stars.gif\" border=\"0\">"
    } elseif (
$post['storep']<600) { 
    
$post['storestar'] = "<img src=\"{imagesfolder}//5stars.gif\" border=\"0\"><img src=\"{imagesfolder}/1stars.gif\" border=\"0\">"
    } elseif (
$post['storep']<700) { 
    
$post['storestar'] = "<img src=\"{imagesfolder}/5stars.gif\" border=\"0\"><img src=\"{imagesfolder}/2stars.gif\" border=\"0\">"
    } 


Lesane 09-27-2003 12:04 PM

Well, i have it so that all my 7 stars are 1 star. 7 different colors, so when i want the red star displayed 2 times i do the above. It's just an other way, but that's why i say "play with it".

Big J 09-27-2003 04:17 PM

I Love You Man!!!! Thank You!!!!!!!!!!!!!!!!


All times are GMT. The time now is 12:27 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.01178 seconds
  • Memory Usage 1,759KB
  • 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
  • (5)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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