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 49 users online :: 0 Registered, 0 Hidden and 49 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 2 of 3 • Share
Page 2 of 3 • 1, 2, 3
First topic message reminder :
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 !
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.
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
- paylos25Member
- Gender :
Posts : 12
Points : 2936
Reputation : 0
Language : greek
Browser : Forum Version :
i dont understand.. my english is litle sorry
- paylos25Member
- Gender :
Posts : 12
Points : 2936
Reputation : 0
Language : greek
Browser : Forum Version :
nothing!!
- paylos25Member
- Gender :
Posts : 12
Points : 2936
Reputation : 0
Language : greek
Browser : Forum Version :
yes
I just tested this code on my forum using the Console and it worked.. Um.. Maybe try completely deleting this script off of your JS Management and then reinstalling it with the correct placement.
If that doesn't work the original code might have to be modified a bit to fit your forum templates..
If that doesn't work the original code might have to be modified a bit to fit your forum templates..
- paylos25Member
- Gender :
Posts : 12
Points : 2936
Reputation : 0
Language : greek
Browser : Forum Version :
i try but nothing..
@paylos25 I see the script is on your forum now, which is good. We're one step closer.
Did you follow the instructions below ?
Did you follow the instructions below ?
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."
- paylos25Member
- Gender :
Posts : 12
Points : 2936
Reputation : 0
Language : greek
Browser : Forum Version :
hello.. thanks for the help me,, but i have all enable...
here its pictures
here its pictures
- paylos25Member
- Gender :
Posts : 12
Points : 2936
Reputation : 0
Language : greek
Browser : Forum Version :
i change and this and nothing.
@paylos25 if the solution SLG posted above doesn't work, would you be willing to provide me an account on the forum that has administration privileges via PM ? It'd allow me to figure out why this isn't working for you, directly. I know it'd be a lot easier considering the language barrier. Let me know.
- GuestGuest
Installed. Works fine with Edge.
- NeonSynthNew Member
- Gender :
Posts : 7
Points : 2910
Reputation : 0
Language : German & English
Browser : Forum Version :
Is there a code snippet that only enables it for certain user groups though? Because this one suits my needs perfectly but I have an user group which I move new users into for various reasons. I hope this is possible... >_< If not, then it's fine but it would've been cool if it wasn't for the normal members.
https://fmdesign.forumotion.com/t411-how-to-install-the-code-snippet-button#14440NeonSynth wrote:Is there a code snippet that only enables it for certain user groups though? Because this one suits my needs perfectly but I have an user group which I move new users into for various reasons. I hope this is possible... >_< If not, then it's fine but it would've been cool if it wasn't for the normal members.
- NeonSynthNew Member
- Gender :
Posts : 7
Points : 2910
Reputation : 0
Language : German & English
Browser : Forum Version :
Yeah thank you, it's not supposed to be for just admins though Only 2 usergroups should be left out
- GuestGuest
Try this:
In the original code, find:
and have it replaced with:
where x, y and z represent the group numbers (IDs), groups that are allowed to see the data. You can add more if needed, ofc. What it does is, it 'll check if each of one of the conditions are met (|| means OR, && means AND). So, if a member is in any of groups x, y or z it will display the data. You can find the group IDs in your ACP > Modules > Groups. Your Admin group will most likely have ID 1, moderators ID 2, and so on. Just make sure you leave the two specific groups you mentioned out.
Samantha.
In the original code, find:
- Code:
if (origin.data('ajax') !== 'cached')
and have it replaced with:
- Code:
if (origin.data('ajax') !== 'cached' && _userdata.user_level == x || _userdata.user_level == y || _userdata.user_level == z)
where x, y and z represent the group numbers (IDs), groups that are allowed to see the data. You can add more if needed, ofc. What it does is, it 'll check if each of one of the conditions are met (|| means OR, && means AND). So, if a member is in any of groups x, y or z it will display the data. You can find the group IDs in your ACP > Modules > Groups. Your Admin group will most likely have ID 1, moderators ID 2, and so on. Just make sure you leave the two specific groups you mentioned out.
Samantha.
- NeonSynthNew Member
- Gender :
Posts : 7
Points : 2910
Reputation : 0
Language : German & English
Browser : Forum Version :
The script itself works, but it still shows up for the groups it's not supposed to. :/
Here's what I basically did:
Here's what I basically did:
- Code:
if (origin.data('ajax') !== 'cached' && _userdata.user_level == 1 || _userdata.user_level == 2 || _userdata.user_level == 3 || _userdata.user_level == 4 || _userdata.user_level == 5 || _userdata.user_level == 8) {
- GuestGuest
Then, the account you tested with is probably a member of one of the groups that are allowed to see the data as well. So, a member of one of the groups that are not allowed AS WELL as a member of one of the groups that can (member of at least 2 groups). Can you confirm?
If so, you could try this:
!= means NOT equals
== means equals
which indicates, whatever (combined) group membership the account has, if in either group ID 6 or 7, it won't show data.
If so, you could try this:
- Code:
if (origin.data('ajax') !== 'cached' && _userdata.user_level != 6 || _userdata.user_level != 7) {
!= means NOT equals
== means equals
which indicates, whatever (combined) group membership the account has, if in either group ID 6 or 7, it won't show data.
- NeonSynthNew Member
- Gender :
Posts : 7
Points : 2910
Reputation : 0
Language : German & English
Browser : Forum Version :
Ooooh I think we were talking at cross-purpose Alright, what I meant wasn't the permission on who can see the preview, I just wanted 2 usergroups to NOT preview on the legend (i.e. banned and normal member usergroup).
OT: Just in case a question might come up, the "normal member" usergroup is a group I manually move new users into. This has its reasons, because of FMs' permission limitations.
OT: Just in case a question might come up, the "normal member" usergroup is a group I manually move new users into. This has its reasons, because of FMs' permission limitations.
- GuestGuest
I'm really not sure no more what it is exactly you're asking. I feel confused. Banned users based on IP address in general won't be able to see your site, so if you banned several users based on their username or e-mail address you'll need to add 'guests' to that line I gave you. 'Guests' are actually sessions that are not logged in: !_userdata.session_logged_in. And again, '!' means 'not'.
So, that code will do something if they're logged in and not a member of group IDs 6 or 7.
If that's not what you wanted, perhaps you should add some screenshots to your next post and add your site URL to your profile to get a better understanding of what you want. I'm trying to give you solutions here based on the plug-in, not based on phpBB2.
- Code:
if (origin.data('ajax') !== 'cached' && !_userdata.session_logged_in || _userdata.user_level != 6 || _userdata.user_level != 7)
So, that code will do something if they're logged in and not a member of group IDs 6 or 7.
If that's not what you wanted, perhaps you should add some screenshots to your next post and add your site URL to your profile to get a better understanding of what you want. I'm trying to give you solutions here based on the plug-in, not based on phpBB2.
- NeonSynthNew Member
- Gender :
Posts : 7
Points : 2910
Reputation : 0
Language : German & English
Browser : Forum Version :
I'm sorry, I shoulda been more clear... lemme try:
I have these usergroups:
[ Band ] [ Surveillance Squad ] [ Artists ] [ DJs ] [ Chat Mods ] [ VIPs ] [ Outcasts ] [ Recruits ]
"Outcasts" are the banned people. Technically they're not banned, they just can see a certain subforum in which they can apologize to the staff to eventually get a second chance. Depending on severity they get the actual real banned status.
"Recruits" are the normal users. When someone registers, they are technically normal members. But due to Forumotion limitations, I had to make another usergroup in which I move a newly registered user.
Okay, so... I want the groups to preview when hovering the mouse over them, EXCEPT for when I hover above Outcasts and Recruits. I hope it's clear anough now. ^_^
I have these usergroups:
[ Band ] [ Surveillance Squad ] [ Artists ] [ DJs ] [ Chat Mods ] [ VIPs ] [ Outcasts ] [ Recruits ]
"Outcasts" are the banned people. Technically they're not banned, they just can see a certain subforum in which they can apologize to the staff to eventually get a second chance. Depending on severity they get the actual real banned status.
"Recruits" are the normal users. When someone registers, they are technically normal members. But due to Forumotion limitations, I had to make another usergroup in which I move a newly registered user.
Okay, so... I want the groups to preview when hovering the mouse over them, EXCEPT for when I hover above Outcasts and Recruits. I hope it's clear anough now. ^_^
- GuestGuest
That's someting totally different. I think I could come up with something for that, but a far better, faster and more practical way would be to HIDE the two groups. There's an option in the ACP's group administration for that. It allows you to hide a group from any of view on a per group basis. You'll still be able to administrate the groups.
- Sponsored content
Page 2 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 2 of 3
Permissions in this forum:
You cannot reply to topics in this forum