vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   accessing forum array in SHOWTHREAD (https://vborg.vbsupport.ru/showthread.php?t=276685)

Southernphuk 01-09-2012 04:12 PM

accessing forum array in SHOWTHREAD
 
I'm wanting to put a title onto my thread display, telling the user which forum the thread is in and showing the forum icon added using Forum Icons. But I can't work out how to access the forum array for the parent forum.

I used something like this in the FORUMDISPLAY
HTML Code:

<div id="pagetitle" class="pagetitle">
        <img src="{vb:raw foruminfo.iconlocation}" alt="{vb:raw foruminfo.title}" style="float: left; margin-right: 4px;" />
        <h1>{vb:rawphrase forum}: <span class="forumtitle">{vb:raw foruminfo.title}</span></h1>
        <vb:if condition="$foruminfo['description']"><p class="description">{vb:raw foruminfo.description}</p></vb:if>
</div>

How would I do something similar in SHOWTHREAD?

kh99 01-09-2012 04:53 PM

The problem is that foruminfo isn't registered to the SHOWTHREAD template like it is in the FORUMDISPLAY template. But it turns out it's a global in showthread.php, so you can use this:

Code:

{vb:raw GLOBALS.foruminfo.description}

Southernphuk 01-09-2012 06:00 PM

Ta muchly.. that worked a treat. in the end it ended up something like this

HTML Code:

<div id="ThreadForum" class="pagetitle">
        <vb:if condition="$GLOBALS['foruminfo']['iconlocation']"><img src="{vb:raw GLOBALS.foruminfo.iconlocation}" alt="{vb:raw GLOBALS.foruminfo.title}" style="float: left; margin-right: 4px;" /></vb:if>
        <h1><span class="forumtitle">{vb:rawphrase forum}: <a href="{vb:link forum, {vb:raw GLOBALS.forum}}">{vb:raw GLOBALS.foruminfo.title}</a></span></h1>
        <vb:if condition="$GLOBALS['foruminfo']['description']"><p class="description">{vb:raw GLOBALS.foruminfo.description}</p></vb:if>
</div>



All times are GMT. The time now is 07:52 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.01918 seconds
  • Memory Usage 1,720KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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