⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 www2-main.js

📁 KBS的BBS源码
💻 JS
📖 第 1 页 / 共 3 页
字号:
			break;		case dir_modes["NORMAL"]:			str += '<a href="bbscon.php?bid=' + this.bid + '&id=' + id;			if (bf.toLowerCase() == 'd') str += "&ftype=" + dir_modes["ZHIDING"];			if (is_tex) str += '&tex=yes';			str += '">' + title + '</a>';			if (size >= 1000) {				str += '<span class="red">(' + (Math.floor(size / 100) / 10.0) + 'k)</span>';			} else {				str += '<span class="normal">(' + size + ')</span>';			}			if (is_tex) {				str += ' <a href="bbscon.php?bid=' + this.bid + '&id=' + id;				if (bf.toLowerCase() == 'd') str += "&ftype=" + dir_modes["ZHIDING"];				str += '">[TeX源码]</a>';			}			break;		default:			str += '<a href="bbscon.php?bid=' + this.bid + '&id=' + id + '&ftype=' + this.ftype + '&num=' + (this.start + this.num);			if (is_tex) str += '&tex=yes';			str += '">' + title + '</a>';			if (is_tex) {				str += ' <a href="bbscon.php?bid=' + this.bid + '&id=' + id + '&ftype=' + this.ftype + '&num=' + (this.start + this.num) + '">[TeX源码]</a>';			}			break;	}	str += '</td></tr>';	w(str);	this.num++;};function mansubmit(flag) {	document.manage.act.value = flag;	document.manage.submit();}docWriter.prototype.t = function() {	var ret = '';	ret += '</tbody></table>';	if (this.man) {		var bbsman_modes = {"DEL": 1, "MARK": 2, "DIGEST": 3, "NOREPLY": 4,	"ZHIDING": 5, "UNDEL": 6, "PERCENT": 7, "TODEL": 8, "SHARP": 9, "ANNOUNCE": 10, "ANNOUNCEADD": 11, "IMPORT_I": 12, "IMPORT_J": 13, "CENSOR": 14};		ret += '<input type="hidden" name="act" value=""/>';		if (this.ftype != dir_modes["DELETED"])		{ /* TODO: 这段似乎可以简化一点... */			ret += '<br>基本标记: [<a href="javascript:mansubmit(' + bbsman_modes['MARK'] + ');">切换M</a>]';			ret += ' [<a href="javascript:mansubmit(' + bbsman_modes['DIGEST'] + ');">切换G</a>]';			ret += ' [<a href="javascript:mansubmit(' + bbsman_modes['PERCENT'] + ');">切换%</a>]';			ret += ' [<a href="javascript:mansubmit(' + bbsman_modes['TODEL'] + ');">切换X</a>]';			ret += ' [<a href="javascript:mansubmit(' + bbsman_modes['SHARP'] + ');">切换#</a>]<br>';			ret += '其他操作: [<a href="javascript:if(confirm(\'确定要删除吗?\')){mansubmit(' + bbsman_modes['DEL'] + ');}">删除</a>]';			ret += ' [<a href="javascript:mansubmit(' + bbsman_modes['NOREPLY'] + ');">切换不可回复</a>]';			ret += ' [<a href="javascript:mansubmit(' + bbsman_modes['ZHIDING'] + ');">置底</a>]';			ret += ' [<a href="javascript:mansubmit(' + bbsman_modes['ANNOUNCE'] + ');">收精华区</a>]<br>';			ret += '暂 存 档: [<a href="bbsimport.php" target="_blank">看暂存档</a>]';			ret += ' [<a href="bbsimport.php?act=clear" target="_blank">清空</a>]';			ret += ' [<a href="javascript:mansubmit(' + bbsman_modes['IMPORT_I'] + ');">保留头尾</a>]';			ret += ' [<a href="javascript:mansubmit(' + bbsman_modes['IMPORT_J'] + ');">去掉头尾</a>]';		}		else		{			ret += '<input type="button" value="恢复到版面" onclick="mansubmit(' + bbsman_modes['UNDEL'] + ');"/>';		}		ret += '<br></form>';	}	ret += '<form action="bbsdoc.php" method="get" class="docPager smaller">';	ret += '<input type="hidden" name="board" value="' + this.board + '"/>';	if (this.man) {		ret += '<input type="hidden" name="manage" value="1"/>';	}	if (!this.ftype) {		if (isLogin()) {			var url = 'bbspst.php?board=' + this.board;			ret += '<a href="' + url + '" class="flimg">' + putImageCode('postnew.gif','alt="发表话题" class="flimg" onclick="location.href=\'' + url + '\';"') + '</a>';		}	} else {		ret += '<input type="hidden" name="ftype" value="' + this.ftype + '"/>';	}	if (!this.man) {		ret += '[<a href="javascript:location.reload()">刷新</a>]';	}	if (this.page > 1) {		ret += ' [<a href="' + this.baseurl + '&page=1">第一页</a>]';		ret += ' [<a href="' + this.baseurl + '&page=' + (this.page - 1) + '">上一页</a>]';	} else {		ret += ' [第一页] [上一页]';	}	if (this.start <= this.total - 20) {		ret += ' [<a href="' + this.baseurl + '&page=' + (this.page + 1) + '">下一页</a>]';		ret += ' [<a href="' + this.baseurl + '">最后一页</a>]';	} else {		ret += ' [下一页] [最后一页]';	}	ret += ' <input type="submit" value="跳转到"/> ';	ret += '第 <input type="text" name="start" size="3" onmouseover="this.focus()" onfocus="this.select()" /> 篇/共 ' + this.total + ' 篇';	ret += '</form>';	ret += '</div>'; //class="doc"	w(ret);		if (this.showHot && this.hotOpt == 0) hotTopic(this.board, this.bid);};docWriter.prototype.f = function(rss,related,isclub) {	var i,ret = '<div class="oper smaller">';	ret += '[<a href="bbsnot.php?board=' + this.board + '">进版画面</a>] ';	ret += '[<a href="bbsshowvote.php?board=' + this.board + '">版内投票</a>] ';	ret += '[<a href="bbsshowtmpl.php?board=' + this.board + '">发文模板</a>] ';	if (this.normalB && !this.man) {		ret += '<span id="kbsrc_clear" style="display:none;">[<a href="bbsclear.php?board=' + this.board + '&kbsrc=1">清除未读</a>] </span>';		ret += '<div id="kbsrcInfo">doc,' + this.bid + ',' + this.ids.join(',') + '</div>';	} else {		ret += '[<a href="bbsclear.php?board=' + this.board + '">清除未读</a>] ';	}	if (rss) {		ret += '<a href="' + rss + '" title="RSS"><img src="images/xml.gif"/></a>';	}	if (related) {		ret += '<br/>来这个版的人常去的其他版面:';		for (i=0;i<related.length;i++) {			ret += '[<a class="b3" href="bbsdoc.php?board=' + related[i] + '"><font class="b3">' + related[i] + '</font></a>]';		}	}	var allAds = [		/* ['TrafficInfo','http://www.kooxoo.com/?fromid=smthpic01','smth_piao.gif',300] */	];	for (i=0;i<allAds.length;i++) {		var ad = allAds[i];		if (this.board == ad[0]) {			ret += "<div><center>" + getAds(ad[2],ad[1],ad[3]) + "</center></div>";			break;		}	}	if (isBM(this.bid)) {		ret += '<br/>管理链接:';		ret += '[<a href="bbsdeny.php?board=' + this.board + '">封禁名单</a>] ';		ret += '[<a href="bbsmnote.php?board=' + this.board + '">进版画面</a>] ';		ret += '[<a href="bbsmvote.php?board=' + this.board + '">管理投票</a>] ';		if (this.man != 1) {			ret += '[<a href="bbsdoc.php?manage=1&board=' + this.board + '">管理模式</a>] ';		}		if (this.man) {			ret += '[<a href="bbsdoc.php?board=' + this.board + '">普通模式</a>] ';		}		if (isclub) {			ret += ' [<a href="bbsclub.php?board=' + this.board + '">俱乐部成员</a>]';		}		ret += ' [<a href="bbs0anbm.php?path=' + escape(this.apath) + '">精华区管理</a>]';	}	ret += '</div>';	w(ret);};function clearArticleDiv(id) {	if (parent && (divArtCon = parent.document.getElementById("art" + id))) {		divArtCon.innerHTML = "";	}}function conWriter(ftype, board, bid, id, gid, reid, favtxt, num, use_tex) {	this.board = escape(board);	this.ftype = ftype;	this.bid = bid;	this.id = id;	this.gid = gid;	this.reid = reid;	this.favtxt = favtxt;	this.num = num;	this.baseurl = "bbscon.php?bid=" + bid + "&id=" + id;	if (parent && (divArtCon = parent.document.getElementById("art" + id))) {		addBootFn(writeArticle);		return;	}	w("<div id='kbsrcInfo'>con," + bid + "," + id + "</div>");	if (!isLogin() && this.ftype) {		this.headers = "";		return;	}	var ret = '<div class="conPager smaller right">';	if (isLogin()) { /* TODO: 某些模式应该禁止显示这两个链接 */		var url = 'bbspst.php?board=' + this.board + '&reid=' + this.id ;		ret += '<a onclick="return showReplyForm(\'' + url + '\');" href="' + url + '">' + putImageCode('reply.gif','alt="回复帖子" class="flimg"') + '</a>';		url = 'bbspst.php?board=' + this.board;		ret += '<a href="' + url + '" class="flimg">' + putImageCode('postnew.gif','alt="发表话题" class="flimg" onclick="location.href=\'' + url + '\';"') + '</a>';	}	if (this.ftype == 0) {		var tex_app = '';		if (use_tex == 2) {			tex_app = '&tex=yes';			ret += '[<a href="' + this.baseurl + '">TeX源码</a>] ';		}		else if(use_tex == 1)			ret += '[<a href="' + this.baseurl + '&tex=yes">TeX数学公式</a>] ';		ret += '[<a href="' + this.baseurl + '&p=p' + tex_app + '">上一篇</a>] ';		ret += '[<a href="' + this.baseurl + '&p=n' + tex_app + '">下一篇</a>] ';		ret += '[<a href="' + this.baseurl + '&p=tp' + tex_app + '">同主题上篇</a>] ';		ret += '[<a href="' + this.baseurl + '&p=tn' + tex_app + '">同主题下篇</a>]';	} else {		ret += '<span style="color:#CCCCCC">[上一篇] [下一篇] [同主题上篇] [同主题下篇]</span>';	}	ret += '</div>';	this.headers = ret;}conWriter.prototype.h = function(isTop) {	if (divArtCon) return;	var ret = this.headers;	if (!isTop) ret = '</div>' + ret;	else ret += '<div class="article">';	w(ret);};conWriter.prototype.t = function() {	if (divArtCon) return;	var PAGE_SIZE = 20;	var url = "bbsdoc.php?board=" + this.board;	var zd = false;	if (this.ftype != dir_modes["ZHIDING"]) {		url += "&page=" + Math.floor((this.num + PAGE_SIZE - 1) / PAGE_SIZE);		if (this.ftype) url += "&ftype=" + this.ftype;	} else zd = true;	var ao = (!this.ftype || zd);	var ret = '<div class="oper smaller" id="idConOper">';	if (ao) {		var qry = '?board=' + this.board + '&id=' + this.id;		ret += '[<a href="bbstcon.php?board=' + this.board + '&gid=' + this.gid + '">同主题展开</a>] ';		ret += '[<a href="bbscon.php?bid=' + this.bid + '&id=' + this.gid + '">同主题第一篇</a>] ';		ret += '[<a href="bbstcon.php?board=' + this.board + '&gid=' + this.gid + '&start=' + this.id + '">从此处展开</a>] ';		ret += '[<a href="bbscon.php?bid=' + this.bid + '&id=' + this.reid + '" title="跳转到本文所回复的文章">溯源</a>] ';	}	ret += '[<a href="' + url + '">返回版面' + dir_name(this.ftype) + '</a>] ';	ret += '[<a href="javascript:history.go(-1)">快速返回</a>]<br/>';	if (ao && isLogin()) {		ret += '[<a href="bbsshowtmpl.php' + qry + '">模板回复</a>] ';		ret += '[<a href="bbsfwd.php' + qry + '">转寄</a>] ';		ret += '[<a href="bbsccc.php' + qry + '">转贴</a>] ';		if (!zd) ret += '[<a href="bbscommend.php' + qry + '">推荐</a>] ';		ret += '[' + this.favtxt + '] ';		ret += '[<a href="bbspstmail.php' + qry + '">回信</a>] ';		ret += '[<a href="bbsedit.php' + qry + '&ftype=' + this.ftype + '">修改</a>] ';		if (!zd) {			ret += '[<a href="bbsprop.php' + qry + '">属性</a>] ';			ret += '[<a onclick="return confirm(\'你真的要删除本文吗?\')" href="bbsdel.php?board=' + this.board + '&id=' + this.id + '">删除</a>] ';		}	}	ret += '</div><div id="divReplyForm"></div>';	if (gIE) addBootFn(function() { // fuck you IE		var o = getObj("idConOper");		o.style.display = "none";		o.style.display = "block";	});	top.hlInfo = this.bid + "," + this.id + "," + this.gid;	w(ret);};function tconWriter(board, bid, gid, start, tpage, pno, serial, prevgid, nextgid) {	this.board = escape(board);	this.bid = bid;	this.gid = gid;	this.start = start;	this.serial = serial;	this.tpage = tpage;	this.pno = pno;	this.prevgid = (prevgid==0)?gid:prevgid;	this.nextgid = (nextgid==0)?gid:nextgid;}tconWriter.prototype.h = function() {	var ret = '<div class="tnav smaller"><span style="float:right">';	if(isBM(this.bid))	{		ret += '[<a href="bbsthreads.php?board=' + this.board + '&gid=' + this.gid + '&start=' + this.start + '">同主题操作</a>] ';	}	ret += '[<a href="bbstcon.php?board=' + this.board + '&gid=' + this.prevgid + '">上一主题</a>] ';	ret += '[<a href="bbstcon.php?board=' + this.board + '&gid=' + this.nextgid + '">下一主题</a>]';	ret += '</span>【分页: ';	var u = 'bbstcon.php?board=' + this.board + '&gid=' + this.gid + '&start=' + this.start + '&pno=';	for(var j = 1; j < this.tpage + 1; j ++ ) {		if (this.pno != j) {			ret += '<a href="' + u + j + '"><u>' + j + '</u></a> ';		} else {			ret += '<b>' + j + '</b> ';		}	}	ret += '】';	if (this.pno < this.tpage) ret += '<a href="' + u + (this.pno+1) + '">下一页</a> ';	ret += '</div>';	w(ret);};tconWriter.prototype.o = function(arts) {	var ifs = "";	var ids = new Array();	for (var i = 0; i < arts.length; i++) {		var id = arts[i][0];		var owner = arts[i][1];		ids.push(id);		var url = 'bbscon.php?bid=' + this.bid + '&id=' + id;		var ret = '<br/>';		ret += '<div class="tconPager smaller left">';		ret += '[<a href="' + url + '">本篇全文</a>] ';		if (isLogin()) {			ret += '[<a href="bbspst.php?board=' + this.board + '&reid=' + id + '">回复文章</a>] ';		}		ret += '[本篇作者:<a href="bbsqry.php?userid=' + owner + '">' + owner + '</a>] ';		if (isLogin()) {			ret += '[<a href="bbspstmail.php?board=' + this.board + '&id=' + id + '">回信给作者</a>] ';		}		ret += '[<a href="bbsdoc.php?board=' + this.board + '">进入讨论区</a>] ';		ret += '[<a href="#top">返回顶部</a>]';		ret += '<div class="tnum">' + (this.serial+i+1) + '</div>';		ret += '</div><div class="article" id="art' + id + '"><div align="center">...载入中...</div></div>';		ifs += '<iframe width=0 height=0 frameborder="0" scrolling="no" src="' + url + '"></iframe>';		w(ret);	}	w('<div id="kbsrcInfo">tcon,' + this.bid + ',' + ids.join(',') + '</div>');	w(ifs);};function brdWriter(father, select, fix) {	var ret = '<table class="main wide">';	if (arguments.length == 2) { //bbsboa.php		fix = true;		ret += '<col width="2%"/><col width="2%"/><col width="24%"/><col width="10%"/><col width="31%"/><col width="15%"/><col width="8%"/><col width="8%"/>';		ret += '<tr><th>#</th><th> </th><th>讨论区名称</th><th>类别</th><th>中文描述</th><th>版主</th><th>篇数</th><th>在线</th></tr>';		if (select > 0) {			ret += '<tr><td> </td><td> ' + putImageCode('groupgroup.gif','alt="up" title="回到上一级"') + '</td>';			ret += '<td colspan="6"><a href="bbsboa.php?group=' + father + '">回到上一级</a></td></tr>';		}	} else {		ret += '<col width="2%"/><col width="2%"/><col width="23%"/><col width="10%"/><col width="27%"/><col width="14%"/><col width="8%"/><col width="6%"/><col width="6%"/>';		ret += '<tr><th>#</th><th> </th><th>讨论区名称</th><th>类别</th><th>中文描述</th><th>版主</th><th>篇数</th><th>在线</th>';		if (!fix) ret += '<th> </th>';		ret += '</tr>';		if (select != 0) {			ret += '<tr><td> </td><td> ' + putImageCode('groupgroup.gif','alt="up" title="回到上一级"') + '</td>';			ret += '<td colspan="'+(fix?6:7)+'"><a href="bbsfav.php?select=' + father + fix + '">回到上一级</a></td></tr>';		}	}	w(ret);	this.father = father;	this.select = select;	this.fix = fix;	this.index = 0;	this.kbsrc = new Array();}brdWriter.prototype.f = function(select, desc, npos, name) {	this.index++;	var ret = '<tr class="' + (this.index%2?"even":"odd") + '"><td class="center">' + this.index + '</td>';	ret += '<td> ' + putImageCode('groupgroup.gif','alt="+" title="版面组"') + '</td>';	ret += '<td><a href="bbsfav.php?select=' + select + this.fix + '">' + htmlize(this.fix?name:desc) + '</a></td>';	if (!this.fix) desc = '';	ret += '<td class="center">[目录]</td><td colspan="4">' + desc + ' </td>';	if (!this.fix) ret += '<td class="center"><a href="bbsfav.php?select=' + this.select + '&deldir=' + npos + '">删除</a></td>';	ret += '</tr>';	w(ret);};brdWriter.prototype.o = function(group, unread, bid, lastpost, cls, name, desc, bms, artcnt, npos, online) {	this.index++;	var brdlink, ret = '<tr class="' + (this.index%2?"even":"odd") + '"><td class="center">' + this.index + '</td>';	if (group) {		ret += '<td>' + putImageCode('groupgroup.gif','alt="+" title="版面组"') + '</td>';		//brdlink = 'bbsboa.php?group=' + this.father + '&group2=' + bid;        /* pig2532: 版面组也用bbsdoc,让它自己去跳转好了,上面这个group参数是不对的。 */        brdlink = 'bbsdoc.php?board=' + escape(name);	} else {		var unread_tag = (unread ? "" : ' style="display: none"') + ' id="kbsrc' + bid + 'u"';		var read_tag = (!unread ? "" : ' style="display: none"') + ' id="kbsrc' + bid + 'r"';		ret += '<td>' + putImageCode('newgroup.gif','alt="◆" title="未读标志"' + unread_tag);		ret += putImageCode('oldgroup.gif','alt="◇" title="已读标志"' + read_tag) + '</td>';		this.kbsrc.push(bid);		this.kbsrc.push(lastpost); 		brdlink = 'bbsdoc.php?board=' + escape(name);	}	ret += '<td>&nbsp;<a href="' + brdlink + '">' + htmlize(name) + '</a></td>';	ret += '<td class="center">' + htmlize(cls) + '</td>';	if (group) {		ret += '<td colspan="3">&nbsp;&nbsp;<a href="' + brdlink + '">' + htmlize(desc) + '</a>[目录]</td>';	} else {		ret += '<td>&nbsp;&nbsp;<a href="' + brdlink + '">' + htmlize(desc) + '</a></td>';		ret += '<td class="center">' + writeBM_html(bms, true) + '</td>';		ret += '<td class="right">' + artcnt + '</td>';	}	ret += '<td class="right">' + online + '</td>';	if (!this.fix) ret += '<td class="center"><a href="bbsfav.php?select=' + this.select + '&delete=' + npos + '">删除</a></td>';	ret += '</tr>';	w(ret);};brdWriter.prototype.t = function() {	w('<div id="kbsrcInfo">brd,' + this.kbsrc.join(',') + '</div></table>');};function tabWriter(num, tabC, caption, header) {	/* header[i][0]: title, header[i][1]: width, header[i][2]: class */	this.header = header;	if (typeof header == "string") {		switch (header) {			case 'boards':				break;		}	}	this.num = num;	this.row = 0;	var ret = '<table class="' + tabC + '">';	if (caption) ret += '<caption>' + caption + '</caption>';	for(var i = 0; i < header.length; i++) {		ret += '<col';		if (header[i][1]) ret += ' width="' + header[i][1] + '"';		ret += '/>';	}		ret += '<tr>';	for(i = 0; i < header.length; i++) {		ret += '<th>' + header[i][0] + '</th>';	}	ret += '</tr><tbody>';	w(ret);}tabWriter.prototype.pr = function(col, content) {	var ret = '<td';	var c = this.header[col];	if (c) {		if (c[2]) ret += ' class="' + c[2] + '"';	}	ret += '>' + content + '</td>';	return ret;};tabWriter.prototype.r = function() {	var ret = '<tr class="' + (((this.row++)%2)?'even':'odd') + '">';	var i = 0, j = 0;	if (this.num) {		ret += this.pr(0, this.row);		j++;	}	for(i = 0; i < arguments.length; i++,j++) {		ret += this.pr(j, arguments[i]);	}	ret += '</tr>';	w(ret);};tabWriter.prototype.t = function() {	w("</tbody></table>");};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -