back'; function checkFiles() { if (!DEBUG && (file_exists('install') || file_exists('documents'))) { exit('

Bitte lösche die Ordner "install" und "documents"!
'); } } function message($type, $text, $url){ if($url==1) $url = 'javascript:history.back()'; if($type == 'error') { $msg = '

'.$text.'

back

'; return $msg; } elseif($type == 'msg') { $msg = '

'; $msg .= $text; $msg .= 'Du wirst in 3 Sekunden weitergeleitet.
Wenn Du nicht länger warten willst, klicke hier.


'; return $msg; } } function drawheader($header) { echo'


'.$header.'

'; } function drawfooter($version) { echo '
'; } // Checkt am Anfang jeder Seite, ob der Zugriff authorisiert ist function checklogin() { session_start(); if (!$_SESSION['loginuser']) { // Deaktiviert // $path = __FILE__; // $redirect = basename($path); header("Location: pn_login.php"); exit(); } } // Checkt, ob der User Admin-Rechte hat function adminonlyaccess($loginlevel) { if ($loginlevel != 'admin') { exit('Hierfür musst du Admin sein! Du bist '.$loginlevel.'...'); } } // Macht aus Zeilenumbrüchen XHTML-Breaks (
) function my_nl2br ($text) { $retvalue = ''; for ($ii = 0; $ii < strlen($text); $ii++) { if ($text[$ii]!= chr(13)) $text[$ii] == "\n" ? $retvalue .= '
' : $retvalue .= $text[$ii]; } return $retvalue; } function my_br2nl ($text) { return preg_replace('=|([\s/][^>]*)>)\r?\n?=i', "\n", $text); } // Ermöglicht UBB-Code function bbcode($string) { $pattern = array( 'bold' => '=\[b](.*)\[/b]=sUi', 'underline' => '=\[u](.*)\[/u]=sUi', 'italic' => '=\[i](.*)\[/i]=sUi', 'strike' => '=\[s](.*)\[/s]=sUi', 'url1' => '=\[url1\=(.*)\](.*)\[/url1]=sUi', 'url2' => '=\[url2\=(.*)\](.*)\[/url2]=sUi', 'email1' => '=\[email](.*)\[/email]=sUi', 'email2' => '=\[email\=(.*)\](.*)\[/email]=sUi', 'code' => '=\[code\](.*)\[/code\]=sUi', 'quote' => '=\[quote\](.*)\[/quote\]=sUi', 'list' => '=\[list\](.*)\[/list\]=sUi', 'list_olul' => '=\[list\=(ol|ul)\](.*)\[/list\]=sUi', 'li' => '=\[\*\](.*)=sUi', 'img' => '=\[img\=(.*)\]=sUi', ); $replace = array( 'bold' => '$1', 'underline' => '$1', 'italic' => '$1', 'strike' => '$1', 'url1' => '$1', 'url2' => '$2', 'email1' => '$1', 'email2' => '$2', 'code' => '
Quellcode:
$1

', 'quote' => '
Quote:
$1
', 'list' => '', 'list_olul' => '<$1>$2', 'li' => '
  • $1
  • ', 'img' => '', ); return preg_replace($pattern, $replace, $string); } // Fügt Smilie-Grafiken ein function smilies($path,$text) { $smilieString = array( 'angel' => '@:)', 'angry' => ':angry:', 'confused' => ':c:', 'cool' => '8)', 'cross' => ':x', 'crying' => ':cry:', 'devil' => ':evil:', 'dont-know' => ':?:', 'grin' => ':D', 'hug-left' => ':L', 'hug-right' => ':R', 'kiss' => ':B', 'nerdy' => ':nerdy:', 'neutral' => ':|', 'sad' => ':(', 'shame' => ':oops:', 'shock' => ':shock:', 'sick' => ':sick:', 'silent' => ':silent:', 'smile' => ':)', 'thinking' => ':thinking:', 'tongue' => ':P:', 'uhm-yeah' => ':´|:', 'wink' => ':wink:', 'yawn' => ':o:' ); $imgpath1 = ''; $smilieHtml = array( 'angel' => $imgpath1.'angel.png'.$imgpath2, 'angry' => $imgpath1.'angry.png'.$imgpath2, 'confused' => $imgpath1.'confused.png'.$imgpath2, 'cool' => $imgpath1.'cool.png'.$imgpath2, 'cross' => $imgpath1.'cross.png'.$imgpath2, 'crying' => $imgpath1.'crying.png'.$imgpath2, 'devil' => $imgpath1.'devil.png'.$imgpath2, 'dont-know' => $imgpath1.'dont-know.png'.$imgpath2, 'grin' => $imgpath1.'grin.png'.$imgpath2, 'hug-left' => $imgpath1.'hug-left.png'.$imgpath2, 'hug-right' => $imgpath1.'hug-right.png'.$imgpath2, 'kiss' => $imgpath1.'kiss.png'.$imgpath2, 'nerdy' => $imgpath1.'nerdy.png'.$imgpath2, 'neutral' => $imgpath1.'neutral.png'.$imgpath2, 'sad' => $imgpath1.'sad.png'.$imgpath2, 'shame' => $imgpath1.'shame.png'.$imgpath2, 'shock' => $imgpath1.'shock.png'.$imgpath2, 'sick' => $imgpath1.'sick.png'.$imgpath2, 'silent' => $imgpath1.'silent.png'.$imgpath2, 'smile' => $imgpath1.'smile.png'.$imgpath2, 'thinking' => $imgpath1.'thinking.png'.$imgpath2, 'tongue' => $imgpath1.'tongue.png'.$imgpath2, 'uhm-yeah' => $imgpath1.'uhm-yeah.png'.$imgpath2, 'wink' => $imgpath1.'wink.png'.$imgpath2, 'yawn' => $imgpath1.'yawn.png'.$imgpath2 ); return str_replace($smilieString,$smilieHtml,$text); } function a(){ return ''; } function commentscount($id) { $datafile = PATH.'inc/pn_comments.dat'; $zeile = file($datafile); $zeilen = sizeof($zeile); $commentscount = 0; for ($i=0; $i < $zeilen; $i++) { $eintrag = explode('§',$zeile[$i]); if ($eintrag[1] == $id) { $commentscount++; } } return $commentscount; } function formatdate($datum, $dateformat) { $datum = date($dateformat, $datum); return $datum; } function formattext ($text, $smilies, $smiliespath, $html) { if($html == 'txt0' OR $html == 'com0' ) { $text = htmlspecialchars($text); $text = str_replace('<br>','
    ',$text); $text = str_replace('<br />','
    ',$text); } $text = bbcode($text); if ($smilies == 'yes') $text = smilies($smiliespath,$text); return $text; } function cleantext ($text, $hsc=0) { $text = my_nl2br(stripslashes($text)); $text = str_replace("§"," ",$text); $text = trim($text); if($hsc == 1) $text = htmlspecialchars($text); return $text; } function readcatselect($catfile) { $zeile = file($catfile); $zeilen = sizeof($zeile); for ($i=0; $i<$zeilen; $i++) { $eintrag = explode ('§', $zeile[$i]); echo ''; } } function getcat($catnr,$catfile,$picdir, $catpics) { $catzeile = file($catfile); $catzeilen = sizeof($catzeile); for ($i=0; $i<$catzeilen; $i++) { $catex = explode ('§', $catzeile[$i]); if($catex[0] == $catnr) { if($catpics=='yes' && $catex[2]!=''){ $imgsize = @getimagesize($picdir.'/'.$catex[2]); $width = $imgsize[0]; $height = $imgsize[1]; //$catex[2] = ''; $catex[2] = ''; return $catex[2]; } //else return $catex[1]; } } } function getselectedcat($catnr,$catfile) { $catzeile = file($catfile); $catzeilen = sizeof($catzeile); for ($i=0; $i<$catzeilen; $i++) { $catex = explode ('§', $catzeile[$i]); if ($catex[0] == $catnr) echo ''; else echo ''; } } function getname($user, $userfile) { $zeile = file($userfile); $zeilen = sizeof($zeile); for ($i=2; $i<$zeilen-2; $i++) { $eintrag = explode ('§', $zeile[$i]); if($eintrag[3] == $user) return $eintrag[0]; } } function delcomment($id, $comfile){ $zeile = file($comfile); $zeilen = sizeof($zeile); for ($i=0,$z=0; $i < $zeilen; $i++) { $entry = explode ('§', $zeile[$i]); if ($entry[1] != $id) { $neuzeile[$z] = $zeile[$i]; $z++; } } $fp = fopen($comfile,"w+"); flock($fp,2); for ($i=0; $i < $zeilen; $i++) { fwrite($fp, $neuzeile[$i]); } flock($fp,3); fclose($fp); } function unspecialchars($text) { $text = stripslashes($text); $text = str_replace('&','&',$text); $text = str_replace('"','"',$text); $text = str_replace('<','<',$text); $text = str_replace('>','>',$text); return $text; } function delfile($file) { $delfile = @unlink($file); @clearstatcache(); if (@file_exists($file)) { @unlink(trim($file)); } @clearstatcache(); if (@file_exists($file)) { $filesys = @eregi_replace("/","\\",$file); $delete = @system("del $filesys"); } @clearstatcache(); if (@file_exists($file)) { $delete = @chmod ($file, 0775); $delete = @unlink($file); $delete = @system("del $filesys"); } @clearstatcache(); if (@file_exists($file)) return 0; else return 1; } ?>