File size: 12.51Kb
<?php
include "sys/cons.php";
include "sys/cepumi.php";
include "sys/funct.php";
include "sys/lang/$language.php";
include "sys/head.php";
include "sys/msg.php";
include "sys/zip.php";
$vards=parbaude($_GET['vards']);
$fails=parbaude($_GET['fails']);
$lapa = parbaude($_GET['lapa']);//lapa
$mape = error_checker(parbaude($_GET['mape']));//mapes apstrāde
echo'<div id="up" class="a"><img src="resursi/img/down.gif" alt="">
<a href="index.php?">'.NOSAUKUMS.'</a></div><br>';
$size = filesize($fails);//izmērs
$t = filemtime($fails);//
$neimss = format($vards);//nogriežam formātu
$neimss=str_replace(".$neimss","",$vards);
$apraksts = @file_get_contents("apraksts/$vards.txt");//apraksts op = apraksts
$nokachats = @file_get_contents("dati/$vards.count");//nokačāts ckz = nokachats
if($nokachats == ''){ $nokachats = 0;}//nokačajuma skaits nulle
$er = format($vards);//formāts
if(!$act){
echo'<div class="dl">';
if($er == 'png' or $er == 'gif' or $er == 'jpg' or $er == 'bmp' or $er == 'JPG' or $er == 'PNG' or $er == 'GIF') {
$sz = GetImageSize($fails);
$weigth = $sz[0];
$height = $sz[1];
}
echo'<div class="file">';
if(time() - filectime($fails) < IS_NEW_FILE) {echo'<b>(<font color="red">'.NEW_FILE_MESSAGE.'</font>)</b> ';}
echo'<b>'.$lang['fails'].': </b>';
if($er == 'png' or $er == 'gif' or $er == 'jpg' or $er == 'bmp' or $er == 'JPG' or $er == 'PNG' or $er == 'GIF'){echo'<a href="downer.php?fails='.$fails.'&vards='.$vards.'">'.$transs($neimss,$transs_bildem).'</a><br />';}else{
echo'<a href="downer.php?fails='.$fails.'&vards='.$vards.'">'.$transs($neimss,TRANSLATE_FILE).'</a><br />';}
echo'</div>';
echo'<div class="file">';
echo'<b>'.$lang['svara'].':</b> '.formatsizes($size).'<br />';
echo'<b>'.$lang['iekachats'].':</b> '.date ("d.m.y H:i:s.",$t).'<br />';
echo'<b>'.$lang['nokachats'].':</b> '.$nokachats.' '.$lang['nokachats2'].'<br />';
echo'<b>'.$lang['format'].':</b> '.$er.'<br />';
echo'</div>';
if($er =="mp3"){
$id3 = new MP3_Id();
$result = $id3->read($fails);
$result = $id3->study();
echo'<div class="file">';
echo'<b>'.$lang['mp3_kvalitate'].':</b> '.$id3->getTag('mode').'<br/>';
echo'<b>'.$lang['mp3_bitrate'].':</b> '.$id3->getTag('bitrate').' '.$lang['mp3_kb'].'<br/>';
echo'<b>'.$lang['mp3_lenght'].':</b> '.$id3->getTag('length').'<br/>';
echo'<b>'.$lang['mp3_frek'].':</b> '.$id3->getTag('frequency').' '.$lang['mp3_khz'].'<br/>';
echo'<form action="about.php?act=mp3rez&fails='.$fails.'&vards='.$vards.'&mape='.$mape.'" method="post">';
echo'<br><u>'.$lang['mp3_must_down'].' '.round($delete_laiks_mp3/60).' '.$lang['mp3_must_down2'].'</u><br/>';
echo'<b>'.$lang['mp3_rez'].'</b><br />';
echo'<b>'.$lang['mp3_way'].':</b><br><select name="way"><option value="size">'.$lang['mp3_way_size'].'</option>';
echo '<option value="time">'.$lang['mp3_way_time'].'</option></select><br>';
echo ''.$lang['mp3_start'].':<input type="text" name="s"/><br/>';
echo''.$lang['mp3_end'].':<input type="text" name="p"/><br/>';
echo'<input type="submit" value="'.$lang['mp3_go'].'"/></form>';
echo'</div>';
}
if($er == 'png' or $er == 'gif' or $er == 'jpg' or $er == 'bmp' or $er == 'JPG' or $er == 'PNG' or $er == 'GIF') {
echo'<div class="file">';
echo'<b>'.$lang['img_izmeri'].':</b> '.$weigth.' x '.$height.' px<br>';
echo'<b>'.$lang['screenshot'].':</b><br /><img src="prev.php?fails='.$fails.'&h=80&w=80"/><br />';
echo '<b>'.$lang['img_izmeri_ip'].':</b><br />
<a href="createimg.php?fails='.$fails.'&vards='.$vards.'&h=132&w=132"><b>132x132</b></a><br />
<a href="createimg.php?fails='.$fails.'&vards='.$vards.'&h=132&w=176"><b>132x176</b></a><br />
<a href="createimg.php?fails='.$fails.'&vards='.$vards.'&h=176&w=220"><b>176x220</b></a><br />
<a href="createimg.php?fails='.$fails.'&vards='.$vards.'&w=240&h=320"><b>320x240</b></a><br />
<b>'.$lang['img_izmeri_spec'].':</b><font color="blue">[<500x500]</font><br />
<form action="createimg.php?" method="GET">
<input type="text" name="w" size="3"> x <input type="text" name="h"size="3"> px
<input type="hidden" name="fails" value="'.$fails.'">
<input type="hidden" name="vards" value="'.$vards.'">
<input type="submit" value="'.$lang['img_down'].'">
</form>
';
echo'</div>';
}
if(file_exists('screens/'.$vards.'.png')) {echo'<div class="file">';
echo ''.$lang['screenshot'].':<br><img src="prev.php?fails=screens/'.$vards.'.png&w=50&h=50" /><br>
';
echo'</div>';}
if(file_exists('screens/'.$vards.'.gif')) {echo'<div class="file">';
echo ''.$lang['screenshot'].':<br><img src="prev.php?fails=screens/'.$vards.'.gif&w=50&h=50" /><br>
';
echo'</div>';}
if(file_exists('screens/'.$vards.'.jpg')) {echo'<div class="file">';
echo ''.$lang['screenshot'].':<br><img src="prev.php?fails=screens/'.$vards.'.jpg&w=50&h=50" /><br>
';
echo'</div>';}
if(file_exists('screens/'.$vards.'.JPG')) {echo'<div class="file">';
echo ''.$lang['screenshot'].':<br><img src="prev.php?fails=screens/'.$vards.'.JPG&w=50&h=50" /><br>
';
echo'</div>';}
if(file_exists('screens/'.$vards.'.GIF')) {echo'<div class="file">';
echo ''.$lang['screenshot'].':<br><img src="prev.php?fails=screens/'.$vards.'.GIF&w=50&h=50" /><br>
';
echo'</div>';}
if(file_exists('screens/'.$vards.'.PNG')) {echo'<div class="file">';
echo ''.$lang['screenshot'].':<br><img src="prev.php?fails=screens/'.$vards.'.PNG&w=50&h=50" /><br>
';
echo'</div>';}
//---------------------------
if(!empty($apraksts)) {
echo'<div class="file">';
echo '<b>'.$lang['opis'].':</b><br /> '.$apraksts.'<br>';
echo'</div>';
}else{
echo'<div class="file">';
echo'<b>'.$lang['opis'].':</b> '.$lang['no'].'<br>';
echo'</div>';}
echo'<div class="file">';
echo'<img src="resursi/img/file.gif" alt"" /> <a href="downer.php?fails='.$fails.'&vards='.$vards.'">'.$lang['down'].'</a><br>';
echo'</div>';
if($er == 'zip') {
echo'<div class="file">';
echo '<img src="resursi/img/ico/zip.gif" alt"" /> <a href="zip.php?&fails='.$fails.'&vards='.$vards.'&mape'.$mape.'">'.$lang['zip_look'].'</a><br />';
echo'</div>';}
//if($er == 'jar') {
//echo'<img src="resursi/img/ico/jad.gif" alt=""/> <a href="downer.php?fails='.$fails.'&vards='.$vards.'&mape='.$mape.'&tips=jad">'.$lang['downjad'].'</a><br />';
//}
echo'<div class="file">';
echo '<img src="resursi/img/koment.gif" alt"" /> <a href="about.php?act=comm&vards='.$vards.'&fails='.$fails.'&mape='.$mape.'">'.$lang['comm_add'].'</a>'.comm_count($vards).'';
echo'</div>';
//}
############################################################################
###################################### BALSOJUMS ###########################
############################################################################
if(!$_GET["gls"]) {
echo'<div class="file">';
echo '<b>
'.$lang['oc_ocen'].':</b><br />
<small>[<a href="ocen.php?gls=1&fails='.$fails.'&nm='.$vards.'&mape='.$mape.'">1</a>|<a href="about.php?gls=2&fails='.$fails.'&vards='.$vards.'&mape='.$mape.'">2</a>|<a href="about.php?gls=3&fails='.$fails.'&vards='.$vards.'&mape='.$mape.'">3</a>|<a href="about.php?gls=4&fails='.$fails.'&vards='.$vards.'&mape='.$mape.'">4</a>|<a href="about.php?gls=5&fails='.$fails.'&vards='.$vards.'&mape='.$mape.'">5</a>]</small>';
$uzhe = @file_get_contents('dati/'.md5($vards).'.balss');
$new = explode("\n",$uzhe);
$p2 = sizeof($new);
$bb = array_sum($new)/$p2;
echo '<br /><b>'.$lang['oc_golos'].':</b> '.($p2-1).'<br />';
echo'<b>'.$lang['oc_ocens'].':</b> '.round($bb,1).'';
echo'</div>';
} elseif($_GET["gls"]){
$gs = $_GET["gls"];
if($gs=="1"){$rs="1";}
if($gs=="2"){$rs="2";}
if($gs=="3"){$rs="3";}
if($gs=="4"){$rs="4";}
if($gs=="5"){$rs="5";}
if(!$gs==""){
$fp = @fopen('dati/'.md5($vards).'.balss',"a+");
@fputs($fp,$rs."\n");
@fclose($fp);
header ("Location: about.php?msg=addvote&fails=$fails&vards=$vards&mape=$mape"); exit;
}else{ header ("Location: about.php?msg=novote&fails=$fails&vards=$vards&mape=$mape"); exit;
}}
//------------------------ ADMINISTRĒŠANA --------------------------------\\
if (!$_SESSION['nick']=="" && !md5($_SESSION['par'])=="" && md5($_SESSION['par'])==$admins_par && $_SESSION['nick']==$admins_nick ) {
echo'<hr><a href="admin/admin.php?act=delfile&fails='.$fails.'&vards='.$vards.'&mape='.$mape.'">'.$lang['adm_del'].' ('.$transs($neimss,$transs_bildem).')</a><br />';
}
echo'<div class="file">';
echo '<b>'.$lang['fileurl'].':</b><br>
<input type="text" value="http://'.$homeurl.'/'.$folderscr.'/'.$fails.'"
<br />';
echo'</div>';
echo'</div>';//dl linija
}
####################################################################
if($act=="mp3rez"){
if($er=="mp3"){
if(!isset($s)||empty($s)){echo''.$lang['mp3_start_no'].'<br/>'; $error = 1;}
if(!isset($p)||empty($p)){echo''.$lang['mp3_end_no'].'<br/>'; $error = 1;}
$randintval = 'temp/mp3/'.$vards;
if(copy($fails,$randintval)){
$id3 = new MP3_Id();
$result = $id3->read($randintval);
$result = $id3->study();
$fp = fopen($randintval, "rb");
$raz = filesize($randintval);
$s = intval($s);
$p = intval($p);
if($way=="size"){
$s = $s*1024;
$p = $p*1024;
if($s>$raz||$s<0){$s = 0;}
if($p>$raz||$p<$s){$p = $raz;}
}elseif($way=="time"){
$id3 = new MP3_Id();
$result = $id3->read($randintval);
$result = $id3->study();
$byterate = $id3->getTag('bitrate')/8;
$secbit = $raz/1024/$byterate;
if($s>$secbit||$s<0){$s = 0;}
if($p>$secbit||$p<$s){$p = $secbit;}
$s = $s*$byterate*1024;
$p = $p*$byterate*1024;}
$p = $p-$s;
fseek($fp, $s);
$filefp = fread($fp, $p);
fclose($fp);
unlink($randintval);
$fp = fopen($randintval, "xb");
if(!fwrite($fp, $filefp) === FALSE){
header ("Location: downer.php?fails=$randintval&vards=$vards&mape=$mape");
}else{echo''.$lang['mp3_error'].'';}
}else{echo''.$lang['mp3_no_copy'].'<br>';}
fclose($fp);
}else{echo''.$lang['mp3_not'].'<br>';}
}
if($act=="comm"){
######################################################################
echo'<hr><form action="add.php?fails='.$fails.'&mape='.$mape.'&vards='.$vards.'" method="post">';
echo'<b>'.$lang['nick'].':</b><br><input type="text" name="nick" /><br>';
echo'<b>'.$lang['msg'].':</b><br>';
echo'<textarea cols="25" rows="3" name="msg"></textarea><br>';
echo''.$lang['transs'].': <input name="trans" type="checkbox" value="y" /><br>';
echo'<input type="submit" value="'.$lang['add'].'" /></form><hr>';
if(file_exists(BASE."dati/$vards.comm")){
$file = file(BASE."dati/$vards.comm");
$file = array_reverse($file);
$total = count($file);
if($total<1){echo'<br><b>'.$lang['comm_no'].'</b><br>';}
if (empty($_GET['start'])){ $start = 0;}
else $start = $_GET['start'];
if ($total < $start + COMMENTS_COUNT){ $end = $total; }
else {$end = $start + COMMENTS_COUNT; }
for ($i = $start; $i < $end; $i++){
$data = explode("|",$file[$i]);
$i2=round($i+1);
$data=preg_replace ("|[\r\n]+|si","",$data);
echo'<font color="red"><b>'.$data[1].'</b></font> <font color="purple">('.$data[2].'/'.$data[3].')</font><br>';
echo''.kods($data[0]).'<br>';
echo'<font color="navy">['.$data[4].'/'.$data[5].']</font><br><br>';
}
//echo'Kopā komentāru:'.$total.'<br>';
if ($start != 0) {echo '<a href="about.php?act=comm&fails='.$fails.'&vards='.$vards.'&mape='.$mape.'&start='.($start - COMMENTS_COUNT).'&'.SID.'"><-'.$lang['back'].'</a> ';}else{echo'<-'.$lang['back'].'';}
echo' | ';
if ($total > $start + COMMENTS_COUNT) {echo ' <a href="about.php?act=comm&fails='.$fails.'&vards='.$vards.'&mape='.$mape.'&start='.($start + COMMENTS_COUNT).'&'.SID.'">'.$lang['go'].'-></a>';}else{echo''.$lang['go'].'->';}
if($total>COMMENTS_COUNT*3){
$ba=ceil($total/COMMENTS_COUNT);
$ba2=$ba*COMMENTS_COUNT-COMMENTS_COUNT;
echo '<hr>'.$lang['pages'].':';
$asd=$start-(COMMENTS_COUNT*3);
$asd2=$start+(COMMENTS_COUNT*4);
if($asd<$total && $asd>0){echo ' <a href="about.php?act=comm&fails='.$fails.'&vards='.$vards.'&mape='.$mape.'&start=0">1</a> ... ';}
for($i=$asd; $i<$asd2;)
{
if($i<$total && $i>=0){
$ii=floor(1+$i/COMMENTS_COUNT);
if ($start==$i) {
echo ' <b>('.$ii.')</b>';
}
else {
echo ' <a href="about.php?act=comm&fails='.$fails.'&vards='.$vards.'&mape='.$mape.'&start='.$i.'">'.$ii.'</a>';
}}
$i=$i+COMMENTS_COUNT;}
if($asd2<$total){echo ' ... <a href="about.php?act=comm&fails='.$fails.'&vards='.$vards.'&mape='.$mape.'&start='.$ba2.'">'.$ba.'</a>';}
}
}else{echo''.$lang['comm_no'].'';}
echo '<br>';
######################################################################
}
echo'<hr><div align="center">';
echo '[<a href="index.php?mape='.$mape.'"><b>'.$lang['category'].'</b></a>]<br>';
echo'[<a href="http://'.$homeurl.'"><b>'.$lang['galvena'].'</b></a>]<br>';
echo'</div>';
include"sys/foot.php";
?>