<div class="foot"> |
<p class="sort" style="padding: 5px; "> |
<font color="#ff0000">Внимание! Данный сайт содержит информацию для взрослых.<br />Для посещения сайта Вы должны подтвердить, что Вам есть 18 лет.</font> |
</p> |
<p class="sort"> |
<a href="#" onclick="Im18Y(this);" class="button">Мне есть 18 лет</a> |
<a class="button" href="http://soft.ru">Покинуть сайт</a> |
</p> |
</div> |
|
<script type="text/javascript"> |
function Im18Y(el) { |
SetCookie('18y', '1', 24); |
|
var span = document.createElement("button"); |
span.innerHTML = "сайт для взрослых"; |
el.parentNode.replaceChild(span, el); |
|
return false; |
} |
</script> |
|
<div class="foot"> |
<center> |
<a href="#"><img src="/dis/logo.png" width="400" height="60" alt=""></a> |
</center> |
</div> |
|
<?php |
|
// mod Gemorroj |
require 'moduls/config.php'; |
require 'moduls/header.php'; |
|
|
###############Проверка переменных############### |
$onpage = get2ses('onpage'); |
$prew = get2ses('prew'); |
|
$id = isset($_GET['id']) ? int($_GET['id']) : 0; |
$page = isset($_GET['page']) ? int($_GET['page']) : 0; |
$start = isset($_GET['start']) ? int($_GET['start']) : 0; |
$out = ''; |
$banner = ''; |
if ($onpage < 3) { |
$onpage = $setup['onpage']; |
} |
|
if ($prew != 0 && $prew != 1) { |
$prew = $setup['preview']; |
} |
|
$mode = '`priority` DESC, `timeupload` DESC'; |
|
###############Получаем текущий каталог############# |
if ($id) { |
$d = mysql_fetch_assoc(mysql_query(' |
SELECT `t1`.`path`, |
COUNT(`t2`.`id`) AS `all` |
FROM `files` AS `t1` |
LEFT JOIN `files` AS `t2` ON `t2`.`infolder` = `t1`.`path` |
WHERE `t1`.`id` = ' . $id . ' |
AND `t1`.`hidden` = "0" |
GROUP BY `t1`.`id` |
ORDER BY NULL |
', |
$mysql)); |
} else { |
$d['path'] = $setup['path'] . '/'; |
$d['all'] = mysql_result(mysql_query('SELECT COUNT(1) FROM `files` WHERE `infolder` = "' . mysql_real_escape_string($d['path'], $mysql) . '" AND `hidden` = "0"', $mysql), 0); |
} |
|
if (!is_dir($d['path'])) { |
error('Folder not found.'); |
} |
|
###############Онлайн############# |
mysql_query("REPLACE INTO `online` (`ip`, `time`) VALUES ('" . $_SERVER['HTTP_USER_AGENT'] . "', NOW());", $mysql); |
mysql_query('DELETE FROM `online` WHERE `time` < (NOW() - INTERVAL ' . $setup['online_time'] . ' SECOND)', $mysql); |
|
$online = mysql_fetch_row(mysql_query('SELECT COUNT(1) FROM online', $mysql)); |
if ($online[0] > $setup['online_max']) { |
mysql_query("REPLACE INTO `setting`(`name`, `value`) VALUES('online_max', '" . $online[0] . "');", $mysql); |
mysql_query("REPLACE INTO `setting`(`name`, `value`) VALUES('online_max_time', NOW());", $mysql); |
} |
|
|
###############Постраничная навигация############### |
$pages = ceil($d['all'] / $onpage); |
if (!$pages) { |
$pages = 1; |
} |
if ($page > $pages || $page < 1) { |
$page = 1; |
} |
|
$start = ($page - 1) * $onpage; |
if ($start > $d['all'] || $start < 0){ |
$start = 0; |
} |
|
###############Готовим заголовок################### |
$ex = explode('/', $d['path']); |
$sz = sizeof($ex) - 2; |
$nav_dir = $setup['path'] . '/'; |
|
unset($ex[0], $ex[$sz + 1]); |
$path = $setup['path'] . '/'; |
|
$put = ''; |
if ($ex) { |
$implode = 'SELECT ' . ($_SESSION['langpack'] == 'russian' ? '`id`, `rus_name`' : '`id`, `name`') . ' FROM `files` WHERE `path` IN('; |
foreach ($ex as $v) { |
$path .= $v . '/'; |
$implode .= '"' . mysql_real_escape_string($path, $mysql) . '",'; |
} |
|
|
$q = mysql_query(rtrim($implode, ',') . ')', $mysql); |
while ($s = mysql_fetch_row($q)) { |
$put .= '<a href="' . DIRECTORY . $s[0] . '">' . htmlspecialchars($s[1], ENT_NOQUOTES) . '</a> | '; |
$title .= '/' . htmlspecialchars($s[1], ENT_NOQUOTES); |
$descript .= htmlspecialchars($s[1], ENT_NOQUOTES); |
$keyword .= htmlspecialchars($s[1], ENT_NOQUOTES); |
} |
} |
|
###############Вывод заголовка############### |
if($id >= 1) $out.='<div class="mainzag" align="center">'.nam($put).'</div>'; |
###############Вывод рекламы############### |
|
if($id < 1) $banner.='<div class="foot"><a href="'.DIRECTORY.'online/">Online: '.int($online[0]).'</a> | '.$_SESSION['language']['maximum online'] . ': <strong>' . intval($setup['online_max']) . '</strong> (' . tm(strtotime($setup['online_max_time'])) . ')</div>'; |
|
$Reklames = new Reklames(); // Создаем экземпляр класса Reklames |
$out.= $Reklames->Top(); |
$banner.= $Reklames->Bottom(); |
|
if($id < 1){ |
$banner.='<div class="foots" align="center">'.$_SESSION['language']['language'].' : '; |
$arr_lang=array('russian','english'); |
foreach ($arr_lang as $va) { |
$banner.= '<a href="'.DIRECTORY.'lang/'.$va.'/"><img src="'.DIRECTORY.'dis/'.$va.'.png"></a> '; |
} |
$banner.='</div>'; |
} |
$banner.= $id < 1 ? $Reklames->Banner(1) : $Reklames->Banner(); |
|
|
// только если корень |
if ($id < 1) { |
$str = ''; |
/// новости // кол-во символов |
$news = mysql_fetch_row(mysql_query('SELECT `time`, LEFT(`' . ($_SESSION['langpack'] == 'russian' ? 'rus_news' : 'news') . '`,64) FROM `news` ORDER BY `id` DESC LIMIT 1', $mysql)); |
|
if ($news) { |
$str.= '- <a href="' . DIRECTORY . 'news.php">' . $_SESSION['language']['news'] . '</a> (' . tm($news[0]) . ')<br/>'; |
} |
|
if ($setup['search_change']) { |
$str.= '- <a href="' . DIRECTORY . 'search.php">' . $_SESSION['language']['search'] . '</a><br/>'; |
} |
$str.= '- <a href="' . DIRECTORY . 'new/">' . $_SESSION['language']['new files'] . '</a><br/>'; |
|
if ($setup['top_change']) { |
$str.= '- <a href="' . DIRECTORY . 'top/">' . str_replace('%files%', $setup['top_num'], $_SESSION['language']['top20']) . '</a><br/>'; |
} |
|
if ($setup['zakaz_change']) { |
$str .= '- <a href="' . DIRECTORY . 'table.php">' . $_SESSION['language']['orders'] . '</a><br/>'; |
} |
|
if ($str) { |
$out .= '<div class="aut">' . $str . '</div>'; |
unset($str); |
} |
} |
|
|
###############Список файлов и папок############### |
if (!$d['all']) { |
$out .= '<div class="row"><strong>[' . $_SESSION['language']['empty'] . ']</strong></div>'; |
} |
if($d['all'] && $id >= 1){ |
|
if ($setup['preview_change']) { |
$out.= '<div class="sort">' . $_SESSION['language']['preview'] . ': '; |
if ($_SESSION['prew'] == 1) { |
$out.= '<strong>On</strong> <a href="' . DIRECTORY . 'prew/0/' . $id . '">Off</a>'; |
} elseif($_SESSION['prew'] == 0) { |
$out.= '<a href="' . DIRECTORY . 'prew/1/' . $id . '">On</a> <strong>Off</strong>'; |
} |
$out.= '</div>'; |
} |
} |
|
$dn = 86400 * $setup['day_new']; |
$key = false; |
|
$limit = $id < 1 ? '' : 'LIMIT ' . $start . ', ' . $onpage; |
|
if ($_SESSION['langpack'] == 'russian') { |
$query = mysql_query(' |
SELECT |
`id`, |
`dir`, |
`dir_count`, |
`path` as `v`, |
`rus_name` AS `name`, |
`size`, |
`loads`, |
`timeupload`, |
`yes`, |
`no`, |
`3d_dir`,`bt_dir`,`top_dir`,`vendor_dir`,`alp_dir`,`new_dir`, |
(SELECT COUNT(1) FROM `files` WHERE `infolder`=`v` AND `timeupload` > "' . ($_SERVER['REQUEST_TIME'] - $dn) . '" AND `dir` = "0" AND `hidden` = "0" AND `fileid`="0") AS `count` |
FROM `files` |
WHERE `infolder` = "' . mysql_real_escape_string($d['path'], $mysql) . '" |
AND `hidden` = "0" |
AND `fileid` = "0" |
ORDER BY ' . $mode . ' |
'.$limit,$mysql); |
|
} else { |
$query = mysql_query( |
'SELECT |
`id`, |
`dir`, |
`dir_count`, |
`path` as `v`, |
`name`, |
`size`, |
`loads`, |
`timeupload`, |
`yes`, |
`no`, |
`3d_dir`,`bt_dir`,`top_dir`,`vendor_dir`,`alp_dir`,`new_dir`, |
(SELECT COUNT(1) FROM `files` WHERE `infolder`=`v` AND `timeupload` > "' . ($_SERVER['REQUEST_TIME'] - $dn) . '" AND `dir` = "0" AND `hidden` = "0" AND `fileid`="0") AS `count` |
FROM `files` |
WHERE `infolder` = "' . mysql_real_escape_string($d['path'], $mysql) . '" |
AND `hidden` = "0" |
AND `fileid` = "0" |
ORDER BY ' . $mode . ' |
'.$limit,$mysql); |
} |
|
$dirsql = mysql_fetch_row(mysql_query('SELECT `3d_dir`,`bt_dir`,`top_dir`,`vendor_dir`,`alp_dir`,`new_dir` FROM `files` WHERE `id`="'.$id.'" AND `dir`="1" LIMIT 1',$mysql)); |
|
$errore = $dirsql[0].$dirsql[1].$dirsql[2].$dirsql[3].$dirsql[4].$dirsql[5]; |
|
//Вывод топ, бт,3д, производители... |
if($page <= 1 && $errore) $out.='<div class="aut">'; |
|
if($dirsql[0] && $page <= 1) $out.='- <a href="'.DIRECTORY.'3D_games/">'.htmlspecialchars($dirsql[0]).'</a><br/>'; |
|
if($dirsql[1] && $page <= 1) $out.='- <a href="'.DIRECTORY.'bluetooth_games/">'.htmlspecialchars($dirsql[1]).'</a><br/>'; |
|
if($dirsql[2] && $page <= 1) $out.='- <a href="'.DIRECTORY.'top/'.$id.'/load">'.$setup['top_num'].htmlspecialchars($dirsql[2]).'</a><br/>'; |
|
if($dirsql[3] && $page <= 1) $out.='- <a href="'.DIRECTORY.'vendors/">'.htmlspecialchars($dirsql[3]).'</a><br/>'; |
|
if($dirsql[4] && $page <= 1) $out.='- <a href="'.DIRECTORY.'alphabets/'.$id.'/">'.htmlspecialchars($dirsql[4]).'</a><br/>'; |
|
if($dirsql[5] && $page <= 1) $out.='- <a href="'.DIRECTORY.'new/'.$id.'/">'.htmlspecialchars($dirsql[5]).'</a><br/>'; |
|
if($page <= 1 && $errore) $out.='</div>'; |
|
|
while ($v = mysql_fetch_assoc($query)) { |
$pre = $desc = $info = $new_info = ''; |
$screen = strstr($v['v'], '/'); // убираем папку с загрузками |
|
|
|
if ($key = !$key) { |
$row = '<div class="row">'; |
} else { |
$row = '<div class="row2">'; |
} |
if ($v['dir']) { |
//Кол-во новых файлов в папке |
if ($setup['day_new'] && $v['count']) { |
$new_all = '<a href="'.DIRECTORY.'new/'.$v['id'].'/"><span class="yes">+' . $v['count'] . '</span></a>'; |
} else { |
$new_all = ''; |
} |
|
//Иконка к папке |
if (file_exists($v['v'] . 'folder.png')) { |
$ico = '<img src="' . DIRECTORY . htmlspecialchars($v['v']) . 'folder.png" alt=""/>'; |
} else { |
$ico = '<img src="' . DIRECTORY . 'ext/dir.png" alt=""/>'; |
} |
|
//Собсвенно вывод |
$out .= $row . $ico . ' <a href="' . DIRECTORY . $v['id'] . '">' . htmlspecialchars($v['name'], ENT_NOQUOTES) . '</a> <strong>(' . $v['dir_count'] . ')</strong>' . $new_all; |
|
// описания |
if ($setup['desc'] && file_exists($setup['opath'] . $screen . '.txt')) { |
$out .= '<br/>' . iconv_substr(trim(file_get_contents($setup['opath'] . $screen . '.txt')), 0, $setup['desc']); |
} |
|
$out .= '</div>'; |
} else { |
$prev_pic = str_replace('/', '--', iconv_substr($screen, 1)); |
$ext = strtolower(pathinfo($v['v'], PATHINFO_EXTENSION)); |
$pre = ''; |
|
//Предосмотр |
if ($prew) { |
if ($setup['screen_change'] && ($ext == 'gif' || $ext == 'jpeg' || $ext == 'jpg' || $ext == 'png' || $ext == 'bmp')) { |
if (file_exists($setup['picpath'] . '/' . $prev_pic . '.gif')) { |
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . $setup['picpath'] . '/' . htmlspecialchars($prev_pic) . '.gif" alt=""/>'; |
} else { |
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . 'im/' . $v['id'] . '" alt=""/>'; |
} |
} else if ($setup['screen_change'] && ($ext == 'avi' || $ext == '3gp' || $ext == 'mp4' || $ext == 'flv') && extension_loaded('ffmpeg')) { |
$wh = explode('*', $setup['prev_size']); |
if (file_exists($setup['ffmpegpath'] . '/' . htmlspecialchars($prev_pic) . '_frame_' . $setup['ffmpeg_frame'] . '.gif')) { |
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . $setup['ffmpegpath'] . '/' . htmlspecialchars($prev_pic) . '_frame_' . $setup['ffmpeg_frame'] . '.gif" alt=""/>'; |
} else { |
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . 'ffmpeg/' . $v['id'] . '" alt=""/>'; |
} |
} else if ($setup['screen_change'] && ($ext == 'thm' || $ext == 'nth' || $ext == 'utz' || $ext == 'sdt' || $ext == 'scs')) { |
if (file_exists($setup['tpath'] . '/' . $prev_pic . '.gif')) { |
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . $setup['tpath'] . '/' . htmlspecialchars($prev_pic) . '.gif" alt=""/>'; |
} else if ($setup['swf_change'] && file_exists($setup['tpath'] . '/' . $prev_pic . '.gif.swf')) { |
$pre .= '<object style="width:128px; height:128px;"><param name="movie" value="' . DIRECTORY . $setup['tpath'] . '/' . htmlspecialchars($prev_pic) . '.gif.swf"><embed src="' . DIRECTORY . $setup['tpath'] . '/' . htmlspecialchars($prev_pic) . '.gif.swf" style="width:128px; height:128px;"></embed></param></object>'; |
} else if (!file_exists($setup['tpath'] . '/' . $prev_pic . '.gif.swf')) { |
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . 'theme/' . $v['id'] . '" alt=""/>'; |
} |
} else if ($setup['swf_change'] && $ext == 'swf') { |
$pre .= '<object style="width:128px; height:128px;"><param name="movie" value="' . DIRECTORY . htmlspecialchars($v['v']) . '"><embed src="' . DIRECTORY . htmlspecialchars($v['v']) . '" style="width:128px; height:128px;"></embed></param></object>'; |
} |
} |
|
|
//Новизна файла |
if (($v['timeupload'] + $dn) >= $_SERVER['REQUEST_TIME'] && $setup['day_new']) { |
$new_info = ' <span class="yes">' . $_SESSION['language']['new'] . '</span>'; |
} else { |
$new_info = ''; |
} |
//Красивый размер |
$v['size'] = '(' . size($v['size']) . ')'; |
|
if ($setup['screen_change']) { |
$th_gif = file_exists($setup['spath'] . $screen . '.thumb.gif'); |
$th_jpg = file_exists($setup['spath'] . $screen . '.thumb.jpg'); |
|
if (file_exists($setup['spath'] . $screen . '.gif') && !$th_gif) { |
img_resize($setup['spath'] . $screen . '.gif', $setup['spath'] . $screen . '.thumb.gif', 0, 0, $setup['marker']); |
} else if (file_exists($setup['spath'] . $screen . '.jpg') && !$th_gif) { |
img_resize($setup['spath'] . $screen . '.jpg', $setup['spath'] . $screen . '.thumb.gif', 0, 0, $setup['marker']); |
} |
|
if ($th_gif) { |
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . $setup['spath'] . htmlspecialchars($screen) . '.thumb.gif" alt=""/> '; |
} else if ($th_jpg) { |
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . $setup['spath'] . htmlspecialchars($screen) . '.thumb.jpg" alt=""/> '; |
} |
} |
|
if ($pre) { |
$pre .= '<br/>'; |
} |
|
|
//Иконка к файлу |
if (!$pre && $setup['jar_change'] && ($ext == 'jar' && $ext != 'apk')) { |
if (file_exists($setup['ipath'] . '/' . $prev_pic . '.png')) { |
$ico = '<img style="margin: 1px;" src="' . DIRECTORY . $setup['ipath'] . '/' . htmlspecialchars($prev_pic) . '.png" width="16" height="16" alt=""/> '; |
} elseif (jar_ico($v['v'], $setup['ipath'] . '/' . $prev_pic . '.png')) { |
$ico = '<img style="margin: 1px;" src="' . DIRECTORY . $setup['ipath'] . '/' . htmlspecialchars($prev_pic) . '.png" width="16" height="16" alt=""/> '; |
} |
}elseif (!$pre && $setup['apk_change'] && ($ext == 'apk' && $ext != 'jar')) { |
if (file_exists($setup['apkpath'] . '/' . $prev_pic . '.png')) { |
$ico = '<img style="margin: 1px;" src="' . DIRECTORY . $setup['apkpath'] . '/' . htmlspecialchars($prev_pic) . '.png" width="16" height="16" alt=""/> '; |
} elseif (apk_ico($v['v'], $setup['apkpath'] . '/' . $prev_pic . '.png')) { |
$ico = '<img style="margin: 1px;" src="' . DIRECTORY . $setup['apkpath'] . '/' . htmlspecialchars($prev_pic) . '.png" width="16" height="16" alt=""/> '; |
} |
}elseif (!$pre && file_exists('ext/' . $ext . '.png')) { |
$ico = '<img src="' . DIRECTORY . 'ext/' . $ext . '.png" alt=""/> '; |
}elseif(!$pre && !file_exists('ext/' . $ext . '.png')) { |
$ico = '<img src="' . DIRECTORY . 'ext/stand.png" alt=""/> '; |
}elseif($pre && file_exists('ext/' . $ext . '.png')){ |
$ico = ''; |
} |
|
if ($setup['desc'] && file_exists($setup['opath'] . $screen . '.txt')) { |
$desc .= '<br/>' . iconv_substr(trim(file_get_contents($setup['opath'] . $screen . '.txt')), 0, $setup['desc']); |
} |
|
|
//Собственно вывод |
$out .= $row . $pre . $ico . '<strong><a href="' . DIRECTORY . 'view/' . $v['id'] . '">' . htmlspecialchars($v['name'], ENT_NOQUOTES) . '</a></strong> ' . $v['size'] . $info . $new_info . $desc . '<br/></div>'; |
} |
} |
|
###############Постраничная навигация######## |
if ($pages > 1 && $limit != '') { |
$out .= '<div class="row">' . $_SESSION['language']['pages'] . ': '; |
$asd = $page - 2; |
$asd2 = $page + 3; |
if ($asd < $d['all'] && $asd > 0 && $page > 3) { |
$out .= '<a href="' . DIRECTORY . $id . '/1">1</a> ... '; |
} |
for ($i = $asd; $i < $asd2; ++$i) { |
if($i < $d['all'] && $i > 0) { |
if ($i > $pages ) { |
break; |
} |
if ($page == $i) { |
$out .= '<strong>' . $i . '</strong> '; |
} else { |
$out .= ' <a href="' . DIRECTORY . $id . '/' . $i . '">' . $i . '</a>,'; |
} |
} |
} |
if ($i <= $pages) { |
if ($asd2 < $d['all']) { |
$out .= ' ... <a href="' . DIRECTORY . $id . '/' . $pages . '">' . $pages . '</a>'; |
} |
} |
$out .= '<br/></div>'; |
|
} |
|
if($d['all'] && $id >= 1){ |
if ($setup['onpage_change']) { |
$out .= '<div class="sort">' . $_SESSION['language']['files on page'] . ': '; |
for ($i = 5; $i < 25; $i += 5) { |
if (isset($_SESSION['onpage']) && $_SESSION['onpage'] == $i) { |
$out .= '<strong>' . $i . '</strong> '; |
} else { |
$out .= '<a href="' . DIRECTORY . 'onpage/' . $i . '/' . $id . '">' . $i . '</a> '; |
} |
} |
$out .= '</div>'; |
} |
$out .= '<div class="foot">'; |
if ($setup['search_change']) $out.='<a href="'.DIRECTORY.'search.php?cat='.$id.'">' . $_SESSION['language']['search2'] . '</a> | '; |
$out.='<a href="' . DIRECTORY . '">' . $_SESSION['language']['downloads'] . '</a> | ' . $put . '</div>'; |
} |
|
|
echo $out . '</div>' . $banner; |
|
require 'moduls/foot.php'; |
|
?> |