Файл: masteram_us/fo/index.php
Строк: 120
<?
require'../shaxty.php'; // waphp.ru - закрытый клуб вап мастеров!
$align='left';
$title='Обменник файлов';
$head='Обменник файлов';
include_once (H.'shaxty/head.php');
check_login();
unset($_SESSION['search']);
unset($_SESSION['pass']);
$k_user=mysql_result(mysql_query("select COUNT(*) from `fo_files` WHERE user_id = '".$user['id']."';"),0);
if ($k_user!=$user['fo_files'])mysql_query('UPDATE `users` SET `fo_files` = "'.$k_user.'" WHERE `id` = "'.$user['id'].'"');
echo '<img src="/fo/ext/search.png" alt="*"/> <a href="search">Поиск файлов</a><br />
<img src="/fo/ext/top.gif" alt="*"/> ТОП '.$set['top_num'].' <a href="top">файлов</a>| <a href="users">пользователей</a><br />';
$new_all_files = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `fo_files` WHERE `timeupload` > '.($time-(86400*$set['fo_day_new'])).''));
if($new_all_files[0]!=0) echo '<img src="/fo/ext/new.gif" alt="*"/> <a href="new">Новинки (+'.$new_all_files[0].')</a><br />';
echo '<dt></dt>';
if(!empty($_SESSION["onpage"]) AND !empty($_GET['onpage'])){
$_SESSION["onpage"]=$_GET['onpage'];
}elseif(empty($_SESSION["onpage"]) AND !empty($_GET['onpage'])){
$onpage=$_GET['onpaget'];
session_register ("onpage") ;}
if(!empty($_SESSION["prew"]) AND !empty($_GET['prew']))
$_SESSION["prew"]=$_GET['prew'];
elseif(empty($_SESSION["prew"]) AND !empty($_GET['prew'])){
$prew=$_GET['prew'];
session_register ("prew") ;}
if(!empty($_SESSION["sort"]) AND !empty($_GET['sort']))
$_SESSION["sort"]=$_GET['sort'];
elseif(empty($_SESSION["sort"]) AND !empty($_GET['sort'])){
$sort=$_GET['sort'];
session_register ("sort") ;}
if($sort == 'name') $sortlink = '<a href="?sort=data">дата</a>|<a href="index.php?sort=size">размер</a>|<a href="?sort=load">популярность</a>|<a href="?sort=eval">рейтинг</a>';
elseif($sort == 'size') $sortlink = '<a href="?sort=data">дата</a>|<a href="?sort=name">имя|<a href="?sort=load">популярность</a></a>|<a href="?sort=eval">рейтинг</a>';
elseif($sort == 'load') $sortlink = '<a href="?sort=data">дата</a>|<a href="?sort=name">имя|<a href="?sort=size">размер</a>|<a href="?sort=eval">рейтинг</a>';
elseif($sort == 'eval') $sortlink = '<a href="?sort=data">дата</a>|<a href="?sort=name">имя|<a href="?sort=size">размер</a>|<a href="?sort=load">популярность</a>';
else $sortlink = '<a href="?sort=name">имя</a>|<a href="?sort=size">размер</a>|<a href="?sort=load">популярность</a>|<a href="?sort=eval">рейтинг</a>';
//echo ' Cортировать по:<br />  '.$sortlink.'<br /><dt></dt>';
echo '<br /><img src="/img/load.png" alt=""/> <a href="/fo/upload"><b>Загрузить!</b></a><br /><br />';
$valid_sort = array('timeupload' => '','name' => '','data' => '','load' => '','size' => '','eval' =>'');
if(!isset($valid_sort[$sort])){
$sort='data';
}
$MODE = '`timeupload` DESC';
if($sort == 'name') $MODE = '`name` DESC';
elseif($sort == 'size') $MODE = '`size` ASC';
elseif($sort == 'load') $MODE = '`loads` DESC';
elseif($sort == 'eval') $MODE = '`yes` DESC ,`no` ASC';
$max = $user['max'];
$k_post=mysql_result(mysql_query("select COUNT(*) from `fo_files`;"),0);
$k_page=k_page($k_post,$max);
$page=page($k_page);
$start=$max*$page-$max;
if ($k_post==0)echo 'Здесь файлов пока нет :)<br />';
$q = mysql_query( "SELECT * from `fo_files` ORDER BY ".$MODE." limit $start,$max;" );
while ($file = @mysql_fetch_array(@$q))
{
if(is_file($file['path'])){
$ex = pathinfo($file['path']);
$ext = strtolower($ex['extension']);
/*//Предосмотр
$pre = '';
if ($ext == 'bmp') $pre = 'Предосмотр невозможен...<br>';
if ($ext == 'gif' or $ext == 'jpeg' or $ext == 'jpg' or $ext == 'png' or $ext == 'JPG' or $ext == 'GIF' or $ext == 'PNG'or $ext == 'JPEG') $pre = '<img style="margin: 1px;" src="/fo/img.php?bab=1&file='.$file['id'].'" alt=""/><br />';*/
//Новизна файла
$new_info='';
$filtime2 = $file['timeupload']+(3600*24*$set['fo_day_new']);
if($filtime2>=$time and $set['fo_day_new']!=0) $new_info = ' <img src="/fo/ext/new.gif" alt=""/>';
//Красивый размер
if($file['size'] < 1024) $file['size'] = '('.$file['size'].' б)';
if($file['size'] < 1048576 and $file['size'] >= 1024) $file['size'] = '('.round($file['size']/1024, 2).' Кб)';
if($file['size'] > 1048576) $file['size'] = '('.round($file['size']/1024/1024, 2).' Мб)';
//Иконка к файлу
if(!file_exists('ext/'.$ext.'.png') ) $ico = '<img src="/fo/ext/stand.png" alt=""/>';
/*elseif ($ext =='jar') $ico = ' <img src="/fo/ic.php?lf='.$file['path'].'&file='.$file[id].'" alt="" width="16" height="16"/>';*/
else $ico = '<img src="/fo/ext/'.$ext.'.png" alt=""/>';
//Показ расиширения
$extension = "$ext|";
$file['size']=str_replace(')','',$file['size']);
$file['size']=str_replace('(','',$file['size']);
echo $div1.''.$ico.' <a href="/fo/'.$file['id'].'"><strong>'.$file['name'].'</strong></a>  ['.$extension.$file['size'].']'.$new_info.$div9.'';
echo ' <img src="/fo/ext/load.gif" alt=""/> <a href="/fo/load/'.$file['id'].'">Скачать</a>';
if(empty($file['pass'])){
if($ext =='txt')echo '|<a href="/fo/read/'.$file['id'].'">Читать</a>';
echo '<br />';
$bolt=0;
if(($ext == 'avi' || $ext == '3gp' || $ext == 'mp4') && extension_loaded('ffmpeg')){
$pre = '<img style="margin: 1px;" src="/fo/ffmpeg.php?file='.$file['id'].'" alt=""/><br />';
$bolt=1;
}
/*else if($ext == 'thm' || $ext == 'nth'){
$pre = '<img style="margin: 1px;" src="/fo/theme.php?file='.$file['id'].'" alt="prev"/><br />';
$bolt=1;
}*/
if(($ext == 'avi' || $ext == 'flv' || $ext =='swf' || $ext =='mp4') AND (
!$h_ua ||
strpos($h_ua, 'windows') !== false ||
strpos($h_ua, 'linux') !== false ||
strpos($h_ua, 'bsd') !== false ||
strpos($h_ua, 'x11') !== false ||
strpos($h_ua, 'unix') !== false ||
strpos($h_ua, 'macintosh') !== false ||
strpos($h_ua, 'macos') !== false))
{
$pre ='<object type="application/x-shockwave-flash" data="uflvplayer_500x375.swf" height="99" width="125">
<param name="bgcolor" value="#DFE6EF" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="movie" value="uflvplayer_500x375.swf" />
<param name="FlashVars" value="way=/fo/'.$file['path'].'&swf=uflvplayer_500x375.swf&w=400&h=300&pic=/fo/ffmpeg.php?file='.$file['id'].'&autoplay=0&tools=1&skin=white&volume=70&q=&comment=" /></object><br />';
}
if($ext == 'mp3' or $ext == 'wav'){
if (
!$h_ua ||
strpos($h_ua, 'windows') !== false ||
strpos($h_ua, 'linux') !== false ||
strpos($h_ua, 'bsd') !== false ||
strpos($h_ua, 'x11') !== false ||
strpos($h_ua, 'unix') !== false ||
strpos($h_ua, 'macintosh') !== false ||
strpos($h_ua, 'macos') !== false)
{
echo'Прослушка: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 " width="96" height="20" id="own_flashplayer" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<embed src="/fo/own_flashplayer_plc.swf?file=/fo/'.$file['path']. '&sta rtplay=false" quality="high" bgcolor="#0B91C4" width="96" height="20" name="own_flashplayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object><br />';
}}
echo $pre;
/*echo'<a href="komm.php?file='.$id2.'">Ком.: ['.$all_komments.']</a>|Рейтинг:<font color="black">'.$file['yes'].'</font>/<font color="red">'.$file['no'].'</font><font color="blue">|Скач.:</font>['.$file['loads'].']<br/>';*/
}
$opis=$file['about'];
$opis=substr($opis,0,100);
$opis = htmlentities($opis, ENT_QUOTES, 'UTF-8');
echo '<br />'.$opis.'...<br />';
}else {mysql_query("DELETE FROM `fo_files` where id = '".$file['id']."'");
}
echo '<dl></dl>';
}
if ($k_page>1){
echo '<br/><dl><dt></dt></dl>';
str("?",$k_page,$page); // Вывод страниц
echo '<br/><dl><dt></dt></dl>';
}
echo '<br /><img src="/img/load.png" alt=""/> <a href="/fo/upload/'.$fid.'/'.$fid2.'"><b>Загрузить!</b></a><br /><br />';
echo "<br/>";
echo $div1.'<a href="/fo">Обменник</a>'.$div9;
include_once (H.'shaxty/foot.php');
?>