Hi leute ich hab eine frage
und zwar brauche ich in dem newsscript ein weiteres eingabe feld das auch in der verkürzten anzeige angezeigt wird
muss nur ein kleines feld sein
was muss ergänzt werden?
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
if (!empty($_REQUEST['um'])) { $um = $_REQUEST['um']; $_POST['titel'] = escape($_POST['titel'], 'string'); $_POST['grecht'] = escape($_POST['grecht'], 'integer'); $_POST['kat'] = escape($_POST['kat'], 'string'); $_POST['katLis'] = escape($_POST['katLis'], 'string'); $_POST['newsID'] = escape($_POST['newsID'], 'integer'); $_POST['**name neues Feld**'] = escape($_POST['**name neues Feld**'], 'integer'); if ($um == 'insert') { // insert $text = escape($_POST['txt'], 'textarea'); 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,**name neues Feld**) VALUES ('" . $_POST['titel'] . "'," . $_SESSION['authid'] . ",NOW()," . $_POST['grecht'] . ",'" . $_POST['katLis'] . "','" . $text . "','" . $_POST['**name neues Feld**'] . "')"); // insert } elseif ($um == 'change') { // edit $text = escape($_POST['txt'], 'textarea'); 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 . '", **name neues Feld** = "' . $_POST['**name neues Feld**'] . '" WHERE news_id = "' . $_POST['newsID'] . '" LIMIT 1'); $edit = $_POST['newsID']; } } // edit // del if ($menu->get(1) == 'del') { db_query('DELETE FROM `prefix_news` WHERE news_id = "' . $menu->get(2) . '" 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 = 20; // Limit $page = ($menu->getA(1) == 'p' ? $menu->getE(1) : 1); $MPL = db_make_sites ($page , '' , $limit , "?news" , 'news'); $anfang = ($page - 1) * $limit; if ($menu->get(1) != 'edit') { $FnewsID = ''; $Faktion = 'insert'; $Fueber = ''; $Fstext = ''; $Ftxt = ''; $Fgrecht = ''; $FkatLis = ''; $Fsub = 'Eintragen'; $neues_feld = ''; } else { $row = db_fetch_object(db_query("SELECT * FROM `prefix_news` WHERE news_id = " . $menu->get(2))); $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'; $neues_feld = $row->**name neues Feld**; } $tpl = new tpl ('news', 1); $ar = array ( 'NEWSID' => $FnewsID, 'AKTION' => $Faktion, 'MPL' => $MPL, 'UEBER' => $Fueber, 'txt' => $Ftxt, 'SMILIS' => getsmilies(), 'grecht' => dbliste($Fgrecht, $tpl, 'grecht', "SELECT id,name FROM prefix_grundrechte ORDER BY id DESC"), 'KATS' => getKats($FkatLis), 'FSUB' => $Fsub, '**name neues Feld**' => $neues_Feld );
$abf = "SELECT a.news_title as title, a.news_id as id, a.**name neues Feld** as **name neues Feld**, DATE_FORMAT(a.news_time,'%d. %m. %Y') as datum, DATE_FORMAT(a.news_time,'%W') as dayofweek, a.news_kat as kate, a.news_text as text, b.name as username FROM prefix_news as a LEFT JOIN prefix_user as b ON a.user_id = b.id WHERE ".$_SESSION['authright']." <= a.news_recht OR a.news_recht = 0 ORDER BY news_time DESC LIMIT ".$anfang.",".$limit;
news_preis = "' . $_POST['preis'] . '" WHERE news_id = "' . $_POST['newsID'] . '" LIMIT 1');
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'), news_preis = "' . $_POST['preis'] . '" WHERE news_id = "' . $_POST['newsID'] . '" LIMIT 1'), $edit = $_POST['newsID'];
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 . '", news_preis = "' . $_POST['preis'] . '" WHERE news_id = "' . $_POST['newsID'] . '" LIMIT 1');
<?php # Copyright by: Manuel # Support: www.ilch.de defined ('main') or die ( 'no direct access' ); $title = $allgAr['title'].' :: News'; $hmenu = 'News'; $design = new design ( $title , $hmenu ); $design->addheader('<link rel="alternate" type="application/atom+xml" title="News (Atom)" href="index.php?news-atom" /> <link rel="alternate" type="application/rss+xml" title="News (RSS)" href="index.php?news-rss" />'); function news_find_kat ($kat) { $katpfad = 'include/images/news/'; $katjpg = $katpfad.$kat.'.jpg'; $katgif = $katpfad.$kat.'.gif'; $katpng = $katpfad.$kat.'.png'; if ( file_exists( $katjpg ) ) { $pfadzumBild = $katjpg; } elseif ( file_exists ( $katgif ) ) { $pfadzumBild = $katgif; } elseif ( file_exists ( $katpng ) ) { $pfadzumBild = $katpng; } if ( !empty( $pfadzumBild ) ) { $kategorie = '<img style="" src="'.$pfadzumBild.'" alt="'.$kat.'">'; } else { $kategorie = '<b>'.$kat.'</b><br /><br />'; } return ( $kategorie ); } if ( !is_numeric($menu->get(1)) ) { if($menu->get(1) == 'rss' || $menu->get(1) == 'atom') { #ob_clean(); $feed_type = $menu->get(1); $abf = "SELECT MAX(news_time) AS last_update FROM prefix_news"; $erg = db_query($abf); $row = db_fetch_assoc($erg); $last_update = str_replace(' ', 'T', $row['last_update']) . 'Z'; $abf = "SELECT a.news_title as title, a.news_id as id,"; $abf .= ($feed_type == 'atom') ? 'a.news_time as datum,' : "DATE_FORMAT(a.news_time,'%a, %e %b %y %H:%i:%s') as datum,"; $abf .= "a.news_kat as kate, a.news_text as text, b.name as username FROM prefix_news as a LEFT JOIN prefix_user as b ON a.user_id = b.id WHERE a.news_recht = 0 ORDER BY news_time DESC LIMIT 15"; $erg = db_query($abf); $tpl = new tpl( 'news_'.$menu->get(1).'.htm' ); header('Content-type: application/' . $menu->get(1) . '+xml'); $tpl->set_ar_out(array('FEEDTITLE' => $allgAr['title'], 'UPDATED' => $last_update, 'SITEURL' => 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF'])), 0); while ($row = db_fetch_assoc($erg)) { if($feed_type == 'atom') { $Z = (date('Z') > 0 ? '+' : '').date('H:i:s', date('Z') + 23 * 3600); $row['datum'] = str_replace(' ', 'T', $row['datum']) . $Z; } $a = explode('[PREVIEWENDE]', $row['text']); $tpl->set_ar_out(array('TITLE' => $row['title'], 'TXT' => bbcode($a[0]), 'LINK' => 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']). '/index.php?news-' . $row['id'], 'AUTHOR' => $row['username'], 'DATE' => $row['datum'] ), 1); } $tpl->out(2); exit; } else { $design->header(); $limit = $allgAr['Nlimit']; $page = ( $menu->getA(1) == 'p' ? $menu->getE(1) : 1 ); $MPL = db_make_sites ($page , "WHERE news_recht >= ".$_SESSION['authright'] , $limit , '?news' , 'news' ); $anfang = ($page - 1) * $limit; $tpl = new tpl ( 'news.htm' ); $abf = "SELECT a.news_title as title, a.news_id as id, a.news_preis as preis, DATE_FORMAT(a.news_time,'%d. %m. %Y') as datum, DATE_FORMAT(a.news_time,'%W') as dayofweek, a.news_kat as kate, a.news_text as text, b.name as username FROM prefix_news as a LEFT JOIN prefix_user as b ON a.user_id = b.id WHERE ".$_SESSION['authright']." <= a.news_recht OR a.news_recht = 0 ORDER BY news_time DESC LIMIT ".$anfang.",".$limit; #echo '<pre>'.$abf.'</pre>'; $erg = db_query($abf); while ($row = db_fetch_assoc($erg)) { $k0m = db_query("SELECT COUNT(ID) FROM `prefix_koms` WHERE uid = ".$row['id']." AND cat = 'NEWS'"); $row['kom'] = db_result($k0m,0); $row['kate'] = news_find_kat($row['kate']); $row['datum'] = $lang[$row['dayofweek']].' '.$row['datum']; if ( strpos ( $row['text'] , '[PREVIEWENDE]' ) !== FALSE ) { $a = explode('[PREVIEWENDE]' , $row['text']); $row['text'] = $a[0]; $row['readwholenews'] = '» <a href="index.php?news-'.$row['id'].'">'.$lang['readwholenews'].'</a> «'; } else { $row['readwholenews'] = ''; } $row['text'] = bbcode($row['text']); $tpl->set_ar_out($row,0); } $tpl->set_out('SITELINK', $MPL,1); unset($tpl); } } else { $design->header(); $nid = escape($menu->get(1), 'integer'); $row = db_fetch_object(db_query("SELECT * FROM `prefix_news` WHERE news_id = '".$nid."'")); if ( has_right(array($row->news_recht)) ) { $komsOK = true; if ( $allgAr['Ngkoms'] == 0 ) { if ( loggedin() ) { $komsOK = true; } else { $komsOK = false; } } if ( $allgAr['Nukoms'] == 0 ) { $komsOK = false; } # kommentar add if ( (loggedin() OR chk_antispam ('newskom')) AND $komsOK AND !empty($_POST['name']) AND !empty($_POST['txt']) ) { $_POST['txt'] = escape($_POST['txt'],'string'); $_POST['name'] = escape($_POST['name'],'string'); db_query("INSERT INTO `prefix_koms` (`uid`,`cat`,`name`,`text`) VALUES (".$nid.",'NEWS','".$_POST['name']."','".$_POST['txt']."')"); } # kommentar add # kommentar loeschen if ($menu->getA(2) == 'd' AND is_numeric($menu->getE(2)) AND has_right(-7, 'news')) { $kommentar_id = escape($menu->getE(2),'integer'); db_query("DELETE FROM prefix_koms WHERE uid = ".$nid." AND cat = 'NEWS' AND id = ".$kommentar_id); } # kommentar loeschen $kategorie = news_find_kat($row->news_kat); $textToShow = bbcode($row->news_text); $textToShow = str_replace('[PREVIEWENDE]','',$textToShow); if ( !empty($such) ) { $textToShow = markword($textToShow,$such); } $tpl = new tpl ( 'news.htm' ); $ar = array ( 'TEXT' => $textToShow, 'KATE' => $kategorie, 'NID' => $nid, 'uname' => $_SESSION['authname'], 'ANTISPAM' => (loggedin()?'':get_antispam ('newskom', 0)), 'NAME' => $row->news_title ); $tpl->set_ar_out($ar, 2 ); if ($komsOK) { $tpl->set_ar_out ( array ( 'NAME' => $row->news_title , 'NID' => $nid ), 3 ); } $erg1 = db_query("SELECT text, name, id FROM `prefix_koms` WHERE uid = ".$nid." AND cat = 'NEWS' ORDER BY id DESC"); $ergAnz1 = db_num_rows($erg1); if ( $ergAnz1 == 0 ) { echo '<b>'.$lang['nocomments'].'</b>'; } else { $zahl = $ergAnz1; while ($row1 = db_fetch_assoc($erg1)) { $row1['text'] = bbcode(trim($row1['text'])); if (has_right(-7, 'news')) { $row1['text'] .= '<a href="?news-'.$nid.'-d'.$row1['id'].'"><img src="include/images/icons/del.gif" alt="löschen" border="0" title="löschen" /></a>'; } $tpl->set_ar_out( array('NAME' => $row1['name'], 'TEXT' => $row1['text'], 'ZAHL' => $zahl ) , 4 ); $zahl--; } } } $tpl->out(5); } $design->footer(); ?>
<div> <strong>{datum}</strong> <hr style="height: 0px; border: dotted #000000 0px; border-top-width: 1px; " /> </div> <div style="float:left; width:20%; text-align:center; ">{kate}</div> <div style="float:left; width:80%; padding-top:25px; "> <table width="100%" border="0" align="center" cellpadding="1" cellspacing="0" class="cbg1"> <tr> <td><strong><a href="index.php?news-{id}">{title}</a></strong></td> </tr> <tr> <td class="smalfont">{_lang_from} {username}</td> </tr> </table> </div><br style="clear:both; " /> <div> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="2">{text} {preis}</td> </tr> <tr> <td width="50%"><a href="index.php?news-{id}">{kom} {_if_{kom}=='1'}{_lang_comment}{_else_}{_lang_comments}{/_endif} </a></td> <td width="50%"> <div align="right">{readwholenews}</div> </td> </tr> </table> </div> <br /> <br /> {EXPLODE} <br /> <br /><center>{SITELINK}</center> {EXPLODE} <!-- News Kommentare und Mehr lesen --> <table class="border" width="100%" cellpadding="5" cellspacing="1" border="0"> <tr class="Chead"> <th height="25"><b>{NAME}</b></th> </tr> <tr> <td height="25" class="Cdark">{_lang_message}</td> </tr> <tr> <td class="Cnorm"> <div style="float:left; ">{KATE}</div> <div style="float:left; padding-left:10px; ">{TEXT}</div><br style="clear:both; " /> <p></p> <a href="index.php?news"><b>«</b> {_lang_back}</a> </td> </tr> <tr> <td height="25" class="Cmite">{_lang_commentsfor} {NAME}</td> </tr> <tr> <td class="Cnorm"> {EXPLODE} <form action="index.php?news-{NID}" method="POST"> <fieldset> <legend>{_lang_writecomment}</legend> <input type="text" name="name" value="{uname}" /> {ANTISPAM} <input type="submit" value="{_lang_enter}"><br /> <textarea style="width: 98%" cols="50" rows="2" name="txt"></textarea><br /> </fieldset> </form> <br /> {EXPLODE} <span class="Cmite"># <b>{ZAHL}</b> von {NAME}</span> <br />{TEXT}<br /><br /> {EXPLODE} <br /> <a href="index.php?news"><b>«</b> {_lang_back}</a> </td> </tr> </table> {EXPLODE} <table width="100%" border="0" cellspacing="0" cellpadding="5" class="rand"> <tr class="mite"> <td width="65%"><b>{NAME}</b></td> <td width="15%">{FUER}</td> <td width="20%" align="right">{DATE}</td> </tr><tr class="norm"> <td valign="top" colspan="2">{TEXT}{MEHR}</td> <td valign="top" rowspan="2" align="center">{KATE}</td> </tr><tr class="norm"> <td valign="bottom" height="20" colspan="2" align="center"> <b>{_lang_from} {UNAME}</b> [ {KOM} <a href="index.php?news-1&nid={ID}">{_lang_comments}</a> ] </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'); $design = new design ('Admins Area', 'Admins Area', 2); $design->header(); // -----------------------------------------------------------| // # // ## // ### // #### 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 (trim($a) == trim($akt)) { $sel = ' selected'; } else { $sel = ''; } $kats .= '<option' . $sel . '>' . $a . '</option>'; } return ($kats); } // #### F u n k t i o n // ### // ## // # // # // ## // ### // #### A k t i o n e n if (!empty($_REQUEST['um'])) { $um = $_REQUEST['um']; $_POST['titel'] = escape($_POST['titel'], 'string'); $_POST['grecht'] = escape($_POST['grecht'], 'integer'); $_POST['kat'] = escape($_POST['kat'], 'string'); $_POST['katLis'] = escape($_POST['katLis'], 'string'); $_POST['newsID'] = escape($_POST['newsID'], 'integer'); $_POST['preis'] = escape($_POST['preis'], 'integer'); if ($um == 'insert') { // insert $text = escape($_POST['txt'], 'textarea'); 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,news_preis) VALUES ('" . $_POST['titel'] . "'," . $_SESSION['authid'] . ",NOW()," . $_POST['grecht'] . ",'" . $_POST['katLis'] . "','" . $text . "','" . $_POST['preis'] . "')"); // insert } elseif ($um == 'change') { // edit $text = escape($_POST['txt'], 'textarea'); 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 . '", news_preis = "' . $_POST['preis'] . '" WHERE news_id = "' . $_POST['newsID'] . '" LIMIT 1'); $edit = $_POST['newsID']; } } // edit // del if ($menu->get(1) == 'del') { db_query('DELETE FROM `prefix_news` WHERE news_id = "' . $menu->get(2) . '" 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 = 20; // Limit $page = ($menu->getA(1) == 'p' ? $menu->getE(1) : 1); $MPL = db_make_sites ($page , '' , $limit , "?news" , 'news'); $anfang = ($page - 1) * $limit; if ($menu->get(1) != 'edit') { $FnewsID = ''; $Faktion = 'insert'; $Fueber = ''; $Fstext = ''; $Ftxt = ''; $Fgrecht = ''; $FkatLis = ''; $Fsub = 'Eintragen'; $Fpreis = ''; } else { $row = db_fetch_object(db_query("SELECT * FROM `prefix_news` WHERE news_id = " . $menu->get(2))); $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'; $Fpreis = $row->news_preis; } $tpl = new tpl ('news', 1); $ar = array ( 'NEWSID' => $FnewsID, 'AKTION' => $Faktion, 'MPL' => $MPL, 'UEBER' => $Fueber, 'txt' => $Ftxt, 'SMILIS' => getsmilies(), 'grecht' => dbliste($Fgrecht, $tpl, 'grecht', "SELECT id,name FROM prefix_grundrechte ORDER BY id DESC"), 'KATS' => getKats($FkatLis), 'FSUB' => $Fsub, 'FPREIS' => $Fpreis ); $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); $class = ''; while ($row = db_fetch_object($erg)) { $class = ($class == 'Cmite' ? 'Cnorm' : 'Cmite'); $tpl->set_ar_out(array ('ID' => $row->news_id, 'class' => $class, 'TITEL' => $row->news_title) , 1); } // e d i t , d e l e t e $tpl->set_ar_out(array ('MPL' => $MPL) , 2); } $design->footer(); ?>
<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="?news-del-"+DELID; } } function delKcheck ( DELID , NID) { var frage = confirm ( "Willst du dieses Kommentar wirklich l�schen?" ); if ( frage == true ) { document.location.href="?news-sKoms-"+NID+"-Kdel-"+DELID+"#"+NID; } } function sichtbar(){ if( document.form.katLis.value=="neu"){ document.form.kat.style.visibility="visible"; } else { document.form.kat.style.visibility="hidden"; } } //--></script> <script type='text/javascript' src='include/includes/js/bbcode.js'></script> <table cellpadding="0" cellspacing="0" border="0"><tr><td><img src="include/images/icons/admin/news.png" /></td><td width="30"></td><td valign="bottom"><h1>News</h1></td></tr></table> <hr style="width: 400px; margin: 0px;" > <br /><br /> <table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top"> <form method="POST" name="form" action="?news"> <input type="hidden" name="um" value="{AKTION}"> <input type="hidden" name="newsID" value="{NEWSID}"> <table cellpadding="2" cellspacing="1" border="0" class="border"> <tr> <td class="Cmite" align="right"><strong>Titel : </strong></td> <td class="Cnorm"><input size="50" type="text" name="titel" value="{UEBER}"></td> </tr><tr> <td class="Cmite" align="right"><strong>News : </strong></td> <td rowspan="2" class="Cnorm"> <!-- BB Code START --> <a href="javascript:simple('b')"><img style="padding-left: 4%; float: left;" src="include/images/icons/button.bold.gif" alt="b" title="{_lang_bold}" border="0"></a> <a href="javascript:simple('i')"><img style="padding-left: 4%; float: left;" src="include/images/icons/button.italic.gif" alt="i" title="{_lang_italic}" border="0"></a> <a href="javascript:simple('u')"><img style="padding-left: 4%; float: left;" src="include/images/icons/button.underline.gif" alt="u" title="{_lang_underlined}" border="0"></a> <a href="javascript:simple('code')"><img style="padding-left: 4%; float: left;" src="include/images/icons/button.code.gif" alt="Code" title="{_lang_code}" border="0"></a> <a href="javascript:simple_liste()"><img style="padding-left: 4%; float: left;" src="include/images/icons/button.insertunorderedlist.gif" alt="{_lang_list}" title="{_lang_list}" border="0"></a> <a href="javascript:simple('url')"><img style="padding-left: 4%; float: left;" src="include/images/icons/button.link.gif" alt="Url" title="{_lang_link}" border="0"></a> <a href="javascript:simple('img')"><img style="padding-left: 4%; float: left;" src="include/images/icons/button.image.gif" alt="{_lang_picture}" title="{_lang_picture}" border="0"></a> <!-- BB Code ENDE --> </td> </tr><tr> <td rowspan="2" valign="top" class="Cmite">{SMILIS}</td> </tr><tr> <td class="Cnorm"><textarea name="txt" rows="15" cols="65" tabindex="2">{txt}</textarea></td> </tr><tr> <td class="Cmite" align="right"><strong>Sichtbar ab : </strong></td> <td class="Cnorm"><select name="grecht">{_list_grecht@<option%1 value="%2">%3</option>}</select></td> </tr><tr> <td class="Cmite" align="right"><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"></td> </tr> <tr> <td class="Cmite" align="right"><strong>Preis : </strong></td> <td class="Cnorm"> <input size="50" type="text" name="preis" value="{FPREIS}"></td> </tr><tr class="Cdark"> <td></td> <td><input type="submit" value="{FSUB}" name="submit"></td> </tr> </table> </form> <br /><br /> <div class="info_box"> <b>Merke (Kategorie Bild)</b> <br /> <span 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 </span> </div> <div class="info_box"> <b>Merke (Vorschau Funktion)</b> <br /> <span 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. </span> </div> </td><td width="75"> </td><td valign="top"> {MPL} <table cellpadding="3" cellspacing="1" border="0" class="border"> {EXPLODE}<tr class="{class}"> <td><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></td> <td><a href="?news-edit-{ID}"><img src="include/images/icons/edit.gif" alt="Verändern" title="Verändern" border="0"></a></td> <td>{TITEL}</td> </tr>{EXPLODE} </table> {MPL} </td></tr></table> <script language="JavaScript" type="text/javascript"> <!-- sichtbar(); //--> </script>
'ANTISPAM' => (loggedin()?'':get_antispam ('newskom', 0)),
'**Name**' => $row->**datenbank-name**
$_POST['**name neues Feld**'] = escape($_POST['**name neues Feld**'], 'integer');
$_POST['**name neues Feld**'] = escape($_POST['**name neues Feld**'], 'string');
<tr> <td height="25" class="Cdark">{_lang_message}</td> </tr>
echo '<b>'.$lang['nocomments'].'</b>';
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 (trim($a) == trim($akt)) { $sel = ' selected'; } else { $sel = ''; } $kats .= '<option' . $sel . '>' . $a . '</option>'; } return ($kats); }
function image_valid($type) { $file_types = array( 'image/pjpeg' => 'jpg', 'image/jpeg' => 'jpg', 'image/jpeg' => 'jpeg', 'image/gif' => 'gif', 'image/X-PNG' => 'png', 'image/PNG' => 'png', 'image/png' => 'png', 'image/x-png' => 'png', 'image/JPG' => 'jpg', 'image/GIF' => 'gif', ); if ( !array_key_exists ( $type, $file_types ) ) { return false; } else { return true; } }
if ($_POST['katLis'] == 'neu') { $_POST['katLis'] = $_POST['kat'];
// Hochgeladenes Bild verarbeiten if(isset($_FILES['bild_upload']) && image_valid($_FILES['bild_upload']['type'])) { $datei_endung = explode(".", $_FILES['bild_upload']['name']); $i = count($datei_endung) -1; $datei_endung = $datei_endung[$i]; $speicherort = "include/images/news/" . $_POST['kat'] . "." . $datei_endung; move_uploaded_file($_FILES['bild_upload']['tmp_name'], $speicherort); }
document.form.kat.style.visibility="visible";
document.getElementById('kat_bild').style.display="inline";
document.form.kat.style.visibility="hidden";
document.getElementById('kat_bild').style.display="none";
<form method="POST" name="form" action="?news">
<form method="POST" name="form" action="?news" enctype="multipart/form-data">
<td class="Cnorm"><select onChange="sichtbar()" name="katLis">{KATS}<option value="neu">Neu:</option></select> <input type="text" name="kat" size="40"></td>
<td class="Cnorm"><select onChange="sichtbar()" name="katLis">{KATS}<option value="neu">Neu:</option></select> <input type="text" name="kat" size="40"><br><div id="kat_bild">Kat-Bild: <input name="bild_upload" type="file"></div></td>
Geschlossen | ||
Zurück zu Allgemein |