language_file"); $get_template=mysql_query("SELECT * FROM $prefix"."_templates WHERE aktiv='1'"); $aus_template=mysql_fetch_object($get_template); ########## Templates ausgeben ########## //----- Header und CSS ----- $output_header=$aus_template->template_header; $output_header=str_replace("{css}", "", $output_header); echo "$output_header"; ############ Check ob noch News auto. freizuschalten sind ############# $date_aktuell=date("Y-m-d H:i:s"); $get_queue=mysql_query("SELECT * FROM $prefix"."_entries_queue"); while($aus_queue=mysql_fetch_object($get_queue)) { $date_db=$aus_queue->date_post; if($date_aktuell>=$date_db && $date_db!="0000-00-00 00:00:00") { mysql_query("INSERT INTO $prefix"."_entries (name,mail,topic,cat,related_link1,related_link2,related_link3,related_link4,related_link5,msg,announce,date) VALUES ('$aus_queue->name','$aus_queue->mail','$aus_queue->topic','$aus_queue->cat','$aus_queue->related_link1','$aus_queue->related_link2','$aus_queue->related_link3','$aus_queue->related_link4','$aus_queue->related_link5','$aus_queue->msg','$aus_queue->announce','$aus_queue->date')"); mysql_query("DELETE FROM $prefix"."_entries_queue WHERE id='$aus_queue->id'"); } } ####################################################################### ########### Check ob noch News auf dem Newsmailserver sind ############ if(function_exists(imap_open)) { $get_timelock=mysql_query("SELECT * FROM $prefix"."_timelock"); $aus_timelock=mysql_fetch_object($get_timelock); if((time()-$aus_timelock->timestamp)>=600) //letzte aktualisierung länger als 10min her, dann checke mails { $get_mail_sms=mysql_query("SELECT * FROM $prefix"."_mail_sms"); $aus_mail_sms=mysql_fetch_object($get_mail_sms); if($aus_mail_sms->service_active=="1") { $username=$aus_mail_sms->username; $password=base64_decode($aus_mail_sms->password); $adr=$aus_mail_sms->server_adr; $kind=$aus_mail_sms->server_kind; $port=$aus_mail_sms->server_port; $mailserver=$adr."/".$kind.":".$port; if($username!="" && $password!="") { //Verbindung herstellen $mbox=@imap_open("\{$mailserver}INBOX",$username,$password); $folders=@imap_listmailbox($mbox, "\{$mailserver}", "*"); if($folders==true) { $check=imap_mailboxmsginfo($mbox); for($i=1; $i<=imap_num_msg($mbox); $i++) { $structure=imap_fetchstructure($mbox,$i); if(isset($structure->parts)) { if($structure->subtype=="MIXED") { $body=imap_fetchbody($mbox,$i,1.1); } else { $body=imap_fetchbody($mbox,$i,1); } } else { $body=imap_body($mbox,$i); } $body=str_replace("<", "<", $body); $body=str_replace(">", ">", $body); $body=str_replace("\n", "
", $body); $body=str_replace("=FC", "ü", $body); $body=str_replace("=E4", "ä", $body); $body=str_replace("=F6", "ö", $body); $body=str_replace("=DF", "ß", $body); $header=imap_headerinfo($mbox, $i, 80, 80); $date=$header->date; $date=strtotime($date); $date_insert=date("Y-m-d h:i:s",$date); $from=substr($header->fromaddress,4); $from_mail=$header->fromaddress; $subject=$header->fetchsubject; $get_userdb=mysql_query("SELECT * FROM $prefix"."_intern_users ORDER BY user"); while($aus_userdb=mysql_fetch_object($get_userdb)) { $handy_nr=substr($aus_userdb->handy_nr,4); if($aus_userdb->handy_nr!="") { if(strstr($from,$handy_nr)==true) { if($aus_mail_sms->standard_topic=="")$standard_topic=$subject; else $standard_topic=$aus_mail_sms->standard_topic; //-- Sind gefilterte Inhalte vorhanden -- $get_filtered=mysql_query("SELECT * FROM $prefix"."_mail_sms_filter ORDER BY filtered"); if(mysql_num_rows($get_filtered)!="0") { while($aus_filtered=mysql_fetch_object($get_filtered)) { if(strstr($body,$aus_filtered->filtered)==true) { $body=str_replace($aus_filtered->filtered,"",$body); } } } //--------------------------------------- if($aus_userdb->news_in_send=="1" && $aus_userdb->news_in=="1") { $worked=mysql_query("INSERT INTO $prefix"."_entries (name,mail,topic,msg,date) VALUES ('$aus_userdb->user','$aus_userdb->mail','$standard_topic','$body','$date_insert')"); } else if($aus_userdb->news_in_send=="1" && $aus_userdb->news_in=="0") { $worked=mysql_query("INSERT INTO $prefix"."_entries_queue (name,mail,topic,msg,date) VALUES ('$aus_userdb->user','$aus_userdb->mail','$standard_topic','$body','$date_insert')"); } } } if(strstr($from_mail,$aus_userdb->mail)==true) { if($aus_mail_sms->standard_topic=="")$standard_topic=$subject; else $standard_topic=$aus_mail_sms->standard_topic; if($aus_userdb->news_in_send=="1" && $aus_userdb->news_in=="1") { $worked=mysql_query("INSERT INTO $prefix"."_entries (name,mail,topic,msg,date) VALUES ('$aus_userdb->user','$aus_userdb->mail','$standard_topic','$body','$date_insert')"); } else if($aus_userdb->news_in_send=="1" && $aus_userdb->news_in=="0") { $worked=mysql_query("INSERT INTO $prefix"."_entries_queue (name,mail,topic,msg,date) VALUES ('$aus_userdb->user','$aus_userdb->mail','$standard_topic','$body','$date_insert')"); } } } if($worked==true)imap_delete($mbox,$i); } imap_expunge($mbox); } } } $timestamp=time(); mysql_query("UPDATE $prefix"."_timelock SET timestamp='$timestamp'"); } //check if } ####################################################################### ################################################################################## ################################################################################## ################################################################################## ## 1.0 ################################################################## //--------------------------- Mail to... ------------------------------- $mailto=$_GET['mailto']; if($mailto=="ok") { $newsid=$_GET['newsid']; include($abs_path."/templates/newsscript_mailto.php"); } ## 2.0 ################################################################## //---------------------------- Comments -------------------------------- $comments=$_GET['comments']; if($comments=="ok") { $newsid=$_GET['newsid']; include($abs_path."/templates/newsscript_comments.php"); } ## 3.0 ################################################################## //------------------------- News einsenden ----------------------------- $sendnews=$_GET['sendnews']; if($sendnews=="ok") { include($abs_path."/templates/newsscript_sendnews.php"); } ## 4.0 ################################################################## //------------------------ Anzeige des Archivs -------------------------- $archiv=$_GET['archiv']; if($archiv=="ok") { include($abs_path."/inc/newsscript_archiv.php"); echo "
"; } ################################################################################## ################################################################################## ################################################################################## if(!$mailto && !$comments && !$sendnews && !$archiv) { ###################################################### //----------- Holen der News Output Vars ------------ ########## Datumsformat bestimmen ########### if($aus_settings->show_dateformat=="1"){$datevar="%d.%m.%Y";} if($aus_settings->show_dateformat=="2"){$datevar="%d.%m.%Y - %T";} if($aus_settings->show_dateformat=="3"){$datevar="%d-%m-%Y";} if($aus_settings->show_dateformat=="4"){$datevar="%d-%m-%Y - %T";} if($aus_settings->show_dateformat=="5"){$datevar="%m.%Y";} if($aus_settings->show_dateformat=="6"){$datevar="%m.%Y - %T";} if($aus_settings->show_dateformat=="7"){$datevar="%m-%Y";} if($aus_settings->show_dateformat=="8"){$datevar="%m-%Y - %T";} if($aus_settings->show_dateformat=="9"){$datevar="%d.%m";} if($aus_settings->show_dateformat=="10"){$datevar="%d.%m - %T";} if($aus_settings->show_dateformat=="11"){$datevar="%d-%m";} if($aus_settings->show_dateformat=="12"){$datevar="%d-%m - %T";} if($aus_settings->show_dateformat=="13"){$datevar="%T";} if($aus_settings->show_dateformat=="14"){$datevar="%d";} if($aus_settings->show_dateformat=="15"){$datevar="%m";} if($aus_settings->show_dateformat=="16"){$datevar="%Y";} //---- Script für Seitenzahlen ----- if(!$page) { $page="1"; } $page--; $limit=$aus_settings->number_news*$page; //---------------------------------- $counter="1"; $get_news=mysql_query("SELECT id, name, mail, topic, cat, related_link1, related_link2, related_link3, related_link4, related_link5, msg, date_format(date, '$datevar') as date_var FROM $prefix"."_entries WHERE announce='0' ORDER BY date DESC LIMIT $limit,$aus_settings->number_news"); while($aus_news=mysql_fetch_object($get_news)) { $news_topic=$aus_news->topic; $news_text=$aus_news->msg; $news_date=$aus_news->date_var; $news_name=$aus_news->name; $news_mail=$aus_news->mail; ###################################################### //---------------- Template Anzeigen ---------------- //umtauschen der platzhalter in variablen $output_news=$aus_template->template_news; $output_news=str_replace("<", "<", $output_news); $output_news=str_replace(">", ">", $output_news); $output_news=str_replace("{news_topic}", "$news_topic", $output_news); $output_news=str_replace("{news_text}", "$news_text", $output_news); $output_news=str_replace("{news_date}", "$news_date", $output_news); $output_news=str_replace("{news_name}", "$news_name", $output_news); $output_news=str_replace("{news_mail}", "$news_mail", $output_news); ####################################################### //--- Smilies in Bilder umsetzen? ---- if($aus_settings->show_smilies=="1") { $get_smilies=mysql_query("SELECT * FROM $prefix"."_smilies"); while($aus_smilies=mysql_fetch_object($get_smilies)) { if(strstr($output_news,$aus_smilies->smilie)==true) { $output_news=str_replace($aus_smilies->smilie ,"file\">",$output_news); } } } //--- BB Code umsetzen --- if($aus_settings->show_bbcode=="1") { if(strstr($output_news,"[/b]")==true) { $output_news=str_replace("[b]", "", $output_news); $output_news=str_replace("[/b]", "", $output_news); } if(strstr($output_news,"[/i]")==true) { $output_news=str_replace("[i]", "", $output_news); $output_news=str_replace("[/i]", "", $output_news); } if(strstr($output_news,"[/u]")==true) { $output_news=str_replace("[u]", "", $output_news); $output_news=str_replace("[/u]", "", $output_news); } if(strstr($output_news,"[/s]")==true) { $output_news=str_replace("[s]", "", $output_news); $output_news=str_replace("[/s]", "", $output_news); } if(strstr($output_news,"[/center]")==true) { $output_news=str_replace("[center]", "
", $output_news); $output_news=str_replace("[/center]", "
", $output_news); } if(strstr($output_news,"[/right]")==true) { $output_news=str_replace("[right]", "

", $output_news); $output_news=str_replace("[/right]", "

", $output_news); } if(strstr($output_news,"[/list]")==true) { $output_news=str_replace("[list]", "", $output_news); $output_news=str_replace("[*]", "
  • ", $output_news); } if(strstr($output_news,"[/color]")==true) { $output_news=preg_replace("/\[color=(.*?)\](.*?)\[\/color\]/si","\\2", $output_news); } if(strstr($output_news,"[/size]")==true) { $output_news=preg_replace("/\[size=(.*?)\](.*?)\[\/size\]/si","\\2", $output_news); } if(strstr($output_news,"[/font]")==true) { $output_news=preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/si","\\2", $output_news); } if(strstr($output_news,"[/img]")==true) { $output_news=preg_replace("/\[img\](.*?)\[\/img\]/si","", $output_news); } if(strstr($output_news,"[/url]")==true) { $output_news=preg_replace("/\[url=(.*?)\](.*?)\[\/url\]/si","$font_msg_a"."\\2"."$font_msg_b", $output_news); } if(strstr($output_news,"[/email]")==true) { $output_news=preg_replace("/\[email=(.*?)\](.*?)\[\/email\]/si","$font_msg_a"."\\2"."$font_msg_b", $output_news); } if(strstr($output_news,"[/flash]")==true) { $output_news=preg_replace("/\[flash width=(.*?) height=(.*?)\](.*?)\[\/flash\]/si"," ", $output_news); } } ####################################################### ############ Mail versenden ############ if($aus_settings->target_friendmail=="1") { $target_friendmail="_blank"; } else { $target_friendmail="_self"; } if($aus_settings->show_att_mail_k=="1") { $output_news=str_replace("{news_mailto}", "id\" target=\"$target_friendmail\">\"".$lang_output_tpl_altmailto."!\" ", $output_news); } else { $output_news=str_replace("{news_mailto}", "id\" target=\"$target_friendmail\">$font_att_a".$lang_output_lyt_mailto."$font_att_b ", $output_news); } ############ News einsenden ############ if($aus_settings->target_sendnews=="1") { $target_sendnews="_blank"; } else { $target_sendnews="_self"; } $output_news=str_replace("{news_sendnews}", "$font_att_a".$lang_output_lyt_sendnews."$font_att_b ", $output_news); ############################### echo "
    "; $news_modded=strip_tags($news_text); echo ""; ########### Drucken ########### if($aus_settings->show_att_print_k=="1") { $output_news=str_replace("{news_print}", "id."');\">\"".$lang_output_tpl_altprint."!\" ", $output_news); } else { $output_news=str_replace("{news_print}", "id."');\">$font_att_a".$lang_output_lyt_print."$font_att_b ", $output_news); } ########### Kommentar ########### if($aus_settings->target_com=="1") { $target_com="_blank"; } else { $target_com="_self"; } if($aus_settings->show_att_com_k=="1") { if($aus_settings->show_att_com_count=="1") { $erg_count=mysql_query("SELECT count(id) AS countid FROM $prefix"."_comments WHERE id_news='$aus_news->id'"); $erg_count=mysql_result($erg_count,0,0); $count_com="$font_att_a"."[$erg_count]"."$font_att_b"; } $output_news=str_replace("{news_com}", "id\" target=\"$target_com\">\"".$lang_output_tpl_altcom."!\" $count_com", $output_news); } else { if($aus_settings->show_att_com_count=="1") { $erg_count=mysql_query("SELECT count(id) AS countid FROM $prefix"."_comments WHERE id_news='$aus_news->id'"); $erg_count=mysql_result($erg_count,0,0); $count_com="$font_att_a"."[$erg_count]"."$font_att_b"; } $output_news=str_replace("{news_com}", "id\" target=\"$target_com\">$font_att_a".$lang_output_lyt_com."$font_att_b $count_com", $output_news); } echo "$output_news"; echo "
    "; ###################################################### $counter++; } } echo "$aus_template->template_footer"; ?>