Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

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
  #452  
Old 05-05-2006, 03:53 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yep, and the solution to to an automatic refresh after a post is posted here, iirc, just search the first pages of the thread, it was in them
Reply With Quote
  #453  
Old 05-05-2006, 04:19 PM
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay thanks.

I was aware of this post

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 Additional Comment: \n",    // What should be between the old post and the new one (default: two empty lines). Note: PersianImmortal has added Additional Comment: \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', $vbulletin, ERRTYPE_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', true, false));
    }  
    else
    {
        // no doublepost so save as new post
        $post['message'] = $oldmsg;
        $id = $dataman->save();
    }
This was for the file based edit however, for kicks I replaced my Main Doublepost Prevent Engine contente with this one
it wasn't pretty. I did a search within the thread for auto refresh and I did find 2 results but no reference with code changes other than the one shown above. am I missing it?
Reply With Quote
  #454  
Old 05-05-2006, 04:32 PM
MixMakers MixMakers is offline
 
Join Date: Apr 2005
Posts: 110
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried uninstalling/reinstalling because it didn't seem to work, and now when I try to import the xml, i get this error:

XML Error: mismatched tag at Line 6
Reply With Quote
  #455  
Old 05-06-2006, 01:43 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sounds like a corrupted xml file, redownload it again might help
Reply With Quote
  #456  
Old 05-06-2006, 02:08 PM
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Xenon
yep, and the solution to to an automatic refresh after a post is posted here, iirc, just search the first pages of the thread, it was in them
What does iirc mean?
and I was unable to find an auto refresh function that I could incorporate into the plugin system.
Reply With Quote
  #457  
Old 05-06-2006, 02:50 PM
vitnuce vitnuce is offline
 
Join Date: May 2005
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Xenon,

Does this hack work with v3.5.4 ?

- v
Reply With Quote
  #458  
Old 05-06-2006, 03:05 PM
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by vitnuce
Hi Xenon,

Does this hack work with v3.5.4 ?

- v
Yes I'm using it on 3.5.4, its fine
Reply With Quote
  #459  
Old 05-06-2006, 04:32 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

iirc = if i remember correctly

i just think it was posted here, but not by myself, because the things i wanted to do didn't work out as they should
Reply With Quote
  #460  
Old 05-06-2006, 04:55 PM
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Xenon
iirc = if i remember correctly

i just think it was posted here, but not by myself, because the things i wanted to do didn't work out as they should
Ah okay well thanks, I learned a new thing today iirc
I have the script looking beautifully and other than the lacking autorefresh feature its way nicer than my last file edit based version. However I do miss the auto refresh option though... I wish it came as an option under the CPanel so that way we could use it as an option.

As it is now, my members are a bit confused when they see the merged message and multiple post windows within the thread. So what happens is they try to edit it and then are even more confused afterwards... (its a mess) and yes... they are not all that technical, but I still love them

Anyways I would be more than happy with an edit in the plugin section if you could help me have it refresh after the double post feature is activated though. I tried on my own and although i did get it to autorefresh it was very nasty looking because it would created double, triples, and more everytime. lol

Any idea what command or edit I could add to the existing script to have it auto refresh?
Reply With Quote
  #461  
Old 05-06-2006, 05:26 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well, nope, as i said, my tests didn'T work out well, thats why i did it the "ghost post" way
Reply With Quote
Reply


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 10:28 AM.


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.06731 seconds
  • Memory Usage 2,318KB
  • 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_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