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 19 users online :: 0 Registered, 0 Hidden and 19 Guests :: 2 Bots
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
Display a Preview of Groups on Hover
Page 1 of 3 • Share
Page 1 of 3 • 1, 2, 3
This plugin displays a preview of groups when you hover over them on the legend, allowing you to quickly view a brief summary of the group.
Note : For this plugin to work you must have the following option enabled.
Admin Panel > General > Messages > Configuration and enable the options entitled "Allow username tag" and "Activate the preview of profiles on the tag usernames." This plugin is optimized to work on any forum version, so if it doesn't work for you please leave a reply below with the URL to your forum.
To install this plugin, go to Admin Panel > Modules > JavaScript codes management and create a new script with the following settings.
Title : Group Preview
Placement : In the homepage
Paste the following code :
Modifications
If you want to make any modifications to this plugin, please click the spoiler below to reveal the instructions.
Once you're finishing making modifications, save the script and the plugin will be installed. Now when you hover the group links on the homepage, a preview of the group should pop up !
If you have any comments, questions, or problems, feel free to leave a reply below. Enjoy !
Click to view demo |
Note : For this plugin to work you must have the following option enabled.
Admin Panel > General > Messages > Configuration and enable the options entitled "Allow username tag" and "Activate the preview of profiles on the tag usernames." This plugin is optimized to work on any forum version, so if it doesn't work for you please leave a reply below with the URL to your forum.
Installation
To install this plugin, go to Admin Panel > Modules > JavaScript codes management and create a new script with the following settings.
Title : Group Preview
Placement : In the homepage
Paste the following code :
- Code:
$(function() {
var max_users = 10, // max number of users
// language data
lang = {
view_group : 'View the full group',
loading : 'Loading...',
view_err : 'The group data could not be retrieved.'
},
links = $('a[href^="/g"]').filter(function() {
if (/\/g\d+-/.test(this.href)) {
return this;
}
}),
groupsinfo = {};
links.tooltipster && links.not('.tooltipstered').tooltipster({
animation : 'fade',
interactive : true,
contentAsHTML : true,
minWidth : 300,
maxWidth : 300,
delay : 500,
theme : 'tooltipster-default',
arrowColor : "#EEE",
autoClose : true,
content : lang.loading,
functionBefore : function(origin, continueTooltip) {
continueTooltip();
var groupURL = $(this).attr('href'),
groupId = groupURL.replace(/.*?\/g(\d+).*/, '$1'),
groupName = $(this).text();
if (origin.data('ajax') !== 'cached') {
if (groupsinfo[groupId] != undefined) {
origin.tooltipster('content', groupsinfo[groupId]).data('ajax', 'cached');
} else {
$.get(groupURL, function(d) {
var user = $('form[action="' + groupURL + '"] a[href^="/u"]', d),
i = 0,
li,
container = $('<div>'+
'<div class="fa_group_preview">'+
'<h2 class="fa_group_name">' + groupName + '</h2>'+
'<p class="fa_group_desc">' + $('form[action^="/g"]', d).find('dl:eq(1) dd, tr:eq(2) td.row2 .gen').text() + '</p>'+
'<ol class="fa_group_list"></ol>'+
'<div class="fa_group_button">'+
'<a href="' + groupURL + '" class="button1">' + lang.view_group + '</a>'+
'</div>'+
'</div>'+
'</div>');
for (; i < max_users; i++) {
if (user[i]) {
li = document.createElement('LI');
li.appendChild(user[i]);
$('ol', container).append(li);
}
}
if (!$('li', container).length) {
$('ol', container).after('<div>' + lang.view_err + '</div>');
}
groupsinfo[groupId] = container.html();
origin.tooltipster('content', groupsinfo[groupId]).data('ajax', 'cached');
});
}
}
}
});
$('head').append(
'<style type="text/css">'+
'.fa_group_preview { font-family:Arial; font-size:12px; color:#000; }'+
'.fa_group_preview a { text-decoration:none; }'+
'h2.fa_group_name { font-size:24px; }'+
'p.fa_group_desc, h2.fa_group_name { margin:10px 0 10px 0; }'+
'ol.fa_group_list { margin:0 25px; padding:0; }'+
'.fa_group_button { margin-top:10px; text-align:center; }'+
'</style>'
);
});
Modifications
If you want to make any modifications to this plugin, please click the spoiler below to reveal the instructions.
- Click to view modifications:
- 1. max_users
The max_users variable allows you to modify the amount of group members that are shown in the preview. By default 10 members are shown, if you want more or less members shown, simply modify the number for this variable.- Code:
var max_users = 10, // max number of users
2. lang
If you want to make any modifications to the texts that appear in this plugin, modify the texts in the lang object :- Code:
// language data
lang = {
view_group : 'View the full group',
loading : 'Loading...',
view_err : 'The group data could not be retrieved.'
},
Once you're finishing making modifications, save the script and the plugin will be installed. Now when you hover the group links on the homepage, a preview of the group should pop up !
If you have any comments, questions, or problems, feel free to leave a reply below. Enjoy !
Notice |
Tutorial written by @Ange Tuteur. Special thanks to Samantha for the idea and to the Beta Testers for testing this plugin. Reproduction not permitted without consent from the author. |
Last edited by Ange Tuteur on Wed 14 Sep 2016, 13:53; edited 3 times in total
Milouze14 likes this post
- JoostMember
- Gender :
Age : 33
Posts : 16
Points : 3182
Reputation : 4
Location : The Netherlands
Language : Dutch
Browser : Forum Version :
Nice!
This is not working with the Forumactif Edge, i see not the preview..
This is not working with the Forumactif Edge, i see not the preview..
- IsmaelS.New Member
- Gender :
Age : 29
Posts : 4
Points : 3027
Reputation : 7
Language : Portugal
Browser : Forum Version :
Very nice this dude, thank you! ;D
not working on most of my forums for some reason, works great in my Gokart Forum?
Weird thing i updated my test forum with the beta forum script and now the display is working?
Can PM you links if needed.
Weird thing i updated my test forum with the beta forum script and now the display is working?
Can PM you links if needed.
- ShagoNew Member
- Gender :
Age : 48
Posts : 7
Points : 3147
Reputation : 3
Location : France
Language : French
Browser : Forum Version :
Bonsoir à tous,
Super, merci !
Comment changer la couleur du fond ?
Merci beaucoup pour la réponse et pour tout le travail effectué
Super, merci !
Comment changer la couleur du fond ?
Merci beaucoup pour la réponse et pour tout le travail effectué
@skouliki @IsmaelS. @jessy @Michael_vx You're welcome ! ^^
@Joost @BlackScorpion I'm sorry, I forgot to add this portion to the tutorial :
This tutorial might interest you. See "theme" under the section "Modifications" for changing the color of the tooltip. It will work for this tutorial as well.
@Joost @BlackScorpion I'm sorry, I forgot to add this portion to the tutorial :
It's added now. If it still doesn't work after this let me know.Note : For this plugin to work you must have the following option enabled.
Admin Panel > General > Messages > Configuration and enable the option entitled "Activate the preview of profiles on the tag usernames."
Hi !Shago wrote:Bonsoir à tous,
Super, merci !
Comment changer la couleur du fond ?
Merci beaucoup pour la réponse et pour tout le travail effectué
This tutorial might interest you. See "theme" under the section "Modifications" for changing the color of the tooltip. It will work for this tutorial as well.
- ShagoNew Member
- Gender :
Age : 48
Posts : 7
Points : 3147
Reputation : 3
Location : France
Language : French
Browser : Forum Version :
Ange Tuteur wrote:@skouliki @IsmaelS. @jessy @Michael_vx You're welcome ! ^^
@Joost @BlackScorpion I'm sorry, I forgot to add this portion to the tutorial :It's added now. If it still doesn't work after this let me know.Note : For this plugin to work you must have the following option enabled.
Admin Panel > General > Messages > Configuration and enable the option entitled "Activate the preview of profiles on the tag usernames."Hi !Shago wrote:Bonsoir à tous,
Super, merci !
Comment changer la couleur du fond ?
Merci beaucoup pour la réponse et pour tout le travail effectué
This tutorial might interest you. See "theme" under the section "Modifications" for changing the color of the tooltip. It will work for this tutorial as well.
Merci !!!
- MateusAnjosVNew Member
- Gender :
Posts : 1
Points : 3009
Reputation : 1
Language : Português
Browser : Forum Version :
Magnificent! Thank you for providing this excellent code to members of my forum!
Actually you need to activate
1) Allow username tag
2) Activate the preview of profiles on the tag username. " Although this one was already enabled,"
This is how i got it to work for me.
1) Allow username tag
2) Activate the preview of profiles on the tag username. " Although this one was already enabled,"
This is how i got it to work for me.
- JoostMember
- Gender :
Age : 33
Posts : 16
Points : 3182
Reputation : 4
Location : The Netherlands
Language : Dutch
Browser : Forum Version :
Thanks, it's works!
Ooooh I forgot about that, thanks for reminding me. ^^BlackScorpion wrote:Actually you need to activate
1) Allow username tag
2) Activate the preview of profiles on the tag username. " Although this one was already enabled,"
This is how i got it to work for me.
@Ange Tuteur
- Code:
var groupURL = $(this).attr('href'),
groupId = groupURL.replace(/.*?\/g(\d+).*/, '$1'), // What exactly is this line doing?
groupName = $(this).text();
@Ace 1 it gets the group id so that it can be used as a key to cache data temporarily to an object. Basically it's stripping out the unnecessary data and capturing the digit in the string. Run this in the console and it'll return "2" :
- Code:
'http://fmdesign.forumotion.com/g2-administrators'.replace(/.*?\/g(\d+).*/, '$1'); // 2
Yep, the () capturing parentheses are useful for, well, capturing values in strings. I'm not sure if you looked at regular expressions yet, but this'll explain a ton :
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
I go back to that page sometimes in case I forget what something does.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
I go back to that page sometimes in case I forget what something does.
- paylos25Member
- Gender :
Posts : 12
Points : 2936
Reputation : 0
Language : greek
Browser : Forum Version :
good morning..I did everything but not functioned!!
- paylos25Member
- Gender :
Posts : 12
Points : 2936
Reputation : 0
Language : greek
Browser : Forum Version :
- paylos25Member
- Gender :
Posts : 12
Points : 2936
Reputation : 0
Language : greek
Browser : Forum Version :
i put now but nothing...
- paylos25Member
- Gender :
Posts : 12
Points : 2936
Reputation : 0
Language : greek
Browser : Forum Version :
- Sponsored content
Page 1 of 3 • 1, 2, 3
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 3
Permissions in this forum:
You cannot reply to topics in this forum