Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // V1.0
- $(function() {
- var u = _userdata, l = _lang;
- var content = $('html').get(); // document.getElementsByName('html'); - not work, i don't know
- for (i = 0; i < content.length; i++) {
- content[i].innerHTML = content[i].innerHTML
- .replace(/\{IM_ONLINE\}/g, u.session_logged_in)
- .replace(/\{USER_NAME\}|\{.USER_NAME\}/g, u.username)
- .replace(/\{AVATAR\}|\{.AVATAR\}/g, u.avatar)
- .replace(/\{USER_PRIVATE_MSG\}|\{.USER_PRIVATE_MSG\}/g, u.user_nb_privmsg)
- .replace(/\{USER_REPUTATION\}|\{.USER_REPUTATION\}/g, u.point_reputation)
- .replace(/\{USERID\}|\{.USERID\}/g, "/u"+u.user_id)
- .replace(/\{USER_POST\}|\{.USER_POST\}/g, u.user_posts)
- .replace(/\{USER_LEVEL\}|\{.USER_LEVEL\}/g, u.user_level)
- .replace(/\{RANK_TITLE\}|\{.RANK_TITLE\}/g, l.rank_title);
- }
- });
- // v2.0
- function html_variables(tag, variable) {
- var c = $('html'), f = 0; for(f; f < c.length; f++) c[f].innerHTML = c[f].innerHTML.replace(tag, variable);
- };
- $(function() {
- html_variables("\{USER_NAME\}", _userdata.username); // Get user name of html tags
- html_variables("\{.USER_NAME\}", _userdata.username); // Get user name on html template :D
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement