Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!isset($_POST['nextID']))
- {
- $entry = getEntry( getLastRecord()->getID() ); // get the last Entry from database
- }
- else
- {
- $entry = getEntry( $_POST['nextID'] ); // get the specified Entry from database
- }
- $features = $entry->getFeatArray(); // get all features for Entry
- $arraySize = count($features); // get the total # of features for Entry
- $dir = '../_images/'. $entry->getImage().'/'; // get Entry image directory
- $numOfPics = numFilesInDir( $dir , FALSE ); // get # of pics in Entry's image directory
- // build all the images for return
- for ($i=1;$i<=$numOfPics;$i++)
- {
- $return['image'.$i.''] = '<img src="../_images/'.$entry->getImage().'/'.$i.'.png" class="thumbs">';
- }
- // build all the features for return
- for ( $i=0; $i < $arraySize; $i++ )
- {
- $return['feature'.$i.''] = $features[0];
- }
- // build all other variables for return
- $return['error'] = false;
- $return['id'] = $entry->getID();
- $return['date'] = $entry->getDate();
- $return['title'] = $entry->getTitle();
- $return['subtitle'] = $entry->getSubTitle();
- $return['spotlightimage'] = '../_images/'.$entry->getImage().'/1.png';
- $retunr['image'] = $entry->getImage();
- $return['size'] = $arraySize;
- $retunr['picsize'] = $numOfPics;
- $return['description'] = $entry->getDescription();
- echo json_encode($return);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment