So also hier fürs Gästebuch:
include/contents/gbinform.php <?php
# Copyright by: Manuel
# Support: www.ilch.de
# inform.php by Mairu
defined ('main') or die ( 'no direct access' );
$title = $allgAr['title'].' :: Gästebuch :: Benachrichtigung';
$hmenu = 'Gästebuch <b> » </b> Benachrichtigung';
$design = new design ( $title , $hmenu, 1);
$design->header();
$gbid = ($menu->getA(1) == 'e' ? $menu->getE(1) : '');
if (isset($_POST['submit'])) $gbid = $_POST['gbid'];
if (empty($gbid) OR @db_result(db_query("SELECT COUNT(*) FROM `prefix_gbook` WHERE id = $gbid"),0) != 1) echo 'Diese Seite wurde falsch aufgerufen!<br /><br />
<a href="javascript:history.back()">zurück</a>';
else {
$frm = db_fetch_object(db_query("SELECT id,name,time FROM `prefix_gbook` WHERE id = $gbid"));
if (isset($_POST['submit']) AND $_POST['mod'] != 'noone'){
$pmtxt = "Benachrichtigung durch: {$_SESSION['authname']}\n
User: $frm->name\n
[url=http://{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']}?gbook-show-$gbid]Link zum Eintrag[/url]
vom ".date('d.m.Y - H:i',$frm->time)."\n
Kommentar: {$_POST['reason']}\n";
sendpm($_SESSION['authid'],$_POST['mod'],'Forumsbenachrichtigung',$pmtxt,1);
echo 'Benachrichtung erfolgreich abgeschickt.<br /><a href="?gbook">Zurück zum Gästebuch</a>';
}
else {
if (isset($_POST['submit']) AND $_POST['mod'] == 'noone') echo 'Du musst einen Adressat auswählen<br />';
$admins = '';
$rechte = array();
$sql = db_query("SELECT name,id FROM `prefix_grundrechte` WHERE id <= -7");
while ($row = db_fetch_object($sql)) $rechte[$row->id]=$row->name;
$sql = db_query("SELECT id,name,recht FROM `prefix_user` WHERE recht <= -7 ORDER BY recht ASC, name DESC");
while ($row = db_fetch_object($sql)) $admins .= "<option value=\"$row->id\">$row->name (".$rechte[$row->recht].")</option>\n";
$out = array( 'GBID' => '<input type="hidden" name="gbid" value="'.$gbid.'" />',
'ADMINS' => $admins,
'TXT' => $_POST['reason']);
$tpl = new tpl('gbinform');
$tpl->set_ar_out($out,0);
}
}
$design->footer();
?>
include/templates/gbinform.htm <form action="index.php?gbinform" method="post">
{GBID}
<table width="98%" border="0" cellspacing="1" class="border" cellpadding="5" id="table1">
<tr class="Chead">
<th colspan="2" height="20">Beitrag melden</th>
</tr><tr class="Cmite">
<td height="20">Benachrichtigung an Moderator:</td>
<td height="20">
<select name="mod">
<option value="noone">Bitte auswählen</option>
{ADMINS}
</select></td>
</tr><tr>
<td colspan="2" class="Cnorm"><textarea name="reason" rows=14 cols=64>{TXT}</textarea></td>
</tr><tr>
<td><input type="submit" name="submit" value="Abschicken"></td>
</tr>
</table></form>
Ja und dann könnte man die Funktion in der
include/contents/gbook.php einbauen, indem man nach
$koms = '';
if ($allgAr['gbook_koms_for_inserts'] == 1) {
$koms = db_result(db_query("SELECT COUNT(*) FROM prefix_koms WHERE uid = ".$row->id." AND cat = 'GBOOK'"),0,0);
$koms = '<a href="index.php?gbook-show-'.$row->id.'">'.$koms.' '.$lang['comments'].'</a>';
}
sucht und darunter noch diese Zeile einfügt
$koms .= ' <a href="?gbinform-e'.$row->id.'">Eintrag einem Admin melden</a>';