vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Highlighting Threads by Author's User Group (https://vborg.vbsupport.ru/showthread.php?t=269528)

greytone 09-01-2011 08:02 PM

Highlighting Threads by Author's User Group
 
I want my thread list in each sub-forum to emphasize threads that were created by Administrators. For instance, have their name in red.

It would make sense to edit the memberaction_dropdown template because this is where the user names are printed, but I can't figure out what conditional statement to write. Any suggestions?

I already have the posts within a single thread doing custom styling on the username, but this doesn't affect the list of thread in a forum.

Lynne 09-01-2011 11:17 PM

Try a condition like (not exactly like this since I put a comment in it!):
HTML Code:

<vb:if condition="is_member_of($memberinfo, x)">
<span style="whatever">{vb:raw memberinfo.username}
(or {vb:raw memberinfo.musername} )
</span>
<vb:else />
{vb:raw memberinfo.username}
(or {vb:raw memberinfo.musername} )
</vb:if>

Change x to the usergroup you want

greytone 09-02-2011 09:26 PM

Hi Lynne,

I'm afraid that your suggestion didn't work.
No matter what number I substitute for X, it never executes as "true".
I suspect that the $member variable doesn't evaluate.

Any other suggestions?

Lynne 09-02-2011 10:03 PM

Whoops, sorry, it is $memberinfo. And, I didn't do the else correctly (why did I write another if???).

A correct example for replacing the username (need to do the same for musername):
HTML Code:

<vb:if condition="is_member_of($memberinfo, 6)">
<span style="color:red">{vb:raw memberinfo.username}</span>
<vb:else />
{vb:raw memberinfo.username}
</vb:if>

And, if you only want it on the forumdisplay page, you may need to add in the condition "AND THIS_SCRIPT=='forumdisplay'" also.

greytone 09-06-2011 03:41 PM

It works!

Thank you very much!

dany_danay 10-21-2013 06:54 PM

Hi, now i think its not woriking ... :(

tbworld 10-21-2013 09:17 PM

Quote:

Originally Posted by dany_danay (Post 2455149)
Hi, now i think its not woriking ... :(

Please describe what is not working and where you are trying to implement @Lynnes code. We can only be as helpful as per the data you provide us. Most likely you are implementing @Lynne's code snippet incorrectly. Give your question another go. :)


All times are GMT. The time now is 10:27 PM.

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.01498 seconds
  • Memory Usage 1,726KB
  • 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
  • (2)bbcode_html_printable
  • (1)bbcode_quote_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