| Current Path : /var/www/html/components/com_jvld/models/ |
| Current File : /var/www/html/components/com_jvld/models/userprofile.php |
<?php
/**
* @version $Id$
* @package JV-LinkDirectory
* @subpackage com_jvld
* @copyright Copyright 2008-2013 JV-Extensions. All rights reserved
* @license GNU General Public License version 3 or later
* @author JV-Extensions
* @link http://www.jv-extensions.com
*/
// No direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.modellist');
class JvldModelUserprofile extends JModelList
{
protected function getListQuery()
{
$uid = JFactory::getApplication()->input->getInt('id', 0);
$langcheckq = (_JVLD_JOOMLA_MLANG) ? " and (L.language = '".JFactory::getLanguage()->getTag()."' or L.language = '*') " : "";
$u_alevels = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
$dsql = "select L.id
from #__jvld_links as L, #__jvld_catlinks as CL, #__categories as JC, #__jvld_users as U
where L.id = CL.lid
and CL.isprimary = 1
and CL.cid = JC.id".$langcheckq."
and JC.published = 1
and JC.access in (".$u_alevels.")
and L.access in (".$u_alevels.")
and L.link_status = "._JVLD_LINKSTATUS_ESTABLISHED."
and L.uid = U.id
and U.id = ".(int)$uid."
order by L.link_published_on desc";
return $dsql;
}
public function getCurrentPageNumber()
{
if ($this->getLimit() == 0)
return 0;
return ($this->getStart()/$this->getLimit()) + 1;
}
public function getStart()
{
return $this->getState('list.start');
}
public function getLimit()
{
return $this->getState('list.limit');
}
protected function getStoreId($id = '')
{
return parent::getStoreId($id);
}
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
$start_value = $app->input->get('limitstart', 0, 'int');
$this->setState('list.start', $start_value);
$limit_value = $app->input->get('limit', intval($app->get('list_limit', 0)), 'uint');
$this->setState('list.limit', $limit_value);
}
}