vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Prevent Doubleposting (https://vborg.vbsupport.ru/showthread.php?t=96602)

Cyricx 11-23-2005 03:29 PM

double merging, you mean like it duplicated what you were merging into the post and put it twice?

Xenon 11-24-2005 05:07 PM

exactly

i found it a bit funny ^^

Paul M 11-25-2005 07:57 AM

Hmm, well I installed this on my test forum last night, and yes, it has (had) two problems ;

1. The post dateline is not updated on a merge, so it doesn't get seen as unread.

2. The one everyone complains about - no ajax refresh (unless you alter the time stamp, then you get two versions of the same post).


So, since I wanted this on our forum I have fixed both locally - this is what I have done.


1. To fix the timestamp ;

Find ;

PHP Code:

// set info 

Add below it ;

PHP Code:

$dataman2->set('dateline'TIMENOW); 

2. To fix the ajax issue, use this nasty hack ;

Find ;

PHP Code:

    if ($isdoublepost)
    {
        
$id $doublepost['postid'];
        
$dataman->save();
        
        
//now add edited by
        
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']) . "')
            "
);
        }
    } 

Replace with ;

PHP Code:

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

Seems to work okay for me, feel free to try it. :)

Boofo 11-25-2005 08:15 AM

Paul, then how will you know when the first post was written? ;)

Paul M 11-25-2005 08:25 AM

You won't (unless perhaps you add it into the seperator). I don't really care as we only use a 1 hour limit for double posts anyway. If it bothers you then simply don't do step 1 - your choice. :)

keymistress 11-25-2005 08:32 AM

does this script work on version 3.5.1?
before your hack i tried on 3.5 and it's ok but it doesn't seem to be working for 3.5.1...
or maybe it's just me...

Boofo 11-25-2005 08:33 AM

Quote:

Originally Posted by Paul M
You won't (unless perhaps you add it into the seperator). I don't really care as we only use a 1 hour limit for double posts anyway. If it bothers you then simply don't do step 1 - your choice. :)

All I did was ask a question, not complain.

Paul M 11-25-2005 08:38 AM

Quote:

Originally Posted by Boofo
All I did was ask a question, not complain.

All I did was answer it. :p

moonclamp 11-25-2005 09:22 AM

Quote:

Originally Posted by Paul M
All I did was answer it. :p

Why did you call that a 'nasty' hack if it works?

Is there potential for problems?

Snake 11-25-2005 12:25 PM

Quote:

Originally Posted by moonclamp
Why did you call that a 'nasty' hack if it works?

Is there potential for problems?

I was going to ask the same thing lol.


All times are GMT. The time now is 04:55 PM.

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.01378 seconds
  • Memory Usage 1,761KB
  • 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
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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