This repository has been archived by the owner on Mar 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 147
/
f.php
71 lines (68 loc) · 2.56 KB
/
f.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
<?php
require_once("config.php");//基础配置文件
require_once('includes/function.php');//函数库
require_once('includes/connect.php');
require_once('includes/smarty.inc.php');//smarty模板配置
require_once('includes/userShell.php');
$share_key=$_GET['k'];
$share_c=inject_check($share_key);
if($share_c=="bad"){exit();}
$result = mysqli_query($con,"SELECT * FROM sd_setting");//获取数据
while($row = mysqli_fetch_assoc($result)){
$tit= $row['main_tit'];
$theme= $row['theme'];
$des= $row['desword'];
$kw= $row['keyword'];
$tjcode= $row['tjcode'];
$share= $row['share'];
$url= $row['zzurl'];
}
if($share=="false"){
echo'<script>document.location="views/error.php";</script>';
exit();
}
$cha=mysqli_query($con,"SELECT * FROM sd_ss where sskey = '$share_key'");
if(mysqli_num_rows($cha)=="0"){
echo'<script>document.location="views/error.php?t=您访问的文件不存在或已被删除";</script>';
exit();
}
while($row1 = mysqli_fetch_assoc($cha)){
$fname= htmlspecialchars($row1['fname'],ENT_QUOTES,'utf-8');
$key1= $row1['filekey'];
$sstime= $row1['sstime'];
$num= $row1['downloadnum'];
}
$cha2=mysqli_query($con,"SELECT * FROM sd_file where key1 = '$key1'");
while($row2 = mysqli_fetch_assoc($cha2)){
$policyId = $row2['policyid'];
$uploadUser = $row2['upuser'];
$ming= htmlspecialchars($row2['ming'],ENT_QUOTES,'utf-8');
$array = explode(".",$ming);//分割文件名
$filetype=end($array);//获取文件扩展名
}
$array1 = explode(" ",$sstime);//分割文件名
$results = mysqli_query($con,"SELECT * FROM sd_policy where id = $policyId");
while(@$row3 = mysqli_fetch_assoc($results)){
$serverUrl = $row3['p_url'];
}
$smarty->template_dir = "content/themes/".$theme;
$head='<script type="text/javascript" src="includes/js/jquery-1.9.1.min.js"></script>';
$jscode=$tjcode;
$smarty->assign("uu", "f");
$smarty->assign("stype", "open");
$smarty->assign("tit", $tit); //应用标题
$smarty->assign("zzurl", $url);
$smarty->assign("fname", $fname); //文件名
$smarty->assign("fileurl", $serverUrl.$ming); //外链URL
$smarty->assign("ming",$ming); //外链URL
$smarty->assign("head", $head); //应用模板头
$smarty->assign("kw", $kw);
$smarty->assign("num", $num);
$smarty->assign("isVisitor", $isVisitor);
$smarty->assign("userinfo", $userInfo);
$smarty->assign("sskey", $share_key);
$smarty->assign("sstime", $array1[0]);
$smarty->assign("filetype", $filetype); //文件扩展名
$smarty->assign("jscode", 'Powered by <a target="_blank" href="http://yun.aoaoao.me">树洞外链</a> '.$jscode); //应用模板头
$smarty->display("share_pub.html"); // 输出页面
?>