<?php
	/*
	*by Krite (http://upcoder.net)
	*/
	define('_IN_JOHNCMS', 1);
	$headmod = 'loadblogs';
	require_once '../incfiles/core.php';
	$result = mysql_query('SELECT * FROM `' . $set['prefblog'] . 'blogs_files` WHERE `id`=' . $id . ';');
	$row = mysql_fetch_array($result);
	$row2 = mysql_num_rows($result);
	if ($row2 == 0)
	{
		header('Location: ../index.php?err');
	}
	else
	{
		mysql_query("UPDATE `" . $set['prefblog'] . "blogs_files` SET `count`=count+1 WHERE `id`='" . $id . "' LIMIT 1;");
		header('Location: files/'.$row['name']);
		exit;
	}
?>