function dashboard() { if ($this->User->isLoggedIn()) { $this->load->model('Photo'); $this->load->model('Video'); $data['photos'] = $this->Photo->get_last(3); $data['videos'] = $this->Video->get_nb(3); thumbnail_or_image($data['videos']); $this->layout->view('admin/admin', $data); } }
public function view($id) { $player = null; $this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file')); if ($this->cache->apc->is_supported()) { if ($_data = $this->cache->apc->get('VIDEO_PLAYER_' . $id)) { $player = $_data; } } $data['video'] = $this->Video->get_video($id); thumbnail_or_image($data['video']); if (empty($player)) { $data['player'] = video_player($data['video']); $this->cache->apc->save('VIDEO_PLAYER_' . $id, $data['player'], 1339200); } else { $data['player'] = $player; } $this->layout->view('videos/view', $data); }
public function view($page = 'home', $offset = 0) { if (!file_exists('application/views/pages/' . $page . '.php')) { show_404(); } $data = array(); if ($page == 'home') { $this->load->model('Video'); $this->load->helper('videos'); $data['i'] = 0; $data['j'] = 0; $data['v'] = 0; $data['headers'] = $this->Video->get_for_header(); thumbnail_or_image($data['headers']); $data['videos'] = $this->Video->get_all(); thumbnail_or_image($data['videos']); //Pagination $this->load->library('pagination'); $config['base_url'] = site_url('home'); $config['total_rows'] = count($data['videos']); $config['per_page'] = 9; $this->pagination->initialize($config); $data["pagination"] = $this->pagination->create_links(); $data["videos"] = array_slice($data["videos"], $offset, $config['per_page']); $this->layout->js('assets/js/jquery.quicksand.js'); } else { if ($page == 'about') { $this->load->model('Site_model'); $data['about'] = $this->Site_model->view(1); } } $this->layout->title("Séverine Lenglet : " . ucfirst($page)); if ($page == 'home') { $this->layout->view(array("pages/home", "videos/index"), $data); } else { $this->layout->view("pages/" . $page, $data); } }
function index() { $data['videos'] = $this->Video->get_all($admin = true); thumbnail_or_image($data['videos']); $this->layout->view('admin/videos/index', $data); }