* +------------------------------------------------------------+ */ $startzeit=microtime(); #---< INCLUDE PFAD --------> define('GB_PATH',""); #---< INCLUDE PFAD --------> define('FILE_POSTS',GB_PATH."db/posts.dat"); define('FILE_SMILIE',GB_PATH."db/smilie.dat"); $GB_INCLUDE[Img] = GB_PATH; $gb_failure = true; $gb_del = true; include(GB_PATH."admin/engine.inc.php"); include(GB_PATH."db/settings.dat"); $GB_ERROR['Hp'] = "Homepageadresse ist falsch!"; $GB_ERROR['Mail'] = "Emailadresse ist falsch!"; $GB_ERROR['Error1']= "Felder wurden
nicht korrekt ausgefüllt!"; $GB_ERROR['Error2']= "Kommentar muss mindestens ".$GB_ADMIN[Min_Zeichen_Comment]." Zeichen haben!"; $GB_ERROR['Error3']= "Name muss mindestens ".$GB_ADMIN[Min_Zeichen_Name]." Zeichen haben!"; $GB_ERROR['Error4']= "Kommentar darf nicht mehr als ".$GB_ADMIN[Max_Zeichen_Comment]." Zeichen haben!"; $GB_ERROR['Error6']= "Ihr Eintrag wurde hinzugefügt"; $GB_ERROR['Error5']= "Eintrag exestiert bereits!"; $GB_ERROR['Error7']= "Ihr Server unterstützt keine Mailfunktion
Schalte die Mailfunktion im Admin ab."; if($GB_ADMIN[Service] == Off) { print "
".$GB_ADMIN['Service_Grund'].""; } else { $gb_temp = $gb_class_template->gb_temp(GB_PATH."templates/gb_temp"); $gb_spamcontrol = true; if(GB_PATH == "") { echo"\n"; echo"\n"; echo"\n"; echo"".$GB_ADMIN['Titel']."\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; echo"\n"; } else { echo"\n"; } echo" \n"; ?> \n"; if(GB_PATH == "") { echo"\n"; } ?> ".$GB_ERROR['Error1']."
"; $sb_warning = "
".$GB_ERROR['Error1']."
"; $sb_errbool = false; } # Überprüfung der Minimalen Anzahl von Zeichen, beim Kommentar $gb_commentchar = str_replace(" ","",$_POST['gbKommentar'] ); if (strlen($gb_commentchar) < $GB_ADMIN['Min_Zeichen_Comment']) { $gb_warning = "
".$GB_ERROR['Error2']."
"; $gb_failure = false; } # Überprüfen der Maximalen Anzahl von Zeichen, beim Kommentar if (strlen($gb_commentchar) > $GB_ADMIN['Max_Zeichen_Comment']) { $gb_warning = "
".$GB_ERROR['Error4']."
"; $gb_failure = false; } # Überprüfung der Minimalen Anzahl von Zeichen, beim Namen $gb_namechar = str_replace(" ","",$_POST['gbName']); if (strlen($gb_namechar) < $GB_ADMIN['Min_Zeichen_Name']) { $gb_warning = "
".$GB_ERROR['Error3']."
"; $gb_failure = false; } # Überprüfung von Email und Homepage if($GB_ADMIN['Check_Mail'] == "1") { if($_POST['gbMail'] != "") { $gb_sign_mail = "[-!#$%&\'*+\\.0-9^_'a-z{|}A-Z~]+"; $gb_check_mail = "^".$gb_sign_mail."@".$gb_sign_mail."\.".$gb_sign_mail."$"; if(!ereg($gb_check_mail, $_POST['gbMail'])) { $gb_warning = "
".$GB_ERROR['Mail']."
"; $gb_failure = false; } } } if($GB_ADMIN['Check_Hp'] == "1") { if($_POST['gbHp'] != "http://" && $_POST['gbHp'] != "") { $gb_http = substr($_POST['gbHp'] ,0,7); if($gb_http != "http://") { $_POST['gbHp'] = "http://".$_POST['gbHp']; } $gb_sign_hp = "[-!#$%&\'*+\\.0-9^_'a-z{|}A-Z~]+"; $gb_check_hp = "^"."http://".$gb_sign_hp."\.".$gb_sign_hp."$"; if(!ereg($gb_check_hp, $_POST['gbHp'])) { $gb_warning = "
".$GB_ERROR['Hp']."
"; $gb_failure = false; } } } # Kontrolle ob Eintrag schon vorhanden # Daten in ein Array einlesen $gb_old_content = file(FILE_POSTS); $gb_old_reverse = array_reverse($gb_old_content); $gb_oldentry0 = explode("|#|",$gb_old_reverse[0]); $gb_oldentry1 = explode("|#|",$gb_old_reverse[1]); $gb_oldentry2 = explode("|#|",$gb_old_reverse[2]); $_POST['gbKommentar'] = str_replace("\r\n","
",htmlentities($_POST['gbKommentar'])); if($gb_oldentry0[7] == trim($_POST['gbKommentar']) OR $gb_oldentry1[7] == trim($_POST['gbKommentar']) OR $gb_oldentry2[7] == trim($_POST['gbKommentar'])) { $gb_warning = "
".$GB_ERROR['Error5']."
"; $gb_spamcontrol = false; } /*================================================================================================= * Daten eintragen *================================================================================================= */ if ($gb_spamcontrol == true && $gb_failure == true) { #---< Mail für Admin if($GB_ADMIN['Email_Inform']== "On") { if($GB_ADMIN['Email'] != "") { $admin_mail = explode(",",$GB_ADMIN['Email']); foreach($admin_mail as $mail_name) { mail($mail_name,$GB_ADMIN['Email_Inform_Topic'],$GB_ADMIN['Email_Inform_Text']) or die($GB_ERROR['Error7']); } } } #---< Mail für User if($GB_ADMIN['Email_Thx'] == "On") { if($_POST['gbMail'] != "") { mail($_POST['gbMail'],$GB_ADMIN['Email_Thx_Topic'],$GB_ADMIN['Email_Thx_Text']) or die($GB_ERROR['Error7']); } } $gbpath_length = strlen(GB_PATH); $gbicon_length = strlen($_POST['gbIcon']); $gbpath_cut = substr($_POST['gbIcon'],0,$gbpath_length); if($gbpath_cut == GB_PATH) { $_POST['gbIcon'] = substr($_POST['gbIcon'],$gbpath_length,$gbicon_length); } if($_POST['gbMail'] ==""){$_POST['gbMail'] ="false";} if($_POST['gbHp'] == "" OR $_POST['gbHp'] == "http://"){ $_POST['gbHp'] ="false";} if($_POST['gbMsNummer'] ==""){$_POST['gbMsNummer'] ="false";} if($_POST['gbMs'] ==""){$gbMs ="false";} if($_POST['gbTitle'] == ""){$_POST['gbTitle'] = "false";} if($GB_ADMIN['Date'] != ""){$GB_ADMIN['Date'] = date($GB_ADMIN['Date']);} else {$GB_ADMIN['Date']="false";} if($GB_ADMIN['Time'] != ""){$GB_ADMIN['Time']= date($GB_ADMIN['Time']);} else{$GB_ADMIN['Time']="false";} $gb_fp = fopen(FILE_POSTS,"a+"); $data = "".htmlentities($_POST['gbName'])."|#|".$_POST['gbHp']."|#|".$_POST['gbMail']."|#|".$_POST['gbIcon']."|#|".htmlentities($_POST['gbTitle'])."|#|".$_POST['gbMsNummer']."|#|".$_POST['gbMs']."|#|".trim($_POST['gbKommentar'])."|#|".$_SERVER['REMOTE_ADDR']."|#|".$GB_ADMIN['Date']."|#|".$GB_ADMIN['Time']."|#|\n"; fputs($gb_fp,$data); fclose($gb_fp); $gb_warning = $GB_ERROR['ERROR6']; } } #---< Daten aufbereiten $gb_content = file(FILE_POSTS); $gb_count = count($gb_content); $gb_reverse = array_reverse($gb_content); if($gb_count == 0) { $gb_warning = "Bis jetzt gibt es noch keine Einträge!"; } #---< Link zum eintragen switch($GB_ADMIN['Modus']) { case'1': $gb_link = "Eintragen\n"; break; case'2': $gb_link = "gb_url(array("switchgb=eintragen","lm=2"))."\">Eintragen\n"; break; } $gb_admin = "Admin"; /*================================================================================================= * Editieren und löschen eines Eintrages *================================================================================================= */ if($_REQUEST['submitEdit'] == "submit") { if($GB_ADMIN['Md5_Pass'] == md5(trim($_REQUEST['editPass'])) ) { if(!$_REQUEST['editDel']) { $gb_class_function->gb_edit($_GET['editid'],FILE_POSTS,$_POST['editHp'],$_POST['editMail'],$_POST['editMsNummer'],$_POST['editMsArt'], $_POST['editTitle'],$_POST['editDate'],$_POST['editTime'],$_POST['editIp'],$_POST['gbKommentar'],$_POST['editName'],$_POST['editIcon']); $gb_warning = "Eintrag wurde erfolgreich editiert!
gb_url(array("gbpage=1"))."\">zurück\n"; } $gbInf = explode("|#|",$gb_content[$editId-1]); $gbKommentar = htmlentities($_GET['gbKommentar']); $gbKommentar= str_replace("\r","
",$gbKommentar); $gbKommentar= str_replace("\n","
",$gbKommentar); $gbInf[0] = stripslashes($gbInf[0]); $editName = stripslashes($_GET['editName']); if(trim($gbInf[0]) == trim($editName)) { if($_POST['editDel']) { $gb_del = false; $gb_class_function->gb_delete($_GET['editid'],FILE_POSTS); $gb_warning = ("Eintrag wurde erfolgreich gelöscht!
gb_url(array("gbpage=1"))."\">zurück\n"); } } } else { $gb_warning = "Passwort ist falsch !"; } } #---< Einträge für Modus 2 ausblenden if($_GET['switchgb'] != "eintragen" && $_GET['switchgb'] != "edit") { /*============================================================ * Seitenanzahl *============================================================ */ #---< Überprüfen ob gbpage ein integer ist wenn nicht default if(is_numeric($_GET['gbpage'])== false || $_GET['gbpage'] == "") { $_GET['gbpage'] = 1; } list($gb_navi, $gb_start, $gb_end) = $gb_class_function->gb_seiten($GB_ADMIN['Pages'],$_GET['gbpage'], $GB_ADMIN['Entries'], $gb_count); if ($gb_count < $gb_end) { $gb_end = $gb_count;} eval ("\$gb_html_head = \"".$gb_temp[0]."\";"); print $gb_html_head; /*================================================================================================= * Einträge auslesen *================================================================================================= */ for($i= $gb_start ; $i < $gb_end; $i++) { $gb_entry = explode("|#|",$gb_reverse[$i]); $gb_nr = $gb_count- $i; $gb_id = $gb_nr-1; list($gb_name,$gb_hp,$gb_mail,$gb_icon,$gb_title,$gb_msn,$gb_ms,$gb_comment,$gb_ip,$gb_date,$gb_time) = $gb_entry; #---< Datum If($gb_date == "false"){ $gb_date="";} If($gb_time == "false"){ $gb_time="";} #---< Messenger $gb_ms = $gb_class_replace->gb_messenger($gb_msn, $gb_ms, $gb_name,GB_PATH); if($gb_title == "false"){$gb_title="";} #---< Email if($gb_mail != "false"){ $gb_mail = "gb_emailschutz($gb_mail)."\">\"\"\n";} else { $gb_mail="";} if($gb_hp != "false") { $gb_http = substr($gb_hp,0,7); if($gb_http== "http://") { $gb_hp = "\"\"\n"; } else { $gb_hp = "\"\"\n"; } } else { $gb_hp="";} $gb_icon = "\"\""; $gb_comment = $gb_class_replace->gb_changeText($gb_comment,GB_PATH,$GB_ADMIN['Wordwrap'],$GB_ADMIN['Img_Height'],$GB_ADMIN['Img_Width'],FILE_SMILIE); $gb_edit = "gb_url(array("gbpage=".$_GET['gbpage']."","switchgb=edit","editid=$gb_id"))."\">"."$gb_name"."´s Eintrag editieren\n"; #---< Name mit Effekten $gb_name = $gb_class_replace->gb_colorname($gb_name,$GB_ADMIN['Effect']); eval ("\$gb_html_body = \"".$gb_temp[1]."\";"); print $gb_html_body; unset($name,$hp,$mail,$ip,$ms); }#---> for eval ("\$gb_html_foot = \"".$gb_temp[2]."\";"); print $gb_html_foot; }#---< modus /*================================================================================================= * Einträge bearbeiten *================================================================================================= */ if($_GET['switchgb'] == "edit") { if($gb_del == true) { $gb_back = "gb_url(array("gbpage=1"))."\">zurück\n"; echo"
\n"; $gb_temp_edit = $gb_class_template->gb_temp(GB_PATH."templates/gb_edit_temp"); $gb_edit_content = file(FILE_POSTS); $gb_edit_count = count($gb_edit_content); $gb_edit_entry = explode("|#|",$gb_edit_content[$_GET['editid']]); list($gb_name,$gb_hp,$gb_mail,$gb_icon,$gb_title,$gb_msn,$gb_ms,$gb_comment,$gb_ip,$gb_date,$gb_time) = $gb_edit_entry; $gb_comment = trim( str_replace("
","\n",$gb_comment) ); echo"\n"; echo"\n"; $gbColor = $gb_class_replace->gb_change_Color(GB_PATH); $gbHrc = $gb_class_replace->gb_change_Hrc(GB_PATH); $gbIcon = $gb_class_replace->gb_change_icon(GB_PATH); $gbSmilie = $gb_class_replace->gb_smilies(FILE_SMILIE,GB_PATH); eval ("\$edit_entry_html = \"".$gb_temp_edit[0]."\";"); print $edit_entry_html; echo"
"; } } /*================================================================================================= * Neuen Eintrag verfassen *================================================================================================= */ if($_GET['lm'] == 2) { $gb_back = "gb_url(array("gbpage=1"))."\">zurück\n"; } if($_GET['switchgb'] != "edit") { if($GB_ADMIN['Modus'] == 1 OR $_GET['lm'] == 2) { $gbColor = $gb_class_replace->gb_change_Color(GB_PATH); $gbHrc = $gb_class_replace->gb_change_Hrc(GB_PATH); $gbIcon = $gb_class_replace->gb_change_icon(GB_PATH); $gbSmilie = $gb_class_replace->gb_smilies(FILE_SMILIE,GB_PATH); echo"
gb_url(array("gbpage=1"))."\">\n"; $ticon = "\"\"\n"; echo"\n"; eval ("\$gb_form_html = \"".$gb_temp[3]."\";"); print $gb_form_html; echo"
"; } } print $gb_class_error->gb_echoError($gb_warning); }#---< Service $endzeit=microtime()-$startzeit; $kmh = round($endzeit,3); echo"
© Knusperleicht
Parsetime: $kmh secs
"; ?>