Dvbbs
小狐狸
小狐狸
  • UID8685
  • 注册日期2005-09-18
  • 最后登录2005-12-15
  • 发帖数14
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
阅读:2531回复:2

about greasemonkey ; bbcode 0.4.1.3

楼主#
更多 发布于:2005-12-01 16:36
1.bbcode0413这个扩展在dvbbs论坛怎么用?
2.下面这个在greasemonkey里用的扩展有高手能修理修理用在dvbbs吗?

// IGN Boards Killfile
// version 0.1
// 2005-06-08
// Copyright (c) 2005, Michael Stephens (<!-- e --><a href="mailto:michaeljs@gmail.com">michaeljs@gmail.com</a><!-- e -->)
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// A simple GreaseMonkey user script to ignore posts of certain users on the IGN
// message boards. To ignore a user, simply add them to the list below. If the
// script is already installed, this can be acomplished by going to
// Tools->Manage Scripts, selecting the IGN Boards Killfile, and
// pressing the "Edit" button.
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name        IGN Boards Killfile
// @namespace   http://mikejs.no-ip.org/code/greasemonkey
// @description allows you to ignore posts from specific users
// @include     http://boards.ign.com/*
// ==/UserScript==

// ADD YOUR IGNORES HERE:
list = new Array("AirNik", "hotgi");

function xpath(query) {
    return document.evaluate(query, document, null,
        XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
}

var allRows, thisRow, thisAuthor;
allRows = xpath("/html/body/table[2]/tbody/tr[5]/td[2]/table/tbody/tr[2]/td[2]/table/tbody/tr/td/table[2]/tbody/tr[@class='BoardRowA']");

for(var i = 0; i < allRows.snapshotLength; i++) {
    thisRow = allRows.snapshotItem(i);
    thisAuthor = thisRow.firstChild.firstChild.firstChild.nodeValue;
    for(j = 0; j < list.length; j++) {
        if(thisAuthor == list[j]) {    
            thisRow.nextSibling.nextSibling.innerHTML = "";
            thisRow.nextSibling.innerHTML = "";
            thisRow.innerHTML = "";
        }
    }
}
CrossBud
黄金狐狸
黄金狐狸
  • UID7038
  • 注册日期2005-06-29
  • 最后登录2016-08-31
  • 发帖数5948
  • 经验12枚
  • 威望2点
  • 贡献值40点
  • 好评度20点
  • 社区居民
1楼#
发布于:2005-12-01 16:36
难道用法和一般的论坛还不一样吗?
从来没上过dvbbs的论坛
sunwan
火狐狸
火狐狸
  • UID9953
  • 注册日期2005-11-20
  • 最后登录2009-07-27
  • 发帖数105
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
2楼#
发布于:2005-12-01 16:36
改了一下,只在云宵和快读试过,Greasemonkey0.5.3,文件要保存为UTF-8格式。
Greasemonkey0.6.x肯定会不行,若代码中有中文字符,就会发生错误!
@include要你自己改。
// IGN Boards Killfile
// version 0.1
// 2005-06-08
// Copyright (c) 2005, Michael Stephens (michaeljs@gmail.com)
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// A simple GreaseMonkey user script to ignore posts of certain users on the IGN
// message boards. To ignore a user, simply add them to the list below. If the
// script is already installed, this can be acomplished by going to
// Tools->Manage Scripts, selecting the IGN Boards Killfile, and
// pressing the "Edit" button.
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// --------------------------------------------------------------------
// Modify by sunwan	------2005.12.2
//
// ==UserScript==
// @name Dvbbs Kill User
// @namespace http://mikejs.no-ip.org/code/greasemonkey
// @description allows you to ignore posts from specific users
// @include http://bbs*/dispbbs.asp?*
// ==/UserScript==

// ADD YOUR IGNORES HERE:
list = new Array("AirNik", "张三");

var m = document.evaluate('//meta[@content="dvbbs"]', document, null,XPathResult.ANY_UNORDERED_NODE_TYPE, null);
if ( m )	{
	killUser();
}

function killUser()	{
	var xpath = "//div[@class='postlary1'] | //div[@class='postlary2']";

	var allDivs, thisDiv, thisAuthor;
	allDivs = document.evaluate(xpath, document, null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

	for (var i = 0; i < allDivs.snapshotLength; i++) {
		thisDiv = allDivs.snapshotItem(i);
		//alert(thisDiv.childNodes[1].childNodes[1].childNodes[1].firstChild.firstChild.firstChild.nodeValue);
		thisAuthor = thisDiv.childNodes[1].childNodes[1].childNodes[1].firstChild.firstChild.firstChild.nodeValue;
		for (j = 0; j < list.length; j++) {
			if (thisAuthor == list[j]) {
				thisDiv.nextSibling.nextSibling.innerHTML = "";
				thisDiv.nextSibling.innerHTML = "";
				thisDiv.innerHTML = ""
			}
		}
	}
}
附件名称/大小 下载次数 最后更新
dvbbs_user_fliter.zip (2KB)  211 2005-12-02 18:12
游客

返回顶部