vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Prevent Doubleposting (https://vborg.vbsupport.ru/showthread.php?t=59916)

Xenon 01-07-2004 10:00 PM

Prevent Doubleposting
 
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

Quote:

Originally Posted by Xenon
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

Quote:

Originally Posted by Xenon
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.

Code:

// 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

Quote:

Originally Posted by Xenon
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

[high]* Koutaru installs!
[/high]

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:

Quote:

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

Quote:

Originally Posted by Gio Takahashi
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:

PHP 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.
Code:

SET pagetext = '" . addslashes($doublepost['pagetext'] . "\n\n" . $post['message']) . "',
becomes
Code:

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

Quote:

Originally Posted by The Quibbler
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

Quote:

Originally Posted by Zelda-King
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:
PHP Code:

        // 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 ;)


All times are GMT. The time now is 01:37 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01650 seconds
  • Memory Usage 1,827KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete