View file settings/site_fone.php

File size: 1.29Kb
<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
only_reg();
$set['title']='Фон сайта';
include_once '../sys/inc/thead.php';
title();
aut();
$array_files = array();
$odir = opendir(H."style/fones");
echo '<div class="mess">';
while ($file = readdir($odir)) {
	if ($file != '.' && $file != '..')
	echo '<a style="border: 1px solid #CCC; display: inline-block; margin-bottom: 1px;" href="?sel='.htmlspecialchars($file).'"><img style="margin: 1px;" src="/style/fones/'.htmlspecialchars($file).'" height="90" width="90" /></a> ';
	$array_files[] = $file;
}
if (isset($_GET['sel']) && in_array($_GET['sel'], $array_files)) {
	mysql_query("UPDATE `user` SET `site_fon` = '".my_esc($_GET['sel'])."' WHERE `id` = '$user[id]'");
	$_SESSION['message'] = 'Фон успешно установлен';
	header("Location: /settings/");
	exit();
}
echo "</div>\n";

echo '<a class="link" href="/settings/"><img src="/style/icons/str2.gif"> Назад</a>';

include_once '../sys/inc/tfoot.php';
?>