예제 #1
0
 /**
  * Switch for the main page, when not handled by rsgOption
  */
 function mainPage()
 {
     global $rsgConfig;
     $page = rsgInstance::getWord('page', '');
     switch ($page) {
         case 'slideshow':
             $gallery = rsgGalleryManager::get();
             rsgInstance::instance(array('rsgTemplate' => $rsgConfig->get('current_slideshow'), 'gid' => $gallery->id));
             break;
         case 'inline':
             $this->inline();
             break;
         case 'viewChangelog':
             $this->viewChangelog();
             break;
         case 'test':
             $this->test();
             break;
         default:
             $this->showMainGalleries();
             $this->showThumbs();
     }
 }
예제 #2
0
 /**
  *  returns an array of item db rows
  * @todo image listing should be based on what the current visitor can see (owner, administrator, un/published, etc.)
  */
 function itemRows()
 {
     if ($this->_itemRows === null) {
         global $rsgConfig;
         $my =& JFactory::getUser();
         $database =& JFactory::getDBO();
         $filter_order = rsgInstance::getWord('filter_order', $rsgConfig->get("filter_order"));
         $filter_order_Dir = rsgInstance::getWord('filter_order_Dir', $rsgConfig->get("filter_order_Dir"));
         $where = ' WHERE gallery_id = ' . $this->get('id');
         if ($my->get('gid') != 25) {
             $where .= ' AND published = 1 ';
         }
         $orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir;
         $query = ' SELECT * FROM #__rsgallery2_files ' . $where . $orderby;
         // limit handling was borked but I had this fixed.  we can use it again....
         $database->setQuery($query);
         //, $limitstart, $limit );
         $this->_itemRows = $database->loadAssocList('id');
     }
     return $this->_itemRows;
 }