| Server IP : 180.180.241.3 / Your IP : 216.73.216.216 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/news/administrator/components/com_youtubegallery/views/videolist/ |
Upload File : |
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla view library
jimport('joomla.application.component.view');
/**
* YoutubeGallery VideoList View
*/
class YoutubeGalleryViewVideoList extends JView
{
function display($tpl = null)
{
global $mainframe;
JToolBarHelper::title(JText::_('YouTube Gallery - Videos Found'), 'generic.png');
JToolBarHelper::cancel( 'cancel', 'Close' );
JRequest::setVar('hidemainmenu', 1);
$db = & JFactory::getDBO();
$context = 'com_youtubegallery.videolist.';
$filter_order = $mainframe->getUserStateFromRequest( $context.'filter_order', 'filter_order', 's.id', 'cmd' );
$filter_order_Dir = $mainframe->getUserStateFromRequest( $context.'filter_order_Dir', 'filter_order_Dir', '', 'word' );
$search = $mainframe->getUserStateFromRequest( $context.'search', 'search', '', 'string' );
$limit = $mainframe->getUserStateFromRequest( $context.'limit', 'limit', $mainframe->getCfg('list_limit'), 'int' );
$limitstart = $mainframe->getUserStateFromRequest( $context.'limitstart', 'limitstart', 0, 'int' );
$where = array();
$where[]='`listid`='.JRequest::getInt( 'listid');
//$where[]='`isvideo`';
if ($search)
{
$where[] = 'LOWER(s.title) LIKE '.$db->Quote( '%'.$db->getEscaped($search,true).'%', false );
}
$where = count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '';
$query = 'SELECT COUNT(*)'
. ' FROM #__youtubegallery_videos AS v '
. $where
;
$db->setQuery( $query );
if (!$db->query()) echo ( $db->stderr());
$total = $db->loadResult();
$orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir ;
jimport('joomla.html.pagination');
$pageNav = new JPagination( $total, $limitstart, $limit );
$query = 'SELECT s.* FROM #__youtubegallery_videos AS s '
. $where
. $orderby
;
$db->setQuery($query, $pageNav->limitstart, $pageNav->limit );
if (!$db->query()) echo ( $db->stderr());
$rows = $db->loadObjectList();
if(!isset($rows))
{
$rows=array();
}
foreach($rows as $r)
$r->checked_out='';
$javascript = 'onchange="document.adminForm.submit();"';
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// search filter
$lists['search']= $search;
$this->assignRef('items', $rows);
$this->assignRef('pagination', $pageNav);
$this->assignRef('lists', $lists);
parent::display($tpl);
}
/*
function display($tpl = null)
{
// Get data from the model
$items = $this->get('Items');
$pagination = $this->get('Pagination');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// Assign data to the view
$this->items = $items;
$this->pagination = $pagination;
//$script = $this->get('Script');
// Set the toolbar
$this->addToolBar();
$context= '';//com_youtubegallery.videoylist.';
$mainframe = JFactory::getApplication();
$search = $mainframe->getUserStateFromRequest($context."search",'search','', 'string' );
$search = JString::strtolower( $search );
$lists['search']=$search;
$this->assignRef('lists', $lists);
// Display the template
parent::display($tpl);
}
*/
/**
* Setting the toolbar
*/
/*
protected function addToolBar()
{
JRequest::setVar('hidemainmenu', true);
JToolBarHelper::title(JText::_('COM_YOUTUBEGALLERY_VIDEO_LIST'));
JToolBarHelper::cancel('videolist.cancel', 'JTOOLBAR_CLOSE');
}
*/
}