Meine Dateien sind wie folgt aufgebaut.
admin_songs.htm :
<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 = "?admin_songs-del-" + DELID; } } //--></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> Songs</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="?admin_songs"> <input type="hidden" name="um" value="{AKTION}"> <input type="hidden" name="songsID" value="{SONGSID}"> <table cellpadding="2" cellspacing="1" border="0"> <tr> <td> Titel: </td> <td> <input type="text" name="titel" value="{titel}" /> </td> </tr> <tr> <td> Dauer: </td> <td> <input type="text" name="dauer" value="{dauer}"> </td> </tr> <tr> <td> Größe: </td> <td> <input type="text" name="groesse" value="{groesse}"> </td> </tr> <tr> <td> Downloadlink: </td> <td> <textarea name="download" cols="17" rows="5">{download}</textarea> </td> </tr> <tr> <td colspan="2"> <!--<input size="80" type="text" name="download" value="{download}">--> </td> </tr> <tr class="Cdark"> <td> </td> <td> <input type="submit" value="{FSUB}" name="submit"> </td> </tr> </table> </form> <br /> <br /> </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="?admin_songs-edit-{ID}"> <img src="include/images/icons/edit.gif" alt="Verändern" title="Verändern" border="0"></a> </td> <td> {titel} </td> <td> {dauer} </td> <td> {groesse} </td> <td> {download} </td> </tr> {EXPLODE} </table> {MPL} </td> </tr> </table> <script language="JavaScript" type="text/javascript"> <!-- sichtbar(); //--> </script>
Und hier meine admin_songs.php :
<?php // Copyright by: Manuel // Support: www.ilch.de // modified by Darkentik // www.fritsch-community.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(); // -----------------------------------------------------------| // # // ## // ### // #### A k t i o n e n if (!empty($_REQUEST['um'])) { $um = $_REQUEST['um']; $_POST['titel'] = escape($_POST['titel'], 'string'); $_POST['dauer'] = escape($_POST['dauer'], 'string'); $_POST['groesse'] = escape($_POST['groesse'], 'string'); $_POST['download'] = escape($_POST['download'], 'string'); $_POST['songsID'] = escape($_POST['songsID'], 'integer'); if ($um == 'insert') { // insert db_query("INSERT INTO `prefix_songs` (titel,dauer,groesse,download) VALUES ('" . $_POST['titel'] . "','" . $_POST['dauer'] . "','" . $_POST['groesse'] . "','" . $_POST['download'] . "')"); // insert } elseif ($um == 'change') { // edit db_query('UPDATE `prefix_songs` SET titel = "' . $_POST['titel'] . '", dauer = "' . $_POST['dauer'] . '", groesse = "' . $_POST['groesse'] . '", download = "' . $_POST['download'] . '" WHERE ID = "' . $_POST['songsID'] . '" LIMIT 1'); $edit = $_POST['songsID']; } } // edit // del if ($menu->get(1) == 'del') { db_query('DELETE FROM `prefix_songs` WHERE 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 , "?admin_songs" , 'songs'); $anfang = ($page - 1) * $limit; if ($menu->get(1) != 'edit') { $FsongsID = ''; $Faktion = 'insert'; $Ftitel=''; $Fdauer = ''; $Fgroesse = ''; $Fdownload = ''; $Fsub = 'Eintragen'; } else { $row = db_fetch_object(db_query("SELECT * FROM `prefix_songs` WHERE ID = " . $menu->get(2))); $FsongsID = $row->ID; $Faktion = 'change'; $Ftitel = $row->titel; $Fdauer = $row->dauer; $Fgroesse = $row->groesse; $Fdownload = $row->download; $Fsub = 'Ändern'; } $tpl = new tpl ('admin_songs', 1); $ar = array ( 'SONGSID' => $FsongsID, 'AKTION' => $Faktion, 'MPL' => $MPL, 'titel' => $Ftitel, 'dauer' => $Fdauer, 'groesse' => $Fgroesse, 'download'=> $Fdownload, 'FSUB' => $Fsub ); $tpl->set_ar_out($ar, 0); // e d i t , d e l e t e //Erzeugen der Ausgabe der Datensätze in der DB $abf = 'SELECT * FROM `prefix_songs` ORDER BY ID ASC 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->ID, 'class' => $class, 'titel' => $row->titel,'dauer' => $row->dauer, 'groesse' => $row->groesse,'download' => $row->download), 1); } // e d i t , d e l e t e $tpl->set_ar_out(array ('MPL' => $MPL) , 2); } $design->footer(); ?>
Könnte mir da jmd helfen noch unter den Punkt Downloadlink einen FTP-Upload zu integrieren? Später möchte ich dann noch den Downloadlink dynamisch erstellen lassen.
Gruß Darkentik
verwendete ilchClan Version: 1.1 N
betroffene Homepage: chosenones.ch.funpic.de/Jaezzhole/?home