Location: PHPKode > projects > Poddy > src/maintainance/reingest_item.php
<html>
<head>
<title>Delete Podcast</title>
</head>
<body>
<a href="list_pods.php">Zur Liste</a>

<?
require_once("../config.php");
require_once("lib/db_utils.php");
require_once("lib/sql_utils.php");

if (empty($_REQUEST["id"])) {
	die("no item id given");
}

$item = get_item($_REQUEST["id"]);

$sql = array();
$sql[] = "delete from item where id='".$_REQUEST["id"]."'";
$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 item_rating where item_id='".$_REQUEST["id"]."'";
$sql[] = "delete from item_hit_relation where (item1_id='".$_REQUEST["id"]."' or item2_id='".$_REQUEST["id"]."')";
$sql[] = "delete from item_stat where item_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 comment where comment_parent='".$_REQUEST["id"]."'";
$sql[] = "delete from tag_links where item_id='".$_REQUEST["id"]."'";
$sql[] = "delete from qix where item_id='".$_REQUEST["id"]."'";

$cmd = array();
$cmd[] = "rm -rf '".FS_BASE_PODCASTS.$item["podcast_id"]."/".$_REQUEST["id"]."*'";
$cmd[] = "rm -rf '".FS_BASE_ICONS.$item["podcast_id"]."/".$_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_item.php?id=<?php echo $_REQUEST["id"]; ?>&really=true">Wirklich löschen ?</a>

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