diff --git a/admin-slammer.php b/admin-slammer.php index 99447e1..ede9f98 100644 --- a/admin-slammer.php +++ b/admin-slammer.php @@ -42,6 +42,7 @@ else if ($_POST['knockout']) echo "Delivered IP ban to {$uinfo['lastip']}.\n"; xk_ircsend("1|". xk(8) . $uinfo['name'] . xk(7). " (IP " . xk(8) . $uinfo['lastip'] . xk(7) .") is the latest victim of the new EZ BAN button(tm)."); + report("super", "**" . $uinfo['name'] . "** (IP " . $uinfo['lastip'] .") is the latest victim of the new EZ BAN button(tm)."); echo "\n".redirect("admin-slammer.php", 'the slammer (for another go)', 2); die(); diff --git a/editprofile.php b/editprofile.php index 3b661ea..4ace254 100644 --- a/editprofile.php +++ b/editprofile.php @@ -214,6 +214,7 @@ $sex=2; $oldtitle = ""; + $title = stripslashes($title); while ($oldtitle != $title) { $oldtitle = $title; $title=preg_replace("'<(b|i|u|s|small|br)>'si", '[\\1]', $title); @@ -231,6 +232,8 @@ $title=preg_replace("'(face|style|class|size|id)=\'([^ ].*?)\''si", '', $title); $title=preg_replace("'(face|style|class|size|id)=([^ ].*?)'si", '', $title); } + $title = addslashes($title); + $bio=preg_replace("'nload', $bio); diff --git a/ext/ppdgauge.php b/ext/ppdgauge.php index b083c1e..06ca60e 100644 --- a/ext/ppdgauge.php +++ b/ext/ppdgauge.php @@ -69,7 +69,7 @@ $cx = ($i) / 25 * 255; $cc = imagecolorallocate($image, 255, $cx, 0); } elseif ($i <= 49) { - $cx = ($i - 75) / 25 * 127; + $cx = ($i - 25) / 25 * 127; $cc = imagecolorallocate($image, 255 - $cx, 255 - $cx, $cx); } elseif ($i <= 74) { $cx = ($i - 50) / 25 * 31; diff --git a/irc.php b/irc.php index 05123d0..fa6b2ec 100644 --- a/irc.php +++ b/irc.php @@ -9,9 +9,14 @@ require 'lib/layout.php'; $servers[3] = "irc.tcrf.net"; if ($server > count($servers) || $server <= -1) $server = 0; + print "$header
"; + print " $tblstart + $tccellh>Hold up, it's ". '$' ."YEAR. + $tccell1>Maybe you want to head straight for our Discord? + $tblend"; -print " $header
$tblstart +print "

$tblstart $tccellh>IRC Chat - BadnikZONE, #tcrf, #x $tccell1>Server List: "; diff --git a/lib/function.php b/lib/function.php index 849f18f..544c042 100644 --- a/lib/function.php +++ b/lib/function.php @@ -243,7 +243,10 @@ $sql->query("UPDATE `users` SET `sex` = '22' WHERE `id` = 20"); #nicole $sql->query("UPDATE `users` SET `sex` = '23' WHERE `id` = 50"); #Rena $sql->query("UPDATE `users` SET `sex` = '24' WHERE `id` = 2069"); #Adelheid/Stark/etc. - + // So I can switch between Schezo/Witch colors myself :D + $kakcol = filter_bool($_GET['witch_colors']) ? 96 : 25; + $sql->query("UPDATE `users` SET `sex` = '{$kakcol}' WHERE `id` = 2889"); #Kak + $sql->query("UPDATE `users` SET `name` = 'Xkeeper' WHERE `id` = 1"); #Xkeeper. (Change this and I WILL Z-Line you from Badnik for a week.) } @@ -880,6 +883,8 @@ function getnamecolor($sex, $powl, $prefix = true){ $namecolor .= "77ECFF"; break; case 24: // Adelheid $namecolor .= "D2A6E1"; break; + case 25: // Kak - Schezo + $namecolor .= "D8E8FE"; break; case 41: $namecolor .= "8a5231"; break; case 42: @@ -890,6 +895,8 @@ function getnamecolor($sex, $powl, $prefix = true){ $namecolor .= $nmcol[0][3]; break; case 97: $namecolor .= "6600DD"; break; + case 96: // Kak - Witch + $namecolor .= $nmcol[2][3]; break; // Make it readable in case the user has a light theme default: $namecolor .= $nmcol[$sex][$powl]; break; @@ -1253,6 +1260,8 @@ function dofilters($p){ //$p=preg_replace("'(https?://.*?photobucket.com/)'si",'images/photobucket.png#\\1',$p); $p=preg_replace("'http://.{0,3}\.?tinypic\.com'si",'tinyshit',$p); $p=str_replace('',"",$p); + $p=str_replace('yukina.io',"",$p); // hiryuu's domain, dead, css lags + $p=str_replace('safiria.net',"",$p); $p=str_replace("tabindex=\"0\" ","title=\"the owner of this button is a fucking dumbass\" ",$p); // $p=str_replace("http://xkeeper.shacknet.nu:5/", 'http://xchan.shacknet.nu:5/', $p); @@ -1329,6 +1338,17 @@ function addslashes_array($data) { } + function report($type, $msg) { + if (!function_exists('get_discord_webhook')) return; + + $wh_url = get_discord_webhook($type, null); + + if (!$wh_url) return; + + discord_send($wh_url, $outdiscord); + } + + // general purpose report function, now with discord! function xk_ircout($type, $user, $in) { // gone @@ -1350,18 +1370,33 @@ function addslashes_array($data) { if ($in['pmatch'] >= 3) $color = array(7, 4); elseif ($in['pmatch'] >= 5) $color = array(4, 5); $extra = " (". xk($color[1]) ."Password matches: ". xk($color[0]) . $in['pmatch'] . xk() .")"; + $extradiscord = " (**Password matches**: " . $in['pmatch'] . ")"; } $out = "1|New user: #". xk(12) . $in['id'] . xk(11) ." $user ". xk() ."(IP: ". xk(12) . $in['ip'] . xk() .")$extra: https://jul.rustedlogic.net/?u=". $in['id']; + $outdiscord = "New user: **#" . $in['id'] . "** ". $user . " (IP: " . $in['ip'] . ")$extra: "; } else { // global $sql; // $res = $sql -> resultq("SELECT COUNT(`id`) FROM `posts`"); $out = "$dest|New $type by ". xk(11) . $user . xk() ." (". xk(12) . $in['forum'] .": ". xk(11) . $in['thread'] . xk() ."): https://jul.rustedlogic.net/?p=". $in['pid']; + $outdiscord = "New $type by **" . $user . "** (" . $in['forum'] . ": **" . $in['thread'] . "**): "; } xk_ircsend($out); + + // discord part + + // logic to decide where the message goes based on info provided + if (!function_exists('get_discord_webhook')) return; + + $wh_url = get_discord_webhook($type, $in); + + if (!$wh_url) return; + + discord_send($wh_url, $outdiscord); + } function xk_ircsend($str) { @@ -1380,6 +1415,28 @@ function addslashes_array($data) { return true; } + function discord_send($url, $msg) { + // stripped down from https://gist.github.com/Mo45/cb0813cb8a6ebcd6524f6a36d4f8862c + $json_data = json_encode([ + "content" => $msg + ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + + + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json')); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + + $response = curl_exec($ch); + // echo $response; + curl_close($ch); + + return true; + } + function xk($n = -1) { if ($n == -1) $k = ""; else $k = str_pad($n, 2, 0, STR_PAD_LEFT); diff --git a/lib/layout.php b/lib/layout.php index 6a66f49..52ecacd 100644 --- a/lib/layout.php +++ b/lib/layout.php @@ -530,7 +530,7 @@ Acmlmboard - ". (file_exists('version.txt') ? file_get_contents("version.txt") : shell_exec("git log --format='commit %h [%ad]' --date='short' -n 1")) ." -
©2000-". date("Y") ." Acmlm, Xkeeper, Kaito Sinclaire, et al. $ikachan_text +
©2000-". date("Y") ." Acmlm, Xkeeper, et al. $ikachan_text diff --git a/login.php b/login.php index 57aca60..f8dfd6d 100644 --- a/login.php +++ b/login.php @@ -40,11 +40,14 @@ //if ($fails > 1) @xk_ircsend("102|". xk(14) ."Failed attempt". xk(8) ." #$fails ". xk(14) ."to log in as ". xk(8) . $username . xk(14) ." by IP ". xk(8) . $_SERVER['REMOTE_ADDR'] . xk(14) ."."); + report("mod", "Failed attempt **#$fails** to log in as **$username** by IP " . $_SERVER['REMOTE_ADDR'] . "."); if ($fails >= 5) { $sql->query("INSERT INTO `ipbans` SET `ip` = '". $_SERVER['REMOTE_ADDR'] ."', `date` = '". ctime() ."', `reason` = 'Send e-mail for password recovery'"); @xk_ircsend("102|". xk(7) ."Auto-IP banned ". xk(8) . $_SERVER['REMOTE_ADDR'] . xk(7) ." for this."); + report("mod", "Auto-IP banned " . $_SERVER['REMOTE_ADDR'] . "for this."); @xk_ircsend("1|". xk(7) ."Auto-IP banned ". xk(8) . $_SERVER['REMOTE_ADDR'] . xk(7) ." for repeated failed logins."); + report("super", "Auto-IP banned " . $_SERVER['REMOTE_ADDR'] . "for repeated failed logins."); } $msg = "Couldn't login. Either you didn't enter an existing username, or you haven't entered the right password for the username."; diff --git a/schemes/garbg.php b/schemes/garbg.php index 32cc5c4..6c79dea 100644 --- a/schemes/garbg.php +++ b/schemes/garbg.php @@ -25,7 +25,7 @@ $linkcolor4 = 'CCE8FF'; # Hover $tableborder = '000011'; # Border color for tables - $tableheadtext = '002549'; # Table header text color + $tableheadtext = 'bdd8f1'; # Table header text color $tableheadbg = '000921'; # Table header background (you can use images) $categorybg = '002864'; # Category BG $tablebg1 = '001E4B'; # Table cell 1 background diff --git a/schemes/spec-zen.php b/schemes/spec-zen.php index 8fd49cc..ebbfbaa 100644 --- a/schemes/spec-zen.php +++ b/schemes/spec-zen.php @@ -4,7 +4,8 @@ $formcss=1; $inputborder='000000'; - $bgcolor='010'; + $bgcolor='010 linear-gradient(45deg, #001100 40%, #001600 40%, #001600 50%, #001100 50%, #001100 90%, #001600 90%, #001600 100%); background-size: 35.36px 35.36px'; + $bgimage=""; $textcolor='DDDDDD'; $linkcolor ='BEFEBA';