PDA

View Full Version : Finished the Multiple Ranks Hack


LoB
02 Sep 2001, 20:01
check it out on my board @
STGN (http://stgn.ugforums.com/vb)
go into the UserCP -> edit profile, and select a rankset from the dropdown menu..
im just finishing off the control panel section to allow you to add rank schemes through there instead of using phpmyadmin like im doing at the moment, should all be done by tomorrow at which time ill attatch the hack.

i made this for ikonboard months ago and we were the only one to have it, i thought "ill not share this i want us to be origional" but after receiving so much help from here i want to give something back for it

basically it allows your users to pick a scheme for the rank pips, i.e. they pick trees and it gives them tree pips, they pick snowmen it gives them snowmen pips :D

Shakron
06 Oct 2001, 22:13
Yeah! Cool you made it :D ... please, can I get it?

LoB
06 Oct 2001, 22:26
oh cool someones actually interested :D yeah its all finished now including the control panel, ill package it up and post it tomorrow morning when i wake up.

Shakron
06 Oct 2001, 22:28
thanks thanks thanks .... I've been interested the whole time ... I was just to shy to ask :D

Mike Gaidin
06 Oct 2001, 23:24
This is cool!

Mega
07 Oct 2001, 13:11
Hmm look's good..

now all I have to do is finish my education so I can get a good job to pay for vbulletin :D

Bitmap
08 Oct 2001, 19:11
cool ... is this hack already available???? this is exactly what i was looking for :)

Ruth
08 Oct 2001, 19:38
cool :)

anything for doctors/physicians?

Rcooper
08 Oct 2001, 23:14
Man is thisn what i am thinking. Like picking what stars go to what group you select? I run a hunting , fishing and acamping board I would like to have the stars go with the person say they are hunting -> deer fishing ->fish etc etc.

Is that what this hack does?

R.cooper

Shakron
08 Oct 2001, 23:51
so all are very excited .. but where's THE guy? ... still sleeping ...;) ?

Shakron
12 Oct 2001, 09:59
Well, it seems you won't give it to us even if you promised to do so :(

... but it would be just fair if you could as at least tell us why ... because if you don't do that we all will come here every day to see if you posted it ... and will get disappointed every day :(

Goldfinger
12 Oct 2001, 10:03
i'd like to get my hands on this hack :).

LoB
12 Oct 2001, 10:55
oh sorry guys i totally forgot, heres the multi rank control panel (im sure someone could improve on this, it was just... thrown together as quickly as possible) ill post the hack in a few hours, just need to extract the changes from the code. while you wait, youll be able to see how the hack works from the admin script though.
NOTE: you will also need to add the hack for the selection box in the users profile to get this to work, otherwise users will get a box where theyll have to type the rank name in manually (guess) which isn't great, ill bundle that hack in the same zip

Shakron
12 Oct 2001, 12:21
Thanks :D ... I really thought you wouldn't give it to us anymore :)

... as soon as we have it on our board we will show you our brand new SWG-board :)

Ruth
12 Oct 2001, 22:18
Thanks Lob :)

Bitmap
13 Oct 2001, 08:12
yea ... thanks lob ... it looks pretty cool in the admincenter but i'm still waiting for the rest of the hack ;)
hope your not forgetting to attach it like last time :D

Shakron
14 Oct 2001, 16:34
I don't want to get on your nerves but .. could we please get the other part of the hack?

I mean .. I don't understand you ... you offered that hack and now you are not posting it and you are ignoring me when I try to contact you :( .. what have I done wrong?

... and if you are mad about me (don't know why) ... then please give it at least to the other people or tell us, that you won't give it to us.

Ichabod_Crane
14 Oct 2001, 18:42
LoB, could you please post the second part of the code, im dying to get that stuff :)

thanks,
Ichabod Crane

Shakron
18 Oct 2001, 13:27
Originally posted by rcooper
Man is thisn what i am thinking. Like picking what stars go to what group you select? I run a hunting , fishing and acamping board I would like to have the stars go with the person say they are hunting -> deer fishing ->fish etc etc.

Is that what this hack does?

R.cooper

Hmm .. I am not sure if I understood it right, but it's like this:

UserA opens his user-center and there he is able to choose what ranking-path he wants. So if we take as an example a Star Wars board this would mean, that he is able to choose between the following paths:
- Jedi
- Dark-Jedi
- Rebell
- Imperial
- Crime

Now, let's say he chooses the Imperial-path. This means he will get ranks like Leutnant, General, Grand-Admiral ...

Someone else chose Jedi and so his rank-path will be like Jedi-Padwan- Jedi - Jedi-Master ...

.. ok? Well .. that's it and believe me: It's pretty cool :D

.. so I am still hoping that we get the second part ...

LoB
18 Oct 2001, 17:52
here it is sorry for the long wait, i do things then wait so long to document them i forget how they work lol.

BEFORE INSTALLING:
you will need the hack which allows for the use of combo (dropdown) boxes in the user profile fields
when it's done, you'll need a custom user profile field called "Rankset" using the dropdown combobox (otherwise people will have to type in rankset names by hand instead of selecting from a list)

run the install script (attatched to this post)
and modify the code (below)
then use the ranks admincenter to add ranks.


look for this code in admin/functions.php

on a sidenote, you'll see [field8] below, in userfields find out which is your last unused custom user field and use that (change the number in this script) or simply add a new column in phpmyadmin, the custom user field (8) stores the rank info for that user


if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
if ($post[customtitle]==2) {
$post[usertitle] = htmlspecialchars($post[usertitle]);
}



right after it put this:


//START MULTI RACE HACK

$res = mysql_query("SELECT * FROM userfield WHERE userid='$post[userid]'");
$userinfo = mysql_fetch_array($res);
mysql_free_result($res);

//go through all of the ranks, seeing which postcount fits which pip

$res = mysql_query("SELECT * FROM rankcategories WHERE cat_name='$userinfo[field8]'");
$rankinfo = mysql_fetch_array($res);
mysql_free_result($res);

if(!isset($rankinfo[cat_id]) || strlen($rankinfo[cat_id])<1)
{
$rankinfo[cat_id]=1;
}

$rankposts = mysql_query ("SELECT * FROM ranks WHERE rank_catid='$rankinfo[cat_id]'");

while($row = mysql_fetch_array($rankposts))
{

if($post[posts]>=$row[rank_posts])
{

$temppostcount = $row[rank_posts];

}


}

$res = mysql_query("SELECT * FROM ranks WHERE rank_catid='$rankinfo[cat_id]' AND rank_posts='$temppostcount'");
$rank = mysql_fetch_array($res);
mysql_free_result($res);

$rankpip = "<img src=$rank[rank_graphic]>";

$post[usertitle]="$post[usertitle]<br>$rankpip";

//END MULTI RANK HACK

LoB
18 Oct 2001, 18:03
heres the attatched multirace rank hack installed..
get rid of the default set if you like, they were just for my board.

LoB
18 Oct 2001, 21:21
don't all thank me at once :D

Bitmap
18 Oct 2001, 21:34
well ... thank you :)
it's great you postet it ... hope i can get it to work.

Martyjp
18 Oct 2001, 22:13
You are a star thank you :D

Dunny
19 Oct 2001, 13:47
anyone got a demo of it in action?

Shakron
19 Oct 2001, 13:49
Well, I acctually said "thank you" yesterday per ICQ but here .. just for you ... Thank You! :D

... now we just need to get it working .. and that's the problem ... *sigh* ... :(

LoB
19 Oct 2001, 17:41
Originally posted by Dunny
anyone got a demo of it in action?

check my first post or go here: http://stgn.ugforums.com/vb/

Martyjp
20 Oct 2001, 14:41
Hope you dont mind, I have made a slight change to the code ;)

in the changes to functions.php

change

$rankpip = "<img src=$rank[rank_graphic]>";

$post[usertitle]="$post[usertitle]<br>$rankpip";

//END MULTI RANK HACK

to

$rankpip = "<img src=$rank[rank_graphic]>";
$rankid = "$rank[rank_name]";

$post[usertitle]="$post[usertitle]$rankid<br>$rankpip";

//END MULTI RANK HACK

Now go into the vb control panel and remove all user titles, and then you need to edit any user groups that have their own titles, such as moderators and administrators, what you will need to do here is stick a <BR> on the end. like so

http://www.forums4games.com/example.jpg

The original hack will only display the pips and will keep the user titles that vb uses as standard, the above makes a slight change so that it displays the rank name

It may be a sloppy way of doing it, I am not sure but it does the job, what I would rather have it do is display administrator titles instead of the rank, but I havent worked that bit out yet ;)

Thanks again LoB :D

LoB
20 Oct 2001, 15:05
np, i was eventually going to get around to that, but well... im lazy :D

edit - you might wanna put a <br> after $post[usertitle] because administrator/senior member whatever, ends up on the same line

Martyjp
20 Oct 2001, 23:17
Reason why I did it the way I did :)

I have removed all user titles from my board, so for the majority of members $post[usertitle] will be blank, if you put a <BR> after it then there will be a blank line under the username, to get round this I have added <BR> after the titles in edit user groups. This would also have to be done on any custom user titles.

Since I dont allow people to change their titles on my board the way I did it worked best, but with boards that do you are correct in saying <BR> needs top be added :)

