<?php require "../php/header.php"; $id = stripslashes($HTTP_GET_VARS['id']); if (isset($HTTP_GET_VARS['id']) && $userdata['session_logged_in'] == true) { $pid = $userdata['user_id']; $mc = mcGetLevel($id); # echo "<pre>"; # print_r($mc); # echo "</pre>"; $parents = $mc->getParents(); $parent = $parents[0]->getId(); #echo "size = " . sizeof($parents) . "<br>"; if (sizeof($parents) <= 1) { $error = "Sorry you can't delete a top level folder."; } else { if (sizeof($mc->getSubFolders()) > 0 || sizeof($mc->getMaps()) > 0) { $error = "Sorry, you can't delete a folder with items in it"; } else { if ($mc->getPid() == $pid) { #OK to delete $id = mysql_escape_string($id); $sql = "delete from map_structure where ms_id = '{$id}'"; #echo $sql; mysql_query($sql); $error = ""; } else { $error = "Sorry you can't modify folders you don't own."; } } }
<?php require "../php/header.php"; $html_title = "WinBolo.net: Map Collections"; $id = $HTTP_GET_VARS['id']; $mc = mcGetLevel($id); $levelExists = true; include "{$BASE_FILES}/inc_mapcollection_top.php"; if (isset($HTTP_GET_VARS['id']) && $mc->getPid() == '') { $mc = mcGetLevel(''); $levelExists = false; } require "{$BASE_FILES}/inc_mapcollection_navigation.php"; if (sizeof($mc->getSubFolders()) > 0) { require "{$BASE_FILES}/inc_mapcollection_folders.php"; } if (sizeof($mc->getMaps()) > 0) { require "{$BASE_FILES}/inc_mapcollection_maps.php"; } if ($levelExists == true && $userdata['session_logged_in'] == true && $userdata['user_id'] == $mc->getPid()) { include "{$BASE_FILES}/inc_mapcollection_options.php"; } require "{$BASE_FILES}/inc_mapcollection_bottom.php"; ?>