-
Notifications
You must be signed in to change notification settings - Fork 0
/
detail.php
241 lines (204 loc) · 8.06 KB
/
detail.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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<? require "imagesharing/header2.php";
$file = check_input($_GET['filename']);
$view = check_input($_GET['view']);
if ($file == "") {
header("Location: " . $server_url);
exit;
}
$t1=mktime(0,0,0,date("m"),date("d"),date("y"));
$t2=($t1+24*60*50)-1;
$currentip = $_SERVER['REMOTE_ADDR'];
$query1 = "select * from images where filename='$file'";
$result1 = mysql_query($query1) or die("Query failed1.");
if(mysql_num_rows($result1) ==0) { ?>
<div id="error"><div class="msg" id="sucmsgid"> <?
echo "请求的图片不存在"; ?>
</div></div>
<META HTTP-EQUIV="refresh" CONTENT="3;URL=gallery.php">
<?
}
while ($row = mysql_fetch_array($result1))
{
$uploaderid=$row['userid'];
$filesize1=$row['filesize'];
$file_path=$row['filepath'];
$date_added=date("jS F Y", $row[added]);
}
if($filesize1=="" or $file_path=="")
{
$err = "Image Not found";
$query2 = "select filesize,filepath,filename,tn_filename from images order by rand() limit 1";
$result2 = mysql_query($query2) or die("Query failed2.");
while ($line1 = mysql_fetch_array($result2)) {
$filesize1=$line1[filesize];
$file_path=$line1[filepath];
}
}
$query3 = "select count(*) as total from imagehits where filename='$file'";
$result3 = mysql_query($query3) or die("Query failed3.");
while ($line2 = mysql_fetch_array($result3)) {
$view1=$line2[total];
}
$referer = $_SERVER['HTTP_REFERER'];
/* if($view1>0)
$kb=$view1*$filesize1;
else
$kb=$filesize1;
$timestamp=time();
$sql="insert into imagehits set referer='".$referer."', kb=$kb, filename='".$file."',ip='".$currentip."',timestamp='".$timestamp."'";
mysql_query($sql) or die("Query failed3.");
*/
$timestamp=time();
$sql="insert into imagehits set referer='".$referer."', kb=$filesize1, filename='".$file."',ip='".$currentip."',timestamp='".$timestamp."'";
mysql_query($sql) or die("Query failed3.");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<link href="static/css/detail.css" rel="stylesheet" type="text/css">
</head>
<body id="page-post" class="main-body">
<? require "header.php"?>
<div id="container" style="">
<div id="main">
<div id="block-content">
<div class="post-info-pad">
<h1>
<?php
// TODO
?>
</h1>
<p>
<a href="
<?
// TODO URL OF USER
?>
">
<?php
echo $uploaderid;
?>
</a>
<span class="seperator">|</span>
<?php
// TODO
echo $date_added;
?>
<span class="comment"><?php
// TODO ��������
?></span>
<span class="loved"><span id="love_count_
<?php
// TODO love count
?>" votes="
<?php
//TODO VOTE COUNT
?>
" score="
<?php
// TODO score
?>
">
</span></span>
</p>
<ul class="actions">
<li><a id="post_view_love" rel="
<?php
// TODO pic id
?>
" class="love " href="javascript:void(0);">Love</a></li>
</ul>
</div><!--end post-info-pad-->
<div id="post-control-bar" class="spread-bar-wrap">
<div class="spread-bar">
<!-- JiaThis Button BEGIN -->
<div id="ckepop">
<span class="jiathis_txt">评论</span>
<a class="jiathis_button_tools_1"></a>
<a class="jiathis_button_tools_2"></a>
<a class="jiathis_button_tools_3"></a>
<a class="jiathis_button_tools_4"></a>
<a href="http://www.jiathis.com/share?uid=1586402" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank">分享</a>
<a class="jiathis_counter_style"></a>
</div>
</div>
<div class="post-next-prev">
<a id="prev_post" class="prev-post" href="http://9gag.com/gag/3256248" onclick="_gaq.push(['_trackEvent', 'View-Post', 'Clicked', 'Previous', 1]);"></a>
<a id="next_post" class="next-post" href="http://9gag.com/gag/3256314" onclick="_gaq.push(['_trackEvent', 'View-Post', 'Clicked', 'Next', 1]);"></a>
</div>
<script type="text/javascript">var jiathis_config = {data_track_clickback:true};</script>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js?uid=1586402" charset="utf-8"></script>
</div>
<!-- JiaThis Button END -->
<!-- JiaThis Button BEGIN -->
<script type="text/javascript">var jiathis_config = {data_track_clickback:true};</script>
<script type="text/javascript" src="http://v2.jiathis.com/code/jiathis_r.js?type=left&move=0&uid=1586402" charset="utf-8"></script>
<!-- JiaThis Button END -->
<div id="content">
<div class="post-container">
<div class="img-wrap">
<a href="/random">
<img src="<?=$file_path.$file?>" alt="
<?
echo "filename";
?>" border="0" style="max-width:800px"/>
</a>
</div><!--end image-wrap-->
</div><!--end post-container-->
<div class="comment-section">
<h3 class="title" id="comments">评论</h3>
<span class="report-and-source">
<p>
<a class="fix" href="<?php
// �ж��Ƿ��¼���ҵ�¼
?>">帖子有问题</a>
<span id="report-item-separator">|</span>
<a class="report" href="">X和谐</a>
<span id="report-item-separator">|</span>
δ֪ </p>
</span>
<div id="entry-comments" style="text-align:center">
<?php
?>
<!-- UY BEGIN -->
<div id="uyan_frame"></div>
<script type="text/javascript" id="UYScript" src="http://v1.uyan.cc/js/iframe.js?UYUserId=90227" async=""></script>
<!-- UY END -->
</div>
</div><!--end div.comment-section-->
<br>
</div>
</div><!--end div.block-content-->
</div><!--end div#main-->
<script type="text/javascript">
</script>
<div class="side-dock">
<div id="special-button">
<script type="text/javascript">rmt('http://goo.gl/ktrVc?a=148');</script>
<a class="special-btn green" href="https://prenoon.com/signup" label="Sidebar" onclick="rmt('http://goo.gl/4L7Xz?a=402');">�㻹δ��¼</a>
</div>
<div class="s-300">
<script type="text/javascript">
try {
GA_googleFillSlotWithSize("ca-pub-0268871989845966", "Top-Right-300x250", 300, 250);
} catch (e) {}
</script>
<div id="google_ads_div_Top-Right-300x250"><ins style="position:relative;width:300px;height:250px;border:none;display:inline-table;">
<ins style="position:relative;width:300px;height:250px;border:none;display:block;">
<iframe id="google_ads_iframe_Top-Right-300x250" name="google_ads_iframe_Top-Right-300x250" width="300" height="250" vspace="0" hspace="0" allowtransparency="true" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" style="border:0px;left:0;position:absolute;top:0;" src="http://pubads.g.doubleclick.net/gampad/ads?correlator=1330165484054&output=html&impl=ifr&client=ca-pub-0268871989845966&slotname=Top-Right-300x250&page_slots=Top-Right-300x250&cookie=ID%3D2c8de1e47b8d646a%3AT%3D1329576818%3AS%3DALNI_MZbfaK_OJgtwVcE37f4xvON9zfePQ&url=http%3A%2F%2F9gag.com%2Fgag%2F2140534&ref=http%3A%2F%2Flocalhost%2Fprenoon%2Fdetail.php&lmt=1330136684&dt=1330165484063&biw=1263&bih=675&adk=1086858102&adx=861&ady=142&ifi=1&oid=3&u_tz=480&u_his=4&u_java=true&u_h=800&u_w=1280&u_ah=760&u_aw=1280&u_cd=32&u_nplug=28&u_nmime=82&flash=11.1.102&gads=v2&ga_vid=95337883.1330165484&ga_sid=1330165484&ga_hid=3029064"></iframe></ins></ins></div>
</div>
<div id="post-gag-stay" class="_badge-sticky-elements" data-y="60">
<div class="popular-block">
<h3>�����ƽ�</h3>
<ol>
<?php
// TODO �Ƽ�ģ��
?>
</ol>
</div>
</div>
</div><!--end div.side-dock-->
</div>
</body>
</html>