Log in

View Full Version : Multiple user ranks divided with a character in postbit


LostForWords
09-04-2010, 09:10 PM
I was wondering if there was a way to divide user ranks with a character (specifically a forwards slash).

Let's say my user ranks are words - IE: ADMIN, CONTRIBUTOR etc.
Is it possible that in the postbit I can make it so that rather than having

ADMIN
CONTRIBUTOR

or

ADMIN CONTRIBUTOR

I can have:

ADMIN/CONTRIBUTOR

If anybody could help me achieve this I'd be very grateful!

kh99
09-04-2010, 10:30 PM
I haven't tried it, but you could try creating a plugin using the 'postbit_display_complete' hook and

$post['rank'] = str_replace('<BR>', '/', $post['rank']);

as the code.

LostForWords
09-05-2010, 10:33 AM
Ah I gave that a go and it didn't seem to work. Thanks for the suggestion though :)

kh99
09-05-2010, 11:16 AM
OK, sorry. I just tried this and it works (well, at least it appears to given my 15 seconds of testing).

$post['rank'] = str_replace('<br />', '/', $post['rank']);

(Also, remember to set the plugin to Active - I always manage to forget that the first time :mad:)

LostForWords
09-06-2010, 09:13 PM
Worked beautifully! Thankyou so much.

Would it be cheeky to ask if you could find a way to make the plugin work in the memberinfo as well? :P

kh99
09-06-2010, 09:50 PM
Well what you can do is create a second plugin using the "member_complete" hook and use this code:

$prepared['rank'] = str_replace('<br />', '/', $prepared['rank']);


There may be a way to do it without separate plugins, but I couldn't see one because the code that puts together the ranks has the '<br />' hard-coded.

LostForWords
09-07-2010, 09:15 PM
I'm fine with the separate plugins!

Thanks so much for this! :D