digg_frame.htm
3.24 KB
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang;?>" />
<title>digg</title>
<style>
body {
text-align:center;
}
#digg {
margin:0 auto;
width:420px;
overflow:hidden;
}
.diggbox {
cursor:pointer;
float:left;
height:51px;
margin-right:8px;
overflow:hidden;
width:195px;
}
.diggbox .digg_act {
float:left;
font-size:14px;
font-weight:bold;
height:29px;
line-height:31px;
overflow:hidden;
text-indent:32px;
}
.diggbox .digg_num {
float:left;
line-height:29px;
text-indent:5px;
}
.diggbox .digg_percent {
text-align:left;
clear:both;
overflow:hidden;
padding-left:10px;
width:180px;
}
.diggbox .digg_percent .digg_percent_bar {
background:#E8E8E8 none repeat scroll 0 0;
border-right:1px solid #CCCCCC;
float:left;
height:7px;
margin-top:3px;
overflow:hidden;
width:100px;
}
.diggbox .digg_percent .digg_percent_num {
float:left;
font-size:10px;
padding-left:10px;
}
.diggbox .digg_percent .digg_percent_bar span {
background:#000000 none repeat scroll 0 0;
display:block;
height:5px;
overflow:hidden;
}
.digg_good {
background:transparent url(../templets/default/images/newdigg-bg.png) no-repeat scroll left top;
}
.digg_bad {
background:transparent url(../templets/default/images/newdigg-bg.png) no-repeat scroll right top;
}
.digg_good .digg_act {
color:#CC3300;
}
.digg_good .digg_num {
color:#CC6633;
}
.digg_bad .digg_act {
color:#3366CC;
}
.digg_bad .digg_num {
color:#3399CC;
}
.digg_good .digg_percent .digg_percent_bar span {
background:#FFC535 none repeat scroll 0 0;
border:1px solid #E37F24;
}
.digg_bad .digg_percent .digg_percent_bar span {
background:#94C0E4 none repeat scroll 0 0;
border:1px solid #689ACC;
}
</style>
<script>
//读写cookie函数
function GetCookie(c_name)
{
if (document.cookie.length > 0)
{
c_start = document.cookie.indexOf(c_name + "=")
if (c_start != -1)
{
c_start = c_start + c_name.length + 1;
c_end = document.cookie.indexOf(";",c_start);
if (c_end == -1)
{
c_end = document.cookie.length;
}
return unescape(document.cookie.substring(c_start,c_end));
}
}
return null
}
function SetCookie(c_name,value,expiredays)
{
var exdate = new Date();
exdate.setDate(exdate.getDate() + expiredays);
document.cookie = c_name + "=" +escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); //使设置的有效时间正确。增加toGMTString()
}
function postDigg(ac, aid)
{
var saveid = GetCookie('diggid');
if(saveid != null)
{
var saveids = saveid.split(',');
var hasid = false;
saveid = '';
j = 1;
for(i=saveids.length-1;i>=0;i--)
{
if(saveids[i]==aid && hasid) continue;
else {
if(saveids[i]==aid && !hasid) hasid = true;
saveid += (saveid=='' ? saveids[i] : ','+saveids[i]);
j++;
if(j==20 && hasid) break;
if(j==19 && !hasid) break;
}
}
if(hasid) { alert("您已经顶过该帖,请不要重复顶帖 !"); return false; }
else saveid += ','+aid;
SetCookie('diggid',saveid,1);
} else {
SetCookie('diggid',aid,1);
}
location.href='digg_frame.php?action='+ac+'&id='+aid;
}
</script>
<body>
<div id="digg">
<?php
echo $digg;
?>
</div>
</body>
</html>