Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Username in html?

Asked Modified Viewed 3,389 times
L
lsainsbury
L
Best Regards,
Lee
  • Senior Member, joined since
  • Contributed 270 posts on the community forums.
  • Started 53 threads in the forums
  • Started this discussions
asked
Senior Member

Hi,

In my welcome panel I want to use the user_name variable to display the user name.

How do I use this variable inside the html or is that not the way to do this?

Cheers

Lee
0 replies

12 posts

L
lsainsbury
L
Best Regards,
Lee
  • Senior Member, joined since
  • Contributed 270 posts on the community forums.
  • Started 53 threads in the forums
  • Started this discussions
answered
Senior Member

Hmmm,

Having a play around myself:

if (iMEMBER) {
opentable("Member Welcome");
  echo "<center>Welcome Back </center>";($userdata['user_name']);
closetable();

}



Not working though... :(
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

if (iMEMBER) {
opentable("Member Welcome");
echo "<center>Welcome Back ".$userdata['user_name']."</center>";
closetable();
}
0 replies
L
lsainsbury
L
Best Regards,
Lee
  • Senior Member, joined since
  • Contributed 270 posts on the community forums.
  • Started 53 threads in the forums
  • Started this discussions
answered
Senior Member

Daaaaa!!!! How close was I???!!!

Thanks Digi!!!

:D
0 replies
S
Sled_ride
S
  • Newbie, joined since
  • Contributed 8 posts on the community forums.
  • Started 3 threads in the forums
answered
Newbie

This close to what I am looking for but I would like to post a custom message if members are a member of a specific group.

Any help on what that custom page would look like?
0 replies
L
lsainsbury
L
Best Regards,
Lee
  • Senior Member, joined since
  • Contributed 270 posts on the community forums.
  • Started 53 threads in the forums
  • Started this discussions
answered
Senior Member

I'm still trying to work out how to put the username in the title of the panel - along with some other text. I can do one or the other but can't work out how to combine it...


Any pointers?
0 replies
B
Bad Boy
B
____________________
BadBoy aka GoogleDude
http://www.googlecityforums.com
  • Member, joined since
  • Contributed 155 posts on the community forums.
  • Started 1 thread in the forums
answered
Member

Quote

LSainsbury wrote:
I'm still trying to work out how to put the username in the title of the panel - along with some other text. I can do one or the other but can't work out how to combine it...

Any pointers?


Yep. Here's a pointer for you...

openside("".$userdata['user_name']." - Additional Text");
echo "Content";
closeside();
Edited by Bad Boy on 25-10-2006 21:16,
0 replies
L
lsainsbury
L
Best Regards,
Lee
  • Senior Member, joined since
  • Contributed 270 posts on the community forums.
  • Started 53 threads in the forums
  • Started this discussions
answered
Senior Member

Ahh - a double set of double quotes round the username variable - thats where I went wrong. Thank-you BadBoy!
0 replies
E
Elvenelf
E
  • Member, joined since
  • Contributed 184 posts on the community forums.
  • Started 19 threads in the forums
answered
Member

Quote

Sled_ride wrote:
This close to what I am looking for but I would like to post a custom message if members are a member of a specific group.

Any help on what that custom page would look like?


For members, I think all you need is to write in the welcome panel a php if statement...

something like...

if(iMEMBER){
echo "<center>Welcome ".$userdata['user_name']."!<br> Thanks for visiting again!</center>";
}else{
echo "<center>Welcome <b>Guest</b>. <br>Please register by visiting the <a href='register.php'>Registration Page</a>. </center>";
}


I havent tested that exact code as I have more user levels on my own site and made that if chain larger with elseifs along the way... but I think that could work out for ya just fine.

if you want to make a custom page... using the custom pages thing from control panel then you just add to what I gave above the

opentable("Welcome");

if(iMEMBER){
echo "<center>Welcome ".$userdata['user_name']."!<br> Thanks for visiting again!</center>";
}else{
echo "<center>Welcome <b>Guest</b>. <br>Please register by visiting the <a href='register.php'>Registration Page</a>. </center>";
}

closetable();

thing
Edited by Elvenelf on 25-10-2006 21:34,
0 replies
S
Sled_ride
S
  • Newbie, joined since
  • Contributed 8 posts on the community forums.
  • Started 3 threads in the forums
answered
Newbie

Thanks elvenelf, I should have been more specific.

I would like to ship a different message if a member is part of a user group.

Example, If I have 10 users in a user group, I want to show them a different message than any other member that logs in. The If Else statements are correct, but I do not know how to do the if member of user group.
0 replies
L
lsainsbury
L
Best Regards,
Lee
  • Senior Member, joined since
  • Contributed 270 posts on the community forums.
  • Started 53 threads in the forums
  • Started this discussions
answered
Senior Member

Note sure if this would work?? It's been a long while since BASIC on my Acorn Electron!


opentable("Welcome");

if(iMEMBER){
echo "<center>Welcome ".$userdata['user_name']."!<br> Thanks for visiting again!</center>";

}or{

if(iGUEST){
echo "<center>Welcome ".$userdata['user_name']."!<br> Thanks for visiting again!</center>";

}or{

if(isomeothergroup){
echo "<center>Welcome ".$userdata['user_name']."!<br> Thanks for visiting again!</center>";


}else{
echo "<center>Welcome <b>Guest</b>. <br>Please register by visiting the <a href='register.php'>Registration Page</a>. </center>";
}

closetable();
Edited by lsainsbury on 26-10-2006 10:13,
0 replies
— 4 months later —
B
BadCase
B
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
answered
Newbie

I am trying to get the username to show by the header sublinks by modifiying the theme.php file i tried your examples without the opentable closetable
shouldnt
echo $userdata['user_name'];

echo the user name?

I coded it to show Login or Register links on the upper left if your a guest and to say welcome and the username but when a member sees it
echo "<font color='#000000'><b>Welcome ".$userdata['user_name']."</b></font>";

just echos
Welcome

http://badcase.net is the site.
Edited by BadCase on 17-03-2007 05:36,
0 replies
B
BadCase
B
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
answered
Newbie

I got it i had to change
global $theme_width,$settings;

to
global $theme_width,$settings,$userdata;
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 12 posts
  • Votes 0 votes
  • Topic users 6 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet