public function gallery($page = 1)
 {
     $page_details = array('pageURL' => '/gallery/' . $page);
     $current_page_details = Common::setPageDetails($page_details);
     $page = intval($page) < 1 ? 1 : intval($page);
     $input = count($_GET) ? Common::formXssClean() : array();
     $input['search'] = isset($input['search']) ? preg_replace('/[^\\p{L}\\-_ 0-9]+/u', '', $input['search']) : '';
     $input['filter'] = isset($input['filter']) && in_array($input['filter'], array('winners', 'all')) ? $input['filter'] : 'all';
     $gallery = Gallery::get_gallery($page, $input['search'], $input['filter'] == 'winners');
     $total_pages = Gallery::get_total_pages($input['search'], $input['filter'] == 'winners');
     return View::make('layouts/default')->with('template', 'gallery')->with('gallery', $gallery)->with('total_pages', $total_pages)->with('input', $input)->with('page', $page)->with('page_details', $current_page_details);
 }
示例#2
0
<?php

include 'includes/inc.php';
include "includes/classes/class.gallery.php";
$gallery = new Gallery();
$arr = NULL;
$data = NULL;
//print_r($_SESSION); exit;
if (isset($_GET['act']) && isset($_GET['id'])) {
    $data = $gallery->get_gallery($_GET['id'], $_SESSION['user_id']);
    $data['gallery_path'] = '../../admin/images/gallery/' . $data['customer_id'] . '/' . $_GET['id'] . '/';
    /*echo '<pre>';
    		print_r($data);
    		exit;*/
}
if (isset($_POST['AddGallery'])) {
    $arr['customer_id'] = $_SESSION['user_id'];
    $arr['customer_name'] = $_SESSION['username'];
    $arr['customer_gallery_name'] = $_POST['customer_gallery_name'];
    // print_r($arr); exit;
    if (isset($_POST['gallery_id']) && $_POST['gallery_id'] != '') {
        $temp_dir_name = $_POST['gallery_id'];
    } else {
        $temp_dir_name = "temp";
    }
    //echo $temp_dir_name; exit;
    $new_path = $album_path . '/' . $temp_dir_name;
    //echo $new_path;
    if (!is_dir($new_path)) {
        mkdir($new_path, 0777);
        chmod($new_path, 0777);