Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-23-2009, 08:41 PM
monstermunch monstermunch is offline
 
Join Date: Jun 2005
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Thread title in header?

Hi,

Does anyone know if its possible to show the "thread title" in the header template, for some reason I cant get it to display.

im using the
Code:
$thread[title]
to try and display it but it dosent seem to work, although it seems to work in the title and showthread pages?

Probably something simple im doing wrong.

thanks
Reply With Quote
  #2  
Old 11-23-2009, 09:42 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think it's because the header template is processed before $thread[title] is set. I don't know if there's a "standard" trick to get around that. I guess if you really wanted to do it you could use a plugin to insert it somehow, using the showthread_complete hook.

navbar isn't done till the end so it could go near the navbar (but I guess it's already in the navbar ).
Reply With Quote
  #3  
Old 11-24-2009, 07:22 AM
monstermunch monstermunch is offline
 
Join Date: Jun 2005
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
I think it's because the header template is processed before $thread[title] is set. I don't know if there's a "standard" trick to get around that. I guess if you really wanted to do it you could use a plugin to insert it somehow, using the showthread_complete hook.

navbar isn't done till the end so it could go near the navbar (but I guess it's already in the navbar ).
I thought the same thing so decided to look at the showthread template and found $thread[title] is used in the <title></title> which is before the $header is called.. its odd as it seems to work before the $header, and in the $navbar but not in the $header template itself
Reply With Quote
  #4  
Old 11-24-2009, 08:15 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But looking at the code in showthread.php, $header is set at the beginning (in global.php) and the showthread template isn't used until the end (and $navbar is set near the end). So although the $header appears after the <title></title> in the template, it is already set before the template even begins.

Something could be inserted between <body> and $header, but of course that would put it at the very top of the page.
Reply With Quote
  #5  
Old 11-24-2009, 09:36 AM
monstermunch monstermunch is offline
 
Join Date: Jun 2005
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
But looking at the code in showthread.php, $header is set at the beginning (in global.php) and the showthread template isn't used until the end (and $navbar is set near the end). So although the $header appears after the <title></title> in the template, it is already set before the template even begins.

Something could be inserted between <body> and $header, but of course that would put it at the very top of the page.

I see, so its dosent look like it something that easy to do then

--------------- Added [DATE]1259076988[/DATE] at [TIME]1259076988[/TIME] ---------------

Quote:
Originally Posted by kh99 View Post
But looking at the code in showthread.php, $header is set at the beginning (in global.php) and the showthread template isn't used until the end (and $navbar is set near the end). So although the $header appears after the <title></title> in the template, it is already set before the template even begins.

Something could be inserted between <body> and $header, but of course that would put it at the very top of the page.
I just checked my showthread template and it goes in this order

<title></title>
$header
$navbar

it seems to work above the header, below the header, in the navbar, but not in the header , although I can get the forum topics to show in the header just no the thread/post title..
Reply With Quote
  #6  
Old 11-24-2009, 04:30 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by monstermunch View Post
I just checked my showthread template and it goes in this order

<title></title>
$header
$navbar
Right, but what "$header" does is take what is in the variable "$header" and insert it in the template at that point. So it doesn't matter where it is in the template, what matters is where $header is set in the .php file compared to where the template is eval'd. In showthread.php, $header is set (by evaluating the header template) at the top before $thread is set, so $thread[title] doesn't show up. The forum info must work because it's set before the header template is eval'd.

However - in checking out why the forum stuff works, I noticed that there's another thread variable that *is* set early, it's called "$threadinfo". So, if you use $threadinfo[title] it should work in the header. (But word wrapping and censoring has not been done at that point, so it may be different than what appears in later in the page, if you use either of those features).
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:25 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.04093 seconds
  • Memory Usage 2,215KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete