Compare commits
17 Commits
df5d1447af
...
stable/1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c7e2f6a8f | ||
|
|
6920c10d2d | ||
|
|
c477afabb0 | ||
|
|
ea745b5dbb | ||
| 1184d1415a | |||
| 2030fbce57 | |||
|
|
5f3879e48c | ||
|
|
051747f114 | ||
|
|
0a96927e50 | ||
|
|
57f254ea39 | ||
|
|
05903ce02d | ||
|
|
9a024c5c88 | ||
|
|
f9a0e41889 | ||
|
|
e17e570114 | ||
| 50b3d192ba | |||
|
|
b2e6260dfb | ||
|
|
ed87d341ab |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@
|
|||||||
/secret.php
|
/secret.php
|
||||||
/config.php
|
/config.php
|
||||||
/test.php
|
/test.php
|
||||||
|
/_secret.php
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ include_once ('string.php');
|
|||||||
include_once ('numbers.php');
|
include_once ('numbers.php');
|
||||||
include_once ('mail.php');
|
include_once ('mail.php');
|
||||||
include_once ('debug.php');
|
include_once ('debug.php');
|
||||||
include_once ('markdown.php');
|
// include_once ('markdown.php');
|
||||||
?>
|
?>
|
||||||
18
ips/crawler.php
Normal file
18
ips/crawler.php
Normal 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
|
||||||
|
);
|
||||||
|
?>
|
||||||
3
mail.php
3
mail.php
@@ -5,6 +5,9 @@ function send_mail($an, $betreff, $text, $ok = '', $error = '') {
|
|||||||
if (isset ( $_sendermail )) {
|
if (isset ( $_sendermail )) {
|
||||||
$sender = $_sendermail;
|
$sender = $_sendermail;
|
||||||
}
|
}
|
||||||
|
if (is_array ( $text )) {
|
||||||
|
$text = print_r ( $text, true );
|
||||||
|
}
|
||||||
$header = 'From: ' . $sender . "\r\n";
|
$header = 'From: ' . $sender . "\r\n";
|
||||||
$header .= 'To: ' . $an . "\r\n";
|
$header .= 'To: ' . $an . "\r\n";
|
||||||
$header .= 'Content-Type:text/html' . "\r\n";
|
$header .= 'Content-Type:text/html' . "\r\n";
|
||||||
|
|||||||
84
markdown.php
84
markdown.php
@@ -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>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
446
string.php
446
string.php
@@ -1,22 +1,21 @@
|
|||||||
<<<<<<< HEAD
|
|
||||||
<?php
|
<?php
|
||||||
function umlaute($str) {
|
function umlaute($str) {
|
||||||
return str_replace ( array (
|
return str_replace ( array (
|
||||||
'Ä',
|
'Ä',
|
||||||
'Ö',
|
'Ö',
|
||||||
'Ü',
|
'Ü',
|
||||||
'ä',
|
'ä',
|
||||||
'ö',
|
'ö',
|
||||||
'ü',
|
'ü',
|
||||||
'ß'
|
'ß'
|
||||||
), array (
|
), array (
|
||||||
'Ä',
|
'Ä',
|
||||||
'Ö',
|
'Ö',
|
||||||
'Ü',
|
'Ü',
|
||||||
'ä',
|
'ä',
|
||||||
'ö',
|
'ö',
|
||||||
'ü',
|
'ü',
|
||||||
'ß'
|
'ß'
|
||||||
), $str );
|
), $str );
|
||||||
}
|
}
|
||||||
function chk($str) {
|
function chk($str) {
|
||||||
@@ -24,11 +23,11 @@ function chk($str) {
|
|||||||
}
|
}
|
||||||
function noScript($str) {
|
function noScript($str) {
|
||||||
return str_replace ( array (
|
return str_replace ( array (
|
||||||
'<',
|
'<',
|
||||||
'>'
|
'>'
|
||||||
), array (
|
), array (
|
||||||
'<',
|
'<',
|
||||||
'>'
|
'>'
|
||||||
), $str );
|
), $str );
|
||||||
}
|
}
|
||||||
function random($name_laenge) {
|
function random($name_laenge) {
|
||||||
@@ -128,399 +127,144 @@ function markUp($text) {
|
|||||||
}
|
}
|
||||||
function onlySimpleHTML($s) {
|
function onlySimpleHTML($s) {
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'<',
|
'<',
|
||||||
'>'
|
'>'
|
||||||
), array (
|
), array (
|
||||||
'{{|-<-|}}',
|
'{{|-<-|}}',
|
||||||
'{{|->-|}}'
|
'{{|->-|}}'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}b{{|->-|}}',
|
'{{|-<-|}}b{{|->-|}}',
|
||||||
'{{|-<-|}}b/{{|->-|}}'
|
'{{|-<-|}}b/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<b>',
|
'<b>',
|
||||||
'<b/>'
|
'<b/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}u{{|->-|}}',
|
'{{|-<-|}}u{{|->-|}}',
|
||||||
'{{|-<-|}}u/{{|->-|}}'
|
'{{|-<-|}}u/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<u>',
|
'<u>',
|
||||||
'<u/>'
|
'<u/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}i{{|->-|}}',
|
'{{|-<-|}}i{{|->-|}}',
|
||||||
'{{|-<-|}}i/{{|->-|}}'
|
'{{|-<-|}}i/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<i>',
|
'<i>',
|
||||||
'<i/>'
|
'<i/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}span{{|->-|}}',
|
'{{|-<-|}}span{{|->-|}}',
|
||||||
'{{|-<-|}}span/{{|->-|}}'
|
'{{|-<-|}}span/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<span>',
|
'<span>',
|
||||||
'<span/>'
|
'<span/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}b{{|->-|}}',
|
'{{|-<-|}}b{{|->-|}}',
|
||||||
'{{|-<-|}}b/{{|->-|}}'
|
'{{|-<-|}}b/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<b>',
|
'<b>',
|
||||||
'<b/>'
|
'<b/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}br{{|->-|}}',
|
'{{|-<-|}}br{{|->-|}}',
|
||||||
'{{|-<-|}}br/{{|->-|}}'
|
'{{|-<-|}}br/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<br>',
|
'<br>',
|
||||||
'<br/>'
|
'<br/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}h1{{|->-|}}',
|
'{{|-<-|}}h1{{|->-|}}',
|
||||||
'{{|-<-|}}h1/{{|->-|}}'
|
'{{|-<-|}}h1/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<h1>',
|
'<h1>',
|
||||||
'<h1/>'
|
'<h1/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}h2{{|->-|}}',
|
'{{|-<-|}}h2{{|->-|}}',
|
||||||
'{{|-<-|}}h2/{{|->-|}}'
|
'{{|-<-|}}h2/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<h2>',
|
'<h2>',
|
||||||
'<h2/>'
|
'<h2/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}h3{{|->-|}}',
|
'{{|-<-|}}h3{{|->-|}}',
|
||||||
'{{|-<-|}}h3/{{|->-|}}'
|
'{{|-<-|}}h3/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<h3>',
|
'<h3>',
|
||||||
'<h3/>'
|
'<h3/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}h4{{|->-|}}',
|
'{{|-<-|}}h4{{|->-|}}',
|
||||||
'{{|-<-|}}h4/{{|->-|}}'
|
'{{|-<-|}}h4/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<h4>',
|
'<h4>',
|
||||||
'<h4/>'
|
'<h4/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}h5{{|->-|}}',
|
'{{|-<-|}}h5{{|->-|}}',
|
||||||
'{{|-<-|}}h5/{{|->-|}}'
|
'{{|-<-|}}h5/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<h5>',
|
'<h5>',
|
||||||
'<h5/>'
|
'<h5/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}h6{{|->-|}}',
|
'{{|-<-|}}h6{{|->-|}}',
|
||||||
'{{|-<-|}}h6/{{|->-|}}'
|
'{{|-<-|}}h6/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<h6>',
|
'<h6>',
|
||||||
'<h6/>'
|
'<h6/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}li{{|->-|}}',
|
'{{|-<-|}}li{{|->-|}}',
|
||||||
'{{|-<-|}}li/{{|->-|}}'
|
'{{|-<-|}}li/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<li>',
|
'<li>',
|
||||||
'<li/>'
|
'<li/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}ul{{|->-|}}',
|
'{{|-<-|}}ul{{|->-|}}',
|
||||||
'{{|-<-|}}ul/{{|->-|}}'
|
'{{|-<-|}}ul/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<ul>',
|
'<ul>',
|
||||||
'<ul/>'
|
'<ul/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}ol{{|->-|}}',
|
'{{|-<-|}}ol{{|->-|}}',
|
||||||
'{{|-<-|}}ol/{{|->-|}}'
|
'{{|-<-|}}ol/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<ol>',
|
'<ol>',
|
||||||
'<ol/>'
|
'<ol/>'
|
||||||
), $s );
|
), $s );
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-<-|}}pre{{|->-|}}',
|
'{{|-<-|}}pre{{|->-|}}',
|
||||||
'{{|-<-|}}pre/{{|->-|}}'
|
'{{|-<-|}}pre/{{|->-|}}'
|
||||||
), array (
|
), array (
|
||||||
'<pre>',
|
'<pre>',
|
||||||
'<pre/>'
|
'<pre/>'
|
||||||
), $s );
|
), $s );
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
$s = str_replace ( array (
|
$s = str_replace ( array (
|
||||||
'{{|-',
|
'{{|-',
|
||||||
'-|}}'
|
'-|}}'
|
||||||
), array (
|
), array (
|
||||||
'',
|
'',
|
||||||
''
|
''
|
||||||
), $s );
|
), $s );
|
||||||
|
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
function linkify($input) {
|
function linkify($input) {
|
||||||
$pattern = '@(http(s)?://)?(([a-zA-Z])([-\w]+\.)+([^\s\.]+[^\s]*)+[^,.\s])@';
|
$pattern = '@(http(s)?://[a-zA-Z0-9/\.\#\-\_]*)@';
|
||||||
return $output = preg_replace ( $pattern, '<a href="http$2://$3">$0</a>', $input );
|
return $output = preg_replace ( $pattern, '<a href="$1">$1</a>', $input );
|
||||||
}
|
}
|
||||||
=======
|
function inStr($needle, $haystack) {
|
||||||
<?php
|
if (strpos ( $haystack, $needle ) !== false) {
|
||||||
function umlaute($str) {
|
return true;
|
||||||
return str_replace ( array (
|
|
||||||
'Ä',
|
|
||||||
'Ö',
|
|
||||||
'Ü',
|
|
||||||
'ä',
|
|
||||||
'ö',
|
|
||||||
'ü',
|
|
||||||
'ß'
|
|
||||||
), array (
|
|
||||||
'Ä',
|
|
||||||
'Ö',
|
|
||||||
'Ü',
|
|
||||||
'ä',
|
|
||||||
'ö',
|
|
||||||
'ü',
|
|
||||||
'ß'
|
|
||||||
), $str );
|
|
||||||
}
|
|
||||||
function chk($str) {
|
|
||||||
return str_replace ( "'", '"', $str );
|
|
||||||
}
|
|
||||||
function noScript($str) {
|
|
||||||
return str_replace ( array (
|
|
||||||
'<',
|
|
||||||
'>'
|
|
||||||
), array (
|
|
||||||
'<',
|
|
||||||
'>'
|
|
||||||
), $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;
|
|
||||||
}
|
}
|
||||||
return false;
|
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 (
|
|
||||||
'{{|-<-|}}',
|
|
||||||
'{{|->-|}}'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}b{{|->-|}}',
|
|
||||||
'{{|-<-|}}b/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<b>',
|
|
||||||
'<b/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}u{{|->-|}}',
|
|
||||||
'{{|-<-|}}u/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<u>',
|
|
||||||
'<u/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}i{{|->-|}}',
|
|
||||||
'{{|-<-|}}i/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<i>',
|
|
||||||
'<i/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}span{{|->-|}}',
|
|
||||||
'{{|-<-|}}span/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<span>',
|
|
||||||
'<span/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}b{{|->-|}}',
|
|
||||||
'{{|-<-|}}b/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<b>',
|
|
||||||
'<b/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}br{{|->-|}}',
|
|
||||||
'{{|-<-|}}br/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<br>',
|
|
||||||
'<br/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}h1{{|->-|}}',
|
|
||||||
'{{|-<-|}}h1/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<h1>',
|
|
||||||
'<h1/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}h2{{|->-|}}',
|
|
||||||
'{{|-<-|}}h2/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<h2>',
|
|
||||||
'<h2/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}h3{{|->-|}}',
|
|
||||||
'{{|-<-|}}h3/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<h3>',
|
|
||||||
'<h3/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}h4{{|->-|}}',
|
|
||||||
'{{|-<-|}}h4/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<h4>',
|
|
||||||
'<h4/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}h5{{|->-|}}',
|
|
||||||
'{{|-<-|}}h5/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<h5>',
|
|
||||||
'<h5/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}h6{{|->-|}}',
|
|
||||||
'{{|-<-|}}h6/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<h6>',
|
|
||||||
'<h6/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}li{{|->-|}}',
|
|
||||||
'{{|-<-|}}li/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<li>',
|
|
||||||
'<li/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}ul{{|->-|}}',
|
|
||||||
'{{|-<-|}}ul/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<ul>',
|
|
||||||
'<ul/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}ol{{|->-|}}',
|
|
||||||
'{{|-<-|}}ol/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<ol>',
|
|
||||||
'<ol/>'
|
|
||||||
), $s );
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-<-|}}pre{{|->-|}}',
|
|
||||||
'{{|-<-|}}pre/{{|->-|}}'
|
|
||||||
), array (
|
|
||||||
'<pre>',
|
|
||||||
'<pre/>'
|
|
||||||
), $s );
|
|
||||||
|
|
||||||
// cleanup
|
|
||||||
$s = str_replace ( array (
|
|
||||||
'{{|-',
|
|
||||||
'-|}}'
|
|
||||||
), array (
|
|
||||||
'',
|
|
||||||
''
|
|
||||||
), $s );
|
|
||||||
|
|
||||||
return $s;
|
|
||||||
}
|
|
||||||
>>>>>>> branch 'master' of https://git.seemsleg.it/pub/php-func-lib
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user