Doublepostings

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Doublepostings

Post 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?
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
User avatar
Thursdaybloom
Citizen
Posts: 81
Joined: Mon Feb 15, 2010 3:43 am
Location: Australia

Re: Doublepostings

Post by Thursdaybloom »

+1

You're not the only one, by any means, who finds double-posting irritating.
User avatar
zac352
Party member
Posts: 496
Joined: Sat Aug 28, 2010 8:13 pm
Location: In your head.
Contact:

Re: Doublepostings

Post by zac352 »

Heh.. Heh.. :roll:
Hello, I am not dead.
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Doublepostings

Post 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.
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: Doublepostings

Post 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:
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests