Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-08-2001, 07:00 AM
Castel Castel is offline
 
Join Date: Oct 2001
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I want an extra rank image added for admins as part of the galaga shiled ranking hack. I thought it would be simple enough for my limited PHP knowledge but I got stuck anyway.

Here is what I have in showthread.php

PHP Code:
if ($bbuserinfo['usergroupid']==6) {
$rank "<img src=\"images/ranks/admin.gif\" border=0>";
} else {
$rank "";

It displays the extra image for everybody. I have tinkered with it for a while now and I either get no image or an image for everybody. What am I doing wrong here?

Thanks
Reply With Quote
  #2  
Old 06-08-2001, 11:38 AM
Castel Castel is offline
 
Join Date: Oct 2001
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nevermind..finally figured it out
Reply With Quote
  #3  
Old 06-08-2001, 01:32 PM
Prezident's Avatar
Prezident Prezident is offline
 
Join Date: Nov 2001
Location: Denver, CO. USA
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would like to be able to display an images for each different rank I have on my board.

Maybe a variation of what you did would allow me do to this. Are you willing to share your knowledge about this?
Reply With Quote
  #4  
Old 06-08-2001, 05:55 PM
Castel Castel is offline
 
Join Date: Oct 2001
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It sound like what you are looking to do is the Star Hack, just replace the star images with whatever images you like.

My users prefer the Galaga ranking system because the image ranking changes every 10 posts they make. They just love that stuff.

This hack is also a little easier to install I think. It only requires one change in showthread.php and no database changes. What I did is add a mod shield before the actual ranking shields.

change:

PHP Code:
$RankNum $userpostcount 10
$rank ""
in the Galaga hack (link above) to:

PHP Code:
$RankNum $post[posts] / 10
if ((
$post[usergroupid] ==5) || ($post[usergroupid] ==6) || ($post[usergroupid] ==7)) {
$rank "<img src=\"images/ranks/mod.gif\" border=0>";
} else {
$rank "";

This will give all admins, mods and supermods an extra shield.
Reply With Quote
  #5  
Old 06-09-2001, 02:59 AM
Prezident's Avatar
Prezident Prezident is offline
 
Join Date: Nov 2001
Location: Denver, CO. USA
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The star hack only lets you add multiples of 1 image.

I want to have a unique image for each different ranking on my board.

I was able to do this on phpBB.

Not that I am trying to compare the two of them, obviously VB is better, but I would still like to be able to do something like this.
Reply With Quote
  #6  
Old 06-09-2001, 04:55 AM
kicks
Guest
 
Posts: n/a
Default

Prez: I'm pretty sure you can do that with the star hack

I could be wrong, but in the admin cp you have to type in the image name and the number of posts required to meet that image name
Reply With Quote
  #7  
Old 06-11-2001, 06:19 PM
Prezident's Avatar
Prezident Prezident is offline
 
Join Date: Nov 2001
Location: Denver, CO. USA
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried installing the Stars hack, and it caused some kind of problem in my database, so I had to revert back, and have decided not to use the hack. I am pretty sure I followed the instructions to the letter, and don't have the knowledge to trouble shoot it when something like that doesn't work.

I am certainly no expert when it comes to this stuff, but it sounds like Castel's version could be adapted to what I want to do, but I don't know how to do it.

Maybe an additional custom template that could be called from the right point in showthread.php to get the images to display that I would like to add.

Currently I have 11 different user titles that I would like to have an additional graphic file associated with.

The difference in what he has implemented, and the way the user titles are obtained on my board is that he has it change on every 10 posts, and mine gets progressively harder to obtain a higher rank, so I don't think the division process would work for me.
Reply With Quote
  #8  
Old 06-11-2001, 08:45 PM
Castel Castel is offline
 
Join Date: Oct 2001
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think this will do exactly what you are looking for. Save your original showthread.php because I am very new to PHP. But it seems to work fine on my test board.

In showthread.php find :

PHP Code:
$post[joindate]=vbdate($registereddateformat,$post[joindate]); 
Right above that add :

PHP Code:
$RankNum $post[posts];  
if (
$RankNum 1000) {
$rank "<img src=\"images/ranks/1000.gif\" border=0>";
}
elseif ((
$RankNum 500) && ($RankNum 999)) {
$rank "<img src=\"images/ranks/500.gif\" border=0>";
}
elseif ((
$RankNum 100) && ($RankNum 499)) {
$rank "<img src=\"images/ranks/100.gif\" border=0>";
}
elseif ((
$RankNum 50) && ($RankNum 99)) {
$rank "<img src=\"images/ranks/50.gif\" border=0>";
}
elseif ((
$RankNum 10) && ($RankNum 49)) {
$rank "<img src=\"images/ranks/10.gif\" border=0>";
}
elseif ((
$RankNum 5) && ($RankNum 9)) {
$rank "<img src=\"images/ranks/5.gif\" border=0>";
}
else {
$rank "<br>";

Upload the images in images/ranks/ of your forum directory and add $rank in the postbit template where you want the image to appear.

You mentioned you have 11 user titles so you will need to add more elseif routines and change the number of posts in this example to fit your forum title settings.
Reply With Quote
  #9  
Old 06-11-2001, 11:33 PM
Prezident's Avatar
Prezident Prezident is offline
 
Join Date: Nov 2001
Location: Denver, CO. USA
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, here is what I did so far, but I will add a couple questions afterwards.

PHP Code:
$RankNum $post[posts];  
if (
$RankNum 500) {
$rank "<img src=\"images/ranks/gen.gif\" border=0>";
}
elseif ((
$RankNum 400) && ($RankNum 499)) {
$rank "<img src=\"images/ranks/col.gif\" border=0>";
}
elseif ((
$RankNum 300) && ($RankNum 399)) {
$rank "<img src=\"images/ranks/ltcol.gif\" border=0>";
}
elseif ((
$RankNum 200) && ($RankNum 299)) {
$rank "<img src=\"images/ranks/major.gif\" border=0>";
}
elseif ((
$RankNum 150) && ($RankNum 199)) {
$rank "<img src=\"images/ranks/capt.gif\" border=0>";
}
elseif ((
$RankNum 100) && ($RankNum 149)) {
$rank "<img src=\"images/ranks/1stlt.gif\" border=0>";
}
elseif ((
$RankNum 75) && ($RankNum 99)) {
$rank "<img src=\"images/ranks/2ndlt.gif\" border=0>";
}
elseif ((
$RankNum 50) && ($RankNum 74)) {
$rank "<img src=\"images/ranks/sgt.gif\" border=0>";
}
elseif ((
$RankNum 25) && ($RankNum 49)) {
$rank "<img src=\"images/ranks/corporal.gif\" border=0>";
}
elseif ((
$RankNum 1) && ($RankNum 24)) {
$rank "<img src=\"images/ranks/private.gif\" border=0>";
}
else {
$rank "<br>";

I would like to be able to exclude myself from being assigned a graphic related to my rank based on the amount of posts I have.

Also, there might be the rare case that I would want to give someone a custom rank, and maybe have a custom graphic associated with that and over ride this mathematical part of it.

Is it possible to relate the graphics to the user title rather then how many posts they have?

Thank you so much for the help, you are awesome.
Reply With Quote
  #10  
Old 06-12-2001, 11:38 PM
Ludikraut
Guest
 
Posts: n/a
Default

Quote:
Originally posted by Castel
...My users prefer the Galaga ranking system because the image ranking changes every 10 posts they make. They just love that stuff...
Heh, us tekkenites are so vain

l8r)

Ludikraut (aka SauerChoke)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:55 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.04552 seconds
  • Memory Usage 2,284KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (8)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete