1 Commits

Author SHA1 Message Date
Sebastian Titz
2e426509b6 remove markdown 2021-08-26 09:17:58 +02:00
4 changed files with 203 additions and 288 deletions

View File

@@ -8,17 +8,11 @@ $_ips_crawler = array (
'104.155.85.', // google '104.155.85.', // google
'114.119.1', // petalbot '114.119.1', // petalbot
'185.191.171.', // semrush bot '185.191.171.', // semrush bot
'207.46.13.', // bing bot '207.46.13.124', // bing bot
'54.36.148.', // ahrefbot '54.36.148.', // ahrefbot
'54.36.149.', // ahrefbot
'216.244.66.196', // opensiteexplorer '216.244.66.196', // opensiteexplorer
'65.21.180.26', // seekport '65.21.180.26', // seekport
'81.209.177.145', // website-datenbank.de '81.209.177.145', // website-datenbank.de
'2a01:4f8:190:4244::2', // mj12bot '2a01:4f8:190:4244::2' // mj12bot
'192.99.5.225', // ...
'157.55.39.', // microsoft???
'2a01:4f8:162:43c5::2', // mj12bot
'85.25.177.', // abuse
'85.25.210.' // hosteurope abuse
); );
?> ?>

View File

@@ -1,84 +0,0 @@
<?php
// TODO markdown imple
function md($str) {
// return nl2br ( $str ); // TODO md problem
$text = '<p>';
$lv = 0;
$str = explode ( "\n", str_replace ( "\r\n", "\n", $str ) );
// var_dump ( $str );
foreach ( $str as $t ) {
// echo '<pre>' . $t . '</pre>';
$t = preg_replace_callback ( '/\[\[([^\]]*)\]\]/m', '_md_link_replacer', $t );
$nlv = 0;
if (startsWith ( $t, '**** ' )) {
// echo - 1;
$t = substr ( $t, 5 );
$nlv = 4;
}
if (startsWith ( $t, '*** ' )) {
// echo - 2;
$t = substr ( $t, 4 );
$nlv = 3;
}
if (startsWith ( $t, '** ' )) {
// echo - 3;
$t = substr ( $t, 3 );
$nlv = 2;
}
if (startsWith ( $t, '* ' )) {
// echo - 4;
$t = substr ( $t, 2 );
$nlv = 1;
}
if ($lv != $nlv) {
while ( $lv < $nlv ) {
// echo '-5 (' . $lv . '-' . $nlv . ')';
$text .= '<ul>';
$lv ++;
}
while ( $lv > $nlv ) {
// echo '-6 (' . $lv . '-' . $nlv . ')';
$text .= '</ul>';
$lv --;
}
}
if (startsWith ( $t, '!!!!! ' )) {
$t = '<h5>' . substr ( $t, 6 ) . '</h5>';
}
if (startsWith ( $t, '!!!! ' )) {
$t = '<h4>' . substr ( $t, 5 ) . '</h4>';
}
if (startsWith ( $t, '!!! ' )) {
$t = '<h3>' . substr ( $t, 4 ) . '</h3>';
}
if (startsWith ( $t, '!! ' )) {
$t = '<h2>' . substr ( $t, 3 ) . '</h2>';
}
if (startsWith ( $t, '! ' )) {
$t = '<h1>' . substr ( $t, 2 ) . '</h1>';
}
if ($lv == 0) {
if ($t == '') {
$text .= '</p><p>';
} else {
$text .= $t;
}
} else {
$text .= '<li>' . $t . '</li>';
}
// var_dump ( $t );
}
while ( $lv > 0 ) {
$text .= '</ul>';
$lv --;
}
$text .= '</p>';
return $text;
}
function _md_link_replacer($in) {
// var_dump ( $in );
$in = explode ( '|', $in [1], 2 );
return '<a href="' . $in [0] . '" target="_blank">' . (isset ( $in [1] ) ? $in [1] : $in [0]) . '</a>';
}
?>

391
sql.php
View File

@@ -1,192 +1,199 @@
<?php <?php
class SQL { class SQL {
private $h; private $h;
private $res = false; private $res = false;
private $m; private $m;
public $salt; public $salt;
public $pre; public $pre;
public $cnt_get = 0; public $cnt_get = 0;
public $cnt_set = 0; public $cnt_set = 0;
public function __construct() { public function __construct() {
require_once ('secret.php'); require_once ('secret.php');
$this->m = $_m; $this->m = $_m;
$this->pre = $_m ['pre']; $this->pre = $_m ['pre'];
$this->salt = $_m ['salt']; $this->salt = $_m ['salt'];
if (SQL_LOG) if (SQL_LOG)
$this->f = fopen ( 'sql.log', 'w' ); $this->f = fopen ( 'sql.log', 'w' );
$this->h = new mysqli ( $_m ['host'], $_m ['user'], $_m ['pass'], $_m ['data'] ); $this->h = new mysqli ( $_m ['host'], $_m ['user'], $_m ['pass'], $_m ['data'] );
if ($this->h->connect_errno) { if ($this->h->connect_errno) {
return false; return false;
} }
return true; return true;
} }
public function get($que, $t = '', $p = array ()) { public function get($que, $t = '', $p = array ()) {
// echo $que; // echo $que;
$this->cnt_get ++; $this->cnt_get ++;
if (SQL_LOG) if (SQL_LOG)
fputs ( $this->f, str_replace ( array ( fputs ( $this->f, str_replace ( array (
"\n", "\n",
" " " "
), array ( ), array (
' ', ' ',
'' ''
), $que ) . "\n" . print_r ( $p, true ) . "\n\n" ); ), $que ) . "\n" . print_r ( $p, true ) . "\n\n" );
$statement = $this->h->prepare ( $que ); $statement = $this->h->prepare ( $que );
if (is_array ( $p )) { switch (count ( $p )) {
switch (count ( $p )) { case 0 :
case 0 : break;
break; case 1 :
case 1 : $statement->bind_param ( $t, $p [0] );
$statement->bind_param ( $t, $p [0] ); break;
break; case 2 :
case 2 : $statement->bind_param ( $t, $p [0], $p [1] );
$statement->bind_param ( $t, $p [0], $p [1] ); break;
break; case 3 :
case 3 : $statement->bind_param ( $t, $p [0], $p [1], $p [2] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2] ); break;
break; case 4 :
case 4 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] ); break;
break; case 5 :
case 5 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] ); break;
break; case 6 :
case 6 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] ); break;
break; case 7 :
case 7 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] ); break;
break; case 8 :
case 8 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] ); break;
break; case 9 :
case 9 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] ); break;
break; case 10 :
case 10 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] );
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] ); break;
break; }
} $statement->execute ();
} else {
$statement->bind_param ( $t, $p ); $ret = array ();
}
$statement->execute (); // print_r($statement);
if (isset ( $statement->error ) && $statement->error != '') {
$ret = array (); if (SQL_LOG)
fputs ( $this->f, $statement->error );
// print_r($statement); return false;
if (isset ( $statement->error ) && $statement->error != '') { }
if (SQL_LOG) $result = $statement->get_result ();
fputs ( $this->f, $statement->error ); // print_r($result);
return false; while ( $row = $result->fetch_assoc () ) {
} $ret [] = $row;
$result = $statement->get_result (); }
// print_r($result); return $ret;
while ( $row = $result->fetch_assoc () ) { }
$ret [] = $row; public function single($que, $t = '', $p = array ()) {
} $data = $this->get ( $que, $t, $p );
return $ret; if ($data) {
} return $data [0];
public function single($que, $t = '', $p = array ()) { }
$data = $this->get ( $que, $t, $p ); return false;
if ($data) { }
return $data [0]; public function list($que, $t = '', $p = array ()) {
} $data = $this->get ( $que, $t, $p );
return false; if ($data) {
} $ret = array ();
public function list($que, $t = '', $p = array ()) { foreach ( $data as $d ) {
$data = $this->get ( $que, $t, $p ); foreach ( $d as $k => $v ) {
if ($data) { $ret [] = $v;
$ret = array (); }
foreach ( $data as $d ) { }
foreach ( $d as $k => $v ) { return $ret;
$ret [] = $v; }
} return false;
} }
return $ret; public function keyval($que, $k, $v, $t = '', $p = array ()) {
} $data = $this->get ( $que, $t, $p );
return false; if ($data) {
} $ret = array ();
public function keyval($que, $k, $v, $t = '', $p = array ()) { foreach ( $data as $d ) {
$data = $this->get ( $que, $t, $p ); $ret [$d [$k]] = $d [$v];
if ($data) { }
$ret = array (); return $ret;
foreach ( $data as $d ) { }
$ret [$d [$k]] = $d [$v]; return false;
} }
return $ret; public function set($que, $t = '', $p = array (), $id = false) {
} // echo $que;
return false; $this->cnt_set ++;
} $statement = $this->h->prepare ( $que );
public function set($que, $t = '', $p = array (), $id = false) { if (SQL_LOG)
// echo $que; fputs ( $this->f, str_replace ( array (
$this->cnt_set ++; "\n",
$statement = $this->h->prepare ( $que ); " "
if (SQL_LOG) ), array (
fputs ( $this->f, str_replace ( array ( ' ',
"\n", ''
" " ), $que ) . "\n" . print_r ( $p, true ) . "\n\n" );
), array ( switch (count ( $p )) {
' ', case 0 :
'' break;
), $que ) . "\n" . print_r ( $p, true ) . "\n\n" ); case 1 :
if (is_array ( $p )) { $statement->bind_param ( $t, $p [0] );
switch (count ( $p )) { break;
case 0 : case 2 :
break; $statement->bind_param ( $t, $p [0], $p [1] );
case 1 : break;
$statement->bind_param ( $t, $p [0] ); case 3 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2] );
case 2 : break;
$statement->bind_param ( $t, $p [0], $p [1] ); case 4 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] );
case 3 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2] ); case 5 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] );
case 4 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] ); case 6 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] );
case 5 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] ); case 7 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] );
case 6 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] ); case 8 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] );
case 7 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] ); case 9 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] );
case 8 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] ); case 10 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] );
case 9 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] ); case 11 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10] );
case 10 : break;
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] ); case 12 :
break; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10], $p [11] );
} break;
} else { case 13 :
$statement->bind_param ( $t, $p ); $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10], $p [11], $p [12] );
} break;
$statement->execute (); case 14 :
if (isset ( $statement->error ) && $statement->error != '') { $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10], $p [11], $p [12], $p [13] );
if (SQL_LOG) break;
fputs ( $this->f, $statement->error ); case 15 :
return false; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9], $p [10], $p [11], $p [12], $p [13], $p [14] );
} break;
}
if ($id) { $statement->execute ();
return $statement->insert_id; if (isset ( $statement->error ) && $statement->error != '') {
} else { if (SQL_LOG)
return $statement->affected_rows; fputs ( $this->f, $statement->error );
} return false;
} }
function __destruct() {
if (SQL_LOG) if ($id) {
$this->h->close (); return $statement->insert_id;
// echo 'DESTROY'; } else {
} return $statement->affected_rows;
} }
?> }
function __destruct() {
if (SQL_LOG)
$this->h->close ();
// echo 'DESTROY';
}
}
?>

View File

@@ -7,8 +7,7 @@ function umlaute($str) {
'ä', 'ä',
'ö', 'ö',
'ü', 'ü',
'ß', 'ß'
'&'
), array ( ), array (
'&Auml;', '&Auml;',
'&Ouml;', '&Ouml;',
@@ -16,8 +15,7 @@ function umlaute($str) {
'&auml;', '&auml;',
'&ouml;', '&ouml;',
'&uuml;', '&uuml;',
'&szlig;', '&szlig;'
'&amp;'
), $str ); ), $str );
} }
function chk($str) { function chk($str) {