Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Prevent Doubleposting Details »»
Prevent Doubleposting
Version: 1.0, by Xenon Xenon is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 09-19-2005 Last Update: 01-15-2007 Installs: 877
Uses Plugins
 
No support by the author.

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.
This will be done until the old post is older than 24 hours (you can change this timespan yourself)

Nothing more to say about that, it's the quite same as my vb3.0 version.

This Mod should run with 3.6 as well


** Please make sure you ENABLE this product after you install it - it is disabled by default. **

For vb 3.8 there are two alternative updates ;

https://vborg.vbsupport.ru/showthread.php?t=203705
https://vborg.vbsupport.ru/showthread.php?t=204177

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
inphoenix

Comments
  #222  
Old 01-06-2006, 12:13 PM
Saskia's Avatar
Saskia Saskia is offline
 
Join Date: Oct 2005
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice hack! I have used Paul M's fix, but the time only changes on the post itself. So in "new post" searches it doesn't show up and the wrong time is still displayed on the "lastpostby" bit in the forumdisplays.

Anyone know how to change that so the automerged post will turn up as a new post in searches? Thank you.
Reply With Quote
  #223  
Old 01-09-2006, 04:48 PM
shockx5 shockx5 is offline
 
Join Date: Aug 2005
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a great modification, but is there any way to disable it for certain forums, as some forums require double posting rapidly.

i dont know if anything has been posted in this thread about that, so if it has im sorry.

any help would be very much appreciated.
Reply With Quote
  #224  
Old 01-11-2006, 05:43 PM
eoc_Jason's Avatar
eoc_Jason eoc_Jason is offline
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I used the code based off someone's plugin posted a few pages back. I removed the time checking so it would always merge their last post, however it would update all the times so it acted as if it was a new post in the thread.

