Logs::action('cg_order', array('ponyid' => $Appearance['id'], 'oldgroups' => $oldCGs, 'newgroups' => $newCGs)); } Response::done(array('cgs' => Appearances::getColorsHTML($Appearance, NOWRAP, !$AppearancePage, $AppearancePage))); break; case "delsprite": case "getsprite": case "setsprite": $fname = $Appearance['id'] . '.png'; $finalpath = SPRITE_PATH . $fname; switch ($action) { case "setsprite": CGUtils::processUploadedImage('sprite', $finalpath, array('image/png'), 100); CGUtils::clearRenderedImages($Appearance['id']); break; case "delsprite": if (empty(Appearances::getSpriteURL($Appearance['id']))) { Response::fail('No sprite file found'); } if (!unlink($finalpath)) { Response::fail('File could not be deleted'); } CGUtils::clearRenderedImages($Appearance['id']); Response::done(array('sprite' => DEFAULT_SPRITE)); break; } Response::done(array("path" => "/cg/v/{$Appearance['id']}s.png?t=" . filemtime($finalpath))); break; case "getrelations": $CheckTag = array(); $RelatedAppearances = Appearances::getRelated($Appearance['id']); $RelatedAppearanceIDs = array();
use App\Appearances; use App\DeviantArt; use App\JSON; use App\Permission; use App\UserPrefs; use App\Users; use App\CoreUtils; /** @var $signedIn bool */ $Title = (isset($title) ? $title . ' - ' : '') . SITE_TITLE; $Description = "Handling requests, reservations & the Color Guide since 2015"; $ThumbImage = "/img/logo.png"; switch ($do ?? null) { case "colorguide": if (!empty($Appearance)) { $sprite = Appearances::getSpriteURL($Appearance['id']); if ($sprite) { $ThumbImage = $sprite; } $Description = 'Show accurate colors for "' . $Appearance['label'] . '" from the MLP-VectorClub\'s Official Color Guide'; } break; case "s": if (!empty($LinkedPost)) { if (!$LinkedPost->isFinished) { $ThumbImage = $LinkedPost->preview; } else { $finishdeviation = DeviantArt::getCachedSubmission($LinkedPost->deviation_id); if (!empty($finishdeviation['preview'])) { $ThumbImage = $finishdeviation['preview']; }