forked from BIN-YEE/bae_tuchuang
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlist.php
162 lines (140 loc) · 5.16 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
<?php
include 'common.inc.php';
if(!$CurrUser){
header('location:/');
exit;
}
$page = max(1,intval($_GET['page']));
$pagesize = 60;
$userid = $CurrUser['userid'];
$platform = $CurrUser['platform'];
$sql="select count(0) as total from filestore nolock where userid = '".$userid."' and platform='".$platform."' ";
$query = $mysql->query($sql);
$row = $query->fetch_object();
$totalcount = $row->total;
$sql="select * from filestore nolock where userid = '".$userid."' and platform='".$platform."' order by id desc limit ".($page-1)*$pagesize." ,".$pagesize;
require_once "BaeLog.class.php";
$logger=BaeLog::getInstance();
$logger ->logNotice($sql);
$pagesize = ceil($totalcount/$pagesize);
$query = $mysql->query($sql);
$rows = array();
while ($obj = $query->fetch_object()) {
$rows[] = $obj;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title><?php echo SITENAME;?></title>
<!-- Our CSS stylesheet file -->
<link rel="stylesheet" href="/static/main_style.css" />
<link rel="stylesheet" href="/static/style.css" />
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="http://code.jquery.com/jquery-1.6.3.min.js"></script>
<script type="text/javascript" src="/static/js/jquery.lazyload.js"></script>
<script type="text/javascript">
$(function(){
$( 'div.picthumb img' ).imglazyload();
});
$(document).ready(function($) {
$('#bsaHolder').css('position','fixed');
$('#bsa_closeAd').click(function(){
$('#bsaHolder').hide();
});
$('#uploadlink').click(function(){
var id = "pass_script_cross";
//if(document.getElementById(id)) return;
var element = document.createElement("script");
element.setAttribute("type", "text/javascript");
element.setAttribute('charset','utf-8');
element.setAttribute("id", id);
element.setAttribute("src",'http://<?php echo HOST;?>/static/js/bookmark.js');
document.body.appendChild(element);
});
$('div.album li').hover(function(){
$(this).find('a.delete').toggle();
});
$('a.delete').click(function(){
var parent = $(this).parent();
if(confirm('确定要删除么?')){
var url='/delete/?fid='+$(this).attr('rel');
$.getJSON(url,function(data){
if(data.code==0){
parent.fadeOut(1000);
}
else
$('#notice').html(data.msg).show();
});
}
});
});
</script>
</head>
<body>
<div id="bsaHolder">
<div class="bsa_it_ad ad1 odd">
<img class="avatar" src="<?php echo $CurrUser['avatar'];?>" />
<p>
您好:<span class="icon_<?php echo $CurrUser['platform']?>"><?php echo $CurrUser['username'];?></span>,[<a href="/">首页</a>]<a href="/home?logout">退出</a>
</p>
<div style="clear:both;"></div>
</div>
<a href="#1" id="bsa_closeAd" title="关闭"></a>
</div>
<div id="body">
<div style="clear:both">
<?php if($pagesize>1):;?>
<ul class="pager">
<?php for($i = 1;$i<=$pagesize;$i++):;?>
<li>
<?php if($i==$page):;?>
<span><?php echo $i;?></span>
<?php else:?>
<a href="/list/?page=<?php echo $i;?>"><?php echo $i;?></a>
<?php endif;?>
</li>
<?php endfor;?>
</ul>
<?php endif;?>
</div>
<div class="album">
<?php if($rows):;?>
<ul>
<?php foreach($rows as $row):;?>
<li>
<a class="delete" rel="<?php echo $row->id;?>">x</a>
<div class="picthumb"><img src="/static/img/placeholder.png" lazy-src="http://bcs.duapp.com/<?php echo BUCKET;?>/<?php echo $row->filename;?>"/></div>
<span class="filesize">size:<?php echo setupSize($row->filesize);?> @ <?php echo date('Y-m-d H:i',$row->created);?></span>
<input type="text" onclick="this.select()" onmouseover="this.select()" onfocus="this.select()" readonly="readonly" class="picurl" value="http://bcs.duapp.com/<?php echo BUCKET;?>/<?php echo $row->filename;?>" />
</li>
<?php endforeach;?>
</ul>
<?php else:?>
哇!你居然一张图片都没有上传过,<a href="#1" id="uploadlink">马上传一张试试</a>~~~~
<?php endif;?>
</div>
<div style="clear:both">
<?php if($pagesize>1):;?>
<ul class="pager">
<?php for($i = 1;$i<=$pagesize;$i++):;?>
<li>
<?php if($i==$page):;?>
<span><?php echo $i;?></span>
<?php else:?>
<a href="/list/?page=<?php echo $i;?>"><?php echo $i;?></a>
<?php endif;?>
</li>
<?php endfor;?>
</ul>
<?php endif;?>
</div>
</div>
</body>
</html>
<?php
unset($rows);
?>