The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using sessions or cookies from vBulletin
I was just wondering if it is possible to use cookies or sessions from vBulletin on a non vB page on my website.
I would like to disable a webpage to people in a certain usergroup, is this possible? Ideally I would like to use template variables with my vB header etc. but every solution I come across just seems so overly complicated. Thank you. |
#2
|
|||
|
|||
You'd have to do something like this: https://vborg.vbsupport.ru/showthread.php?t=228112 . If your non-vb pages are php, then you might be able to include global.php without doing everything that that article shows (if you just wanted the user's group, for instance). But if you mean html pages, then you'd have to create a php page like is shown in that article, and either put in php code to read your html file and return it (after checking the user's group), or else put your html in a template. (I hope this makes some sense - please ask for clarification if it doesn't )
|
Благодарность от: | ||
josh_krz |
#3
|
|||
|
|||
That article is great, could you elaborate more on using global.php please?
So like, when I include that file, do I just use the template variables as normal or is there a different way of using them? Thank you. |
#4
|
|||
|
|||
Quote:
Quote:
|
#5
|
|||
|
|||
Sorry I explained it in a bad way.
What I mean is will I be able to use <vb:if condition="$vboptions['enablesearches']"> inside that PHP file? Or do you use it like so; if ($vboptions['enablesearches'] == true{ //Show search bar; } |
#6
|
|||
|
|||
You could use this:
Code:
if ($vbulletin->options['enablesearches'] == true){ //Show search bar; } To be honest I'm not sure about $vboptions - it's a shortcut variable equivalent to $vbulletin->options that's created for use in templates, but I'm not sure if it's defined outside of a template. |
#7
|
|||
|
|||
Ok thanks, Ill have a go at that and see what's what.
|
#8
|
|||
|
|||
Yeah, my "edit" above (which I removed) may have been wrong - I'm not sure if you can use $vboptions or not - I'd have to do a test (or maybe someone else will know).
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|