$rankpip = "<img src=$rank[rank_graphic]>";
$rankid = "$rank[rank_name]";

$post[usertitle]="$post[usertitle]<BR>$rankid<br>$rankpip";

//END MULTI RANK HACK

LoB
21 Oct 2001, 14:15
is anyone else having any problems with this hack? i know of one person, now i know why i stopped releasing hacks in the first place - the assumption that because the hack is yours youve got to spend YOUR time installing it for OTHER people, im sorry Shakron but before deciding to hack your board, you should perhaps learn some PHP or at least know how the VB works before trying to do it yourself, i dont have all day every day to take you through it step by step (and i tried to take you through it time and time again but it seemed like i was getting nowhere :rolleyes: ).

When you were having problems installing it i even offered to do it for you but all i got in return was mistrust.
You thinking that i wanted to do something bad to your board, or delete it or something if you gave me your FTP details - WHY would i do something like that, then you finally give me the details and expect to get it done overnight, im sorry but im not a goddamned machine, i've got other things to do, i have been busy over this past weekend like i usually am, i have very little free time, at the very bottom of my "what i want to do list" was to get that hack installed on your board, get over it.

next time i will sereously be considering whether or not to release ANY of my new hacks here if this is the demanding crap that i get.
other people have managed and dont send me whiny emails about waiting for their board to be launched but it's my fault that it cant be because YOU havent gotten MY hack working yet, launch without it already, i am withdrawing my help.

Shakron
21 Oct 2001, 14:23
what? you offered that hack in the first place and when I asked for it you promised to give it to us ... we got it 16(!) day later.

than we tried to install it and we had problems and couldnt find the reason and you offered to help us. the only reason why i was not sure if i could give you our ftp-dates was because we are acctally not allowed to give them away.

we would have never had a problem if you tell us that you don't have the time yet and that you'll install it in a few days or that you can't install it because you don't have the time. that would have been sad for us but we would understand it. but you kept us waiting and waiting and waiting without saying a word.

When you were having problems installing it i even offered to do it for you but all i got in return was mistrust.
You thinking that i wanted to do something bad to your board, or delete it or something if you gave me your FTP details - WHY would i do something like that, then you finally give me the details and expect to get it done overnight, im sorry but im not a goddamned machine, i've got other things to do, i have been busy over this past weekend like i usually am, i have very little free time, at the very bottom of my "what i want to do list" was to get that hack installed on your board, get over it.


you got no mistrust .. we just really didnt know what do to. it was very nice that you offered to help us ... but at the same time we feared that you maybe could get something wrong with our ftp-files (because our ftp-account is a littlbit *cough* messy). i was never thinking that you would delete anything because you don't like us or stuff like that (why should i think that?) ...

you offered to help us so at that date ... so i expected that you would do it there ... or at least tell us that you are not able to help us. don't you get it? our problem is not that you don't help us at all .. our problem is that you never said a word and just kept us waitinig without any information!

that's why i am angry now! not because you don't help us ... that's ok for me .. i was not asking you to install it for us ... you offered that to us and we gladly accepted (and after some thinking we decided that we trust you and gave you access to ftp even if we are not allowed to and even if we can get into serious troubles with our host because of that).

so pleeeease, dont say we are the bad girls here. and i think its pretty unfair that you post something like this here ... the other people don't knwo what happened and so it's just absolutely unfair. instead you could have just told us days ago that you are not willing to help us and we would have accepted that.

LoB
21 Oct 2001, 14:30
i did offer my help, and i did try to do it for you, but it seemed that when i was explaining what needed to be done, you had absolutely no idea what i was talking about and couldent do it,
i posted full instructions on here that everyone else managed to follow to the letter, but you kept on icqing me, emailing me and every other conceivable communications method, bugging me trying to get it done, that is why i started ignoring you, your total lack of patience, and lack of ability to get it done for yourself.

jeez, i even sent you some of my pre-hacked VB files but you still couldent get it working, im sorry if i lost patience with you and started ignoring you, but thats what happens when you get bugged days on end to do something i didnt particularly want to be doing in the first place, you only gave me FTP access a few days ago, as i stated i have been very busy this weekend, and this constant nagging over something that really isn't very important in the scheme of things wasn't helping me get any work done.

why do you even need the hack so desperately? why can't you launch without it? what's so special about it? it's just another hack...

Shakron
21 Oct 2001, 14:38
forget it. you don't understand my point. and i can live with that .. but i still think its pretty unfair to post that here ... and do you want to know why i tried to contact you through several ways ov er and over again? because you said absolutely NOTHING. that's why!

just a single small icq-message or email with "i don't have time so dont expect it to be done till XXX" or "i don't want to install it because i just don't have time". i would definitely have accepted that! and yes; i have no idea how to hack a board ... but my board-admin does and she installed it. there was just that damned dropdown-problem.

why that hack is so important for us? i don't think i have to explain that. we've very good reasons ... and that's it.

thanks for posting that hack and thanks for trying to help us ... but you should try to look at the situation from another point ... because right now you are the person that is whining here. sorry .. .i wont bother you anymore.

Neo
31 Oct 2001, 01:48
is there anyway to make it so that only the admin and mods can change this?

SirSteve
03 Nov 2001, 07:40
Everything installed correctly except when I get here, it hangs:

creating default set...

Where is this admin rank center located?

Martyjp
03 Nov 2001, 12:13
Just installed on 2.2.0 and it works fine :)

SirSteve, multiraceadmin.php can be downloaded from the first page, upload it into your admin directory, you will also need to search it for "yourshere" and change the $dbhost, $dbname, $dbuser and $dbpass and you will need to do both twice

SirSteve
03 Nov 2001, 15:57
Thanks Martyjp. Unfortunately, I am still confused. I made the changes and the admin is working but once you add a set, how do you delete/modify them?

And I am not clear on how to get it working... everything installed ok (I belive). This rank admin really needs to go into the admin CP.

All I want is to be able to offer my visitors (Star Wars site) 2 rank paths. Jedi and Sith

Both have 6 ranks each. They have to select 1 path when they register.

Thanks in advance for any help you can give me.

Bitmap
03 Nov 2001, 17:41
hmm ... there is another hack like this, but i didn't write it and don't know if i am allowed to publish it.

this hack is integrated in the admin cp and the ranks can easily be modified.

the user can chose the path only when he registers, afterwards only the admin is able to change it.

well ... it's working great on my vbulletin 2.2.0 (a starwarsboard, too :D ), but as i said, i don't know if i am allowed to publish it.

SirSteve
03 Nov 2001, 17:57
Originally posted by Bitmap
hmm ... there is another hack like this, but i didn't write it and don't know if i am allowed to publish it.

this hack is integrated in the admin cp and the ranks can easily be modified.

the user can chose the path only when he registers, afterwards only the admin is able to change it.

well ... it's working great on my vbulletin 2.2.0 (a starwarsboard, too :D ), but as i said, i don't know if i am allowed to publish it.

Can you e-mail it to me? :)

Martyjp
03 Nov 2001, 23:16
hmm ... there is another hack like this, but i didn't write it and don't know if i am allowed to publish it.

There was one like that on this board up until about 15 minutes ago, it was strange, I downloaded it, installed it and then went to comment how great it was but the post was gone :confused:

Never mind, installed it and it worked so I am happy :D

Bitmap
03 Nov 2001, 23:22
well, i don't think it is the hack i am using because i didn't release it :)

Ralgar
05 Nov 2001, 15:42
http://www.vbulletin.org/forum/showthread.php?s=&threadid=32063

this ;) ?

the user can choose if he register and after (at the user cp) or the admins the rankingsystem he want

proxyMX
24 Jul 2002, 22:33
I like neo would be interested to know if this can be modified so that only Admins can change the set for a user

proxyMX
24 Jul 2002, 23:22
By the way, the code you posted had links in it that made it quite difficult,

proxyMX
24 Jul 2002, 23:47
This hack wrecked my board, poor interface and complex sitatuations made me have to re-install the whole thing :| Not impressed with the hack at all

Ralgar
25 Jul 2002, 07:18
1. no, the user choose wich set he use
2. if u wreck your board check the version (is written for 2.2.0!)
i cant say that it work at the later versions, can work, but mabe not

USS Phenix
04 Aug 2002, 23:29
Help, I cant find this combo hack which allows combos in user fields... Where can I get it?

Ryangel
05 Aug 2002, 06:36
Good and simple to use.
(works with 2.2.6)
Must admit you must have worked a little with mysql db and php but other that its very easy to use.

USS Phenix
05 Aug 2002, 09:59
Hello? Where can I get the combo box hack from? Please tell me because I have installed this hack and the users cannot select a rank for themselfs because I can not find the combo box hack.... PLEASE TELL ME WHERE TO GET IT!

Ryangel
05 Aug 2002, 10:03
hmm i tried to look for it just now but couldnt find it... I'll take a look again.

Ryangel
05 Aug 2002, 10:06
Found it
http://www.vbulletin.org/forum/showthread.php?s=&threadid=21833
here you go. Good luck! :)

TheRaven57
23 Mar 2003, 15:45
Neato

SirSteve
02 Apr 2003, 14:53
How do I uninstall this hack?