| Server IP : 54.36.91.62 / Your IP : 216.73.217.111 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/components/com_jlexreview/models/ |
Upload File : |
<?php
/**
* @package JLex Review
* @version 4.2.3
* @copyright Copyright (c) 2013-2018 JLexArt. All rights reserved
* @license GNU General Public License version 2 or later;
* @author www.jlexart.com
*/
defined ( "_JEXEC" ) or die;
class JLexReviewModelReview extends JModelLegacy
{
public $id = 0;
public function remove()
{
$config = JLexReviewHelperAdmin::getConfig();
$user = JFactory::getUser();
if($user->guest || ($config->get("u_state_any_review",false)==false && $config->get("u_del_own_review",true)==false))
{
$this->setError(JText::_("JR_REVIEW_NOT_FOUND"));
return false;
}
$row = $this->getTable("review", "TableJR");
$row->load($this->id);
if(!$row->id || ($config->get("u_state_any_review",false)==false && $user->id!=$row->created_by))
{
$this->setError(JText::_("JR_REVIEW_NOT_FOUND"));
return false;
}
$state = $row->published==1 ? 0 : 1;
$row->do_remove();
return true;
}
public function state()
{
$config = JLexReviewHelperAdmin::getConfig();
if($config->get("u_state_any_review",false)==false)
{
$this->setError(JText::_("JR_REVIEW_NOT_FOUND"));
return false;
}
$row = $this->getTable("review", "TableJR");
$row->load( $this->id );
if(!$row->id)
{
$this->setError(JText::_("JR_REVIEW_NOT_FOUND"));
return false;
}
$state = $row->published==1 ? 0 : 1;
$row->do_publish($state);
return $state;
}
public function hl()
{
$config = JLexReviewHelperAdmin::getConfig();
if ($config->def("u_feature_any_review",false)==false)
{
$this->setError( JText::_("JR_REVIEW_NOT_FOUND") );
return false;
}
$row = $this->getTable("review", "TableJR");
$row->load($this->id);
if(!$row->id)
{
$this->setError(JText::_("JR_REVIEW_NOT_FOUND"));
return false;
}
$hl = $row->featured==1 ? 0 : 1;
$query = $this->_db->getQuery(true);
$query->update("#__jlexreview")
->set("featured=".$this->_db->quote($hl))
->where("id=".$this->_db->quote($this->id));
$this->_db->setQuery($query)->execute();
return $hl;
}
}