-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlist.php
211 lines (207 loc) · 7.62 KB
/
list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
/***************************************************************************
* Copyright (C) 2010 by Periklis Ntanasis , Ammar Qammaz *
*
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
$time_enter=microtime(true);
require("configuration.php");
require("stat_keeper.php");
require("cleaning_support.php");
require("visuals.php");
require("footer.php");
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="el" xml:lang="el">
<head>
<meta name="author" content="Ammar Qammaz" >
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<meta name="keywords" content="personal uploader" />
<meta name="description" content="" />
<meta name="distribution" content="global" />
<title>MyLoader @ <?php echo $HOST_NAME; ?></title>
<link rel="stylesheet" type="text/css" href="myloader.css" />
<?php echo $HEAD_HTML_INJECTION; ?>
</head>
<body><?php header_bar(); ?>
<center>
<?php
if ( $WILL_CHECK_IF_UPLOAD_DIR_NEEDS_CLEANING==1 )
{
check_and_clean_uploads();
}
if($ENABLE_FILE_INDEXING==1)
{
?>
<script type="text/javascript">
function sortByNameA(a,b) {
var x = a[0].toLowerCase();
var y = b[0].toLowerCase();
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
}
function sortByNameD(a,b) {
var x = a[0].toLowerCase();
var y = b[0].toLowerCase();
return ((x > y) ? -1 : ((x < y) ? 1 : 0));
}
function sortByHoursA(a,b) {
var x = a[2];
var y = b[2];
return (x-y);
}
function sortByHoursD(a,b) {
var x = a[2];
var y = b[2];
return (y-x);
}
function sortBySizeA(a,b) {
var x = a[3];
var y = b[3];
return (x-y);
}
function sortBySizeD(a,b) {
var x = a[3];
var y = b[3];
return (y-x);
}
function showFiles(choice) {
var color = "#FFFFFF";
var flag = 0;
if(choice==1)
{
table.sort(sortByNameA);
document.getElementById('filehead').innerHTML = "<td>File name<a onclick=\"showFiles(2)\"> ↓</a></td>";
document.getElementById('filehead').innerHTML += "<td>Hours on server<a onclick=\"showFiles(3)\"> ↺</a></td>";
document.getElementById('filehead').innerHTML += "<td>~ Size (KB)<a onclick=\"showFiles(5)\"> ↺</a></td>";
}
else if(choice==2)
{
table.sort(sortByNameD);
document.getElementById('filehead').innerHTML = "<td>File name<a onclick=\"showFiles(1)\"> ↑</a></td>";
document.getElementById('filehead').innerHTML += "<td>Hours on server<a onclick=\"showFiles(3)\"> ↺</a></td>";
document.getElementById('filehead').innerHTML += "<td>~ Size (KB)<a onclick=\"showFiles(5)\"> ↺</a></td>";
}
else if(choice==3)
{
table.sort(sortByHoursA);
document.getElementById('filehead').innerHTML = "<td>File name<a onclick=\"showFiles(1)\"> ↺</a></td>";
document.getElementById('filehead').innerHTML += "<td>Hours on server<a onclick=\"showFiles(4)\"> ↓</a></td>";
document.getElementById('filehead').innerHTML += "<td>~ Size (KB)<a onclick=\"showFiles(5)\"> ↺</a></td>";
}
else if(choice==4)
{
table.sort(sortByHoursD);
document.getElementById('filehead').innerHTML = "<td>File name<a onclick=\"showFiles(1)\"> ↺</a></td>";
document.getElementById('filehead').innerHTML +="<td>Hours on server<a onclick=\"showFiles(3)\"> ↑</a></td>";
document.getElementById('filehead').innerHTML += "<td>~ Size (KB)<a onclick=\"showFiles(5)\"> ↺</a></td>";
}
else if(choice==5)
{
table.sort(sortBySizeA);
document.getElementById('filehead').innerHTML = "<td>File name<a onclick=\"showFiles(1)\"> ↺</a></td>";
document.getElementById('filehead').innerHTML += "<td>Hours on server<a onclick=\"showFiles(3)\"> ↺</a></td>";
document.getElementById('filehead').innerHTML += "<td>~ Size (KB)<a onclick=\"showFiles(6)\"> ↓</a></td>";
}
else if(choice==6)
{
table.sort(sortBySizeD);
document.getElementById('filehead').innerHTML = "<td>File name<a onclick=\"showFiles(1)\"> ↺</a></td>";
document.getElementById('filehead').innerHTML += "<td>Hours on server<a onclick=\"showFiles(3)\"> ↺</a></td>";
document.getElementById('filehead').innerHTML += "<td>~ Size (KB)<a onclick=\"showFiles(5)\"> ↑</a></td>";
}
for(var i=0;i<table.length;i++)
{
if(flag)
{
color="#FFFFFF";
flag=0;
}
else
{
color="#CCCCCC";
flag=1;
}
if(i==0)
{
document.getElementById('tablerow').innerHTML = "<tr>";
}
else
{
document.getElementById('tablerow').innerHTML += "<tr>";
}
s = table[i][1];
ext = s.substring(s.length-4).toLowerCase();
gdoc ="";
<?php
if($ENABLE_GOOGLEDOCS_LINK == 1)
{?>
if(ext==".pdf" || ext=="tiff" || ext==".ppt" || ext=="pptx")
{
gdoc = "<a target=\"_blank\" href=\"http://docs.google.com/viewer?url="+table[i][4]+"\"><img src=\"images/gdocs.jpg\" height=\"15\" width=\"13\" /></a>";
}<?php
}?>
document.getElementById('tablerow').innerHTML += "<td bgcolor='"+color+"'> "+gdoc+"<a href=\"vfile.php?i="+escape(table[i][1])+"\">"+table[i][0]+"</a> </td><td bgcolor='"+color+"'>"+table[i][2]+"</td><td bgcolor='"+color+"'>"+table[i][3]+"</td>";
document.getElementById('tablerow').innerHTML += "</tr>";
}
}
<?php
$target=$SCRIPT_LOCAL_BASE."uploads/";
$files=scandir($target);
$now=date("U");
$switch=0;
$i=0;
echo ' var table = new Array();';
foreach($files as $file)
{
if(strcmp($file,"index.html")==0 || strcmp($file,"check_x.png")==0 || strcmp($file,".")==0 || strcmp($file,"..")==0 || strcmp($file,".htaccess")==0)
{
continue;
}
$fileseconds=date("U", filemtime($target.$file));
$filehours=($now - $fileseconds)/3600;
$filename=substr($file,33);
echo '
var line=new Array(4);
line[0]="'.$filename.'";
line[1]="'.$file.'";
line[2]="'.intval($filehours).'";
line[3]="'.intval(filesize($target.$file)/1024).'";
line[4]="'.urlencode($SCRIPT_WEB_BASE."file.php?i=".urlencode($file)).'";
table['.$i.']=line;
';
$i++;
}
?>
</script>
<table>
<thead ><tr id="filehead"></tr></thead>
<tbody id="tablerow"></tbody>
</table>
<script type="text/javascript">
showFiles(1);
</script>
<?php
}
?>
<br/><br/><b><a href="index.php">Go Back?</a></b><br/><br/>
<?php
$cache_size = intval(get_cache_size()); //we get the cache size here because it is needed for the bottom line and for quota checks
write_footer($time_enter,$HOST_NAME,$LOCAL_PHP_FILE_LIMIT,$cache_size,$ENABLE_FILE_INDEXING,$ENABLE_MIRROR_LINK,$ENABLE_SHOW_STATS);
?>
</center>
</body>
</html>