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.
Need help with two things (php code)
Hi guys,
I need help with some php code:
- What's the code I need to put in the href attribute of an anchor to lead to the user's account page? (Like when you click on the account tab. I want to get rid of it and link the user's username in the #Session to the account page.)
- What's the php code I need to put in the href that would lead the user to board's home? I don't want to hardcode my own since I'd like to make this style public.
0
This discussion has been closed.
Comments
http://lussumo.com/community/account/".$Context->Session->UserID."/"
normal :
"http://lussumo.com/community/account.php?u=".$Context->Session->UserID
its stored in : $Configuration['WEB_ROOT']
so use it : $Context->Configuration['WEB_ROOT'])
This is too much for my designer brain to grasp... I guess I'm supposed to be editing something here (from menu.php):
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'].'" class="Signout">'.$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>';
But f*** if I know what to do... Basically all I want to do is link the username to the account page.
PS
Is there a way to make it friendly/query-visible URL scheme independent? I wouldn't like to break the functionality of the users who don't use the friendly URLs with this.
This is what I did, added to the top of the extension file, but would work in conf/language.php also:
$Context->Dictionary['SignedInAsX'] = 'Signed in as <a href="' . $Context->Configruation['BASE_URL'] . '/account' . ('Standard' == $Context->Configuration['URL_BUILDING_METHOD'] ? '.php' : '/' .'">//1</a>';
You might want to change the CSS also, because the link doesn't appear to be a link other than when its hovered.
<?php // Custom Language Definitions $Context->Dictionary['SignedInAsX'] = 'Signed in as <a href="'. $Context->Configruation['BASE_URL'] . '/account'. ('Standard' == Context->Configuration['URL_BUILDING_METHOD'] ? '.php' : '/' .'">//1</a>'; ?>
It doesn;t work.
Too bad, that would rock.
<?php // Custom Language Definitions $Context->Dictionary['SignedInAsX'] = 'Signed in as <a href="'. $Context->Configuration['BASE_URL'] .'account'. ('Standard' == $Context->Configuration['URL_BUILDING_METHOD'] ? '.php' : '/') .'">//1</a>'; ?>
Thank you so much WallPhone!