Location: PHPKode > projects > Poddy > src/maintainance/delete_pod.php
<html>
<head>
<title>Delete Podcast</title>
</head>
<body>
<a href="index.php">Zum Hauptmen√ľ</a>
<hr/>
<?
require_once("../config.php");
require_once("lib/db_utils.php");

if (empty($_REQUEST["id"])) {
	die("no podcast id given");
}
$podcast = get_podcast($_REQUEST["id"]);
if (empty($podcast) || empty($podcast["id"])) {
	die("no podcast id given");
}


$sql = array();
$sql[] = "delete from podcast where id='".$_REQUEST["id"]."'";
$sql[] = "delete from mypodcast where id='".$_REQUEST["id"]."'";
$sql[] = "delete from item where podcast_id='".$_REQUEST["id"]."'";
$sql[] = "delete from podcast_category where podcast_id='".$_REQUEST["id"]."'";
$sql[] = "delete from podcast_rating where podcast_id='".$_REQUEST["id"]."'";
$sql[] = "delete from podcast_hit_relation where (podcast1_id='".$_REQUEST["id"]."' or podcast2_id='".$_REQUEST["id"]."')";
$sql[] = "delete from podcast_stat where podcast_id='".$_REQUEST["id"]."'";
$sql[] = "delete from poddyuser_fav where podcast_id='".$_REQUEST["id"]."'";
$sql[] = "delete from poddyuser_hist where podcast_id='".$_REQUEST["id"]."'";
$sql[] = "delete from comments where comment_parent='".$_REQUEST["id"]."'";
$sql[] = "delete from tag_links where podcast_id='".$_REQUEST["id"]."'";
$sql[] = "delete from qix where podcast_id='".$_REQUEST["id"]."'";

$cmd = array();
$cmd[] = "rm -rf '".FS_BASE_PODCASTS.$_REQUEST["id"]."'";
$cmd[] = "rm -rf '".FS_BASE_ICONS.$_REQUEST["id"]."*'";

foreach ($sql as $s) {
	echo $s."<br/>";
	if (!empty($_REQUEST["really"])) {
		db_query($s);
	}
}
foreach ($cmd as $c) {
	echo $c."<br/>";
	if (!empty($_REQUEST["really"])) {
		shell_exec($c);
	}
}
?>

<a href="delete_pod.php?id=<?php echo $_REQUEST["id"]; ?>&really=true">Wirklich löschen ?</a>

</body>
</html>
Return current item: Poddy