mirror of
https://github.com/Xkeeper0/jul.git
synced 2025-07-31 04:02:00 -07:00
Removing trailing whitespaces from function.php
This commit is contained in:
@@ -67,16 +67,16 @@
|
|||||||
$newid = 0 - ctime();
|
$newid = 0 - ctime();
|
||||||
|
|
||||||
if ($newid) setcookie('loguserid',$newid,2147483647);
|
if ($newid) setcookie('loguserid',$newid,2147483647);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
header("HTTP/1.1 403 Forbidden");
|
header("HTTP/1.1 403 Forbidden");
|
||||||
|
|
||||||
die("<title>Error</title>
|
die("<title>Error</title>
|
||||||
<body style=\"background: #000; color: #fff;\">
|
<body style=\"background: #000; color: #fff;\">
|
||||||
<font style=\"font-family: Verdana, sans-serif;\">
|
<font style=\"font-family: Verdana, sans-serif;\">
|
||||||
<center>
|
<center>
|
||||||
Suspicious request detected (e.g. bot or malicious tool).
|
Suspicious request detected (e.g. bot or malicious tool).
|
||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,15 +194,15 @@
|
|||||||
$isadmin = ($power>=3);
|
$isadmin = ($power>=3);
|
||||||
if($banned) $power=0;
|
if($banned) $power=0;
|
||||||
|
|
||||||
$specialscheme = "";
|
$specialscheme = "";
|
||||||
$smallbrowsers = array("Nintendo DS", "Android", "PSP", "Windows CE");
|
$smallbrowsers = array("Nintendo DS", "Android", "PSP", "Windows CE");
|
||||||
if ( (str_replace($smallbrowsers, "", $_SERVER['HTTP_USER_AGENT']) != $_SERVER['HTTP_USER_AGENT']) || filter_int($_GET['mobile']) == 1) {
|
if ( (str_replace($smallbrowsers, "", $_SERVER['HTTP_USER_AGENT']) != $_SERVER['HTTP_USER_AGENT']) || filter_int($_GET['mobile']) == 1) {
|
||||||
$loguser['layout'] = 2;
|
$loguser['layout'] = 2;
|
||||||
$loguser['viewsig'] = 0;
|
$loguser['viewsig'] = 0;
|
||||||
$boardtitle = "<span style=\"font-size: 2em;\">$boardname</span>";
|
$boardtitle = "<span style=\"font-size: 2em;\">$boardname</span>";
|
||||||
$x_hacks['smallbrowse'] = true;
|
$x_hacks['smallbrowse'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// $atempval = $sql -> resultq("SELECT MAX(`id`) FROM `posts`");
|
// $atempval = $sql -> resultq("SELECT MAX(`id`) FROM `posts`");
|
||||||
// if ($atempval == 199999 && $_SERVER['REMOTE_ADDR'] != "172.130.244.60") {
|
// if ($atempval == 199999 && $_SERVER['REMOTE_ADDR'] != "172.130.244.60") {
|
||||||
// //print "DBG ". strrev($atempval);
|
// //print "DBG ". strrev($atempval);
|
||||||
@@ -375,7 +375,7 @@ function generatenumbergfx($num,$minlen=0,$double=false){
|
|||||||
if($minlen>1 && strlen($num) < $minlen) {
|
if($minlen>1 && strlen($num) < $minlen) {
|
||||||
$gfxcode = '<img src=images/_.gif width='. ($nw * ($minlen - strlen($num))) .' height='. $nw .'>';
|
$gfxcode = '<img src=images/_.gif width='. ($nw * ($minlen - strlen($num))) .' height='. $nw .'>';
|
||||||
}
|
}
|
||||||
|
|
||||||
for($i=0;$i<strlen($num);$i++) {
|
for($i=0;$i<strlen($num);$i++) {
|
||||||
$code = $num{$i};
|
$code = $num{$i};
|
||||||
switch ($code) {
|
switch ($code) {
|
||||||
@@ -385,7 +385,7 @@ function generatenumbergfx($num,$minlen=0,$double=false){
|
|||||||
}
|
}
|
||||||
if ($code == " ") {
|
if ($code == " ") {
|
||||||
$gfxcode.="<img src=images/_.gif width=$nw height=$nw>";
|
$gfxcode.="<img src=images/_.gif width=$nw height=$nw>";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$gfxcode.="<img src=numgfx/$numdir$code.png width=$nw height=$nw>";
|
$gfxcode.="<img src=numgfx/$numdir$code.png width=$nw height=$nw>";
|
||||||
|
|
||||||
@@ -407,7 +407,7 @@ function dotags($msg, $user, &$tags = array()) {
|
|||||||
'/me ' => "*<b>". $user['username'] ."</b> ",
|
'/me ' => "*<b>". $user['username'] ."</b> ",
|
||||||
'&date&' => date($dateformat, ctime() + $tzoff),
|
'&date&' => date($dateformat, ctime() + $tzoff),
|
||||||
'&numdays&' => floor($user['days']),
|
'&numdays&' => floor($user['days']),
|
||||||
|
|
||||||
'&numposts&' => $user['posts'],
|
'&numposts&' => $user['posts'],
|
||||||
'&rank&' => getrank($user['useranks'], '', $user['posts'], 0),
|
'&rank&' => getrank($user['useranks'], '', $user['posts'], 0),
|
||||||
'&postrank&' => $sql->resultq("SELECT count(*) FROM `users` WHERE posts>$user[posts]")+1,
|
'&postrank&' => $sql->resultq("SELECT count(*) FROM `users` WHERE posts>$user[posts]")+1,
|
||||||
@@ -415,7 +415,7 @@ function dotags($msg, $user, &$tags = array()) {
|
|||||||
'&10000&' => 10000 - $user['posts'],
|
'&10000&' => 10000 - $user['posts'],
|
||||||
'&20000&' => 20000 - $user['posts'],
|
'&20000&' => 20000 - $user['posts'],
|
||||||
'&30000&' => 30000 - $user['posts'],
|
'&30000&' => 30000 - $user['posts'],
|
||||||
|
|
||||||
'&exp&' => $user['exp'],
|
'&exp&' => $user['exp'],
|
||||||
'&expgain&' => calcexpgainpost($user['posts'], $user['days']),
|
'&expgain&' => calcexpgainpost($user['posts'], $user['days']),
|
||||||
'&expgaintime&' => calcexpgaintime($user['posts'], $user['days']),
|
'&expgaintime&' => calcexpgaintime($user['posts'], $user['days']),
|
||||||
@@ -430,7 +430,7 @@ function dotags($msg, $user, &$tags = array()) {
|
|||||||
|
|
||||||
'&exppct&' => sprintf('%01.1f', ($user['lvllen'] ? (1 - $user['expnext'] / $user['lvllen']) : 0) * 100),
|
'&exppct&' => sprintf('%01.1f', ($user['lvllen'] ? (1 - $user['expnext'] / $user['lvllen']) : 0) * 100),
|
||||||
'&exppct2&' => sprintf('%01.1f', ($user['lvllen'] ? ( $user['expnext'] / $user['lvllen']) : 0) * 100),
|
'&exppct2&' => sprintf('%01.1f', ($user['lvllen'] ? ( $user['expnext'] / $user['lvllen']) : 0) * 100),
|
||||||
|
|
||||||
'&level&' => $user['level'],
|
'&level&' => $user['level'],
|
||||||
'&lvlexp&' => calclvlexp($user['level'] + 1),
|
'&lvlexp&' => calclvlexp($user['level'] + 1),
|
||||||
'&lvllen&' => $user['lvllen'],
|
'&lvllen&' => $user['lvllen'],
|
||||||
@@ -444,7 +444,7 @@ function dotags($msg, $user, &$tags = array()) {
|
|||||||
|
|
||||||
function doreplace($msg, $posts, $days, $username, &$tags = null) {
|
function doreplace($msg, $posts, $days, $username, &$tags = null) {
|
||||||
global $tagval, $sql;
|
global $tagval, $sql;
|
||||||
|
|
||||||
// This should probably go off of user ID but welp
|
// This should probably go off of user ID but welp
|
||||||
$user = $sql->fetchq("SELECT * FROM `users` WHERE `name` = '".addslashes($username)."'", MYSQL_BOTH, true);
|
$user = $sql->fetchq("SELECT * FROM `users` WHERE `name` = '".addslashes($username)."'", MYSQL_BOTH, true);
|
||||||
|
|
||||||
@@ -476,7 +476,7 @@ function escape_codeblock($text) {
|
|||||||
$list2 = array("", "", "<", "\"", "\\", "\'", "[", ":", ")", "_");
|
$list2 = array("", "", "<", "\"", "\\", "\'", "[", ":", ")", "_");
|
||||||
|
|
||||||
// @TODO why not just use htmlspecialchars() or htmlentities()
|
// @TODO why not just use htmlspecialchars() or htmlentities()
|
||||||
return "[quote]<code>". str_replace($list, $list2, $text[0]) ."</code>[/quote]";
|
return "[quote]<code>". str_replace($list, $list2, $text[0]) ."</code>[/quote]";
|
||||||
}
|
}
|
||||||
|
|
||||||
function doreplace2($msg, $options='0|0'){
|
function doreplace2($msg, $options='0|0'){
|
||||||
@@ -529,7 +529,7 @@ function doreplace2($msg, $options='0|0'){
|
|||||||
$msg=str_replace('http://nightkev.110mb.com/justus_layout.css','about:blank',$msg);
|
$msg=str_replace('http://nightkev.110mb.com/justus_layout.css','about:blank',$msg);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$msg = preg_replace("/<(\/?)t(able|h|r|d)(.*?)>(\s+?)<(\/?)t(able|h|r|d)(.*?)>/si",
|
$msg = preg_replace("/<(\/?)t(able|h|r|d)(.*?)>(\s+?)<(\/?)t(able|h|r|d)(.*?)>/si",
|
||||||
"<\\1t\\2\\3><\\5t\\6\\7>", $msg, -1, $replaced);
|
"<\\1t\\2\\3><\\5t\\6\\7>", $msg, -1, $replaced);
|
||||||
} while ($replaced >= 1);
|
} while ($replaced >= 1);
|
||||||
|
|
||||||
@@ -545,7 +545,7 @@ function settags($text, $tags) {
|
|||||||
if (!$tags) {
|
if (!$tags) {
|
||||||
return $text;
|
return $text;
|
||||||
} else {
|
} else {
|
||||||
$text = dotags($text, array(), $tags);
|
$text = dotags($text, array(), $tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
@@ -779,7 +779,7 @@ function getnamecolor($sex, $powl, $prefix = true){
|
|||||||
$powl = min(3, $powl);
|
$powl = min(3, $powl);
|
||||||
|
|
||||||
$namecolor = (($prefix) ? 'color=' : '');
|
$namecolor = (($prefix) ? 'color=' : '');
|
||||||
|
|
||||||
if ($powl < 0) // always dull drab banned gray.
|
if ($powl < 0) // always dull drab banned gray.
|
||||||
$namecolor .= $nmcol[0][$powl];
|
$namecolor .= $nmcol[0][$powl];
|
||||||
|
|
||||||
@@ -883,11 +883,11 @@ function fonlineusers($id){
|
|||||||
$sql->query("UPDATE users SET lastforum=$id WHERE id=$loguserid");
|
$sql->query("UPDATE users SET lastforum=$id WHERE id=$loguserid");
|
||||||
else
|
else
|
||||||
$sql->query("UPDATE guests SET lastforum=$id WHERE ip='$userip'");
|
$sql->query("UPDATE guests SET lastforum=$id WHERE ip='$userip'");
|
||||||
|
|
||||||
$forumname =@$sql->resultq("SELECT title FROM forums WHERE id=$id",0,0);
|
$forumname =@$sql->resultq("SELECT title FROM forums WHERE id=$id",0,0);
|
||||||
$onlinetime =ctime()-300;
|
$onlinetime =ctime()-300;
|
||||||
$onusers =$sql->query("SELECT id,name,lastactivity,minipic,lasturl,aka,sex,powerlevel,birthday FROM users WHERE lastactivity>$onlinetime AND lastforum=$id ORDER BY name");
|
$onusers =$sql->query("SELECT id,name,lastactivity,minipic,lasturl,aka,sex,powerlevel,birthday FROM users WHERE lastactivity>$onlinetime AND lastforum=$id ORDER BY name");
|
||||||
|
|
||||||
$onlineusers = "";
|
$onlineusers = "";
|
||||||
|
|
||||||
for($numon=0;$onuser=$sql->fetch($onusers);$numon++){
|
for($numon=0;$onuser=$sql->fetch($onusers);$numon++){
|
||||||
@@ -915,7 +915,7 @@ function fonlineusers($id){
|
|||||||
$jspcount = 0;
|
$jspcount = 0;
|
||||||
function jspageexpand($start, $end) {
|
function jspageexpand($start, $end) {
|
||||||
global $jspcount;
|
global $jspcount;
|
||||||
|
|
||||||
if (!$jspcount) {
|
if (!$jspcount) {
|
||||||
echo '
|
echo '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -923,11 +923,11 @@ function jspageexpand($start, $end) {
|
|||||||
{
|
{
|
||||||
var elem = document.getElementById(uid);
|
var elem = document.getElementById(uid);
|
||||||
var res = "";
|
var res = "";
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
|
|
||||||
$entityid = "expand" . ++$jspcount;
|
$entityid = "expand" . ++$jspcount;
|
||||||
|
|
||||||
$js = "#todo";
|
$js = "#todo";
|
||||||
@@ -1187,7 +1187,7 @@ function include_js($fn, $as_tag = false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function dofilters($p){
|
function dofilters($p){
|
||||||
global $hacks;
|
global $hacks;
|
||||||
$temp = $p;
|
$temp = $p;
|
||||||
@@ -1216,7 +1216,7 @@ function dofilters($p){
|
|||||||
$p=preg_replace("'onmouseout'si",'onmou<z>seout',$p);
|
$p=preg_replace("'onmouseout'si",'onmou<z>seout',$p);
|
||||||
$p=preg_replace("'onmouseover'si",'onmo<z>useover',$p);
|
$p=preg_replace("'onmouseover'si",'onmo<z>useover',$p);
|
||||||
$p=preg_replace("'onmouseup'si",'onmou<z>seup',$p);
|
$p=preg_replace("'onmouseup'si",'onmou<z>seup',$p);
|
||||||
|
|
||||||
if ($temp != $p) {
|
if ($temp != $p) {
|
||||||
nuke_js($temp, $p);
|
nuke_js($temp, $p);
|
||||||
}
|
}
|
||||||
@@ -1339,7 +1339,7 @@ function addslashes_array($data) {
|
|||||||
// global $sql;
|
// global $sql;
|
||||||
// $res = $sql -> resultq("SELECT COUNT(`id`) FROM `posts`");
|
// $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() ."): http://jul.rustedlogic.net/?p=". $in['pid'];
|
$out = "$dest|New $type by ". xk(11) . $user . xk() ." (". xk(12) . $in['forum'] .": ". xk(11) . $in['thread'] . xk() ."): http://jul.rustedlogic.net/?p=". $in['pid'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xk_ircsend($out);
|
xk_ircsend($out);
|
||||||
@@ -1349,7 +1349,7 @@ function addslashes_array($data) {
|
|||||||
$str = str_replace(array("%10", "%13"), array("", ""), rawurlencode($str));
|
$str = str_replace(array("%10", "%13"), array("", ""), rawurlencode($str));
|
||||||
|
|
||||||
$str = html_entity_decode($str);
|
$str = html_entity_decode($str);
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, "http://treeki.rustedlogic.net:5000/reporting.php?t=$str");
|
curl_setopt($ch, CURLOPT_URL, "http://treeki.rustedlogic.net:5000/reporting.php?t=$str");
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
@@ -1360,7 +1360,7 @@ function addslashes_array($data) {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function xk($n = -1) {
|
function xk($n = -1) {
|
||||||
if ($n == -1) $k = "";
|
if ($n == -1) $k = "";
|
||||||
else $k = str_pad($n, 2, 0, STR_PAD_LEFT);
|
else $k = str_pad($n, 2, 0, STR_PAD_LEFT);
|
||||||
@@ -1371,7 +1371,7 @@ function addslashes_array($data) {
|
|||||||
$in = "/[A-Z][^A-Z]/";
|
$in = "/[A-Z][^A-Z]/";
|
||||||
$out = " \\0";
|
$out = " \\0";
|
||||||
$output = preg_replace($in, $out, $input);
|
$output = preg_replace($in, $out, $input);
|
||||||
|
|
||||||
return trim($output);
|
return trim($output);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1382,7 +1382,7 @@ function addslashes_array($data) {
|
|||||||
// We only need to do the replacing one time
|
// We only need to do the replacing one time
|
||||||
static $bl;
|
static $bl;
|
||||||
if ($bl) return $bl;
|
if ($bl) return $bl;
|
||||||
|
|
||||||
$bl = $dateformat;
|
$bl = $dateformat;
|
||||||
$bl = preg_replace('/[jNwzWnLgGI]/', '-', $bl);
|
$bl = preg_replace('/[jNwzWnLgGI]/', '-', $bl);
|
||||||
$bl = preg_replace('/[dSmtyaAhHis]/', '--', $bl);
|
$bl = preg_replace('/[dSmtyaAhHis]/', '--', $bl);
|
||||||
@@ -1416,7 +1416,7 @@ function addslashes_array($data) {
|
|||||||
function numrange($n, $lo, $hi) {
|
function numrange($n, $lo, $hi) {
|
||||||
return max(min($hi, $n), $lo);
|
return max(min($hi, $n), $lo);
|
||||||
}
|
}
|
||||||
|
|
||||||
function marqueeshit($str) {
|
function marqueeshit($str) {
|
||||||
return "<marquee scrollamount='". mt_rand(1, 50) ."' scrolldelay='". mt_rand(1, 50) ."' direction='". pick_any(array("left", "right")) ."'>$str</marquee>";
|
return "<marquee scrollamount='". mt_rand(1, 50) ."' scrolldelay='". mt_rand(1, 50) ."' direction='". pick_any(array("left", "right")) ."'>$str</marquee>";
|
||||||
}
|
}
|
||||||
@@ -1517,13 +1517,13 @@ function gethttpheaders() {
|
|||||||
|
|
||||||
function printtimedif($timestart){
|
function printtimedif($timestart){
|
||||||
global $x_hacks, $sql, $sqldebuggers, $smallfont;
|
global $x_hacks, $sql, $sqldebuggers, $smallfont;
|
||||||
|
|
||||||
$exectime = microtime(true) - $timestart;
|
$exectime = microtime(true) - $timestart;
|
||||||
|
|
||||||
$qseconds = sprintf("%01.6f", mysql::$time);
|
$qseconds = sprintf("%01.6f", mysql::$time);
|
||||||
$sseconds = sprintf("%01.6f", $exectime - mysql::$time);
|
$sseconds = sprintf("%01.6f", $exectime - mysql::$time);
|
||||||
$tseconds = sprintf("%01.6f", $exectime);
|
$tseconds = sprintf("%01.6f", $exectime);
|
||||||
|
|
||||||
$queries = mysql::$queries;
|
$queries = mysql::$queries;
|
||||||
$cache = mysql::$cachehits;
|
$cache = mysql::$cachehits;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user