-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfooter.htm
137 lines (116 loc) · 4.81 KB
/
footer.htm
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
</div><!--/body-->
<div class="footer" role="contentinfo">
<p>$conf[app_copyright]</p>
<!--{if $conf[china_icp]}--><p>网站备案号:$conf[china_icp]</p><!--{/if}-->
<p>$_SERVER[time_fmt], 耗时:<!--{php echo number_format(microtime(1) - $_SERVER['starttime'], 4);}-->s</p>
<!-- 请尊重版权,不要删除下面的版权信息。如必须删除,请联系作者获得许可。 -->
<p>Powered by <a href="http://www.qt06.com/" target="_blank"><b>晴天无障碍建站系统</b> $conf[version]</a> Based on <a href="http://bbs.xiuno.com/" target="_blank">Xiuno BBS</a> </p>
</div>
<!--{require footer_debug.htm}-->
<script src="view/js/jquery.js" type="text/javascript" ></script>
<script src="view/js/jquery.browser.js" type="text/javascript" ></script>
<script src="view/bootstrap/js/bootstrap.min.js"></script>
<script src="view/js/common.js" type="text/javascript"></script>
<script src="view/js/dialog.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).on('click', 'a.ajaxdialog, input.ajaxdialog', ajaxdialog_click);
$(document).on('click', 'a.ajaxtoggle', ajaxtoggle_event);
//按钮空格激活
$(document).on("keydown", "[role='button']", function(e){if(e.which == 32) this.click();});
//qacms
$('#search input').focus(function() {$('#search').addClass('hover');});
$('#search input').blur(function() {$('#search').removeClass('hover');});
$('#search input').keyup(function(e) {
if(e.which == 13 || e.which == 10) {
var val = encodeURIComponent($(this).val());
$('#search_form').attr('action', '?search-index-keyword-'+val+'.htm');
$('#search_form').submit();
return false;
}
});
// 登陆后才能发帖
$('#create_thread').click(function() {
if(g_uid == 0) {
ajaxdialog_request('?user-login.htm', function() {
$('#create_thread').unbind('click');
ajaxdialog_request($('#create_thread').attr('href'));
$('#create_thread').click(function() {
ajaxdialog_request($('#create_thread').attr('href'));
});
}, {fullicon: 1});
return false;
} else {
ajaxdialog_request($('#create_thread').attr('href'), null);
return false;
}
});
//$('div.list .table tr:odd').not('tr.header').addClass('odd'); /* 奇数行的背景色 */
//$('div.list .table tr:last').addClass('last'); /* 奇数行的背景色 */
{if $_user[uid]}
// ------------------------> 短消息 start
function userlist_to_html(userlist) {
var s = '<div id="pm_userlist">';
for(k in userlist) {
var user = userlist[k];
s += '<a href="?pm-ajaxlist-uid-'+user.uid+'-ajax-1.htm" uid="'+user.uid+'" class="ajaxdialog" ajaxdialog="{position: \'center\', modal: false, cache: false}"><span class="avatar_small" style="'+(user.avatar_small ? 'background-image: url('+user.avatar_small+')' : '')+'"></span> '+user.username+' (<b class="red">'+user.newpms+'</b>)</a>';
}
s += '</div>';
return s;
}
// 如果有新短消息,除了全局提示以外,再做一个全局标记,实现模拟即时聊天。
var g_newpm_userlist = null; // 全局变量
// 心跳频率 根据负载来调整,如果PV <10W: 1秒, <100w 2秒, <600w 3秒, 600w+, 5秒
var g_newpm_delay = $pm_delay;
function newpm() {
var _this = this;
_this.delay = g_newpm_delay;
_this.t = null;
_this.stop = function() {
if(_this.t) clearTimeout(_this.t);
};
_this.run = function() {
_this.stop();
_this.t = setTimeout(function() {
//print_r('?pm-new-ajax-1.htm');
$.get('?pm-new-ajax-1.htm', function(s) {
var json = json_decode(s);
if(error = json_error(json)) {return false;}
// alert(error);
if(json.status == 1) {
// hook footer_newpm_show_before.htm
var userlist = json.message;
g_newpm_userlist = userlist;
var s = userlist_to_html(userlist);
$('#pm a.pm').hide();
$('#pm a.newpm').show().unbind('mouseover').mouseover(function() {
$('#pm a.newpm').alert(s, {"width": 150, "pos": 7, "delay": 1000, "alerticon": 0});
});
_this.delay = g_newpm_delay;
_this.run();
} else if(json.status == 2) {
g_newpm_userlist = null;
_this.delay = _this.delay * 2;
_this.run();
} else if(json.status == -1) {
// 退出登录,什么都不做
} else {
// 发生错误,不提示,否则太频繁,影响用户体验。可以在后台查看PHP错误日志
// alert(json.message);
}
});
}, _this.delay);
};
return this;
}
//短消息轮询几乎无意义,屏蔽掉
//var newpm_instance = new newpm();
//newpm_instance.run();
{if DEBUG == 2}
//newpm_instance.stop();
{/if}
// ----------------> 短消息 end
// 鼠标放在上面,显示最后联系的5个人。
{/if}
</script>
<!--{hook footer_end.htm}-->
$conf[footer_js]