PDA

View Full Version : Prevent Doubleposting


Pages : [1] 2

Xenon
01-07-2004, 10:00 PM
When a User posts into a thread where he already has the lastpost, no new post will be added. The lastpost of him will be edited and the new text is put after his first message, attachments will be added to the old post as well.
This will be done until the old post is older than 1 hour (you can change this timespan yourself:))
by changing $do_bump in the script, you can define wether the post's time will be altered or not.

Enjoy, and don't forget to click install :)

Notice: If you have installed the Proxy ip to real ip conversion or Proxy Detector v3.1 Hack, then you should probably take a look at this post.

Zelda-King
01-08-2004, 08:17 PM
Oh yes! I've been waiting for this one. Thanks a lot!

Kentaurus
01-08-2004, 08:31 PM
Ok, this is a portover of my old vb2 Hack.
On vb3 it has slightly increased, but has also new functionality regarding attachments.

So waht does this hack if anybody doesn't know it already:
When a User posts to a thread where he already has the lastpost, no new post will be added. The lastpost of him will be edited and the new text is put after his first message, attachments will be added to the old post as well.
This will the old post is older than 1 hour (you can change this timespan yourself:))

Enjoy, and don't forget to click install :)
Great hack, this is a must-to. Makes users who want to flood a single thre... err make a lot of posts in one single thread angry, though.

Zelda-King
01-08-2004, 08:43 PM
I'm about to check this myself but one of my admins made the following observation: "if you post, then someone else does, it adds you next post to your post two above".

EDIT: Yep! I notice that too. I'm going to install it afresh just in case...

EDIT 2: Yeah, still a problem.

DuffMan
01-08-2004, 08:56 PM
Thanks for releasing this! I'm going to wait until that issue Zelda-King mentioned has been resolved before I install.

Kentaurus
01-08-2004, 08:57 PM
Ok, this is a portover of my old vb2 Hack.
On vb3 it has slightly increased, but has also new functionality regarding attachments.

So waht does this hack if anybody doesn't know it already:
When a User posts to a thread where he already has the lastpost, no new post will be added. The lastpost of him will be edited and the new text is put after his first message, attachments will be added to the old post as well.
This will the old post is older than 1 hour (you can change this timespan yourself:))

Enjoy, and don't forget to click install :)Xenon, just installed it and noticed that if you use the parsed post cache then your post doesn't appear (it uses the post_parsed text and not the post one). It makes it appear as if it didn't work

I added this code and after that it works fine. I don't know yet if there is a better way to do it.


// delete the parsed post
$DB_site->query("DELETE FROM post_parsed WHERE postid='".$doublepost['postid']."'");


The issue that Zelda told about is still there, I have tested and confirmed it also

Xenon
01-08-2004, 09:19 PM
gahh, didn't think of the parsecache.

ok, both little bugs have been fixed.

Kentaurus
01-08-2004, 09:30 PM
gahh, didn't think of the parsecache.

ok, both little bugs have been fixed.
Yet another thing:

$tpye != 'thread'

isn't it

$type != 'thread' ? :)

Xenon
01-08-2004, 09:44 PM
:p

i guess you are right ;)
well it doesn't change anything, it is just to optimize it a bit ;)

sabret00the
01-08-2004, 09:50 PM
thanks xenon, this was a must have for my community :D you're awesome :D

Zelda-King
01-08-2004, 09:57 PM
Installed the fixed version. Seems fine now. Thanks for the promptness! :)

Koutaru
01-08-2004, 10:05 PM
* Koutaru installs!

Thanks for porting it over :)

Xenon
01-08-2004, 10:06 PM
:) that's why i'm here

hagi
01-08-2004, 10:14 PM
Great work. Been waiting for this one :) Install has been clicked

The Quibbler
01-08-2004, 10:38 PM
Great hack! :) *clicks install*

Rampag33
01-08-2004, 10:49 PM
Nice job Xenon

INSTALLS

The Quibbler
01-08-2004, 10:55 PM
I have a question: where would I change the time before people can double-post?

And is it possible to make it so people can NEVER double post, or at least not for a really long time - like a month, or even a year?

Edit: I think I fixed it, just by deleting:

AND dateline > " . (time() - 3600) . "

that part of the code.

Weasel
01-09-2004, 09:16 AM
There are a couple of bugs in this hack that will cause a mysql error on forums with table prefixes in their database.

To fix

[FIXES APPLIED]

Xenon
01-09-2004, 01:22 PM
Thx, i've applied the fixes.

seems i forgot a prefix in one of my queries ;)

btw. i edited tyour post, as i want to keep that thread clean, and two screen posts don't help there :)

FleaBag
01-09-2004, 02:23 PM
Excellent as always Xenon, thanks.

Taco John
01-09-2004, 08:05 PM
I hope this isn't a dumb question... But I just want to make certain I understand this correctly...

This hack is to prevent a user from posting back-to-back messages, correct? And if they do, are they sent anywhere that they are told anything? (ie "doubleposting is turned off, please edit your previous post if you would like to add to your statement, or wait for someone to respond)

If not, It would be a really nice thing to be able to turn it on and off in the admin cp, as well as set a message for users...

Thank you.

Zelda-King
01-09-2004, 08:11 PM
If you doublepost, the doublepost is inserted into the previous post as an edit. Thereby, it counts as an edit on a new line rather than as a new post.

Gio Takahashi
01-09-2004, 11:18 PM
I installed it and it works.

I have a question, however.

When someone double posts within an hour, how would I make "DOUBLE POST" appear above the second post IE:
Bob:

Hello

Double Post

How are you

Chris M
01-09-2004, 11:40 PM
I installed it and it works.

I have a question, however.

When someone double posts within an hour, how would I make "DOUBLE POST" appear above the second post IE:
Bob:

Hello

Double Post

How are you
It has to do with this code:

// Update DB
$DB_site->query("
UPDATE " . TABLE_PREFIX . "post
SET pagetext = '" . addslashes($doublepost['pagetext'] . "\n\n" . $post['message']) . "',
attach = attach + $totalattachments
WHERE postid = $doublepost[postid]
");
You could simply modify what it sets the pagetext field to, i.e.
SET pagetext = '" . addslashes($doublepost['pagetext'] . "\n\n" . $post['message']) . "',
becomes
SET pagetext = '" . addslashes($doublepost['pagetext'] . "\n\n<b>Double Post</b>\n\n" . $post['message']) . "',
I am not sure if that would work exactly, but at 1:39am I am entitled to mistakes :p

Satan

Xenon
01-10-2004, 10:54 AM
instead of <b> you have to use [b] but the rest is correct :)

The Keeper
01-10-2004, 11:37 AM
One of my moderators just brought this to my attention. Is it possible to have the query which updates a post in the case of a doublepost to also update the post dateline so that users are aware there is new content?

The Keeper
01-10-2004, 11:42 AM
Not sure if it's already a feature, but I've managed to edit the code to do this. If anyone wants it, it's fairly simple.

Xenon
01-10-2004, 11:47 AM
i will add it to the next version.

be sure you also update the thread/forum's lastpost info if you change the dateline :)

idwf
01-10-2004, 11:50 AM
Great hack! :) *clicks install*
aye...thats a fine hack!

idwf
01-11-2004, 03:45 PM
infact...I've changed my mind......that is by FAR the greatest hack Ive ever...EVER seen! Well dont lad! Its saved me no end!

Gio Takahashi
01-11-2004, 11:37 PM
Thanks, that worked.

Taco John
01-12-2004, 09:39 PM
If you doublepost, the doublepost is inserted into the previous post as an edit. Thereby, it counts as an edit on a new line rather than as a new post.



Oh that's GENIUS.

I'm installing this one for sure after the next release... Genius, I tell you...

Xenon
01-12-2004, 11:10 PM
I've uploaded a new version.

Now there is a variable included so you can define yourself, wether the post's date will be altered or not :)

The Keeper
01-13-2004, 10:16 AM
I think one of my users has spotted a bug. If someone posts, then deletes their post, then posts again then the new text is appended to a deleted post, and thus it's not visible. Is there something you can add in to check if the post it is about to be added to is deleted or not?

Xenon
01-13-2004, 03:20 PM
d'oh.
yesterday i reported a quite similar vb3 bug and now i made it myself....

thx, i've fixed it :)

The Quibbler
01-13-2004, 06:21 PM
I've already installed it, and I'd rather not do the whole thing over again, so could you tell me what needs to be changed to fix that error?

Xenon
01-13-2004, 07:57 PM
it's just the very first query:
// doublepost check
if ($type != 'thread' AND $doublepost = $DB_site->query_first("
SELECT postid, pagetext, post.userid
FROM " . TABLE_PREFIX . "post
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
WHERE threadid = $threadinfo[threadid]
AND dateline > " . (TIMENOW - 3600) . "
AND visible = 1 AND deletionlog.primaryid IS NULL
ORDER BY dateline DESC
LIMIT 1
") AND $doublepost['userid'] == $bbuserinfo['userid'])

cka
01-14-2004, 02:11 PM
Ahh nice... I believe I'll install this. Beats macgyvering one up on my own. :p

PET
01-17-2004, 07:32 PM
This is a DIVINE one ! thanx

NTLDR
01-17-2004, 07:56 PM
I've just got round to installing this one and I love it, such a simple idea, yet so usefull. Something I should have added to my board along time ago ;)

PET
01-17-2004, 07:56 PM
QUESTION : Will posting a new post bump the topic ?

I have the last post...wright ? But it have been for about 1 WEEK. So the topic is down. I post a new post...but this HACK will paste my new post intro the old one wright ? But the topic will remain DOWN or it will be BUMPED ? Coz if he remain down, then this hack is not to GOOD.

Xenon
01-17-2004, 08:03 PM
:)
thx, lee, in vb2 it was even less to hack, so simple ;)
i use it since a long time now

@PET: you can decide yourself weather it will bump a thread or not.
also you can define a timespan when it's regarded as a real new post or as a dp (the standart is 3600 seconds)

Weasel
01-21-2004, 05:01 AM
Xenon your new version introduces some more table_prefix bugs that cause MySQL errors. The problem is that you have to use the AS clause to create an alias so you can use things like post.whatever in the rest of the query without having to put table_prefix all over the place. Here's an example:


SELECT postid, pagetext, post.userid
FROM " . TABLE_PREFIX . "post AS post

You only need to do this on the SELECT query.

Xenon
01-21-2004, 03:46 PM
some more?
i just forgot to add the AS on one line...

damn thing, i hate that table prefix in vb3, just a new trap to fall into when writing up instructions

achtungbaby
02-13-2004, 09:07 PM
Excellent hack, very clean not to mention ridiculously quick to install.

Hoffi
03-05-2004, 08:49 AM
Good Job. Will Install it later.

Boofo
03-08-2004, 09:32 PM
Is there a way to disable this for Admins?

Xenon
03-09-2004, 05:32 PM
you just have to edit the condition:

if ($type != 'thread' AND $doublepost = $DB_site->query_first("
SELECT postid, pagetext, post.userid
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
WHERE threadid = $threadinfo[threadid]
AND dateline > " . (TIMENOW - 3600) . "
AND visible = 1 AND deletionlog.primaryid IS NULL
ORDER BY dateline DESC
LIMIT 1
") AND $doublepost['userid'] == $bbuserinfo['userid'])

and change for example into:
if ($type != 'thread' AND $bbuserinfo['usergroupid'] != 6 AND $doublepost = $DB_site->query_first("
SELECT postid, pagetext, post.userid
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
WHERE threadid = $threadinfo[threadid]
AND dateline > " . (TIMENOW - 3600) . "
AND visible = 1 AND deletionlog.primaryid IS NULL
ORDER BY dateline DESC
LIMIT 1
") AND $doublepost['userid'] == $bbuserinfo['userid'])

Boofo
03-09-2004, 05:49 PM
Aha, thank you very much. I was thinking it was in there somewhere but I wasn't sure how to edit it. ;)

Xenon
03-09-2004, 06:14 PM
np, you're welcome as always :)

Wifey
03-15-2004, 08:26 PM
Just installed the hack and it didn't work at first, then I went back, respaced, and it's working perfectly! Great hack!

*clicks install*

Eternal2u
03-20-2004, 04:04 PM
Very good hack, i h8 doubleposter's, and this is gona make my admins/mod's life ALOT easier..

Aleksey
03-21-2004, 02:27 AM
Can you please release one with no bugs O:-)?

Boofo
03-21-2004, 04:44 AM
What bugs? It works like it is supposed to for me and most of the others who have installed it, apparently.

DarkSavior
03-21-2004, 03:13 PM
Great add-on. I already got tired on my older forum to tell users to use the edit button instead of posting again! Now there is no such problem. :)

Xenon
03-22-2004, 06:30 PM
@Hibernated: there shouldn't be any bugs anymore :)

@all: nice to see you like this mod :)

Flashinblue
03-23-2004, 03:54 PM
superb hack, works very good, can't be easier to install

msimplay
03-26-2004, 05:38 PM
i like this hack but i just realised we have a sports page
and sometimes we need the posts seperate for results in the same thread

Koutaru
03-28-2004, 03:46 PM
@Hibernated: there shouldn't be any bugs anymore :)

@all: nice to see you like this mod :)
This is really odd, it's not working for me at all. Weird, and the coding seems fine. It worked before with the RC but now that I have Gold, it's not working. Fresh install.

Strange.

Xenon
03-28-2004, 04:02 PM
hmm, really strange as there weren't changes in that section afaics.

will have to take a closer look when i finished my tests...

Koutaru
03-28-2004, 04:06 PM
Thanks Xenon :)

I'll look back over it to make sure it wasnt a stupid mistake on my part :p

EDIT:
IT WAS a stupid mistake on my part. :tired: Thanks, it's all fixed now ;)

8472
03-28-2004, 05:06 PM
as of now i haven't installed the hack yet .. although i plan to do so as soon as the following question is answered.

what happens if there are too many attachments overall ?

for example: post A 3 attachments | post B 4 attachments | overall allowed attachments per post = 5

Xenon
03-28-2004, 08:52 PM
AFAIK the attachmenttest are done during the upload within the popup window, so it should not be affected by this hack at all.

but i cannot say for sure, never tested this specific thing :)

PET
03-29-2004, 12:01 AM
after how much time the hack don't update the last post ?

For exemple i have a post that is 1 week old. I want to "bump" the topic with a new news, will the hack bump the topic i reply again ?

Xenon
03-29-2004, 03:24 PM
Standart is 1 hour, but you can change this if you want.
It's one value in the code to change :)

Chrissicom
04-02-2004, 08:30 AM
Standart is 1 hour, but you can change this if you want.
It's one value in the code to change :)
I guess setting the TIMENOW value from 3600 to 259200 will make it 3 days then right? I actually want to prevent double posting in any circumstance. Whatfor have we got an edit function :)

Xenon
04-02-2004, 09:17 PM
Absolutelly correct :)

if you want to prevent DP at all, just remove that line:
AND dateline > " . (TIMENOW - 3600) . "

TheRayden
04-13-2004, 04:41 PM
Excellent hack, this will be very usefull.

Oblivion Knight
04-18-2004, 02:50 AM
Thanks Xenon :)
Installed and running with no problems..

I love installing your hacks, so small yet so useful :D

Xenon
04-18-2004, 12:20 PM
:)

Thx.
Well, that's my way for coding hacks. i'm a purist and don't need much effekts and such, just the usefull features are really needed :)

007
04-22-2004, 06:17 PM
Awesome. Installed again! (I used the VB2 version too)

Xenon
05-30-2004, 09:08 PM
nope, not normal, and i don't think my hack is doing this, as it's working since months now without problems.

seems to be a bug with another hack...

Xenon
05-31-2004, 01:03 PM
;)

tell me if you find out whats exactly the problem then, so maybe a workaround is possible :)

freehtml
06-04-2004, 12:36 AM
Can it be use in like for example I had a Ads Forum and I only allow said new post for every 7 days..will this hack be able to achieve that effect also?

Thanks.

Xenon
06-04-2004, 09:39 AM
nope, for that purpose you have to hack another area of vb, where it checks the flood control :)

InsaneContender
06-06-2004, 05:09 AM
Nice hack. It would be very nice if you could split the post apart if someone double posted. Such as adding a horizontal rule or such inbetween posts to know what is a new post and such.

Xenon
06-06-2004, 12:00 PM
well, you can design the split yourself.
But it is just possible to use codes, whcih a user is able to use as well.

but if you want to add a -------------------------------- or whatever, you can do so :)

chrisvonc
06-06-2004, 01:06 PM
Another great addition, thank you. This will definatly help cut down "post count padders".

Agent XY
06-09-2004, 03:05 PM
Very great hack !!

*install*

Baptizer
06-23-2004, 01:14 PM
Quick Question: I have this installed and it is working great. However, is there anyway I can get it to do the following? I have it set to do the following:
-User cannot double post within a 24 hour window (got this working)
-Posts are not bumped if they double post within a 24 hour window

Is there a way to add an 'edit' comment to the thread that got merged because of a double post? Currently, when a user double posts it does not say ' Last edited by xxx : 21. Jan 2004 at 16:47. Reason: '

chrisvonc
06-23-2004, 01:33 PM
If I understand you right, post 24 (https://vborg.vbsupport.ru/showpost.php?p=459685&postcount=24) has a tip that lets you define a comment for double posts. Also note the correction in post #25 as well. :)

Andreas
07-15-2004, 09:16 PM
@Xenon
It seems like this hack does provide some kind of "backdoor": It allows the user to add more images to his post then he would normally be allowed to have.

Furthermore, it seems like this adds a query whenever a new reply is posted.
What about adding $threadinfo['lastposter'] == $bbuserinfo['username'] to the condition before $doublepost = ...?

As this evaluates to false if there is no double post (and thus the whole term will be false) it's not necessary to continue evaluating the query, or am I wrong?

Xenon
07-15-2004, 11:17 PM
@Kirby: hmm, right, the backdoor is possible, will have to take a look at it...

As for the second part. yes, you can avoid the query in the if clause, by that, but you will still need the query when you update the post later (because of deleting the postindex, updating the pagetext...

Also as we have had some problems sometimes, when the lastposter cache isn't correctly or something like, then the string compare would resolve incorrectly.

I think it doesn't matter that much, but i'll consider it when i have the time to look through all of my hacks soon :)

Xenon
07-20-2004, 04:34 PM
Hmm, i was just thinking: Sometimes, when users make doublepost it is, because they just can post a special ammount of images per post.

So, the question is, should i really fix that 'backdoor'?

Oblivion Knight
07-20-2004, 05:18 PM
Hmm, i was just thinking: Sometimes, when users make doublepost it is, because they just can post a special ammount of images per post.

So, the question is, should i really fix that 'backdoor'?You raise a valid point, and in my opinion it shouldn't be fixed (or if it is, make it some kind of option if possible).

Boofo
07-20-2004, 06:25 PM
Hmm, i was just thinking: Sometimes, when users make doublepost it is, because they just can post a special ammount of images per post.

So, the question is, should i really fix that 'backdoor'?
Of course you should fix it. What is the sense of having an image limit if they can get around it like that? ;)

Xenon
07-20-2004, 06:34 PM
nice to get two totally different answers ^^

well, i'll think about it ^^

Andreas
07-20-2004, 07:28 PM
Well, actually I got a couple of users who explicitly use this got get more images into their posts :(

Xenon
07-20-2004, 08:28 PM
Ok, i have uploaded Version 1.4.

It now checks if the new post is valid regarding the settings (max images/ max characters...)
If it is, then it will merge the post, if it's not, then the new post will be a true doublepost.

I did it that way, because the limit will appear when doing an edit on a merged post otherwise.

Also i have removed a bit overhead of the code.

My test worked well, but i consider it as RC, until some of you can confirm they don't have problems (there shouldn't be, but you cannot be too sure ;))

Merjawy
07-20-2004, 08:34 PM
Really nice and needed hack thnx Xenon

my question and forgive me if it was mentioned before, what if a user clicks the Quick Reply icon to replay to the first post and clicked it again to replay lets say to the 3rd post in there and clicked again to reply to the 6th reply in there, would this hack merge all 3 posts as you see there seperate replies

Thnx

Andreas
07-20-2004, 08:41 PM
Yes it will.

Xenon
07-20-2004, 08:51 PM
That way, you have a multiple quote option included *ggg*

As mentioned in the description, this hack is for linear mode, threaded mode users, shouldn't use it.
but as there are more problems when someone enables threaded mode on his board, then he will know if or not to install this hack ;)

Oblivion Knight
07-20-2004, 11:03 PM
Thanks for the update Stefan.. :)
I had a couple of modifications applied to this hack that were mentioned earlier in this thread, and have re-applied them but just wanted to make sure that they have been done correctly.


As I understand it, TIMENOW - 3600 now has 2 instances - so if I wanted to increase the time limit to 3 days, I'd replace BOTH instances of 3600, correct?

Also, I don't want admin posts to be merged no matter what, so applying a similar mod to last time should be ok, right? I now have this line:
if ($type != 'thread' AND $bbuserinfo['usergroupid'] != 6 AND $threadinfo['lastpost'] > TIMENOW - 172800 AND $threadinfo['lastposter'] == $post['postusername'])All seems to work as I want it to, but I thought I'd better make sure..

Andreas
07-20-2004, 11:20 PM
I think you should use $bbuserinfo['permissions']['adminpermissions'] & CANCONTROLPANEL instead of checking for the usergroup, as admins could be in any usergroup ;)

I've also modified this so the time after which a post is considered a double post and if the post's timestamp should be modified are now settings in Message Posting & Editiong Options, so they can be changed easily :)

Boofo
07-20-2004, 11:22 PM
I think you should use $bbuserinfo['permissions']['adminpermissions'] & CANCONTROLPANEL instead of checking for the usergroup, as admins could be in any usergroup ;)
How would you use that for Admins, SuperMods and Mods?

I've also modified this so the time after which a post is considered a double post and if the post's timestamp should be modified to be a setting (in Message Posting & Editiong Options), so it can be changed easily :)
Can you share that with us, sir? ;)

Andreas
07-20-2004, 11:31 PM
How would you use that for Admins, SuperMods and Mods?

For Supermods it is

$bbuserinfo['permissions']['adminpermissions'] & ISMODERATOR.


For Mods it's a bit more difficult. You could use can_moderate() - which might cause an extra query then (without my Show ModCP link being installed).


Can you share that with us, sir?

It's pretty easy:
Create two new settings (I called them dblpostthreshold and bumpdblpost) where you want them. The first one being an input (for the seconds, could also be minutes or hours - then you would have to add the appropriate multiplier to the code) and the second being a yesno option.

Then replace

TIMENOW - 3600


with

TIMENOW - $vboptions['dblpostthreshold']


And

$do_bump


with

$vboptions['bumpdblpost']


And delete

// change this to false if you don't want doubleposts changing post's dateline
$do_bump = true;

As it is not needed any longer.

Xenon
07-21-2004, 02:26 PM
*gg*

I'm always to lazy to create settings ;)

@OKnight: correct, both instances have to be changed.

the other code is correct (at least if you just consider the main usergroup of admins ;))

Oblivion Knight
07-21-2004, 07:02 PM
Thanks for the confirmation Stefan.. :)


For Supermods it is

$bbuserinfo['permissions']['adminpermissions'] & ISMODERATOR.


For Mods it's a bit more difficult. You could use can_moderate() - which might cause an extra query then (without my Show ModCP link being installed).So if we have your ModCP Link hack installed, I'd change this:
$bbuserinfo['usergroupid'] != 6
To this:
can_moderate()
Which would exempt Mods, Supermods and Admins.. Correct? :nervous:

Andreas
07-21-2004, 07:07 PM
Yup. Of yourse you can also just check the usergroup id - as long as you don't have admins, supermods oder mods in other usergroups then the standard groups ;)

Oblivion Knight
07-21-2004, 07:48 PM
Using can_moderate() doesn't work..

My double posts are getting merged.

Andreas
07-21-2004, 07:55 PM
Hmm ... mine don't :)
Could you post the exact if () you are using?

Oblivion Knight
07-21-2004, 08:01 PM
Here you go.. :)

if ($type != 'thread' AND can_moderate() AND $threadinfo['lastpost'] > TIMENOW - $vboptions['dblpostthreshold'] AND $threadinfo['lastposter'] == $post['postusername'])

Andreas
07-21-2004, 08:13 PM
Well, that's wrong :)

You want the doublepost filter for all those who can not moderate, therefore it must be

!can_moderate()

Oblivion Knight
07-21-2004, 08:44 PM
Whoops.! :o

Hehe, thanks again Kirby.

Dead End Society
07-26-2004, 08:55 AM
Installed.

A life saver.

Datenpapst
07-26-2004, 01:26 PM
install clicking all the time :D

Hiro
08-08-2004, 08:22 PM
Wheres the install button

Xenon
08-08-2004, 08:26 PM
at the top right of each showthread page :)

Hiro
08-08-2004, 08:35 PM
It doesnt have one on my skin?

Hiro
08-08-2004, 08:38 PM
anyone?

Blam Forumz
08-08-2004, 08:53 PM
Then use a different skin :P

Skaterscafe.com
08-09-2004, 03:26 AM
AWSOME!!! Works like a charm, thanks!!!

Xenon
08-09-2004, 12:44 PM
It doesnt have one on my skin?
as far as i can see every style has the button..

qxh
08-13-2004, 05:24 PM
tHANKS ALOT!

Woops ^^.

deathemperor
08-15-2004, 06:38 AM
*installed*

very 9 hac

Xcist
08-25-2004, 02:39 AM
Is there a way to add an 'edit' comment to the thread that got merged because of a double post? Currently, when a user double posts it does not say ' Last edited by xxx : 21. Jan 2004 at 16:47. Reason: '

Great hack! I've installed myself, and works wonders. :) My mods are staring in awe. ~_^

Now, I'm wondering if it's possible to do what Baptizer suggested? I would really like a little line stating when the edit was made. Thanks again. *clicks install*

Xenon
08-26-2004, 06:41 AM
Hmm, shouldn't be that hard to add, i'll put it on my list :)

bluesteel
08-26-2004, 08:46 AM
Cheers Xenon.
Perfect to stop my users double-posting to earn cash for the Arcade!
*clicks install*

Mosh
08-29-2004, 05:24 AM
Xenon,

Thanks for this.

I am trying to tweak it so that it always merges the post, no matter what the time limit is.

So what would I need to change to prevent double posting, full stop?

Will definately click install when I can do this.

Cheers for the help in advance,

JD. :)

Xenon
08-29-2004, 10:12 AM
very easy, just remove that line:

AND dateline > " . (TIMENOW - 3600) . "

and that part:
AND $threadinfo['lastpost'] > TIMENOW - 3600

Goodspeed
08-30-2004, 05:40 AM
Great hack Xeon! Thank you! Going to install it...

But at first I have a question: what I need to do to switch off double post prevention after some time left? Is it possible to merge posts during appointed time?

Mosh
08-30-2004, 07:01 AM
very easy, just remove that line:

AND dateline > " . (TIMENOW - 3600) . "

and that part:
AND $threadinfo['lastpost'] > TIMENOW - 3600

Xenon,

That worked an absolute treat.

Thanks ever so much for this.

JD. :)

btw. JD clicks Install :)

Xenon
08-30-2004, 09:58 AM
@Goodspeed: hmm, i'm not sure if i get what you want.
If you want the merge just within the first xxy hopurse, use the default, if you want the merge whenever there's a doublepost show the code i posted for sinclair.

or do you mean that within 10 minutes no post should be merged, and then during the next hour it should?
everything is possible by changing just the conditions :)

Goodspeed
08-30-2004, 04:57 PM
I'm sorry for my english Xenon, still not too good in it :(

Yes, I want to merge posts only during last 10 minutes, after that new post in thread by the same user should appear as new.
What kind of conditions should I change?

And one more question: is it possible to mark added text after merge? For example by adding line: Added by User at some time...

Thank you!

Xenon
08-30-2004, 09:05 PM
no prob :)

just replace
AND dateline > " . (TIMENOW - 3600) . "
with
AND dateline > " . (TIMENOW - 3600) . " AND dateline < " . (TIMENOW - 600) . "

as well as replace
AND $threadinfo['lastpost'] > TIMENOW - 3600

with
AND $threadinfo['lastpost'] > TIMENOW - 3600 AND $threadinfo['lastpost'] < TIMENOW - 600

as for the merging text addition:
in $post['message'] = $doublepost['pagetext'] . "\n\n" . $post['message'];

replace the "\n\n" with for example:

$post['message'] = $doublepost['pagetext'] . "\nAdded at " . vbdate($vboptions['dateformat'], TIMENOW) . "\n" . $post['message'];

Goodspeed
08-30-2004, 09:26 PM
I did everything, checked it twice, but merge not work after those changes.
Now, posts appear one by one without merging.

Update
After couple of tests I understood that is problem in first two changes. I removed them and it works but without 10 min limit.

Addition with update date working GREAT! Thank you very much!

I changed it a little bit: added update time.

$post['message'] = $doublepost['pagetext'] . "\n\n<strong><i>Added at " . vbdate($vboptions['dateformat'], TIMENOW) . ", " . vbdate($vboptions['timeformat'], TIMENOW) . "</i></strong>" . "\n" . $post['message'];

bjornstrom
09-13-2004, 07:00 AM
Works great - thanks a lot /Martin

Snatch
09-13-2004, 08:40 AM
What do this hack if the Maximum number of sings per post reached and the Memver must creat an new one to complett the post ?

Xenon
09-13-2004, 09:45 AM
since the newest version it checks if the merged post is still a vald one.
If it is, then the post will be merged, if it's not valid anymore (too much chars/images or whatever) it will create a new post just as it would do without the hack :)

HappyPike
09-23-2004, 01:38 AM
Looks like a cool hack, Xenon. :) Does it have any impact on forum performance on a large forum?

Xenon
09-23-2004, 12:07 PM
Since the new version handles most of the conditions without extra queries, you should not see any impacts on huge forums :)

Slynderdale
09-23-2004, 05:38 PM
I made some edits to this hack, this allows you to control it via Admin CP Settings so you can modify the settings for it and turn double post checking on and off. Its backwards compatible so this hack will work even if you don't add the settings.

Note:
Please backup your includes/functions_newpost.php before your install these changes.


In file includes/functions_newpost.php find Xenon's original code and replace it with this:

// ### POST NEW POST ###
// doublepost check
$isdoublepost = false;
$doubleposttime = (intval($vboptions['doubleposttime'])>0?intval($vboptions['doubleposttime']):3600);
if ($type != 'thread' AND $threadinfo['lastpost'] > TIMENOW - $doubleposttime AND $threadinfo['lastposter'] == $post['postusername'] AND $vboptions['doublepostenabled'] == 1) {
$doublepost = $DB_site->query_first("
SELECT postid, pagetext, post.userid
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
WHERE threadid = $threadinfo[threadid]
AND dateline > " . (TIMENOW - $doubleposttime) . "
AND visible = 1 AND deletionlog.primaryid IS NULL
ORDER BY dateline DESC
LIMIT 1
");

if ($doublepost['userid'] == $bbuserinfo['userid'])
{
// we truely have a doublepost, now check if the merged post fits the rules!
$oldmsg = $post['message'];
$olderrors = $errors;

$post['message'] = $doublepost['pagetext'] . "\n\n" . $post['message'];
verify_post_errors($type, $post, $errors);
if (sizeof($errors) == 0)
{
// merged post is ok, so do merging
$isdoublepost = true;
$post['postid'] = $doublepost['postid'];
}
else
{
// merging will produce errors so keep it as a single post..
$isdoublepost = false;
$post['message'] = $oldmsg;
}
unset($oldmsg);
$errors = $olderrors;
unset($olderrors);
}
}

if ($isdoublepost)
{
// change this to false if you don't want doubleposts changing post's dateline
$do_bump = (isset($vboptions[doublepostbump])?$vboptions[doublepostbump]:1);

// Yes we have a doublepost, so do unindexing
require_once('./includes/functions_databuild.php');
delete_post_index($doublepost['postid'], $doublepost['title'], $doublepost['pagetext']);
unset($doublepost);

// Update DB
$DB_site->query("
UPDATE " . TABLE_PREFIX . "post
SET pagetext = '" . addslashes($post['message']) . "',
" . iif($do_bump, 'dateline = ' . TIMENOW . ',', '') . "
attach = attach + $totalattachments
WHERE postid = $post[postid]
");

//Delete Eventually parsed cached post
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "post_parsed WHERE postid = " . $post['postid']);

if ($totalattachments > 0 OR $do_bump)
{
$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET " . iif($do_bump, 'lastpost = ' . TIMENOW . ',', '') . "
attach = attach + $totalattachments
WHERE threadid = $threadinfo[threadid]
");
}

//Update forum if postdate has changed.
if ($do_bump)
{
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($post['postusername']) . "',
lastthread = '" . addslashes($threadinfo['title']) . "',
lastthreadid = $threadinfo[threadid],
lasticonid = " . iif($threadinfo['pollid'], -1, $threadinfo['iconid']) . "
WHERE forumid = $foruminfo[forumid]
");
}
}
else
{
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post
(threadid, parentid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, ipaddress, iconid, visible, attach)
VALUES
($threadinfo[threadid], $parentid, '" . addslashes($post['title']) . "',
'" . addslashes($post['postusername']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($post['message']) . "', $post[enablesmilies], $post[signature],
'" . addslashes($post['ipaddress']) . "', $post[iconid], $post[visible], $totalattachments)
");
$post['postid'] = $DB_site->insert_id();
}


Now to add the options, this can be done manually or with the queries below. I choosed to add them in the Posting settings group.

Manually Add then:

Varname: doublepostenabled
Type: yesno
Value: 1
Title: Check for double posts
Description: If enabled, it will check to see if the user already posted in the thread in a certain time limit, if so, their new post text will be added to their old post.

Varname: doublepostbump
Type: yesno
Value: 1
Title: Double posts bumping
Description: If enabled, and someone double posts, do you want the thread to be bumped because of the changes?

Varname: doubleposttime
Type:
Value: 3600
Title: Double post time
Description: The time in seconds you want to check for double posting.


OR

Queries:

INSERT INTO `setting` VALUES ('doublepostenabled', 'posting', '1', '', 'yesno', 250, 0, 0);
INSERT INTO `setting` VALUES ('doublepostbump', 'posting', '1', '', 'yesno', 260, 0, 0);
INSERT INTO `setting` VALUES ('doubleposttime', 'posting', '3600', '3600', '', 270, 0, 0);

INSERT INTO `phrase` VALUES ('', 0, 'setting_doublepostenabled_title', 'Check for double posts', 5000);
INSERT INTO `phrase` VALUES ('', 0, 'setting_doublepostenabled_desc', 'If enabled, it will check to see if the user already posted in the thread in a certain time limit, if so, their new post text will be added to their old post.', 5000);
INSERT INTO `phrase` VALUES ('', 0, 'setting_doublepostbump_title', 'Double posts bumping', 5000);
INSERT INTO `phrase` VALUES ('', 0, 'setting_doublepostbump_desc', 'If enabled, and someone double posts, do you want the thread to be bumped because of the changes?', 5000);
INSERT INTO `phrase` VALUES ('', 0, 'setting_doubleposttime_title', 'Double post time', 5000);
INSERT INTO `phrase` VALUES ('', 0, 'setting_doubleposttime_desc', 'The time in seconds you want to check for double posting.', 5000);

HappyPike
09-23-2004, 11:19 PM
Since the new version handles most of the conditions without extra queries, you should not see any impacts on huge forums :)
Cool. I installed it on my forum. :)

*clicked install *

HappyPike
09-25-2004, 12:08 AM
I think I found a little bug:

On my forum I set the attachments per post limit to 5. But people are able to create post with 9 attachments after I install this hack.

Xenon
09-26-2004, 10:05 PM
have you installed the newest version of this hack?

I prevented such things with the last upgrade, so can you please tell me if your hack'sversion is 1.4?
If yes, i wonder why, but will put it on my bug-to-fix-list

thx in advance

HappyPike
09-26-2004, 10:38 PM
Yup, I installed the latest 1.4 version.

Xenon
09-27-2004, 10:23 AM
hmm, kay thx for reporting, i'll look into it :)

HappyPike
09-27-2004, 10:13 PM
1) Xenon, how can I turn off this feature for certain forums? For example, for forum IDs 5, 10, and 20?

Some of my users have been whining because they need to reserve several posts in a row for some types of threads in certain forums.

2) It would be great if the make new post page can be edited to include a checkbox that says something like "Disable auto-merging". This way posters who prefer to make the post separate has a mean to do so. I wouln't need to disable the feature just for certain forums if this possible.

Thanks in advance for your help.

Xenon
09-28-2004, 06:53 PM
Hmm, sorry the attachment problem will stay a while, as attachment setting checkings are done somewhere else and not where the other checks are done, i'll try to write an easy fix, but i'm currently strongly overworked, and so the next version may take a bit of time...

as for excluding some forums:

find:
if ($type != 'thread' AND $threadinfo['lastpost'] > TIMENOW - 3600 AND $threadinfo['lastposter'] == $post['postusername'])

and change it into:
if ($type != 'thread' AND !in_array($threadinfo['forumid'], array(x,y,z)) AND $threadinfo['lastpost'] > TIMENOW - 3600 AND $threadinfo['lastposter'] == $post['postusername'])

and replace x,y,z with your list of forumids

theArchitect
10-02-2004, 05:55 AM
Sensational mod. *theArchitect clicks install*.

Will you be releasing an updated ones that works with your Hidden Posts mod? I only ask as since I have installed this if I post in a thread and then write a hidden post the two are combined. As you can imagine this is not the best scenario.

Xenon
10-02-2004, 12:01 PM
hmm, actually i don't like to post hack which include other hacks' infos so that everyone can use a single hack without needing another, but i may look at it, if it's doable without getting in problems with single instals i'll do so :)

silentwille
10-22-2004, 11:19 AM
Hello,
any question, it's possible to add "Edit by" or other, when the second post is merged in the post of member ??

Thx

Xenon
10-22-2004, 04:04 PM
Not by default.

It's on my todo list, but i'm too busy with moreimportant things these times...

Yuneek
10-29-2004, 07:46 PM
I installed and then tested and I could double post fine - is it because I'm an administrator?

Xenon
10-30-2004, 12:22 PM
Erm, nope, i did not implement any Adminspecial within that hack, so you may have made a little mistake during the install process?

leeman
11-28-2004, 07:36 PM
installed and works like a charm.

question.

is there a way to make this take Threads instead....
To prevent spamming of the boards.
I have a couple of users that when they are bored they post like 5 pages of mumbo jumbo....

*LEE clicks install

Xenon
11-29-2004, 07:31 PM
well, of course it's possible as well, but this would be contraproductive as well.

i know more situations when two or more threads are created shortly behind each other, but not to spam (for example news threads on some boards...)

leeman
11-30-2004, 12:12 PM
well, of course it's possible as well, but this would be contraproductive as well.

i know more situations when two or more threads are created shortly behind each other, but not to spam (for example news threads on some boards...)

Yeah that's true ...
But I get alotta problems with tr00ls spamming my board ...

And I have taken this question to the board and every one thinks it a good idea ... Just need to put the "last post time" to like +15 secs of flood time ...

So if you can alter it to / make a additional mod with this funktion ..... :insert you rock slimie here: .

Xenon
11-30-2004, 03:10 PM
wouldn't it be easier to put up rules? ^^

leeman
11-30-2004, 04:08 PM
wouldn't it be easier to put up rules? ^^

I have a spam rule ... but you know ....
Well rules doesn't stop them from spamming.... and gives the mods a hell of a time cleaning it up .... :(

Xenon
12-08-2004, 11:04 AM
well, hard mods will be able to solve those "spammers" ^^

Boofo
12-08-2004, 11:34 AM
Stefan, is there a way to have this go by the user's timezone time instead of the server time? I noticed a user doubler-posted the other day and the time was 2 hours behind the actual double-post (the server is set at PST and I am in CST).

Xenon
12-08-2004, 11:40 AM
as posts are stored in server timezone as well as the timenow variable which is used for the hack, it's not possible.

Or better, wouldn't make sense, because if you would base it on usetimezone, then it would be possible that one user can post every minute while the other must have to wait nearly a whole day until...

Boofo
12-08-2004, 12:51 PM
as posts are stored in server timezone as well as the timenow variable which is used for the hack, it's not possible.

Or better, wouldn't make sense, because if you would base it on usetimezone, then it would be possible that one user can post every minute while the other must have to wait nearly a whole day until...
But shouldn't it at least be ahead of the post time itself? This was almost 2 hours before the actual post time of the message.

Xenon
12-09-2004, 08:59 PM
i think either you or me is confused now.

everything has to be based on TIMENOW as that's the value stored in the DB, and used by the phpscript.

so the hack works absolutelly correct.

if you get wierd behaviours, that could mean, that you have another hack, which manipulates the times or, a slight server problem with different times on different servers..

gilbert
12-10-2004, 04:58 PM
Great hack!

leeman
12-15-2004, 02:03 PM
well, hard mods will be able to solve those "spammers" ^^


Well since i don't (sorry enough) have mods online 24/7 ....

Could you please do the code change or look at it if it's not too much trouble.

alqadir
12-16-2004, 08:42 AM
If one wanted to incorporate checking of the title to validate double posting, how do you compare the title from the last post to the new post.

I want to prevent users from posting two books of the same title (the book title is part of the post title).

Thanks

Xenon
12-18-2004, 12:25 PM
the value is stored in $post[title]

@leeman: sorry, i'm very very busy and cannot help you right now.

AZone
12-21-2004, 09:43 PM
Great hack, thank you!
By the way, does this hack update New Posts list when someone is doubleposting?

Xenon
12-23-2004, 09:31 AM
just if $do_bump is set to true

cinq
12-23-2004, 02:30 PM
Let's say a user makes a post and maxs out the number of attachments.
WHat happens when within the very short interval ( which considers the next post a double post ) , he posts again with an attachment.

Can this handle that ?

alqadir
12-25-2004, 12:57 PM
hello all,
I have tried to install this hack but I get the following error:
Database error in vBulletin 3.0.3:

Invalid SQL:
SELECT postid, pagetext, post.title, post.userid
FROM post AS post
LEFT JOIN deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
WHERE threadid =
AND dateline > 1103982928
AND visible = 1 AND deletionlog.primaryid IS NULL
ORDER BY dateline DESC
LIMIT 1

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND dateline > 1103982928
AND visible = 1 AND deletionl

mysql error number: 1064



Can someone out their please help me out! thanks

Xenon
12-27-2004, 02:52 PM
@cinq: actually the attachmentpart is the only little bug which is still there

you can add more attachments then allowed with the doublepost, as the avoidance would have produced too much queries....

@alquadir: the $threadinfo varialbe seems to be empty, you have either placed the code at the wrong place, or you have another hack, which is buggy
nothing i can solve.

cinq
12-28-2004, 12:57 AM
@cinq: actually the attachmentpart is the only little bug which is still there

you can add more attachments then allowed with the doublepost, as the avoidance would have produced too much queries....


So in this hack, it doesnt cater for that, and the post with new attachments will just be a new post, correct ?

If so, that's fine with me :)

Xenon
12-28-2004, 08:42 PM
nope, it will just merge them, no matter if you get over the limit or not ;)

cinq
12-29-2004, 12:11 AM
oic, so the first post will have more attachments than the max limit per post.

I'm fine with it too, but do let us know if you manage a workaround for it :)
thanks ! :D

Xenon
12-29-2004, 04:54 PM
of course ;)

i'll work onit on my free days soon ;)

Xenon
01-03-2005, 12:20 PM
Version 1.5 released

actually it's just a minor release, so i won't send an update mail

What has changed?
Bugfix: Doubleposts won't create posts with more than attachlimit attachments
Setting: I have created a settingarray at the top of the hack, allowing to easyly changint the timespan of when a post will be counted as doublepost.

No further changes are planned right now.

cinq
01-04-2005, 11:45 PM
Just to confirm Stefan, only when a user posts within the time allocated in a particular thread that the posts are merged.

A scenario :
If he starts a new thread A, or makes a post B1 somewhere in another thread B, both the thread A or new post B1 should not get merged into the post C1 in thread C which he made 5 mins ago before making post B1 or new thread A, correct ?

( sorry if it sounds confusing, but it seems some of my members are complaining about this .... odd )

Xenon
01-05-2005, 12:02 AM
sounds very confusing ^^

to make it short it just works in one thread, so he can start 4 new thread and nothing will be merged, just if someone makes a post in a thread where he already has the last post and it's not that long ago, then it will be merged ;)

cinq
01-05-2005, 12:47 AM
Ah yes, that's what I thought too....I think my members are rather confused though. Will explain it to them :)

Thanks :D

Sel
01-05-2005, 07:30 AM
Hi

Some of the users on the forum I moderate have pointed out a way to get around the hack.

If a user posts more than the max number of allowed smilies, a new post is added and the double post hack does not work.

For example the smilie limit on the forum is 3...

A user makes a post with 2 smilies, then the same user posts straight after with another 2 smilies, this breaks the smilie limit and causes a new post to be added rather than the 2 posts being merged.

Don't think this has been pointed out already so I thought I’d mention it. :nervous:

Thanks

Xenon
01-05-2005, 01:30 PM
@Sel: well, yep thats know, but it's how the hack is designed.

i did it without the check before, and that lead to non editable posts after the merge, so this smilie check has to be in

i'd increase the ammount of smilies allowed ;)

Sel
01-05-2005, 03:19 PM
Nice one, thanks for the quick reply. Think I will increase the smilie limit then, three is a bit harsh!!

Great hack by the way!

Xenon
01-05-2005, 04:08 PM
thanks :)

sbp
01-08-2005, 06:10 AM
Thank you Xenon http://sbp777.homestead.com/files/kawaii.gif

Paul M
01-08-2005, 11:32 AM
If you have previously installed Proxy ip to real ip conversion (https://vborg.vbsupport.ru/showthread.php?t=69295) or Proxy Detector v3.1 (https://vborg.vbsupport.ru/showthread.php?t=61331) then these install instructions will not work (or if you manage to find the block of code to replace, and then replace it as specified, your proxy hack will cease to function correctly).

This is because both proxy ip hacks add an extra field to all new posts. To fix this, edit the install instructions as follows.

find ;

showsignature, ipaddress, iconid, visible, attach)
and replace with;

showsignature, ipaddress, proxyip, iconid, visible, attach)
also find ;

'" . addslashes($post['ipaddress']) . "', $post[iconid], $post[visible], $totalattachments)
and replace with ;

'" . addslashes($post['ipaddress']) . "','" . addslashes($post['proxyip']) . "', $post[iconid], $post[visible], $totalattachments)
You can then apply this hack. :)

Xenon
01-08-2005, 11:43 AM
Thx for mentioning Paul, i included a link to your post in the first post :)

Baptizer
01-09-2005, 01:40 AM
When someone double posts, is there a way to put a message above the merged post stating when the user double posted?

DrkFusion
01-09-2005, 02:11 AM
Awesome work on that Xenon, I had something like this going, but this is much better, much more optimized, and well it works and it works good!

Regards,

Xenon
01-09-2005, 02:00 PM
glad to hear Arunan :)

@Baptizer: i think i answered it already within the thread, but short again: you can change the \n\n in $post['message'] = $doublepost['pagetext'] . "\n\n" . $post['message']; to add custom text between the posts as well.

Baptizer
01-09-2005, 10:03 PM
glad to hear Arunan :)

@Baptizer: i think i answered it already within the thread, but short again: you can change the \n\n in $post['message'] = $doublepost['pagetext'] . "\n\n" . $post['message']; to add custom text between the posts as well.


THanks a bunch! Any way to get the time of the double post to display using the post viewers timezone? I am guessing not, correct?

Xenon
01-10-2005, 01:08 PM
nope, that's not possible, at least not without adding extram fields to the post table (or creating something like a doublepost log)

