File manager - Edit - /home/ferretapmx/public_html/models.zip
Back
PK ��\�i�-� � albums.phpnu �[��� <?php /** * @package com_speasyimagegallery * @author JoomShaper http://www.joomshaper.com * @copyright Copyright (c) 2010 - 2025 JoomShaper * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later */ use Joomla\CMS\Factory; use Joomla\CMS\MVC\Model\ListModel; // No direct access to this file defined('_JEXEC') or die('Restricted access'); class SpeasyimagegalleryModelAlbums extends ListModel { protected function populateState($ordering = null, $direction = null) { $app = Factory::getApplication('site'); $params = $app->getParams(); $this->setState('list.start', $app->input->get('limitstart', 0, 'uint')); $limit = $params->get('limit', 20); $this->setState('list.limit', $limit); // Store featured flag from menu/module params $showFeaturedOnly = (int) $params->get('show_featured_only', 0); $this->setState('filter.featured', $showFeaturedOnly); } protected function getListQuery() { $app = Factory::getApplication(); $user = Factory::getUser(); $catid = $app->input->get('catid', 0, 'INT'); // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select the required fields from the table. $query->select('a.*'); $query->from($db->quoteName('#__speasyimagegallery_albums', 'a')); // Join over the categories. $query->select('c.title AS category_title, c.alias AS category_alias') ->join('LEFT', '#__categories AS c ON c.id = a.catid'); // Images count $query->select('CASE WHEN c.count IS NULL THEN 0 ELSE c.count END as count')->join('LEFT', '( SELECT b.album_id, COUNT(b.album_id) as count FROM '. $db->quoteName('#__speasyimagegallery_images', 'b') . ' WHERE b.state = 1 GROUP BY b.album_id ) AS c ON c.album_id = a.id'); //Authorised $groups = implode(',', $user->getAuthorisedViewLevels()); $query->where('a.access IN (' . $groups . ')'); // Filter category if($catid) { $descendants = implode(',',$this->getCatChild($catid)); $query->where('a.catid IN ( ' . $descendants . ')'); // Get in all the descendants } // Filter by featured if ((int) $this->getState('filter.featured', 0)) { $query->where('a.featured = 1'); } // Filter by language $query->where('a.language in (' . $db->quote(Factory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); $query->where('a.published = 1'); $query->order('a.ordering ASC'); return $query; } // Get category child ids public function getCatChild($id) { $children = []; $ids[] = $id; while(!empty($ids)) { $cid = array_pop($ids); $children[] = (string)$cid; $categories = $this->getCategories($cid); if(!empty($categories)) { foreach($categories as $cat) { $ids[] = $cat; } } } return $children; } //Get cat ids public function getCategories($catid) { $cats = []; $result = array(); $db = $this->getDbo(); $query = $db->getQuery(true); $query->select('a.id as cid'); $query->from($db->quoteName('#__categories', 'a')); $query->where($db->quoteName('extension') . ' = ' . $db->quote('com_speasyimagegallery')); $query->where('a.parent_id = '. $catid); $db->setQuery($query); $cats = $db->loadObjectList(); foreach ($cats as $cat) { $result[] = $cat->cid; } return $result; } }PK ��\98_� � album.phpnu �[��� <?php /** * @package com_speasyimagegallery * @author JoomShaper http://www.joomshaper.com * @copyright Copyright (c) 2010 - 2025 JoomShaper * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Factory; use Joomla\CMS\Table\Table; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\ItemModel; use Joomla\CMS\Language\Multilanguage; use Joomla\Database\DatabaseInterface; class SpeasyimagegalleryModelAlbum extends ItemModel { protected $_context = 'com_speasyimagegallery.album'; protected function populateState() { $app = Factory::getApplication('site'); $albumId = $app->input->getInt('id'); $this->setState('album.id', $albumId); $this->setState('filter.language', Multilanguage::isEnabled()); } public function getItem( $albumId = null ) { $user = Factory::getApplication()->getIdentity(); $albumId = (!empty($albumId))? $albumId : (int)$this->getState('album.id'); if ( $this->_item == null ) { $this->_item = array(); } if (!isset($this->_item[$albumId])) { try { $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('a.*') ->from('#__speasyimagegallery_albums as a') ->where('a.id = ' . (int) $albumId); $query->select('l.title AS language_title') ->leftJoin( $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language'); $query->select('ua.name AS author_name') ->leftJoin('#__users AS ua ON ua.id = a.created_by'); // Filter by published state. $query->where('a.published = 1'); if ($this->getState('filter.language')) { $query->where('a.language in (' . $db->quote(Factory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); } $db->setQuery($query); $data = $db->loadObject(); if(isset($data->id) && $data->id) { $data->images = $this->getImages($data->id); } if (empty($data)) { return new \Exception(Text::_('COM_SPEASYIMAGEGALLERY_ERROR_ALBUM_NOT_FOUND'), 404); } // Check the access level. $groups = $user->getAuthorisedViewLevels(); if(!in_array($data->access, $groups)) { return new \Exception(Text::_('COM_SPEASYIMAGEGALLERY_ERROR_ALBUM_NOT_AUTHORISED'), 404); } $this->_item[$albumId] = $data; } catch (Exception $e) { if ($e->getCode() == 404 ) { throw new Exception($e->getMessage(), 404); } else { $this->setError($e); $this->_item[$albumId] = false; } } } return $this->_item[$albumId]; } public function getImages($album_id) { $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true); $query->select(array('a.*')); $query->from($db->quoteName('#__speasyimagegallery_images', 'a')); $query->where($db->quoteName('album_id') . ' = '. $db->quote($album_id)); $query->where($db->quoteName('state') . ' = '. $db->quote(1)); $query->order('a.ordering DESC'); $db->setQuery($query); return $db->loadObjectList(); } public function hit($pk = 0) { $pk = (!empty($pk)) ? $pk : (int) $this->getState('album.id'); $table = Table::getInstance('Album', 'SpeasyimagegalleryTable'); $table->load($pk); $table->hit($pk); return true; } } PK ��\�Sʉ� � .htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK � �\��]�� � searches.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_search * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Methods supporting a list of search terms. * * @since 1.6 */ class SearchModelSearches extends JModelList { /** * Constructor. * * @param array $config An optional associative array of configuration settings. * * @see JController * @since 1.6 */ public function __construct($config = array()) { if (empty($config['filter_fields'])) { $config['filter_fields'] = array( 'search_term', 'a.search_term', 'hits', 'a.hits', ); } parent::__construct($config); } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering An optional ordering field. * @param string $direction An optional direction (asc|desc). * * @return void * * @since 1.6 */ protected function populateState($ordering = 'a.hits', $direction = 'asc') { // Load the filter state. $this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string')); // Special state for toggle results button. $this->setState('show_results', $this->getUserStateFromRequest($this->context . '.show_results', 'show_results', 1, 'int')); // Load the parameters. $params = JComponentHelper::getParams('com_search'); $this->setState('params', $params); // List state information. parent::populateState($ordering, $direction); } /** * Method to get a store id based on model configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string $id A prefix for the store id. * * @return string A store id. * * @since 1.6 */ protected function getStoreId($id = '') { // Compile the store id. $id .= ':' . $this->getState('show_results'); $id .= ':' . $this->getState('filter.search'); return parent::getStoreId($id); } /** * Build an SQL query to load the list data. * * @return JDatabaseQuery * * @since 1.6 */ protected function getListQuery() { // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select the required fields from the table. $query->select( $this->getState( 'list.select', 'a.*' ) ); $query->from($db->quoteName('#__core_log_searches', 'a')); // Filter by search in title if ($search = $this->getState('filter.search')) { $search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%')); $query->where($db->quoteName('a.search_term') . ' LIKE ' . $search); } // Add the list ordering clause. $query->order($db->escape($this->getState('list.ordering', 'a.hits')) . ' ' . $db->escape($this->getState('list.direction', 'ASC'))); return $query; } /** * Override the parent getItems to inject optional data. * * @return mixed An array of objects on success, false on failure. * * @since 1.6 */ public function getItems() { $items = parent::getItems(); // Determine if number of results for search item should be calculated // by default it is `off` as it is highly query intensive if ($this->getState('show_results')) { JPluginHelper::importPlugin('search'); $app = JFactory::getApplication(); if (!class_exists('JSite')) { // This fools the routers in the search plugins into thinking it's in the frontend JLoader::register('JSite', JPATH_ADMINISTRATOR . '/components/com_search/helpers/site.php'); } foreach ($items as &$item) { $results = $app->triggerEvent('onContentSearch', array($item->search_term)); $item->returns = 0; foreach ($results as $result) { $item->returns += count($result); } } } return $items; } /** * Method to reset the search log table. * * @return boolean * * @since 1.6 */ public function reset() { $db = $this->getDbo(); $query = $db->getQuery(true) ->delete($db->quoteName('#__core_log_searches')); $db->setQuery($query); try { $db->execute(); } catch (RuntimeException $e) { $this->setError($e->getMessage()); return false; } return true; } } PK � �\*ah�v v forms/filter_searches.xmlnu �[��� <?xml version="1.0" encoding="utf-8"?> <form> <fields name="filter"> <field name="search" type="text" inputmode="search" label="COM_SEARCH_SEARCH_IN_PHRASE" description="COM_SEARCH_SEARCH_IN_PHRASE" hint="JSEARCH_FILTER" /> </fields> <fields name="list"> <field name="fullordering" type="list" onchange="this.form.submit();" default="a.hits ASC" validate="options" > <option value="">JGLOBAL_SORT_BY</option> <option value="a.search_term ASC">COM_SEARCH_HEADING_SEARCH_TERM_ASC</option> <option value="a.search_term DESC">COM_SEARCH_HEADING_SEARCH_TERM_DESC</option> <option value="a.hits ASC">JGLOBAL_HITS_ASC</option> <option value="a.hits DESC">JGLOBAL_HITS_DESC</option> </field> <field name="limit" type="limitbox" class="input-mini" default="25" onchange="this.form.submit();" /> </fields> </form> PK � �\�Sʉ� � forms/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK ��\�i�-� � albums.phpnu �[��� PK ��\98_� � � album.phpnu �[��� PK ��\�Sʉ� � .htaccessnu �7��m PK � �\��]�� � E searches.phpnu �[��� PK � �\*ah�v v )- forms/filter_searches.xmlnu �[��� PK � �\�Sʉ� � �0 forms/.htaccessnu �7��m PK � 2
| ver. 1.4 |
Github
|
.
| PHP 8.2.32 | Generation time: 0.07 |
proxy
|
phpinfo
|
Settings