Page 1 of 1

Doublepostings

Posted: Tue Oct 12, 2010 12:44 pm
by vrld
I noticed a dramatic increase in the amount of double posts per topic in the last few weeks. Sometimes there were even triple-posts.
I find this annoying. Very annoying. It is annoying because it reflects the lack of thinking before, while and after posting. And it reflects apathy: You can always use the "edit" button to, well, edit your post if you think you should add something.

Since apparently a human solution to this problem is not possible, I created a technical one:
A script (in javascript) that will pop up a dialog whenever you are about to commit a double-, triple-, or - heaven forbid - a quadruple-post:

Code: Select all

function getElementsByTagAndClass(tag, cls) {
	var tags = document.getElementsByTagName(tag);
	var ret = [];
	for (var i = 0; i < tags.length; ++i) {
		if (tags[i].className.indexOf(cls) > -1)
			ret.push(tags[i]);
	}
	return ret;
}


// get own name
var logoutStr = getElementsByTagAndClass("li", "icon-logout")[0];
var user = logoutStr.firstChild.title.replace(/^Logout \[\s+/, "").replace(/\s+\]$/, "");

// get author list
var posts = getElementsByTagAndClass("div", "post ");
var authors = []
for (var i = 0; i < posts.length; ++i) {
	var author = posts[i].childNodes[1].childNodes[2].childNodes[5].childNodes[2].firstChild.innerHTML; // yeah, i know...
	authors.push(author);
}
var beforebeforelast = authors[authors.length - 3];
var beforelast = authors[authors.length - 2];
var last = authors[authors.length - 1];

// nag function
function checkDoublePost() {
	if (last == user) {
		if (beforelast == user) {
			if (beforebeforelast == user) {
				alert("Quadruplepost?! NO!");
				return false;
			}
			return confirm("Triple post? Really?");
		}
		return confirm("Are you sure you want to double post?\nYou can always edit your post.");
	}
	return true;
}

// add question popup to reply and quote links
var links = [];
var reply = getElementsByTagAndClass("div", "reply-icon");
for (var i = 0; i < reply.length; ++i)
	links.push(reply[i].firstChild);

var quote = getElementsByTagAndClass("li", "quote-icon");
for (var i = 0; i < quote.length; ++i)
	links.push(quote[i].firstChild);

for (var i = 0; i < links.length; ++i)
	links[i].onclick = checkDoublePost;
It would have to be added to the forum header, and would only work if the user has javascript enabled. But since nowadays there is almost no way to enjoy surfing the internet while disabling javascipt, this shouldn't be a problem.
What do you think?

Re: Doublepostings

Posted: Tue Oct 12, 2010 12:53 pm
by Thursdaybloom
+1

You're not the only one, by any means, who finds double-posting irritating.

Re: Doublepostings

Posted: Tue Oct 12, 2010 1:09 pm
by zac352
Heh.. Heh.. :roll:

Re: Doublepostings

Posted: Tue Oct 12, 2010 2:12 pm
by thelinx
My verdict is that this is up to the user. However, I'll take this up to you and start acting upon double-posting.

You know who you are.

Re: Doublepostings

Posted: Tue Oct 12, 2010 2:16 pm
by vrld
It would still be up to the user. The script does not prevent anything (except >= 4 posts in a row). It just shows a little reminder that one is about to double-post in case one did not notice ^^
Maybe nag-screens can help building a up better forum manners. :roll: