Просмотр файла modules/forum/file.php

Размер файла: 1.65Kb
<?php
/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
// Sitchi CMS - Mobile Content Management System //
// The author:  Nikoloz Sitchinava [sitchi]      //
// Link:        http://sitchicms.num.ge          //
// Skype:       SitchiCMS                        //
// License:     LICENSE.txt (see attached file)  //
// Version:     VERSION.txt (see attached file)  //
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
define('_SITCHICMS', 1);
$root_path='../../'; 
require $root_path.'includes/db_connect.php'; 
require $root_path.'includes/start.php';
require $root_path.'includes/header.php';
require $root_path.'includes/functions.php';
require $root_path.'includes/head.php'; // თავი
$lng_forum = load_lng('forum');
$id=$_GET['id'];
if ($id) {
// მიმაგრებული ფაილის გადაწერა
$mot = mysql_query("SELECT * FROM `forum_files` WHERE `id` = '$id'");
if (mysql_num_rows($mot)) {
$res = mysql_fetch_array($mot);
if (file_exists('../../files/forum/' . $res['filename'])) {
$count = $res['count'] + 1;
mysql_query("UPDATE `forum_files` SET  `count` = '$count' WHERE `id` = '$id'");
header('location: ../../files/forum/' . $res['filename']);
}else{
$err[] = true;
}
}else{
$err[] = true;
}
if ($err) {
head(''.$lng['1_61'].'');
echo'<div class="hdr"><b><a href="index.php">'.$lng_forum['1_1'].'</a> | '.$lng['1_61'].'</b></div>';
echo'<div class="errmenu">'.$lng_forum['1_78'].'</div>';
echo'<a href="'.htmlspecialchars($_SERVER['HTTP_REFERER']).'"> '.$lng['1_50'].'</a>';
require $root_path.'includes/end.php'; // დასასრული
exit;
}
}else{
header('location: index.php');
}
?>