-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathdelayedRedirect.php
224 lines (208 loc) · 10.5 KB
/
delayedRedirect.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
212
213
214
215
216
217
218
219
220
221
222
223
224
<?php
/* setup includes */
require_once('includes/master.inc.php');
if (!isset($file))
{
die("Error: No file found.");
}
require_once('_header.php');
?>
<script>
<!--
var milisec = 0;
var seconds = <?php echo (int) SITE_CONFIG_REDIRECT_DELAY_SECONDS; ?>;
function display()
{
$('.btn-free').hide();
$('.download-timer').show();
if (milisec<=0)
{
milisec = 9;
seconds -= 1;
}
if (seconds<=-1)
{
milisec = 0;
seconds += 1;
}
else
{
milisec -= 1;
}
if(seconds == 0)
{
$('.download-timer').html("<a href='<?php echo $file->getFullShortUrl(); ?>?d=1'><?php echo t("download_now", "download now"); ?></a>");
}
else
{
$('.download-timer-seconds').html(seconds);
setTimeout("display()", 100);
}
}
$(document).ready(function() {
$('.download-timer-seconds').html(<?php echo SITE_CONFIG_REDIRECT_DELAY_SECONDS; ?>);
});
-->
</script>
<?php
// figure out upgrade url
$auth = Auth::getAuth();
$url = WEB_ROOT."/register.".SITE_CONFIG_PAGE_EXTENSION;
if($auth->loggedIn == true)
{
$url = WEB_ROOT."/upgrade.".SITE_CONFIG_PAGE_EXTENSION;
}
?>
<div class="contentPageWrapper">
<div class="pageSectionMainFull ui-corner-all">
<div class="pageSectionMainInternal">
<!-- top ads -->
<div class="metaRedirectWrapperTopAds">
<?php echo SITE_CONFIG_ADVERT_DELAYED_REDIRECT_TOP; ?>
</div>
<div class="downloadPageTable">
<table>
<tbody>
<tr>
<th class="descr">
<strong>
<?php echo $file->originalFilename; ?> (<?php echo formatSize($file->fileSize); ?>)<br/>
</strong>
<?php echo t('choose_free_or_premium_download', 'Choose free or premium download'); ?>
</th>
<th>
<a class="link btn-free" href="#" onClick="display(); return false;">
<?php echo strtoupper(t('slow_download', 'slow download')); ?>
</a>
<div class="download-timer" style="display:none;">
<?php echo UCFirst(t('wait', 'wait')); ?> <span class="download-timer-seconds"></span> <?php echo t('sec', 'sec'); ?>.<br/>
<span id="loadingSpinner">
<img src="<?php echo SITE_IMAGE_PATH; ?>/loading_small.gif" alt="<?php echo t("please_wait", "please wait"); ?>" width="16" height="16" style="padding-top: 8px;"/><br/>
</span>
</div>
</th>
<th>
<a class="link premiumBtn" href="<?php echo $url; ?>">
<?php echo strtoupper(t('fast_instant_download', 'FAST INSTANT DOWNLOAD')); ?>
</a>
</th>
</tr>
<tr>
<td class="descr">
<?php echo UCFirst(t('download_type', 'download type')); ?>:
</td>
<td><?php echo UCFirst(t('free', 'free')); ?></td>
<td>
<strong>
<?php echo UCFirst(t('premium', 'premium')); ?>
</strong>
</td>
</tr>
<tr>
<td class="descr">
<?php echo UCFirst(t('download_speed', 'download speed')); ?>:
</td>
<td>
<?php echo SITE_CONFIG_FREE_USER_MAX_DOWNLOAD_SPEED>0?formatSize(SITE_CONFIG_FREE_USER_MAX_DOWNLOAD_SPEED).'ps':UCFirst(t('limited', 'limited')); ?>
</td>
<td>
<strong>
<?php echo UCFirst(t('maximum', 'maximum')); ?>
</strong>
</td>
</tr>
<tr>
<td class="descr">
<?php echo UCFirst(t('waiting_time', 'waiting time')); ?>:
</td>
<td><?php echo SITE_CONFIG_REDIRECT_DELAY_SECONDS>0?SITE_CONFIG_REDIRECT_DELAY_SECONDS.' '.UCFirst(t('seconds', 'seconds')):UCFirst(t('instant', 'instant')); ?></td>
<td>
<strong>
<?php echo UCFirst(t('instant', 'instant')); ?>
</strong>
</td>
</tr>
<tr>
<td class="descr">
<?php echo UCFirst(t('site_advertising', 'site advertising')); ?>:
</td>
<td>
<?php echo UCFirst(t('yes', 'yes')); ?>
</td>
<td>
<strong>
<?php echo UCFirst(t('none', 'none')); ?>
</strong>
</td>
</tr>
<tr>
<td class="descr">
<?php echo UCFirst(t('how_long_to_keep_files', 'how long to keep files')); ?>:
</td>
<td><?php echo SITE_CONFIG_FREE_USER_UPLOAD_REMOVAL_DAYS; ?> <?php echo UCFirst(t('days', 'days')); ?></td>
<td><?php echo UCFirst(t('forever', 'forever')); ?></td>
</tr>
<tr>
<td class="descr">
<?php echo UCFirst(t('maximum_file_upload_size', 'Maximum file upload size')); ?>:
</td>
<td><?php echo SITE_CONFIG_FREE_USER_MAX_UPLOAD_FILESIZE>0?formatSize(SITE_CONFIG_FREE_USER_MAX_UPLOAD_FILESIZE):UCFirst(t('unlimited', 'unlimited')); ?></td>
<td><?php echo SITE_CONFIG_PREMIUM_USER_MAX_UPLOAD_FILESIZE>0?formatSize(SITE_CONFIG_PREMIUM_USER_MAX_UPLOAD_FILESIZE):UCFirst(t('unlimited', 'unlimited')); ?></td>
</tr>
<tr>
<td class="descr">
<?php echo UCFirst(t('interface_to_manage_uploaded_files', 'interface to manage uploaded files')); ?>:
</td>
<td><?php echo UCFirst(t('not_available', 'not available')); ?></td>
<td><?php echo UCFirst(t('available', 'available')); ?></td>
</tr>
<tr>
<td class="descr">
<?php echo UCFirst(t('fast_download_even_when_servers_are_busy', 'fast download even when servers are busy')); ?>:
</td>
<td><?php echo UCFirst(t('not_available', 'not available')); ?></td>
<td><?php echo UCFirst(t('available', 'available')); ?></td>
</tr>
<tr>
<td class="descr">
<?php echo UCFirst(t('estimated_download_time', 'estimated Download time')); ?>:
</td>
<td>
<a class="link btn-free" href="#" onClick="display(); return false;">
<?php
$speed = 0;
if(SITE_CONFIG_FREE_USER_MAX_DOWNLOAD_SPEED > 0)
{
$speed = SITE_CONFIG_FREE_USER_MAX_DOWNLOAD_SPEED;
}
echo calculateDownloadSpeedFormatted($file->fileSize, $speed);
?>
</a>
<div class="download-timer" style="display:none;">
<?php echo UCFirst(t('wait', 'wait')); ?> <span class="download-timer-seconds"></span> <?php echo t('sec', 'sec'); ?>.
</div>
</td>
<td>
<a class="link premiumBtn" href="<?php echo $url; ?>">
<?php echo calculateDownloadSpeedFormatted($file->fileSize, 0); ?>
</a>
</td>
</tr>
</tbody>
</table>
</div>
<!-- bottom ads -->
<div class="metaRedirectWrapperBottomAds">
<?php echo SITE_CONFIG_ADVERT_DELAYED_REDIRECT_BOTTOM; ?>
</div>
<div id="pageHeader" style="padding-top: 18px;">
<h2><?php echo t("account_benefits", "account benefits"); ?></h2>
</div>
<div class="clear"><!-- --></div>
<?php include_once('_upgradeBenefits.inc.php'); ?>
</div>
</div>
</div>
<?php
require_once('_footer.php');
?>