Compare commits
14 Commits
new-mysql
...
385a02c90f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
385a02c90f | ||
|
|
8638f28847 | ||
|
|
5f2502877b | ||
|
|
8eccdffb1e | ||
|
|
c858d5dd32 | ||
|
|
234e187a54 | ||
| d8f5fd7f3a | |||
|
|
a30fd21842 | ||
|
|
57421ead5e | ||
| a846fe2fa7 | |||
|
|
06a3112617 | ||
|
|
064d8f0df3 | ||
|
|
19dcea8344 | ||
| b8e078f470 |
8
.gitignore
vendored
8
.gitignore
vendored
@@ -1,5 +1,5 @@
|
|||||||
/.buildpath
|
/.buildpath
|
||||||
/.project
|
/.project
|
||||||
/secret.php
|
/secret.php
|
||||||
/config.php
|
/config.php
|
||||||
/test.php
|
/test.php
|
||||||
|
|||||||
@@ -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
|
|
||||||
|
|||||||
18
_func.php
18
_func.php
@@ -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');
|
||||||
?>
|
?>
|
||||||
29
mail.php
29
mail.php
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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';
|
||||||
?>
|
?>
|
||||||
2
sql.php
2
sql.php
@@ -196,4 +196,4 @@ class SQL {
|
|||||||
// echo 'DESTROY';
|
// echo 'DESTROY';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
518
string.php
518
string.php
@@ -1,260 +1,260 @@
|
|||||||
<?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) {
|
||||||
return str_replace ( "'", '"', $str );
|
return str_replace ( "'", '"', $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) {
|
||||||
$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 );
|
||||||
$name_neu .= $zeichen {$r};
|
$name_neu .= $zeichen {$r};
|
||||||
}
|
}
|
||||||
return $name_neu;
|
return $name_neu;
|
||||||
}
|
}
|
||||||
function startsWith($haystack, $needle) {
|
function startsWith($haystack, $needle) {
|
||||||
$length = strlen ( $needle );
|
$length = strlen ( $needle );
|
||||||
return (substr ( $haystack, 0, $length ) === $needle);
|
return (substr ( $haystack, 0, $length ) === $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 = '') {
|
||||||
return preg_replace ( "/[^a-zA-Z0-9 \-\{$zus}_]+/", "", $str );
|
return preg_replace ( "/[^a-zA-Z0-9 \-\_{$zus}]+/", "", $str );
|
||||||
}
|
}
|
||||||
function shortener($str, $len = 50, $fill = '...') {
|
function shortener($str, $len = 50, $fill = '...') {
|
||||||
if (strlen ( $str ) > $len) {
|
if (strlen ( $str ) > $len) {
|
||||||
$str = substr ( $str, 0, $len - strlen ( $fill ) ) . $fill;
|
$str = substr ( $str, 0, $len - strlen ( $fill ) ) . $fill;
|
||||||
}
|
}
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
function isEmail($str) {
|
function isEmail($str) {
|
||||||
$match = preg_match ( "/[a-zA-Z0-9\-\_\.]*\@[a-zA-Z0-9\-\_\.]*.[a-z]{2,10}/", $str );
|
$match = preg_match ( "/[a-zA-Z0-9\-\_\.]*\@[a-zA-Z0-9\-\_\.]*.[a-z]{2,10}/", $str );
|
||||||
if ($match) {
|
if ($match) {
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function markUp($text) {
|
function markUp($text) {
|
||||||
$r = '';
|
$r = '';
|
||||||
$lv = 0;
|
$lv = 0;
|
||||||
foreach ( explode ( "\n", $text ) as $t ) {
|
foreach ( explode ( "\n", $text ) as $t ) {
|
||||||
$nlv = 0;
|
$nlv = 0;
|
||||||
if (startsWith ( '**** ', $t )) {
|
if (startsWith ( '**** ', $t )) {
|
||||||
$t = substr ( $t, 5 );
|
$t = substr ( $t, 5 );
|
||||||
$nlv = 4;
|
$nlv = 4;
|
||||||
}
|
}
|
||||||
if (startsWith ( '*** ', $t )) {
|
if (startsWith ( '*** ', $t )) {
|
||||||
$t = substr ( $t, 4 );
|
$t = substr ( $t, 4 );
|
||||||
$nlv = 3;
|
$nlv = 3;
|
||||||
}
|
}
|
||||||
if (startsWith ( '** ', $t )) {
|
if (startsWith ( '** ', $t )) {
|
||||||
$t = substr ( $t, 3 );
|
$t = substr ( $t, 3 );
|
||||||
$nlv = 2;
|
$nlv = 2;
|
||||||
}
|
}
|
||||||
if (startsWith ( '* ', $t )) {
|
if (startsWith ( '* ', $t )) {
|
||||||
$t = substr ( $t, 2 );
|
$t = substr ( $t, 2 );
|
||||||
$nlv = 1;
|
$nlv = 1;
|
||||||
}
|
}
|
||||||
if ($lv != $nlv) {
|
if ($lv != $nlv) {
|
||||||
while ( $lv < $nlv ) {
|
while ( $lv < $nlv ) {
|
||||||
$text .= '<ul>';
|
$text .= '<ul>';
|
||||||
$lv ++;
|
$lv ++;
|
||||||
}
|
}
|
||||||
while ( $lv > $nlv ) {
|
while ( $lv > $nlv ) {
|
||||||
$text .= '</ul>';
|
$text .= '</ul>';
|
||||||
$lv --;
|
$lv --;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (startsWith ( $t, '!!!!! ' )) {
|
if (startsWith ( $t, '!!!!! ' )) {
|
||||||
$t = '<h5>' . substr ( $t, 6 ) . '</h5>';
|
$t = '<h5>' . substr ( $t, 6 ) . '</h5>';
|
||||||
}
|
}
|
||||||
if (startsWith ( $t, '!!!! ' )) {
|
if (startsWith ( $t, '!!!! ' )) {
|
||||||
$t = '<h4>' . substr ( $t, 5 ) . '</h4>';
|
$t = '<h4>' . substr ( $t, 5 ) . '</h4>';
|
||||||
}
|
}
|
||||||
if (startsWith ( $t, '!!! ' )) {
|
if (startsWith ( $t, '!!! ' )) {
|
||||||
$t = '<h3>' . substr ( $t, 4 ) . '</h3>';
|
$t = '<h3>' . substr ( $t, 4 ) . '</h3>';
|
||||||
}
|
}
|
||||||
if (startsWith ( $t, '!! ' )) {
|
if (startsWith ( $t, '!! ' )) {
|
||||||
$t = '<h2>' . substr ( $t, 3 ) . '</h2>';
|
$t = '<h2>' . substr ( $t, 3 ) . '</h2>';
|
||||||
}
|
}
|
||||||
if (startsWith ( $t, '! ' )) {
|
if (startsWith ( $t, '! ' )) {
|
||||||
$t = '<h1>' . substr ( $t, 2 ) . '</h1>';
|
$t = '<h1>' . substr ( $t, 2 ) . '</h1>';
|
||||||
}
|
}
|
||||||
if ($lv == 0) {
|
if ($lv == 0) {
|
||||||
$r .= $t;
|
$r .= $t;
|
||||||
} else {
|
} else {
|
||||||
$r .= '<li>' . $t . '</li>';
|
$r .= '<li>' . $t . '</li>';
|
||||||
}
|
}
|
||||||
// var_dump ( $t );
|
// var_dump ( $t );
|
||||||
}
|
}
|
||||||
while ( $lv > 0 ) {
|
while ( $lv > 0 ) {
|
||||||
$r .= '</ul>';
|
$r .= '</ul>';
|
||||||
$lv --;
|
$lv --;
|
||||||
}
|
}
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
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;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user