Created
July 25, 2017 02:17
-
-
Save atsu666/2bfa510b33751d55d44f58bcc27c8777 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ACMS_User_POST_Api_GetEntries extends ACMS_POST | |
{ | |
function post() | |
{ | |
$eids = $this->Post->get('entry_ids'); | |
$eids = explode(',', $eids); | |
if ( !is_array($eids) ) { | |
return false; | |
} | |
$DB = DB::singleton(dsn()); | |
$SQL = SQL::newSelect('entry'); | |
ACMS_Filter::entrySession($SQL); | |
$SQL->addWhereIn('entry_id', $eids); | |
$SQL->setFieldOrder('entry_id', $eids); | |
$all = $DB->query($SQL->get(dsn()), 'all'); | |
$items = array(); | |
foreach ( $all as $item ) { | |
$eid = $item['entry_id']; | |
$field = loadEntryField($eid); | |
$items[] = array( | |
'title' => $item['entry_title'], | |
'link' => acmsLink(array( | |
'eid' => $item['entry_id'], | |
)), | |
'image' => $field->get('bookCover_url'), | |
); | |
} | |
$json = json_encode(array( | |
"items" => $items | |
)); | |
die($json); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment