The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using Variables outside vBulletin
I'm having some issues using variables outside vbulletin. For the username I'm using $vbulletin->userinfo['username'] which is fine. Now, for notifications I'm using $notifications_total which works outside of vBulletin but for some reason this variable doesn't work when I include a php file in the header of vBulletin it is just "blank".
Is there anyway around this? Also, I am using $pmbox['lastvisitdate'] to show the last time a user visited outside vBulletin which, again, is fine but again, on vBulletin it is "blank". Can anyone help me with this? Thanks very much! |
#2
|
|||
|
|||
You would get a better and most likely a faster answer by posting in the right forum.
https://vborg.vbsupport.ru/forumdisplay.php?f=15 |
#3
|
|||
|
|||
Quote:
|
#4
|
||||
|
||||
Moved to Programming Discussions.
I don't understand when you say you are using things "outside vbulletin". Did you create some new page for your site? And did you include global.php at all? Did you follow something like this article - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. You can only use a variable if it's been defined. And some variables are only defined for some specific pages. So, you would need to include the code in your page in order to use some of them. |
#5
|
|||
|
|||
Quote:
|
#6
|
||||
|
||||
Start by searching for a modification that does something similar to what you want and then modifying it to do what you need. Or, find a the queries in the existing vb code and modify it to do what you want.
|
#7
|
|||
|
|||
I've been looking everywhere. I just can't seem to get $notifications_total to work in the header template of my vbulletin skin. $notifications_total works outside vbulletin now but not in the healer of my skin.
|
#8
|
||||
|
||||
I would guess it hasn't been defined prior to you evaling your header template. It's too hard to tell with such vague descriptions of what you have done.
|
#9
|
|||
|
|||
I have moved the notifications_total code to my header template on my vbulletin skin and as you said I dont think it has been defined yet. Is there anyway around this?
|
#10
|
||||
|
||||
The way around it is to move the code to a spot prior to the header being evaled, or move the notifications back to the navbar template.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|