vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=229)
-   -   Show Thread Enhancements - User Title HTML markup in Postbit based on UserGroup (https://vborg.vbsupport.ru/showthread.php?t=195539)

Seven Skins 11-04-2008 10:00 PM

User Title HTML markup in Postbit based on UserGroup
 
User Title HTML markup in Postbit based on UserGroup

Here is a small hack for postbit as some people have requested.
This will markup user titles in postbit. (Not user name)


https://vborg.vbsupport.ru/external/2008/11/42.png

Template to edit: Postbit.

Full Install Instructions are in the text file attached.



Find in postbit:
HTML Code:

$post[usertitle]



Replace with:
HTML Code:

<!-- User title HTML markup www.sevenskins.com -->
<if condition="($post[displaygroupid]== X)">
<span style="font-weight:bold; color: #FF0000;">$post[usertitle]</span>
<else />
    <if condition="($post[displaygroupid]== X)">
    <span style="font-weight:bold; color: #008000;">$post[usertitle]</span>
    <else />
        <if condition="($post[displaygroupid]== X)">
            <span style="font-weight:bold; color: #0000FF;">$post[usertitle]</span>
            <else />
            $post[usertitle]
            </if>
    </if>
</if>
<!-- / User title HTML markup www.sevenskins.com -->




You will have to change X for the usergroup ID.
Three user groups IF statements has been added but you can add more as needed.



Enjoy


.

iogames 11-05-2008 11:28 PM

So if I create 5 usergroups, how can I use this?

Seven Skins 11-06-2008 10:42 AM

^^


you keep adding the code just below the last <else /> replacing $post[usertitle] and change the color: #0000FF as required.
HTML Code:

            <if condition="($post[displaygroupid]== X)">
                <span style="font-weight:bold; color: #0000FF;">$post[usertitle]</span>
                <else />
                $post[usertitle]
                </if>




Screen Shot below gives you idea what to do.




https://vborg.vbsupport.ru/external/2008/11/41.png


.

m411b 11-02-2009 01:26 AM

Thank you much for this!

tommyxv 03-18-2012 08:46 PM

can you update this for vb 4 as the conditionals are different?

CoffeeLovesYou 12-10-2013 06:47 PM

Hi.
I want to use this, however, I'm trying to do something special with it.
How can I make it show the color only if they're a moderator of that forum?
For example;
UserA is a moderator of ForumID 5.
If UserA posts in ForumID 5, I want their usertitle to show with a color for everyone. However, if UserA posts in ForumID 15 (which they don't moderate), their usertitle shows as normal. How can I do this? Thanks

Digital Jedi 12-13-2013 04:28 AM

You would use conditionals that only display the formatting in the forums you wish. Check the articles sections for the vB3 conditionals list. I forget the exact syntax off the top of my head, but you would just wrap the specific parts you want displaying differently in the conditional statement.

On an unrelated note, it's 12:28 AM, and I'm drinking coffee. Yes. Yes it does.

CoffeeLovesYou 12-21-2013 07:34 AM

Quote:

Originally Posted by Digital Jedi (Post 2467936)
You would use conditionals that only display the formatting in the forums you wish. Check the articles sections for the vB3 conditionals list. I forget the exact syntax off the top of my head, but you would just wrap the specific parts you want displaying differently in the conditional statement.

On an unrelated note, it's 12:28 AM, and I'm drinking coffee. Yes. Yes it does.

Thanks for responding.
However, I know what you're meaning.. but I'm trying to go more in depth & complicated.
If I'm a guest viewing vB.org at your post right now, and you're a moderator of this forum this is posted on, your usertitle would show with the color and what not. However, if I'm a guest viewing another post you made on vB.org in, for example, the Articles forums (which you don't moderate), then your usertitle would show without any customization..

Digital Jedi 12-21-2013 01:18 PM

I may be recalling incorrectly, but I was fairly certain there was an [minicode]is_moderator()[/minicode] function for vB 3 conditionals. Something like:

HTML Code:

<if condition="is_moderator($forumid, 5, 6, 7)"><!--Some Code Here--></if>
Probably not the exact syntax, but I can't seem to find a reference to it this morning.

CoffeeLovesYou 12-21-2013 10:03 PM

Quote:

Originally Posted by Digital Jedi (Post 2469815)
I may be recalling incorrectly, but I was fairly certain there was an [minicode]is_moderator()[/minicode] function for vB 3 conditionals. Something like:

HTML Code:

<if condition="is_moderator($forumid, 5, 6, 7)"><!--Some Code Here--></if>
Probably not the exact syntax, but I can't seem to find a reference to it this morning.

Yes, that will show if the user who is looking is a moderator.
I want it to show if anyone is looking at a post of a moderator in that forum..
With that if condition, if I am a moderator of forums 5, 6, and 7 I will be able to see the code. However, if I'm a normal user and I'm looking at the moderator's post in forum 5, 6 or 7, I won't be able to see the code.. which is what I am looking for.


All times are GMT. The time now is 05:21 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.05411 seconds
  • Memory Usage 1,748KB
  • 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
  • (5)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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