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)

Boofo 11-25-2005 12:31 PM

Quote:

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

This is the part I was referring to:

Quote:

If it bothers you then simply don't do step 1
;)

Paul M 11-25-2005 03:45 PM

Quote:

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

Is there potential for problems?

There are no problems with it, it's just a phrase. :)

The 'fix' is really just a workaround to bypass ajax rather than a proper fix using ajax.

Boofo 11-25-2005 03:57 PM

Quote:

Originally Posted by Paul M
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. :)

Shouldn't that be:

PHP Code:

 $dataman2->set_info('dateline'TIMENOW);[/ 


Paul M 11-25-2005 04:16 PM

I don't believe so.

The line probably should't be with the other set_info lines, that just happens to be where I stuck it. :)

Boofo 11-25-2005 04:26 PM

Quote:

Originally Posted by Paul M
I don't believe so.

The line probably should't be with the other set_info lines, that just happens to be where I stuck it. :)

Ok, good enough for me. Installed. ;)

Snake 11-25-2005 04:33 PM

So Paul, this should fix the AJAX issue that we all are having, right?

Xenon 11-25-2005 05:28 PM

@Paul: the first thing is not a problem, it's designed that way ;)

the change of the dateline was optional in the 3.0 version, but not in the original version, as it allows bumping...

Paul M 11-25-2005 05:59 PM

Quote:

Originally Posted by Xenon
@Paul: the first thing is not a problem, it's designed that way ;)

It's a problem to me, and a few others from reading the thread. We don't use it for "anti bumping", we just hate it when people double/treble post in quick sucession. The 'fix' is optional of course. :)

@Aftermath - Yes, it gets round it.

moonclamp 11-25-2005 07:46 PM

Quote:

Originally Posted by Paul M
There are no problems with it, it's just a phrase. :)

The 'fix' is really just a workaround to bypass ajax rather than a proper fix using ajax.

But will ajax still work on the initial post?

Paul M 11-25-2005 07:56 PM

Yes.


All times are GMT. The time now is 03:58 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.01845 seconds
  • Memory Usage 1,765KB
  • 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
  • (5)bbcode_php_printable
  • (7)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