Working sourcebans system (yes, you need MySQL server and web server with PHP). Currently supported versions 1.4.* (and 1.5.0 for sourcebans plugin). Integration into sourcebans 2.0 currently in development.
SM version 1.5.0-hg3761 or higher
SourceMod version 1.5.3 or 1.6 is required to compile the plugin (compiled plugin also works on sm 1.5)
Plugin based on ExtendedComms (Twisted|Panda) & SourceBans (SourceBans Development Team) plugins. Thanks them for code and idea. :wink:
Features:
Provides a straightforward category in the sm_admin menu where administrators can punish players as well as view current comm punishments.
The original BaseComm menu option still exist, and will still function. SourceComms plugin support storing history of punishments from BaseComm and another plugins
The category provides options for issuing new punishments, removing and viewing current punishments (categorized based on the punishment), as well as a List feature that provides information about current punishments.
The category also modifies the player's names in all of the options to show what their current punishment is. [ ] = None, [G] = Gagged, [M] = Muted, [S] = Silenced. I used Twisted|Panda menu code :oops:
All punishments (temporary, extended or permanent) are saved in MySQL database and are automatically reapplied (except temporary) when the punished player connects to the server. This allows punishments to be applied across multiple servers.
Extended punishments will automatically expire in-game at the designated time.
Permanent punishments remain on the player until an administrator removes them.
If the server has problems with access to the database, the punishments will store in SQLite database and would be added in the main database when connection is restored. (like in sourcebans plugin, yes)
Also you could apply punishments to multi-targets (such as `@all`, `@ct`, `@blue`, etc...)
Multi-target punishments will not be saved in db.
Removing punishments from multi-targets will removed punishments temporary (not from db).
Allowed session (temporary) punishments and extended with length less than 30 minutes and less than DefaultTime setting.
Permanent multi-target punishments is not available.
SourceComms has support for protecting current punishments based on immunity levels.
When a punishment is issued, the administrator responsible has their immunity level attached to the punishment. In order to remove that punishment, the second administrator must have higher immunity level or special admin flag (ADMFLAG_CUSTOM2 by default. You may change it in sourcecode). Also, punishment can be removed by console or his author.
Punishments issued by CONSOLE has some immunity level (which is set in config).
Immunity checking system could be disabled by setting "DisableUnblockImmunityCheck" to value 1 in config file.
One more important moment. When somebody removes punishment - plugin retrieves "punishment issuer admin id" from database. If the request fails - punishment could be temporary removed (on server, not in database) only by console, admin with special flag or with higher immunity.
Plugin has Servers White List feature. If enabled, plugin will apply on players punishments only from current server or servers listed in White List.
Punishments reasons and times stored in config. More details about config listed below.
Full punishments history (includes time, server, admin, reason, block length, comments, etc)
Showing type of block as icon in first column
Showing count of other blocks for this player (steam-id) at the right end of 'Player Name' column (This allows you to quickly identify regular offenders)
Admins with necessary rights could edit, delete blocks, and also "ungag" or "umnute" (like unban) player.
If the block is still in effect, during unblocking or deleting, web-part sends command for ungag or unmute player to all servers
Search field for quick punishments search on all pages and advanced search options on Comms page.
Admin-page 'Comms' for adding new punishments.
Command 'Block comms' in player context menu on servers page (sweet :) )
Commands:
The time parameter controls how long the player is punished. (< 0 == Temporary, 0 == Permanent, # == Minutes). If not specified it will be "DefaultTime" minutes (30 by default)
The player parameter could be Name (only as single word, without whitespaces), UserID (`#127`) or *magic* targets (like `@all` or `@red`). Look at sourcemod wiki for more details about targets.
sm_comms
Shows to player their communications status. (Also may used in chat)
Removes a player's ability to use in-game voice and chat.
sm_unmute <player> <optional:reason>
Restores a player's ability to use in-game voice.
sm_ungag <player> <optional:reason>
Restores a player's ability to use in-game chat.
sm_unsilence <player> <optional:reason>
Restores a player's ability to use in-game voice and chat.
Cvars:
sourcecomms_version - plugin version
Config settings:
DefaultTime. When admin run sm_gag (mute, silence) command only with player name - player will be gagged on DefaultTime value minutes. (if DefaultTime setted in -1 -> player will be blocked only on session (until reconnect)). Value 0(permanent)is not allowed.
DisableUnblockImmunityCheck (0, 1). Default value is 0. If setted to 1, player can be ungagged only by issuer admin, console or admin with special flag. Also, If 0 player maybe unblocked by Admin with higher immunity level than issuer admin had.
ConsoleImmunity. Default value is 0. Immunity Level of server console.
MaxLength, which works following way: Plugin will hide (for admins without ADMFLAG_CUSTOM 2) from menu all durations more than MaxLength and restricts punishments commands with time > MaxLength argument (or permanent).
OnlyWhiteListServers. Default value is 0. Set this option to 1 to applying on players punishments only from this server and servers listed in WhiteList. Value 0 applies on players punishments from any server.
Installation instructions Installation of server part
A sourcecomms-srv.zip file that provide all the necessary files, which can simply be extracted to your SourceMod directory. However, this is where the files go:
Code:
- sourcecomms.smx into /sourcemod/plugins/
- sourcecomms.phrases.txt into /sourcemod/translations/
- sourcecomms.cfg into /sourcemod/configs/sourcebans/
You need to add database record "sourcecomms" to your /sourcemod/configs/databases.cfg
Database Config (sample):
Installation of database part
Execute the following query below (but first - check your table prefix!! replace sb to yours, if you uses another) on your sourcebans database:
Also, you could import attached sb_comms.sql.txt file instead of copying code from this post.
After this, If you want to import punishments from ExtendedComm plugin, execute folowing queries on your sourcebans database (check sourcebans table prefix and extendedcomm table name. If you have different prefix or table_name - replace their in code below to your values. if extendedcomm table is in a different database - replace in code below extendedcomm to 'database_with_table'.'name_of_extendedcomm_t able'):
Code:
INSERT INTO sb_comms (authid, name, created, length, ends, reason, type) SELECT steam_id, "", mute_time, mute_length, mute_time+mute_length, mute_reason, 1 FROM extendedcomm WHERE (mute_type='1' OR mute_type='2');
INSERT INTO sb_comms (authid, name, created, length, ends, reason, type) SELECT steam_id, "", gag_time, gag_length, gag_time+gag_length, gag_reason, 2 FROM extendedcomm WHERE (gag_type='1' OR gag_type='2');
Also, you could import attached import.sql.txt file instead of copying code from this post.
Installation of Web part
Place files from sourcecomms-web.zip archive to your sourcebans web folder. Then you need to edit a few files (make backup before you doing this!!!) Instructions for edit are placed in files_to_edit.txt or under spoiler below
Spoiler
Code:
\filepath\filename
At line XXX -- code on this line for simple search --
Add AFTER/BEFORE/REPLACE
New code here
------------------------------------------------------------------------------------------------------------------------------------
\includes\admin.php
At line 315 -- elseif($_GET['c'] == "mods") --
Add BEFORE
elseif($_GET['c'] == "comms")
// ###################[ Comms ]##################################################################
{
CheckAdminAccess( ADMIN_OWNER|ADMIN_ADD_BAN|ADMIN_EDIT_OWN_BANS|ADMIN_EDIT_ALL_BANS );
if(!isset($_GET['o']))
{
// ====================[ ADMIN SIDE MENU START ] ===================
$banTabMenu = new CTabsMenu();
if($userbank->HasAccess(ADMIN_OWNER|ADMIN_ADD_BAN ) ) {
$banTabMenu->addMenuItem("Add a block", 0);
}
$banTabMenu->addMenuItem("Comms list", 1, "", "index.php?p=commslist",true);
$banTabMenu->outputMenu();
// ====================[ ADMIN SIDE MENU END ] ===================
include TEMPLATES_PATH . "/admin.comms.php";
if(isset($_GET['mode']) && $_GET['mode'] == "delete")
echo "<script>ShowBox('Ban Deleted', 'The ban has been deleted from SourceBans', 'green', '', true);</script>";
elseif(isset($_GET['mode']) && $_GET['mode']=="unban")
echo "<script>ShowBox('Player Unbanned', 'The Player has been unbanned from SourceBans', 'green', '', true);</script>";
RewritePageTitle("Comms");
}
elseif($_GET['o'] == 'edit')
{
$banTabMenu = new CTabsMenu();
$banTabMenu->addMenuItem("Back", 0,"", "javascript:history.go(-1);", true);
$banTabMenu->outputMenu();
include TEMPLATES_PATH . "/admin.edit.comms.php";
RewritePageTitle("Edit Block Details");
}
}
------------------------------------------------------------------------------------------------------------------------------------
\includes\page-builder.php
At line 38 -- case "servers": --
Add BEFORE
case "commslist":
RewritePageTitle("Communications Block List");
$page = TEMPLATES_PATH ."/page.commslist.php";
break;
------------------------------------------------------------------------------------------------------------------------------------
\includes\sb-callback.php
At line 2969 (end of file) -- ?> --
Add BEFORE
function AddBlock($nickname, $type, $steam, $length, $reason)
{
$objResponse = new xajaxResponse();
global $userbank, $username;
if(!$userbank->HasAccess(ADMIN_OWNER|ADMIN_ADD_BAN))
{
$objResponse->redirect("index.php?p=login&m=no_access", 0);
$log = new CSystemLog("w", "Hacking Attempt", $username . " tried to add a block, but doesnt have access.");
return $objResponse;
}
$steam = trim($steam);
$error = 0;
// If they didnt type a steamid
if(empty($steam))
{
$error++;
$objResponse->addAssign("steam.msg", "innerHTML", "You must type a Steam ID or Community ID");
$objResponse->addScript("$('steam.msg').setStyle('display', 'block');");
}
else if((!is_numeric($steam)
&& !validate_steam($steam))
|| (is_numeric($steam)
&& (strlen($steam) < 15
|| !validate_steam($steam = FriendIDToSteamID($steam)))))
{
$error++;
$objResponse->addAssign("steam.msg", "innerHTML", "Please enter a valid Steam ID or Community ID");
$objResponse->addScript("$('steam.msg').setStyle('display', 'block');");
}
else
{
$objResponse->addAssign("steam.msg", "innerHTML", "");
$objResponse->addScript("$('steam.msg').setStyle('display', 'none');");
}
if($error > 0)
return $objResponse;
$nickname = RemoveCode($nickname);
$reason = RemoveCode($reason);
if(!$length)
$len = 0;
else
$len = $length*60;
// prune any old bans
PruneComms();
$typeW = "";
switch ((int)$type)
{
case 1:
$typeW = "type = 1";
break;
case 2:
$typeW = "type = 2";
break;
case 3:
$typeW = "(type = 1 OR type = 2)";
break;
default:
$typeW = "";
break;
}
// Check if the new steamid is already banned
$chk = $GLOBALS['db']->GetRow("SELECT count(bid) AS count FROM ".DB_PREFIX."_comms WHERE authid = ? AND (length = 0 OR ends > UNIX_TIMESTAMP()) AND RemovedBy IS NULL AND ".$typeW, array($steam));
if(intval($chk[0]) > 0)
{
$objResponse->addScript("ShowBox('Error', 'SteamID: $steam is already blocked.', 'red', '');");
return $objResponse;
}
// Check if player is immune
$admchk = $userbank->GetAllAdmins();
foreach($admchk as $admin)
if($admin['authid'] == $steam && $userbank->GetProperty('srv_immunity') < $admin['srv_immunity'])
{
$objResponse->addScript("ShowBox('Error', 'SteamID: Admin ".$admin['user']." ($steam) is immune.', 'red', '');");
return $objResponse;
}
if((int)$type == 1 || (int)$type == 3)
{
$pre = $GLOBALS['db']->Prepare("INSERT INTO ".DB_PREFIX."_comms(created,type,authid,name,ends,length,reason,aid,adminIp ) VALUES
(UNIX_TIMESTAMP(),1,?,?,(UNIX_TIMESTAMP() + ?),?,?,?,?)");
$GLOBALS['db']->Execute($pre,array($steam,
$nickname,
$length*60,
$len,
$reason,
$userbank->GetAid(),
$_SERVER['REMOTE_ADDR']));
}
if ((int)$type == 2 || (int)$type ==3)
{
$pre = $GLOBALS['db']->Prepare("INSERT INTO ".DB_PREFIX."_comms(created,type,authid,name,ends,length,reason,aid,adminIp ) VALUES
(UNIX_TIMESTAMP(),2,?,?,(UNIX_TIMESTAMP() + ?),?,?,?,?)");
$GLOBALS['db']->Execute($pre,array($steam,
$nickname,
$length*60,
$len,
$reason,
$userbank->GetAid(),
$_SERVER['REMOTE_ADDR']));
}
$objResponse->addScript("ShowBlockBox('".$steam."', '".(int)$type."', '".(int)$len."');");
$objResponse->addScript("TabToReload();");
$log = new CSystemLog("m", "Block Added", "Block against (" . $steam . ") has been added, reason: $reason, length: $length", true, $kickit);
return $objResponse;
}
function PrepareReblock($bid)
{
$objResponse = new xajaxResponse();
$ban = $GLOBALS['db']->GetRow("SELECT name, authid, type, length, reason FROM ".DB_PREFIX."_comms WHERE bid = '".$bid."';");
// clear any old stuff
$objResponse->addScript("$('nickname').value = ''");
$objResponse->addScript("$('steam').value = ''");
$objResponse->addScript("$('txtReason').value = ''");
$objResponse->addAssign("txtReason", "innerHTML", "");
// add new stuff
$objResponse->addScript("$('nickname').value = '" . $ban['name'] . "'");
$objResponse->addScript("$('steam').value = '" . $ban['authid']. "'");
$objResponse->addScriptCall("selectLengthTypeReason", $ban['length'], $ban['type']-1, addslashes($ban['reason']));
$objResponse->addScript("SwapPane(0);");
return $objResponse;
}
function PrepareBlockFromBan($bid)
{
$objResponse = new xajaxResponse();
// clear any old stuff
$objResponse->addScript("$('nickname').value = ''");
$objResponse->addScript("$('steam').value = ''");
$objResponse->addScript("$('txtReason').value = ''");
$objResponse->addAssign("txtReason", "innerHTML", "");
$ban = $GLOBALS['db']->GetRow("SELECT name, authid FROM ".DB_PREFIX."_bans WHERE bid = '".$bid."';");
// add new stuff
$objResponse->addScript("$('nickname').value = '" . $ban['name'] . "'");
$objResponse->addScript("$('steam').value = '" . $ban['authid']. "'");
$objResponse->addScript("SwapPane(0);");
return $objResponse;
}
function PasteBlock($sid, $name)
{
$objResponse = new xajaxResponse();
global $userbank, $username;
$sid = (int)$sid;
if(!$userbank->HasAccess(ADMIN_OWNER|ADMIN_ADD_BAN))
{
$objResponse->redirect("index.php?p=login&m=no_access", 0);
$log = new CSystemLog("w", "Hacking Attempt", $username . " tried paste a block, but doesn't have access.");
return $objResponse;
}
require INCLUDES_PATH.'/CServerRcon.php';
//get the server data
$data = $GLOBALS['db']->GetRow("SELECT ip, port, rcon FROM ".DB_PREFIX."_servers WHERE sid = ?;", array($sid));
if(empty($data['rcon'])) {
$objResponse->addScript("$('dialog-control').setStyle('display', 'block');");
$objResponse->addScript("ShowBox('Error', 'No RCON password for server ".$data['ip'].":".$data['port']."!', 'red', '', true);");
return $objResponse;
}
$r = new CServerRcon($data['ip'], $data['port'], $data['rcon']);
if(!$r->Auth())
{
$GLOBALS['db']->Execute("UPDATE ".DB_PREFIX."_servers SET rcon = '' WHERE sid = ?;", array($sid));
$objResponse->addScript("$('dialog-control').setStyle('display', 'block');");
$objResponse->addScript("ShowBox('Error', 'Wrong RCON password for server ".$data['ip'].":".$data['port']."!', 'red', '', true);");
return $objResponse;
}
$ret = $r->rconCommand("status");
$search = preg_match_all(STATUS_PARSE,$ret,$matches,PREG_PATTERN_ORDER);
$i = 0;
$found = false;
$index = -1;
foreach($matches[2] AS $match) {
if($match == $name) {
$found = true;
$index = $i;
break;
}
$i++;
}
if($found) {
$steam = $matches[3][$index];
$name = $matches[2][$index];
$objResponse->addScript("$('nickname').value = '" . addslashes($name) . "'");
$objResponse->addScript("$('steam').value = '" . $steam . "'");
} else {
$objResponse->addScript("ShowBox('Error', 'Can\'t get player info for ".addslashes(htmlspecialchars($name)).". Player is not on the server (".$data['ip'].":".$data['port'].") anymore!', 'red', '', true);");
$objResponse->addScript("$('dialog-control').setStyle('display', 'block');");
return $objResponse;
}
$objResponse->addScript("SwapPane(0);");
$objResponse->addScript("$('dialog-control').setStyle('display', 'block');");
$objResponse->addScript("$('dialog-placement').setStyle('display', 'none');");
return $objResponse;
}
******************************************************************
At line 2477-2478 -- if($ctype=="B")
$redir = "?p=banlist".$pagelink; --
Add AFTER
elseif($ctype=="C")
$redir = "?p=commslist".$pagelink;
******************************************************************
At line 2448-2449 -- elseif($ctype=="P")
$redir = "?p=admin&c=bans#^1"; --
Add AFTER
elseif($ctype=="C")
$redir = "?p=commslist".$pagelink;
******************************************************************
At line 2410-2411 -- elseif($ctype=="P")
$redir = "?p=admin&c=bans#^1"; --
ADD AFTER
elseif($ctype=="C")
$redir = "?p=commslist".$pagelink;
******************************************************************
At line 1348 -- {name: "Kick", callback: function(){KickPlayerConfirm('.$sid.', "'.str_replace('"', '\"', $player["name"]).'", 0);}}, --
Add AFTER
{name: "Block comms", callback: function(){window.location = "index.php?p=admin&c=comms&action=pasteBan&sid='.$sid.'&pName='.str_replace('"', '\"', $player["name"]).'"}},
******************************************************************
At line 66 -- $xajax->registerFunction("SendMail"); --
Add AFTER
$xajax->registerFunction("AddBlock");
$xajax->registerFunction("PrepareReblock");
$xajax->registerFunction("PrepareBlockFromBan");
$xajax->registerFunction("PasteBlock");
------------------------------------------------------------------------------------------------------------------------------------
\includes\system-functions.php
At line 765 -- function GetSVNRev() --
Add BEFORE
function PruneComms()
{
global $userbank;
$res = $GLOBALS['db']->Execute('UPDATE `'.DB_PREFIX.'_comms` SET `RemovedBy` = 0, `RemoveType` = \'E\', `RemovedOn` = UNIX_TIMESTAMP() WHERE `length` != 0 and `ends` < UNIX_TIMESTAMP() and `RemoveType` IS NULL');
return $res?true:false;
}
******************************************************************
At line 218 -- case "groups": --
Add BEFORE
case "comms":
$cat = "Communication blocks management";
break;
******************************************************************
At line 187 -- $submenu->addMenuItem("Bans", 0,"", "index.php?p=admin&c=bans", true); --
Add AFTER
if($userbank->HasAccess( ADMIN_OWNER|ADMIN_ADD_BAN|ADMIN_EDIT_OWN_BANS|ADMIN_EDIT_ALL_BANS))
$submenu->addMenuItem("Comms", 0,"", "index.php?p=admin&c=comms", true);
******************************************************************
At line 169 -- AddTab("Ban List", "index.php?p=banlist", "All of the bans in the database can be viewed from here."); --
Add AFTER
AddTab("Comm List", "index.php?p=commslist", "All of the communication bans (such as chat gags and voice mutes) in the database can be viewed from here.");
******************************************************************
At line 135-137 -- $tab_arr[2] = "Servers";
$tab_arr[3] = "Submit a ban";
$tab_arr[4] = "Protest a ban"; --
REPLACE
$tab_arr[2] = "Comm List";
$tab_arr[3] = "Servers";
$tab_arr[4] = "Submit a ban";
$tab_arr[5] = "Protest a ban";
------------------------------------------------------------------------------------------------------------------------------------
\pages\page.banlist.php
At line 470 -- $data['details_link'] = CreateLinkR('click','getdemo.php?type=B&id='.$res->fields['ban_id']); --
ADD BEFORE
$data['blockcomm_link'] = CreateLinkR('<img src="images/forbidden.png" border="0" alt="" style="vertical-align:middle" /> Block Comms',"index.php?p=admin&c=comms".$pagelink."&blockfromban=".$res->fields['ban_id']."&key=".$_SESSION['banlist_postkey']."#^0");
******************************************************************
At line 345 -- $where = "WHERE CO.commenttxt LIKE ?"; --
REPLACE
$where = "WHERE CO.type = 'B' AND CO.commenttxt LIKE ?";
------------------------------------------------------------------------------------------------------------------------------------
\scripts\sourcebans.js
At line 1473 (end of file) -- } --
Add AFTER
function RemoveBlock(id, key, page, name, confirm)
{
if(confirm==0) {
ShowBox('Delete Block', 'Are you sure you want to delete the block for '+ name + '?', 'blue', '', true);
$('dialog-control').setHTML('<input type="button" onclick="RemoveBlock(\''+id+'\', \''+key+'\', \''+page+'\', \''+addslashes(name.replace(/\'/g,'\\\''))+'\', \'1\''+');" name="rban" class="btn ok" onmouseover="ButtonOver(\'rban\')" onmouseout="ButtonOver(\'rban\')" id="rban" value="Remove Block" /> <input type="button" onclick="closeMsg(\'\');$(\'bulk_action\').options[0].selected=true;" name="astop" class="btn cancel" onmouseover="ButtonOver(\'astop\')" onmouseout="ButtonOver(\'astop\')" id="astop" value="Cancel" />');
} else if(confirm==1) {
if(page != "")
var pagelink = page;
else
var pagelink = "";
window.location = "index.php?p=commslist" + pagelink + "&a=delete&id="+ id +"&key="+ key;
}
}
function UnGag(id, key, page, name, popup)
{
if(popup==1) {
ShowBox('UnGag Reason', '<b>Please give a short comment, why you are going to ungag '+"\'"+ name +"\'"+'!</b><br><textarea rows="3" cols="40" name="ureason" id="ureason" style="overflow:auto;"></textarea><br><div id="ureason.msg" class="badentry"></div>', 'blue', '', true);
$('dialog-control').setHTML('<input type="button" onclick="UnGag(\''+id+'\', \''+key+'\', \''+page+'\', \''+addslashes(name.replace(/\'/g,'\\\''))+'\', \'0\''+');" name="uban" class="btn ok" onmouseover="ButtonOver(\'uban\')" onmouseout="ButtonOver(\'uban\')" id="uban" value="UnGag Player" /> <input type="button" onclick="closeMsg(\'\');" name="astop" class="btn cancel" onmouseover="ButtonOver(\'astop\')" onmouseout="ButtonOver(\'astop\')" id="astop" value="Cancel" />');
} else if(popup==0) {
if(page != "")
var pagelink = page;
else
var pagelink = "";
reason = $('ureason').value;
if(reason == "") {
$('ureason.msg').setHTML("Please leave a comment.");
$('ureason.msg').setStyle('display', 'block');
return;
} else {
$('ureason.msg').setHTML('');
$('ureason.msg').setStyle('display', 'none');
}
window.location = "index.php?p=commslist" + pagelink + "&a=ungag&id="+ id +"&key="+ key +"&ureason="+ reason;
}
}
function UnMute(id, key, page, name, popup)
{
if(popup==1) {
ShowBox('UnMute Reason', '<b>Please give a short comment, why you are going to unmute '+"\'"+ name +"\'"+'!</b><br><textarea rows="3" cols="40" name="ureason" id="ureason" style="overflow:auto;"></textarea><br><div id="ureason.msg" class="badentry"></div>', 'blue', '', true);
$('dialog-control').setHTML('<input type="button" onclick="UnMute(\''+id+'\', \''+key+'\', \''+page+'\', \''+addslashes(name.replace(/\'/g,'\\\''))+'\', \'0\''+');" name="uban" class="btn ok" onmouseover="ButtonOver(\'uban\')" onmouseout="ButtonOver(\'uban\')" id="uban" value="UnMute Player" /> <input type="button" onclick="closeMsg(\'\');" name="astop" class="btn cancel" onmouseover="ButtonOver(\'astop\')" onmouseout="ButtonOver(\'astop\')" id="astop" value="Cancel" />');
} else if(popup==0) {
if(page != "")
var pagelink = page;
else
var pagelink = "";
reason = $('ureason').value;
if(reason == "") {
$('ureason.msg').setHTML("Please leave a comment.");
$('ureason.msg').setStyle('display', 'block');
return;
} else {
$('ureason.msg').setHTML('');
$('ureason.msg').setStyle('display', 'none');
}
window.location = "index.php?p=commslist" + pagelink + "&a=unmute&id="+ id +"&key="+ key +"&ureason="+ reason;
}
}
function UnSilence(id, key, page, name, popup)
{
if(popup==1) {
ShowBox('UnSilence Reason', '<b>Please give a short comment, why you are going to unmute&ungag '+"\'"+ name +"\'"+'!</b><br><textarea rows="3" cols="40" name="ureason" id="ureason" style="overflow:auto;"></textarea><br><div id="ureason.msg" class="badentry"></div>', 'blue', '', true);
$('dialog-control').setHTML('<input type="button" onclick="UnSilence(\''+id+'\', \''+key+'\', \''+page+'\', \''+addslashes(name.replace(/\'/g,'\\\''))+'\', \'0\''+');" name="uban" class="btn ok" onmouseover="ButtonOver(\'uban\')" onmouseout="ButtonOver(\'uban\')" id="uban" value="UnSilence Player" /> <input type="button" onclick="closeMsg(\'\');" name="astop" class="btn cancel" onmouseover="ButtonOver(\'astop\')" onmouseout="ButtonOver(\'astop\')" id="astop" value="Cancel" />');
} else if(popup==0) {
if(page != "")
var pagelink = page;
else
var pagelink = "";
reason = $('ureason').value;
if(reason == "") {
$('ureason.msg').setHTML("Please leave a comment.");
$('ureason.msg').setStyle('display', 'block');
return;
} else {
$('ureason.msg').setHTML('');
$('ureason.msg').setStyle('display', 'none');
}
window.location = "index.php?p=commslist" + pagelink + "&a=unsilence&id="+ id +"&key="+ key +"&ureason="+ reason;
}
}
function search_blocks()
{
var type = "";
var input = "";
if($('name').checked)
{
type = "name";
input = $('nick').value;
}
if($('steam_').checked)
{
type = (document.getElementById('steam_match').value == "1" ? "steam" : "steamid");
input = $('steamid').value;
}
if($('reason_').checked)
{
type = "reason";
input = $('ban_reason').value;
}
if($('date').checked)
{
type = "date";
input = $('day').value + "," + $('month').value + "," + $('year').value;
}
if($('length_').checked)
{
type = "length";
if($('length').value=="other")
var length = $('other_length').value;
else
var length = $('length').value
input = $('length_type').value + "," + length;
}
if($('ban_type_').checked)
{
type = "btype";
input = $('ban_type').value;
}
if($('bancount').checked)
{
type = "bancount";
input = $('timesbanned').value;
}
if($('admin').checked)
{
type = "admin";
input = $('ban_admin').value;
}
if($('where_banned').checked)
{
type = "where_banned";
input = $('server').value;
}
if($('comment_').checked)
{
type = "comment";
input = $('ban_comment').value;
}
if(type!="" && input!="")
window.location = "index.php?p=commslist&advSearch=" + input + "&advType=" + type;
}
function ShowBlockBox(check, type, length)
{
ShowBox('Block Added', 'The block has been successfully added<br><iframe id="srvkicker" frameborder="0" width="100%" src="pages/admin.blockit.php?check='+check+'&type='+type+'&length='+length+'"></iframe>', 'green', 'index.php?p=admin&c=comms', true);
}
******************************************************************
At line 1197 -- window.location = "index.php?p=banlist"+searchlink+"&page="+nextPage; --
Add AFTER
if(type == "C")
window.location = "index.php?p=commslist"+searchlink+"&page="+nextPage;
------------------------------------------------------------------------------------------------------------------------------------
\themes\**\css\css.php
At line 496-501 -- #search {
width: 300px;
float: right;
padding: 2px 0 0 0;
text-align: right;
} --
REPLACE
#search2 {
width: 300px;
float: right;
padding: 2px 0 0 0;
text-align: right;
}
#search {
width: 200px;
float: right;
margin: auto 14px 0 auto;
margin-right: 14;
margin-bottom: -10px;
padding: 0 0 0 0;
text-align: right;
}
******************************************************************
At line 334-339 -- .searchbox {
width:105px;
height:14px;
background-color:#d7d7d7;
border:0;
} --
REPLACE
.searchbox {
width:230px;
height:14px;
background-color:#fdeaa8;
border:0;
}
.searchbox2 {
width:105px;
height:14px;
background-color:#fdeaa8;
border:0;
}
------------------------------------------------------------------------------------------------------------------------------------
\themes\**\page_bans.tpl
At line 138 -- <li>{$ban.demo_link}</li> --
ADD BEFORE
<li>{$ban.blockcomm_link}</li>
Plugin tested and works fine on TF2, CS:S, CS:Go servers.
Last edited by ppalex; 03-20-2016 at 10:21.
Reason: updated to 0.9.266