PDA

View Full Version : Need a little help displaying rank image for admin only


Castel
08 Jun 2001, 08:00
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



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



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

Castel
08 Jun 2001, 12:38
Nevermind..finally figured it out :D

Prezident
08 Jun 2001, 14:32
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?

Castel
08 Jun 2001, 18:55
It sound like what you are looking to do is the Star Hack (http://161.58.84.213/forum/showthread.php?s=&threadid=12761), just replace the star images with whatever images you like.

My users prefer the Galaga ranking (http://161.58.84.213/forum/showthread.php?s=&threadid=11589) 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:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



in the Galaga hack (link above) to:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



This will give all admins, mods and supermods an extra shield.

Prezident
09 Jun 2001, 03:59
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.

kicks
09 Jun 2001, 05:55
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

Prezident
11 Jun 2001, 19:19
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.

Castel
11 Jun 2001, 21:45
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 :



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Right above that add :



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



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.

Prezident
12 Jun 2001, 00:33
OK, here is what I did so far, but I will add a couple questions afterwards.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



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.

Ludikraut
13 Jun 2001, 00:38
Originally posted by Castel
...My users prefer the Galaga ranking (http://161.58.84.213/forum/showthread.php?s=&threadid=11589) system because the image ranking changes every 10 posts they make. They just love that stuff...

Heh, us tekkenites are so vain :rolleyes:

l8r)

Ludikraut (aka SauerChoke)

Castel
13 Jun 2001, 23:28
Well you could start out the code like this



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




This would exclude the admin (you) from getting an image and also newly created usergroup that would have a group ID of 8. If you want to give a few people a special status you could move these people in the new user group and edit their profile title from the admin panel. From there you can include html in the title. For example you could put -- General<br><img src=images/ranks/general.gif> -- as the tile for that person. If you have more than one admin (and you want other admins to have the default image) you could change the code above from post[usergroupid] to post[userid] and add your specific ID number

I'm sure there is a better automated way of doing this but that is far beyond my limited PHP knowledge at this point.

Prezident
14 Jun 2001, 03:25
Well you just made my life amazingly simple, maybe without even knowing it.

I can just use the html code in the user title like you just showed me.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I added this code with the corresponding gif image to each of my user titles, and it works great. Just needed to update the user tables afterwards. Very easy.

Really no need to make any changes to showthread.php if I can just include html code in the user title text.

Thank you SOOOOO very much. That is exactly what I wanted to do.

I did not realize I could use html code in that area.

Castel
14 Jun 2001, 08:09
Well DOH, I should have thought about that in the first place. I even have one of my user titles like this (before they receive the first Galaga badge at 10 posts.

Oh well, at least I got a little beginner PHP practice out of it.

Prezident
14 Jun 2001, 13:05
It's cool man. I have to say I did gain a little better understanding of PHP in the process even though I didn't apply any of the code.

I was actually starting to understand how variables are assigned, and maybe even started to get a clue how some of the else/if statements work.

Thanks for your help man, I really do appreciate it.

I imagine that this kind of thing can be used more commonly that I had previously though.

justsomedude
24 Oct 2001, 22:58
hmmmm I too am trying to give my mods and admins immunity to the rankings, but i can't seem to get it to work. here's what i did:


In admin/functions.php found:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



and directly above that added:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I then added:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



directly above



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I tried modifying a couple of diferent ways, but still no go. anyone have any suggestions?

justsomedude
26 Oct 2001, 01:57
anyone??

Castel
27 Oct 2001, 09:01
You just placed your code in the wrong place. You need to reset rank to nothing after it's been created, so add the code at the end.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Or you could probably limit the rank to just the "Registered" group like this (replace XX with number fo your Registered group):



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------