} else { $ok = false; $error['photographer_gridref'] = $sq->errormsg; } } $view_direction = intval(trim(stripslashes($_POST['view_direction']))); $use6fig = intval(trim(stripslashes($_POST['use6fig']))); ///////////////////////////////////////////////////////////// // STEP 2 - change control if ($ok) { //we really need this not be interupted ignore_user_abort(TRUE); set_time_limit(3600); //create new change control object $ticket = new GridImageTroubleTicket(); $ticket->setSuggester($USER->user_id, $USER->realname); if ($isadmin && !empty($_REQUEST['mod'])) { $ticket->setModerator($USER->user_id); } if (!empty($_REQUEST['type'])) { $ticket->setType($_REQUEST['type']); } $ticket->setPublic(isset($_REQUEST['public']) ? $_REQUEST['public'] : 'everyone'); $ticket->setImage($_REQUEST['id']); $ticket->setNotes($updatenote); if (strlen($imageclassother)) { $imageclass = $imageclassother; } //attach the various field changes $ticket->updateField("title1", $image->title1, $title, $moderated["title"]); $ticket->updateField("comment1", $image->comment1, $comment, $moderated["comment"]);
$db->Execute("REPLACE INTO moderation_log SET user_id = {$USER->user_id}, gridimage_id = {$gridimage_id}, new_status={$status}, old_status='{$image->moderation_status}',created=now(),type = 'dummy'"); print "classification {$status} recorded"; } else { echo "NOT LOGGED IN"; } } else { //we really need this not be interupted ignore_user_abort(TRUE); set_time_limit(3600); $status2 = $db->Quote($status); $db->Execute("INSERT INTO moderation_log SET user_id = {$USER->user_id}, gridimage_id = {$gridimage_id}, new_status={$status2}, old_status='{$image->moderation_status}',created=now(),type = 'real'"); $info = $image->setModerationStatus($status, $USER->user_id); echo $info; if ($status == 'rejected') { $ticket = new GridImageTroubleTicket(); $ticket->setSuggester($USER->user_id); $ticket->setModerator($USER->user_id); $ticket->setPublic('everyone'); $ticket->setImage($gridimage_id); if (!empty($_GET['comment'])) { $ticket->setNotes("Auto-generated ticket, as a result of Moderation. Rejecting this image because: " . stripslashes($_GET['comment'])); } else { $ticket->setNotes("Auto-generated ticket, as a result of Moderation. Please leave a comment to explain the reason for rejecting this image."); } $status = $ticket->commit('open'); echo " <a href=\"/editimage.php?id={$gridimage_id}\"><B>View Ticket</b></a>"; } //clear caches involving the image $smarty->clear_cache('view.tpl', "{$gridimage_id}_0_0"); $smarty->clear_cache('view.tpl', "{$gridimage_id}_0_1"); $smarty->clear_cache('view.tpl', "{$gridimage_id}_1_0");
function setCredit($realname) { global $USER; if (!$this->isValid()) { return "Invalid image"; } $db = $this->_getDB(); $db->Execute(sprintf("update gridimage set realname = %s where gridimage_id=%d", $db->Quote($realname), $this->gridimage_id)); $ticket = new GridImageTroubleTicket(); $ticket->setSuggester($USER->user_id); $ticket->setPublic('everyone'); ## dont thing any case for this to be anon, its either a mod or the owner $ticket->setImage($this->gridimage_id); #$ticket->setNotes("Credit changed to '$realname'"); $ticket->updateField("realname", $this->realname, $realname, false); $status = $ticket->commit('closed'); $this->realname = $realname; $this->updateCachedTables(); }