This commit is contained in:
xen
2020-03-25 20:09:12 +02:00
committed by xen
commit 527e7ec05e
420 changed files with 68682 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
A few explanations:
You will need to set up a database config in addons/sourcemod/configs/databases.cfg. There is a file (db info to add.txt) with example setups for either mysql or sqlite. The plugin supports both.
ChatTags_blocked.cfg: Each line in this file is a separate sub-phrase that is blocked for all players who do not have the configured admin flag. e.g. if "owner" is a line, then "owner", "growner", or even "addwdaownercqdq" are blocked for anyone w/o the admin flag. (non-case sensitive).
ChatTags_colors_csgo.cfg, ChatTags_colors_ins.cfg and ChatTags_colors.cfg: ChatTags_colors_csgo is for csgo, ChatTags_colors_ins.cfg is for insurgency, and the other is for all other games. No need to install the ones that dont apply. For ChatTags_colors.cfg, you can add as many hex colors as you want (http://www.colorpicker.com/ is a good site to make them). The cs:go one has no other colors available (well, there is ONE more, but it causes formatting issues, so it is hidden). The insurgency just has 7 colors at this time.
Similar to the config files, there are translation files for several games. While it doesnt hurt to add them all, the only one that will be used is the one matching your game (e.g. scp.cstrike.phrases.txt for CS:S, or scp.csgo.phrases.txt for CS:GO).
ChatTags_groups.cfg is the main "setup" config other than the cvar file that is generated. Be sure to read the info at the top for a full explanation of all the ways it can be used/configured.
The web stuff is in its own folder and has further instructions inside.
If you have more questions or any issues, let me know!
+4
View File
@@ -0,0 +1,4 @@
Founder
Admin
console
Shop
+783
View File
@@ -0,0 +1,783 @@
"Tag Colors"
{
"1"
{
"name" "Alice Blue"
"color" "#F0F8FF"
}
"2"
{
"name" "Allies"
"color" "#4D7942"
}
"3"
{
"name" "Antique White"
"color" "#FAEBD7"
}
"4"
{
"name" "Aqua"
"color" "#00FFFF"
}
"5"
{
"name" "Aquamarine"
"color" "#7FFFD4"
}
"6"
{
"name" "Axis"
"color" "#FF4040"
}
"7"
{
"name" "Azure"
"color" "#007FFF"
}
"8"
{
"name" "Beige"
"color" "#F5F5DC"
}
"9"
{
"name" "Bisque"
"color" "#FFE4C4"
}
"10"
{
"name" "Black"
"color" "#000000"
}
"11"
{
"name" "Blanched Almond"
"color" "#FFEBCD"
}
"12"
{
"name" "Blue"
"color" "#99CCFF"
}
"13"
{
"name" "Blue Violet"
"color" "#8A2BE2"
}
"14"
{
"name" "Brown"
"color" "#A52A2A"
}
"15"
{
"name" "Burlywood"
"color" "#DEB887"
}
"16"
{
"name" "Cadet Blue"
"color" "#5F9EA0"
}
"17"
{
"name" "Chartreuse"
"color" "#7FFF00"
}
"18"
{
"name" "Chocolate"
"color" "#D2691E"
}
"19"
{
"name" "Community"
"color" "#70B04A"
}
"20"
{
"name" "Coral"
"color" "#FF7F50"
}
"21"
{
"name" "Cornflower Blue"
"color" "#6495ED"
}
"22"
{
"name" "Cornsilk"
"color" "#FFF8DC"
}
"23"
{
"name" "Crimson"
"color" "#DC143C"
}
"24"
{
"name" "Cyan"
"color" "#00FFFF"
}
"25"
{
"name" "Dark Blue"
"color" "#00008B"
}
"26"
{
"name" "Dark Cyan"
"color" "#008B8B"
}
"27"
{
"name" "Dark Golden Rod"
"color" "#B8860B"
}
"29"
{
"name" "Dark Grey"
"color" "#A9A9A9"
}
"30"
{
"name" "Dark Green"
"color" "#006400"
}
"31"
{
"name" "Dark Khaki"
"color" "#BDB76B"
}
"32"
{
"name" "Dark Magenta"
"color" "#8B008B"
}
"33"
{
"name" "Dark Olive Green"
"color" "#556B2F"
}
"34"
{
"name" "Dark Orange"
"color" "#FF8C00"
}
"35"
{
"name" "Dark Orchid"
"color" "#9932CC"
}
"36"
{
"name" "Dark Red"
"color" "#8B0000"
}
"37"
{
"name" "Dark Salmon"
"color" "#E9967A"
}
"38"
{
"name" "Dark Sea Green"
"color" "#8FBC8F"
}
"39"
{
"name" "Dark Slate Blue"
"color" "#483D8B"
}
"41"
{
"name" "Dark Slate Grey"
"color" "#2F4F4F"
}
"42"
{
"name" "Dark Turquoise"
"color" "#00CED1"
}
"43"
{
"name" "Dark Violet"
"color" "#9400D3"
}
"44"
{
"name" "Deep Pink"
"color" "#FF1493"
}
"45"
{
"name" "Deep Sky Blue"
"color" "#00BFFF"
}
"46"
{
"name" "Dim Grey"
"color" "#696969"
}
"48"
{
"name" "Dodger Blue"
"color" "#1E90FF"
}
"49"
{
"name" "Firebrick"
"color" "#B22222"
}
"50"
{
"name" "Floral White"
"color" "#FFFAF0"
}
"51"
{
"name" "Forest Green"
"color" "#228B22"
}
"52"
{
"name" "Fuchsia"
"color" "#FF00FF"
}
"53"
{
"name" "Full Blue"
"color" "#0000FF"
}
"54"
{
"name" "Full Red"
"color" "#FF0000"
}
"55"
{
"name" "Gainsboro"
"color" "#DCDCDC"
}
"56"
{
"name" "Genuine"
"color" "#4D7455"
}
"57"
{
"name" "Ghost White"
"color" "#F8F8FF"
}
"58"
{
"name" "Gold"
"color" "#FFD700"
}
"59"
{
"name" "Goldenrod"
"color" "#DAA520"
}
"60"
{
"name" "Gray"
"color" "#CCCCCC"
}
"61"
{
"name" "Green"
"color" "#3EFF3E"
}
"62"
{
"name" "Green Yellow"
"color" "#ADFF2F"
}
"63"
{
"name" "Haunted"
"color" "#38F3AB"
}
"64"
{
"name" "Honeydew"
"color" "#F0FFF0"
}
"65"
{
"name" "Hot Pink"
"color" "#FF69B4"
}
"66"
{
"name" "Indian Red"
"color" "#CD5C5C"
}
"67"
{
"name" "Indigo"
"color" "#4B0082"
}
"68"
{
"name" "Ivory"
"color" "#FFFFF0"
}
"69"
{
"name" "Khaki"
"color" "#F0E68C"
}
"70"
{
"name" "Lavender"
"color" "#E6E6FA"
}
"71"
{
"name" "Lavender Blush"
"color" "#FFF0F5"
}
"72"
{
"name" "Lawn Green"
"color" "#7CFC00"
}
"73"
{
"name" "Lemon Chiffon"
"color" "#FFFACD"
}
"74"
{
"name" "Light Blue"
"color" "#ADD8E6"
}
"75"
{
"name" "Light Coral"
"color" "#F08080"
}
"76"
{
"name" "Light Cyan"
"color" "#E0FFFF"
}
"77"
{
"name" "Light Goldenrod Yellow"
"color" "#FAFAD2"
}
"78"
{
"name" "Light Grey"
"color" "#D3D3D3"
}
"80"
{
"name" "Light Green"
"color" "#99FF99"
}
"81"
{
"name" "Light Pink"
"color" "#FFB6C1"
}
"82"
{
"name" "Light Salmon"
"color" "#FFA07A"
}
"83"
{
"name" "Light Sea Green"
"color" "#20B2AA"
}
"84"
{
"name" "Light Sky Blue"
"color" "#87CEFA"
}
"85"
{
"name" "Light Slate Grey"
"color" "#778899"
}
"86"
{
"name" "Light Slate Grey"
"color" "#778899"
}
"87"
{
"name" "Light Steel Blue"
"color" "#B0C4DE"
}
"88"
{
"name" "Light Yellow"
"color" "#FFFFE0"
}
"89"
{
"name" "Lime"
"color" "#00FF00"
}
"90"
{
"name" "Lime Green"
"color" "#32CD32"
}
"91"
{
"name" "Linen"
"color" "#FAF0E6"
}
"92"
{
"name" "Magenta"
"color" "#FF00FF"
}
"93"
{
"name" "Maroon"
"color" "#800000"
}
"94"
{
"name" "Medium Aquamarine"
"color" "#66CDAA"
}
"95"
{
"name" "Medium Blue"
"color" "#0000CD"
}
"96"
{
"name" "Medium Orchid"
"color" "#BA55D3"
}
"97"
{
"name" "Medium Purple"
"color" "#9370D8"
}
"98"
{
"name" "Mediumsea Green"
"color" "#3CB371"
}
"99"
{
"name" "Mediumslate Blue"
"color" "#7B68EE"
}
"100"
{
"name" "Medium Spring Green"
"color" "#00FA9A"
}
"101"
{
"name" "Medium Turquoise"
"color" "#48D1CC"
}
"102"
{
"name" "Medium Violet Red"
"color" "#C71585"
}
"103"
{
"name" "Midnight Blue"
"color" "#191970"
}
"104"
{
"name" "Mint Cream"
"color" "#F5FFFA"
}
"105"
{
"name" "Misty Rose"
"color" "#FFE4E1"
}
"106"
{
"name" "Moccasin"
"color" "#FFE4B5"
}
"107"
{
"name" "Navajo White"
"color" "#FFDEAD"
}
"108"
{
"name" "Navy"
"color" "#000080"
}
"109"
{
"name" "Normal"
"color" "#B2B2B2"
}
"110"
{
"name" "Old Lace"
"color" "#FDF5E6"
}
"111"
{
"name" "Olive"
"color" "#9EC34F"
}
"112"
{
"name" "Olive Drab"
"color" "#6B8E23"
}
"113"
{
"name" "Orange"
"color" "#FFA500"
}
"114"
{
"name" "Orange Red"
"color" "#FF4500"
}
"115"
{
"name" "Orchid"
"color" "#DA70D6"
}
"116"
{
"name" "Pale Goldenrod"
"color" "#EEE8AA"
}
"117"
{
"name" "Pale Green"
"color" "#98FB98"
}
"118"
{
"name" "Pale Turquoise"
"color" "#AFEEEE"
}
"119"
{
"name" "Pale Violet Red"
"color" "#D87093"
}
"120"
{
"name" "Papaya Whip"
"color" "#FFEFD5"
}
"121"
{
"name" "Peach Puff"
"color" "#FFDAB9"
}
"122"
{
"name" "Peru"
"color" "#CD853F"
}
"123"
{
"name" "Pink"
"color" "#FFC0CB"
}
"124"
{
"name" "Plum"
"color" "#DDA0DD"
}
"125"
{
"name" "Powder Blue"
"color" "#B0E0E6"
}
"126"
{
"name" "Purple"
"color" "#800080"
}
"127"
{
"name" "Red"
"color" "#FF4040"
}
"128"
{
"name" "Rosybrown"
"color" "#BC8F8F"
}
"129"
{
"name" "Royal Blue"
"color" "#4169E1"
}
"130"
{
"name" "Saddle Brown"
"color" "#8B4513"
}
"131"
{
"name" "Salmon"
"color" "#FA8072"
}
"132"
{
"name" "Sandy Brown"
"color" "#F4A460"
}
"133"
{
"name" "Sea Green"
"color" "#2E8B57"
}
"134"
{
"name" "Seashell"
"color" "#FFF5EE"
}
"135"
{
"name" "Selfmade"
"color" "#70B04A"
}
"136"
{
"name" "Sienna"
"color" "#A0522D"
}
"137"
{
"name" "Silver"
"color" "#C0C0C0"
}
"138"
{
"name" "Sky Blue"
"color" "#87CEEB"
}
"139"
{
"name" "Slate Blue"
"color" "#6A5ACD"
}
"140"
{
"name" "Slate Grey"
"color" "#708090"
}
"141"
{
"name" "Slate Grey"
"color" "#708090"
}
"142"
{
"name" "Snow"
"color" "#FFFAFA"
}
"143"
{
"name" "Spring Green"
"color" "#00FF7F"
}
"144"
{
"name" "Steel Blue"
"color" "#4682B4"
}
"145"
{
"name" "Strange"
"color" "#CF6A32"
}
"146"
{
"name" "Tan"
"color" "#D2B48C"
}
"147"
{
"name" "Teal"
"color" "#008080"
}
"148"
{
"name" "Thistle"
"color" "#D8BFD8"
}
"149"
{
"name" "Tomato"
"color" "#FF6347"
}
"150"
{
"name" "Turquoise"
"color" "#40E0D0"
}
"151"
{
"name" "Unique"
"color" "#FFD700"
}
"152"
{
"name" "Unusual"
"color" "#8650AC"
}
"153"
{
"name" "Valve"
"color" "#A50F79"
}
"154"
{
"name" "Vintage"
"color" "#476291"
}
"155"
{
"name" "Violet"
"color" "#EE82EE"
}
"156"
{
"name" "Wheat"
"color" "#F5DEB3"
}
"157"
{
"name" "White"
"color" "#FFFFFF"
}
"158"
{
"name" "Whitesmoke"
"color" "#F5F5F5"
}
"159"
{
"name" "Yellow"
"color" "#FFFF00"
}
"160"
{
"name" "Yellow Green"
"color" "#9ACD32"
}
}
+83
View File
@@ -0,0 +1,83 @@
"Tag Colors"
{
"1"
{
"name" "White"
"color" "1"
}
"2"
{
"name" "Dark Red (Disabled)"
"color" "-1"
}
"3"
{
"name" "Team Colors"
"color" "3"
}
"4"
{
"name" "Lime Green"
"color" "4"
}
"5"
{
"name" "Light Green"
"color" "5"
}
"6"
{
"name" "Olive"
"color" "6"
}
"7"
{
"name" "Light Red"
"color" "7"
}
"8"
{
"name" "Grey"
"color" "8"
}
"9"
{
"name" "Yellow"
"color" "9"
}
"10"
{
"name" "Light Blue"
"color" "10"
}
"11"
{
"name" "Blue"
"color" "11"
}
"12"
{
"name" "Dark Blue"
"color" "12"
}
"13"
{
"name" "Another Blue"
"color" "13"
}
"14"
{
"name" "Purple"
"color" "14"
}
"15"
{
"name" "Orange Red"
"color" "15"
}
"16"
{
"name" "Orange"
"color" "16"
}
}
+38
View File
@@ -0,0 +1,38 @@
"Tag Colors"
{
"1"
{
"name" "White"
"color" "1"
}
"2"
{
"name" "Team Colors"
"color" "2"
}
"3"
{
"name" "Lime Green"
"color" "3"
}
"4"
{
"name" "Light Green"
"color" "4"
}
"5"
{
"name" "Olive Black"
"color" "5"
}
"6"
{
"name" "Banana Yellow"
"color" "6"
}
"7"
{
"name" "Dark Yellow"
"color" "7"
}
}
+131
View File
@@ -0,0 +1,131 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// EXPLANATION OF SETUPS:
//
// "Group Name" <<< See GROUP NAME EXPLANATION below.
// {
// "flags" "st" <<< Flags required to be considered a matching setup. See FLAGS EXPLANATION below.
// "tagstring" "[Donator]" <<< Define the tag text.
// "tagcolor" "9" <<< Color to use for the tag text, if applicable (see COLOR SETTINGS EXPLANATION below).
// "namecolor" "5" <<< Color to use for the players name (see COLOR SETTINGS EXPLANATION below).
// "chatcolor" "6" <<< Color to use for chat message text (see COLOR SETTINGS EXPLANATION below).
// }
//
//////////////////////////////////////////////////////////////////////////////////
//
// ORDER OF OPERATIONS: Players get the first matching setup. Order them accordingly!
//
// For all setups, be sure to make check which setup first applies. e.g. if admins have flags 'b' and 's' and donators have 's',
// make sure the admin setup comes first, else they will get the donator setup
//
//////////////////////////////////////////////////////////////////////////////////
// FLAGS EXPLANATION: Access can be set to be a single flag, a set of required flags, or even sets of sets.
//
// e.g. Setting the flag as "a" requires players to have the "a" flag to be considered a match.
// e.g. "at" requires players to have both the "a" AND "t" flags to be considered a match.
// e.g. "a;t" requires players to have either the "a" OR "t" flags to be considered a match.
// e.g. "at;b" requires players to have EITHER: (both the "a" AND "t" flags), OR the "b" flag. If either of the two conditions apply, they are considered a match.
// A few more inputs: "none" restricts access for all. "public" or empty quotes ("") make the access available to all (if the "flags" key-value is omitted in any non-steam ID group, "public" is assumed).
//
//////////////////////////////////////////////////////////////////////////////////
// GROUP NAME EXPLANATION:
//
// Names for the setups can be anything, but there are a few special names that can be used:
// * Set it to a player's Steam ID (STEAM_X:Y:ZZZZZZZZ (AuthId_Steam2) or [U:Y:ZZZZZZZZ] (AuthId_Steam3) or XXXXXXXXXXXXXXXXX (AuthId_SteamID64)) to make one specific for that player.
// Note: It will identify steam IDs as any section name with ":" in it (AuthId_Steam2 or AuthId_Steam3), or that is only numbers (AuthId_SteamID64).
//
// * Set it to TEAM_# (replace # with a team number) to make the setup apply to anyone on that team.
// e.g. TEAM_2 would be team 2, which in CS:S/CS:GO is the Terrorist team. TEAM_3 would be the Counter-Terrorist team.
// Note: If the "flags" key-value is set, then both are applied. e.g. A setup can specify Team 2 players with flag "a".
//
//////////////////////////////////////////////////////////////////////////////////
// COLOR SETTINGS EXPLANATION:
//
// Note: The same colors below are required for the plugin cvars that ask you to specify colors. Lavender
//
// INSURGENCY COLORS:
// 1 - White 2 - Team Colors 3 - Lime Green 4 - Light Green
// 5 - Olive Black 6 - Banana Yellow 7 - Dark Yellow 8 - Grey
//
// CS:GO COLORS:
// 1 - White 2 - Dark Red 3 - Team Colors 4 - Lime Green
// 5 - Light Green 6 - Olive 7 - Light Red 8 - Grey
// 9 - Yellow 10 - Light Blue 11 - Blue 12 - Dark Blue
// 13 - Another Blue 14 - Purple 15 - Orange Red
//
// ALL OTHER GAMES:
// Use hex code. e.g. Red = FF0000. To generate hex code, either look in ChatTags_colors.cfg for examples, or use a website like http://www.colorpicker.com/
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
"Setups"
{
"Root Admins"
{
"flags" "z"
"tagstring" "[Root Admin]"
"tagcolor" "7"
"namecolor" "6"
"chatcolor" "9"
}
"Normal Admins"
{
"flags" "s"
"tagstring" "[Admin]"
"tagcolor" "7"
"namecolor" "6"
"chatcolor" "9"
}
"Donators"
{
"flags" "o"
"tagstring" "[Donator]"
"tagcolor" "4"
"namecolor" "5"
"chatcolor" "1"
}
"Vip"
{
"flags" "opq"
"tagstring" "[Vip]"
"tagcolor" "4"
"namecolor" "5"
"chatcolor" "1"
}
"Mapper"
{
"flags" "opqr"
"tagstring" "[Mapper]"
"tagcolor" "16"
"namecolor" "9"
"chatcolor" "1"
}
"Event Winner"
{
"flags" "t"
"tagstring" "[Event Winner]"
"tagcolor" "12"
"namecolor" "11"
"chatcolor" "1"
}
//"TEAM_2"
//{
// "tagstring" "[TERRORIST]"
// "tagcolor" "5"
// "namecolor" "1"
// "chatcolor" "9"
//}
//"TEAM_3"
//{
// "tagstring" "[CT]"
// "tagcolor" "5"
// "namecolor" "1"
// "chatcolor" "9"
//}
}
+24
View File
@@ -0,0 +1,24 @@
"Databases"
{
"ChatTags"
{
"driver" "mysql"
"host" "YOUR HOST IP HERE"
"database" "YOUR DB NAME HERE"
"user" "DB USERNAME HERE"
"pass" "USERNAME PASSWORD HERE"
}
//Use the above setup example if connecting to a MySQL DB.
//======== OR ========
//Use the below setup example if connecting to a local SQLite DB.
"ChatTags"
{
"driver" "sqlite"
"host" "localhost"
"database" "ChatTags"
"user" "root"
"pass" ""
}
}
File diff suppressed because it is too large Load Diff
+361
View File
@@ -0,0 +1,361 @@
"Phrases"
{
"ClientPrefs Title"
{
"en" "[Donator] Chat Tags"
"jp" "[ドネーター] Chat Tags (チャットタグ)"
"chi" "[捐助者] Chat Tags (聊天标签)"
"zho" "[捐助者] Chat Tags (聊天標籤)"
}
"CheckConsole"
{
"en" "Check console for output!"
"jp" "コンソールの出力を確認してください!"
//"chi" ""
//"zho" ""
}
"NotFoundOrInvalidParameter"
{
"en" "Not found or invalid parameter."
"jp" "見つからなかったか無効なパラメータです."
//"chi" ""
//"zho" ""
}
"InvalidHex"
{
"en" "Invalid hex."
"jp" "無効なHEX."
//"chi" ""
//"zho" ""
}
"Usage"
{
"en" "Usage:"
"jp" "使用方法:"
//"chi" ""
//"zho" ""
}
"NotAvailableForCSGO"
{
"en" "This command is not available for CS:GO!"
"jp" "このコマンドは CS:GO では使用できません!"
//"chi" ""
//"zho" ""
}
"NotAvailableForInsurgency"
{
"en" "This command is not available for Insurgency!"
"jp" "このコマンドは Insurgency では使用できません!"
//"chi" ""
//"zho" ""
}
"DisabledByServerManager"
{
"en" "This feature has been disabled by the server manager!"
"jp" "この機能はサーバー管理者によって無効化されています!"
//"chi" ""
//"zho" ""
}
"DisabledForEveryoneByServerManager"
{
"en" "This feature has been disabled for everyone by the server manager!"
"jp" "この機能はサーバー管理者によってプレイヤー全体で無効化されています!"
//"chi" ""
//"zho" ""
}
"MustBeInGame"
{
"en" "You must be in game to use this command!"
"jp" "このコマンドを使用するにはゲーム内である必要があります!"
//"chi" ""
//"zho" ""
}
"DoNotHaveAccess"
{
"en" "You do not have access to this feature!"
"jp" "あなたはこの機能にアクセスできません!"
//"chi" ""
//"zho" ""
}
"DisabledUntilCookiesCached"
{
"en" "This feature is disabled until your cookies have cached!"
"jp" "この機能はあなたのクッキーがキャッシュされるまで使用できません!"
//"chi" ""
//"zho" ""
}
"TagEnabled"
{
"en" "Your tag is now enabled!"
"jp" "あなたのタグが有効になりました!"
//"chi" ""
//"zho" ""
}
"TagDisabled"
{
"en" "Your tag is now disabled!"
"jp" "あなたのタグが無効になりました!"
//"chi" ""
//"zho" ""
}
"RestrictedChangingTags"
{
"en" "You are currently restricted from changing your tags!"
"jp" "あなたは現在タグの変更が制限されています!"
//"chi" ""
//"zho" ""
}
"RestrictedChangingTagColors"
{
"en" "You are currently restricted from changing your tag colors!"
"jp" "あなたは現在タグの色の変更が制限されています!"
//"chi" ""
//"zho" ""
}
"RestrictedChangingNameColors"
{
"en" "You are currently restricted from changing your name colors!"
"jp" "あなたは現在名前の色の変更が制限されています!"
//"chi" ""
//"zho" ""
}
"RestrictedChangingChatColors"
{
"en" "You are currently restricted from changing your chat colors!"
"jp" "あなたは現在チャットの色の変更が制限されています!"
//"chi" ""
//"zho" ""
}
"EnabledChatBlocker"
{
"en" "You have enabled chat blocker! You will no longer see chat from other players. To re-enable it, type !blockchat."
"jp" "チャットブロックを有効にしました! 他のプレイヤーのチャットが見えなくなります. 再度 !blockchar を入力で元に戻します."
//"chi" ""
//"zho" ""
}
"DisabledChatBlocker"
{
"en" "You have disabled chat blocker! You can now see chat. To disable chat again, type !blockchat."
"jp" "チャットブロックを無効にしました! チャットが見えるようになります. 再度 !blockchar を入力でチャットを無効化します."
//"chi" ""
//"zho" ""
}
"DeniedChangeTagByExternalPlugin"
{
"en" "Your access to change your tag text has been denied by override by an external plugin!"
"jp" "他のプラグインが優先制御している為, タグテキストの変更が拒否されました!"
//"chi" ""
//"zho" ""
}
"DeniedChangeTagColorByExternalPlugin"
{
"en" "Your access to change your tag colors has been denied by override by an external plugin!"
"jp" "他のプラグインが優先制御している為, タグの色の変更が拒否されました!"
//"chi" ""
//"zho" ""
}
"DeniedChangeNameColorByExternalPlugin"
{
"en" "Your access to change your name colors has been denied by override by an external plugin!"
"jp" "他のプラグインが優先制御している為, 名前の色の変更が拒否されました!"
//"chi" ""
//"zho" ""
}
"DeniedChangeChatColorByExternalPlugin"
{
"en" "Your access to change your chat colors has been denied by override by an external plugin!"
"jp" "他のプラグインが優先制御している為, チャットの色の変更が拒否されました!"
//"chi" ""
//"zho" ""
}
"TagBlockedFromUse"
{
"en" "Nice try! This tag is blocked from use."
"jp" "いい試みですね! このタグの使用はブロックされています."
//"chi" ""
//"zho" ""
}
"TagSetTo"
{
"en" "Your tag is now visible and is set to:"
"jp" "あなたのタグが設定されました:"
//"chi" ""
//"zho" ""
}
"TagColorSetTo"
{
"en" "Your tag color is now set to:"
"jp" "あなたのタグの色が設定されました:"
//"chi" ""
//"zho" ""
}
"NameColorSetTo"
{
"en" "Your name color is now set to:"
"jp" "あなたの名前の色が設定されました:"
//"chi" ""
//"zho" ""
}
"ChatColorSetTo"
{
"en" "Your chat color is now set to:"
"jp" "あなたのチャットの色が設定されました:"
//"chi" ""
//"zho" ""
}
"ResetTagColor"
{
"en" "Your tag color is now reset to default."
"jp" "あなたのタグの色が初期値にリセットされました."
//"chi" ""
//"zho" ""
}
"ResetNameColor"
{
"en" "Your name color is now reset to default."
"jp" "あなたの名前の色が初期値にリセットされました."
//"chi" ""
//"zho" ""
}
"ResetChatColor"
{
"en" "Your chat color is now reset to default."
"jp" "あなたのチャットの色が初期値にリセットされました."
//"chi" ""
//"zho" ""
}
"TooFast"
{
"en" "You are sending messages too fast!"
"jp" "メッセージの間隔が短かすぎます!"
//"chi" ""
//"zho" ""
}
"HasBeenGagged"
{
"en" "has been gagged for spamming chat."
"jp" "がチャットスパムによってギャグされました."
//"chi" ""
//"zho" ""
}
"MimickingCONSOLE"
{
"en" "Your chat tags setup has been removed due to mimicking CONSOLE (change your name)!"
"jp" "あなたはCONSOLE表示を真似しようとしたためタグの設定が消去されました (名前を変更してください)!"
//"chi" ""
//"zho" ""
}
"ToDefineYourOwnTagColor"
{
"en" "To define your own tag color, type !tagcolor <hexcode> (e.g. !tagcolor FFFFFF)."
"jp" "自分の好みのタグの色を定義するには, !tagcolor <HEXコード> を入力してください (例. !tagcolor FFFFFF)."
//"chi" ""
//"zho" ""
}
"ToDefineYourOwnNameColor"
{
"en" "To define your own name color, type !namecolor <hexcode> (e.g. !namecolor FFFFFF)."
"jp" "自分の好みの名前の色を定義するには, !namecolor <HEXコード> を入力してください (例. !namecolor FFFFFF)."
//"chi" ""
//"zho" ""
}
"ToDefineYourOwnChatColor"
{
"en" "To define your own chat color, type !chatcolor <hexcode> (e.g. !chatcolor FFFFFF)."
"jp" "自分の好みのチャットの色を定義するには, !chatcolor <HEXコード> を入力してください (例. !chatcolor FFFFFF)."
//"chi" ""
//"zho" ""
}
"Chat Tags"
{
"en" "Chat Tags"
"jp" "チャットタグ"
//"chi" ""
//"zho" ""
}
"Disable Tag"
{
"en" "Disable Tag"
"jp" "タグを無効化"
//"chi" ""
//"zho" ""
}
"Enable Tag"
{
"en" "Enable Tag"
"jp" "タグを有効化"
//"chi" ""
//"zho" ""
}
"Tag Colors"
{
"en" "Tag Colors"
"jp" "タグの色"
//"chi" ""
//"zho" ""
}
"Name Colors"
{
"en" "Name Colors"
"jp" "名前の色"
//"chi" ""
//"zho" ""
}
"Chat Colors"
{
"en" "Chat Colors"
"jp" "チャットの色"
//"chi" ""
//"zho" ""
}
"Check Setup of Player"
{
"en" "Check Setup of Player"
"jp" "プレイヤーの設定値を確認"
//"chi" ""
//"zho" ""
}
"Chat Command To Change Tag"
{
"en" "Chat command to change tag:"
"jp" "タグを変更するコマンド:"
//"chi" ""
//"zho" ""
}
"Tag Text You Want"
{
"en" "!tag <Text You Want>"
"jp" "!tag <設定したいテキスト>"
//"chi" ""
//"zho" ""
}
"Characters Max"
{
"#format" "{1:i}"
"en" "({1} Characters Max)"
"jp" "(最大 {1} 文字)"
//"chi" ""
//"zho" ""
}
"Check Tag Setup For"
{
"en" "Check Tag Setup for:"
"jp" "タグの設定値を確認:"
//"chi" ""
//"zho" ""
}
"Reset"
{
"en" "Reset"
"jp" "リセット"
//"chi" ""
//"zho" ""
}
"Define Your Own Color"
{
"en" "Define Your Own Color"
"jp" "自分の好みの色を定義"
//"chi" ""
//"zho" ""
}
}
@@ -0,0 +1,53 @@
"Phrases"
{
"Cstrike_Chat_CT_Loc"
{
"#format" "{1:s},{2:s}"
"en" "(Counter-Terrorist) {1} : {2}"
}
"Cstrike_Chat_CT"
{
"#format" "{1:s},{2:s}"
"en" "(Counter-Terrorist) {1} : {2}"
}
"Cstrike_Chat_T_Loc"
{
"#format" "{1:s},{2:s}"
"en" "(Terrorist) {1} : {2}"
}
"Cstrike_Chat_T"
{
"#format" "{1:s},{2:s}"
"en" "(Terrorist) {1} : {2}"
}
"Cstrike_Chat_CT_Dead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD*(Counter-Terrorist) {1} : {2}"
}
"Cstrike_Chat_T_Dead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD*(Terrorist) {1} : {2}"
}
"Cstrike_Chat_Spec"
{
"#format" "{1:s},{2:s}"
"en" "(Spectator) {1} : {2}"
}
"Cstrike_Chat_All"
{
"#format" "{1:s},{2:s}"
"en" "{1} : {2}"
}
"Cstrike_Chat_AllDead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD* {1} : {2}"
}
"Cstrike_Chat_AllSpec"
{
"#format" "{1:s},{2:s}"
"en" "*SPEC* {1} : {2}"
}
}
@@ -0,0 +1,53 @@
"Phrases"
{
"Cstrike_Chat_CT_Loc"
{
"#format" "{1:s},{2:s}"
"en" "(Counter-Terrorist) {1} : {2}"
}
"Cstrike_Chat_CT"
{
"#format" "{1:s},{2:s}"
"en" "(Counter-Terrorist) {1} : {2}"
}
"Cstrike_Chat_T_Loc"
{
"#format" "{1:s},{2:s}"
"en" "(Terrorist) {1} : {2}"
}
"Cstrike_Chat_T"
{
"#format" "{1:s},{2:s}"
"en" "(Terrorist) {1} : {2}"
}
"Cstrike_Chat_CT_Dead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD*(Counter-Terrorist) {1} : {2}"
}
"Cstrike_Chat_T_Dead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD*(Terrorist) {1} : {2}"
}
"Cstrike_Chat_Spec"
{
"#format" "{1:s},{2:s}"
"en" "(Spectator) {1} : {2}"
}
"Cstrike_Chat_All"
{
"#format" "{1:s},{2:s}"
"en" "{1} : {2}"
}
"Cstrike_Chat_AllDead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD* {1} : {2}"
}
"Cstrike_Chat_AllSpec"
{
"#format" "{1:s},{2:s}"
"en" "*SPEC* {1} : {2}"
}
}
@@ -0,0 +1,68 @@
"Phrases"
{
"Game_radio"
{
"#format" "{1:s},{2:s}"
"en" " {1} (RADIO): {2}"
}
"Game_radio_location"
{
"#format" "{1:s},{2:s}"
"en" " {1} (RADIO): {2}"
}
"INS_Chat_T1_Loc"
{
"#format" "{1:s},{2:s}"
"en" "(Security) {1} : {2}"
}
"INS_Chat_T1"
{
"#format" "{1:s},{2:s}"
"en" "(Security) {1}: {2}"
}
"INS_Chat_T2_Loc"
{
"#format" "{1:s},{2:s}"
"en" "(Insurgents) {1}: {2}"
}
"INS_Chat_T2"
{
"#format" "{1:s},{2:s}"
"en" "(Insurgents) {1}: {2}"
}
"INS_Chat_T1_Dead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD*(Security) {1}: {2}"
}
"INS_Chat_T2_Dead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD*(Insurgents) {1} : {2}"
}
"INS_Chat_Spec"
{
"#format" "{1:s},{2:s}"
"en" "(Spectator) {1} : {2}"
}
"INS_Chat_All"
{
"#format" "{1:s},{2:s}"
"en" " {1} : {2}"
}
"INS_Chat_AllDead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD* {1} : {2}"
}
"INS_Chat_AllSpec"
{
"#format" "{1:s},{2:s}"
"en" "*SPEC* {1} : {2}"
}
"INS_Chat_Party"
{
"#format" "{1:s},{2:s}"
"en" "(Party) {1}"
}
}
+43
View File
@@ -0,0 +1,43 @@
"Phrases"
{
"L4D_Chat_Infected"
{
"#format" "{1:s},{2:s}"
"en" "(Infected) {1} : {2}"
}
"L4D_Chat_Survivor"
{
"#format" "{1:s},{2:s}"
"en" "(Survivor) {1} : {2}"
}
"L4D_Chat_Infected_Dead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD*(Infected) {1} : {2}"
}
"L4D_Chat_Survivor_Dead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD*(Survivor) {1} : {2}"
}
"L4D_Chat_Spec"
{
"#format" "{1:s},{2:s}"
"en" "(Spectator) {1} : {2}"
}
"L4D_Chat_All"
{
"#format" "{1:s},{2:s}"
"en" "{1} : {2}"
}
"L4D_Chat_AllDead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD* {1} : {2}"
}
"L4D_Chat_AllSpec"
{
"#format" "{1:s},{2:s}"
"en" "*SPEC* {1} : {2}"
}
}
@@ -0,0 +1,43 @@
"Phrases"
{
"L4D_Chat_Infected"
{
"#format" "{1:s},{2:s}"
"en" "(Infected) {1} : {2}"
}
"L4D_Chat_Survivor"
{
"#format" "{1:s},{2:s}"
"en" "(Survivor) {1} : {2}"
}
"L4D_Chat_Infected_Dead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD*(Infected) {1} : {2}"
}
"L4D_Chat_Survivor_Dead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD*(Survivor) {1} : {2}"
}
"L4D_Chat_Spec"
{
"#format" "{1:s},{2:s}"
"en" "(Spectator) {1} : {2}"
}
"L4D_Chat_All"
{
"#format" "{1:s},{2:s}"
"en" "{1} : {2}"
}
"L4D_Chat_AllDead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD* {1} : {2}"
}
"L4D_Chat_AllSpec"
{
"#format" "{1:s},{2:s}"
"en" "*SPEC* {1} : {2}"
}
}
+43
View File
@@ -0,0 +1,43 @@
"Phrases"
{
"TF_Chat_Team_Loc"
{
"#format" "{1:s},{2:s}"
"en" "(TEAM) {1} : {2}"
}
"TF_Chat_Team"
{
"#format" "{1:s},{2:s}"
"en" "(TEAM) {1} : {2}"
}
"TF_Chat_Team_Dead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD*(TEAM) {1} : {2}"
}
"TF_Chat_Spec"
{
"#format" "{1:s},{2:s}"
"en" "(Spectator) {1} : {2}"
}
"TF_Chat_All"
{
"#format" "{1:s},{2:s}"
"en" "{1} : {2}"
}
"TF_Chat_AllDead"
{
"#format" "{1:s},{2:s}"
"en" "*DEAD* {1} : {2}"
}
"TF_Chat_AllSpec"
{
"#format" "{1:s},{2:s}"
"en" "*SPEC* {1} : {2}"
}
"TF_Chat_Coach"
{
"#format" "{1:s},{2:s}"
"en" "(Coach) {1} : {2}"
}
}
+30
View File
@@ -0,0 +1,30 @@
Drop the "session" and "chattags" folders onto your website in the public section.
Drop the "steamauth" folder in your root directory.
The paths in the plugin assume:
//ROOT:
* steamauth/
* public/
* chatlogs/
* sessions/
If your structure differs from this, you may want to edit the following lines:
In "chatlogs/index.php", lines 11-13 may need to be adjusted. Here's some explanation of the existing code:
* $_SERVER['DOCUMENT_ROOT'] [line 11] gets the path to the public folder.
* str_replace("/public", "", $_SERVER['DOCUMENT_ROOT']) [line 11] removes "/public" from the above path. Given the structure shown above, that puts us at the ROOT folder.
If yours is different, or if your public folder is named differently, this would need to be edited.
* define('ROOT_FOLDER', str_replace("/public", "", $_SERVER['DOCUMENT_ROOT'])); [line 11] defines the above path as a named constant 'ROOT_FOLDER'.
* define('STEAM_AUTH_FOLDER', ROOT_FOLDER.'/steamauth/'); [line 12] defines 'STEAM_AUTH_FOLDER' as the root path with "/steamauth/" appended.
* session_save_path($_SERVER['DOCUMENT_ROOT'].'/sessions'); [line 13] says that the session data for a visitor are saved in the public folder in the "sessions" subfolder.
In "chatlogs/index.php", add admins by adding them as text (inside quotes) into the array on line 15. This will give access to IP searches and seeing IP info.
In "steamauth/SteamConfig.php", fill in line 3 and 4 (follow the comments to the right of the lines).
In "chatlogs/runquery.php",
* Set your database info on lines 2-5.
* Line 6 sets the number of rows from the database to show per page.
* Around line 300, you will see where you can manipulate the names of the tabs from being server IPs, to whatever else you want it to be (names presumably).
Fin. Make edits to banners, backgrounds, logos, and/or text as your see fit.
Note: The server validation file is only included if you wish to set up server validation via a database. It is a bit complex to set up, so see me if you wish to enable this.
+221
View File
@@ -0,0 +1,221 @@
body
{
background:#1b1b1b url(img/bg.jpg) top center no-repeat;
color:#bbb;
font-size:12px;
font-family:Verdana, Geneva, sans-serif;
margin:0px 0px 0px 0px;
line-height:18px;
overflow:auto;
}
#wrap
{
width:auto;
margin:0 auto;
min-height:100px;
padding:20px 20px 20px 20px;
position:relative;
overflow:auto;
}
.infobox
{
width:auto;
height:auto;
position:relative;
background:url(img/tranbg2.png);
border-radius:10px;
padding:10px 15px 10px 15px;
box-shadow: 5px 5px 10px #121212;
overflow:auto;
margin-left: auto;
margin-right: auto;
}
.infobox2
{
width:auto;
height:auto;
/*position:relative;*/
background:url(img/tranbg2.png);
border-radius:10px;
padding:10px 15px 10px 15px;
box-shadow: 5px 5px 10px #121212;
overflow:auto;
margin-left: auto;
margin-right: auto;
float:right;
}
.headpoint1
{
font-size:16px;
font-weight:bold;
color:#ddd;
}
.headpoint2
{
font-size:30px;
font-weight:bold;
color:#ddd;
}
.headpoint3
{
font-size:18px;
font-weight:bold;
color:#ddd;
}
.headpoint4
{
font-size:14px;
color:#ddd;
}
.headpoint5
{
font-size:12px;
color:#ddd;
}
ul.rules li
{
padding-top:1px;
padding-bottom:1px;
}
<style type="text/css">
.spoilerbutton {display:block;margin:5px 0;overflow:hidden;}
.spoiler {overflow:hidden;width:auto;}
.spoiler > div {-webkit-transition: all 0.2s ease;-moz-transition: margin 0.2s ease;-o-transition: all 0.2s ease;transition: margin 0.2s ease;}
.spoilerbutton[value="Show"] + .spoiler > div {margin-top:-100%;}
.spoilerbutton[value="Hide"] + .spoiler {padding:5px;}
</style>
.cf:before, .cf:after{
content:"";
display:table;
}
.cf:after{
clear:both;
}
.cf{
zoom:1;
}
/* Form wrapper styling */
.form-wrapper {
/*width: 295px;*/
width: auto;
height: auto;
margin: 2px auto 2px auto;
background: #444;
background: rgba(0,0,0,.2);
border-radius: 10px;
box-shadow: 0 1px 1px rgba(0,0,0,.4) inset, 0 1px 0 rgba(255,255,255,.2);
}
/* Form wrapper styling */
.form-wrapper {
/*width: 295px;*/
width: auto;
height: auto;
margin: 2px auto 2px auto;
background: #444;
background: rgba(0,0,0,.2);
border-radius: 10px;
box-shadow: 0 1px 1px rgba(0,0,0,.4) inset, 0 1px 0 rgba(255,255,255,.2);
}
/* Form text input */
.form-wrapper input {
width: 200px;
height: 16px;
padding: 5px 1px;
float: left;
font: bold 15px 'lucida sans', 'trebuchet MS', 'Tahoma';
border: 0;
background: #eee;
border-radius: 0;
}
.form-wrapper input:focus {
outline: 0;
background: #fff;
box-shadow: 0 0 2px rgba(0,0,0,.8) inset;
}
.form-wrapper input::-webkit-input-placeholder {
color: #999;
font-weight: normal;
font-style: italic;
}
.form-wrapper input:-moz-placeholder {
color: #999;
font-weight: normal;
font-style: italic;
}
.form-wrapper input:-ms-input-placeholder {
color: #999;
font-weight: normal;
font-style: italic;
}
/* Form submit button */
.form-wrapper button {
overflow: visible;
position: relative;
float: right;
border: 0;
padding: 0;
cursor: pointer;
height: 26px;
width: 75px;
font: bold 12px/20px 'lucida sans', 'trebuchet MS', 'Tahoma';
color: #fff;
text-transform: uppercase;
background: #d83c3c;
border-radius: 0 3px 3px 0;
text-shadow: 0 -1px 0 rgba(0, 0 ,0, .3);
}
.form-wrapper button:hover{
background: #e54040;
}
.form-wrapper button:active,
.form-wrapper button:focus{
background: #c42f2f;
outline: 0;
}
.form-wrapper button:before { /* left arrow */
content: '';
position: absolute;
border-width: 8px 8px 8px 0;
border-style: solid solid solid none;
border-color: transparent #d83c3c transparent;
top: 5px;
left: -6px;
}
.form-wrapper button:hover:before{
border-right-color: #e54040;
}
.form-wrapper button:focus:before,
.form-wrapper button:active:before{
border-right-color: #c42f2f;
}
.form-wrapper button::-moz-focus-inner { /* remove extra button spacing for Mozilla Firefox */
border: 0;
padding: 0;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 921 B

+10
View File
@@ -0,0 +1,10 @@
<html>
<head>
<title>Chat Tags: Chat Logs</title>
</head>
<body>
<center>
<iframe name="nmMyFrame" id="idMyFrame" src="index.php" width="1000px" height="600px"></iframe>
</center>
</body>
</html>
+486
View File
@@ -0,0 +1,486 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Chat Tags - Chat Logs</title>
<link href="formatting.css" type="text/css" rel="stylesheet" />
<link rel="shortcut icon" href="img/fire.gif" >
<link rel="icon" type="image/gif" href="img/fire.gif" >
<?php
define('ROOT_FOLDER', str_replace("/public", "", $_SERVER['DOCUMENT_ROOT']));
define('STEAM_AUTH_FOLDER', ROOT_FOLDER.'/steamauth/');
//define('REQUIRE_AUTH_FOR_LOGS', 'REQUIRE_AUTH_FOR_LOGS'); //UNCOMMENT THIS LINE TO REQUIRE STEAM AUTH TO SEE LOGS
session_save_path($_SERVER['DOCUMENT_ROOT'].'/sessions');
include_once STEAM_AUTH_FOLDER.'steamauth.php';
$admins = array("STEAM_0:0:36592457", "STEAM_0:0:36592457");
$servername = "";
$username = "";
$password = "";
$dbname = "";
$num_rec_per_page = 30;
if(!function_exists('toSteamID'))
{
function toSteamID($id) //https://gist.github.com/rannmann/49c1321b3239e00f442c
{
if (is_numeric($id) && strlen($id) >= 16)
{
$z = bcdiv(bcsub($id, '76561197960265728'), '2');
}
elseif (is_numeric($id))
{
$z = bcdiv($id, '2'); // Actually new User ID format
}
else
{
return $id; // We have no idea what this is, so just return it.
}
$y = bcmod($id, '2');
return 'STEAM_0:' . $y . ':' . floor($z);
}
}
function LogConnectedSteamID($sSteamID, $sSteamName, $servername, $username, $password, $dbname)
{
try
{
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare("CREATE TABLE IF NOT EXISTS `chatlogs_connections` (`id` int(20) PRIMARY KEY AUTO_INCREMENT, `steamid` VARCHAR(65) NOT NULL, `steamname` VARCHAR(65) NOT NULL) DEFAULT CHARSET=latin1");
$stmt->execute();
$stmt = $conn->prepare("INSERT INTO chatlogs_connections (steamid,steamname) VALUES (:steamid,:steamname)");
$stmt->bindValue(":steamid", $sSteamID, PDO::PARAM_STR);
$stmt->bindValue(":steamname", $sSteamName, PDO::PARAM_STR);
$stmt->execute();
$conn = null;
}
catch(PDOException $e)
{
echo "Error: " . $e->getMessage();
}
}
?>
<script type="text/javascript">
var sReverse = "";
var sOrder = "";
var sPage = "";
function CallQuery()
{
var sParams = "";
if(document.getElementById("idSteamid").value != "")
{
sParams = sParams + "?inputcol=steamid&input=" + encodeURIComponent(document.getElementById("idSteamid").value);
}
else if(document.getElementById("idPlayerName").value != "")
{
sParams = sParams + "?inputcol=playername&input=" + encodeURIComponent(document.getElementById("idPlayerName").value);
}
else if(document.getElementById("idChatText").value != "")
{
sParams = sParams + "?inputcol=chatmsg&input=" + encodeURIComponent(document.getElementById("idChatText").value);
}
else
{
try
{
if(document.getElementById("idPlayerIP").value != "")
{
sParams = sParams + "?inputcol=playerip&input=" + encodeURIComponent(document.getElementById("idPlayerIP").value);
}
}
catch(err)
{
//do nothing
}
}
if((sPage != "") && (sPage != null))
{
sParams = AppendParameter(sParams, "page", sPage);
}
if(sReverse == "true")
{
sParams = AppendParameter(sParams, "reverse", sReverse);
}
if((sOrder != "") && (sOrder != null))
{
sParams = AppendParameter(sParams, "ordercol", sOrder);
}
var idOpenTab = GetOpenTab();
/*
if((idOpenTab != "") && (idOpenTab != null))
{
sParams = AppendParameter(sParams, "opentab", idOpenTab);
}*/
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function()
{
if (this.readyState == 4 && this.status == 200)
{
document.getElementById("idDisplayArea").innerHTML = this.responseText;
if(idOpenTab == null)
{
idOpenTab = "162_248_94_226_27015";
}
document.getElementById(idOpenTab+"_menu").click();
try //in case tags are ever added...
{
var $this = $(this),
href = $this.attr("href");
$(document.body).load(href);
location.href = "#" + href;
}
catch(err)
{
//do nothing
}
}
};
xmlhttp.open("GET", "runquery.php" + sParams, true);
xmlhttp.send();
return;
}
function GetOpenTab()
{
var i, a_oTabContent, idOpenTab;
idOpenTab = "";
try
{
a_oTabContent = document.getElementsByClassName("tabcontent");
for (i = 0; i < a_oTabContent.length; i++)
{
//alert(a_oTabContent[i].style.display);
if(a_oTabContent[i].style.display.indexOf("block") != -1)
{
//alert(a_oTabContent[i].id);
idOpenTab = a_oTabContent[i].id;
return idOpenTab;
}
}
return;
}
catch(err)
{
return;
}
}
window.onload = function()
{
var sOpenTabParam = getParameterByName("opentab", window.location);
if(sOpenTabParam == null)
{
sOpenTabParam = "162_248_94_226_27015";
}
document.getElementById(sOpenTabParam+"_menu").click(); //click link to tab
};
function AppendParameter(sParams, sNewParam, sValue)
{
if(sParams == "")
{
sParams = "?" + sNewParam + "=" + sValue;
}
else
{
sParams = sParams + "&" + sNewParam + "=" + sValue;
}
return sParams;
}
function PageSelect(sPageNum)
{
sPage = sPageNum;
CallQuery();
return false;
}
function OrderColSelect(sOrderCol)
{
sOrder = sOrderCol;
CallQuery();
return false;
}
function ReverseDirSelect(sValue)
{
sReverse = sValue;
CallQuery();
return false;
}
function RedirectPage(sLocation)
{
try
{
window.top.frames["nmMyFrame"].location = sLocation;
}
catch(err)
{
window.location = sLocation;
}
}
function OpenTab(evt, idName)
{
var i, a_oTabContent, a_oTabLinks;
a_oTabContent = document.getElementsByClassName("tabcontent"); // Get all elements with class="tabcontent" and hide them
for (i = 0; i < a_oTabContent.length; i++)
{
a_oTabContent[i].style.display = "none";
}
a_oTabLinks = document.getElementsByClassName("tablinks"); // Get all elements with class="tablinks" and remove the class "active"
for (i = 0; i < a_oTabLinks.length; i++)
{
a_oTabLinks[i].className = a_oTabLinks[i].className.replace(" active", "");
}
document.getElementById(idName).style.display = "block"; // Show the current tab, and add an "active" class to the link that opened the tab
evt.currentTarget.className += " active";
}
function getParameterByName(name, url)
{
if (!url)
{
url = window.location.href;
}
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
</script>
<style>
a:link
{
color: #0066FF;
}
a:visited
{
color: #0066FF;
}
a:hover
{
color: #FF0000;
}
a:active
{
color: #FF6600;
}
body {font-family: "Lato", sans-serif;}
ul.tab
{
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #f1f1f1;
border: 1px solid #ccc;
border-style:solid;
border-width:1px;
}
ul.tab li {float: left;}
ul.tab li a
{
display: inline-block;
color: black;
text-align: center;
font-size:14px;
height:36px;
padding: 6px 6px;
text-decoration: none;
transition: 0.3s;
font-size: 16px;
border-style:solid;
border-width:1px;
font-weight: bold;
align-items: center;
justify-content: center;
display: flex;
}
ul.tab li a:hover
{
background-color: #ff3333;
}
ul.tab li a:focus, .active
{
background-color: #ff6666;
}
.tabcontent
{
display: none;
padding: 6px 12px;
-webkit-animation: fadeEffect 0.2s;
animation: fadeEffect 0.2s;
}
@-webkit-keyframes fadeEffect
{
from {opacity: 0;}
to {opacity: 1;}
}
@keyframes fadeEffect
{
from {opacity: 0;}
to {opacity: 1;}
}
</style>
<base target="_parent" />
</head>
<body>
<div style="min-height:50px;width:1px;"></div>
<div style='position:fixed; top:5px; right:5px; z-index:1;'>
<?php
if(!isset($_SESSION['steamid']))
{
loginbutton("rectangle");
echo '</br>&nbsp&nbsp&nbsp&nbsp<font color="red">[Log In for Additional Options]</font>';
if(defined(REQUIRE_AUTH_FOR_LOGS) == true)
{
$_SESSION['chatlogs_admin'] = "NOT AUTHORIZED";
}
}
else
{
include_once (STEAM_AUTH_FOLDER.'userInfo.php'); //To access the $steamprofile array
$_SESSION['steamid2'] = toSteamID($steamprofile['steamid']);
echo '<font style="font-weight:bold;">Logged in as:</font> '.$steamprofile['personaname'].'</br>('.$_SESSION['steamid2'].')';
$_SESSION['chatlogs_admin'] = "NOT ADMIN";
if(in_array($_SESSION['steamid2'], $admins))
{
$_SESSION['chatlogs_admin'] = "ADMIN";
}
else if(defined(REQUIRE_AUTH_FOR_LOGS) == true)
{
$_SESSION['chatlogs_admin'] = "NOT AUTHORIZED";
}
echo ' <font color="red">['.$_SESSION['chatlogs_admin'].']</font>';
echo '<form action="" method="get"><button name="logout" type="submit" class="btn btn-default btn-sm" style="font-size:16px;"><span class="glyphicon glyphicon-log-out"></span><img src="img/logout.png" style="height:20px;width:20px;border:1px"/>&nbsp&nbspLog out of STEAM</button></form>'; //logoutbutton();
LogConnectedSteamID(toSteamID($steamprofile['steamid']), $steamprofile['personaname'], $servername, $username, $password, $dbname);
}
?>
</div>
<div style="clear:both;" align="center">
<a class="headpoint2" onclick="RedirectPage('index.php')" href="javascript:void(0);" >Chat Tags - Chat Logs</a> <!-- Title -->
</div>
<div style="min-height:30px;width:1px;"></div>
<div class="form-wrapper cf">
<div class="infobox2" style='position:fixed; top:80px; right:0px; z-index:1;'>
<input type="text" placeholder="Input Steam ID Here..." name="nmSteamid" id="idSteamid" onkeyup="CallQuery()">
</div>
<div class="infobox2" style='position:fixed; top:130px; right:0px; z-index:1;'>
<input type="text" placeholder="Input Name Here..." name="nmPlayerName" id="idPlayerName" onkeyup="CallQuery()">
</div>
<div class="infobox2" style='position:fixed; top:180px; right:0px; z-index:1;'>
<input type="text" placeholder="Input Chat Text Here..." name="nmChatText" id="idChatText" onkeyup="CallQuery()">
</div>
<?php
if($_SESSION['chatlogs_admin'] == "ADMIN")
{
echo "<div class='infobox2' style='position:fixed; top:230px; right:0px; z-index:1;'>";
echo '<input type="text" placeholder="Input Player IP Here..." name="nmPlayerIP" id="idPlayerIP" onkeyup="CallQuery()">';
echo '</div>';
}
?>
</div>
<!--
html comment
<!--
<div class="infobox2" style='position:fixed; top:140px; right:0px;'>
<form class="form-wrapper cf">
<input type="text" placeholder="Input IP Here..." required name="player_ip">
<button type="submit" onclick="SearchIP(this.form);" >Search</button>
</form>
</div>
-->
<div style="min-height:100px;width:1px;"></div>
<div style="clear:both;" align="center">
<p class="headpoint3" >Select Server</p>
</div>
<style type="text/css">
.tg {border-collapse:collapse;border-spacing:0;border-radius: 25px;}
.tg td{font-family:Arial, sans-serif;padding:10px 5px;border-style:solid;border-width:2px;overflow:hidden;word-break:normal;border-radius: 25px;}
.tg th
{
font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:2px;overflow:hidden;word-break:normal;
background: white; /* For browsers that do not support gradients */
background: -webkit-radial-gradient(white 25%, grey 60%, rgba(0,0,0,0.5) 15%); /* Safari 5.1-6.0 */
background: -o-radial-gradient(white 25%, grey 60%, rgba(0,0,0,0.5) 15%); /* For Opera 11.6-12.0 */
background: -moz-radial-gradient(white 25%, grey 60%, rgba(0,0,0,0.5) 15%); /* For Firefox 3.6-15 */
background: radial-gradient(white 25%, grey 60%, rgba(0,0,0,0.5) 15%); /* Standard syntax */
border-radius: 25px;
}
.tg .tg-hder{font-weight:bold;font-size:16px;font-family:Arial, Helvetica, sans-serif !important;;background-color:#9b9b9b;color:#000000;text-align:center;border-radius: 25px;}
.tg .tg-game{font-weight:bold;font-size:14px;background-color:#d6d6d6;color:#F0F0F0;text-align:center;background:rgba(255,255,255,0.01);border-radius: 25px;}
.tg .tg-name{font-weight:bold;font-size:14.5px;font-size:16px;background-color:#d6d6d6;color:#F0F0F0;text-align:center;text-decoration: underline;background:rgba(255,255,255,0.01);border-radius: 25px;}
.tg .tg-ver{background-color:#d6d6d6;font-size:14px;color:#F0F0F0;text-align:center;background:rgba(255,255,255,0.01);border-radius: 25px;}
.tg .tg-desc{background-color:#d6d6d6;font-size:14px;color:#F0F0F0;background:rgba(255,255,255,0.01);border-radius: 25px;}
.tg .tg-catg{font-weight:bold;font-size:20px;font-family:"Times New Roman", Times, serif !important;background-color:#EB4646;text-align:center;color:#000000;border-radius: 25px;}
</style>
<?php
$num_rec_per_page = 20;
$thispg = 'http://' . $_SERVER['HTTP_HOST'] .strtok($_SERVER["REQUEST_URI"],'?');
echo '<div name="nmDisplayArea" id="idDisplayArea">';
include_once('runquery.php');
echo '</div>';
?>
<div style="min-height:150px;width:1px;"></div>
<center><div style="clear:both;">
<p class="headpoint5">Page created by That One Guy.</p>
</div></center>
</body>
</html>
+620
View File
@@ -0,0 +1,620 @@
<?php
$servername = "";
$username = "";
$password = "";
$dbname = "";
$tblname = "";
$num_rec_per_page = 30;
$thispg = 'http://' . $_SERVER['HTTP_HOST'] .strtok($_SERVER["REQUEST_URI"],'?');
$thispg = str_replace("runquery.php", "index.php", $thispg); //not needed if file used as an include. needed for ajax though
session_save_path($_SERVER['DOCUMENT_ROOT'].'/sessions');
session_start();
if($_SESSION['chatlogs_admin'] == "NOT AUTHORIZED")
{
echo '<p style="font-size:20px; color:red;" align="center">You must be logged in as an admin to view the chat logs!</p>';
die;
}
function noHTML($input, $encoding = 'UTF-8')
{
return htmlentities($input, ENT_QUOTES | ENT_HTML5, $encoding);
}
function GetSteamID64($steamid)
{
if(preg_match('/^STEAM_[0-9]:[0-9]:[0-9]{1,}/i', $steamid)) // Valid?
{
// Convert
$steamid = str_replace("_", ":", $steamid);
list($part_one, $part_two, $part_three, $part_four) = explode(':', $steamid);
$result = bcadd('76561197960265728', $part_four * 2);
return bcadd($result, $part_three);
}
else
{
return false;
}
}
if(!function_exists('toSteamID'))
{
function toSteamID($id) //https://gist.github.com/rannmann/49c1321b3239e00f442c
{
if(is_numeric($id) && strlen($id) >= 16)
{
$z = bcdiv(bcsub($id, '76561197960265728'), '2');
}
elseif (is_numeric($id))
{
$z = bcdiv($id, '2'); // Actually new User ID format
}
else
{
return $id; // We have no idea what this is, so just return it.
}
$y = bcmod($id, '2');
return 'STEAM_0:' . $y . ':' . floor($z);
}
}
$a_sColNames;
$a_sColNames = array();
$a_sServers;
$a_sServers = array();
define('ROOT_FOLDER', str_replace("/public", "", $_SERVER['DOCUMENT_ROOT']));
define('STEAM_AUTH_FOLDER', ROOT_FOLDER.'/steamauth/');
/*if(isset($_SESSION['steamid']))
{
include_once (STEAM_AUTH_FOLDER.'userInfo.php'); //To access the $steamprofile array
LogConnectedSteamID(toSteamID($steamprofile['steamid']), $steamprofile['personaname'], $servername, $username, $password, $dbname);
}*/
//echo 'session id: '.$_SESSION['steamid2'].'</br>';
//include_once STEAM_AUTH_FOLDER.'steamauth.php';
//include_once (STEAM_AUTH_FOLDER.'userInfo.php'); //To access the $steamprofile array
//$_SESSION['steamid2'] = toSteamID($steamprofile['steamid']);
//$GLOBALS['steamid2']
//echo "<script>alert(\"test\");</script>";
if(isset($_GET["page"]))
{
$currentpage = urldecode($_GET["page"]);
}
else
{
$currentpage = 1;
};
if(isset($_GET["server"]))
{
$server = urldecode($_GET["server"]);
}
else
{
$server = 1;
};
if(isset($_GET["input"]) && isset($_GET["inputcol"]))
{
$input = urldecode($_GET["input"]);
$inputcol = urldecode($_GET["inputcol"]);
if($_SESSION['chatlogs_admin'] != "ADMIN")
{
if(($inputcol == "playerip"))
{
$input = "";
$inputcol = "";
}
}
}
else
{
$input = "";
$inputcol = "";
//echo "<script>alert(\"".$steamid."\");</script>";
};
if(isset($_GET["ordercol"]))
{
$ordercol = urldecode($_GET["ordercol"]);
}
else
{
$ordercol = "id";
};
if(isset($_GET["reverse"]))
{
$reverse = urldecode($_GET["reverse"]);
}
else
{
$reverse = "";
};
class TableHeaders extends RecursiveIteratorIterator
{
function __construct($it)
{
parent::__construct($it, self::LEAVES_ONLY);
}
function current()
{
$colname = parent::current();
if(($colname == "playername"))
{
$minwidth = 200;
}
else if(($colname == "ip_country") || ($colname == "logdate"))
{
$minwidth = 110;
}
else if(($colname == "chatmsg"))
{
$minwidth = 250;
}
else if(($colname == "chatgrp"))
{
$minwidth = 75;
}
else if(($colname == "mapname") || ($colname == "server") || ($colname == "steamid"))
{
$minwidth = 140;
}
else
{
$minwidth = 0;
}
$colname = str_replace("_", " ", $colname);
if($colname == "mapname")
{
$colname = "Map Name";
}
else if($colname == "steamid")
{
$colname = "Steam ID";
}
else if($colname == "server")
{
$colname = "Server IP";
}
else if($colname == "playername")
{
$colname = "Player Name";
}
else if($colname == "playerip")
{
$colname = "Player IP";
}
else if($colname == "chatmsg")
{
$colname = "Chat Message";
}
else if($colname == "ip country")
{
$colname = "Country";
}
else if($colname == "ip_country")
{
$colname = "Country";
}
else if($colname == "chatgrp")
{
$colname = "Message Type";
}
else if($colname == "logdate")
{
$colname = "Message Date";
}
if(isset($_GET["ordercol"])) //if set
{
$ordercol = urldecode($_GET["ordercol"]);
if(!empty($ordercol)) //if not set to blank
{
if($ordercol == parent::current()) //if the current one we're setting, check for reverse
{
if(!isset($_GET["reverse"]))
{
//return "<th style='min-width:".$minwidth."px;border:1px dotted black;word-wrap: break-word;'><a href='".$thispg."?ordercol=".parent::current()."&reverse=true'>".$colname. " &#9660</a></th>";
return "<th style='min-width:".$minwidth."px;border:1px dotted black;word-wrap: break-word;'><a onclick='ReverseDirSelect(\"true\")' href='javascript:void(0);'>".$colname. " &#9660</a></th>";
}
else
{
$reverse = urldecode($_GET["reverse"]);
if(($reverse == "false") || empty($reverse))
{
//return "<th style='min-width:".$minwidth."px;border:1px dotted black;word-wrap: break-word;'><a href='".$thispg."?ordercol=".parent::current()."&reverse=true'>".$colname. " &#9660</a></th>";
return "<th style='min-width:".$minwidth."px;border:1px dotted black;word-wrap: break-word;'><a onclick='ReverseDirSelect(\"true\")' href='javascript:void(0);'>".$colname. " &#9660</a></th>";
}
else
{
//return "<th style='min-width:".$minwidth."px;border:1px dotted black;word-wrap: break-word;'><a href='".$thispg."?ordercol=".parent::current()."'>".$colname. " &#9650</a></th>";
return "<th style='min-width:".$minwidth."px;border:1px dotted black;word-wrap: break-word;'><a onclick='ReverseDirSelect(\"false\")' href='javascript:void(0);'>".$colname. " &#9660</a></th>";
}
}
}
}
}
//return "<th style='min-width:".$minwidth."px;border:1px dotted black;word-wrap: break-word;'><a href='".$thispg."?ordercol=".parent::current()."'>".$colname. "</a></th>";
return "<th style='min-width:".$minwidth."px;border:1px dotted black;word-wrap: break-word;'><a onclick='OrderColSelect(\"".parent::current()."\")' href='javascript:void(0);'>".$colname. "</a></th>";
}
function beginChildren()
{
echo "<tr>";
}
function endChildren()
{
echo "</tr>";
}
}
class TableRows extends RecursiveIteratorIterator
{
function __construct($it)
{
parent::__construct($it, self::LEAVES_ONLY);
}
function current()
{
if(parent::current() == "")
{
$value = "-";
}
else
{
$value = noHTML(parent::current());
}
//return "<td style='border:1px solid black;text-align: center;'>".$value. "</td>";
if(strpos($value, "STEAM_") === false)
{
return "<td style='border:1px solid black;text-align: center;'>".$value. "</td>";
}
else
{
return '<td style="border:1px solid black;text-align: center;"><a href="http://steamcommunity.com/profiles/' .GetSteamID64($value). '" target="_blank">' .$value. '</a></td>';
}
}
function beginChildren()
{
echo "<tr>";
}
function endChildren()
{
echo "</tr>" . "\n";
}
}
try
{
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare("SELECT DISTINCT server FROM ".$tblname);
$stmt->execute();
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
$result = $stmt->fetchAll();
foreach ($result as $key => $value)
{
$a_sServers[] = $value['server'];
}
//create tabs
echo '<div style="min-height:5px;text-align:center;" >';
echo '<div style="display: inline-block;">';
echo '<ul class="tab" >';
foreach($a_sServers as $sServer)
{
$sServerName = $sServer;
if($sServerName == "13.73.0.133:27019")
{
$sServerName = "Test Server</br>(".$sServerName.")";
}
else if($sServerName == "13.73.0.133:27017")
{
$sServerName = "Some Fake Server</br>(".$sServerName.")";
}
echo '<li><a id="'.str_replace(":", "_", str_replace(".", "_", $sServer)).'_menu" href="javascript:void(0)" class="tablinks" onclick="OpenTab(event, \''.str_replace(":", "_", str_replace(".", "_", $sServer)).'\')">'.$sServerName.'</a></li>';
}
echo '</ul>';
echo '</div>';
echo '</div>';
foreach($a_sServers as $sServer)
{
$sServerDiv = str_replace(".", "_", str_replace(":", "_", $sServer));
$server = $sServer;
echo '<div id="'.$sServerDiv.'" class="tabcontent"> <div id="wrap">';
/*echo ' <table class="tg" border="3">';
echo '<tr><col width="130"><col width="175"><col width="120"><col width="600"><col width="130"><col width="175"><col width="120"><col width="600">';
echo '<th class="tg-hder">Server IP</th><th class="tg-hder">Map Name</th><th class="tg-hder">Steam ID</th><th class="tg-hder">Player Name</th>';
echo '<th class="tg-hder">Country</th><th class="tg-hder">Message Type</th><th class="tg-hder">Message</th><th class="tg-hder">Message Date</th></tr>';
*/
//$stmt = $conn->prepare("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '".$tblname."'");
$sQuery = "SELECT 'server','mapname','steamid','playername'";
if($_SESSION['chatlogs_admin'] == "ADMIN")
{
$sQuery .=",'playerip'";
}
$sQuery .=",'ip_country','chatgrp','chatmsg','logdate'";
$stmt = $conn->prepare($sQuery);
$stmt->execute();
// set the resulting array to associative
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
$result = $stmt->fetchAll();
foreach ($result as $key => $value)
{
//$a_sColNames[] = $value['COLUMN_NAME'];
$a_sColNames[] = "server";
$a_sColNames[] = "mapname";
$a_sColNames[] = "steamid";
$a_sColNames[] = "playername";
$a_sColNames[] = "playerip";
$a_sColNames[] = "ip_country";
$a_sColNames[] = "chatgrp";
$a_sColNames[] = "chatmsg";
$a_sColNames[] = "logdate";
}
$headers = '';
foreach(new TableHeaders(new RecursiveArrayIterator($result)) as $key=>$value)
{
$headers = $headers.$value;
}
//echo "<script>alert(\"".$headers."\");</script>";
echo "<table style='border: solid 1px black; padding:20px 20px 20px 20px; table-layout:fixed;'>";
echo $headers;
$start_from = ($currentpage - 1) * $num_rec_per_page;
if(empty($reverse) || ($reverse == "false"))
{
$orderdir = "DESC";
}
else
{
$orderdir = "ASC";
}
if($_SESSION['chatlogs_admin'] == "ADMIN")
{
//echo "<script>alert(\"admin\");</script>";
$query = "SELECT server,mapname,steamid,playername,playerip,ip_country,chatgrp,chatmsg,logdate FROM ".$tblname." ";
}
else
{
//echo "<script>alert(\"not admin\");</script>";
$query = "SELECT server,mapname,steamid,playername,ip_country,chatgrp,chatmsg,logdate FROM ".$tblname." ";
}
$bWhere = false;
if(!empty($inputcol))
{
$bValid = false;
foreach($a_sColNames as $sColName)
{
if($sColName == $inputcol)
{
$bValid = true;
break;
}
}
if($bValid == false)
{
$inputcol = "";
}
}
$bValid = false;
foreach($a_sColNames as $sColName)
{
if($sColName == $ordercol)
{
$bValid = true;
break;
}
}
if($bValid == false)
{
$ordercol = "id";
}
if(!(empty($input) || empty($inputcol)))
{
$bWhere = true;
if(($inputcol == "playername") || ($inputcol == "playerip") || ($inputcol == "steamid") || ($inputcol == "chatmsg"))
{
$query = $query."WHERE (".$inputcol." LIKE :inputstr) ";
$inputtemp = '%'.$input.'%';
}
else
{
$query = $query."WHERE (".$inputcol." = :inputstr) ";
}
}
if(!empty($server))
{
if($bWhere === false)
{
$query = $query."WHERE (server = :server) ";
}
else
{
$query = $query."AND (server = :server) ";
}
$bWhere = true;
}
$query = $query." ORDER BY ".$ordercol." ".$orderdir." LIMIT :startpgnum, ".$num_rec_per_page;
//echo $query;
$stmt = $conn->prepare($query);
if(!(empty($input) || empty($inputcol)))
{
$stmt->bindValue(":inputstr", $inputtemp, PDO::PARAM_STR);
}
if(!empty($server))
{
$stmt->bindValue(":server", $server, PDO::PARAM_STR);
}
$stmt->bindValue(":startpgnum", $start_from, PDO::PARAM_INT);
$stmt->execute();
// set the resulting array to associative
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
foreach(new TableRows(new RecursiveArrayIterator($stmt->fetchAll())) as $k=>$v)
{
echo $v;
}
echo "</table>";
//page numbers
if(empty($input) || empty($inputcol))
{
if(!empty($server))
{
$query = "SELECT * FROM ".$tblname." WHERE server = :server";
}
else
{
$query = "SELECT * FROM ".$tblname;
}
}
else
{
if(($inputcol == "playername") || ($inputcol == "playerip") || ($inputcol == "steamid") || ($inputcol == "chatmsg"))
{
$query = "SELECT * FROM ".$tblname." WHERE ".$inputcol." LIKE :inputstr";
$inputtemp = '%'.$input.'%';
}
else
{
$query = "SELECT * FROM ".$tblname." WHERE ".$inputcol." = :inputstr";
}
if(!empty($server))
{
$query = $query." AND server = :server";
}
}
$stmt = $conn->prepare($query);
if(!(empty($input) || empty($inputcol)))
{
$stmt->bindValue(":inputstr", $inputtemp, PDO::PARAM_STR);
}
if(!empty($server))
{
$stmt->bindValue(":server", $server, PDO::PARAM_STR);
}
$stmt->execute();
$i_count = $stmt->rowCount();
$total_pages = ceil($i_count / $num_rec_per_page);
echo "<span style='font-weight: bold;'>Page: </span>";
if($total_pages <= 10)
{
for($i = 1; $i <= $total_pages; $i++)
{
if($i == $currentpage)
{
echo "<span>".$i."</span>";
}
else
{
echo '<a onclick="PageSelect('.$i.')" href="javascript:void(0);">'.$i.'</a>';
}
echo "<span> </span>";
};
}
else
{
if($currentpage < 8) //7 or less, then list first 10
{
for($i = 1; $i <= 9; $i++)
{
if($i == $currentpage)
{
echo "<span>".$i."</span>";
}
else
{
echo '<a onclick="PageSelect('.$i.')" href="javascript:void(0);">'.$i.'</a>';
}
echo "<span> </span>";
};
echo '<a onclick="PageSelect('.($currentpage + 1).')" href="javascript:void(0);">></a>'; // Goto next page at end of list
echo "<span> ... </span>";
echo '<a onclick="PageSelect('.$total_pages.')" href="javascript:void(0);">'.$total_pages.'</a>'; // Goto last page
}
else
{
echo '<a onclick="PageSelect(1)" href="javascript:void(0);">1</a>'; // Goto 1st page
echo '<span> </span><a onclick="PageSelect(2)" href="javascript:void(0);">2</a>';
echo '<span> </span><a onclick="PageSelect(3)" href="javascript:void(0);">3</a>';
echo '<span> ... </span>';
$i_temp = $currentpage - 2;
echo '<a onclick="PageSelect('.$i_temp.')" href="javascript:void(0);">'.$i_temp.'</a><span> </span>'; //2 less
$i_temp++;
echo '<a onclick="PageSelect('.$i_temp.')" href="javascript:void(0);">'.$i_temp.'</a><span> </span>'; //1 less
$i_temp++;
echo "<span>".$i_temp."</span>"; //current
echo "<span> </span>";
$i_temp++;
if($i_temp <= $total_pages) //if not past last, continue
{
echo '<a onclick="PageSelect('.$i_temp.')" href="javascript:void(0);">'.$i_temp.'</a><span> </span>'; //1 past current
$i_temp++;
if($i_temp <= $total_pages) //if not past last, continue
{
echo '<a onclick="PageSelect('.$i_temp.')" href="javascript:void(0);">'.$i_temp.'</a><span> </span>'; //2 past current
$i_temp++;
if($i_temp <= $total_pages) //if not past last, show 'next'
{
if(($i_temp + 1 == $total_pages) || ($i_temp == $total_pages)) //show number if within last 2
{
echo '<a onclick="PageSelect('.$i_temp.')" href="javascript:void(0);">'.$i_temp.'</a>';
}
else //show symbol for next instead of number
{
echo '<a onclick="PageSelect('.$i_temp.')" href="javascript:void(0);">></a>';
}
$i_temp++;
if($i_temp <= $total_pages) //if not past last, show last
{
if($i_temp < $total_pages)
{
echo "<span> ... </span>";
}
else
{
echo "<span> </span>";
}
echo '<a onclick="PageSelect('.$total_pages.')" href="javascript:void(0);">'.$total_pages.'</a>'; // Goto last page
}
}
}
}
}
}
echo '</div></div>';
}
}
catch(PDOException $e)
{
echo "Error: " . $e->getMessage();
}
$conn = null;
?>
@@ -0,0 +1,54 @@
1. Create a database, username, and password for the plugin validation table.
////////////////////////////////////////////////////////////////////
2. Run the query to create the validation table. It is stored in Validation Database Table Creation Query.sql
You can certainly add additional columns for keeping notes, as required. The notes column isnt actually used by the validation, so you can leave that out if you wish as well.
////////////////////////////////////////////////////////////////////
3. Edit lines 2-5 of validationdatabase_web.php to be the database information set up in step 1.
////////////////////////////////////////////////////////////////////
4. Edit the include for the plugin: servervalidation.inc
Change the line: #define VALIDATION_PHP_URL "http://www.domain.com/servervalidation/validationdatabase_web.php"
Set it to the path for wherever you installed the servervalidation folder.
////////////////////////////////////////////////////////////////////
5. Look for the following lines near the top of the plugin that is to be validated. If they dont exist, add them:
#if defined(VALIDATION_TIME) || defined(VALIDATION_IP) || defined(VALIDATION_HOSTNAME) || defined(VALIDATION_DATABASE)
#include <servervalidation>
#endif
Directly above these lines, add this line:
#define VALIDATION_DATABASE
////////////////////////////////////////////////////////////////////
6. Search in the plugin for: public void OnPluginStart().
Note: The word void may or may not be included in the line if it is old syntax.
Inside of this function, add the following code (if it doesnt already exist):
#if defined(VALIDATION_TIME) || defined(VALIDATION_IP) || defined(VALIDATION_HOSTNAME) || defined(VALIDATION_DATABASE)
ValidateServer("SOME PLUGIN KEY HERE");
#endif
Note: Replace "SOME PLUGIN KEY HERE" with some custom key for further validation that is harder to spoof.
Leave as empty quotes to exclude the additional check (though there is no reason not to use it).
////////////////////////////////////////////////////////////////////
7. Recompile the plugin.
////////////////////////////////////////////////////////////////////
8. In the database, insert a row with the server IP under `serveraddr`, the plugin file name under `pluginname`, and the key you made in step 6 under `pluginkey`.
At this time, the port is not checked in the validation.
For the plugin name, you dont need to include .smx, but it wont break the validation if you do.
The validaiton query will look for the pluginname with wildcards on either side, so if the database has .smx included, it will still find a match.
Note: The whole PHP page is coded using prepared statements to protect against SQL injection.
////////////////////////////////////////////////////////////////////
9. Install socket extension on the game server. This extension is used to communicate with the web page. You can find the extension here:
https://forums.alliedmods.net/showthread.php?t=67640
////////////////////////////////////////////////////////////////////
10. Put the plugin on the server and reload it via RCon (sm plugins reload YOUR_PLUGINS_NAME_HERE).
If you changed anything in your databases.cfg file for the plugin, you will need to restart the server.
@@ -0,0 +1,8 @@
CREATE TABLE IF NOT EXISTS `validatedplugins` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`serveraddr` varchar(60) NOT NULL,
`pluginname` varchar(200) NOT NULL,
`pluginkey` varchar(200) DEFAULT NULL,
`notes` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
@@ -0,0 +1,62 @@
<?php
$servername = "localhost"; //PUT THE ACTUAL IP IF THIS IS A REMOTE CONNECTION
$username = "DATABASE USERNAME HERE";
$password = "PASSWORD HERE";
$dbname = "NAME OF DATABASE HERE";
if(isset($_GET["serveraddr"]))
{
$serveraddr = $_GET["serveraddr"];
}
if(isset($_GET["pluginname"]))
{
$pluginname = $_GET["pluginname"];
}
try
{
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
if(isset($_GET["pluginkey"]))
{
$pluginkey = $_GET["pluginkey"];
$stmt = $conn->prepare("SELECT serveraddr,pluginname,pluginkey FROM validatedplugins WHERE (serveraddr LIKE :serveraddr) AND (pluginname LIKE :pluginname) AND (pluginkey = :pluginkey);");
$stmt->bindValue(':serveraddr', "%{$serveraddr}%");
$stmt->bindValue(':pluginname', "%{$pluginname}%");
$stmt->bindValue(':pluginkey', $pluginkey);
}
else
{
$stmt = $conn->prepare("SELECT serveraddr,pluginname FROM validatedplugins WHERE (serveraddr LIKE :serveraddr) AND (pluginname LIKE :pluginname);");
$stmt->bindValue(':serveraddr', "%{$serveraddr}%");
$stmt->bindValue(':pluginname', "%{$pluginname}%");
}
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC); //$row = $stmt->fetch();
$pos = strpos($row['pluginname'], $pluginname);
if(!($pos === false) && ($row['serveraddr'] == $serveraddr))
{
echo "PLUGIN IS VALID";
}
else
{
echo "PLUGIN IS INVALID!!!";
}
//var_dump($stmt);
//var_dump($row);
//$result = $stmt->setFetchMode(PDO::FETCH_ASSOC); // set the resulting array to associative
//echo "Plugin Valid: $result['pluginname']";
//echo $result['pluginname'];
//echo "<script>alert(\"".$headers."\");</script>";
}
catch(PDOException $e)
{
echo "Error: " . $e->getMessage();
}
$conn = null;
$stmt = null;
?>
+13
View File
@@ -0,0 +1,13 @@
<?php
//Version 3.2
$steamauth['apikey'] = ""; // Your Steam WebAPI-Key found at http://steamcommunity.com/dev/apikey
$steamauth['domainname'] = "http://server.possession.tokyo"; // The main URL of your website displayed in the login page
$steamauth['logoutpage'] = ""; // Page to redirect to after a successfull logout (from the directory the SteamAuth-folder is located in) - NO slash at the beginning!
$steamauth['loginpage'] = ""; // Page to redirect to after a successfull login (from the directory the SteamAuth-folder is located in) - NO slash at the beginning!
// System stuff
if (empty($steamauth['apikey'])) {die("<div style='display: block; width: 100%; background-color: red; text-align: center;'>SteamAuth:<br>Please supply an API-Key!</div>");}
if (empty($steamauth['domainname'])) {$steamauth['domainname'] = $_SERVER['SERVER_NAME'];}
if (empty($steamauth['logoutpage'])) {$steamauth['logoutpage'] = $_SERVER['PHP_SELF'];}
if (empty($steamauth['loginpage'])) {$steamauth['loginpage'] = $_SERVER['PHP_SELF'];}
?>
File diff suppressed because it is too large Load Diff
+77
View File
@@ -0,0 +1,77 @@
<?php
ob_start();
session_start();
function logoutbutton()
{
echo "<form action='' method='get'><button name='logout' type='submit'>Logout of Steam</button></form>"; //logout button
}
function loginbutton($buttonstyle = "square")
{
$button['rectangle'] = "01";
$button['square'] = "02";
$button = "<a href='?login'><img src='http://cdn.steamcommunity.com/public/images/signinthroughsteam/sits_".$button[$buttonstyle].".png'></a>";
echo $button;
}
if (isset($_GET['login'])){
require 'openid.php';
try {
require 'SteamConfig.php';
$openid = new LightOpenID($steamauth['domainname']);
if(!$openid->mode) {
$openid->identity = 'http://steamcommunity.com/openid';
header('Location: ' . $openid->authUrl());
} elseif ($openid->mode == 'cancel') {
echo 'User has canceled authentication!';
} else {
if($openid->validate()) {
$id = $openid->identity;
$ptn = "/^http:\/\/steamcommunity\.com\/openid\/id\/(7[0-9]{15,25}+)$/";
preg_match($ptn, $id, $matches);
$_SESSION['steamid'] = $matches[1];
if (!headers_sent()) {
header('Location: '.$steamauth['loginpage']);
exit;
} else {
?>
<script type="text/javascript">
window.location.href="<?=$steamauth['loginpage']?>";
</script>
<noscript>
<meta http-equiv="refresh" content="0;url=<?=$steamauth['loginpage']?>" />
</noscript>
<?php
exit;
}
} else {
echo "User is not logged in.\n";
}
}
} catch(ErrorException $e) {
echo $e->getMessage();
}
}
if (isset($_GET['logout'])){
require 'SteamConfig.php';
session_unset();
session_destroy();
header('Location: '.$steamauth['logoutpage']);
exit;
}
if (isset($_GET['update']) || !empty($_SESSION['steam_uptodate']) && $_SESSION['steam_uptodate']+(24*60*60) < time()){
unset($_SESSION['steam_uptodate']);
require 'userInfo.php';
header('Location: '.$_SERVER['PHP_SELF']);
exit;
}
// Version 3.2
?>
+43
View File
@@ -0,0 +1,43 @@
<?php
if (empty($_SESSION['steam_uptodate']) or empty($_SESSION['steam_personaname'])) {
require 'SteamConfig.php';
$url = file_get_contents("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=".$steamauth['apikey']."&steamids=".$_SESSION['steamid']);
$content = json_decode($url, true);
$_SESSION['steam_steamid'] = $content['response']['players'][0]['steamid'];
$_SESSION['steam_communityvisibilitystate'] = $content['response']['players'][0]['communityvisibilitystate'];
$_SESSION['steam_profilestate'] = $content['response']['players'][0]['profilestate'];
$_SESSION['steam_personaname'] = $content['response']['players'][0]['personaname'];
$_SESSION['steam_lastlogoff'] = $content['response']['players'][0]['lastlogoff'];
$_SESSION['steam_profileurl'] = $content['response']['players'][0]['profileurl'];
$_SESSION['steam_avatar'] = $content['response']['players'][0]['avatar'];
$_SESSION['steam_avatarmedium'] = $content['response']['players'][0]['avatarmedium'];
$_SESSION['steam_avatarfull'] = $content['response']['players'][0]['avatarfull'];
$_SESSION['steam_personastate'] = $content['response']['players'][0]['personastate'];
if (isset($content['response']['players'][0]['realname'])) {
$_SESSION['steam_realname'] = $content['response']['players'][0]['realname'];
} else {
$_SESSION['steam_realname'] = "Real name not given";
}
$_SESSION['steam_primaryclanid'] = $content['response']['players'][0]['primaryclanid'];
$_SESSION['steam_timecreated'] = $content['response']['players'][0]['timecreated'];
$_SESSION['steam_uptodate'] = time();
}
$steamprofile['steamid'] = $_SESSION['steam_steamid'];
$steamprofile['communityvisibilitystate'] = $_SESSION['steam_communityvisibilitystate'];
$steamprofile['profilestate'] = $_SESSION['steam_profilestate'];
$steamprofile['personaname'] = $_SESSION['steam_personaname'];
$steamprofile['lastlogoff'] = $_SESSION['steam_lastlogoff'];
$steamprofile['profileurl'] = $_SESSION['steam_profileurl'];
$steamprofile['avatar'] = $_SESSION['steam_avatar'];
$steamprofile['avatarmedium'] = $_SESSION['steam_avatarmedium'];
$steamprofile['avatarfull'] = $_SESSION['steam_avatarfull'];
$steamprofile['personastate'] = $_SESSION['steam_personastate'];
$steamprofile['realname'] = $_SESSION['steam_realname'];
$steamprofile['primaryclanid'] = $_SESSION['steam_primaryclanid'];
$steamprofile['timecreated'] = $_SESSION['steam_timecreated'];
$steamprofile['uptodate'] = $_SESSION['steam_uptodate'];
// Version 3.2
?>