vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Template Conditional for threads by a specific author (https://vborg.vbsupport.ru/showthread.php?t=325037)

malmazan 05-05-2017 08:09 PM

Template Conditional for threads by a specific author
 
Hi all

I need to change the appearance of threads started by a specific author.

What would be the template conditional for that?

Ideally by user id number, else by author name. Since the author is also the admin, a conditional for admin thread authors could also be a compromise solution. Using a plugin is fine.

Thanks in advance for the help

Dave 05-05-2017 08:24 PM

Threads use the SHOWTHREAD template. Just before </head> you could add the following condition:

HTML Code:

<vb:if condition="$thread['postuserid'] == 1">
  {vb:cssfile davethreadstyle.css}
</vb:if>

Then create a new template called davethreadstyle.css (or whatever you named it in the code above) and it will load it in a thread when the thread is started by userid 1. Add your custom CSS to the CSS template.

Alternatively, instead of injecting a CSS file, you could use the regular CSS style tag like this:
HTML Code:

<vb:if condition="$thread['postuserid'] == 1">
  <style type="text/css">
      .element{
        attribute: value;
      }
  </style>
</vb:if>


CAG CheechDogg 05-06-2017 03:25 AM

So how exactly does this look ?

malmazan 05-06-2017 10:48 AM

That works, many thanks Dave


All times are GMT. The time now is 08:37 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.01003 seconds
  • Memory Usage 1,711KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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