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_ns8/mod_yj_ns8.php
<?php
/*======================================================================*\
|| #################################################################### ||
|| # Youjoomla LLC - YJ- Licence Number JFANS777
|| # Licensed to - joomfans.com
|| # ---------------------------------------------------------------- # ||
|| # Copyright (C) 2006-2009 Youjoomla LLC. All Rights Reserved.        ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- THIS IS NOT FREE SOFTWARE ---------------- #      ||
|| # http://www.youjoomla.com | http://www.youjoomla.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/

// no direct access
defined('_JEXEC') or die('Restricted access');
$who = strtolower($_SERVER['HTTP_USER_AGENT']);
JHTML::_('behavior.mootools');
require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
require_once('modules/mod_yj_ns8/lib/slike.php');
              $get_items        = $params->get   ('get_items',1);
              $nitems           = $params->get   ('nitems',4);
              $chars            = $params->get   ('chars',40);
              $ordering         = $params->get   ('ordering',3);// 1 = ordering | 2 = popular | 3 = random 
              $specificitems 	= $params->get   ('specificitems','');		
  
              
              $full_player_width  = $params->get ('full_player_width',960);
			  $player_height      = $params->get ('player_height',300);
              $intro_width       = $params->get ('intro_width',"320px");
              $autoSlide         = $params->get ('autoSlide',0);
              $startElem         = $params->get ('startElem',2);
              $visibleItems      = $params->get ('visibleItems',3);
			  $type_slider       = $params->get('type_slider');
			  $sorient           = $params->get('sorient');
			  $stime             = $params->get('stime');
              $sduration         = $params->get('sduration');
			  $showtooltip       = $params->get('showtooltip',0);
			  $showcattitle      = $params->get('showcattitle',1);
			  $showreadmore      = $params->get('showreadmore',1);
			  
			  if($ordering ==1){
              $order = 'ordering';
              }elseif($ordering == 2){
              $order = 'hits';
              }elseif ($ordering == 3){
              $order = 'RAND()';
              }
			 
$document = &JFactory::getDocument();
$document->addStyleSheet(JURI::base() . 'modules/mod_yj_ns8/css/stylesheet.css');
$document->addScript(JURI::base() . 'modules/mod_yj_ns8/script/yjns8.js');
	if(preg_match("/msie 6/", $who)) {
	$document->addStyleSheet(JURI::base() . 'modules/mod_yj_ns8/css/ifie.php');
	}
$document->addScriptDeclaration("
		window.addEvent('load', function(){
			new YJSports({
				outerContainer : 'YJSports_outer',
				innerContainer : 'YJSports_inner',
				elements: '.YJSports_slide',
				navigation: {
					'forward':'YJSports_right', 
					'back':'YJSports_left',
					container: 'YJSports_inner_nav',
					elements:'.YJSports_navLink',
					outer: 'YJSports_nav',
					visibleItems:$visibleItems
					
				},
				navInfo: 'YJSports_nav_info',
				navLinks: '.YJSports_navLink',
				slideType: $type_slider,
				orientation: $sorient,
				slideTime: $stime,
				duration: $sduration,
				tooltips:$showtooltip,
				autoslide:$autoSlide,
				startElem:$startElem
	
			});
		});
");

  echo "<!-- http://www.Youjoomla.com  Youjoomla News Slider Module V8.0 for Joomla 1.5 starts here -->	";
?>

		
        
<?php
		$db			=& JFactory::getDBO();
		$user		=& JFactory::getUser();
		$userId		= (int) $user->get('id');
		$aid		= $user->get('aid', 0);
		$contentConfig = &JComponentHelper::getParams( 'com_content' );
		$access		= !$contentConfig->get('shownoauth');
		$nullDate	= $db->getNullDate();
		$date =& JFactory::getDate();
		$now = $date->toMySQL(); //date('Y-m-d H:i:s');
		$where		= 'a.state = 1'
			. ' AND ( a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' )'
			. ' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )'
			;
	if(!empty($specificitems)){
		$where .= ' AND a.id IN ('.$specificitems.')';
	}else{
	    $where .= ' AND cc.id = '.$get_items.'';
	}
$sql = 'SELECT a.*, ' .
' 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,'.
'cc.title as cattitle,'.
's.title as sectitle'.

			' 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 .'' .
			($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.'';
			
$db->setQuery( $sql );
$load_items = $db->loadObjectList();
$slides8 = array();
foreach ( $load_items as $row ) {
	$slide8 = array(
  			'date' => JHTML::_('date', $row->created, '%d-%m-%Y'),
			'intro' => substr(strip_tags($row->introtext),0,$chars),
			'link' => ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid),
			'cat_link' => ContentHelperRoute::getCategoryRoute($row->catid, $row->sectionid),
			'img_url' => $img_url = article_image8($row),
			'title' => $row->title,
			'cat_title' => $row->cattitle,
			'img_url' => '',
			'img_out' =>"<img src=\"".JURI::base().$img_url."\" border=\"0\"  class=\"YJSports_link\" title=\"".$row->cattitle." :: ".$row->title."\"  alt=\"\"/>"
    	);
  		$slides8[] = $slide8;
  	}  	 
?>
<div style="width:<?php echo $full_player_width ?>px; margin:0px auto 0px; display:block; position:relative;">
  <div id="YJSports_outer" class="slide" style="width:<?php echo $full_player_width ?>px; height:<?php echo $player_height ?>px;">
    <div id="YJSports_inner" style="width:<?php echo $full_player_width ?>px;">
      <?php $countSlides = 0;?>
      <?php foreach ($slides8 as $slide8):?>
      <div class="YJSports_slide" style="width:<?php echo $full_player_width ?>px; height:<?php echo $player_height ?>px; display:<?php echo $startElem==$countSlides?'block':'none';?>"> <a href="<?php echo $slide8['link'] ?>" title="">
        <?php if(isset($img_url) && $img_url != "") echo $slide8['img_out'] ?>
        </a>
        <div class="YJSports_description" style="width:<?php echo $intro_width ?>;"> <div class="title"><?php echo  $slide8['title'] ?>
          <?php if($showcattitle  ==1) { ?>
          <div class="slide_cat"><a href="<?php echo  $slide8['cat_link'] ?>">More <?php echo  $slide8['cat_title'] ?> news</a></div>
          <?php } ?>
          </div>
          <p><?php echo $slide8['intro'] ?></p>
          <?php if ($showreadmore == 1 ){ ?>
          <a href="<?php echo $slide8['link'] ?>" title="" class="YJSports_more">Подробнее...</a>
          <?php } ?>
        </div>
      </div>
      <?php $countSlides+=1; ?>
      <?php endforeach;?>
    </div>
  </div>
  <div class="navContainer" style="width:<?php echo $full_player_width ?>px;"> <a href="#" title="previous" id="YJSports_left"></a> <a href="#" title="next" id="YJSports_right"></a>
    <div id="YJSports_nav" style="width:<?php echo $full_player_width - 120 ?>px;">
      <div class="nav_inner" id="YJSports_inner_nav">
        <?php foreach ($slides8 as $slide8):?>
        <a href="#" class="YJSports_navLink" title="Navigate to  ::<?php echo  $slide8['title'] ?>">
        <?php if(isset($img_url) && $img_url != "") echo $slide8['img_out'] ?>
        </a>
        <?php endforeach;?>
      </div>
    </div>
  </div>
</div>