In the postdata_presave I added the following with all the other set's:
PHP Code:
$this->set('dateline'TIMENOW); 
Here is all of my code in the postdata_postsave, you can see how you have to update both the thread time & forum time:
PHP Code:
if ($this->isdoublepost)
{
    
// Add Edited By Note
    
$this->dbobject->query_write("
        REPLACE INTO " 
TABLE_PREFIX "editlog (postid, userid, username, dateline, reason)
        VALUES (" 
$this->fetch_field('postid') . ", " $this->fetch_field('userid') . ", '" $this->dbobject->escape_string($this->fetch_field('username')) . "', " TIMENOW ", '" $this->dbobject->escape_string('Automerged Doublepost') . "')
    "
);

    
// Update Last Posted In Thread
    
$thread =& datamanager_init('Thread'$this->registryERRTYPE_SILENT'threadpost');
    
$thread->set_existing($this->info['thread']);

    
$thread->set('lastpost'TIMENOW);
    
$thread->set('lastposter'$this->fetch_field('username'));

    
$thread->save();

    
// Update Last Posted In Forum
    
$forumdata =& datamanager_init('Forum'$this->registryERRTYPE_SILENT);
    
$forumdata->set_existing($this->info['forum']);
    
$forumdata->set_info('disable_cache_rebuild'true);

    
$forumdata->set('lastpost'$this->fetch_field('dateline'));
    
$forumdata->set('lastposter'$this->fetch_field('username''post'));

    
$forumdata->set('lastthread'$this->info['thread']['title']);
    
$forumdata->set('lastthreadid'$this->info['thread']['threadid']);
    
$forumdata->set('lasticonid', ($this->info['thread']['pollid'] ? -$this->info['thread']['iconid']));

    
$forumdata->save();

    
// Set Redirect
    
$postid $this->fetch_field('postid');
    
$this->registry->url 'showthread.php?' $vbulletin->session->vars['sessionurl'] . "p=$postid#post$postid";
    eval(
print_standard_redirect('redirect_doublepost'truetrue));


The reason the forum & thread do not get updated is because an "edit" creates the $this->condition and thus the other two queries will not run automatically.

Hope this helps.
Reply With Quote
  #225  
Old 01-11-2006, 06:01 PM
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have modified the code as follows:
Code:
$post['message'] = $doublepost['pagetext'] . $dp_settings['spacer'] . " $vbulletin->userinfo[username] added " . intval((TIMENOW - $doublepost[dateline]) / 60) . " minute(s) " . intval((TIMENOW - $doublepost[dateline]) % 60). " seconds later...\n\n" . $post['message'];
No matter what I try I cannot get it to display the username in the comment, can someone help me?
Reply With Quote
  #226  
Old 01-11-2006, 07:35 PM
IrPr IrPr is offline
 
Join Date: Mar 2005
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PaulM ur fix not workin when upgraded to 3.5.3


Quote:
Fatal error: Call to undefined function: build_thread_counters() in c:\program files\easyphp1-8\www\forum\newreply.php(530) : eval()'d code on line 14
Reply With Quote
  #227  
Old 01-12-2006, 04:44 AM
biggazillakilla biggazillakilla is offline
 
Join Date: Mar 2004
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andreas
Hmm, I can't reproduce such problems on my board.

But I think the SQL error is releated to thread/forum subscriptions, as the Datamanager won't return the postid.

Edit: Reproduced.

Actually, the database error causes the double merge:

The QR AJAX JS gets the database error and attempts a repost.
This one works in an interesting way, too. (Attachment link.) I've just tested it on my test board, and it merges all posts without paragraph breaks, which doesn't look too good.

I seem to recall that you're not developing this as a plugin, but just in case...
Reply With Quote
  #228  
Old 01-12-2006, 05:09 AM
EasyTarget EasyTarget is offline
 
Join Date: Nov 2004
Posts: 660
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you go to the vbulletin options and you can add linebreaks or whatever you want to do.
Reply With Quote
  #229  
Old 01-12-2006, 08:14 AM
IrPr IrPr is offline
 
Join Date: Mar 2005
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any suggestion ?

Quote:
Fatal error: Call to undefined function: build_thread_counters() in forum/newreply.php(530) : eval()'d code on line 14
im got this fatal error when upgrade my board to 3.5.3 and do PaulM's code modifications
Reply With Quote
  #230  
Old 01-13-2006, 01:44 AM
PersianImmortal PersianImmortal is offline
 
Join Date: Dec 2005
Location: Australia
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got this to work on my 3.5.3 board (TweakGuides Forums) by using the original code, modifying as provided by Paul M, and also adding one new feature I think is very useful. This code works with AJAX (e.g. Quick Reply) without any problems, it automatically refreshes the page:

PHP Code:
// ########### Xenon Modified Prevent Doublepost Hack #########
    
$dp_settings = array(
        
'timespan' => 3600 24// how many seconds after the last post the new post is defined as doublepost (default: 24 hours)
        
'spacer' => "\n\n [b]Additional Comment:[/b] \n",    // What should be between the old post and the new one (default: two empty lines). Note: PersianImmortal has added [b]Additional Comment:[/b] \n to make it clear what is being added each time - can be removed if you wish.
        
'editedbymsg' => '[Automerged Doublepost]'// If left blank no edited by will appear
    
);
    
    
$isdoublepost false;
    
$oldmsg $post['message'];

    if (
$type != 'thread' 
        
AND $threadinfo['lastpost'] > TIMENOW $dp_settings['timespan'
        AND 
$threadinfo['lastposter'] == $vbulletin->userinfo['username'])
    {
        
// we are here, so we may have a doublepost -> do more exact checkings
        
$doublepost $vbulletin->db->query_first("
            SELECT post.*
            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 $dp_settings['timespan']) . "
                AND visible = 1 AND deletionlog.primaryid IS NULL
            ORDER BY dateline DESC
            LIMIT 1
        "
);
    
        if (
$doublepost['userid'] == $vbulletin->userinfo['userid'])
        {
            
// we truely have a doublepost, now check if the merged post still fits the rules!
            
$dataman2 =& datamanager_init('Post'$vbulletinERRTYPE_ARRAY'threadpost');
            
$dataman2->set_existing($doublepost);
            
$post['message'] = $doublepost['pagetext'] . $dp_settings['spacer'] . $post['message'];
            
            
// set info
            
$dataman2->set_info('preview'$post['preview']);
            
$dataman2->set_info('parseurl'$post['parseurl']);
            
$dataman2->set_info('posthash'$post['posthash']);
            
$dataman2->set_info('forum'$foruminfo);
            
$dataman2->set_info('thread'$threadinfo);
    
            
// set options
            
$dataman2->setr('showsignature'$post['signature']);
            
$dataman2->setr('allowsmilie'$post['enablesmilies']);
    
            
// set data
            
$dataman2->setr('pagetext'$post['message']);
            
$dataman2->setr('iconid'$post['iconid']);
    
            
$dataman2->pre_save();
            if (!
$dataman2->errors)
            {
                
// merged post is ok, so do merging
                
$isdoublepost true;
                unset(
$dataman);
                
$dataman =& $dataman2;
                
$post['postid'] = $doublepost['postid'];
            }
            else
            {
                
// merging will produce errors so keep it as a single post..
                
$isdoublepost false;
            }
        }
    }
    
if (
$isdoublepost)
    {
        
// Ugly hack added by Paul M to fix ajax merge //
        
if (!$vbulletin->GPC['ajax'])
        {
            
$id $doublepost['postid'];
            
$dataman->save();
        
            if (
$dp_settings['editedbymsg'] != '')
            {
                
$vbulletin->db->query_write("
                REPLACE INTO " 
TABLE_PREFIX "editlog (postid, userid, username, dateline, reason)
                VALUES (
$id, " $vbulletin->userinfo['userid'] . ", '" addslashes($vbulletin->userinfo['username']) . "', " TIMENOW ", '" addslashes($dp_settings['editedbymsg']) . "')
                "
);
            }
        }
        
$vbulletin->url 'showthread.php?' $vbulletin->session->vars['sessionurl'] . "p=$post[postid]#post$post[postid]";
        eval(
print_standard_redirect('redirect_postthanks'truefalse));
    }  
    else
    {
        
// no doublepost so save as new post
        
$post['message'] = $oldmsg;
        
$id $dataman->save();
    } 
In summary the modifications to the original code are firstly the second step provided by Paul M (comment tags show Paul's added code as he provided it) - this is necessary for the AJAX refresh to work properly.

I also added an Additional Comment: heading in the Spacer, so that each automerged reply looks like this:

Additional Comment:
Second post text merged into first post

Additional Comment:
Third post text merged into first post

That way it becomes obvious what's been merged, both to the user and the reader. Also helps prompt the user to use the Edit button to add additional comments next time rather than just post multiple times in a row.

As I said, this now works perfectly on my board, and having tested it with both standard replies, quick replies using full AJAX features enabled, there are no errors or glitches.

Many thanks to Xenon and Paul M for this great mod, very useful and prevents a lot of conflicts and work for mods who get tired of having to merge multiple posts by individuals.
Reply With Quote
  #231  
Old 01-13-2006, 09:34 AM
IrPr IrPr is offline
 
Join Date: Mar 2005
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice! but it works same as Andreas's Product
but PaulM's method don't need refreshing
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06416 seconds
  • Memory Usage 2,383KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete