17 Commits

Author SHA1 Message Date
Sebastian Titz
5c7e2f6a8f abfangen wenn mailtext arrayst 2021-08-26 15:12:49 +02:00
Sebastian Titz
6920c10d2d remove markdown 2021-08-26 09:18:43 +02:00
troy
c477afabb0 Merge branch 'master' of https://git.seemsleg.it/pub/php-func-lib
Conflicts:
	ips/crawler.php
2021-08-17 18:33:05 +02:00
troy
ea745b5dbb ip 2021-08-17 18:31:57 +02:00
1184d1415a Bing bot 2021-08-14 00:10:37 +02:00
2030fbce57 Mj12 2021-08-14 00:07:54 +02:00
troy
5f3879e48c . 2021-08-08 15:43:04 +02:00
troy
051747f114 linkify bugfix 2021-08-07 09:10:26 +02:00
Sebastian Titz
0a96927e50 seekport 2021-08-03 13:30:05 +02:00
Sebastian Titz
57f254ea39 google bot netz 2021-08-03 07:24:36 +02:00
Sebastian Titz
05903ce02d ips crawler 2021-07-28 08:34:37 +02:00
Sebastian Titz
9a024c5c88 Merge branch 'master' of https://git.seemsleg.it/pub/php-func-lib into
HEAD

Conflicts:
	ips/crawler.php
2021-07-26 15:23:00 +02:00
Sebastian Titz
f9a0e41889 bing bot 2021-07-26 12:33:58 +02:00
troy
e17e570114 crawler ips 2021-07-24 09:50:22 +02:00
50b3d192ba neue bot ips 2021-07-19 14:22:19 +02:00
Sebastian Titz
b2e6260dfb in string fkt 2021-07-15 08:56:38 +02:00
admin
ed87d341ab bot ips zentral sammeln 2021-07-14 20:09:48 +02:00
6 changed files with 123 additions and 441 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@
/secret.php
/config.php
/test.php
/_secret.php

View File

@@ -6,5 +6,5 @@ include_once ('string.php');
include_once ('numbers.php');
include_once ('mail.php');
include_once ('debug.php');
include_once ('markdown.php');
// include_once ('markdown.php');
?>

18
ips/crawler.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
$_ips_crawler = array (
'40.77.167.', // bing bot
'66.249.',
'62.138.',
'62.210.149.60',
'92.118.160.37', // netsystem research bot
'104.155.85.', // google
'114.119.1', // petalbot
'185.191.171.', // semrush bot
'207.46.13.124', // bing bot
'54.36.148.', // ahrefbot
'216.244.66.196', // opensiteexplorer
'65.21.180.26', // seekport
'81.209.177.145', // website-datenbank.de
'2a01:4f8:190:4244::2' // mj12bot
);
?>

View File

@@ -5,6 +5,9 @@ function send_mail($an, $betreff, $text, $ok = '', $error = '') {
if (isset ( $_sendermail )) {
$sender = $_sendermail;
}
if (is_array ( $text )) {
$text = print_r ( $text, true );
}
$header = 'From: ' . $sender . "\r\n";
$header .= 'To: ' . $an . "\r\n";
$header .= 'Content-Type:text/html' . "\r\n";

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>';
}
?>

View File

