PDA

View Full Version : Want a graphic to show instead of point value.. HELP!!


Big J
09-13-2003, 04:05 PM
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:


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
You'll need to edit the part of functions.php.

A start:


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:


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


Add after it:


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:


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!!!!!!!!!!!!!!!!