Файл: chats/gallery.php
Строк: 61
<?php
//*********************/
//Скрипт переписан админом
//http://waufon.ru Кот * Проги для компа и мобил
//Помогал админ
//http://pfc.h2m.ru/ КОСМОС * Посети непожалееш
//всю эту срань господнюю
//перехуяривали на дыры
//http://rus-waphost.ru/ Nitrix * Супер хост без висов
/*********************/
require( "inc/conf.inc.php" );
require( "inc/check.php" );
echo "<title>Галерея</title>";
echo "<style type="text/css">";
echo "body { font-size: {$fs}; color: {$tcol}; background-color: {$bcol} }";
echo "a:link,a:visited { text-decoration: underline; color: {$lcol} }";
echo "div { border-style:solid; border-width: 1px; background-color: {$rcol} }";
echo "</style>";
echo "</head>";
echo "<body>";
$max = $row['num_msgs'];
if ( empty( $max ) )
{
$max = 5;
}
switch ( $mod )
{
case "s1" :
echo "<div align="center">Фото девушек</div>";
$p = intval( $p );
if ( $p < 0 )
{
$p = 0;
}
$page = $p * $max;
$q = mysql_query( "select login, photo from users where (photo <> '' and sex=2) order by posts desc limit {$page},{$max};" );
$k = mysql_num_rows( $q );
while ( $f = mysql_fetch_array( $q ) )
{
$nick = $f['login'];
$foto = $f['photo'];
print "• <a href="{$foto}">{$nick}</a><br/>";
}
break;
case "s2" :
echo "<div align="center">Фото парней</div>";
$p = intval( $p );
if ( $p < 0 )
{
$p = 0;
}
$page = $p * $max;
$q = mysql_query( "select login, photo from users where (photo <> '' and sex=1) order by posts desc limit {$page},{$max};" );
$k = mysql_num_rows( $q );
while ( $f = mysql_fetch_array( $q ) )
{
$nick = $f['login'];
$foto = $f['photo'];
print "• <a href="{$foto}">{$nick}</a><br/>";
}
break;
case "s3" :
echo "<div align="center">Все фото</div>";
$p = intval( $p );
if ( $p < 0 )
{
$p = 0;
}
$page = $p * $max;
$q = mysql_query( "select login, photo from users where photo <> '' order by posts desc limit {$page},{$max};" );
$k = mysql_num_rows( $q );
while ( $f = mysql_fetch_array( $q ) )
{
$nick = $f['login'];
$foto = $f['photo'];
print "• <a href="{$foto}">{$nick}</a><br/>";
}
break;
default :
$q = mysql_query( "select count(*) as num from users where photo <> '';" );
$a = mysql_fetch_array( $q );
$num = $a['num'];
echo "<div align="center">Всего фоток [{$num}]</div>";
echo "• <a href="gallery.php?id={$id}&pass={$pass}&mod=s1">Девушки</a><br/>";
echo "• <a href="gallery.php?id={$id}&pass={$pass}&mod=s2">Парни</a><br/>";
echo "• <a href="gallery.php?id={$id}&pass={$pass}&mod=s3">Все</a><br/>";
break;
}
if ( isset( $mod ) )
{
echo "<p align="center">";
if ( 0 < $p )
{
print "<a href="gallery.php?id={$id}&pass={$pass}&mod={$mod}&p=".( $p - 1 )."">«назад</a>r";
}
if ( $max <= $k )
{
print "<a href="gallery.php?id={$id}&pass={$pass}&mod={$mod}&p=".( $p + 1 )."">дальше»</a>";
}
echo "</p><a href="gallery.php?id={$id}&pass={$pass}&ref={$ref}">Галерея</a>";
}
$end = gettime( );
echo "<br/><a href="enter.php?id={$id}&pass={$pass}&ref={$ref}">Прихожая</a><br/>";
echo "<p align="center">[".round( $end - $mystart, 5 )."]</p>";
echo "</body></html>";
mysql_close( $link );
?>