vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Multiple user ranks divided with a character in postbit (https://vborg.vbsupport.ru/showthread.php?t=249928)

LostForWords 09-04-2010 09:10 PM

Multiple user ranks divided with a character in postbit
 
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

Code:

$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).

Code:

$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:

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


All times are GMT. The time now is 01:02 AM.

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.01084 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete