HEX
Server: Apache/2.4.6 (CloudLinux) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.16
System: Linux s1.gigspace.ru 3.10.0-962.3.2.lve1.5.77.el7.x86_64 #1 SMP Mon Dec 12 07:06:14 EST 2022 x86_64
User: samok164 (6070)
PHP: 7.2.34
Disabled: NONE
Upload Files
File: /var/www/samok164/data/www2/townsusa.ru/modules/mod_yj_newsflash2/helper.php
<?php
/*----------------------------------------------------------------------
#Youjoomla Newsflash Module for Joomla 1.5 Version 1.0
# ----------------------------------------------------------------------
# Copyright (C) 2007 You Joomla. All Rights Reserved.
# Designed by: Youjoomla.com
# Commercial
# Website: http://www.youjoomla.com// Copyright (c) 2006 - 2008 Youjoomla LLC
# This code cannot be redistributed without permission from Youjoomla - http://www.youjoomla.com.
# More info at http://www.youjoomla.com 
# Developer: Dragan Todorovic
------------------------------------------------------------------------*/

// no direct access
defined('_JEXEC') or die('Restricted access');
//remove notice msg from lay_out
ini_set('error_reporting',E_ALL ^ E_NOTICE);

class modNewsFlash2Helper{
	function getItems(&$params){
		global $mainframe, $_MAMBOTS;
		
		$database					=& JFactory::getDBO();
		$mosConfig_absolute_path	= JPATH_ROOT;
		$mosConfig_live_site 		= JURI :: base(); 
		$user						=& JFactory::getUser();
		$userId						= (int) $user->get('id');
		$aid						= $user->get('aid', 0);	  
		$date 						=& JFactory::getDate();
		$now 						= $date->toMySQL();	 
		$nullDate 					= $database->getNullDate();
	
		$get_items 					= $params->get('get_items',1);
		$nitems 					= $params->get ('nitems',4);
		$chars 						= $params->get ('chars',40);
		$chars_title 				= $params->get ('chars_title',27);
		
		$imgwidth 					= $params->get('imgwidth',"40px");
		$imgheight					= $params->get('imgheight',"40px");
		$imgalign 					= $params->get('imgalign',"left");
		$imgborder 					= $params->get('imgborder',"1px solid #e5e5e5");
		$ordering 					= $params->get('ordering',3);// 1 = ordering | 2 = popular | 3 = random 
		$showimage 					= $params->get('showimage',1);
		$showintro 					= $params->get('showintro',1);
        $showfirst_title 			= $params->get('showfirst_title',1);
		$show_cat_title 			= $params->get('show_cat_title',1);
		$show_creation_date			= $params->get('show_creation_date',1);	
	
		if($ordering ==1){
			$order = 'ordering';
		}elseif($ordering == 2){
			$order = 'hits';
		}elseif ($ordering == 3){
			$order = 'RAND()';
		}
	
		$contentConfig 	= &JComponentHelper::getParams( 'com_content' );
		$access			= !$contentConfig->get('shownoauth');
		$nullDate		= $database->getNullDate();
	
		$where			= 'a.state = 1'
			. ' AND ( a.publish_up = '.$database->Quote($nullDate).' OR a.publish_up <= '.$database->Quote($now).' )'
			. ' AND ( a.publish_down = '.$database->Quote($nullDate).' OR a.publish_down >= '.$database->Quote($now).' )'
			;
	
		$sql = 'SELECT a.*, cc.title as cc_title,' .
		' CONCAT(a.introtext, a.`fulltext`) AS text,'.
		' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'. 
		' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug'.
		' FROM #__content AS a' .
		' INNER JOIN #__categories AS cc ON cc.id = a.catid' .
		' INNER JOIN #__sections AS s ON s.id = a.sectionid' .
		' WHERE '. $where .' AND cc.id = '.$get_items.'' .
		($access ? ' AND a.access <= ' .(int) $aid. ' AND cc.access <= ' .(int) $aid. ' AND s.access <= ' .(int) $aid : '').
		' AND s.published = 1' .
		' AND cc.published = 1' .
		' ORDER BY '.$order .' LIMIT 0,'.$nitems.'';
		$database->setQuery( $sql );
		$load_items = $database->loadObjectList();	
		return $load_items;
	}
}

?>