Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
global variable - extension wide
Is there a way to create a sort of global variable in an extension folder? I'm trying to get the logged in users username via
$nick = $Context->Session->User->Name;
in default.php.
I need to get the variable into a seperate php file in the same folder. I tried using that line in the php file I need it in, but it doesn't seem to work. (I created the line with a simple echo and called the page via an iframe from the forum with pagemanager).
Is there a way to get it to work in a file other than default.php? Or a way to create it globally so I can call it in the other php file?
Much thanks for any help.
-aj
$nick = $Context->Session->User->Name;
in default.php.
I need to get the variable into a seperate php file in the same folder. I tried using that line in the php file I need it in, but it doesn't seem to work. (I created the line with a simple echo and called the page via an iframe from the forum with pagemanager).
Is there a way to get it to work in a file other than default.php? Or a way to create it globally so I can call it in the other php file?
Much thanks for any help.
-aj
0
This discussion has been closed.
Comments
You can, add at the top of the page that will be loaded in the iframe
include("../../appg/settings.php"); include("../../conf/settings.php"); include("../../appg/init_ajax.php");
And you can use all the vanilla stuff in the page.Of if you can't, you can just add in your default.php, something like
$SESSION['ExtensionName_NickName'] = $Context->Session->User->Name;
And add in the iframe page
if (!session_id()) session_start(); if (isset($SESSION['ExtensionName_NickName'])) $nick = $SESSION['ExtensionName_NickName']; else $nick = '';
Another thing, do you have any idea how to order the panel? I've searched and came up with this:
$Panel->AddString($swfcode, $Position = '500', $ForcePosition = '10');
where $swfcode is a small flash movie I'm trying to embed. This doesn't seem to want to work for anything. No matter what I put in either position or forceposition it never changes.
Thanks again. Your help is much appreciated.
cheers
Much thanks,
aj