function replacePicture($newFID, $oldFID, $moduleName) { if ($newFID != 0 && $newFID != $oldFID) { addPicture($newFID, $moduleName); if ($oldFID != 0) { removePicture($oldFID, $moduleName); } } }
publishPicture($cid, 1); break; case "unpublish": publishPicture($cid, 0); break; case 'movepic': movePic($cid[0]); break; case 'movepicres': movePicResult($cid); break; case "edit": editPicture($cid[0]); break; case "remove": removePicture(); break; case "save": savePicture(); break; case "comments": showComments(); break; case "publishcmt": publishComment($id, 1); break; case "unpublishcmt": publishComment($id, 0); break; case "removecmt": removeComment();
* Time: 16:01 */ include 'htmllibrary.php'; include 'DAO.php'; session_start(); // not logged in or id of photo not set if (!isset($_SESSION['user_id']) || !isset($_GET['id'])) { header('Location: index.php'); } //not his photo if (!in_array($_GET['id'], array_keys(getImagesByUser('slike.txt')))) { header('Location: index.php'); } if (!empty($_POST['submitted'])) { if (isset($_POST['btnDelete'])) { removePicture($_GET['id']); header('Location: mypictures.php'); } $data = elements(array('title', 'galleryOption'), $_POST); $allGood = true; foreach ($data as $value) { if ($value === null || empty($value)) { $allGood = false; break; } } $data['description'] = element('description', $_POST, ''); foreach ($data as $key => $value) { $data[$key] = htmlentities($value); } if ($allGood) {
function removeMediaHelper($MID) { $FID = dbDeleteMedia($MID); if ($FID != null) { removePicture($FID, 'Media'); } }