Choose from our various pricing plans. There is a package for everyone!


Customize Usernames For Christmas

View previous topic View next topic Go down

Tutorial Customize Usernames For Christmas

Post by Mati™ on Tue Dec 09, 2014 7:28 pm

Customize Usernames For Christmas


This tutorial will show you how to customize the usernames for Christmas, of the staff members on your forum.

Demo:
Spoiler:


Adding the javascript
Go to Administration Panel ► Modules ► Javascript codes management ► Create a new script.

Title : Christmas
Placement : In all the pages
Paste the code below and save :
Code:
$(document).ready(function() {

    doChristmas();
    
    setTimeout(function() { doChristmas(); }, 1000);

});

function doChristmas() {

    $('a[href*="/u"] strong').each(function(){
        var letters = $(this).text().split('');
        $(this).text('');
        for(var i = 0; i < letters.length; i++){
            if(i % 2 == 0){
                $(this).append('<em class="color_red">' + letters[i] + '</em>');
            }else{
                $(this).append('<em class="color_green">' + letters[i] + '</em>');
            }
        }
    });

}

The CSS Stylesheet:
Go to Administration Panel ► Display ► Colors ► CSS stylesheet. Copy and paste the following code :
Code:
a[href*="/u"] strong {
    background: url("http://i39.servimg.com/u/f39/17/95/88/56/xmas_t10.png") no-repeat scroll 0 0%, url("http://i39.servimg.com/u/f39/17/95/88/56/backro10.gif") repeat scroll 0 0 rgba(0, 0, 0, 0);
    color: green;
    font-weight: bold;
    padding-left: 19px;
}
em {
    font-style: normal;
}
.color_red {
    color: #d81e1e;
}
.color_green {
    color: #1a9132;
}

You're done! You will now have colored your username.

This tutorial was written by Mati™, for FM Focus
avatar
Mati™
Administrator
Administrator

Age : 31
Posts : 2112
Join date : 2011-10-20
Forum Version : PhpBB3
Reputation : 147

View user profile http://fmfocus.forumotion.net/forum

Back to top Go down

Tutorial Re: Customize Usernames For Christmas

Post by J0k3R^ on Sun Dec 14, 2014 1:46 pm

thank you clapping

edit: u say that its only for staff members. for me, it works for every member unsure
avatar
J0k3R^
Member
Member

Age : 24
Posts : 25
Join date : 2013-04-25
Forum Version : PunBB
Reputation : 1

View user profile http://fmplanet.forumgreek.com/

Back to top Go down

Tutorial Re: Customize Usernames For Christmas

Post by Mati™ on Sun Dec 14, 2014 1:55 pm

Is the same code I'm using here, so as you can see is only working for staff members.
avatar
Mati™
Administrator
Administrator

Age : 31
Posts : 2112
Join date : 2011-10-20
Forum Version : PhpBB3
Reputation : 147

View user profile http://fmfocus.forumotion.net/forum

Back to top Go down

Tutorial Re: Customize Usernames For Christmas

Post by Sponsored content


Sponsored content


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