So ich habe hier zwei aktualisierte Version der entsprechenden Admin dateien
1. include/admin/history.php
<?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();
$tpl = new tpl ( 'history', 1);
# delete
if ( $menu->getA(1)=='d' AND is_numeric($menu->getE(1))){
$IdToDelete=escape($menu->getE(1), 'integer');
db_query("DELETE FROM prefix_history WHERE id = '".$IdToDelete."'");
wd('?history','Erfolgreich gelöscht',3);
}
if (isset($_POST['pkey'])) {
$IdToEdit = escape($_POST['pkey'], 'integer');
}
if ( !empty($_POST['sub']) ){
list ( $d,$m,$y ) = explode('.',$_POST['date']);
if ( @checkdate ( $m, $d, $y ) ) {
$date = $y.'-'.$m.'-'.$d;
$date = escape($date,'string');
$txt = escape($_POST['txt'],'textarea');
$title = escape($_POST['title'],'string');
if ( empty ($_POST['pkey']) ) {
db_query("INSERT INTO prefix_history (date,title,txt) VALUES ('".$date."','".$title."','".$txt."')");
} else {
db_query("UPDATE prefix_history SET date = '".$date."',title = '".$title."',txt = '".$txt."' WHERE id = '".$IdToEdit."'");
}
} else {
echo 'Datum stimmt nicht, bitte im Format DD.MM.YYYY eingeben also z.B. 29.12.2005<br />';
}
}
if(!isset($IdToDelete)){
if ( $menu->getA(1)=='e' AND is_numeric($menu->getE(1)) AND empty($IdToEdit) ) {
$IdToEdit = escape($menu->getE(1), 'integer');
$erg = db_query("SELECT id,DATE_FORMAT(date,'%d.%m.%Y') as date,title,txt FROM prefix_history WHERE id = '".$IdToEdit."'");
$_ilch = db_fetch_assoc($erg);
$_ilch['pkey'] = $IdToEdit;
} else {
$_ilch = array ('pkey'=>'','date'=>date('d.m.Y'),'title'=>'','txt'=>'');
}
$tpl->set_ar_out($_ilch,0);
$limit = 20;
$page=($menu->getA(1) == 'p'? escape($menu->getE(1), 'integer') : 1);
$MPL = db_make_sites ($page , 'ORDER BY `date` DESC' , $limit , '?history' , 'history' );
$anfang = ($page - 1) * $limit;
$abf = "SELECT `id`,`date`,`title` FROM prefix_history ORDER BY `date` DESC LIMIT ".$anfang.",".$limit;
$erg = db_query($abf);
while ($row = db_fetch_assoc($erg) ) {
$class = ($class == 'Cmite' ? 'Cnorm' : 'Cmite' );
$row['class'] = $class;
list ( $y,$m,$d ) = explode('-',$row['date']);
$row['date'] = $d.'.'.$m.'.'.$y;
$tpl->set_ar_out($row ,1);
}
$tpl->set_out('MPL', $MPL, 2);
}
$design->footer();
?>
2. include/admin/templates/history.htm
<script language="JavaScript" type="text/javascript">
<!--
function del ( id1 ) {
var x = confirm ( "do you really want to delete?" );
if ( x ) {
document.location.href="admin.php?history-d"+id1;
}
}
//-->
</script>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img src="include/images/icons/admin/history.png" /></td>
<td width="30"></td>
<td valign="bottom"><h1>History</h1></td>
</tr>
</table>
<table width="100%">
<tr>
<td valign="top" width="60%">
<form action="admin.php?history" method="POST">
<input type="hidden" name="pkey" value="{pkey}">
<table class="border" cellpadding="3" cellspacing="1" border="0">
<tr>
<td class="Cmite">Date</td>
<td class="Cnorm"><input type="text" name="date" value="{date}" /></td>
</tr><tr>
<td class="Cmite">Title</td>
<td class="Cnorm"><input type="text" name="title" value="{title}" /></td>
</tr><tr>
<td class="Cmite">Text</td>
<td class="Cnorm"><textarea cols="40" rows="3" name="txt">{txt}</textarea></td>
</tr><tr class="Cdark">
<td></td>
<td><input type="submit" value="Absenden" name="sub" /></td>
</tr>
</table>
</form>
</td>
<td valign="top" width="40%">
<table cellpadding="3" border="0" cellspacing="1" class="border">
<tr class="Chead">
<td>Date</td>
<td>Title</td>
<td></td>
<td></td>
</tr>
{EXPLODE}
<tr class="{class}">
<td>{date}</td>
<td>{title}</td>
<td><a href="?history-e{id}"><img src="include/images/icons/edit.gif" border="0" title="History Eintrag bearbeiten" alt="ändern" /></a></td>
<td><a href="javascript:del('{id}')"><img src="include/images/icons/del.gif" border="0" title="History Eintrag löschen" alt="löschen" /></a></td>
</tr>
{EXPLODE}
</table>
{MPL}
</td>
</tr>
</table>
bitte die Dateien dementsprechend ändern
Meine Postings repräsentieren meine Meinung wenn nicht anders gekennzeichnet.
MFG Rock@wulf