We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Group Forum Moderators
Topic Started: Jul 6 2012, 09:27 AM (1,323 Views)
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code Name: Group Forum Moderators

What the code does: When you add forums to moderate for groups, the information is not added to the Administration and Moderator List, with this code you can add that information.

Preview

How to use the code: The following is all you need to edit.
Code:
 
addGroup('GROUP_NAME', 'GROUP_ID', 'HTML_BEFORE', 'HTML_AFTER');

addForums('GROUP_NAME', 'FORUM_NAME', 'FORUM_ID');

  • GROUP_NAME: The name of the group that moderates forums that you wish to add to the Administration and Moderator List.
  • GROUP_ID: The ID of the group you are adding. The Group ID can be retrieved via the member list by selecting a group from the 'Displaying' drop down menu, the &group= number found in the address bar is the Group ID.
  • HTML_BEFORE: HTML added before the group name, used for styling.
  • HTML_AFTER: HTML added after the group name, used for styling.
  • GROUP_NAME: The group name you wish to add 'Moderator of' forums.
  • FORUM_NAME: The forum name the group moderates.
  • FORUM_ID: The forum ID the group moderates.
Both lines found above in the code can be repeated endlessly to perform the action once again.

How to install the code:

Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
//<![CDATA[
$(function() {
if (location.href.indexOf('/stats/staff') !== -1) {
var gmHTML = '<br /><table cellspacing="0" id="group_leaders"><thead><tr><th colspan="4">Group Forum Moderators</th></tr></thead><tbody><tr><th>Group Name</th><th>Moderator of</th></tr></tbody></table>';

if ($('#forum_leaders').length) {
$('#forum_leaders').after(gmHTML);
} else {
$('table[id="forum_leaders_global"]:last').after(gmHTML);
}

function addGroup(groupName, groupID, htmlBefore, htmlAfter) {
$('#group_leaders').append('<tr><td class="group"><a href="' + main_url + 'members/?group=' + groupID + '">' + htmlBefore + '' + groupName + '' + htmlAfter + '</a></td><td style="text-align: center" class="forums_to_moderate"></td></tr>');
}

function addForums(groupName, forumName, forumID) {
$('#group_leaders tbody tr').each(function() {
if ($(this).find('td.group').text() === groupName) $(this).find('td.forums_to_moderate').append('<a href="' + main_url + 'forum/' + forumID + '/">' + forumName + '</a>');
});
}

addGroup('GROUP_NAME', 'GROUP_ID', 'HTML_BEFORE', 'HTML_AFTER');

addForums('GROUP_NAME', 'FORUM_NAME', 'FORUM_ID');

$('#group_leaders td.forums_to_moderate').each(function() {
$(this).find('a:not(:last)').after(', ');
});
}
});
//]]>
</script>
Edited by Cory, Oct 30 2016, 12:38 AM.
Online Profile Quote Post Goto Top
 
Leon.
Member Avatar
Member
[ *  *  *  * ]
Awesome :wub: Thanks :up:
Edited by Leon., Jul 6 2012, 09:32 AM.
Offline Profile Quote Post Goto Top
 
Geoffrey
Member Avatar
bury hatchets, keep maps
[ *  *  *  *  * ]
That's amazing, thanks Cory! I'm sure this will help many boards. :)
Offline Profile Quote Post Goto Top
 
Hileville-ZNR
Member Avatar
Member
[ * ]
Awesome code. I will be installing it tonight.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply