The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using Vbulletin Vars in Custom Templates?
I have been trying to create a plugin to move the login box to the top of the page. All was going well, I made two templates for the guest and member logged in states. I put the style vars in the header template with a if statement. However the problem I am running into is that I cannot use " in the custom template, it always tries to escape the characters. So I went and replaced everything with single quotes, which fixed the html code. However all the vbulletin variables dont seem to be working. I was trying to use $bbuserinfo[username] and the all the login hidden fields/javascript. This functionality seems to all be broken unless I paste the code directly to the header template.
Is there any way around this? |
#2
|
||||
|
||||
$bbuserinfo is only used in templates. You usually use $vbulletin->userinfo in plugins.
|
#3
|
|||
|
|||
One of the issues I seem to be running into is with the " not working in custom templates.
It seems the page is not properly parsed. For instance: Code:
<span class='navbar_text'> <strong><phrase 1='$vbulletin->userinfo[username]' 2='member.php?$session[sessionurl]u=$vbulletin->userinfo[userid]'>$vbphrase[welcome_x_link_y]</phrase></strong> Code:
" . construct_phrase("$vbphrase[welcome_x_link_y]", "$vbulletin->userinfo[username]", "member.php?" . $GLOBALS['vbulletin']->session->vars['sessionurl'] . "u=$vbulletin->userinfo[userid]") . " |
#4
|
||||
|
||||
Try
HTML Code:
<span class="navbar_text"> <strong><phrase 1="$bbuserinfo[username]" 2="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[welcome_x_link_y]</phrase></strong> |
#5
|
|||
|
|||
Quote:
HTML Code:
" . construct_phrase("$vbphrase[welcome_x_link_y]", "" . $GLOBALS['vbulletin']->userinfo['username'] . "", "member.php?" . $GLOBALS['vbulletin']->session->vars['sessionurl'] . "u=" . $GLOBALS['vbulletin']->userinfo['userid'] . "") . " |
#6
|
||||
|
||||
What template are you putting this in?
|
#7
|
|||
|
|||
I got this fixed now, I was not doing an eval to fetch the template.
However now I am having one issue: HTML Code:
<phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase> You last visited: at Obviously pmbox is not available for custom templates so I tried : HTML Code:
<phrase 1="$vbulletin->userinfo[lastvisitdate]" 2="$vbulletin->userinfo[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase> You last visited: Array[lastvisitdate] at Array[lastvisittime] Any ideas on what variable to use? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|