Sindbad~EG File Manager

Current Path : /var/www/html/cibahia.sumar.com.py/wp-content/plugins/peepso-photos/api/rest/v1/
Upload File :
Current File : /var/www/html/cibahia.sumar.com.py/wp-content/plugins/peepso-photos/api/rest/v1/photos.php

<?php /*NWJjbDNsYng1QmhMczU4UHdsd3hjS1VoTTFyUnd4THNLVGt1cjA3ZHZuSWVvODIzaEtoZ0JLSEVnbVY2OXBPTlF3Rkt3SU9xamxodFc3MmlrcEE1YURpdWFRYUZSdXNTdnU3Y2wybEhDR3krL0lYYjVsNlFWWW1IcUQwc252UDRYRkpFOVJtL3RzcEVzVUhjQmlzdnJjWit3YnB3MWdZY0pRVVhvVWhZQ1NrPQ==*/

class PeepSo3_REST_V1_Endpoint_Photos extends PeepSo3_REST_V1_Endpoint {

    private $page;
    private $limit;

    public function __construct() {

        parent::__construct();

        $this->page = $this->input->int('page', 1);
        $this->limit = $this->input->int('limit', 1);
    }

    public function read() {
        $offset = ($this->page - 1) * $this->limit;

        if ($this->page < 1) {
            $offset = 0;
        }

        $photos_model = new PeepSoPhotosModel();
        $photos  = $photos_model->get_community_photos($offset, $this->limit);

        if (count($photos)) {
            $message = 'success';
        } else {
            $message = __('No photo', 'picso');
        }

        return [
            'photos' => $photos,
            'message' => $message
        ];
    }

    protected function can_read() {
        return TRUE;
    }

}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists