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 Fri Jun 06, 2014 11:30 am

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}"
avatar
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 Fri Jun 06, 2014 5: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
avatar
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 Fri Jun 06, 2014 8: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?
avatar
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 Fri Jun 06, 2014 10:13 pm

But, this is not a CSS code... You need to put this in the message of homepage...
avatar
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 Sat Jun 07, 2014 3: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!
avatar
*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 Sat Jun 07, 2014 6: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!
avatar
smejker
Forumember

Male Posts : 166
Reputation : 4
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 Sun Jun 08, 2014 5: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
avatar
smejker
Forumember

Male Posts : 166
Reputation : 4
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 Sun Jun 08, 2014 7: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
avatar
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 Sun Jun 08, 2014 8:15 pm

This would be a nice CSS for member's.
avatar
Hagoromo Otsutsuki
Forumember

Male Posts : 588
Reputation : 24
Language : English
Location : Between Time and Space

http://fictionalomniverse.forumotion.com/

Back to top Go down

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

Post by smejker on Mon Jun 09, 2014 5: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!
avatar
smejker
Forumember

Male Posts : 166
Reputation : 4
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 Mon Jun 09, 2014 2: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
avatar
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