@@ -1,22 +1,21 @@
<<<<<<< HEAD
<?php
function umlaute($str) {
return str_replace ( array (
'Ä',
'Ö',
'Ü',
'ä',
'ö',
'ü',
'ß'
'Ä',
'Ö',
'Ü',
'ä',
'ö',
'ü',
'ß'
), array (
'&Auml;',
'&Ouml;',
'&Uuml;',
'&auml;',
'&ouml;',
'&uuml;',
'&szlig;'
'&Auml;',
'&Ouml;',
'&Uuml;',
'&auml;',
'&ouml;',
'&uuml;',
'&szlig;'
), $str );
}
function chk($str) {
@@ -24,11 +23,11 @@ function chk($str) {
}
function noScript($str) {
return str_replace ( array (
'<',
'>'
'<',
'>'
), array (
'&lt;',
'&gt;'
'&lt;',
'&gt;'
), $str );
}
function random($name_laenge) {
@@ -128,399 +127,144 @@ function markUp($text) {
}
function onlySimpleHTML($s) {
$s = str_replace ( array (
'<',
'>'
'<',
'>'
), array (
'{{|-&lt;-|}}',
'{{|-&gt;-|}}'
'{{|-&lt;-|}}',
'{{|-&gt;-|}}'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}b{{|-&gt;-|}}',
'{{|-&lt;-|}}b/{{|-&gt;-|}}'
'{{|-&lt;-|}}b{{|-&gt;-|}}',
'{{|-&lt;-|}}b/{{|-&gt;-|}}'
), array (
'<b>',
'<b/>'
'<b>',
'<b/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}u{{|-&gt;-|}}',
'{{|-&lt;-|}}u/{{|-&gt;-|}}'
'{{|-&lt;-|}}u{{|-&gt;-|}}',
'{{|-&lt;-|}}u/{{|-&gt;-|}}'
), array (
'<u>',
'<u/>'
'<u>',
'<u/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}i{{|-&gt;-|}}',
'{{|-&lt;-|}}i/{{|-&gt;-|}}'
'{{|-&lt;-|}}i{{|-&gt;-|}}',
'{{|-&lt;-|}}i/{{|-&gt;-|}}'
), array (
'<i>',
'<i/>'
'<i>',
'<i/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}span{{|-&gt;-|}}',
'{{|-&lt;-|}}span/{{|-&gt;-|}}'
'{{|-&lt;-|}}span{{|-&gt;-|}}',
'{{|-&lt;-|}}span/{{|-&gt;-|}}'
), array (
'<span>',
'<span/>'
'<span>',
'<span/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}b{{|-&gt;-|}}',
'{{|-&lt;-|}}b/{{|-&gt;-|}}'
'{{|-&lt;-|}}b{{|-&gt;-|}}',
'{{|-&lt;-|}}b/{{|-&gt;-|}}'
), array (
'<b>',
'<b/>'
'<b>',
'<b/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}br{{|-&gt;-|}}',
'{{|-&lt;-|}}br/{{|-&gt;-|}}'
'{{|-&lt;-|}}br{{|-&gt;-|}}',
'{{|-&lt;-|}}br/{{|-&gt;-|}}'
), array (
'<br>',
'<br/>'
'<br>',
'<br/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}h1{{|-&gt;-|}}',
'{{|-&lt;-|}}h1/{{|-&gt;-|}}'
'{{|-&lt;-|}}h1{{|-&gt;-|}}',
'{{|-&lt;-|}}h1/{{|-&gt;-|}}'
), array (
'<h1>',
'<h1/>'
'<h1>',
'<h1/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}h2{{|-&gt;-|}}',
'{{|-&lt;-|}}h2/{{|-&gt;-|}}'
'{{|-&lt;-|}}h2{{|-&gt;-|}}',
'{{|-&lt;-|}}h2/{{|-&gt;-|}}'
), array (
'<h2>',
'<h2/>'
'<h2>',
'<h2/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}h3{{|-&gt;-|}}',
'{{|-&lt;-|}}h3/{{|-&gt;-|}}'
'{{|-&lt;-|}}h3{{|-&gt;-|}}',
'{{|-&lt;-|}}h3/{{|-&gt;-|}}'
), array (
'<h3>',
'<h3/>'
'<h3>',
'<h3/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}h4{{|-&gt;-|}}',
'{{|-&lt;-|}}h4/{{|-&gt;-|}}'
'{{|-&lt;-|}}h4{{|-&gt;-|}}',
'{{|-&lt;-|}}h4/{{|-&gt;-|}}'
), array (
'<h4>',
'<h4/>'
'<h4>',
'<h4/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}h5{{|-&gt;-|}}',
'{{|-&lt;-|}}h5/{{|-&gt;-|}}'
'{{|-&lt;-|}}h5{{|-&gt;-|}}',
'{{|-&lt;-|}}h5/{{|-&gt;-|}}'
), array (
'<h5>',
'<h5/>'
'<h5>',
'<h5/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}h6{{|-&gt;-|}}',
'{{|-&lt;-|}}h6/{{|-&gt;-|}}'
'{{|-&lt;-|}}h6{{|-&gt;-|}}',
'{{|-&lt;-|}}h6/{{|-&gt;-|}}'
), array (
'<h6>',
'<h6/>'
'<h6>',
'<h6/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}li{{|-&gt;-|}}',
'{{|-&lt;-|}}li/{{|-&gt;-|}}'
'{{|-&lt;-|}}li{{|-&gt;-|}}',
'{{|-&lt;-|}}li/{{|-&gt;-|}}'
), array (
'<li>',
'<li/>'
'<li>',
'<li/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}ul{{|-&gt;-|}}',
'{{|-&lt;-|}}ul/{{|-&gt;-|}}'
'{{|-&lt;-|}}ul{{|-&gt;-|}}',
'{{|-&lt;-|}}ul/{{|-&gt;-|}}'
), array (
'<ul>',
'<ul/>'
'<ul>',
'<ul/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}ol{{|-&gt;-|}}',
'{{|-&lt;-|}}ol/{{|-&gt;-|}}'
'{{|-&lt;-|}}ol{{|-&gt;-|}}',
'{{|-&lt;-|}}ol/{{|-&gt;-|}}'
), array (
'<ol>',
'<ol/>'
'<ol>',
'<ol/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}pre{{|-&gt;-|}}',
'{{|-&lt;-|}}pre/{{|-&gt;-|}}'
'{{|-&lt;-|}}pre{{|-&gt;-|}}',
'{{|-&lt;-|}}pre/{{|-&gt;-|}}'
), array (
'<pre>',
'<pre/>'
'<pre>',
'<pre/>'
), $s );
// cleanup
$s = str_replace ( array (
'{{|-',
'-|}}'
'{{|-',
'-|}}'
), array (
'',
''
'',
''
), $s );
return $s;
}
function linkify($input) {
$pattern = '@(http(s)?://)?(([a-zA-Z])([-\w]+\.)+([^\s\.]+[^\s]*)+[^,.\s])@';
return $output = preg_replace ( $pattern, '<a href="http$2://$3">$0</a>', $input );
$pattern = '@(http(s)?://[a-zA-Z0-9/\.\#\-\_]*)@';
return $output = preg_replace ( $pattern, '<a href="$1">$1</a>', $input );
}
=======
<?php
function umlaute($str) {
return str_replace ( array (
'Ä',
'Ö',
'Ü',
'ä',
'ö',
'ü',
'ß'
), array (
'&Auml;',
'&Ouml;',
'&Uuml;',
'&auml;',
'&ouml;',
'&uuml;',
'&szlig;'
), $str );
}
function chk($str) {
return str_replace ( "'", '"', $str );
}
function noScript($str) {
return str_replace ( array (
'<',
'>'
), array (
'&lt;',
'&gt;'
), $str );
}
function random($name_laenge) {
$zeichen = "abcedfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZ0123456789";
$name_neu = "";
@mt_srand ( ( double ) microtime () * 1000000 );
for($i = 0; $i < $name_laenge; $i ++) {
$r = mt_rand ( 0, strlen ( $zeichen ) - 1 );
$name_neu .= $zeichen {$r};
}
return $name_neu;
}
function startsWith($haystack, $needle) {
$length = strlen ( $needle );
return (substr ( $haystack, 0, $length ) === $needle);
}
function endsWith($haystack, $needle) {
$length = strlen ( $needle );
return $length === 0 || (substr ( $haystack, - $length ) === $needle);
}
function onlyAlpha($str, $zus = '') {
return preg_replace ( "/[^a-zA-Z0-9 \-\_{$zus}]+/", "", $str );
}
function shortener($str, $len = 50, $fill = '...') {
if (strlen ( $str ) > $len) {
$str = substr ( $str, 0, $len - strlen ( $fill ) ) . $fill;
}
return $str;
}
function isEmail($str) {
$match = preg_match ( "/[a-zA-Z0-9\-\_\.]*\@[a-zA-Z0-9\-\_\.]*.[a-z]{2,10}/", $str );
if ($match) {
return $str;
function inStr($needle, $haystack) {
if (strpos ( $haystack, $needle ) !== false) {
return true;
}
return false;
}
function markUp($text) {
$r = '';
$lv = 0;
foreach ( explode ( "\n", $text ) as $t ) {
$nlv = 0;
if (startsWith ( '**** ', $t )) {
$t = substr ( $t, 5 );
$nlv = 4;
}
if (startsWith ( '*** ', $t )) {
$t = substr ( $t, 4 );
$nlv = 3;
}
if (startsWith ( '** ', $t )) {
$t = substr ( $t, 3 );
$nlv = 2;
}
if (startsWith ( '* ', $t )) {
$t = substr ( $t, 2 );
$nlv = 1;
}
if ($lv != $nlv) {
while ( $lv < $nlv ) {
$text .= '<ul>';
$lv ++;
}
while ( $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) {
$r .= $t;
} else {
$r .= '<li>' . $t . '</li>';
}
// var_dump ( $t );
}
while ( $lv > 0 ) {
$r .= '</ul>';
$lv --;
}
return $r;
}
function onlySimpleHTML($s) {
$s = str_replace ( array (
'<',
'>'
), array (
'{{|-&lt;-|}}',
'{{|-&gt;-|}}'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}b{{|-&gt;-|}}',
'{{|-&lt;-|}}b/{{|-&gt;-|}}'
), array (
'<b>',
'<b/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}u{{|-&gt;-|}}',
'{{|-&lt;-|}}u/{{|-&gt;-|}}'
), array (
'<u>',
'<u/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}i{{|-&gt;-|}}',
'{{|-&lt;-|}}i/{{|-&gt;-|}}'
), array (
'<i>',
'<i/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}span{{|-&gt;-|}}',
'{{|-&lt;-|}}span/{{|-&gt;-|}}'
), array (
'<span>',
'<span/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}b{{|-&gt;-|}}',
'{{|-&lt;-|}}b/{{|-&gt;-|}}'
), array (
'<b>',
'<b/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}br{{|-&gt;-|}}',
'{{|-&lt;-|}}br/{{|-&gt;-|}}'
), array (
'<br>',
'<br/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}h1{{|-&gt;-|}}',
'{{|-&lt;-|}}h1/{{|-&gt;-|}}'
), array (
'<h1>',
'<h1/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}h2{{|-&gt;-|}}',
'{{|-&lt;-|}}h2/{{|-&gt;-|}}'
), array (
'<h2>',
'<h2/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}h3{{|-&gt;-|}}',
'{{|-&lt;-|}}h3/{{|-&gt;-|}}'
), array (
'<h3>',
'<h3/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}h4{{|-&gt;-|}}',
'{{|-&lt;-|}}h4/{{|-&gt;-|}}'
), array (
'<h4>',
'<h4/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}h5{{|-&gt;-|}}',
'{{|-&lt;-|}}h5/{{|-&gt;-|}}'
), array (
'<h5>',
'<h5/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}h6{{|-&gt;-|}}',
'{{|-&lt;-|}}h6/{{|-&gt;-|}}'
), array (
'<h6>',
'<h6/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}li{{|-&gt;-|}}',
'{{|-&lt;-|}}li/{{|-&gt;-|}}'
), array (
'<li>',
'<li/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}ul{{|-&gt;-|}}',
'{{|-&lt;-|}}ul/{{|-&gt;-|}}'
), array (
'<ul>',
'<ul/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}ol{{|-&gt;-|}}',
'{{|-&lt;-|}}ol/{{|-&gt;-|}}'
), array (
'<ol>',
'<ol/>'
), $s );
$s = str_replace ( array (
'{{|-&lt;-|}}pre{{|-&gt;-|}}',
'{{|-&lt;-|}}pre/{{|-&gt;-|}}'
), array (
'<pre>',
'<pre/>'
), $s );
// cleanup
$s = str_replace ( array (
'{{|-',
'-|}}'
), array (
'',
''
), $s );
return $s;
}
>>>>>>> branch 'master' of https://git.seemsleg.it/pub/php-func-lib
?>