Hey, habe mal eine Frage, was muss ich verändern, wenn ich die ganzen templates statt in htm in php umbenenne? Also, das die dann trotzdem eingefügt werden?
verwendete ilchClan Version: 1.0.5
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
<?php # Copyright by: Manuel # Support: www.ilch.de defined ('main') or die ( 'no direct access' ); defined ('admin') or die ( 'only admin access' ); $variable = $_GET['name']; //-----------------------------------------------------------| ## ### #### ##### F u n k t i o n e n function getKats ( $akt ) { $katAR = array(); $kats = ''; $erg = db_query("SELECT DISTINCT news_kat FROM `prefix_news`"); while ($row = db_fetch_object($erg)) { $katAr[] = $row->news_kat; } $katAr[] = 'Allgemein'; $katAr = array_unique($katAr); foreach($katAr as $a) { if ($a == $akt) { $sel = ' selected'; } else { $sel = ''; } $kats .= '<option>'.$a.'</option>'; } return ($kats); } ##### F u n k t i o n #### ### ## # ## ### #### ##### A k t i o n e n if ( !empty($um) ) { if ( $um == 'insert' ) { # insert $text = addslashes($_POST['txt']); if ( $_POST['katLis'] == 'neu' ) { $_POST['katLis'] = $_POST['kat']; } db_query("INSERT INTO `prefix_news` (news_title,user_id,news_time,news_recht,news_kat,news_text) VALUES ('".$_POST['titel']."',".$_SESSION['authid'].",NOW(),".$_POST['grecht'].",'".$_POST['katLis']."','".$text."')"); # insert } elseif ( $um == 'change' ) { # edit $text = addslashes($_POST['txt']); if ( $_POST['katLis'] == 'neu' ) { $_POST['katLis'] = $_POST['kat']; } db_query('UPDATE `prefix_news` SET news_title = "'.$_POST['titel'].'", user_id = "'.$_SESSION['authid'].'", news_recht = "'.$_POST['grecht'].'", news_kat = "'.$_POST['katLis'].'", news_text = "'.$text.'" WHERE news_id = "'.$_POST['newsID'].'" LIMIT 1'); $edit = $_POST['newsID']; } } # edit # del if ( !empty($_GET['del']) ) { db_query('DELETE FROM `prefix_news` WHERE news_id = "'.$_GET['del'].'" LIMIT 1'); } if ( !empty($_GET['Kdel']) ) { db_query('DELETE FROM `prefix_koms` WHERE id = "'.$_GET['Kdel'].'" LIMIT 1'); } #del ##### A k t i o n e n #### ### ## # ## ### #### ##### h t m l E i n g a b e n if ( empty ($doNoIn) ) { $limit = 10; // Limit if(empty($_GET['page'])) { $_GET['page'] = 1; } $variable = $_GET['name']; $MPL = db_make_sites ($_GET['page'] , '' , $limit , "?name='.$variable.'m=news" , 'news' ); $anfang = ($_GET['page'] - 1) * $limit; if ( empty($_GET['edit']) ) { $FnewsID = ''; $Faktion = 'insert'; $Fueber = ''; $Fstext = ''; $Ftxt = ''; $Fgrecht = ''; $FkatLis = ''; $Fsub = 'Eintragen'; } else { $row = db_fetch_object(db_query("SELECT * FROM `prefix_news` WHERE news_id = ".$_GET['edit'])); $FnewsID = $row->news_id; $Faktion = 'change'; $Fueber = $row->news_title; $Ftxt = stripslashes($row->news_text); $Fgrecht = $row->news_recht; $FkatLis = $row->news_kat; $Fsub = 'Ändern'; } $tpl = new tpl ( 'admin/news' ); $ar = array ( 'NEWSID' => $FnewsID, 'AKTION' => $Faktion, 'MPL' => $MPL, 'UEBER' => $Fueber, 'TXT' => $Ftxt, 'grecht' => arliste($Fgrecht,getFuerAr(),$tpl,'grecht'), 'KATS' => getKats($FkatLis,$db), 'FSUB' => $Fsub ); $tpl->set_ar_out($ar,0); # e d i t , d e l e t e $abf = 'SELECT news_id,news_title FROM `prefix_news` ORDER BY news_time DESC LIMIT '.$anfang.','.$limit; $erg = db_query($abf); while ($row = db_fetch_object($erg) ) { $erg1 = db_query('SELECT * FROM `prefix_koms` WHERE uid = "NEWS_'.$row->news_id.'"'); $komAnz = db_num_rows($erg1); if ( $komAnz > 0 ) { $variable = $_GET['name']; $showkoms = ' <a href="?name='.$variable.'m=news&sKoms='.$row->news_id.'#'.$row->news_id.'">show Koms</a>'; } else { $showkoms = ''; } $tpl->set_ar_out( array ( 'ID' => $row->news_id, 'KOMS' => $showkoms, 'TITEL' => $row->news_title ) , 1 ); if ( $komAnz > 0 ) { if ( isset($_GET['sKoms']) AND $_GET['sKoms'] == $row->news_id ) { while($row1 = db_fetch_object($erg1) ) { $tpl->set_ar_out( array ( 'NID' => $row->news_id, 'ID' => $row1->id, 'NAME' => $row1->name ) , 2 ); } } } } # e d i t , d e l e t e $tpl->set_ar_out( array ('MPL' => $MPL ) , 3 ); } ?>
'VARIABLE' => $variable,
# e d i t , d e l e t e $variable = $_GET['name']; $tpl->set_ar_out( array ('VARIABLE' => $variable,'MPL' => $MPL ) , 3 ); }
<script language="JavaScript" type="text/javascript"> <!-- function delcheck ( DELID ) { var frage = confirm ( "Willst du diesen Eintrag wirklich löschen?" ); if ( frage == true ) { document.location.href="?name={VARIABLE}&m=news&del="+DELID; } } function delKcheck ( DELID , NID) { var frage = confirm ( "Willst du dieses Kommentar wirklich löschen?" ); if ( frage == true ) { document.location.href="?name={VARIABLE}&m=news&Kdel="+DELID+"&sKoms="+NID+"#"+NID; } } //--> </script> <table width="99%" border="0" cellspacing="1" cellpadding="5" class="border"> <tr class="Chead"> <td colspan="2"><b>News</b></td> </tr> <tr> <td class="Cdark" width="65%"><b>{FSUB}</b></td> <td class="Cdark" width="35%"><b>Löschen / Ändern</b></td> </tr> <tr> <td class="Cnorm"> <form action="admin.php?name={VARIABLE}" method="POST" name="form"> <input type="hidden" name="m" value="news"> <input type="hidden" name="um" value="{AKTION}"> <input type="hidden" name="newsID" value="{NEWSID}"> <script type='text/javascript' src='include/includes/js/bbcode.js'></script> <table width="100%" cellpadding="2" cellspacing="1" border="0" class="border"> <tr> <td width="20%" class="Cmite"><strong>Titel</strong></td> <td width="80%" class="Cnorm"> <input size="50" type="text" name="titel" value="{UEBER}"> </td> </tr><tr> <td valign="top" class="Cmite"><strong>News</strong></td> <td class="Cnorm"> <!-- BB Code START --> <table width="400" cellpadding="0" border="0" cellspacing="0"> <tr> <td><a href="#" onClick="simple('b')"><img src="include/images/icons/button.bold.gif" alt="bold" border="0"></a> <input style="display: none;" name="b" value="a" size="20"></td> <td><a href="#" onClick="simple('i')"><img src="include/images/icons/button.italic.gif" alt="italic" border="0"></a> <input style="display: none;" name="i" value="a" size="20"></td> <td><a href="#" onClick="simple('u')"><img src="include/images/icons/button.underline.gif" alt="underline" border="0"></a> <input style="display: none;" name="u" value="a" size="20"></td> <td><a href="#" onClick="simple('code')"><img src="include/images/icons/button.code.gif" alt="Code" border="0"></a><input style="display: none;" name="code" value="a" size="20"></td> <td><a href="#" onClick="simple('img')"><img src="include/images/icons/button.image.gif" alt="Bild" border="0"></a><input style="display: none;" name="img" value="a" size="20"></td> <td><a href="#" onClick="url()"><img src="include/images/icons/button.link.gif" alt="Hyperlink" border="0"></a></td> </tr> </table> <textarea cols="60" rows="13" name="txt" wrap="virtual">{TXT}</textarea> </td> </tr> <tr> <td class="Cmite"><strong>Nur für</strong></td> <td class="Cnorm"> <select name="grecht"> {_list_grecht@<option%1 value="%2">%3</option>} </select> </td> </tr> <tr> <td class="Cmite"><strong>Kategorie</strong></td> <td class="Cnorm"> <select onChange="sichtbar()" name="katLis"> {KATS} <option value="neu">Neu:</option> </select> <input type="text" name="kat" size="40"> <script language="JavaScript" type="text/javascript"> <!-- function sichtbar(){ if( document.form.katLis.value=="neu"){ document.form.kat.style.visibility="visible"; } else { document.form.kat.style.visibility="hidden"; } } sichtbar(); //--> </script> </td> </tr> <tr> <td class="Cmite"></td> <td class="Cnorm"> <input type="submit" value="{FSUB}" name="submit"> </td> </tr> </table> </form> <b>Merke (Kategorie Bild)</b> <br /> <font class="smalfont"> Das Kategorie Bild muss in den Ordner include/images/news/ <br /> Das Bild muss genau wie die Kategorie heissen z.B. wenn die Kategorie Allgemein heisst dann muss das Bild Allgemein heissen;)... <br /> Die Endung muss entweder .jpg oder .gif sein bei uns also z.B. Allgemein.jpg </font> <br /><br /> <b>Merke (Vorschau Funktion)</b> <br /> <font class="smalfont"> Soll nur ein kleinerer Vorschautext angezeigt werden, einfach erst die Vorschau eingeben und nach der Vorschau dann <b>[PREVIEWENDE]</b> schreiben. Dann den langen Text eintragen. </font> </td> <td class="Cmite" width="30%" valign="top"> {MPL} <table width="100%" cellpadding="5" cellspacing="0" border="0"> {EXPLODE}<tr> <td width="15%"><a href="#" name="{ID}"></a><a href="javascript:delcheck({ID})"><img src="include/images/icons/del.gif" alt="Löschen" title="Löschen" border="0"></a> <a href="?name={VARIABLE}&m=news&edit={ID}"><img src="include/images/icons/edit.gif" alt="Verändern" title="Verändern" border="0"></a></td> <td width="85%">{TITEL}{KOMS}</td> </tr>{EXPLODE}<tr> <td><a href="javascript:delKcheck({ID},{NID})"><img src="include/images/icons/del.gif" alt="Löschen" title="Löschen" border="0"></a></td> <td>{NAME}</td> </tr>{EXPLODE} </table> {MPL} </td> </tr> </table>
<?php # Copyright by: Manuel # Support: www.ilch.de defined ('main') or die ( 'no direct access' ); defined ('admin') or die ( 'only admin access' ); $variable = $_GET['name']; //-----------------------------------------------------------| ## ### #### ##### F u n k t i o n e n function getKats ( $akt ) { $katAR = array(); $kats = ''; $erg = db_query("SELECT DISTINCT news_kat FROM `prefix_news`"); while ($row = db_fetch_object($erg)) { $katAr[] = $row->news_kat; } $katAr[] = 'Allgemein'; $katAr = array_unique($katAr); foreach($katAr as $a) { if ($a == $akt) { $sel = ' selected'; } else { $sel = ''; } $kats .= '<option>'.$a.'</option>'; } return ($kats); } ##### F u n k t i o n #### ### ## # ## ### #### ##### A k t i o n e n if ( !empty($um) ) { if ( $um == 'insert' ) { # insert $text = addslashes($_POST['txt']); if ( $_POST['katLis'] == 'neu' ) { $_POST['katLis'] = $_POST['kat']; } db_query("INSERT INTO `prefix_news` (news_title,user_id,news_time,news_recht,news_kat,news_text) VALUES ('".$_POST['titel']."',".$_SESSION['authid'].",NOW(),".$_POST['grecht'].",'".$_POST['katLis']."','".$text."')"); # insert } elseif ( $um == 'change' ) { # edit $text = addslashes($_POST['txt']); if ( $_POST['katLis'] == 'neu' ) { $_POST['katLis'] = $_POST['kat']; } db_query('UPDATE `prefix_news` SET news_title = "'.$_POST['titel'].'", user_id = "'.$_SESSION['authid'].'", news_recht = "'.$_POST['grecht'].'", news_kat = "'.$_POST['katLis'].'", news_text = "'.$text.'" WHERE news_id = "'.$_POST['newsID'].'" LIMIT 1'); $edit = $_POST['newsID']; } } # edit # del if ( !empty($_GET['del']) ) { db_query('DELETE FROM `prefix_news` WHERE news_id = "'.$_GET['del'].'" LIMIT 1'); } if ( !empty($_GET['Kdel']) ) { db_query('DELETE FROM `prefix_koms` WHERE id = "'.$_GET['Kdel'].'" LIMIT 1'); } #del ##### A k t i o n e n #### ### ## # ## ### #### ##### h t m l E i n g a b e n if ( empty ($doNoIn) ) { $limit = 10; // Limit if(empty($_GET['page'])) { $_GET['page'] = 1; } $variable = $_GET['name']; $MPL = db_make_sites ($_GET['page'] , '' , $limit , "?name='.$variable.'m=news" , 'news' ); $anfang = ($_GET['page'] - 1) * $limit; if ( empty($_GET['edit']) ) { $FnewsID = ''; $Faktion = 'insert'; $Fueber = ''; $Fstext = ''; $Ftxt = ''; $Fgrecht = ''; $FkatLis = ''; $Fsub = 'Eintragen'; } else { $row = db_fetch_object(db_query("SELECT * FROM `prefix_news` WHERE news_id = ".$_GET['edit'])); $FnewsID = $row->news_id; $Faktion = 'change'; $Fueber = $row->news_title; $Ftxt = stripslashes($row->news_text); $Fgrecht = $row->news_recht; $FkatLis = $row->news_kat; $Fsub = 'Ändern'; } $tpl = new tpl ( 'admin/news' ); $ar = array ( 'NEWSID' => $FnewsID, 'AKTION' => $Faktion, 'MPL' => $MPL, 'UEBER' => $Fueber, 'TXT' => $Ftxt, 'grecht' => arliste($Fgrecht,getFuerAr(),$tpl,'grecht'), 'KATS' => getKats($FkatLis,$db), 'FSUB' => $Fsub ); $tpl->set_ar_out($ar,0); # e d i t , d e l e t e $abf = 'SELECT news_id,news_title FROM `prefix_news` ORDER BY news_time DESC LIMIT '.$anfang.','.$limit; $erg = db_query($abf); while ($row = db_fetch_object($erg) ) { $erg1 = db_query('SELECT * FROM `prefix_koms` WHERE uid = "NEWS_'.$row->news_id.'"'); $komAnz = db_num_rows($erg1); if ( $komAnz > 0 ) { $variable = $_GET['name']; $showkoms = ' <a href="?name='.$variable.'m=news&sKoms='.$row->news_id.'#'.$row->news_id.'">show Koms</a>'; } else { $showkoms = ''; } $tpl->set_ar_out( array ( 'ID' => $row->news_id, 'KOMS' => $showkoms, 'TITEL' => $row->news_title ) , 1 ); if ( $komAnz > 0 ) { if ( isset($_GET['sKoms']) AND $_GET['sKoms'] == $row->news_id ) { while($row1 = db_fetch_object($erg1) ) { $tpl->set_ar_out( array ( 'NID' => $row->news_id, 'ID' => $row1->id, 'NAME' => $row1->name ) , 2 ); } } } } # e d i t , d e l e t e $variable = $_GET['name']; $tpl->set_ar_out( array ('VARIABLE' => $variable,'MPL' => $MPL ) , 3 ); } ?>
Geschlossen | ||
Zurück zu HTML, PHP, SQL,... |