eblivion
01-23-2005, 02:50 PM
I installed the mod and didn't notice any code excluding administrators and moderators from the restriction. How can I prevent it from blocking admins & moderators?

Mechanical Mind
01-23-2005, 03:45 PM
In this thread here: https://vborg.vbsupport.ru/showthread.php?p=600603#post600603post600603
I posted twice in a row, and because it has the hack to show the first thread at the beginning of every page, it didn't merge my posts. It let me post at the end of one page and at the beginning of another???

Just an observation. I don't even have this hack installed.

UPDATE...

Xenon clarifies this below. It is not a bug.

Xenon
01-23-2005, 03:59 PM
i have excluded the release forums from the automerge

Gary King
01-25-2005, 10:43 PM
How can I put a separator to separate a first post and a second post when they both show up in the same post?

Xenon
01-26-2005, 03:43 PM
as i said, you can put everything between the \n\n

this is already a seperator, put in some dashes or whatever ;)

Gary King
01-26-2005, 04:14 PM
as i said, you can put everything between the \n\n

this is already a seperator, put in some dashes or whatever ;)
I can't seem to put HTML in there. It just outputs <hr /> as &lt;hr /&gt;

Xenon
01-26-2005, 04:24 PM
of course you can't

the seperator will become part of the post, and if you don't allow html in posts, you cannot use it ;)

TCattitude
02-06-2005, 03:04 AM
I installed the mod and didn't notice any code excluding administrators and moderators from the restriction. How can I prevent it from blocking admins & moderators?
After upgrade to 3.0.5/3.0.6 i have the same thing here.
Before, admins (i don't know if mods or supermods too) were not affected by the anti-doublepost.

And now... works for admins too.
Anything wrong?
Obviously, i applied the hack again after upgrade.

How exclude admins?

FASherman
02-06-2005, 05:33 PM
Has anyone every included the mod to this hack to update the editlog table? These forums are using it so I know it must exist.

FASherman
02-06-2005, 06:27 PM
okay, okay...i figured it out myself.

FIND

//Update forum if postdate has changed.
if ($dp_settings['dobump'])
{
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($post['postusername']) . "',
lastthread = '" . addslashes($threadinfo['title']) . "',
lastthreadid = $threadinfo[threadid],
lasticonid = " . iif($threadinfo['pollid'], -1, $threadinfo['iconid']) . "
WHERE forumid = $foruminfo[forumid]
");
}


AFTER THAT, ADD:

//Now lets update the editlog
$reason = "Automerged Doublepost";
$lastedit = $DB_site->query_first("
SELECT postid, userid, username, dateline, reason
FROM " . TABLE_PREFIX . "editlog
WHERE postid = $post[postid]
");
if ($lastedit['postid']) {
$DB_site->query("
UPDATE " . TABLE_PREFIX . "editlog
SET postid = $lastedit[postid],
userid = $bbuserinfo[userid],
username = '" . addslashes($post['postusername']) . "',
dateline = " . TIMENOW . ",
reason = '" . addslashes($reason) . "'
WHERE postid = $post[postid]
");
} else {
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "editlog
(postid, userid, username, dateline, reason)
VALUES ($post[postid], $bbuserinfo[userid],
'" . addslashes($post['postusername']) . "',
" . TIMENOW . ",'" . addslashes($reason) . "')
");
}

Xenon
02-06-2005, 07:24 PM
@FASherman: well, here on vb.org there are often some more features in my hacks than in the released version, as i don't release every single change immediatelly ;)

but i have uploaded the newest version now, which adds the editlog text ;)

Imperial Fritz
02-14-2005, 01:37 AM
Thanks, this hack was much needed. :)

That Rob Guy
02-14-2005, 07:02 PM
I love this hack...

/me clicks install. One of the easiest and worthy hacks to have.

JMH11788
02-14-2005, 08:18 PM
i am going to install this mod but i want the option in the admincp to disable it. i know ill have to put it in <if condition> tags and then an <else> at the end but im not sure exactly how.

so i would need an if and else for the top two codes, and this one ^^ needs just and if..correct? so what would the codes be and what would the code i need to add for an ON and OFF radio button in the admin cp be?

thanks!

Xenon
02-14-2005, 08:56 PM
it's not needed to post the hack instructions, everyone know them from the file ;)

and actually it's not hard to do.

first of all you have to enable debug mode of your vb.
then got to acp options and you see you can add new settings to the settinggroups
add one to the message posting options yesno as option code
for example:

varname: preventdoubleposts
title Preventing Doubleposting
optioncode yesno
default 1
vbulletin default no

then just change that line:
if ($type != 'thread' AND $threadinfo['lastpost'] > TIMENOW - $dp_settings['timespan'] AND $threadinfo['lastposter'] == $post['postusername'])

into
if ($vboptions['preventdoubleposts'] AND $type != 'thread' AND $threadinfo['lastpost'] > TIMENOW - $dp_settings['timespan'] AND $threadinfo['lastposter'] == $post['postusername'])

that's all you need

JMH11788
02-14-2005, 10:54 PM
^^^
ahh ic...why do i have to put it in debug mode? and where is the option to put it in debug mode?

thanks

Xenon
02-15-2005, 05:54 PM
please take a look in the manual or do a search, everything is described very well on the board :)

utw-Mephisto
02-18-2005, 04:00 AM
I searched now a while, but I could not find the answer to

why do i have to put it in debug mode?


Or am i just a bit blind :( ?

utw-Mephisto
02-18-2005, 04:02 AM
:laugh: Doublepost test

edit
:lick: :smoke:

MAK-upl
02-18-2005, 02:44 PM
clicks install

MP3
02-20-2005, 04:31 AM
Thanks alot :)

SuperGLS
02-20-2005, 08:44 PM
I earlier updated to vB 3.0.7 and just tried to redo this hack, now I'm getting any error.

Anyone else?

"Parse error: parse error, unexpected $ in /includes/functions_newpost.php on line 1327"

utw-Mephisto
02-20-2005, 08:48 PM
I am using the hack also now on my patched board. I just patched with misc.php ..

If you ever installed hacks on your board, ALWAYS test it first on a testboard and never on a life one ...

utw-Mephisto
02-20-2005, 08:49 PM
I know, it does not really help you here

SuperGLS
02-20-2005, 09:09 PM
Works now, I just messed up the coding.

Imperial Fritz
02-21-2005, 05:57 PM
Could anybody explain how to install it on a 3.0.7?

utw-Mephisto
02-21-2005, 06:30 PM
Sounds naiv, but did you try it like on 3.0.6 ?

Imperial Fritz
02-21-2005, 07:33 PM
Apologies for stupidity, I had the older version :)

Yet it doesn't work for me, the code is there but no matter what posts aren't merged.

Curzon564
02-22-2005, 10:25 PM
I found this hack and installed it immediately. It's great, finally no more users posting doubleposts/tripleposts or even more in a row.

Yet I'm having a little(?) problem.
If the post is made by the post reply button everything works fine but if post is made by quick reply (Standard Editor) page is loading endless and the "new post" doesn't appear.

Could this perhaps be because of vB 3.0.7?
As far as I remember there were some small changes in functions_newpost.php

Xenon
02-23-2005, 03:16 PM
hmm, i have not looked at vb3.0.7 as for time reasons, but that would be wierd, as there shouldn't be a difference between QR posts and normal reply posts, both are calling build_new_post and thats where the changes are done.

When i have more time i'll look at it, but if you have further infos please tell me :)

Oblivion Knight
02-23-2005, 04:13 PM
Working fine for me on 3.0.7.. ;)

Curzon564
02-23-2005, 08:58 PM
Ok, tested today a little bit and found the problem

It's Opera (7.54 & JRE 1.5). IE and Firefox are working fine.
Only Opera doesn't load the new page if poste is made by quick reply.

Xenon
02-24-2005, 05:11 PM
very wierd...

Mark.B
02-24-2005, 05:35 PM
I am going to be controvesial. This hack is great IF you have a pre-existing problem with people spamming their post counts up or bumping threads all the time.

If you DON'T have such a problem then don't install it unless/until you do.

Quite a few people get quite annoyed if they have a legitimate reason for posting two seperate posts and many find it frustrating.

Xenon
02-25-2005, 04:21 PM
well, that's the thing with every hack, just install it if you need it.

so why posting anything which should be wellknown to every admin? :)

Blootix
02-26-2005, 07:22 AM
I don't even think Quick Reply button works in Opera (Unless you've REQUIRED the user to click the Quick Reply button)... I'd stick with Firefox. But yes, it is true that it doesn't work. Most people don't use Opera anyway... so I wouldn't worry about it.

Curzon564
02-26-2005, 05:18 PM
Quick Reply without the hack works fine in Opera, posting this post also with Quick Reply.

I'm preferring Opera (don't like IE & FF very much), but you're right. Most users don't use Opera so this bug (most likely an Opera bug) perhaps won't ever be detected by any user.

The hack really rocks so far. It prevented already a dozen Doubleposts.

The Keeper
03-08-2005, 09:37 AM
I've installed it on 3.0.7 and I seem to be getting the strangest of errors whereby posts are randomly changing. That is, person A makes a post, then a post from Person B in another thread replaces the text only of that post. Might be an unrelated fudge by MySQL but just thought I'd post in case.

Xenon
03-08-2005, 04:09 PM
sounds really wierd.

kcadd
03-12-2005, 10:13 AM
/me installs this hack

thanks xenon!

bold
03-15-2005, 07:30 AM
thanks

The Keeper
03-16-2005, 01:29 PM
Yeah it's still happening. Is anyone else getting this? 3.0.7 and so far this is the only hack installed. Is it possible that the hack is making amendments to the post table that aren't supported in 3.0.7?

Imperial Fritz
03-19-2005, 01:14 AM
I'd like to ask how could this be enabled for everybody, but disabled for just a few people who actually have a reason to post separate posts?

EDIT: ok I read a bit and did it myself

Brandon Sheley
03-29-2005, 09:18 AM
very nice hack, i've seen it at sites and was looking for it,, Thank you
-LM

CrazyLady
04-02-2005, 03:38 PM
1) is this hack Version 3.0.7 friendly?
2) if in the second post, the member exceeds images allowed, what happens? (answer found)
3) are admins and mods excluded from this?

Xenon
04-03-2005, 03:27 PM
1) yes, as you can see on vb.org ;)
2) ;)
3) nope, but in this thread you can find the instructions to exclude them :)

CrazyLady
04-03-2005, 03:45 PM
3) nope, but in this thread you can find the instructions to exclude them :)

I read the entire thread... those instructions were for an earlier version I believe.. I can't find the code to replace?

JohnBee
04-14-2005, 11:05 AM
I saw a similar hack on another forum software and when the user would add
additional text to a post...

JohnBee
04-14-2005, 11:06 AM
*user posted 2 minutes later

It would put something like that between them.
Is it possible to do that with this hack also?

Xenon
04-14-2005, 07:16 PM
post seperator can be whatever you want it to be, that's why i added that one into the option array :)

JohnBee
04-14-2005, 09:19 PM
Yes I saw that, but im stuck on the time display thingy :P

I'm not much of a code so I guess I'm asking what code I would stick
there to produce that :)

If you could tell me that I would be one happy camper :D
I just read that getting the times in there would require much modification
I have a phpbb hack that does this and there code is HUGE in comparisson
and many table queries where logs /records are created, obviously to
manage or calculate times bewteen merges.

anyways, if someone could show me how to get the users name
into the line I would be happy.

ex: *JohnBee has added shortly after...

Marco van Herwaarden
04-15-2005, 05:49 AM
In your includes/functions_newpost.php, find the following:

// we are here, so we may have a doublepost -> do more exact checkings
$doublepost = $DB_site->query_first("
SELECT postid, pagetext, post.title, post.userid, post.attach
and replace by:
// we are here, so we may have a doublepost -> do more exact checkings
$doublepost = $DB_site->query_first("
SELECT postid, pagetext, post.title, post.userid, post.attach, post.dateline AS dateline


Then find:
$post['message'] = $doublepost['pagetext'] . $dp_settings['spacer'] . $post['message'];

and replace by:
$post['message'] = $doublepost['pagetext'] . $dp_settings['spacer'] . "$bbuserinfo[username] posted " . ((TIMENOW - $doublepost[dateline]) / 60) . " minutes later:\n" . $post['message'];


I don't have this hack installed and i didn't test the above example. So test this first on a testboard.

JohnBee
04-15-2005, 11:03 AM
WOW!

Dude it works!:thumbsup:
I needs a little formating but WOW! this is exactly like the phpBB hack except its
1000 lines shorter LMAO!

One thing that I noticed is it posts a highly accurate time stamp :)
like *User posted 1.222343424 mins later.

it doesnt do it all the time but quite often.

WHat kind of text formating can I apply to this, I didn't t see any html in the
newpost.php anywheres so im assuming it uses something else, I noticed the
/n is a cr equivalent or something, so I will research it, I want to make it
smaller and dark blue...

once again thank you for your great support everyone ;)

Marco van Herwaarden
04-15-2005, 11:27 AM
Change:
((TIMENOW - $doublepost[dateline]) / 60)
To:
intval((TIMENOW - $doublepost[dateline]) / 60)

JohnBee
04-15-2005, 12:00 PM
Thank you MarcoH64

The fixed the .2122223332 problem, it seems of of round it off to the minute.
is there a way to round it off to the min.second ?

ex: *User has posted 1 minutes 42 seconds later

or *User has posted 1.23 minutes later

either or would work nicely :)

Marco van Herwaarden
04-15-2005, 12:39 PM
Ok, change that line to:
$post['message'] = $doublepost['pagetext'] . $dp_settings['spacer'] . "$bbuserinfo[username] has posted " . intval((TIMENOW - $doublepost[dateline]) / 60) . " minutes " . intval((TIMENOW - $doublepost[dateline]) % 60). " seconds later:\n" . $post['message'];

Or:
$post['message'] = $doublepost['pagetext'] . $dp_settings['spacer'] . "$bbuserinfo[username] posted " . round(((TIMENOW - $doublepost[dateline]) / 60), 2) . " minutes later:\n" . $post['message'];

JohnBee
04-15-2005, 01:26 PM
Well that did it!

Thank you Xenon and MarcoH64 for your hack and excellent support!
I managed to get this thing tuned just the way I hoped and now it looks and performs
perfectly.

:thumbsup:

Good work and keep up the quality releases. Your efforts are greatly appreciated.
and only remind me why I paid for vBulletin over the competition.

~JB

Xenon
04-15-2005, 03:33 PM
:)

we're glad you like it :)

Marco van Herwaarden
04-15-2005, 03:50 PM
And WE are glad you liked it too :D

KW802
04-23-2005, 10:10 PM
Thanks guys! This is definitely one of those rare hacks that is so useful that it should be a function that comes out-of-the-box with vBulletin. :cool:

007
04-26-2005, 12:23 AM
I found a bug!

If you have a smilie limit turned on, say 5. If someone's previous post has 5 smilies already, it won't merge their next one. :(

Can somebody code a fix for this? It's annoying because my members have found that this is a convenient way to bump their threads. :(

Xenon
04-27-2005, 10:26 AM
well, actually that's not a bug but a bugfix.

i have had to add that, as if i wouldn't do so, the merge would produce an invalid post, which means, if they edit the post afterwards, without changing something, just edit-submit it would produce a too many images error.

you should increase the smilielimit ;)

007
04-27-2005, 03:59 PM
LOL! I have the smilie limit set at 5.. do you think that is not enough??

(I actually upped this limit before until a recent member put 40 in a row. :()

I guess I can't win no matter how hard I try lol!

Xenon
04-28-2005, 05:34 PM
5 is very low, i know from other boards, there are members posting long texts and are complaining, because 20 smilies limit is enabled (and it's not 20 in a row) ^^

but nope, you cannot win, as this is no bug ^^

prawn
05-08-2005, 02:22 PM
hi there
i installed that hack on my board but it seems that nothing works. i altered the file as i should but preventing is enabled. there are no error messages or something the file works as before. any ideas?

Xenon
05-09-2005, 07:36 AM
nope, i assume you made a mistake during the install process.

i did not get a similar report yet.