View file game/chat/gallery.php

File size: 2.57Kb
<?php
//POWERED by ILI
// ICQ : 197042
//site: ili.wab.ru
// ilichat v4.0
error_reporting(0);
//GZIP COMPRESSION
require_once"./includes/functions/gzip.php";
//CONNECTION TO DATABASE
include('config.php');
//SESSION START
include('start.php');
//GENERATION TIME TOP
list($msec, $sec) = explode(chr(32), microtime()); 
$headtime = $sec + $msec;

if($ver=='html'){
$my_title = "Gallery";
if(!isset($_COOKIE['theme'])) $_COOKIE['theme'] = 1;
include_once "themes/".intval($_COOKIE['theme'])."/index.php";
$px = '<br/>:::::::<br/><a href="http://ili.wab.ru">ili.wab.ru</a></div></body></html>';
}
else{
header('Cache-Control: no-cache');
header('Content-Type: text/vnd.wap.wml');
echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd">
<wml>
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>
<card id="gallery" title="ili.wab.ru">
<p align="left" mode="wrap">
<a href="gallery.php">Фотки</a>-&gt;';

$px = '<br/>:::::::<br/><a href="http://ili.wab.ru">ili.wab.ru</a></p></card></wml>';
}
$n = $_GET['n'];
function allfiles($path)
	{
	  return count(glob($path."/*")); 
	}


$path="photos/";
$o=opendir($path) or die("Запрещено! ".$path.$px);
while($f=readdir($o))
	{
	  if($f!="." and $f!=".." and $f!=".htaccess")
		{
		$q = mysql_query("SELECT `nickname` FROM `chat_users` WHERE `id` = '".intval(substr($f,0,-4))."';");
		$nick = mysql_result($q, 0);
		if(empty($nick)) $nick = $f;
		if(eregi("jpg",$f) or eregi("gif",$f) or eregi("jpeg",$f) or eregi("png",$f))$sk="<img src='im.php?pic=".$path.$f."' alt='..'/>";$link[]=$sk."<a href='".$path.$f."'>".$nick."</a>[".round(filesize($path."/".$f)/1024)."kb]<br/>";$sk="";
		}
	}

echo "<br/>::::::<br/>Обьектов: ".count($link)."<br/>:::::::<br/>";
if($n=="")$n=0;
for($i=1; $i<=10; $i++)
	{
	  if(isset($link[$n])) echo $link[$n]; 
	  $n++;
	}
$off=$n-20; 
echo "<br/>[<a href='gallery.php?n=$off&amp;".SID."&amp;ver=".$ver."'>Назад</a>][<a href='gallery.php?n=$n&amp;".SID."&amp;ver=".$ver."'>Далее</a>]<br/>"; 
echo '[<a href="upload.php?'.SID.'&amp;ver=html&amp;case=add">Добавить</a>]<br/>';
echo '[<a href="menu.php?'.SID.'&amp;ver='.$ver.'">Меню чата</a>]'; 
if($ver=='html'){
include_once "themes/".intval($_COOKIE['theme'])."/foot.php";
}
else{
echo '<br/>';
require_once "includes/functions/gzip_foot.php";
list($msec, $sec) = explode(chr(32), microtime());
echo "[".round(($sec+$msec)-$headtime,5)."] sec\n";
echo $px;
ob_end_flush();
}
?>