vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Forum Info (https://vborg.vbsupport.ru/showthread.php?t=159366)

LauraS 10-03-2007 01:01 PM

Forum Info
 
I use $foruminfo[title] to get the title of each forum on each page, and then use that information for a custom ad solution. After testing it, though, I realized that when you drill-down into the thread level, it picks up the name of the thread; I'd rather it just keep the name of the overall forum.

For instance, if you have "National Football League" as a forum, and then several threads within that forum: "Chicago Bears", "NY Jets", etc. - I need a way to access the forum name "National Football League" on every page, even the lower-level thread pages. Does anyone know how to do this?

Analogpoint 10-03-2007 01:24 PM

Use this:

Code:

$vbulletin->forumcache[$thread['forumid']]['title'];
Depending on what you're using this for, you might want to use 'title_clean' instead of 'title'.

Dismounted 10-04-2007 04:41 AM

Use {$vbulletin->forumcache[$thread[forumid]][title]} in templates.

Analogpoint 10-04-2007 06:25 AM

Quote:

Originally Posted by Dismounted (Post 1352585)
Use {$vbulletin->forumcache[$thread[forumid]][title]} in templates.

As far as I know, the $vbulletin object is not available in templates.

Dismounted 10-04-2007 07:16 AM

It is available. :) Try putting {$vbulletin->userinfo[username]} in a template.

Analogpoint 10-04-2007 03:40 PM

Quote:

Originally Posted by Dismounted (Post 1352641)
It is available. :) Try putting {$vbulletin->userinfo[username]} in a template.

I've tried it before, and never been able to get it to work. Can you give me an example of where it works?

LauraS 10-04-2007 05:59 PM

I'm able to get {$vbulletin->userinfo[username]} to return the username value, but when I try and use {$vbulletin->forumcache[$thread[forumid]][title]}, it returns nothing - it doesn't error, it just returns a null or blank value.

Paul M 10-04-2007 08:08 PM

I seem to recall that templates have some problem with multiple arrays - i.e. $var[x] will be okay, but $var[x][y] seems to fail, even though it exists. Although I thought that the use of braces fixed the problem ....

Analogpoint 10-04-2007 09:45 PM

Quote:

Originally Posted by LauraS (Post 1352975)
I'm able to get {$vbulletin->userinfo[username]} to return the username value

What template did you try it in? I tried that in a few templates and nothing.

Eikinskjaldi 10-04-2007 11:15 PM

it depends on the scope within which the template was called.

$vbulletin will only be available within a function if you

global $vbulletin;

first.


All times are GMT. The time now is 02:13 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.01091 seconds
  • Memory Usage 1,728KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete