0byt3m1n1-V2
Path:
/
home
/
a
/
c
/
a
/
academiac
/
www
/
[
Home
]
File: mod_articles_popular.tar
mod_articles_popular.php 0000666 00000001126 15137201465 0011474 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage mod_articles_popular * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // no direct access defined('_JEXEC') or die; // Include the syndicate functions only once require_once dirname(__FILE__).'/helper.php'; $list = modArticlesPopularHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_articles_popular', $params->get('layout', 'default')); mod_articles_popular.xml 0000666 00000005400 15137201465 0011504 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension type="module" version="2.5" client="site" method="upgrade"> <name>mod_articles_popular</name> <author>Joomla! Project</author> <creationDate>July 2006</creationDate> <copyright>Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>2.5.0</version> <description>MOD_POPULAR_XML_DESCRIPTION</description> <files> <filename module="mod_articles_popular">mod_articles_popular.php</filename> <folder>tmpl</folder> <filename>helper.php</filename> <filename>index.html</filename> <filename>mod_articles_popular.xml</filename> </files> <languages> <language tag="en-GB">en-GB.mod_articles_popular.ini</language> <language tag="en-GB">en-GB.mod_articles_popular.sys.ini</language> </languages> <help key="JHELP_EXTENSIONS_MODULE_MANAGER_MOST_READ" /> <config> <fields name="params"> <fieldset name="basic"> <field name="catid" type="category" extension="com_content" multiple="true" size="10" default="" label="JCATEGORY" description="MOD_POPULAR_FIELD_CATEGORY_DESC" > <option value="">JOPTION_ALL_CATEGORIES</option> </field> <field name="count" type="text" default="5" label="MOD_POPULAR_FIELD_COUNT_LABEL" description="MOD_POPULAR_FIELD_COUNT_DESC" /> <field name="show_front" type="radio" default="1" label="MOD_POPULAR_FIELD_FEATURED_LABEL" description="MOD_POPULAR_FIELD_FEATURED_DESC"> <option value="1">JSHOW</option> <option value="0">JHIDE</option> </field> </fieldset> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" /> <field name="moduleclass_sfx" type="text" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> <field name="cache" type="list" default="1" label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC"> <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="text" default="900" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" /> <field name="cachemode" type="hidden" default="static"> <option value="static"></option> </field> </fieldset> </fields> </config> </extension> index.html 0000666 00000000037 15137201465 0006551 0 ustar 00 <!DOCTYPE html><title></title> helper.php 0000666 00000004141 15137201465 0006544 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage mod_articles_popular * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once JPATH_SITE.'/components/com_content/helpers/route.php'; JModelLegacy::addIncludePath(JPATH_SITE.'/components/com_content/models', 'ContentModel'); abstract class modArticlesPopularHelper { public static function getList(&$params) { // Get an instance of the generic articles model $model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set application parameters in model $app = JFactory::getApplication(); $appParams = $app->getParams(); $model->setState('params', $appParams); // Set the filters based on the module params $model->setState('list.start', 0); $model->setState('list.limit', (int) $params->get('count', 5)); $model->setState('filter.published', 1); $model->setState('filter.featured', $params->get('show_front', 1) == 1 ? 'show' : 'hide'); // Access filter $access = !JComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id')); $model->setState('filter.access', $access); // Category filter $model->setState('filter.category_id', $params->get('catid', array())); // Filter by language $model->setState('filter.language', $app->getLanguageFilter()); // Ordering $model->setState('list.ordering', 'a.hits'); $model->setState('list.direction', 'DESC'); $items = $model->getItems(); foreach ($items as &$item) { $item->slug = $item->id.':'.$item->alias; $item->catslug = $item->catid.':'.$item->category_alias; if ($access || in_array($item->access, $authorised)) { // We know that user has the privilege to view the article $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->language)); } else { $item->link = JRoute::_('index.php?option=com_users&view=login'); } } return $items; } } tmpl/default.php 0000666 00000000754 15137201465 0007673 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage mod_articles_popular * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // no direct access defined('_JEXEC') or die; ?> <ul class="mostread<?php echo $moduleclass_sfx; ?>"> <?php foreach ($list as $item) : ?> <li> <a href="<?php echo $item->link; ?>"> <?php echo $item->title; ?></a> </li> <?php endforeach; ?> </ul> tmpl/.htaccess 0000666 00000000177 15137201465 0007333 0 ustar 00 <FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>