Файл: other.php
Строк: 185
<?php
#-----------------------------------------------------#
# ============ЗАГРУЗ-ЦЕНТР============= #
# Автор : Sea #
# E-mail : x-sea-x@ya.ru #
# ICQ : 355152215 #
# Вы не имеете права распространять данный скрипт. #
# По всем вопросам пишите в ICQ. #
#-----------------------------------------------------#
// mod Gemorroj
require 'moduls/config.php';
require 'moduls/header.php';
$lll= $_SESSION['langpack'] == 'russian' ? 'rus_name' : 'name';
$onpage = get2ses('onpage');
if ($onpage < 3) {
$onpage = $setup['onpage'];
}
$prew = get2ses('prew');
if ($prew != 0 && $prew != 1) {
$prew = $setup['preview'];
}
$id = isset($_GET['id']) ? abs($_GET['id']) : 0;
$page = isset($_GET['page']) ? abs($_GET['page']) : 1;
if ($page < 1) {
$page = 1;
}
$out = '';
$rekk='';
$banner='';
$Reklames = new Reklames(); // Создаем экземпляр класса Reklames
$rekk.= $Reklames->Top();
$banner.= $Reklames->Bottom();
$banner.=$Reklames->Banner();
$mode = '`t1`.`dir` = "0" AND `t1`.`hidden` = "0" AND `t1`.`fileid`="0" ORDER BY `t1`.`id`';
//производители
if(isset($_GET['vendor'])){
$nomm='`t1`.`vendor` = "'.mysql_real_escape_string($_GET['vendor'],$mysql).'" AND '; //запрос в базу
$cate=htmlspecialchars($_GET['vendor']);
$get='vendor';
$mt=$_SESSION['language']['game by vendor'].' '. htmlspecialchars($_GET['vendor']);
$main = '<div class="mainzag">' . $mt. '</div>'; //верх страницы
$title.= $mt; //титут страницы
//Актеры фильмов
}elseif(isset($_GET['actors'])){
$nomm='`t1`.`akt` LIKE "%'.mysql_real_escape_string(urldecode($_GET['actors']),$mysql).'%" AND '; //запрос в базу
$cate=htmlspecialchars($_GET['actors']);
$get='actors';
$mt=$_SESSION['language']['films with the actor'].' '. htmlspecialchars(urldecode($_GET['actors']));
$main = '<div class="mainzag">' . $mt. '</div>'; //верх страницы
$title.= $mt; //титут страницы
//3D игры
}elseif(isset($_GET['3d'])){
$nomm='`t1`.`3d` = "2" AND '; //запрос в базу
$cate=htmlspecialchars($_GET['3d']);
$get='3D_games';
$mt=$_SESSION['language']['games 3D'];
$main = '<div class="mainzag">' . $mt. '</div>'; //верх страницы
$title.= $mt; //титут страницы
//Bluetooth игры
}elseif(isset($_GET['bt'])){
$nomm='`t1`.`bt` = "2" AND '; //запрос в базу
$cate=htmlspecialchars($_GET['bt']);
$get='bluetooth_games';
$mt=$_SESSION['language']['games on bluetooth'];
$main = '<div class="mainzag">' . $mt. '</div>'; //верх страницы
$title.= $mt; //титут страницы
//Режиссеры фильмов
}elseif(isset($_GET['director'])){
$nomm='`t1`.`rejj` LIKE "%'.mysql_real_escape_string(urldecode($_GET['director']),$mysql).'%" AND '; //запрос в базу
$cate=htmlspecialchars($_GET['director']);
$get='director';
$mt=htmlspecialchars(urldecode($_GET['director'])).' '.$_SESSION['language']['films director'];
$main = '<div class="mainzag">' . $mt. '</div>'; //верх страницы
$title.= $mt; //титут страницы
//По алфавиту
}elseif(isset($_GET['alphabet']) && isset($_GET['id'])){
$dire=mysql_result(mysql_query("SELECT `path` FROM `files` WHERE `id`='".int($_GET['id'])."' AND `dir`='1' LIMIT 1",$mysql),0);
$nomm='`t1`.`'.$lll.'` LIKE "'.mysql_real_escape_string($_GET['alphabet'],$mysql).'%" AND `t1`.`infolder` LIKE "'.$dire.'%" AND '; //запрос в базу
$cate=htmlspecialchars($_GET['alphabet']).'/'.int($_GET['id']);
$get='alphabet';
$mt=str_replace('%files%',htmlspecialchars($_GET['alphabet']),$_SESSION['language']['alfavit2']);
$main = '<div class="mainzag">' . $mt . '</div>'; //верх страницы
$title.=$mt ; //титул страницы
}
//По алфавиту
if(isset($_GET['alphabets']) && isset($_GET['id'])){
$view='';
$mt=$_SESSION['language']['alfavit'];
$main = '<div class="mainzag">' . $mt . '</div>'; //верх страницы
$title.= $mt; //титул страницы
$view.='<div class="row">';
$arr_rus=alfavit('rus','big');
for($i=0; $i<count($arr_rus); $i++){
$view.='<a href="'.DIRECTORY.'alphabet/'.$arr_rus[$i].'/'.int($_GET['id']).'/">'.$arr_rus[$i].'</a> ';
}
$view.='</div><div class="row">';
$arr_eng=alfavit('eng','big');
for($x=1; $x<count($arr_eng); $x++){
$view.='<a href="'.DIRECTORY.'alphabet/'.$arr_eng[$x].'/'.int($_GET['id']).'/">'.$arr_eng[$x].'</a> ';
}
$view.='</div><div class="row">';
for($z=1; $z<10; $z++){
$view.='<a href="'.DIRECTORY.'alphabet/'.$z.'/'.int($_GET['id']).'/">'.$z.'</a> ';
}
$view.='</div>';
//Все производители
}elseif(isset($_GET['vendors'])){
$view='<div class="row">';
$mt=$_SESSION['language']['vendors'];
$main = '<div class="mainzag">' . $mt . '</div>'; //верх страницы
$title.= $mt; //титул страницы
$exp=explode(':||:',file_get_contents('moduls/cache/vendors.dat'));
for($i=0; $i<count($exp)-1; $i++){
$ex=explode(':|:',$exp[$i]);
$name=htmlspecialchars($ex[0]);
$view.= '<img src="'.DIRECTORY.'ext/dir.png" alt=""/> <a href="'.DIRECTORY.'vendor/'.$name.'/">'.$name.'</a> <strong>('.int($ex[1]).')</strong><br/>';
}
$view.= '</div>';
}elseif(!isset($_GET['alphabets']) || !isset($_GET['vendors'])){
###############Получаем список файлов###############
if ($_SESSION['langpack'] == 'russian') {
$sql = mysql_query('
SELECT SQL_CALC_FOUND_ROWS `t1`.`id`,
`t1`.`path`,
`t1`.`infolder`,
`t1`.`rus_name` AS `name`,
`t1`.`size`,
`t1`.`loads`,
`t1`.`timeupload`,
`t1`.`yes`,
`t1`.`no`,
`t2`.`id` AS `back`
FROM `files` AS `t1`
LEFT JOIN `files` AS `t2` ON `t2`.`path` = `t1`.`infolder`
WHERE ' . $nomm . $mode . ' DESC
LIMIT ' . (($page * $onpage) - $onpage) . ', ' . $onpage,
$mysql);
} else {
$sql = mysql_query('
SELECT SQL_CALC_FOUND_ROWS `t1`.`id`,
`t1`.`path`,
`t1`.`infolder`,
`t1`.`name`,
`t1`.`size`,
`t1`.`loads`,
`t1`.`timeupload`,
`t1`.`yes`,
`t1`.`no`,
`t2`.`id` AS `back`
FROM `files` AS `t1`
LEFT JOIN `files` AS `t2` ON `t2`.`path` = `t1`.`infolder`
WHERE ' . $nomm . $mode . ' DESC
LIMIT ' . (($page * $onpage) - $onpage) . ', ' . $onpage,
$mysql);
}
$all = mysql_fetch_row(mysql_query('SELECT FOUND_ROWS();', $mysql));
$all=$all[0];
$onpage = $onpage > $all ? $all : $onpage;
###############Cтраницы###############
$pages = @ceil($all / $onpage);
if (!$pages) {
$pages = 1;
}
###############Если их нет...###########
if (!$all) {
$out .= $_SESSION['language']['empty2'];
}
###############Вывод списка#############
$bool = true;
$new = 86400 * $setup['day_new'];
while ($v = mysql_fetch_assoc($sql)) {
$bool != $bool;
if ($bool) {
$out .= '<div class="row">';
} else {
$out .= '<div class="row2">';
}
$ext = strtolower(pathinfo($v['path'], PATHINFO_EXTENSION));
//Красивый размер
$v['size'] = '(' . size($v['size']) . ')';
//Новизна файла
if (($v['timeupload'] + $new) >= $_SERVER['REQUEST_TIME'] && $setup['day_new']) {
$new_info = ' <span class="yes">' . $_SESSION['language']['new'] . '</span>';
} else {
$new_info = '';
}
//Предосмотр
$pre = '';
if ($prew) {
$prev_pic = str_replace('/', '--', iconv_substr(strstr($v['path'], '/'), 1));
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=""/><br/>';
} else {
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . 'im/' . $v['id'] . '" alt=""/><br/>';
}
} 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'] . '/' . $prev_pic . '_frame_' . $setup['ffmpeg_frame'] . '.gif')) {
$pre .= '<img style="margin: 1px; width:' . $wh[0] . '; height:' . $wh[1] . ';" src="' . DIRECTORY . $setup['ffmpegpath'] . '/' . htmlspecialchars($prev_pic) . '_frame_' . $setup['ffmpeg_frame'] . '.gif" alt=""/><br/>';
} else {
$pre .= '<img style="margin: 1px; width:' . $wh[0] . '; height:' . $wh[1] . ';" src="' . DIRECTORY . 'ffmpeg/' . $v['id'] . '" alt=""/><br/>';
}
} 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=""/><br/>';
} 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><br/>';
} else if (!file_exists($setup['tpath'] . '/' . $prev_pic . '.gif.swf')) {
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . 'theme/' . $v['id'] . '" alt=""/><br/>';
}
} else if ($setup['jar_change'] && $ext == 'jar') {
if (file_exists($setup['ipath'] . '/' . $prev_pic . '.png')) {
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . $setup['ipath'] . '/' . htmlspecialchars($prev_pic) . '.png" width="16" height="16" alt=""/>';
} else if (jar_ico($v['path'], $setup['ipath'] . '/' . $prev_pic . '.png')) {
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . $setup['ipath'] . '/' . htmlspecialchars($prev_pic) . '.png" width="16" height="16" alt=""/>';
}
} else if ($setup['apk_change'] && $ext == 'apk') {
if (file_exists($setup['apkpath'] . '/' . $prev_pic . '.png')) {
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . $setup['apkpath'] . '/' . htmlspecialchars($prev_pic) . '.png" width="16" height="16" alt=""/>';
} else if (apk_ico($v['path'], $setup['apkpath'] . '/' . $prev_pic . '.png')) {
$pre .= '<img style="margin: 1px;" src="' . DIRECTORY . $setup['apkpath'] . '/' . htmlspecialchars($prev_pic) . '.png" width="16" height="16" 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><br/>';
}
}
//Иконка к файлу
if (!$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 = '';
}
//Собсвенно вывод
$out .= $pre . ' ' . $ico . '<strong><a href="' . DIRECTORY . 'view/' . $v['id'] . '">' . htmlspecialchars($v['name'], ENT_NOQUOTES) . '</a></strong>' .$v['size']. $new_info.'</div>';
}
//------------------------------------------------------------------------------------------
if ($pages > 1) {
$out .= '<div class="row">' . $_SESSION['language']['pages'] . ': ';
$asd = $page - 2;
$asd2 = $page + 3;
if ($asd < $all && $asd > 0 && $page > 3) {
$out .= '<a href="' . DIRECTORY . $get.'/' . $cate .'/1">1</a> ... ';
}
for ($i = $asd; $i < $asd2; ++$i) {
if($i < $all && $i > 0) {
if ($i > $pages ) {
break;
}
if ($page == $i) {
$out .= '<strong>' . $i . '</strong>, ';
} else {
$out .= '<a href="' . DIRECTORY . $get.'/' . $cate . '/' . $i . '">' . $i . '</a>, ';
}
}
}
if ($i <= $pages) {
if ($asd2 < $all) {
$out .= ' ... <a href="' . DIRECTORY . $get.'/' . $cate . '/' . $pages . '">' . $pages . '</a>';
}
}
$out .= '</div>';
}
}
//------------------------------------------------------------------------------------------
echo isset($main) ? $main : '';
echo $rekk;
echo isset($_GET['alphabets']) || isset($_GET['vendors']) ? $view : $out;
echo'<div class="foot"><a href="' . DIRECTORY . '">' . $_SESSION['language']['downloads'] . '</a> | <a href="javascript:history.go(-1)">' . $_SESSION['language']['back'] . '</a> </div>'.$banner;
require 'moduls/foot.php';
?>