Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
Recent Tutorials
Top posting users this month
Top Achievers
Who is online?
In total there are 20 users online :: 0 Registered, 0 Hidden and 20 Guests :: 1 Bot
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
Personal Rank Titles
Page 1 of 1 • Share
This tutorial will help teach you how to setup a profile field that allows your members to give themselves their own personal rank title.
If you've modified your viewtopic_body template this modification may not work for you. If that's the case please provide the following information in a reply if this tutorial isn't working for you.
Otherwise, follow the installation normally !
To start, we first need to create a new field for our users. Go to Admin Panel > Users & Groups > Profiles and create a new profile field with the following settings.
Type : Text zone ( DO NOT PICK text field )
Name : Title
Description : Your personal title
URL icon : None
Necessarily filled ? : You choose
Display : Profile, Messages
Display type : Icon
Who can modify the profile field value ? : Members, Moderators ( in case of questionable titles )
Display this field for users that are at least : You choose
Separator : No choice
Down below there should be additional information under text zone.
Default content :
Paste the follow content as the default value for the field.
You can set the max length as you like.
When you're finished your field should look similar to this :
If everything looks okay to you click the save button. Then edit the newly created field and click the "Replace the content" button at the very bottom to force the default value. Once you've done this you're ready to move onto the script installation.
So the field functions properly and the personal rank title is placed in the correct position we need to install a small script. Go to Admin Panel > Modules > JavaScript codes management and create a new script with the following settings.
Title : Personal Rank Title
Placement : In all the pages
Paste the code below and submit :
At the top of the script is a variable named formatBBCode. If you want your members to use bbcode in their rank titles ( color, bold, size, etc.. ) then keep this variable set to true, otherwise if you want the rank to remain as plain text set this variable to false.
Once the script is installed everything should function properly. See the final section for information on how it works !
Inputting a title
To input your own personal title go to the edit profile page which should be accessible from the navbar. Find the field and insert your personal title.
If JavaScript is enabled, the rank title will automatically be wrapped with the necessary tags. Otherwise, you should type the rank title between the table tags manually.
Why should my rank be between table tags ?
It's necessary for your rank to be between table tags so that the script can quickly identify your rank title and place it in the correct position. Removing the table tags will prevent your rank title from being moved to the correct position.
Where does my personal title go ?
Your personal title will go directly below your existing rank title. If it doesn't, then your viewtopic_body template may not be compatible with the script, or you removed the necessary table tags.
Can I color my personal title ?
Yes ! Any bbcode should work in the personal title field, so you can change the color, size, font, etc.. Note that this is only applicable if the Administrator allows you to use bbcode.
If you have any questions or comments feel free to leave a reply below. Now go give yourselves some awesome titles !!
If you've modified your viewtopic_body template this modification may not work for you. If that's the case please provide the following information in a reply if this tutorial isn't working for you.
- Code:
[b]URL of topic on your forum :[/b]
[b]Explanation of problem :[/b]
Otherwise, follow the installation normally !
1. Creating the profile field
To start, we first need to create a new field for our users. Go to Admin Panel > Users & Groups > Profiles and create a new profile field with the following settings.
Type : Text zone ( DO NOT PICK text field )
Name : Title
Description : Your personal title
URL icon : None
Necessarily filled ? : You choose
Display : Profile, Messages
Display type : Icon
Who can modify the profile field value ? : Members, Moderators ( in case of questionable titles )
Display this field for users that are at least : You choose
Separator : No choice
Down below there should be additional information under text zone.
Default content :
Paste the follow content as the default value for the field.
- Code:
[table class="fa_personal_title"][tr][td][/td][/tr][/table]
You can set the max length as you like.
When you're finished your field should look similar to this :
If everything looks okay to you click the save button. Then edit the newly created field and click the "Replace the content" button at the very bottom to force the default value. Once you've done this you're ready to move onto the script installation.
2. Installing the JavaScript
So the field functions properly and the personal rank title is placed in the correct position we need to install a small script. Go to Admin Panel > Modules > JavaScript codes management and create a new script with the following settings.
Title : Personal Rank Title
Placement : In all the pages
Paste the code below and submit :
- Code:
$(function() {
var formatBBCode = true;
// editing of profile field
if (/\/profile|\/u\d+/.test(window.location.href)) {
for (var a = document.getElementsByTagName('TEXTAREA'), i = 0, j = a.length; i < j; i++) {
if (/class="fa_personal_title"/.test(a[i].value) && /profile_field/.test(a[i].id)) {
a[i].onfocus = function() {
this.value = this.value.replace(/\n|\r/g, '').replace(/\[table class="fa_personal_title"\]\[tr\]\[td\](.*?)\[\/td\]\[\/tr\]\[\/table\]/, '$1');
};
a[i].onblur = function() {
this.value = '[table class="fa_personal_title"][tr][td]' + this.value + '[/td][/tr][/table]';
};
}
}
}
// parsing in messages
else if (/\/t\d+/.test(window.location.href)) {
var version = $('.bodylinewidth')[0] ? 0 : document.getElementById('phpbb') ? 1 : $('div.pun')[0] ? 2 : document.getElementById('ipbwrapper') ? 3 : document.getElementById('modernbb') ? 4 : document.getElementById('fa_edge') ? 5 : 'badapple',
closest = ['.poster-profile', '.postprofile', '.user', '.postdetails', '.postprofile', '.postprofile'][version],
find = ['br:first', 'dt + dd', '.user-basic-info', 'dt + dd', '.postprofile-rank', '.rank-title'][version],
a = $('.fa_personal_title'),
i = 0,
j = a.length,
node, str, title;
if (version == 'badapple') {
if (window.console && console.warn) console.warn('Your forum version is not supported for the "Personal Title" plugin.');
return;
}
for (; i < j; i++) {
title = $('td', a[i]).eq(0);
title = formatBBCode ? title.html() : title.text();
if (title) {
node = $(a[i]).closest(closest).find(find);
str = '<span class="personal_title">' + title + '</span>';
version == 0 ? node.before(str) : node.append(str);
a[i].style.display = 'none';
}
}
}
});
At the top of the script is a variable named formatBBCode. If you want your members to use bbcode in their rank titles ( color, bold, size, etc.. ) then keep this variable set to true, otherwise if you want the rank to remain as plain text set this variable to false.
Once the script is installed everything should function properly. See the final section for information on how it works !
3. Notes
Inputting a title
To input your own personal title go to the edit profile page which should be accessible from the navbar. Find the field and insert your personal title.
If JavaScript is enabled, the rank title will automatically be wrapped with the necessary tags. Otherwise, you should type the rank title between the table tags manually.
Why should my rank be between table tags ?
It's necessary for your rank to be between table tags so that the script can quickly identify your rank title and place it in the correct position. Removing the table tags will prevent your rank title from being moved to the correct position.
Where does my personal title go ?
Your personal title will go directly below your existing rank title. If it doesn't, then your viewtopic_body template may not be compatible with the script, or you removed the necessary table tags.
Can I color my personal title ?
Yes ! Any bbcode should work in the personal title field, so you can change the color, size, font, etc.. Note that this is only applicable if the Administrator allows you to use bbcode.
If you have any questions or comments feel free to leave a reply below. Now go give yourselves some awesome titles !!
Notice |
Tutorial written by Ange Tuteur. Reproduction not permitted without consent from the author. |
Last edited by Ange Tuteur on Sun 23 Jul 2017, 10:59; edited 2 times in total
- CanhraungotMember
- Gender :
Posts : 20
Points : 3226
Reputation : 7
Language : Viet Nam
Browser : Forum Version :
My forum can not do it , although I have to follow the instructions
http://viethamvui.forumvi.com
http://viethamvui.forumvi.com
You had everything setup good, however I think you forgot to re-edit the profile field and force the default content.
I did that and it appears to be working now.
I did that and it appears to be working now.
- Ruzmarin
- Gender :
Age : 29
Posts : 381
Points : 3688
Reputation : 71
Language : Serbian, English
Browser : Forum Version :
Works flawless thanks Ange
Canhraungot wrote:My forum can not do it , although I have to follow the instructions
http://viethamvui.forumvi.com
@CanhraungotAnge Tuteur wrote:You had everything setup good, however I think you forgot to re-edit the profile field and force the default content.
I did that and it appears to be working now.
I hope that is a test account that you posted.
@Ange Tuteur
Thanks for the amazing tutorial.
- Ruzmarin
- Gender :
Age : 29
Posts : 381
Points : 3688
Reputation : 71
Language : Serbian, English
Browser : Forum Version :
I've made some modifications in view_topicbody in regards of making username and ranks below avatar, and the personal title is being displayed right next to the username for some reason. I tried to fixed this myself but no success :/
- link:
- Forum link: http://camphalfblood.forumotion.eu/
@Ruzmarin in your viewtopic_body template find and replace this line :
with this :
Then replace your personal rank title script with this one :
- Code:
{postrow.displayed.POSTER_RANK}<br />
{postrow.displayed.RANK_IMAGE}{postrow.displayed.POSTER_AVATAR}<br /><br />
with this :
- Code:
<span class="rank_title">{postrow.displayed.POSTER_RANK}<br />
{postrow.displayed.RANK_IMAGE}{postrow.displayed.POSTER_AVATAR}</span><br /><br />
Then replace your personal rank title script with this one :
- Code:
$(function() {
'Personal Title - Give yourself your own personal title !';
'DEVELOPED BY ANGE TUTEUR';
'NO DISTRIBUTION WITHOUT CONSENT OF THE AUTHOR';
'ORIGIN : http://fmdesign.forumotion.com/t413-personal-rank-titles#3302';
var formatBBCode = true;
// editing of profile field
if (/\/profile|\/u\d+/.test(window.location.href)) {
for (var a = document.getElementsByTagName('TEXTAREA'), i = 0, j = a.length; i < j; i++) {
if (/class="fa_personal_title"/.test(a[i].value) && /profile_field/.test(a[i].id)) {
a[i].onfocus = function() {
this.value = this.value.replace(/\n|\r/g, '').replace(/\[table class="fa_personal_title"\]\[tr\]\[td\](.*?)\[\/td\]\[\/tr\]\[\/table\]/, '$1');
};
a[i].onblur = function() {
this.value = '[table class="fa_personal_title"][tr][td]' + this.value + '[/td][/tr][/table]';
};
}
}
}
// parsing in messages
else if (/\/t\d+/.test(window.location.href)) {
var version = $('.bodylinewidth')[0] ? 0 : document.getElementById('wrap') ? 1 : $('div.pun')[0] ? 2 : document.getElementById('ipbwrapper') ? 3 : 'badapple',
closest = ['.poster-profile', '.postprofile', '.user', '.postdetails'][version],
find = ['.rank_title', 'dt + dd', '.user-basic-info', 'dt + dd'][version],
a = $('.fa_personal_title'),
i = 0,
j = a.length,
node, str, title;
if (version == 'badapple') {
if (window.console && console.warn) console.warn('Your forum version is not supported for the "Personal Title" plugin.');
return;
}
for (; i < j; i++) {
title = $('td', a[i]);
title = formatBBCode ? title.html() : title.text();
if (title) {
node = $(a[i]).closest(closest).find(find);
str = '<span class="personal_title">' + title + '</span>';
node.append(str);
a[i].style.display = 'none';
}
}
}
});
- Ruzmarin
- Gender :
Age : 29
Posts : 381
Points : 3688
Reputation : 71
Language : Serbian, English
Browser : Forum Version :
It did the job, but here is this:
Title is visible
Title is visible
- Ruzmarin
- Gender :
Age : 29
Posts : 381
Points : 3688
Reputation : 71
Language : Serbian, English
Browser : Forum Version :
@Ange Tuteur You might wanna change this line boo
to this
I tried other selectors but this was the only one that really works fr.
Because when a user uses the
BBCode for title stylization, the
selector is picking up the text from the
element within the
and the one within itself (that the user entered in the textarea on their profile).
- Code:
title = $('td', a[i]);
to this
- Code:
title = $(a[i]).children('tbody').children('tr').children('td');
I tried other selectors but this was the only one that really works fr.
Because when a user uses the
|
|
|
|
First i tried the code of tutorial.
I've changed JavaScript, post in this message
https://fmdesign.forumotion.com/t413-personal-rank-titles#7536
I did not get results http://prntscr.com/elozon
http://antenadogames.forumeiros.com
I've changed JavaScript, post in this message
https://fmdesign.forumotion.com/t413-personal-rank-titles#7536
I did not get results http://prntscr.com/elozon
http://antenadogames.forumeiros.com
@Harleen try the script below instead :
I'll need to update the first post to support FAE.
- Code:
$(function() {
'Personal Title - Give yourself your own personal title !';
'DEVELOPED BY ANGE TUTEUR';
'NO DISTRIBUTION WITHOUT CONSENT OF THE AUTHOR';
'ORIGIN : http://fmdesign.forumotion.com/';
// editing of profile field
if (/\/profile|\/u\d+/.test(window.location.href)) {
for (var a = document.getElementsByTagName('TEXTAREA'), i = 0, j = a.length; i < j; i++) {
if (/class="fa_personal_title"/.test(a[i].value) && /profile_field/.test(a[i].id)) {
$(a[i]).focus(function() {
this.value = this.value.replace(/\n|\r/g, '').replace(/\[table class="fa_personal_title"\]\[tr\]\[td\](.*?)\[\/td\]\[\/tr\]\[\/table\]/, '$1');
});
$(a[i]).blur(function() {
if (/\[url|!important|founder|administrator|moderator|graphic designer|fmd-admin|fmd-modo|fmd-desi/ig.test(this.value)) {
alert('A word in your title has been forbidden from use as a personal title. Please choose a different title.');
this.value = '';
}
this.value = '[table class="fa_personal_title"][tr][td]' + this.value + '[/td][/tr][/table]';
});
}
}
}
// parsing in messages
else if (/\/t\d+/.test(window.location.href)) {
var html = true,
a = $('.fa_personal_title'),
i = 0,
j = a.length,
node, str, title;
for (; i < j; i++) {
title = $('td', a[i]).eq(0).filter(function() {
return html ? $(this).html() : $(this).text();
});
if (title) {
$(a[i]).hide().closest('.postprofile').find('.rank-title').append($('<span class="personal_title" />').filter(function() {
return html ? $(this).html(title) : $(this).text(title);
}));
}
}
}
});
I'll need to update the first post to support FAE.
- 1337ExodusNew Member
- Gender :
Posts : 1
Points : 2820
Reputation : 1
Language : English, French, Dovahzul
Browser : Forum Version :
I followed all the steps correctly but i'm getting a persistant problem with it displaying correctly.
As you can see from the link below, the rank is displaying where it is supposed to. Its after the achievement profile.
I would appreciate it if someone can help me fix this please. Thanks in advance.
http://necrofinitygaming.forumotion.com/t6-new-topic-testing
As you can see from the link below, the rank is displaying where it is supposed to. Its after the achievement profile.
I would appreciate it if someone can help me fix this please. Thanks in advance.
http://necrofinitygaming.forumotion.com/t6-new-topic-testing
Hi @1337Exodus,
It looks like an issue with modernbb, I've made some optimizations for it. Try the script below instead.
P.S.
I updated the script in the first post, with optimizations for Modernbb and Forumactif Edge.
It looks like an issue with modernbb, I've made some optimizations for it. Try the script below instead.
- Code:
$(function() {
'Personal Title - Give yourself your own personal title !';
'DEVELOPED BY ANGE TUTEUR';
'NO DISTRIBUTION WITHOUT CONSENT OF THE AUTHOR';
'ORIGIN : http://fmdesign.forumotion.com/t413-personal-rank-titles#3302';
var formatBBCode = true;
// editing of profile field
if (/\/profile|\/u\d+/.test(window.location.href)) {
for (var a = document.getElementsByTagName('TEXTAREA'), i = 0, j = a.length; i < j; i++) {
if (/class="fa_personal_title"/.test(a[i].value) && /profile_field/.test(a[i].id)) {
a[i].onfocus = function() {
this.value = this.value.replace(/\n|\r/g, '').replace(/\[table class="fa_personal_title"\]\[tr\]\[td\](.*?)\[\/td\]\[\/tr\]\[\/table\]/, '$1');
};
a[i].onblur = function() {
this.value = '[table class="fa_personal_title"][tr][td]' + this.value + '[/td][/tr][/table]';
};
}
}
}
// parsing in messages
else if (/\/t\d+/.test(window.location.href)) {
var version = $('.bodylinewidth')[0] ? 0 : document.getElementById('phpbb') ? 1 : $('div.pun')[0] ? 2 : document.getElementById('ipbwrapper') ? 3 : document.getElementById('modernbb') ? 4 : document.getElementById('fa_edge') ? 5 : 'badapple',
closest = ['.poster-profile', '.postprofile', '.user', '.postdetails', '.postprofile', '.postprofile'][version],
find = ['br:first', 'dt + dd', '.user-basic-info', 'dt + dd', '.postprofile-rank', '.rank-title'][version],
a = $('.fa_personal_title'),
i = 0,
j = a.length,
node, str, title;
if (version == 'badapple') {
if (window.console && console.warn) console.warn('Your forum version is not supported for the "Personal Title" plugin.');
return;
}
for (; i < j; i++) {
title = $('td', a[i]).eq(0);
title = formatBBCode ? title.html() : title.text();
if (title) {
node = $(a[i]).closest(closest).find(find);
str = '<span class="personal_title">' + title + '</span>';
version == 0 ? node.before(str) : node.append(str);
a[i].style.display = 'none';
}
}
}
});
P.S.
I updated the script in the first post, with optimizations for Modernbb and Forumactif Edge.
- T.C.Member
- Gender :
Posts : 22
Points : 2608
Reputation : 4
Language : English
Browser : Forum Version :
Mine works, however it doesn't do the automatic wrapped in tags when you type it into the box. It is just plain black text that lines up with the profile info rather than in the center. I left the following true?
- Code:
var formatBBCode = true;
- Sponsored content
Similar topics
Create an account or log in to leave a reply
You need to be a member in order to leave a reply.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum