The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Add welcome message with {Username} in the Login Widget

5 posters

Go down

Add welcome message with {Username} in the Login Widget Empty Add welcome message with {Username} in the Login Widget

Post by MadroX June 6th 2014, 12:30 pm

Hello, I was wondering if I could code into my forum that once logged in, the 'login' box (displays the user's username, avatar, and "My Profile" button) would have a greeting message for the user in the table header, such as instead of saying the username, it saying "Welcome Back, {Username}"
MadroX
MadroX
Forumember

Posts : 39
Reputation : 0
Language : English

Back to top Go down

Add welcome message with {Username} in the Login Widget Empty Re: Add welcome message with {Username} in the Login Widget

Post by Wagner' June 6th 2014, 6:21 pm

Hello,

Something like this?
Code:
<script>
    jQuery(function(){
        var avatar = _userdata["avatar"];
        jQuery('#avatar').append(avatar);
    });
</script>
<div id="greeting">
    <div id="avatar"></div>
    Welcome back, <span class="USERLINK">{USERLINK}</span>
</div>

You just need to style this by CSS to give your own "touch" to it...

Best regards, Wagner
Wagner'
Wagner'
Forumember

Male Posts : 48
Reputation : 6
Language : Portuguese
Location : Brazil

http://www.bestskins.net/forum

Back to top Go down

Add welcome message with {Username} in the Login Widget Empty Re: Add welcome message with {Username} in the Login Widget

Post by MadroX June 6th 2014, 9:35 pm

Unfortunately it did not work, in my css it said that most of it was made in html format and my css deleted most of the code by default, any other ideas?
MadroX
MadroX
Forumember

Posts : 39
Reputation : 0
Language : English

Back to top Go down

Add welcome message with {Username} in the Login Widget Empty Re: Add welcome message with {Username} in the Login Widget

Post by Wagner' June 6th 2014, 11:13 pm

But, this is not a CSS code... You need to put this in the message of homepage...
Wagner'
Wagner'
Forumember

Male Posts : 48
Reputation : 6
Language : Portuguese
Location : Brazil

http://www.bestskins.net/forum

Back to top Go down

Add welcome message with {Username} in the Login Widget Empty Re: Add welcome message with {Username} in the Login Widget

Post by *Flora* June 7th 2014, 4:08 pm

MadroX wrote:Unfortunately it did not work, in my css it said that most of it was made in html format and my css deleted most of the code by default, any other ideas?
administrator panel > display > homepage, generalities > homepage message 
and once you're there you can make your title and just add 
Code:
<script>
    jQuery(function(){
        var avatar = _userdata["avatar"];
        jQuery('#avatar').append(avatar);
    });
</script>
<div id="greeting">
    <div id="avatar"></div>
    Welcome back, <span class="USERLINK">{USERLINK}</span>
</div>
into the message content, but be sure to press save on the bottom save button, and if you change any options on general Smile Hope I helped!
*Flora*
*Flora*
Forumember

Female Posts : 27
Reputation : 2
Language : English

Back to top Go down

Add welcome message with {Username} in the Login Widget Empty Re: Add welcome message with {Username} in the Login Widget

Post by smejker June 7th 2014, 7:50 pm

*Flora* wrote:
administrator panel > display > homepage, generalities > homepage message 
and once you're there you can make your title and just add 
Code:
<script>
    jQuery(function(){
        var avatar = _userdata["avatar"];
        jQuery('#avatar').append(avatar);
    });
</script>
<div id="greeting">
    <div id="avatar"></div>
    Welcome back, <span class="USERLINK">{USERLINK}</span>
</div>
into the message content, but be sure to press save on the bottom save button, and if you change any options on general Smile Hope I helped!

I Like this, but...
1. How to resize avatar?
2. How to put on right side (or center)?
Thanks in advance!
smejker
smejker
Forumember

Male Posts : 167
Reputation : 4
Language : serbo-croatian/english/macedonian/bulgarian

Back to top Go down

Add welcome message with {Username} in the Login Widget Empty Re: Add welcome message with {Username} in the Login Widget

Post by smejker June 8th 2014, 6:19 pm

smejker wrote:

I Like this, but...
1. How to resize avatar?
2. How to put on right side (or center)?
Thanks in advance!

Anybody know? Shocked 
smejker
smejker
Forumember

Male Posts : 167
Reputation : 4
Language : serbo-croatian/english/macedonian/bulgarian

Back to top Go down

Add welcome message with {Username} in the Login Widget Empty Re: Add welcome message with {Username} in the Login Widget

Post by Wagner' June 8th 2014, 8:50 pm

You just need to use CSS...

1. To resize use these properties of CSS
Code:
#avatar img{
    width: WIDTHSIZE;
    heigth: HEIGTHSIZE;
}

2. On the right
Code:
#avatar img{
    float: right;
}

On the center
Code:
#avatar{
    text-align: center;
}

Best regargs, waghcwb
Wagner'
Wagner'
Forumember

Male Posts : 48
Reputation : 6
Language : Portuguese
Location : Brazil

http://www.bestskins.net/forum

Back to top Go down

Add welcome message with {Username} in the Login Widget Empty Re: Add welcome message with {Username} in the Login Widget

Post by Beyonder June 8th 2014, 9:15 pm

This would be a nice CSS for member's.
Beyonder
Beyonder
Forumember

Male Posts : 721
Reputation : 29
Language : English
Location : Beyond Realm

http://fictionalomniverse.forumotion.com/

Back to top Go down

Add welcome message with {Username} in the Login Widget Empty Re: Add welcome message with {Username} in the Login Widget

Post by smejker June 9th 2014, 6:50 am


Thanks Wagner'
Yes, it's work... but, I have another little problem...
Avatar picture is OK...The message of "USERLINK" is still on the left...
Solution...
Regards & Respect!
smejker
smejker
Forumember

Male Posts : 167
Reputation : 4
Language : serbo-croatian/english/macedonian/bulgarian

Back to top Go down

Add welcome message with {Username} in the Login Widget Empty Re: Add welcome message with {Username} in the Login Widget

Post by Wagner' June 9th 2014, 3:04 pm

You just need to put it all together in a "wrap" element..

Here is a complete example:
Code:
<style type="text/css">
#greeting{
    overflow: hidden;
}
#greetwrap{
    float: right;
    width: 200px;
}
#avatar img{
    max-width: 50px;
    background: #fff;
    padding: 1px;
    box-shadow: rgba(0,0,0,.5) 0 0 3px;
    float: right;
}
</style>
<script>
    jQuery(function(){
        var avatar = _userdata["avatar"];
        jQuery('#avatar').append(avatar);
    });
</script>
<div id="greeting">
    <div id="greetwrap">
        <div id="avatar"></div>
        Welcome back, <span class="USERLINK">{USERLINK}</span>
    </div>
</div>

Best regards, waghcwb
Wagner'
Wagner'
Forumember

Male Posts : 48
Reputation : 6
Language : Portuguese
Location : Brazil

http://www.bestskins.net/forum

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum