get(2);
$aktMenu = escape($menu->get(3),'integer');
$ar74 = array(
'NICK' => $row['name'],
'UID' => $uid
);
$tpl->set_ar_out($ar74,0);
##VIEW
if($menu->get(2) == "view") {
$limit = 5; // Limit
$page = ($menu->getA(4) == 'p' ? $menu->getE(4) : 1 );
$MPL = db_make_sites ($page , "" , $limit , '?user-usergb-view-'.$uid.'-'.$aktMenu.'' , 'usergb' );
$anfang = ($page - 1) * $limit;
$abf = "SELECT * FROM `prefix_usergb` WHERE uid = $uid ORDER BY id DESC LIMIT $anfang, $limit";
$erg = db_query($abf);
while(@$row = db_fetch_assoc($erg))
{
if(substr($row['page'],0,7) == "http://") {
$homepage = '
';
} else {
$homepage = '
';
}
if($row['mail'] == "") {
$email = '';
} else {
$email = '
';
}
if(is_admin() || $uid == $_SESSION['authid']) {
$del = '
';
} else {
$del = '';
}
$ar2 = array(
'DATE' => $row['date'],
'NICKNAME' => $row['name'],
'TXT' => bbcode($row['txt']),
'HOMEPAGE' => $homepage,
'EMAIL' => $email,
'UID' => $uid,
'DEL' => $del
);
$tpl->set_ar_out($ar2,1);
}
$tpl->set_out('SITELINK', $MPL, 2);
}
##ADD
if($menu->get(2) == "add") {
$class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' );
$ar3 = array(
'CLASS' => $class,
'UID' => $uid,
'ANTISPAM' => get_antispam ('usergb', 1)
);
$tpl->set_ar_out($ar3,3);
}
## INSERT
if($menu->get(2) == "insert") {
if($_POST['email'] == "" || $_POST['nick'] == "" || $_POST['txt'] == "") {
$link = "index.php?user-usergb-add-".$uid."";
$text = "Bitte alle Pflichtfelder ausfüllen!";
wd ($link, $text);
} else {
if(chk_antispam ('usergb')) {
$date = date("d.m.Y", time());
$ip = $_SERVER['REMOTE_ADDR'];
$bet = "Neuer Eintrag in deinem Gästebuch!";
$txt = "Hallo $name[name], es hat jemand in dein Gästebuch geschrieben.
Klicke auf den Link um direkt dorthin zu kommen: [url=?user-usergb-view-".$uid."]Link[/url]";
sendpm(1, $uid, $bet, $txt);
# $txt = escape($_POST['txt'], 'textarea');
# $name = escape($_POST['name'], 'string');
# $mail = escape($_POST['mail'], 'string');
# $page = escape($_POST['page'], 'string');
$ins = db_query("INSERT INTO `prefix_usergb` (name, mail, page, uid, date, ip, txt) VALUES ('".$_POST['nick']."', '".$_POST['email']."', '".$_POST['homepage']."', '".$uid."', '".$date."', '".$ip."', '".$_POST['txt']."')");
if($ins == true) {
$link2 = "index.php?user-usergb-view-".$uid."";
$text2 = "Erfolgreich eingetragen!";
wd ($link2, $text2);
} else {
echo mysql_error();
}
} else {
$antitxt = "Anti-Spam nicht korrekt!";
$antilink = "index.php?user-usergb-add-".$uid."";
wd ($antilink, $antitxt);
}
}
}
## DELETE
if($menu->get(2) == "del") {
$pid = $menu->get(4);
$delete = "DELETE FROM `prefix_usergb` WHERE id = ".$pid." LIMIT 1";
$erg = db_query($delete);
$link3 = "index.php?user-usergb-view-".$uid."";
$text3 = "Eintrag gelöscht!";
wd ($link3, $text3);
}
?>