-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.php
49 lines (48 loc) · 1.69 KB
/
demo.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
<?php
/**
* 文件演示页面
* @copyright (c) Emlog All Rights Reserved
*/
require_once 'init.php';
$id=addslashes($_GET['id']);
$options_cache = $CACHE->readCache('options');
$db = Database::getInstance();
$data = $db->query("SELECT * FROM ".DB_PREFIX."cpdown WHERE logid ='$id'");
$row = $db->fetch_array($data);
$title = htmlspecialchars($row['name']);
if(empty($id)){
emDirect(BLOG_URL);
}elseif(empty($row['yanshi'])){
emDirect(BLOG_URL);
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title><?php echo $title; ?>_<?php echo $options_cache['blogname']; ?></title>
<style>
body{margin: 0;padding: 0;font-family: 'microsoft yahei';font-size: 14px;overflow: hidden;}
#demobar{background-color: #444;color: #eee;height: 32px;line-height: 32px;position: relative;z-index: 9}
#demologo{float: left;padding: 0 20px;position: relative;}
#demoaction{float: right;}
#demoaction a{display: inline-block;padding: 0 30px;color: #fff;background-color: #61B3E6;text-decoration: none;}
#demoaction a:hover{background-color: #3DA3E2;}
#demoframe{position: absolute;top: 32px;bottom: 0;left: 0;right: 0;}
#demoframe iframe{border: 0;width: 100%;height: 100%;margin: 0;position: absolute;top: 0;bottom: 0;left: 0;right: 0;}
</style>
</head>
<body>
<h1 style="display:none"><?php echo $title; ?>_<?php echo $options_cache['blogname']; ?></h1>
<div id="demobar">
<div id="demologo"><?php echo $title; ?>官方演示</div>
<div id="demoaction">
<a target="_blank" href="<?php echo BLOG_URL; ?>download.php?id=<?php echo $id; ?>">点击下载</a>
</div>
</div>
<div id="demoframe">
<iframe src="<?php echo $row['yanshi']; ?>" frameborder="0"></iframe>
</div>
<div style="display:none"></div>
</body>
</html>