The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Add welcome message with {Username} in the Login Widget

View previous topic View next topic Go down

Add welcome message with {Username} in the Login Widget

Post by MadroX on 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
Forumember

Posts : 39
Reputation : 0
Language : English

Back to top Go down

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

Post by Wagner' on 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'
Forumember

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

http://www.bestskins.net/forum

Back to top Go down

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

Post by MadroX on 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
Forumember

Posts : 39
Reputation : 0
Language : English

Back to top Go down

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

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

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

Wagner'
Forumember

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

http://www.bestskins.net/forum

Back to top Go down

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

Post by *Flora* on 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 SmileHope I helped!

*Flora*
Forumember

Female Posts : 27
Reputation : 2
Language : English

Back to top Go down

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

Post by smejker on 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 SmileHope I helped!

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

smejker
Forumember

Male Posts : 158
Reputation : 3
Language : serbo-croatian/english/macedonian/bulgarian

http://smejker@yahoo.com

Back to top Go down

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

Post by smejker on 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
Forumember

Male Posts : 158
Reputation : 3
Language : serbo-croatian/english/macedonian/bulgarian

http://smejker@yahoo.com

Back to top Go down

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

Post by Wagner' on 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'
Forumember

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

http://www.bestskins.net/forum

Back to top Go down

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

Post by Hagoromo Otsutsuki on June 8th 2014, 9:15 pm

This would be a nice CSS for member's.

Hagoromo Otsutsuki
Forumember

Male Posts : 514
Reputation : 21
Language : English
Location : Heaven

http://naruto-omniverse.forumotion.com/

Back to top Go down

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

Post by smejker on 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
Forumember

Male Posts : 158
Reputation : 3
Language : serbo-croatian/english/macedonian/bulgarian

http://smejker@yahoo.com

Back to top Go down

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

Post by Wagner' on 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'
Forumember

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

http://www.bestskins.net/forum

Back to top Go down

View previous topic View next topic Back to top


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