View Full Version : Forum Info
LauraS
10-03-2007, 01:01 PM
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:
$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
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
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
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.
LauraS
10-31-2007, 05:47 PM
I tried it the navbar template and got it to work. Has anyone else been able to get the a multiple-array statement to work within a template? I still can't get the forum title in use within any template on the thread level, it just returns a null value.
Analogpoint
10-31-2007, 06:10 PM
{$GLOBALS[vbulletin]->forumcache[$thread[forumid]][title]}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.