Done !
| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 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/zenit/administrator/components/com_hikashop/classes/ |
Upload File : |
<?php
/**
* @package HikaShop for Joomla!
* @version 4.5.1
* @author hikashop.com
* @copyright (C) 2010-2022 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class hikashopArticleClass extends hikashopClass {
public function getLanguageArticleId($id) {
if ($id > 0 && JLanguageAssociations::isEnabled()) {
$associated = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', $id);
$currentLang = JFactory::getLanguage()->getTag();
if (isset($associated[$currentLang]))
$id = $associated[$currentLang]->id;
}
return $id;
}
public function &getNameboxData($typeConfig, &$fullLoad, $mode, $value, $search, $options) {
$ret = array(
0 => array(),
1 => array()
);
$fullLoad = false;
$displayFormat = !empty($options['displayFormat']) ? $options['displayFormat'] : @$typeConfig['displayFormat'];
$start = (int)@$options['start']; // TODO
$limit = (int)@$options['limit'];
$page = (int)@$options['page'];
if($limit <= 0)
$limit = 50;
$select = array('c.*');
$table = array('#__content AS c');
$where = array();
if(!empty($search)) {
$searchMap = array('c.title', 'c.alias', 'c.id');
if(!HIKASHOP_J30)
$searchVal = '\'%' . $this->db->getEscaped(HikaStringHelper::strtolower($search), true) . '%\'';
else
$searchVal = '\'%' . $this->db->escape(HikaStringHelper::strtolower($search), true) . '%\'';
$where['search'] = '('.implode(' LIKE '.$searchVal.' OR ', $searchMap).' LIKE '.$searchVal.')';
}
$order = ' ORDER BY c.id DESC';
if(count($where))
$where = ' WHERE ' . implode(' AND ', $where);
else
$where = '';
$query = 'SELECT '.implode(', ', $select) . ' FROM ' . implode(' ', $table) . $where . $order;
$this->db->setQuery($query, $page, $limit);
$ret[0] = $this->db->loadObjectList('id');
if(count($ret[0]) < $limit)
$fullLoad = true;
if(empty($value))
return $ret;
if($mode == hikashopNameboxType::NAMEBOX_SINGLE && isset($ret[0][$value])) {
$ret[1][$value] = $ret[0][$value];
} elseif($mode == hikashopNameboxType::NAMEBOX_SINGLE) {
$query = 'SELECT '.implode(', ', $select) . ' FROM ' . implode(' ', $table) . ' WHERE c.id = '.(int)$value;
$this->db->setQuery($query);
$ret[1][$value] = $this->db->loadObject();
} elseif($mode == hikashopNameboxType::NAMEBOX_MULTIPLE && is_array($value)) {
foreach($value as $v) {
if(isset($ret[0][$v])) {
$ret[1][$v] = $ret[0][$v];
}
}
}
return $ret;
}
}