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.
Signed In As ... link in left side panel
bytte
✭
For my own board I'm looking to put the "Signed In As... (Sign Out)" link somewhere in the left side panel.
What would be the best way to do this?
0
This discussion has been closed.
Comments
In the default file, this is what it looks like:
echo '<div id="Session">'; if ($this->Context->Session->UserID > 0) { echo str_replace('//1', $this->Context->Session->User->Name, $this->Context->GetDefinition('SignedInAsX')).' (<a href="'.$this->Context->Configuration['SIGNOUT_URL'].'">'.$this->Context->GetDefinition('SignOut').'</a>)'; } else { echo $this->Context->GetDefinition('NotSignedIn').' (<a href="'.AppendUrlParameters($this->Context->Configuration['SIGNIN_URL'], 'ReturnUrl='.GetRequestUri()).'">'.$this->Context->GetDefinition('SignIn').'</a>)'; } echo '</div>';
Notice the echo calls.
You could do 1 of two things.
First, for either, is to make copies of menu.php and panel.php
(from the themes directory) and put them in the main directory
for the theme you are using. For example, if your theme is called
"MyTheme", you would copy them to themes/MyTheme/. If you're using
either the default vanilla theme, or a theme you've downloaded, it's
usually best to make a fresh copy of the them you're playing with.
Anyway, once copied over, open up menu.php and look for the above
mentioned code.
Here's the easy options:
1) You can either move that chunk of code over to panel.php, and insert
it where you see fit.
2) You can change the two echo's from " echo ' " to " $myvar = ' ".
Then, add a global statement ( global $myvar;) at the top of that
file under the " // Note: " line.
Then, you would add the same global line to panel.php, and add:
echo $myvar;
in panel.php where you see fit.
As a note, you might wish to remove the
echo '<div id="Session">';
and
echo '</div>';
lines, as the default css file will still stick it up in the upper right corner.
You could put it in a span or p tag if you wish, or whatever.