46 Commits

Author SHA1 Message Date
Sebastian Titz
f1b4aaf23a Merge branch 'master' of https://git.seemsleg.it/pub/php-func-lib 2021-11-24 13:02:08 +01:00
Sebastian Titz
e6fd1de954 lrln 2021-11-24 13:01:24 +01:00
troy
c631b51ba2 hosteurope ips 2021-11-21 09:17:33 +01:00
Sebastian Titz
3e083b4eb9 ips 2021-11-16 10:14:06 +01:00
Sebastian Titz
0c41265fb6 bot ips 2021-11-05 07:44:33 +01:00
Sebastian Titz
31a0a02366 Merge branch 'master' of https://git.seemsleg.it/pub/php-func-lib 2021-11-03 07:22:50 +01:00
Sebastian Titz
233c9f5aed & in umlaute 2021-11-03 07:22:04 +01:00
troy
9c034cd935 versuch2 mit single param ohne array umbau 2021-10-15 12:48:41 +02:00
troy
d32ad04722 sql single hotfix 2021-10-15 12:21:19 +02:00
troy
32c65f7da1 sql mit einem param muss nicht mehr mit array geschrieben werden 2021-10-10 16:28:12 +02:00
troy
f736789f5b . 2021-10-09 13:44:04 +02:00
troy
973a0a1d01 microsoft ip 2021-09-21 15:14:23 +02:00
Sebastian Titz
de82116482 crawlerips 2021-08-26 15:21:59 +02:00
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
admin
df5d1447af Merge branch 'master' of https://git.seemsleg.it/pub/php-func-lib
Conflicts:
	string.php
2021-07-13 21:38:08 +02:00
admin
2352fd5396 linkify tool um urls in text in echte links zu verwandeln 2021-07-13 21:37:14 +02:00
Sebastian Titz
385a02c90f ? 2021-07-12 13:40:12 +02:00
admin
8638f28847 fix only alpha 2021-07-11 10:32:35 +02:00
home
5f2502877b . 2021-07-10 14:45:56 +02:00
admin
8eccdffb1e Merge branch 'master' of https://git.seemsleg.it/pub/php-func-lib
Conflicts:
	secret.php.example
2021-05-22 09:25:26 +02:00
admin
c858d5dd32 mail sender update 2021-05-22 09:24:33 +02:00
Sebastian Titz
234e187a54 merge 2021-05-10 13:27:51 +02:00
d8f5fd7f3a pub 2021-05-10 09:57:56 +02:00
admin
a30fd21842 Merge branch 'master' of https://git.seemsleg.it/pub/php-func-lib.git
into HEAD

Conflicts:
	.gitignore
	README.md
	_func.php
	secret.php.example
	sql.php
2021-05-09 18:13:15 +02:00
admin
57421ead5e . 2021-05-09 18:10:53 +02:00
a846fe2fa7 Initial commit 2021-05-09 15:10:06 +02:00
troy grunt
06a3112617 . 2021-04-09 15:13:07 +02:00
troy grunt
064d8f0df3 Merge branch 'master' of https://git.seemsleg.it/pub/php-func-lib 2021-04-09 15:11:31 +02:00
troy grunt
19dcea8344 Merge branch 'master' of https://git.seemsleg.it/pub/php-func-lib
Conflicts:
	README.md
2021-04-09 15:04:31 +02:00
b8e078f470 Initial commit 2021-04-06 13:39:59 +02:00
8 changed files with 355 additions and 328 deletions

9
.gitignore vendored
View File

@@ -1,5 +1,6 @@
/.buildpath /.buildpath
/.project /.project
/secret.php /secret.php
/config.php /config.php
/test.php /test.php
/_secret.php

View File

@@ -1,3 +1,2 @@
git submodule add https://git.seemsleg.it/ef/php-func-lib lib # php-func-lib
git submodule add https://git.seemsleg.it/pub/php-func-lib lib
test

View File

@@ -1,10 +1,10 @@
<?php <?php
// include ('config.php'); // include ('config.php');
include_once ('sql.php'); include_once ('sql.php');
$sql = new SQL (); $sql = new SQL ();
include_once ('string.php'); 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');
?> ?>

24
ips/crawler.php Normal file
View File

@@ -0,0 +1,24 @@
<?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.', // bing bot
'54.36.148.', // ahrefbot
'54.36.149.', // ahrefbot
'216.244.66.196', // opensiteexplorer
'65.21.180.26', // seekport
'81.209.177.145', // website-datenbank.de
'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,17 +1,20 @@
<?php <?php
function send_mail($an, $betreff, $text, $ok = '', $error = '') {
include 'secret.php';
$sender = 'noreply@troy-grunt.de';
if (isset ( $_sendermail )) {
$sender = $_sendermail;
}
$header = 'From: ' . $sender . "\r\n";
$header .= 'To: ' . $an . "\r\n";
$header .= 'Content-Type:text/html' . "\r\n";
$header .= 'Content-Transfer-Encoding: 8bit' . "\r\n";
$header .= 'X-Mailer: PHP/' . phpversion ();
function send_mail($an, $betreff, $text, $ok = '', $error = '') if (mail ( $an, $betreff, $text, $header ) === true) {
{ echo $ok;
$header = 'From: noreply@isleofhope.de' . "\r\n"; } else {
$header .= 'To: ' . $an . "\r\n"; echo $error;
$header .= 'Content-Type:text/html' . "\r\n"; }
$header .= 'Content-Transfer-Encoding: 8bit' . "\r\n";
$header .= 'X-Mailer: PHP/' . phpversion();
if (mail($an, $betreff, $text, $header) === true) {
echo $ok;
} else {
echo $error;
}
} }

View File

@@ -7,4 +7,6 @@ $_m['pass'] = '';
$_m['data'] = ''; $_m['data'] = '';
$_m['pre'] = 'efcms2_'; $_m['pre'] = 'efcms2_';
$_m['salt'] = ''; $_m['salt'] = '';
$_sendermail = 'noreply@troy-grunt.de';
?> ?>

396
sql.php
View File

@@ -1,206 +1,192 @@
<?php <?php
/* class SQL {
* $query = sprintf("SELECT firstname, lastname, address, age FROM friends private $h;
* WHERE firstname='%s' AND lastname='%s'", private $res = false;
* mysql_real_escape_string($firstname), private $m;
* mysql_real_escape_string($lastname)); public $salt;
* public $pre;
* public $cnt_get = 0;
*/ public $cnt_set = 0;
class SQL { public function __construct() {
private $h; require_once ('secret.php');
private $res = false;
private $m; $this->m = $_m;
public $salt; $this->pre = $_m ['pre'];
public $pre; $this->salt = $_m ['salt'];
public $cnt_get = 0; if (SQL_LOG)
public $cnt_set = 0; $this->f = fopen ( 'sql.log', 'w' );
public function __construct() {
require_once ('secret.php'); $this->h = new mysqli ( $_m ['host'], $_m ['user'], $_m ['pass'], $_m ['data'] );
if ($this->h->connect_errno) {
$this->m = $_m; return false;
$this->pre = $_m ['pre']; }
$this->salt = $_m ['salt']; return true;
if (SQL_LOG) }
$this->f = fopen ( 'sql.log', 'w' ); public function get($que, $t = '', $p = array ()) {
// echo $que;
$this->h = mysqli_connect ( $_m ['host'], $_m ['user'], $_m ['pass'] ); $this->cnt_get ++;
//var_dump ( $this->h ); if (SQL_LOG)
if (! $this->h) { fputs ( $this->f, str_replace ( array (
return false; "\n",
} " "
mysqli_select_db ( $this->h, $_m ['data'] ); ), array (
return true; ' ',
} ''
private function prepare($q, $t, $p) { ), $que ) . "\n" . print_r ( $p, true ) . "\n\n" );
$t = str_split ( $t ); $statement = $this->h->prepare ( $que );
$v = array (); if (is_array ( $p )) {
$q = str_replace ( "?", "%s", $q ); switch (count ( $p )) {
foreach ( $t as $i => $c ) { case 0 :
switch ($c) { break;
case 's' : case 1 :
$v [] = "'" . mysqli_real_escape_string ( $this->h, $p [$i] ) . "'"; $statement->bind_param ( $t, $p [0] );
break; break;
case 'i' : case 2 :
$v [] = ( int ) $p [$i]; $statement->bind_param ( $t, $p [0], $p [1] );
break; break;
case 'd' : case 3 :
$v [] = ( double ) $p [$i]; $statement->bind_param ( $t, $p [0], $p [1], $p [2] );
break; break;
default : case 4 :
//return false; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] );
} break;
} case 5 :
$statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] );
$res = array (); break;
switch (count ( $p )) { case 6 :
case 0 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] );
$res = mysqli_query ( $this->h, $q ); break;
break; case 7 :
case 1 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] );
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0] ) ); break;
break; case 8 :
case 2 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] );
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1] ) ); break;
break; case 9 :
case 3 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] );
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2] ) ); break;
break; case 10 :
case 4 : $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8], $p [9] );
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2], $v [3] ) ); break;
break; }
case 5 : } else {
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2], $v [3], $v [4] ) ); $statement->bind_param ( $t, $p );
break; }
case 6 : $statement->execute ();
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2], $v [3], $v [4], $v [5] ) );
break; $ret = array ();
case 7 :
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2], $v [3], $v [4], $v [5], $v [6] ) ); // print_r($statement);
break; if (isset ( $statement->error ) && $statement->error != '') {
case 8 : if (SQL_LOG)
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2], $v [3], $v [4], $v [5], $v [6], $v [7] ) ); fputs ( $this->f, $statement->error );
break; return false;
case 9 : }
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2], $v [3], $v [4], $v [5], $v [6], $v [7], $v [8] ) ); $result = $statement->get_result ();
break; // print_r($result);
case 10 : while ( $row = $result->fetch_assoc () ) {
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2], $v [3], $v [4], $v [5], $v [6], $v [7], $v [8], $v [9] ) ); $ret [] = $row;
break; }
case 11 : return $ret;
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2], $v [3], $v [4], $v [5], $v [6], $v [7], $v [8], $v [9], $v [10] ) ); }
break; public function single($que, $t = '', $p = array ()) {
case 12 : $data = $this->get ( $que, $t, $p );
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2], $v [3], $v [4], $v [5], $v [6], $v [7], $v [8], $v [9], $v [10], $v [11] ) ); if ($data) {
break; return $data [0];
case 13 : }
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2], $v [3], $v [4], $v [5], $v [6], $v [7], $v [8], $v [9], $v [10], $v [11], $v [12] ) ); return false;
break; }
case 14 : public function list($que, $t = '', $p = array ()) {
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2], $v [3], $v [4], $v [5], $v [6], $v [7], $v [8], $v [9], $v [10], $v [11], $v [12], $v [13] ) ); $data = $this->get ( $que, $t, $p );
break; if ($data) {
case 15 : $ret = array ();
$res = mysqli_query ( $this->h, sprintf ( $q, $v [0], $v [1], $v [2], $v [3], $v [4], $v [5], $v [6], $v [7], $v [8], $v [9], $v [10], $v [11], $v [12], $v [13], $v [14] ) ); foreach ( $data as $d ) {
break; foreach ( $d as $k => $v ) {
} $ret [] = $v;
//echo 'ERROR:'; }
//var_dump ( mysqli_error_list ( $this->h ) ); }
//echo '<br>'; return $ret;
/* }
* if (! $res || mysqli_errno ( $this->h )) { return false;
* return false; }
* } public function keyval($que, $k, $v, $t = '', $p = array ()) {
*/ $data = $this->get ( $que, $t, $p );
return $res; if ($data) {
} $ret = array ();
public function get($que, $t = '', $p = array ()) { foreach ( $data as $d ) {
// echo $que; $ret [$d [$k]] = $d [$v];
$this->cnt_get ++; }
if (SQL_LOG) return $ret;
fputs ( $this->f, str_replace ( array ( }
"\n", return false;
" " }
), array ( public function set($que, $t = '', $p = array (), $id = false) {
' ', // echo $que;
'' $this->cnt_set ++;
), $que ) . "\n" . print_r ( $p, true ) . "\n\n" ); $statement = $this->h->prepare ( $que );
$res = $this->prepare ( $que, $t, $p ); if (SQL_LOG)
//var_dump ( $res ); fputs ( $this->f, str_replace ( array (
//echo '<hr>'; "\n",
$ret = array (); " "
), array (
// print_r($statement); ' ',
if (! $res) { ''
if (SQL_LOG) ), $que ) . "\n" . print_r ( $p, true ) . "\n\n" );
fputs ( $this->f, mysqli_error ( $this->h ) ); if (is_array ( $p )) {
return false; switch (count ( $p )) {
} case 0 :
while ( $row = $res->fetch_assoc () ) { break;
$ret [] = $row; case 1 :
} $statement->bind_param ( $t, $p [0] );
break;
//var_dump ( $ret ); case 2 :
//echo '<hr><hr>'; $statement->bind_param ( $t, $p [0], $p [1] );
return $ret; break;
} case 3 :
public function single($que, $t = '', $p = array ()) { $statement->bind_param ( $t, $p [0], $p [1], $p [2] );
$data = $this->get ( $que, $t, $p ); break;
if ($data) { case 4 :
return $data [0]; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3] );
} break;
return false; case 5 :
} $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4] );
public function list($que, $t = '', $p = array ()) { break;
$data = $this->get ( $que, $t, $p ); case 6 :
if ($data) { $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5] );
$ret = array (); break;
foreach ( $data as $d ) { case 7 :
foreach ( $d as $k => $v ) { $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6] );
$ret [] = $v; break;
} case 8 :
} $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7] );
return $ret; break;
} case 9 :
return false; $statement->bind_param ( $t, $p [0], $p [1], $p [2], $p [3], $p [4], $p [5], $p [6], $p [7], $p [8] );
} break;
public function keyval($que, $k, $v, $t = '', $p = array ()) { case 10 :
$data = $this->get ( $que, $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] );
if ($data) { break;
$ret = array (); }
foreach ( $data as $d ) { } else {
$ret [$d [$k]] = $d [$v]; $statement->bind_param ( $t, $p );
} }
return $ret; $statement->execute ();
} if (isset ( $statement->error ) && $statement->error != '') {
return false; if (SQL_LOG)
} fputs ( $this->f, $statement->error );
public function set($que, $t = '', $p = array (), $id = false) { return false;
// echo $que; }
$this->cnt_set ++;
if (SQL_LOG) if ($id) {
fputs ( $this->f, str_replace ( array ( return $statement->insert_id;
"\n", } else {
" " return $statement->affected_rows;
), array ( }
' ', }
'' function __destruct() {
), $que ) . "\n" . print_r ( $p, true ) . "\n\n" ); if (SQL_LOG)
$res = $this->prepare ( $que, $t, $p ); $this->h->close ();
// echo 'DESTROY';
if (! $res) { }
if (SQL_LOG) }
fputs ( $this->f, mysqli_error ( $this->h ) );
return false;
}
if ($id) {
return mysqli_insert_id ( $this->h );
} else {
return ( bool ) mysqli_affected_rows ( $this->h );
}
}
function __destruct() {
mysqli_close ( $this->h );
}
}
?> ?>

