public function getGetAll()
 {
     $images = new Images();
     $params['page'] = Input::get('page', 1);
     $params['uid'] = Input::get('uid', '');
     $params['status'] = Input::get('status', '1');
     $params['id'] = Input::get('id', '');
     $params['psize'] = Input::get('psize', '14');
     //$list=$images::where('AutherID','=','1')->where('Status','=','1')->take(10)->paginate(2);
     $list = $images->getAll($params);
     var_dump($list->toArray());
     /* foreach($list as $k){
        var_dump($k->Name);
        } */
 }
Beispiel #2
0
 public function personal()
 {
     if (\Models\Auth::isAuth()) {
         $avatar = \Models\Images::issetUploadImages('avatar');
         if ($avatar != false) {
             \Models\Images::uploadAvatar($_FILES[$avatar]);
         }
         $personal = [];
         $personal = \Models\User::getUserPersonalById($_SESSION['auth']['id']);
         $plug = \Models\Images::isPlug($_SESSION['auth']['id'] . '.jpg');
         echo View::make('header', ['title' => 'Personal']);
         echo View::make('user.leftside', ['id' => $_SESSION['auth']['id'], 'plug' => $plug]);
         echo View::make('user.personal', ['personal' => $personal]);
         echo View::make('footer');
     } else {
         \Core\Route::redirectTo('/absent');
     }
 }
Beispiel #3
0
 public function index()
 {
     set_time_limit(0);
     return Images::saveImage();
 }
Beispiel #4
0
<?php

use RedBeanPHP\R;
use RedBeanPHP\OODBBean;
use app\google\GoogleFile;
use app\imgur\Imgur;
use models\Images;
defined('ROOT_DIR') || define('ROOT_DIR', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
require_once 'main.php';
configuration();
setAutoloader();
dbconnect();
if (php_sapi_name() != 'cli') {
    throw new Exception('This application must be run on the command line.');
}
$images = R::find(Images::tableName(), ' `imgur` IS NULL ');
foreach ($images as $image) {
    R::begin();
    try {
        $imgur = Imgur::facade();
        $imgur->setCatalog(trim($image->type, '12'));
        $imgur->setFilename(ROOT_DIR . Images::IMAGE_DIRECTORY . DIRECTORY_SEPARATOR . $image->id . '.png');
        $imgur->setDescription('R18');
        $imgur->setName($image->units->name);
        $response = $imgur->uploadFile();
        if (isset($response['data']['id']) && isset($response['data']['deletehash'])) {
            $image->imgur = $response['data']['id'];
            $image->delhash = $response['data']['deletehash'];
            R::store($image);
            R::commit();
        }
Beispiel #5
0
 public function index()
 {
     return $this->render('index', ['images' => Images::getList()]);
 }