$RenderPath = FSPATH."cg_render/{$Appearance['id']}.png"; $FileModTime = '?t='.(file_exists($RenderPath) ? filemtime($RenderPath) : time()); ?> <div id="p<?=$Appearance['id']?>"> <div class='align-center'> <a class='darkblue btn typcn typcn-image' href='/cg/v/<?="{$Appearance['id']}.png$FileModTime"?>' target='_blank'>View as PNG</a> <button class='getswatch typcn typcn-brush teal'>Download swatch file</button> <? if (Permission::sufficient('staff')){ ?> <button class='blue edit typcn typcn-pencil'>Edit metadata</button> <?php if ($Appearance['id']){ ?> <button class='red delete typcn typcn-trash'>Delete apperance</button> <?php } } ?> </div> <? if (!empty($Changes)) echo str_replace('@',CGUtils::getChangesHTML($Changes),CGUtils::CHANGES_SECTION); if ($Appearance['id'] !== 0 && ($CGDb->where('ponyid',$Appearance['id'])->has('tagged') || Permission::sufficient('staff'))){ ?> <section id="tags"> <h2><span class='typcn typcn-tags'></span>Tags</h2> <div class='tags'><?=Appearances::getTagsHTML($Appearance['id'],NOWRAP)?></div> </section> <?php } echo Appearances::getRelatedEpisodesHTML($Appearance, $EQG); if (!empty($Appearance['notes'])){ ?> <section> <h2><span class='typcn typcn-info-large'></span>Additional notes</h2> <p id="notes"><?=Appearances::getNotesHTML($Appearance, NOWRAP, NOTE_TEXT_ONLY)?></p> </section> <? }
if ($EpisodeChanged) { $TagName = CGUtils::checkEpisodeTagName("movie#{$insert['episode']}"); $MovieTag = $CGDb->where('name', $editing ? "movie#{$Episode->episode}" : $TagName)->getOne('tags', 'tid'); if (!empty($MovieTag)) { if ($editing) { $CGDb->where('tid', $MovieTag['tid'])->update('tags', array('name' => $TagName)); } } else { if (!$CGDb->insert('tags', array('name' => $TagName, 'type' => 'ep'))) { Response::dbError('Episode tag creation failed'); } } } } else { if ($SeasonChanged || $EpisodeChanged) { $TagName = CGUtils::checkEpisodeTagName("s{$insert['season']}e{$insert['episode']}"); $EpTag = $CGDb->where('name', $editing ? "s{$Episode->season}e{$Episode->episode}" : $TagName)->getOne('tags', 'tid'); if (!empty($EpTag)) { if ($editing) { $CGDb->where('tid', $EpTag['tid'])->update('tags', array('name' => $TagName)); } } else { if (!$CGDb->insert('tags', array('name' => $TagName, 'type' => 'ep'))) { Response::dbError('Episode tag creation failed'); } } } } } if ($editing) { $logentry = array('target' => $Episode->formatTitle(AS_ARRAY, 'id'));
use App\Tags; /** @var $heading string */ /** @var $Changes array */ ?> <div id="content"> <h1><?php echo $heading; ?> </h1> <p>Displaying <?php echo $Pagination->itemsPerPage; ?> items/page</p> <p class='align-center links'> <a class='btn darkblue typcn typcn-arrow-back' href="/cg">Back to <?php echo $Color; ?> Guide</a> <a class='btn darkblue typcn typcn-tags' href="/cg/tags">List of tags</a> </p> <?php echo $Pagination->HTML . CGUtils::getChangesHTML($Changes, WRAP, SHOW_APPEARANCE_NAMES) . $Pagination->HTML; ?> </div> <? echo CoreUtils::exportVars(array( 'Color' => $Color, 'color' => $color, 'TAG_TYPES_ASSOC' => Tags::$TAG_TYPES_ASSOC, ));
$multiMatch = new ElasticsearchDSL\Query\MultiMatchQuery(['label^20', 'tags'], $SearchQuery, ['type' => 'cross_fields', 'minimum_should_match' => '100%']); $search->addQuery($multiMatch); } } else { $sort = new ElasticsearchDSL\Sort\FieldSort('order', 'asc'); $search->addSort($sort); } $boolquery = new BoolQuery(); if (Permission::insufficient('staff')) { $boolquery->add(new TermQuery('private', true), BoolQuery::MUST_NOT); } $boolquery->add(new TermQuery('ishuman', $EQG), BoolQuery::MUST); $search->addQuery($boolquery); $search->setSource(false); $search = $search->toArray(); $search = CGUtils::searchElastic($search, $Pagination); $Pagination->calcMaxPages($search['hits']['total']); if (!empty($search['hits']['hits'])) { $ids = []; foreach ($search['hits']['hits'] as $hit) { $ids[] = $hit['_id']; } $Ponies = $CGDb->where('id IN (' . implode(',', $ids) . ')')->orderBy('order', 'ASC')->get('appearances'); } } if (!$elasticAvail) { $_EntryCount = $CGDb->where('ishuman', $EQG)->where('id != 0')->count('appearances'); $Pagination = new Pagination('cg', $AppearancesPerPage, $_EntryCount); $Ponies = Appearances::get($EQG, $Pagination->getLimit()); } if (isset($_REQUEST['GOFAST'])) {
<?php } ?> <a class='btn blue typcn typcn-world' href="/cg<?php echo $EQG ? '' : '/eqg'; ?> /full">List of <?php echo $EQG ? 'Ponies' : 'Equestria Girls'; ?> </a> <a class='btn darkblue typcn typcn-tags' href="/cg/tags">Tags</a> <a class='btn darkblue typcn typcn-warning' href="/cg/changes">Major Changes</a> </p> <?php echo CGUtils::getFullListHTML($Appearances, $GuideOrder); ?> </div> <? $export = array( 'Color' => $Color, 'color' => $color, 'EQG' => $EQG, ); if (Permission::sufficient('staff')) $export = array_merge($export,array( 'TAG_TYPES_ASSOC' => Tags::$TAG_TYPES_ASSOC, 'MAX_SIZE' => CoreUtils::getMaxUploadSize(), 'HEX_COLOR_PATTERN' => $HEX_COLOR_REGEX, )); echo CoreUtils::exportVars($export);