get_baseurl() . '/admin');
}
if($action != 'censor' && $action != 'dead')
return;
$r = q("SELECT * FROM `profile` WHERE `id` = %d LIMIT 1",
intval($id)
);
if(! count($r))
return;
if($action == 'censor') {
q("UPDATE `profile` SET `censored` = 1 WHERE `id` = %d LIMIT 1",
intval($id)
);
q("DELETE FROM `flag` WHERE `pid` = %d",
intval($id)
);
notice('Profile censored
');
}
if($action == 'dead') {
q("DELETE FROM `profile` WHERE `id` = %d LIMIT 1",
intval($id)
);
q("DELETE FROM `photo` WHERE `profile-id` = %d LIMIT 1",
intval($id)
);
q("DELETE FROM `flag` WHERE `pid` = %d",
intval($id)
);
notice('Dead profile removed
');
}
goaway($a->get_baseurl() . '/admin');
}
function moderate_content(&$a) {
if(! $_SESSION['uid']) {
notice("Permission denied.");
return;
}
if($a->argc > 1)
$id = intval($a->argv[1]);
if($a->argc > 2)
$reason = $a->argv[2];
if($id) {
$r = q("SELECT * FROM `profile` WHERE `id` = %d LIMIT 1",
intval($id)
);
if(! count($r)) {
notice("Entry does not exist.");
q("DELETE FROM `flag` WHERE `pid` = %d",
intval($id)
);
goaway($a->get_baseurl() . '/admin');
}
}
$c .= "