View File

@@ -1,21 +1,23 @@
<?php <?php
function umlaute($str) { function umlaute($str) {
return str_replace ( array ( return str_replace ( array (
'Ä', 'Ä',
'Ö', 'Ö',
'Ü', 'Ü',
'ä', 'ä',
'ö', 'ö',
'ü', 'ü',
'ß' 'ß',
'&'
), array ( ), array (
'&Auml;', '&Auml;',
'&Ouml;', '&Ouml;',
'&Uuml;', '&Uuml;',
'&auml;', '&auml;',
'&ouml;', '&ouml;',
'&uuml;', '&uuml;',
'&szlig;' '&szlig;',
'&amp;'
), $str ); ), $str );
} }
function chk($str) { function chk($str) {
@@ -23,17 +25,17 @@ function chk($str) {
} }
function noScript($str) { function noScript($str) {
return str_replace ( array ( return str_replace ( array (
'<', '<',
'>' '>'
), array ( ), array (
'&lt;', '&lt;',
'&gt;' '&gt;'
), $str ); ), $str );
} }
function random($name_laenge) { function random($name_laenge) {
$zeichen = "abcedfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZ0123456789"; $zeichen = "abcedfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZ0123456789";
$name_neu = ""; $name_neu = "";
@mt_srand ( ( double ) microtime () * 1000000 ); @mt_srand ( ( double ) microtime () * 1000000 );
for($i = 0; $i < $name_laenge; $i ++) { for($i = 0; $i < $name_laenge; $i ++) {
$r = mt_rand ( 0, strlen ( $zeichen ) - 1 ); $r = mt_rand ( 0, strlen ( $zeichen ) - 1 );
@@ -47,7 +49,7 @@ function startsWith($haystack, $needle) {
} }
function endsWith($haystack, $needle) { function endsWith($haystack, $needle) {
$length = strlen ( $needle ); $length = strlen ( $needle );
return $length === 0 || (substr ( $haystack, - $length ) === $needle); return $length === 0 || (substr ( $haystack, - $length ) === $needle);
} }
function onlyAlpha($str, $zus = '') { function onlyAlpha($str, $zus = '') {
@@ -127,134 +129,144 @@ function markUp($text) {
} }
function onlySimpleHTML($s) { function onlySimpleHTML($s) {
$s = str_replace ( array ( $s = str_replace ( array (
'<', '<',
'>' '>'
), array ( ), array (
'{{|-&lt;-|}}', '{{|-&lt;-|}}',
'{{|-&gt;-|}}' '{{|-&gt;-|}}'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}b{{|-&gt;-|}}', '{{|-&lt;-|}}b{{|-&gt;-|}}',
'{{|-&lt;-|}}b/{{|-&gt;-|}}' '{{|-&lt;-|}}b/{{|-&gt;-|}}'
), array ( ), array (
'<b>', '<b>',
'<b/>' '<b/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}u{{|-&gt;-|}}', '{{|-&lt;-|}}u{{|-&gt;-|}}',
'{{|-&lt;-|}}u/{{|-&gt;-|}}' '{{|-&lt;-|}}u/{{|-&gt;-|}}'
), array ( ), array (
'<u>', '<u>',
'<u/>' '<u/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}i{{|-&gt;-|}}', '{{|-&lt;-|}}i{{|-&gt;-|}}',
'{{|-&lt;-|}}i/{{|-&gt;-|}}' '{{|-&lt;-|}}i/{{|-&gt;-|}}'
), array ( ), array (
'<i>', '<i>',
'<i/>' '<i/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}span{{|-&gt;-|}}', '{{|-&lt;-|}}span{{|-&gt;-|}}',
'{{|-&lt;-|}}span/{{|-&gt;-|}}' '{{|-&lt;-|}}span/{{|-&gt;-|}}'
), array ( ), array (
'<span>', '<span>',
'<span/>' '<span/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}b{{|-&gt;-|}}', '{{|-&lt;-|}}b{{|-&gt;-|}}',
'{{|-&lt;-|}}b/{{|-&gt;-|}}' '{{|-&lt;-|}}b/{{|-&gt;-|}}'
), array ( ), array (
'<b>', '<b>',
'<b/>' '<b/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}br{{|-&gt;-|}}', '{{|-&lt;-|}}br{{|-&gt;-|}}',
'{{|-&lt;-|}}br/{{|-&gt;-|}}' '{{|-&lt;-|}}br/{{|-&gt;-|}}'
), array ( ), array (
'<br>', '<br>',
'<br/>' '<br/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}h1{{|-&gt;-|}}', '{{|-&lt;-|}}h1{{|-&gt;-|}}',
'{{|-&lt;-|}}h1/{{|-&gt;-|}}' '{{|-&lt;-|}}h1/{{|-&gt;-|}}'
), array ( ), array (
'<h1>', '<h1>',
'<h1/>' '<h1/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}h2{{|-&gt;-|}}', '{{|-&lt;-|}}h2{{|-&gt;-|}}',
'{{|-&lt;-|}}h2/{{|-&gt;-|}}' '{{|-&lt;-|}}h2/{{|-&gt;-|}}'
), array ( ), array (
'<h2>', '<h2>',
'<h2/>' '<h2/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}h3{{|-&gt;-|}}', '{{|-&lt;-|}}h3{{|-&gt;-|}}',
'{{|-&lt;-|}}h3/{{|-&gt;-|}}' '{{|-&lt;-|}}h3/{{|-&gt;-|}}'
), array ( ), array (
'<h3>', '<h3>',
'<h3/>' '<h3/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}h4{{|-&gt;-|}}', '{{|-&lt;-|}}h4{{|-&gt;-|}}',
'{{|-&lt;-|}}h4/{{|-&gt;-|}}' '{{|-&lt;-|}}h4/{{|-&gt;-|}}'
), array ( ), array (
'<h4>', '<h4>',
'<h4/>' '<h4/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}h5{{|-&gt;-|}}', '{{|-&lt;-|}}h5{{|-&gt;-|}}',
'{{|-&lt;-|}}h5/{{|-&gt;-|}}' '{{|-&lt;-|}}h5/{{|-&gt;-|}}'
), array ( ), array (
'<h5>', '<h5>',
'<h5/>' '<h5/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}h6{{|-&gt;-|}}', '{{|-&lt;-|}}h6{{|-&gt;-|}}',
'{{|-&lt;-|}}h6/{{|-&gt;-|}}' '{{|-&lt;-|}}h6/{{|-&gt;-|}}'
), array ( ), array (
'<h6>', '<h6>',
'<h6/>' '<h6/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}li{{|-&gt;-|}}', '{{|-&lt;-|}}li{{|-&gt;-|}}',
'{{|-&lt;-|}}li/{{|-&gt;-|}}' '{{|-&lt;-|}}li/{{|-&gt;-|}}'
), array ( ), array (
'<li>', '<li>',
'<li/>' '<li/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}ul{{|-&gt;-|}}', '{{|-&lt;-|}}ul{{|-&gt;-|}}',
'{{|-&lt;-|}}ul/{{|-&gt;-|}}' '{{|-&lt;-|}}ul/{{|-&gt;-|}}'
), array ( ), array (
'<ul>', '<ul>',
'<ul/>' '<ul/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}ol{{|-&gt;-|}}', '{{|-&lt;-|}}ol{{|-&gt;-|}}',
'{{|-&lt;-|}}ol/{{|-&gt;-|}}' '{{|-&lt;-|}}ol/{{|-&gt;-|}}'
), array ( ), array (
'<ol>', '<ol>',
'<ol/>' '<ol/>'
), $s ); ), $s );
$s = str_replace ( array ( $s = str_replace ( array (
'{{|-&lt;-|}}pre{{|-&gt;-|}}', '{{|-&lt;-|}}pre{{|-&gt;-|}}',
'{{|-&lt;-|}}pre/{{|-&gt;-|}}' '{{|-&lt;-|}}pre/{{|-&gt;-|}}'
), 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) {
$pattern = '@(http(s)?://[a-zA-Z0-9/\.\#\-\_]*)@';
return $output = preg_replace ( $pattern, '<a href="$1">$1</a>', $input );
}
function inStr($needle, $haystack) {
if (strpos ( $haystack, $needle ) !== false) {
return true;
}
return false;
}
?> ?>