PHP gevorderde |
|
<?php
if($status == 'beheerder' || $status == 'co-beheerder' || $status == 'admin')
{
if($_GET['methode'] == 'reply')
{
$id = $_GET['id'];
if(is_numeric($id)){
$query = mysql_query("Select * FROM cm_replys WHERE id='".$id."'") or die(mysql_error());
$del = mysql_fetch_assoc($query);
$geb = $del['poster'];
$delete = deletebonuspunt($geb, 1);
if($delete){
echo 'Er is een fout opgetereden.';
}else{
mysql_query("DELETE FROM cm_replys WHERE id='".$id."'") or die(mysql_error());
header('Location: ?pag=forum/topic&id='.$_GET['tid'].'&cat='.$_GET['cat']);
}
}else{
echo 'FOUT';
header('Refresh: 2; URL=?pag=forum/topic&id='.$_GET['tid'].'&cat='.$_GET['cat']);
}
}
elseif($_GET['methode'] == 'type' && ($status == 'beheerder' || $status == "co-berheerder"))
{
$id = $_GET['id'];
if(is_numeric($id)){
$query = mysql_query("SELECT * FROM cm_topics WHERE id='".$id."'") or die(mysql_error());
$delT = mysql_fetch_assoc($query);
$gebT = $delT['poster'];
$delete = deletebonuspunt($gebT, 1);
if($delete){
echo 'Er is een fout opgetereden.';
}else{
mysql_query("DELETE FROM cm_topics WHERE id='".$id."'") or die(mysql_error());
}
$sql = mysql_query("SELECT * FROM cm_replys WHERE top_id='".$id."'") or die(mysql_error());
if(mysql_num_rows($sql) != 0)
{
while($asc = mysql_fetch_assoc($sql))
{
$user = $asc['poster'];
$sql = mysql_query("SELECT * FROM cm_replys WHERE top_id=".$id." AND poster='".$user."'") or die(mysql_error());
$aantal = mysql_num_rows($sql);
deletebonuspunt($user, $aantal);
mysql_query("DELETE FROM cm_replys WHERE top_id='".$id."' AND poster='".$user."'") or die(mysql_error());
}
}
header('Location: ?pag=forum/topic_lijst&cat='.$_GET['cat']);
}
}else{
echo 'FOUT';
header('Refresh: 2; URL=?pag=forum/topic&id='.$_GET['tid'].'&cat='.$_GET['cat']);
}
}else{
header('Location: ?pag=home');
}
?>
<?php if($status == 'beheerder' || $status == 'co-beheerder' || $status == 'admin') { if($_GET['methode'] == 'reply') { $id = $_GET['id']; $geb = $del['poster']; $delete = deletebonuspunt($geb, 1); if($delete){ echo 'Er is een fout opgetereden.'; }else{ header('Location: ?pag=forum/topic&id='.$_GET['tid'].'&cat='.$_GET['cat']); } }else{ header('Refresh: 2; URL=?pag=forum/topic&id='.$_GET['tid'].'&cat='.$_GET['cat']); } } elseif($_GET['methode'] == 'type' && ($status == 'beheerder' || $status == "co-berheerder")) { $id = $_GET['id']; $gebT = $delT['poster']; $delete = deletebonuspunt($gebT, 1); if($delete){ echo 'Er is een fout opgetereden.'; }else{ } { { $user = $asc['poster']; deletebonuspunt($user, $aantal); } } header('Location: ?pag=forum/topic_lijst&cat='.$_GET['cat']); } }else{ header('Refresh: 2; URL=?pag=forum/topic&id='.$_GET['tid'].'&cat='.$_GET['cat']); } }else{ header('Location: ?pag=home'); } ?>
Nu heb ik een probleem met het verwijderen van het topic de is_numeric doet moeilijk
|