403Webshell
Server IP : 46.105.57.169  /  Your IP : 216.73.217.35
Web Server : Apache
System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : verseaumee ( 152031)
PHP Version : 8.5.7
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/verseaumee/123click/assets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/verseaumee/123click/assets/mod_k2_tools.tar
helper.php000060400000121576150752725100006550 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

require_once(JPATH_SITE.'/components/com_k2/helpers/route.php');
require_once(JPATH_SITE.'/components/com_k2/helpers/utilities.php');
require_once(JPATH_SITE.'/media/k2/assets/vendors/cascade/calendar/calendar.php');

class modK2ToolsHelper
{
    public static $paths = array();

    public static function getAuthors(&$params)
    {
        $app = JFactory::getApplication();
        $componentParams = JComponentHelper::getParams('com_k2');
        $where = '';
        $cid = $params->get('authors_module_category');
        if ($cid > 0) {
            $categories = modK2ToolsHelper::getCategoryChildren($cid);
            $categories[] = $cid;
            JArrayHelper::toInteger($categories);
            $where = " catid IN(".implode(',', $categories).") AND ";
        }

        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $db = JFactory::getDbo();

        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
        $nullDate = $db->getNullDate();

        if (K2_JVERSION != '15') {
            $languageCheck = '';
            if ($app->getLanguageFilter()) {
                $languageTag = JFactory::getLanguage()->getTag();
                $languageCheck = "AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').")";
            }
            $query = "SELECT created_by FROM #__k2_items
            WHERE {$where} published=1
            AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." )
            AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." )
            AND trash=0
            AND access IN(".implode(',', $user->getAuthorisedViewLevels()).")
            AND created_by_alias=''
            {$languageCheck}
            AND EXISTS (SELECT * FROM #__k2_categories WHERE id= #__k2_items.catid AND published=1 AND trash=0 AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") {$languageCheck})
            GROUP BY created_by";
        } else {
            $query = "SELECT created_by FROM #__k2_items
            WHERE {$where} published=1
            AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." )
            AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." )
            AND trash=0
            AND access<={$aid}
            AND created_by_alias=''
            AND EXISTS (SELECT * FROM #__k2_categories WHERE id= #__k2_items.catid AND published=1 AND trash=0 AND access<={$aid})
            GROUP BY created_by";
        }

        $db->setQuery($query);
        $rows = $db->loadObjectList();

        $authors = array();
        if (count($rows)) {
            foreach ($rows as $row) {
                $author = JFactory::getUser($row->created_by);
                $author->link = JRoute::_(K2HelperRoute::getUserRoute($author->id));

                $query = "SELECT id, gender, description, image, url, `group`, plugins FROM #__k2_users WHERE userID=".(int)$author->id;
                $db->setQuery($query);
                $author->profile = $db->loadObject();

                if ($params->get('authorAvatar')) {
                    $author->avatar = K2HelperUtilities::getAvatar($author->id, $author->email, $componentParams->get('userImageWidth'));
                }

                if (K2_JVERSION != '15') {
                    $languageCheck = '';
                    if ($app->getLanguageFilter()) {
                        $languageTag = JFactory::getLanguage()->getTag();
                        $languageCheck = "AND i.language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") AND c.language IN (".$db->Quote($languageTag).", ".$db->Quote('*').")";
                    }
                    $query = "SELECT i.*, c.alias as categoryalias FROM #__k2_items as i
                    LEFT JOIN #__k2_categories c ON c.id = i.catid
                    WHERE i.created_by = ".(int)$author->id."
                    AND i.published = 1
                    AND i.access IN(".implode(',', $user->getAuthorisedViewLevels()).")
                    AND ( i.publish_up = ".$db->Quote($nullDate)." OR i.publish_up <= ".$db->Quote($now)." )
                    AND ( i.publish_down = ".$db->Quote($nullDate)." OR i.publish_down >= ".$db->Quote($now)." )
                    AND i.trash = 0 AND created_by_alias='' AND c.published = 1 AND c.access IN(".implode(',', $user->getAuthorisedViewLevels()).") AND c.trash = 0 {$languageCheck} ORDER BY created DESC";
                } else {
                    $query = "SELECT i.*, c.alias as categoryalias FROM #__k2_items as i
                    LEFT JOIN #__k2_categories c ON c.id = i.catid
                    WHERE i.created_by = ".(int)$author->id."
                    AND i.published = 1
                    AND i.access <= {$aid}
                    AND ( i.publish_up = ".$db->Quote($nullDate)." OR i.publish_up <= ".$db->Quote($now)." )
                    AND ( i.publish_down = ".$db->Quote($nullDate)." OR i.publish_down >= ".$db->Quote($now)." )
                    AND i.trash = 0 AND created_by_alias='' AND c.published = 1 AND c.access <= {$aid} AND c.trash = 0 ORDER BY created DESC";
                }

                $db->setQuery($query, 0, 1);
                $author->latest = $db->loadObject();
                $author->latest->id = (int)$author->latest->id;
                $author->latest->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($author->latest->id.':'.urlencode($author->latest->alias), $author->latest->catid.':'.urlencode($author->latest->categoryalias))));

                $query = "SELECT COUNT(*) FROM #__k2_comments WHERE published=1 AND itemID={$author->latest->id}";
                $db->setQuery($query);
                $author->latest->numOfComments = $db->loadResult();

                if ($params->get('authorItemsCounter')) {
                    if (K2_JVERSION != '15') {
                        $languageCheck = '';
                        if ($app->getLanguageFilter()) {
                            $languageTag = JFactory::getLanguage()->getTag();
                            $languageCheck = "AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').")";
                        }
                        $query = "SELECT COUNT(*) FROM #__k2_items  WHERE {$where} published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) AND trash=0 AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") AND created_by_alias='' AND created_by={$row->created_by} {$languageCheck} AND EXISTS (SELECT * FROM #__k2_categories WHERE id= #__k2_items.catid AND published=1 AND trash=0 AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") {$languageCheck} )";
                    } else {
                        $query = "SELECT COUNT(*) FROM #__k2_items  WHERE {$where} published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) AND trash=0 AND access<={$aid} AND created_by_alias='' AND created_by={$row->created_by} AND EXISTS (SELECT * FROM #__k2_categories WHERE id= #__k2_items.catid AND published=1 AND trash=0 AND access<={$aid} )";
                    }
                    $db->setQuery($query);
                    $numofitems = $db->loadResult();
                    $author->items = $numofitems;
                }
                $authors[] = $author;
            }
        }
        return $authors;
    }

    public static function getArchive(&$params)
    {
        $app = JFactory::getApplication();
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $db = JFactory::getDbo();

        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();

        $nullDate = $db->getNullDate();

        $query = "SELECT DISTINCT MONTH(created) as m, YEAR(created) as y FROM #__k2_items WHERE published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) AND trash=0";
        if (K2_JVERSION != '15') {
            $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($app->getLanguageFilter()) {
                $languageTag = JFactory::getLanguage()->getTag();
                $query .= " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
            }
        } else {
            $query .= " AND access<={$aid} ";
        }

        $catid = $params->get('archiveCategory', 0);
        if ($catid > 0) {
            $query .= " AND catid=".(int)$catid;
        }

        $query .= " ORDER BY created DESC";

        $db->setQuery($query, 0, 12);
        $rows = $db->loadObjectList();
        $months = array(
            JText::_('K2_JANUARY'),
            JText::_('K2_FEBRUARY'),
            JText::_('K2_MARCH'),
            JText::_('K2_APRIL'),
            JText::_('K2_MAY'),
            JText::_('K2_JUNE'),
            JText::_('K2_JULY'),
            JText::_('K2_AUGUST'),
            JText::_('K2_SEPTEMBER'),
            JText::_('K2_OCTOBER'),
            JText::_('K2_NOVEMBER'),
            JText::_('K2_DECEMBER'),
        );
        if (count($rows)) {
            foreach ($rows as $row) {
                if ($params->get('archiveItemsCounter')) {
                    $row->numOfItems = modK2ToolsHelper::countArchiveItems($row->m, $row->y, $catid);
                } else {
                    $row->numOfItems = '';
                }
                $row->name = $months[($row->m) - 1];

                if ($params->get('archiveCategory', 0) > 0) {
                    $row->link = JRoute::_(K2HelperRoute::getDateRoute($row->y, $row->m, null, $params->get('archiveCategory')));
                } else {
                    $row->link = JRoute::_(K2HelperRoute::getDateRoute($row->y, $row->m));
                }

                $archives[] = $row;
            }

            return $archives;
        }
    }

    public static function tagCloud(&$params)
    {
        $app = JFactory::getApplication();
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $db = JFactory::getDbo();

        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();

        $nullDate = $db->getNullDate();

        $query = "SELECT i.id FROM #__k2_items as i";
        $query .= " LEFT JOIN #__k2_categories c ON c.id = i.catid";
        $query .= " WHERE i.published=1 ";
        $query .= " AND ( i.publish_up = ".$db->Quote($nullDate)." OR i.publish_up <= ".$db->Quote($now)." ) ";
        $query .= " AND ( i.publish_down = ".$db->Quote($nullDate)." OR i.publish_down >= ".$db->Quote($now)." )";
        $query .= " AND i.trash=0 ";
        if (K2_JVERSION != '15') {
            $query .= " AND i.access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
        } else {
            $query .= " AND i.access <= {$aid} ";
        }
        $query .= " AND c.published=1 ";
        $query .= " AND c.trash=0 ";
        if (K2_JVERSION != '15') {
            $query .= " AND c.access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
        } else {
            $query .= " AND c.access <= {$aid} ";
        }

        $cloudCategory = $params->get('cloud_category');
        if (is_array($cloudCategory)) {
            $cloudCategory = array_filter($cloudCategory);
        }
        if ($cloudCategory) {
            if (!is_array($cloudCategory)) {
                $cloudCategory = (array)$cloudCategory;
            }
            foreach ($cloudCategory as $cloudCategoryID) {
                $categories[] = $cloudCategoryID;
                if ($params->get('cloud_category_recursive')) {
                    $children = modK2ToolsHelper::getCategoryChildren($cloudCategoryID);
                    $categories = @array_merge($categories, $children);
                }
            }
            $categories = @array_unique($categories);
            JArrayHelper::toInteger($categories);
            if (count($categories) == 1) {
                $query .= " AND i.catid={$categories[0]}";
            } else {
                $query .= " AND i.catid IN(".implode(',', $categories).")";
            }
        }

        if (K2_JVERSION != '15') {
            if ($app->getLanguageFilter()) {
                $languageTag = JFactory::getLanguage()->getTag();
                $query .= " AND c.language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") AND i.language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
            }
        }

        $db->setQuery($query);
        $IDs = K2_JVERSION == '30' ? $db->loadColumn() : $db->loadResultArray();

        if (!is_array($IDs) || !count($IDs)) {
            return array();
        }

        $query = "SELECT tag.name, tag.id
            FROM #__k2_tags as tag
            LEFT JOIN #__k2_tags_xref AS xref ON xref.tagID = tag.id
            WHERE xref.itemID IN (".implode(',', $IDs).")
            AND tag.published = 1";
        $db->setQuery($query);
        $rows = $db->loadObjectList();
        $cloud = array();
        if (count($rows)) {
            foreach ($rows as $tag) {
                if (@array_key_exists($tag->name, $cloud)) {
                    $cloud[$tag->name]++;
                } else {
                    $cloud[$tag->name] = 1;
                }
            }

            $max_size = $params->get('max_size');
            $min_size = $params->get('min_size');
            $max_qty = max(array_values($cloud));
            $min_qty = min(array_values($cloud));
            $spread = $max_qty - $min_qty;
            if (0 == $spread) {
                $spread = 1;
            }

            $step = ($max_size - $min_size) / ($spread);

            $counter = 0;
            arsort($cloud, SORT_NUMERIC);
            $cloud = @array_slice($cloud, 0, $params->get('cloud_limit'), true);
            uksort($cloud, "strnatcasecmp");

            foreach ($cloud as $key => $value) {
                $size = $min_size + (($value - $min_qty) * $step);
                $size = ceil($size);
                $tmp = new stdClass;
                $tmp->tag = $key;
                $tmp->count = $value;
                $tmp->size = $size;
                $tmp->link = urldecode(JRoute::_(K2HelperRoute::getTagRoute($key)));
                $tags[$counter] = $tmp;
                $counter++;
            }

            return $tags;
        }
    }

    public static function getSearchCategoryFilter(&$params)
    {
        $result = '';
        $cid = $params->get('category_id', null);
        if ($params->get('catfilter')) {
            if (!is_null($cid)) {
                if (is_array($cid)) {
                    if ($params->get('getChildren')) {
                        $itemListModel = K2Model::getInstance('Itemlist', 'K2Model');
                        $categories = $itemListModel->getCategoryTree($cid);
                        $result = @implode(',', $categories);
                    } else {
                        JArrayHelper::toInteger($cid);
                        $result = implode(',', $cid);
                    }
                } else {
                    if ($params->get('getChildren')) {
                        $itemListModel = K2Model::getInstance('Itemlist', 'K2Model');
                        $categories = $itemListModel->getCategoryTree($cid);
                        $result = @implode(',', $categories);
                    } else {
                        $result = (int)$cid;
                    }
                }
            }
        }

        return $result;
    }

    public static function hasChildren($id)
    {
        $app = JFactory::getApplication();
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $id = (int)$id;
        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__k2_categories  WHERE parent={$id} AND published=1 AND trash=0 ";
        if (K2_JVERSION != '15') {
            $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($app->getLanguageFilter()) {
                $languageTag = JFactory::getLanguage()->getTag();
                $query .= " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
            }
        } else {
            $query .= " AND access <= {$aid}";
        }

        $db->setQuery($query);
        $rows = $db->loadObjectList();
        if ($db->getErrorNum()) {
            echo $db->stderr();
            return false;
        }

        if (count($rows)) {
            return true;
        } else {
            return false;
        }
    }

    public static function treerecurse(&$params, $id = 0, $level = 0, $begin = false)
    {
        static $output;
        if ($begin) {
            $output = '';
        }
        $app = JFactory::getApplication();
        $root_id = (int)$params->get('root_id');
        $end_level = $params->get('end_level', null);
        $id = (int)$id;
        $catid = JRequest::getInt('id');
        $option = JRequest::getCmd('option');
        $view = JRequest::getCmd('view');

        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $db = JFactory::getDbo();

        switch ($params->get('categoriesListOrdering')) {

            case 'alpha':
                $orderby = 'name';
                break;

            case 'ralpha':
                $orderby = 'name DESC';
                break;

            case 'order':
                $orderby = 'ordering';
                break;

            case 'reversedefault':
                $orderby = 'id DESC';
                break;

            default:
                $orderby = 'id ASC';
                break;
        }

        if (($root_id != 0) && ($level == 0)) {
            $query = "SELECT * FROM #__k2_categories WHERE parent={$root_id} AND published=1 AND trash=0 ";
        } else {
            $query = "SELECT * FROM #__k2_categories WHERE parent={$id} AND published=1 AND trash=0 ";
        }

        if (K2_JVERSION != '15') {
            $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($app->getLanguageFilter()) {
                $languageTag = JFactory::getLanguage()->getTag();
                $query .= " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
            }
        } else {
            $query .= " AND access <= {$aid}";
        }

        $query .= " ORDER BY {$orderby}";

        $db->setQuery($query);
        $rows = $db->loadObjectList();
        if ($db->getErrorNum()) {
            echo $db->stderr();
            return false;
        }

        if ($level < intval($end_level) || is_null($end_level)) {
            $output .= '<ul class="level'.$level.'">';
            foreach ($rows as $row) {
                if ($params->get('categoriesListItemsCounter')) {
                    $row->numOfItems = ' ('.modK2ToolsHelper::countCategoryItems($row->id).')';
                } else {
                    $row->numOfItems = '';
                }

                if (($option == 'com_k2') && ($view == 'itemlist') && ($catid == $row->id)) {
                    $active = ' class="activeCategory"';
                } else {
                    $active = '';
                }

                if (modK2ToolsHelper::hasChildren($row->id)) {
                    $output .= '<li'.$active.'><a href="'.urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($row->id.':'.urlencode($row->alias)))).'"><span class="catTitle">'.$row->name.'</span><span class="catCounter">'.$row->numOfItems.'</span></a>';
                    modK2ToolsHelper::treerecurse($params, $row->id, $level + 1);
                    $output .= '</li>';
                } else {
                    $output .= '<li'.$active.'><a href="'.urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($row->id.':'.urlencode($row->alias)))).'"><span class="catTitle">'.$row->name.'</span><span class="catCounter">'.$row->numOfItems.'</span></a></li>';
                }
            }
            $output .= '</ul>';
        }

        return $output;
    }

    public static function treeselectbox(&$params, $id = 0, $level = 0)
    {
        $app = JFactory::getApplication();
        $root_id = (int)$params->get('root_id2');
        $option = JRequest::getCmd('option');
        $view = JRequest::getCmd('view');
        $category = JRequest::getInt('id');
        $id = (int)$id;
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $db = JFactory::getDbo();
        if (($root_id != 0) && ($level == 0)) {
            $query = "SELECT * FROM #__k2_categories WHERE parent={$root_id} AND published=1 AND trash=0 ";
        } else {
            $query = "SELECT * FROM #__k2_categories WHERE parent={$id} AND published=1 AND trash=0 ";
        }

        if (K2_JVERSION != '15') {
            $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($app->getLanguageFilter()) {
                $languageTag = JFactory::getLanguage()->getTag();
                $query .= " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
            }
        } else {
            $query .= " AND access <= {$aid}";
        }

        $query .= " ORDER BY ordering";

        $db->setQuery($query);
        $rows = $db->loadObjectList();
        if ($db->getErrorNum()) {
            echo $db->stderr();
            return false;
        }

        if ($level == 0) {
            echo '
<div class="k2CategorySelectBlock '.$params->get('moduleclass_sfx').'">
    <form action="'.JRoute::_('index.php').'" method="get">
        <select name="category" onchange="window.location=this.form.category.value;">
            <option value="'.JURI::base(true).'/">'.JText::_('K2_SELECT_CATEGORY').'</option>
            ';
        }
        $indent = "";
        for ($i = 0; $i < $level; $i++) {
            $indent .= '&ndash; ';
        }

        foreach ($rows as $row) {
            if (($option == 'com_k2') && ($category == $row->id)) {
                $selected = ' selected="selected"';
            } else {
                $selected = '';
            }
            if (modK2ToolsHelper::hasChildren($row->id)) {
                echo '<option value="'.urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($row->id.':'.urlencode($row->alias)))).'"'.$selected.'>'.$indent.$row->name.'</option>';
                modK2ToolsHelper::treeselectbox($params, $row->id, $level + 1);
            } else {
                echo '<option value="'.urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($row->id.':'.urlencode($row->alias)))).'"'.$selected.'>'.$indent.$row->name.'</option>';
            }
        }

        if ($level == 0) {
            echo '
            </select>
            <input name="option" value="com_k2" type="hidden" />
            <input name="view" value="itemlist" type="hidden" />
            <input name="task" value="category" type="hidden" />
            <input name="Itemid" value="'.JRequest::getInt('Itemid').'" type="hidden" />';

            // For Joom!Fish compatibility
            if (JRequest::getCmd('lang')) {
                echo '<input name="lang" value="'.JRequest::getCmd('lang').'" type="hidden" />';
            }

            echo '
    </form>
</div>
            ';
        }
    }

    public static function breadcrumbs($params)
    {
        $app = JFactory::getApplication();
        $array = array();
        $view = JRequest::getCmd('view');
        $id = JRequest::getInt('id');
        $option = JRequest::getCmd('option');
        $task = JRequest::getCmd('task');

        $db = JFactory::getDbo();
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');

        $menu = $app->getMenu();
        $active = $menu->getActive();

        if ($option == 'com_k2') {
            switch ($view) {

                case 'item':
                    if (K2_JVERSION != '15') {
                        $languageCheck = '';
                        if ($app->getLanguageFilter()) {
                            $languageTag = JFactory::getLanguage()->getTag();
                            $languageCheck = " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
                        }
                        $query = "SELECT * FROM #__k2_items  WHERE id={$id} AND published=1 AND trash=0 AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") {$languageCheck} AND EXISTS (SELECT * FROM #__k2_categories WHERE #__k2_categories.id= #__k2_items.catid AND published=1 AND access IN(".implode(',', $user->getAuthorisedViewLevels()).")  {$languageCheck} )";
                    } else {
                        $query = "SELECT * FROM #__k2_items  WHERE id={$id} AND published=1 AND trash=0 AND access<={$aid} AND EXISTS (SELECT * FROM #__k2_categories WHERE #__k2_categories.id= #__k2_items.catid AND published=1 AND access<={$aid})";
                    }
                    $db->setQuery($query);
                    $row = $db->loadObject();
                    if ($db->getErrorNum()) {
                        echo $db->stderr();
                        return false;
                    }

                    $matchItem = !is_null($active) && @$active->query['view'] == 'item' && @$active->query['id'] == $id;
                    $matchCategory = !is_null($active) && @$active->query['view'] == 'itemlist' && @$active->query['task'] == 'category' && @$active->query['id'] == $row->catid;

                    if ($matchItem || $matchCategory) {
                        $title = ($matchCategory) ? $row->title : '';
                        $path = modK2ToolsHelper::getSitePath();
                        return array($path, $title);
                    }

                    $title = $row->title;
                    $path = modK2ToolsHelper::getCategoryPath($row->catid);

                    break;

                case 'itemlist':
                    if ($task == 'category') {
                        $match = !is_null($active) && @$active->query['view'] == 'itemlist' && @$active->query['task'] == 'category' && @$active->query['id'] == $id;
                        if ($match) {
                            $title = '';
                            $path = modK2ToolsHelper::getSitePath();
                            return array($path, $title);
                        }


                        $query = "SELECT * FROM #__k2_categories  WHERE id={$id} AND published=1 AND trash=0 ";
                        if (K2_JVERSION != '15') {
                            $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
                            if ($app->getLanguageFilter()) {
                                $languageTag = JFactory::getLanguage()->getTag();
                                $query .= " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
                            }
                        } else {
                            $query .= " AND access <= {$aid}";
                        }

                        $db->setQuery($query);
                        $row = $db->loadObject();
                        if ($db->getErrorNum()) {
                            echo $db->stderr();
                            return false;
                        }
                        $title = $row->name;
                        $path = modK2ToolsHelper::getCategoryPath($row->parent);
                    } else {
                        $document = JFactory::getDocument();
                        $title = $document->getTitle();
                        $path = modK2ToolsHelper::getSitePath();
                    }
                    break;

                case 'latest':
                    $document = JFactory::getDocument();
                    $title = $document->getTitle();
                    $path = modK2ToolsHelper::getSitePath();
                    break;
            }
        } else {
            $document = JFactory::getDocument();
            $title = $document->getTitle();
            $path = modK2ToolsHelper::getSitePath();
        }

        return array(
            $path,
            $title
        );
    }

    public static function getSitePath()
    {
        $app = JFactory::getApplication();
        $pathway = $app->getPathway();
        $items = $pathway->getPathway();
        $count = count($items);
        $path = array();
        for ($i = 0; $i < $count; $i++) {
            if (!empty($items[$i]->link)) {
                $items[$i]->name = stripslashes(htmlspecialchars($items[$i]->name, ENT_QUOTES, 'UTF-8'));
                $items[$i]->link = JRoute::_($items[$i]->link);
                array_push($path, '<a href="'.JRoute::_($items[$i]->link).'">'.$items[$i]->name.'</a>');
            }
        }
        return $path;
    }

    public static function getCategoryPath($catid, &$array = array())
    {
        if (isset(self::$paths[$catid])) {
            return self::$paths[$catid];
        }

        $app = JFactory::getApplication();
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $catid = (int)$catid;
        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__k2_categories WHERE id={$catid} AND published=1 AND trash=0 ";

        if (K2_JVERSION != '15') {
            $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($app->getLanguageFilter()) {
                $languageTag = JFactory::getLanguage()->getTag();
                $query .= " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
            }
        } else {
            $query .= " AND access <= {$aid}";
        }

        $db->setQuery($query);
        $rows = $db->loadObjectList();
        if ($db->getErrorNum()) {
            echo $db->stderr();
            return false;
        }

        foreach ($rows as $row) {
            array_push($array, '<a href="'.urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($row->id.':'.urlencode($row->alias)))).'">'.$row->name.'</a>');
            modK2ToolsHelper::getCategoryPath($row->parent, $array);
        }
        $return = array_reverse($array);
        self::$paths[$catid] = $return;
        return $return;
    }

    public static function getCategoryChildren($catid)
    {
        static $array = array();
        $app = JFactory::getApplication();
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $catid = (int)$catid;
        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__k2_categories WHERE parent={$catid} AND published=1 AND trash=0 ";
        if (K2_JVERSION != '15') {
            $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($app->getLanguageFilter()) {
                $languageTag = JFactory::getLanguage()->getTag();
                $query .= " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
            }
        } else {
            $query .= " AND access <= {$aid}";
        }
        $query .= " ORDER BY ordering ";

        $db->setQuery($query);
        $rows = $db->loadObjectList();
        if ($db->getErrorNum()) {
            echo $db->stderr();
            return false;
        }
        foreach ($rows as $row) {
            array_push($array, $row->id);
            if (modK2ToolsHelper::hasChildren($row->id)) {
                modK2ToolsHelper::getCategoryChildren($row->id);
            }
        }
        return $array;
    }

    public static function countArchiveItems($month, $year, $catid = 0)
    {
        $app = JFactory::getApplication();
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $month = (int)$month;
        $year = (int)$year;
        $db = JFactory::getDbo();

        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();

        $nullDate = $db->getNullDate();

        $query = "SELECT COUNT(*) FROM #__k2_items WHERE MONTH(created)={$month} AND YEAR(created)={$year} AND published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) AND trash=0 ";
        if (K2_JVERSION != '15') {
            $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($app->getLanguageFilter()) {
                $languageTag = JFactory::getLanguage()->getTag();
                $query .= " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
            }
        } else {
            $query .= " AND access <= {$aid}";
        }
        if ($catid > 0) {
            $query .= " AND catid={$catid}";
        }
        $db->setQuery($query);
        $total = $db->loadResult();
        return $total;
    }

    public static function countCategoryItems($id)
    {
        $app = JFactory::getApplication();
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $id = (int)$id;
        $db = JFactory::getDbo();

        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();

        $nullDate = $db->getNullDate();

        $query = "SELECT COUNT(*) FROM #__k2_items WHERE catid={$id} AND published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) AND trash=0 ";
        if (K2_JVERSION != '15') {
            $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($app->getLanguageFilter()) {
                $languageTag = JFactory::getLanguage()->getTag();
                $query .= " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
            }
        } else {
            $query .= " AND access <= {$aid}";
        }
        $db->setQuery($query);
        $total = $db->loadResult();
        return $total;
    }

    public static function calendar($params)
    {
        $month = JRequest::getInt('month');
        $year = JRequest::getInt('year');

        $months = array(
            JText::_('K2_JANUARY'),
            JText::_('K2_FEBRUARY'),
            JText::_('K2_MARCH'),
            JText::_('K2_APRIL'),
            JText::_('K2_MAY'),
            JText::_('K2_JUNE'),
            JText::_('K2_JULY'),
            JText::_('K2_AUGUST'),
            JText::_('K2_SEPTEMBER'),
            JText::_('K2_OCTOBER'),
            JText::_('K2_NOVEMBER'),
            JText::_('K2_DECEMBER'),
        );
        $days = array(
            JText::_('K2_SUN'),
            JText::_('K2_MON'),
            JText::_('K2_TUE'),
            JText::_('K2_WED'),
            JText::_('K2_THU'),
            JText::_('K2_FRI'),
            JText::_('K2_SAT'),
        );

        $cal = new MyCalendar;
        $cal->category = $params->get('calendarCategory', 0);
        $cal->setStartDay(1);
        $cal->setMonthNames($months);
        $cal->setDayNames($days);

        if (($month) && ($year)) {
            return $cal->getMonthView($month, $year);
        } else {
            return $cal->getCurrentMonthView();
        }
    }

    public function calendarNavigation()
    {
        $app = JFactory::getApplication();

        $month = JRequest::getInt('month');
        $year = JRequest::getInt('year');

        $months = array(JText::_('K2_JANUARY'), JText::_('K2_FEBRUARY'), JText::_('K2_MARCH'), JText::_('K2_APRIL'), JText::_('K2_MAY'), JText::_('K2_JUNE'), JText::_('K2_JULY'), JText::_('K2_AUGUST'), JText::_('K2_SEPTEMBER'), JText::_('K2_OCTOBER'), JText::_('K2_NOVEMBER'), JText::_('K2_DECEMBER'), );
        $days = array(JText::_('K2_SUN'), JText::_('K2_MON'), JText::_('K2_TUE'), JText::_('K2_WED'), JText::_('K2_THU'), JText::_('K2_FRI'), JText::_('K2_SAT'), );

        $cal = new MyCalendar;
        $cal->setMonthNames($months);
        $cal->setDayNames($days);
        $cal->category = JRequest::getInt('catid');
        $cal->setStartDay(1);
        if (($month) && ($year)) {
            echo $cal->getMonthView($month, $year);
        } else {
            echo $cal->getCurrentMonthView();
        }
        $app->close();
    }

    public static function renderCustomCode($params)
    {
        jimport('joomla.filesystem.file');
        $document = JFactory::getDocument();
        if ($params->get('parsePhp')) {
            $filename = tempnam(JPATH_SITE.'/cache/mod_k2_tools', 'tmp');
            $customCode = $params->get('customCode');
            JFile::write($filename, $customCode);
            ob_start();
            include($filename);
            $output = ob_get_contents();
            ob_end_clean();
            JFile::delete($filename);
        } else {
            $output = $params->get('customCode');
        }
        if ($document->getType() != 'feed') {
            $dispatcher = JDispatcher::getInstance();
            if ($params->get('JPlugins')) {
                JPluginHelper::importPlugin('content');
                $row = new JObject();
                $row->text = $output;
                if (K2_JVERSION != '15') {
                    $dispatcher->trigger('onContentPrepare', array(
                        'mod_k2_tools',
                        &$row,
                        &$params
                    ));
                } else {
                    $dispatcher->trigger('onPrepareContent', array(
                        &$row,
                        &$params
                    ));
                }
                $output = $row->text;
            }
            if ($params->get('K2Plugins')) {
                JPluginHelper::importPlugin('k2');
                $row = new JObject();
                $row->text = $output;
                $dispatcher->trigger('onK2PrepareContent', array(
                    &$row,
                    &$params
                ));
                $output = $row->text;
            }
        }
        return $output;
    }
}

class MyCalendar extends Calendar
{
    public $category = null;
    public $cache = null;

    public function getDateLink($day, $month, $year)
    {
        if (is_null($this->cache)) {
            $this->cache = array();
            $app = JFactory::getApplication();
            $user = JFactory::getUser();
            $aid = $user->get('aid');
            $db = JFactory::getDbo();

            $jnow = JFactory::getDate();
            $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();

            $nullDate = $db->getNullDate();

            $languageCheck = '';
            if (K2_JVERSION != '15') {
                $accessCheck = " access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
                if ($app->getLanguageFilter()) {
                    $languageTag = JFactory::getLanguage()->getTag();
                    $languageCheck = " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').") ";
                }
            } else {
                $accessCheck = " access <= {$aid}";
            }

            $query = "SELECT DAY(created) AS day, COUNT(*) AS counter FROM #__k2_items WHERE YEAR(created)={$year} AND MONTH(created)={$month} AND published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) AND trash=0 AND {$accessCheck} {$languageCheck} AND EXISTS(SELECT * FROM #__k2_categories WHERE id= #__k2_items.catid AND published=1 AND trash=0 AND {$accessCheck} {$languageCheck})";

            $catid = $this->category;
            if ($catid > 0) {
                $query .= " AND catid={$catid}";
            }

            $query .= ' GROUP BY day';

            $db->setQuery($query);
            $objects = $db->loadObjectList();
            if ($db->getErrorNum()) {
                echo $db->stderr();
                return false;
            }
            foreach ($objects as $object) {
                $this->cache[$object->day] = $object->counter;
            }
        }
        $result = isset($this->cache[$day]) ? $this->cache[$day] : 0;

        if ($result > 0) {
            if ($this->category > 0) {
                return JRoute::_(K2HelperRoute::getDateRoute($year, $month, $day, $this->category));
            } else {
                return JRoute::_(K2HelperRoute::getDateRoute($year, $month, $day));
            }
        } else {
            return false;
        }
    }

    public function getCalendarLink($month, $year)
    {
        $itemID = JRequest::getInt('Itemid');
        if ($this->category > 0) {
            return JURI::root(true)."/index.php?option=com_k2&amp;view=itemlist&amp;task=calendar&amp;month={$month}&amp;year={$year}&amp;catid={$this->category}&amp;Itemid={$itemID}";
        } else {
            return JURI::root(true)."/index.php?option=com_k2&amp;view=itemlist&amp;task=calendar&amp;month=$month&amp;year=$year&amp;Itemid={$itemID}";
        }
    }
}
index.html000060400000000054150752725100006540 0ustar00<html><body bgcolor="#FFFFFF"></body></html>includes/calendarClass.php000060400000031454150752725100011631 0ustar00<?php
/**
 * @version    2.7.x
 * @package    K2
 * @author     JoomlaWorks http://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2016 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

// PHP Calendar Class Version 1.4 (5th March 2001)
//
// Copyright David Wilkinson 2000 - 2001. All Rights reserved.
//
// This software may be used, modified and distributed freely
// providing this copyright notice remains intact at the head
// of the file.
//
// This software is freeware. The author accepts no liability for
// any loss or damages whatsoever incurred directly or indirectly
// from the use of this script. The author of this software makes
// no claims as to its fitness for any purpose whatsoever. If you
// wish to use this software you should first satisfy yourself that
// it meets your requirements.
//
// URL:   http://www.cascade.org.uk/software/php/calendar/
// Email: davidw@cascade.org.uk


class Calendar
{


    /*
        Get the array of strings used to label the days of the week. This array contains seven
        elements, one for each day of the week. The first entry in this array represents Sunday.
    */
    function getDayNames()
    {
        return $this->dayNames;
    }


    /*
        Set the array of strings used to label the days of the week. This array must contain seven
        elements, one for each day of the week. The first entry in this array represents Sunday.
    */
    function setDayNames($names)
    {
        $this->dayNames = $names;
    }

    /*
        Get the array of strings used to label the months of the year. This array contains twelve
        elements, one for each month of the year. The first entry in this array represents January.
    */
    function getMonthNames()
    {
        return $this->monthNames;
    }

    /*
        Set the array of strings used to label the months of the year. This array must contain twelve
        elements, one for each month of the year. The first entry in this array represents January.
    */
    function setMonthNames($names)
    {
        $this->monthNames = $names;
    }



    /*
        Gets the start day of the week. This is the day that appears in the first column
        of the calendar. Sunday = 0.
    */
      function getStartDay()
    {
        return $this->startDay;
    }

    /*
        Sets the start day of the week. This is the day that appears in the first column
        of the calendar. Sunday = 0.
    */
    function setStartDay($day)
    {
        $this->startDay = $day;
    }


    /*
        Gets the start month of the year. This is the month that appears first in the year
        view. January = 1.
    */
    function getStartMonth()
    {
        return $this->startMonth;
    }

    /*
        Sets the start month of the year. This is the month that appears first in the year
        view. January = 1.
    */
    function setStartMonth($month)
    {
        $this->startMonth = $month;
    }


    /*
        Return the URL to link to in order to display a calendar for a given month/year.
        You must override this method if you want to activate the "forward" and "back"
        feature of the calendar.

        Note: If you return an empty string from this function, no navigation link will
        be displayed. This is the default behaviour.

        If the calendar is being displayed in "year" view, $month will be set to zero.
    */
    function getCalendarLink($month, $year)
    {
        return "";
    }

    /*
        Return the URL to link to  for a given date.
        You must override this method if you want to activate the date linking
        feature of the calendar.

        Note: If you return an empty string from this function, no navigation link will
        be displayed. This is the default behaviour.
    */
    function getDateLink($day, $month, $year)
    {
        return "";
    }


    /*
        Return the HTML for the current month
    */
    function getCurrentMonthView()
    {
        $d = getdate(time());
        return $this->getMonthView($d["mon"], $d["year"]);
    }


    /*
        Return the HTML for the current year
    */
    function getCurrentYearView()
    {
        $d = getdate(time());
        return $this->getYearView($d["year"]);
    }


    /*
        Return the HTML for a specified month
    */
    function getMonthView($month, $year)
    {
        return $this->getMonthHTML($month, $year);
    }


    /*
        Return the HTML for a specified year
    */
    function getYearView($year)
    {
        return $this->getYearHTML($year);
    }



    /********************************************************************************

        The rest are private methods. No user-servicable parts inside.

        You shouldn't need to call any of these functions directly.

    *********************************************************************************/


    /*
        Calculate the number of days in a month, taking into account leap years.
    */
    function getDaysInMonth($month, $year)
    {
        if ($month < 1 || $month > 12)
        {
            return 0;
        }

        $d = $this->daysInMonth[$month - 1];

        if ($month == 2)
        {
            // Check for leap year
            // Forget the 4000 rule, I doubt I'll be around then...

            if ($year%4 == 0)
            {
                if ($year%100 == 0)
                {
                    if ($year%400 == 0)
                    {
                        $d = 29;
                    }
                }
                else
                {
                    $d = 29;
                }
            }
        }

        return $d;
    }


    /*
        Generate the HTML for a given month
    */
    function getMonthHTML($m, $y, $showYear = 1)
    {
        $s = "";

        $a = $this->adjustDate($m, $y);
        $month = $a[0];
        $year = $a[1];

    	$daysInMonth = $this->getDaysInMonth($month, $year);
    	$date = getdate(mktime(12, 0, 0, $month, 1, $year));

    	$first = $date["wday"];
    	$monthName = $this->monthNames[$month - 1];

    	$prev = $this->adjustDate($month - 1, $year);
    	$next = $this->adjustDate($month + 1, $year);

    	if ($showYear == 1)
    	{
    	    $prevMonth = $this->getCalendarLink($prev[0], $prev[1]);
    	    $nextMonth = $this->getCalendarLink($next[0], $next[1]);
    	}
    	else
    	{
    	    $prevMonth = "";
    	    $nextMonth = "";
    	}

    	$header = $monthName . (($showYear > 0) ? " " . $year : "");

    	$s .= "<table class=\"calendar\">\n";
    	$s .= "<tr>\n";
    	$s .= "<td class=\"calendarNavMonthPrev\">" . (($prevMonth == "") ? "&nbsp;" : "<a class=\"calendarNavLink\" href=\"$prevMonth\">&laquo;</a>")  . "</td>\n";
    	$s .= "<td class=\"calendarCurrentMonth\" colspan=\"5\">$header</td>\n";
    	$s .= "<td class=\"calendarNavMonthNext\">" . (($nextMonth == "") ? "&nbsp;" : "<a class=\"calendarNavLink\" href=\"$nextMonth\">&raquo;</a>")  . "</td>\n";
    	$s .= "</tr>\n";

    	$s .= "<tr>\n";
    	$s .= "<td class=\"calendarDayName\" style=\"width:".round(100/7)."%\">" . $this->dayNames[($this->startDay)%7] . "</td>\n";
    	$s .= "<td class=\"calendarDayName\" style=\"width:".round(100/7)."%\">" . $this->dayNames[($this->startDay+1)%7] . "</td>\n";
    	$s .= "<td class=\"calendarDayName\" style=\"width:".round(100/7)."%\">" . $this->dayNames[($this->startDay+2)%7] . "</td>\n";
    	$s .= "<td class=\"calendarDayName\" style=\"width:".round(100/7)."%\">" . $this->dayNames[($this->startDay+3)%7] . "</td>\n";
    	$s .= "<td class=\"calendarDayName\" style=\"width:".round(100/7)."%\">" . $this->dayNames[($this->startDay+4)%7] . "</td>\n";
    	$s .= "<td class=\"calendarDayName\" style=\"width:".round(100/7)."%\">" . $this->dayNames[($this->startDay+5)%7] . "</td>\n";
    	$s .= "<td class=\"calendarDayName\" style=\"width:".round(100/7)."%\">" . $this->dayNames[($this->startDay+6)%7] . "</td>\n";
    	$s .= "</tr>\n";

    	// We need to work out what date to start at so that the first appears in the correct column
    	$d = $this->startDay + 1 - $first;
    	while ($d > 1)
    	{
    	    $d -= 7;
    	}

        // Make sure we know when today is, so that we can use a different CSS style
        $today = getdate(time());

    	while ($d <= $daysInMonth)
    	{
    	    $s .= "<tr>\n";

    	    for ($i = 0; $i < 7; $i++)
    	    {
        	    $class = ($year == $today["year"] && $month == $today["mon"] && $d == $today["mday"]) ? "calendarToday" : "calendarDate";

    	        if ($d > 0 && $d <= $daysInMonth){
    	            $link = $this->getDateLink($d, $month, $year);
    	            if($link == ""){
    	            	$s .= "<td class=\"{$class}\">$d</td>\n";
    	            } else {
    	            	$s .= "<td class=\"{$class}Linked\"><a href=\"$link\">$d</a></td>\n";
    	            }
    	        } else {
    	        		$s .= "<td class=\"calendarDateEmpty\">&nbsp;</td>\n";
    	        }

        	    $d++;
    	    }
    	    $s .= "</tr>\n";
    	}

    	$s .= "</table>\n";

    	return $s;
    }


    /*
        Generate the HTML for a given year
    */
    function getYearHTML($year)
    {
        $s = "";
    	$prev = $this->getCalendarLink(0, $year - 1);
    	$next = $this->getCalendarLink(0, $year + 1);

        $s .= "<table class=\"calendar\" border=\"0\">\n";
        $s .= "<tr>";
    		$s .= "<td class=\"calendarNavMonthPrev\">" . (($prev == "") ? "&nbsp;" : "<a class=\"calendarNavLink\" href=\"$prev\">&laquo;</a>")  . "</td>\n";
        $s .= "<td class=\"calendarCurrentMonth\">" . (($this->startMonth > 1) ? $year . " - " . ($year + 1) : $year) ."</td>\n";
    		$s .= "<td class=\"calendarNavMonthNext\">" . (($next == "") ? "&nbsp;" : "<a class=\"calendarNavLink\" href=\"$next\">&raquo;</a>")  . "</td>\n";
        $s .= "</tr>\n";
        $s .= "<tr>";
        $s .= "<td class=\"calendarMonth\">" . $this->getMonthHTML(0 + $this->startMonth, $year, 0) ."</td>\n";
        $s .= "<td class=\"calendarMonth\">" . $this->getMonthHTML(1 + $this->startMonth, $year, 0) ."</td>\n";
        $s .= "<td class=\"calendarMonth\">" . $this->getMonthHTML(2 + $this->startMonth, $year, 0) ."</td>\n";
        $s .= "</tr>\n";
        $s .= "<tr>\n";
        $s .= "<td class=\"calendarMonth\">" . $this->getMonthHTML(3 + $this->startMonth, $year, 0) ."</td>\n";
        $s .= "<td class=\"calendarMonth\">" . $this->getMonthHTML(4 + $this->startMonth, $year, 0) ."</td>\n";
        $s .= "<td class=\"calendarMonth\">" . $this->getMonthHTML(5 + $this->startMonth, $year, 0) ."</td>\n";
        $s .= "</tr>\n";
        $s .= "<tr>\n";
        $s .= "<td class=\"calendarMonth\">" . $this->getMonthHTML(6 + $this->startMonth, $year, 0) ."</td>\n";
        $s .= "<td class=\"calendarMonth\">" . $this->getMonthHTML(7 + $this->startMonth, $year, 0) ."</td>\n";
        $s .= "<td class=\"calendarMonth\">" . $this->getMonthHTML(8 + $this->startMonth, $year, 0) ."</td>\n";
        $s .= "</tr>\n";
        $s .= "<tr>\n";
        $s .= "<td class=\"calendarMonth\">" . $this->getMonthHTML(9 + $this->startMonth, $year, 0) ."</td>\n";
        $s .= "<td class=\"calendarMonth\">" . $this->getMonthHTML(10 + $this->startMonth, $year, 0) ."</td>\n";
        $s .= "<td class=\"calendarMonth\">" . $this->getMonthHTML(11 + $this->startMonth, $year, 0) ."</td>\n";
        $s .= "</tr>\n";
        $s .= "</table>\n";

        return $s;
    }

    /*
        Adjust dates to allow months > 12 and < 0. Just adjust the years appropriately.
        e.g. Month 14 of the year 2001 is actually month 2 of year 2002.
    */
    function adjustDate($month, $year)
    {
        $a = array();
        $a[0] = $month;
        $a[1] = $year;

        while ($a[0] > 12)
        {
            $a[0] -= 12;
            $a[1]++;
        }

        while ($a[0] <= 0)
        {
            $a[0] += 12;
            $a[1]--;
        }

        return $a;
    }

    /*
        The start day of the week. This is the day that appears in the first column
        of the calendar. Sunday = 0.
    */
    var $startDay = 0;

    /*
        The start month of the year. This is the month that appears in the first slot
        of the calendar in the year view. January = 1.
    */
    var $startMonth = 1;

    /*
        The labels to display for the days of the week. The first entry in this array
        represents Sunday.
    */
    var $dayNames = array("S", "M", "T", "W", "T", "F", "S");

    /*
        The labels to display for the months of the year. The first entry in this array
        represents January.
    */
    var $monthNames = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

    /*
        The number of days in each month. You're unlikely to want to change this...
        The first entry in this array represents January.
    */
    var $daysInMonth = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

}

?>
mod_k2_tools.php000060400000006023150752725100007651 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

if (K2_JVERSION != '15') {
    $language = JFactory::getLanguage();
    $language->load('com_k2.dates', JPATH_ADMINISTRATOR, null, true);
}

require_once(dirname(__FILE__).'/helper.php');

// Params
$moduleclass_sfx = $params->get('moduleclass_sfx', '');
$module_usage = $params->get('module_usage', 0);
$authorAvatarWidthSelect = $params->get('authorAvatarWidthSelect', 'custom');
$authorAvatarWidth = $params->get('authorAvatarWidth', 50);
$button = $params->get('button');
$imagebutton = $params->get('imagebutton');
$button_pos = $params->get('button_pos', 'left');
$button_text = $params->get('button_text', JText::_('K2_SEARCH'));
$text = $params->get('text', JText::_('K2_SEARCH'));
$searchItemId = $params->get('searchItemId', '');

// API
$document = JFactory::getDocument();
$app = JFactory::getApplication();

// Output
switch ($module_usage) {
    case '0':
        $months = modK2ToolsHelper::getArchive($params);
        if (count($months)) {
            require(JModuleHelper::getLayoutPath('mod_k2_tools', 'archive'));
        }
        break;

    case '1':
        // User avatar
        if ($authorAvatarWidthSelect == 'inherit') {
            $componentParams = JComponentHelper::getParams('com_k2');
            $avatarWidth = $componentParams->get('userImageWidth');
        } else {
            $avatarWidth = $authorAvatarWidth;
        }
        $authors = modK2ToolsHelper::getAuthors($params);
        require(JModuleHelper::getLayoutPath('mod_k2_tools', 'authors'));
        break;

    case '2':
        $calendar = modK2ToolsHelper::calendar($params);
        require(JModuleHelper::getLayoutPath('mod_k2_tools', 'calendar'));
        break;

    case '3':
        $breadcrumbs = modK2ToolsHelper::breadcrumbs($params);
        $path = $breadcrumbs[0];
        $title = $breadcrumbs[1];
        require(JModuleHelper::getLayoutPath('mod_k2_tools', 'breadcrumbs'));
        break;

    case '4':
        $output = modK2ToolsHelper::treerecurse($params, 0, 0, true);
        require(JModuleHelper::getLayoutPath('mod_k2_tools', 'categories'));
        break;

    case '5':
        echo modK2ToolsHelper::treeselectbox($params);
        break;

    case '6':
        $categoryFilter = modK2ToolsHelper::getSearchCategoryFilter($params);
        $action = JRoute::_(K2HelperRoute::getSearchRoute());
        require(JModuleHelper::getLayoutPath('mod_k2_tools', 'search'));
        break;

    case '7':
        $tags = modK2ToolsHelper::tagCloud($params);
        if (count($tags)) {
            require(JModuleHelper::getLayoutPath('mod_k2_tools', 'tags'));
        }
        break;

    case '8':
        $customcode = modK2ToolsHelper::renderCustomCode($params);
        require(JModuleHelper::getLayoutPath('mod_k2_tools', 'customcode'));
        break;
}
mod_k2_tools.xml000060400000030313150752725100007661 0ustar00<?xml version="1.0" encoding="utf-8"?>
<extension type="module" client="site" version="2.5" method="upgrade">
    <name>K2 Tools</name>
    <author>JoomlaWorks</author>
    <creationDate>September 21st, 2018</creationDate>
    <copyright>Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.</copyright>
    <authorEmail>please-use-the-contact-form@joomlaworks.net</authorEmail>
    <authorUrl>www.joomlaworks.net</authorUrl>
    <version>2.9.0</version>
    <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
    <description>K2_TOOLS</description>
    <files>
        <filename module="mod_k2_tools">mod_k2_tools.php</filename>
        <filename>helper.php</filename>
        <folder>tmpl</folder>
    </files>
    <config>
        <fields name="params">
            <fieldset name="basic" addfieldpath="/administrator/components/com_k2/elements/">
                <field name="moduleclass_sfx" type="text" default="" label="K2_MODULE_CLASS_SUFFIX" description="K2_MODULE_CLASS_SUFFIX_DESCRIPTION"/>
                <field name="module_usage" type="list" default="0" label="K2_SELECT_MODULE_FUNCTIONALITY" description="">
                    <option value="0">K2_ARCHIVE</option>
                    <option value="1">K2_AUTHORS_LIST</option>
                    <option value="2">K2_BLOGSTYLE_CALENDAR_NO_OPTIONS</option>
                    <option value="3">K2_BREADCRUMBS</option>
                    <option value="4">K2_CATEGORIES_LIST_MENU</option>
                    <option value="5">K2_CATEGORY_SELECT_BOX</option>
                    <option value="6">K2_SEARCH_BOX</option>
                    <option value="7">K2_TAG_CLOUD</option>
                    <option value="8">K2_CUSTOM_CODE</option>
                </field>
                <!-- K2_ARCHIVE_SETTINGS -->
                <field name="" type="header" default="K2_ARCHIVE_SETTINGS" label="" description=""/>
                <field name="archiveItemsCounter" type="radio" default="1" label="K2_ITEMS_COUNTER" description="" class="btn-group btn-group-yesno">
                    <option value="0">K2_HIDE</option>
                    <option value="1">K2_SHOW</option>
                </field>
                <field name="archiveCategory" type="categories" label="K2_CATEGORY_FILTER" description="" default=""/>
                <!-- Authors List Settings -->
                <field name="" type="header" default="K2_AUTHORS_LIST_SETTINGS" label="" description=""/>
                <field name="authors_module_category" type="categories" default="" label="K2_FILTER_AUTHORS_BY_ROOT_CATEGORY" description="K2_SELECT_THE_ROOT_CATEGORY_FOR_WHICH_YOU_WANT_TO_FILTER_AN_AUTHOR_LIST_SELECT_NONE_TO_FETCH_AUTHORS_FROM_ALL_CATEGORIES"/>
                <field name="authorItemsCounter" type="radio" default="1" label="K2_ITEMS_COUNTER" description="" class="btn-group btn-group-yesno">
                    <option value="0">K2_HIDE</option>
                    <option value="1">K2_SHOW</option>
                </field>
                <field name="authorAvatar" type="radio" default="1" label="K2_AUTHOR_AVATAR" description="" class="btn-group btn-group-yesno">
                    <option value="0">K2_HIDE</option>
                    <option value="1">K2_SHOW</option>
                </field>
                <field name="authorAvatarWidthSelect" type="list" default="custom" label="K2_AUTHOR_AVATAR_WIDTH" description="">
                    <option value="inherit">K2_INHERIT_FROM_COMPONENT_PARAMETERS</option>
                    <option value="custom">K2_USE_CUSTOM_WIDTH</option>
                </field>
                <field name="authorAvatarWidth" type="text" default="50" size="4" label="K2_CUSTOM_WIDTH_FOR_AUTHOR_AVATAR_IN_PX" description=""/>
                <field name="authorLatestItem" type="radio" default="1" label="K2_LATEST_ITEM_WRITTEN_BY_AUTHOR" description="" class="btn-group btn-group-yesno">
                    <option value="0">K2_HIDE</option>
                    <option value="1">K2_SHOW</option>
                </field>
                <!-- Calendar Settings -->
                <field name="" type="header" default="K2_CALENDAR_SETTINGS" label="" description=""/>
                <field name="calendarCategory" type="categories" label="K2_CATEGORY_FILTER" description="" default=""/>
                <!-- Breadcrumbs Settings -->
                <field name="" type="header" default="K2_BREADCRUMBS_SETTINGS" label="" description=""/>
                <field name="home" type="text" default="" label="K2_ROOT_LABEL_EG_HOME" description="K2_THE_LABEL_FOR_THE_HOME_LINK_LEAVE_THIS_BLANK_IF_YOU_DONT_WISH_TO_INCLUDE_A_HOME_LINK_IN_YOUR_PATH"/>
                <field name="seperator" type="text" default="" label="K2_PATH_SEPARATOR" description="K2_THE_PATH_SEPARATOR_EG_A_RIGHT_ARROW"/>
                <!-- Categories List (Menu) Settings -->
                <field name="" type="header" default="K2_CATEGORIES_LIST_MENU_SETTINGS" label="" description=""/>
                <field name="root_id" type="categories" default="" label="K2_SELECT_ROOT_CATEGORY" description="K2_SELECT_THE_ROOT_CATEGORY_FOR_WHICH_YOU_WANT_TO_CREATE_A_CATEGORY_LIST_SELECT_NONE_TO_FETCH_A_LIST_OF_ALL_CATEGORIES"/>
                <field name="end_level" type="text" default="" size="4" label="K2_LEVELS_TO_RENDER" description="K2_SELECT_THE_NUMBER_OF_LEVELS_YOU_WISH_TO_RENDER_LEAVE_THIS_BLANK_IF_YOU_WISH_TO_RENDER_ALL_THE_LEVELS_BELOW_THE_SELECTED_ROOT_CATEGORY"/>
                <field name="categoriesListOrdering" type="list" default="" label="K2_ORDER_BY" description="">
                    <option value="">K2_DEFAULT_BY_ID_ASCENDING</option>
                    <option value="reversedefault">K2_REVERSE_DEFAULT_BY_ID_DESCENDING</option>
                    <option value="alpha">K2_NAME_ALPHABETICAL</option>
                    <option value="ralpha">K2_NAME_REVERSE_ALPHABETICAL</option>
                    <option value="order">K2_ORDERING</option>
                </field>
                <field name="categoriesListItemsCounter" type="radio" default="1" label="K2_ITEMS_COUNTER" description="" class="btn-group btn-group-yesno">
                    <option value="0">K2_HIDE</option>
                    <option value="1">K2_SHOW</option>
                </field>
                <!-- Category Select Box Settings -->
                <field name="" type="header" default="K2_CATEGORY_SELECT_BOX_SETTINGS" label="" description=""/>
                <field name="root_id2" type="categories" default="" label="K2_SELECT_ROOT_CATEGORY" description="K2_SELECT_THE_ROOT_CATEGORY_FOR_WHICH_YOU_WANT_TO_CREATE_A_CATEGORY_DROPDOWN_LIST_SELECT_NONE_TO_CREATE_A_DROPDOWN_LIST_FROM_ALL_CATEGORIES"/>
                <!-- Search Box Settings -->
                <field name="" type="header" default="K2_SEARCH_BOX_SETTINGS" label="" description=""/>
                <field name="catfilter" type="radio" default="0" label="K2_CATEGORY_FILTER" description="" class="btn-group btn-group-yesno-reverse">
                    <option value="0">K2_ALL</option>
                    <option value="1">K2_SELECT</option>
                </field>
                <field name="category_id" type="categoriesmultiple" default="" label="K2_RESTRICT_SEARCH_RESULTS_TO_ONE_OR_MORE_CATEGORIES" description="K2_BY_CHOOSING_SPECIFIC_CATEGORIES_HERE_YOU_CAN_NARROW_DOWN_SEARCH_RESULTS_TO_ITEMS_BELONGING_IN_THE_SELECTED_CATEGORIES_THIS_OPTION_IS_VERY_HANDY_IF_YOU_ARE_DEVELOPING_A_WEBSITE_FOR_BOTH_GUEST_VISITORS_AND_REGISTERED_MEMBERS_EG_INTRANET_AND_YOU_WANT_TO_RESTRICT_SEARCH_RESULTS_FOR_GUEST_VISITORS_ONLY_TO_CATEGORIES_THAT_THEY_ARE_ALLOWED_TO_VIEW"/>
                <field name="getChildren" type="radio" default="0" label="K2_FETCH_ITEMS_FROM_CHILDREN_CATEGORIES" description="" class="btn-group btn-group-yesno">
                    <option value="0">K2_NO</option>
                    <option value="1">K2_YES</option>
                </field>
                <field name="liveSearch" type="radio" default="0" label="K2_ENABLE_LIVE_SEARCH" description="K2_IF_YOU_ENABLE_THIS_OPTION_SEARCH_RESULTS_WILL_BE_DISPLAYED_RIGHT_BELOW_THE_SEARCH_BOX_AS_YOU_TYPE_YOUR_SEARCH_QUERY" class="btn-group btn-group-yesno">
                    <option value="0">K2_NO</option>
                    <option value="1">K2_YES</option>
                </field>
                <field name="text" type="text" default="" label="K2_SEARCH_BOX_DEFAULT_TEXT" description="K2_THE_TEXT_TO_DISPLAY_BY_DEFAULT_IN_THE_SEARCH_BOX"/>
                <field name="button" type="radio" default="0" label="K2_SHOW_SEARCH_BUTTON" description="" class="btn-group btn-group-yesno">
                    <option value="0">K2_NO</option>
                    <option value="1">K2_YES</option>
                </field>
                <field name="imagebutton" type="radio" default="0" label="K2_SEARCH_BUTTON_AS_IMAGE" description="K2_USE_AN_IMAGE_AS_THE_SEARCH_BUTTON" class="btn-group btn-group-yesno">
                    <option value="0">K2_NO</option>
                    <option value="1">K2_YES</option>
                </field>
                <field name="button_text" type="text" default="" label="K2_SEARCH_BUTTON_TEXT" description="K2_SET_THE_DEFAULT_TEXT_WHICH_WILL_APPEAR_ON_THE_SEARCH_BOX_EG_SEARCH_SITE"/>
                <field name="searchItemId" type="menuitem" default="" disable="separator" label="K2_SELECT_A_MENU_ITEM" description="K2_SELECT_A_MENU_ITEM_DESCRIPTION">
                    <option value="">K2_NONE_ONSELECTLISTS</option>
                </field>
                <!-- Tag Cloud Settings -->
                <field name="" type="header" default="K2_TAG_CLOUD_SETTINGS" label="" description=""/>
                <field name="min_size" type="text" default="75" size="4" label="K2_MIN_FONT_SIZE" description="K2_FONT_SIZE_FOR_LESS_POPULAR_TAGS"/>
                <field name="max_size" type="text" default="300" size="4" label="K2_MAX_FONT_SIZE" description="K2_FONT_SIZE_FOR_MOST_POPULAR_TAGS"/>
                <field name="cloud_limit" type="text" default="30" size="4" label="K2_TAG_LIMIT_X_MOST_POPULAR" description="K2_SELECT_THE_X_MOST_POPULAR_TAGS_TO_DISPLAY"/>
                <field name="cloud_category" type="categories" multiple="multiple" default="0" label="K2_FILTER_TAGS_FROM_ONE_OR_MORE_CATEGORIES" description="K2_TO_SELECT_MULTIPLE_CATEGORIES_PRESS_AND_KEEP_CTRLCMD_AND_THEN_CLICK_ON_THE_DESIRED_CATEGORIES"/>
                <field name="cloud_category_recursive" type="radio" default="0" label="K2_APPLY_TAG_CATEGORY_FILTER_RECURSIVELY_TO_ALL_SUBCATEGORIES" description="" class="btn-group btn-group-yesno">
                    <option value="0">K2_NO</option>
                    <option value="1">K2_YES</option>
                </field>
                <!-- Custom code settings -->
                <field name="" type="header" default="K2_CUSTOM_CODE_SETTINGS" label="" description=""/>
                <field name="customCode" type="textarea" filter="raw" default="" label="K2_ADD_CUSTOM_HTML_CSS_JS_OR_PHP_CODE" description="" cols="60" rows="20" />
                <field name="parsePhp" type="radio" default="0" label="K2_PARSE_PHP_CODE" description="" class="btn-group btn-group-yesno">
                    <option value="0">K2_NO</option>
                    <option value="1">K2_YES</option>
                </field>
                <field name="K2Plugins" type="radio" default="0" label="K2_ENABLE_K2_PLUGINS" description="" class="btn-group btn-group-yesno">
                    <option value="0">K2_NO</option>
                    <option value="1">K2_YES</option>
                </field>
                <field name="JPlugins" type="radio" default="0" label="K2_ENABLE_JOOMLA_CONTENT_PLUGINS" description="" class="btn-group btn-group-yesno">
                    <option value="0">K2_NO</option>
                    <option value="1">K2_YES</option>
                </field>
            </fieldset>
            <fieldset name="advanced">
                <field name="cache" type="list" default="1" label="K2_CACHING" description="K2_SELECT_WHETHER_TO_CACHE_THE_CONTENT_OF_THIS_MODULE">
                    <option value="1">K2_USE_GLOBAL</option>
                    <option value="0">K2_NO_CACHING</option>
                </field>
                <field name="cache_time" type="text" default="900" label="K2_CACHE_TIME" description="K2_THE_TIME_IN_SECONDS_BEFORE_THE_MODULE_IS_RECACHED"/>
            </fieldset>
        </fields>
    </config>
</extension>
tmpl/archive.php000060400000001465150752725100007660 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<div id="k2ModuleBox<?php echo $module->id; ?>" class="k2ArchivesBlock<?php if($params->get('moduleclass_sfx')) echo ' '.$params->get('moduleclass_sfx'); ?>">
    <ul>
        <?php foreach ($months as $month): ?>
        <li>
            <a href="<?php echo $month->link; ?>">
                <?php echo $month->name.' '.$month->y; ?>
                <?php if ($params->get('archiveItemsCounter')) echo ' ('.$month->numOfItems.')'; ?>
            </a>
        </li>
        <?php endforeach; ?>
    </ul>
</div>
tmpl/customcode.php000060400000000773150752725100010405 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<div id="k2ModuleBox<?php echo $module->id; ?>" class="k2CustomCodeBlock<?php if($params->get('moduleclass_sfx')) echo ' '.$params->get('moduleclass_sfx'); ?>">
    <?php echo $customcode; ?>
</div>
tmpl/calendar.php000060400000001023150752725100007776 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<div id="k2ModuleBox<?php echo $module->id; ?>" class="k2CalendarBlock<?php if($params->get('moduleclass_sfx')) echo ' '.$params->get('moduleclass_sfx'); ?>">
    <?php echo $calendar; ?>
    <div class="clr"></div>
</div>
tmpl/breadcrumbs.php000060400000002464150752725100010530 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

$output = '';
if ($params->get('home')) {
    $output .= '<span class="bcTitle">'.JText::_('K2_YOU_ARE_HERE').'</span><a href="'.JURI::root().'">'.$params->get('home', JText::_('K2_HOME')).'</a>';
    if (count($path)) {
        foreach ($path as $link) {
            $output .= '<span class="bcSeparator">'.$params->get('seperator', '&raquo;').'</span>'.$link;
        }
    }
    if ($title) {
        $output .= '<span class="bcSeparator">'.$params->get('seperator', '&raquo;').'</span>'.$title;
    }
} else {
    if ($title) {
        $output .= '<span class="bcTitle">'.JText::_('K2_YOU_ARE_HERE').'</span>';
    }
    if (count($path)) {
        foreach ($path as $link) {
            $output .= $link.'<span class="bcSeparator">'.$params->get('seperator', '&raquo;').'</span>';
        }
    }
    $output .= $title;
}

?>

<div id="k2ModuleBox<?php echo $module->id; ?>" class="k2BreadcrumbsBlock<?php if($params->get('moduleclass_sfx')) echo ' '.$params->get('moduleclass_sfx'); ?>">
    <?php echo $output; ?>
</div>
tmpl/authors.php000060400000003601150752725100007716 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<div id="k2ModuleBox<?php echo $module->id; ?>" class="k2AuthorsListBlock<?php if($params->get('moduleclass_sfx')) echo ' '.$params->get('moduleclass_sfx'); ?>">
    <ul>
        <?php foreach ($authors as $author): ?>
        <li>
            <?php if ($params->get('authorAvatar')): ?>
            <a class="k2Avatar abAuthorAvatar" rel="author" href="<?php echo $author->link; ?>" title="<?php echo K2HelperUtilities::cleanHtml($author->name); ?>">
                <img src="<?php echo $author->avatar; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($author->name); ?>" style="width:<?php echo $avatarWidth; ?>px;height:auto;" />
            </a>
            <?php endif; ?>

            <a class="abAuthorName" rel="author" href="<?php echo $author->link; ?>">
                <?php echo $author->name; ?>
                <?php if ($params->get('authorItemsCounter')): ?>
                <span>(<?php echo $author->items; ?>)</span>
                <?php endif; ?>
            </a>

            <?php if ($params->get('authorLatestItem')): ?>
            <a class="abAuthorLatestItem" href="<?php echo $author->latest->link; ?>" title="<?php echo K2HelperUtilities::cleanHtml($author->latest->title); ?>">
                <?php echo $author->latest->title; ?>
                <span class="abAuthorCommentsCount">(<?php echo $author->latest->numOfComments; ?> <?php if($author->latest->numOfComments=='1') echo JText::_('K2_MODK2TOOLS_COMMENT'); else echo JText::_('K2_MODK2TOOLS_COMMENTS'); ?>)</span>
            </a>
            <?php endif; ?>
        </li>
        <?php endforeach; ?>
    </ul>
</div>
tmpl/categories.php000060400000000773150752725100010365 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<div id="k2ModuleBox<?php echo $module->id; ?>" class="k2CategoriesListBlock<?php if($params->get('moduleclass_sfx')) echo ' '.$params->get('moduleclass_sfx'); ?>">
    <?php echo $output; ?>
</div>
tmpl/search.php000060400000004545150752725100007506 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

/*
 * Important note for template overrides:
 * If you wish to use the live search option, you MUST maintain
 * the same class names for wrapping elements, e.g. the wrapping div and form.
*/

?>

<div id="k2ModuleBox<?php echo $module->id; ?>" class="k2SearchBlock<?php if($params->get('moduleclass_sfx')) echo ' '.$params->get('moduleclass_sfx'); if($params->get('liveSearch')) echo ' k2LiveSearchBlock'; ?>">
    <form action="<?php echo $action; ?>" method="get" autocomplete="off" class="k2SearchBlockForm">
        <input type="text" value="<?php echo $text; ?>" name="searchword" class="inputbox" onblur="if(this.value=='') this.value='<?php echo $text; ?>';" onfocus="if(this.value=='<?php echo $text; ?>') this.value='';" />

        <?php if($button): ?>
        <?php if($imagebutton): ?>
        <input type="image" alt="<?php echo $button_text; ?>" class="button" onclick="this.form.searchword.focus();" src="<?php echo JURI::base(true); ?>/components/com_k2/images/search.png" />
        <?php else: ?>
        <input type="submit" value="<?php echo $button_text; ?>" class="button" onclick="this.form.searchword.focus();" />
        <?php endif; ?>
        <?php endif; ?>

        <?php if($categoryFilter): ?>
        <input type="hidden" name="categories" value="<?php echo $categoryFilter; ?>" />
        <?php endif; ?>

        <?php if(!$app->getCfg('sef')): ?>
        <input type="hidden" name="option" value="com_k2" />
        <input type="hidden" name="view" value="itemlist" />
        <input type="hidden" name="task" value="search" />
        <?php endif; ?>

        <?php if($params->get('liveSearch')): ?>
        <input type="hidden" name="format" value="html" />
        <input type="hidden" name="t" value="" />
        <input type="hidden" name="tpl" value="search" />
        <?php endif; ?>

        <?php if($searchItemId): ?>
        <input type="hidden" name="Itemid" value="<?php echo $searchItemId;?>" />
        <?php endif; ?>
    </form>

    <?php if($params->get('liveSearch')): ?>
    <div class="k2LiveSearchResults"></div>
    <?php endif; ?>
</div>
tmpl/tags.php000060400000001541150752725100007170 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<div id="k2ModuleBox<?php echo $module->id; ?>" class="k2TagCloudBlock<?php if($params->get('moduleclass_sfx')) echo ' '.$params->get('moduleclass_sfx'); ?>">
    <?php foreach ($tags as $tag): ?>
    <?php if(!empty($tag->tag)): ?>
    <a href="<?php echo $tag->link; ?>" style="font-size:<?php echo $tag->size; ?>%" title="<?php echo $tag->count.' '.JText::_('K2_ITEMS_TAGGED_WITH').' '.K2HelperUtilities::cleanHtml($tag->tag); ?>">
        <?php echo $tag->tag; ?>
    </a>
    <?php endif; ?>
    <?php endforeach; ?>
    <div class="clr"></div>
</div>

Youez - 2016 - github.com/yon3zu
LinuXploit