Advertisement
Guest User

Untitled

a guest
Apr 9th, 2014
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.03 KB | None | 0 0
  1. <?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
  2. <?php G\Render\include_theme_header(); ?>
  3.  
  4. <div class="content-width">
  5.    
  6.     <?php
  7.        
  8.         // Use CHV magic params
  9.         $list_params = CHV\Listing::getParams();
  10.        
  11.         $type = 'images';
  12.        
  13.         try {
  14.                 global $list;
  15.                 $list = new CHV\Listing;
  16.                 $list->setType($type);
  17.                 $list->setOffset($list_params['offset']);
  18.                 $list->setLimit($list_params['limit']);
  19.                 $list->setItemsPerPage($list_params['items_per_page']);
  20.                 $list->setSortType($list_params['sort'][0]);
  21.                 $list->setSortOrder($list_params['sort'][1]);
  22.                 $list->setRequester(CHV\Login::getUser());
  23.                 $list->setWhere("WHERE image_user_id=:user_id");
  24.                 $list->bind(":user_id", '1');
  25.                 $list->exec();
  26.             } catch(Exception $e) {
  27.                 G\exception_to_error($e);
  28.             }
  29.     ?>
  30.    
  31.     <div class="header header-tabs margin-bottom-10 follow-scroll">
  32.         <h1><strong><?php _se('Explore'); ?></strong></h1>
  33.         <?php
  34.             global $tabs; // Define it as a global to bind it on the included tab.php
  35.             $tabs = array(
  36.                 0 => array(
  37.                     "list"      => true,
  38.                     "tools"     => true,
  39.                     "label"     => _s('Most recent'),
  40.                     "id"        => "list-most-recent",
  41.                     "params"    => "list=images&sort=date_desc&page=1",
  42.                     "current"   => $_REQUEST["sort"] == "date_desc" or !$_REQUEST["sort"] ? true : false,
  43.                 ),
  44.                 1 => array(
  45.                     "list"      => true,
  46.                     "tools"     => true,
  47.                     "label"     => _s('Oldest'),
  48.                     "id"        => "list-most-oldest",
  49.                     "params"    => "list=images&sort=date_asc&page=1",
  50.                     "current"   => $_REQUEST["sort"] == "date_asc",
  51.                 ),
  52.                 2 => array(
  53.                     "list"      => true,
  54.                     "tools"     => true,
  55.                     "label"     => _s('Most viewed'),
  56.                     "id"        => "list-most-viewed",
  57.                     "params"    => "list=images&sort=views_desc&page=1",
  58.                     "current"   => $_REQUEST["sort"] == "views_desc",
  59.                 )
  60.             );
  61.            
  62.             $current = false;
  63.             foreach($tabs as $k => $v) {
  64.                 if($v['current']) {
  65.                     $current = true;
  66.                 }
  67.                 $tabs[$k]['type'] = 'images';
  68.                 $tabs[$k]["url"] = G\get_base_url("?" . $tabs[$k]["params"]);
  69.             }
  70.            
  71.             if(!$current) {
  72.                 $tabs[0]['current'] = true;
  73.             }
  74.            
  75.         ?>
  76.         <ul class="content-tabs" data-tabs="content-listing-tabs">
  77.             <?php G\Render\include_theme_file("snippets/tabs"); ?>
  78.         </ul>
  79.        
  80.         <?php
  81.             if(is_admin()) {
  82.                 global $user_items_editor;
  83.                 $user_items_editor = false;
  84.                 G\Render\include_theme_file("snippets/user_items_editor");
  85.         ?>
  86.         <div class="header-content-right">
  87.             <?php G\Render\include_theme_file("snippets/listing_tools_editor"); ?>
  88.         </div>
  89.         <?php
  90.             }
  91.         ?>
  92.        
  93.     </div>
  94.    
  95.     <div id="content-listing-tabs" class="tabbed-listing">
  96.         <?php
  97.             G\Render\include_theme_file("snippets/listing");
  98.         ?>
  99.     </div>
  100.    
  101. </div>
  102. <style>
  103. #anywhere-upload {
  104.     z-index: 100;
  105.     scroll: auto;
  106.     position: absolute;
  107.     display: block;
  108. }
  109.  
  110. body{
  111. margin-top: 300px;
  112. }
  113.  
  114. .upload-box-close {
  115. display: none;
  116. }
  117.  
  118. #top-bar-upload {
  119. display: none;
  120. }
  121. </style>
  122. <?php G\Render\include_theme_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement