<?php

/*======================================================================*\
|| #################################################################### ||
|| # Drag'nDrop Shop 1.8                                              # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright 2014 JAKWEB All Rights Reserved.                       # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| #   ----------- Drag'nDrop Shop IS NOT FREE SOFTWARE -----------   # ||
|| #                      http://www.jakweb.ch                        # ||
|| #################################################################### ||
\*======================================================================*/

// Check if the file is accessed only via index.php if not stop the script from running
if (!defined('JAK_PREVENT_ACCESS')) {
die('You cannot access this file directly.');
}

$jaktable = 'shop';

$sql = 'SELECT t1.id, t1.title, t1.content, t1.time FROM '.DB_PREFIX.$jaktable.' AS t1 WHERE t1.active = 1 ORDER BY t1.time DESC LIMIT '.JAK_SHOPRSS;
		
		$JAK_RSS_DESCRIPTION = $tl['general']['g4'];

if (!empty($sql)) {

$result = $jakdb->query($sql);
while($row = $result->fetch_assoc()) {
	$Name = $row['title'];
	$whatweask = $row['id'];
	$getStriped = jak_cut_text($row['content'], 160, '...');
	$getStripedT = str_replace('&nbsp;',"",$getStriped);
	
	// get the new seo title in here, where it works!
	if (JAK_SHOPURL) {
		$seo = JAK_base::jakCleanurl($row['title']);
		$parseurl = JAK_rewrite::jakParseurl('i', $whatweask, JAK_base::jakCleanurl($row['title']), '', '');
	} else {
		$parseurl = JAK_rewrite::jakParseurl('i', $whatweask, '', '', '');
	}
	
	$jakdata[] = array('link' => $parseurl, 'title' => $Name, 'description' => trim($getStripedT), 'created' => date("r", strtotime($row['time'])));
}

$JAK_GET_RSS_ITEM = $jakdata;
$JAK_RSS_DATE = date(DATE_RFC2822);

// get the standard template
$template = 'rss.php';

} else {

	jak_redirect(BASE_URL);
	exit;

}
?>