vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   New Posting Features - Doublepost Prevention (https://vborg.vbsupport.ru/showthread.php?t=203705)

Paul M 01-30-2009 10:00 PM

Doublepost Prevention
 
As of 24 Nov 2017 this modification has been withdrawn.

This is an updated version of the popular modification, previously released by Xenon. It is released with his kind permission.

Basically, if member posts in a thread where they were the previous last poster, then if the conditions are met, their new post will be auto-merged into the previous post instead of creating a new "double" post.

A number of options are provided ;

Time Limit - if more than xxx minutes have passed since the last post, no merge is done.

Timestamp Spacer - if enabled, a timestamped spacer is added between the old post text and the new post text.

Post Timestamp Update - if enabled the newly merged post will have its post time updated to the new time, otherwise it retains the time of the original post.

Spacer Colour - allows you to set the colour of the spacer between merged posts.

Usergroup exceptions - Allows you to exempt certain usergroups from the doublepost merges.

Forum exceptions - Allows you to exempt certain forums form the doublepost merges.

All settings are located in vBulletin Options > Doublepost Prevention.


To install just unzip the XML and import into vB using the ACP Product Manager.


History:

v3.8.001 : First Release for vB 3.8.
v3.8.002 : Phrased the post separater.
v3.8.003 : Added JS Template - removing need to edit quick reply javascript file.
v3.8.004 : Updated spacer options.
v3.8.005 : Updated timestamp spacer to fix issue with large merge times.


dannykilla 01-31-2009 12:37 PM

awesome thanks

Sc00by22 01-31-2009 12:53 PM

Thanks, when you use quick reply, it doesn't work with ajax, it places another post underneath but all off center until you refresh.

pipin 01-31-2009 01:04 PM

Great.

For all who have the compressed javascript files:

Just copy the content of vbulletin_quick_reply.js into http://elfz.laacz.lv/beautify/

Beautify it, change the file and upload it.

EDIT:

This does not work, cause content of the uncompressed javascript file is differen!!!

Forum Lover 01-31-2009 01:07 PM

Tagged. Is it possible not to effect on thread openers. I mean, If I am the tread opener, then it wont effect me. I really need that badly. :( Or is it there already?

Paul M 01-31-2009 01:26 PM

Quote:

Originally Posted by Sc00by22 (Post 1729897)
Thanks, when you use quick reply, it doesn't work with ajax.

Yes it does.

You MUST do the javascript edit tho.


Quote:

Originally Posted by Forum Lover (Post 1729910)
Tagged. Is it possible not to effect on thread openers. I mean, If I am the tread opener, then it wont effect me. I really need that badly. :( Or is it there already?

Sorry, there is no such feature.

jshg46 01-31-2009 01:30 PM

be nice to see something like this for attachments, but have it if any member post an attachment with the same name it will not let them post it.

Subah 01-31-2009 01:47 PM

Thanks a lot Paul but what about attached the file that you say it is need to edit ?
i can not edit !! or i mean i do not know how to !!

Rat1972 01-31-2009 01:54 PM

I searched in the javascript, but no such code to replace with.

nexialys 01-31-2009 02:42 PM

thanks Paul... looks like the harrasments to release this version finally gave a result.. LOL!

Paul M 01-31-2009 02:52 PM

Quote:

Originally Posted by jshg46 (Post 1729939)
be nice to see something like this for attachments, but have it if any member post an attachment with the same name it will not let them post it.

Posts with attachments are not merged by design, I have no plans to alter that.

Quote:

Originally Posted by Subah (Post 1729949)
Thanks a lot Paul but what about attached the file that you say it is need to edit ?
i can not edit !! or i mean i do not know how to !!

Sorry, but free support does not extend to to teaching you how to edit files.

Quote:

Originally Posted by Rat1972 (Post 1729953)
I searched in the javascript, but no such code to replace with.

You are doing something wrong then, the code is there.

Quote:

Originally Posted by nexialys (Post 1729980)
thanks Paul... looks like the harrasments to release this version finally gave a result.. LOL!

Yes, thought about it a while ago, and decided on it the other day.

RedHacker 01-31-2009 03:36 PM

Find the following code ; in the txt.file not found....

Rat1972 01-31-2009 03:51 PM

Quote:

Originally Posted by Paul M (Post 1729985)


You are doing something wrong then, the code is there.

I have searched the whole file, there is no such a code what like in the readme file. I am sure about that, :)

Paul M 01-31-2009 04:05 PM

The code is there (in vbulletin_quick_reply.js)

I just looked for it again ;

Code:

function qr_do_ajax_post(ajax)
{
        if (ajax.responseXML)
        {
                document.body.style.cursor = 'auto';
                fetch_object('qr_posting_msg').style.display = 'none';
                var i;

                if (fetch_tag_count(ajax.responseXML, 'postbit'))
                {
                        ajax_last_post = ajax.responseXML.getElementsByTagName('time')[0].firstChild.nodeValue;
                        qr_disable_controls();
                        qr_hide_errors();

                        var postbits = ajax.responseXML.getElementsByTagName('postbit');
                        for (i = 0; i < postbits.length; i++)
                        {
                                var newdiv = document.createElement('div');
                                newdiv.innerHTML = postbits[i].firstChild.nodeValue;
                                var lp = fetch_object('lastpost');
                                var lpparent = lp.parentNode;
                                var postbit = lpparent.insertBefore(newdiv, lp);

                                PostBit_Init(postbit, postbits[i].getAttribute('postid'));
                        }


                        // unfocus the qr_submit button to prevent a space from resubmitting
                        if (fetch_object('qr_submit'))
                        {
                                fetch_object('qr_submit').blur();
                        }
                }
                else
                {
                        if (!is_saf)
                        {
                                // this is the nice error handler, of which Safari makes a mess
                                var errors = ajax.responseXML.getElementsByTagName('error');
                                if (errors.length)
                                {
                                        var error_html = '<ol>';
                                        for (i = 0; i < errors.length; i++)
                                        {
                                                error_html += '<li>' + errors[i].firstChild.nodeValue + '</li>';
                                        }
                                        error_html += '</ol>';

                                        qr_show_errors('<ol>' + error_html + '</ol>');

                                        return false;
                                }
                        }

                        qr_resubmit();
                }
        }
        else
        {
                qr_resubmit();
        }
}


Magnumutz 01-31-2009 04:06 PM

Awesome Paul, good job mate !

Later edit: What the hell, i can't find any of those phrases in the js file...

A bit Later edit: I'm using 3.8.1

Rat1972 01-31-2009 04:12 PM

Quote:

Originally Posted by Paul M (Post 1730053)
The code is there (in vbulletin_quick_reply.js)

I just looked for it again ;

Code:

function qr_do_ajax_post(ajax)
{
        if (ajax.responseXML)
        {
                document.body.style.cursor = 'auto';
                fetch_object('qr_posting_msg').style.display = 'none';
                var i;

                if (fetch_tag_count(ajax.responseXML, 'postbit'))
                {
                        ajax_last_post = ajax.responseXML.getElementsByTagName('time')[0].firstChild.nodeValue;
                        qr_disable_controls();
                        qr_hide_errors();

                        var postbits = ajax.responseXML.getElementsByTagName('postbit');
                        for (i = 0; i < postbits.length; i++)
                        {
                                var newdiv = document.createElement('div');
                                newdiv.innerHTML = postbits[i].firstChild.nodeValue;
                                var lp = fetch_object('lastpost');
                                var lpparent = lp.parentNode;
                                var postbit = lpparent.insertBefore(newdiv, lp);

                                PostBit_Init(postbit, postbits[i].getAttribute('postid'));
                        }


                        // unfocus the qr_submit button to prevent a space from resubmitting
                        if (fetch_object('qr_submit'))
                        {
                                fetch_object('qr_submit').blur();
                        }
                }
                else
                {
                        if (!is_saf)
                        {
                                // this is the nice error handler, of which Safari makes a mess
                                var errors = ajax.responseXML.getElementsByTagName('error');
                                if (errors.length)
                                {
                                        var error_html = '<ol>';
                                        for (i = 0; i < errors.length; i++)
                                        {
                                                error_html += '<li>' + errors[i].firstChild.nodeValue + '</li>';
                                        }
                                        error_html += '</ol>';

                                        qr_show_errors('<ol>' + error_html + '</ol>');

                                        return false;
                                }
                        }

                        qr_resubmit();
                }
        }
        else
        {
                qr_resubmit();
        }
}


The whole block is missing in my script... Strange.

Paul M 01-31-2009 04:18 PM

Are you sure you have the correct file (vbulletin_quick_reply.js, 3.8 version, uncompressed).

There is no way that can be missing ;)

Magnumutz 01-31-2009 04:22 PM

Dude, i just downloaded 3.8.1 from the vBulletin Member's Area, and the code is not there.
vBulletin gets downloaded with uncompressed js's by default, right?

Rat1972 01-31-2009 04:23 PM

Quote:

Originally Posted by Paul M (Post 1730067)
Are you sure you have the correct file (vbulletin_quick_reply.js, 3.8 version, uncompressed).

There is no way that can be missing ;)

I am absolute sure and it was missing. But i added (the block) it the vbulletin_quick_reply and it work like charm. Strange it was missing, but now its working! Thanks Paul!


*click* install

Rat1972 01-31-2009 04:23 PM

Quote:

Originally Posted by Magnumutz (Post 1730071)
Dude, i just downloaded 3.8.1 from the vBulletin Member's Area, and the code is not there.
vBulletin gets downloaded with uncompressed js's by default, right?

Same here :D
But i added it, and it worked :)

Magnumutz 01-31-2009 04:25 PM

Looks like i was wrong... vBulletin comes with compressed javascripts.
You got to manually select the "Package - Uncompressed JavaScript".

Sorry for the trouble Paul... geez i feel dumb...

Rat1972 01-31-2009 04:28 PM

I think i found the problem. The 3.8.0 quick reply has the code. I donwloaded that one, and it wasnt hard to find that code.

But when i download 3.8.1 and do the same thing, the code isn't there, i think there has been a code change in that script.

RedHacker 01-31-2009 04:32 PM

I have 3.8.1 and no saw this code but open vbulletin_quick_reply.js with Word and I saw this code and change..!!!But if i do quick reply saw two posts in thread but if doing refresh doing one..!!!Why...?Can doing one with auto refresh...?

Paul M 01-31-2009 04:34 PM

Just to be quite clear - the javascript file has not changed in ANY version of 3.8.x

Please READ the big red note, its there for a reason. :)

Quote:

... you must have the uncompressed versions - obtaining these is an option when you download vbulletin, by default you get the compressed versions.

Kihon Kata 01-31-2009 05:01 PM

HI Paul,

This is a great mod and works well on my current board. The old one is working on my 3.8, np. With that said, I'd like to ask a hypothetical question:

If I install yours (and remove my old one), AND and in the future upgrade my forum, will the javascript file that needs the EDIT, be overwritten?

redlabour 01-31-2009 05:10 PM

Awesome! :)

Paul M 01-31-2009 05:13 PM

Quote:

Originally Posted by Kihon Kata (Post 1730100)
If I install yours (and remove my old one), AND and in the future upgrade my forum, will the javascript file that needs the EDIT, be overwritten?

Yes. On any upgrade you would need to re-edit the JS file.

redlabour 01-31-2009 05:18 PM

Quote:

Originally Posted by pipin (Post 1729907)
Great.

For all who have the compressed javascript files:

Just copy the content of vbulletin_quick_reply.js into http://elfz.laacz.lv/beautify/

Beautify it, change the file and upload it.

Does not work - the Code is still missing - searched more then one Time with Notepad++.

Quote:

Originally Posted by Paul M (Post 1730112)
Yes. On any upgrade you would need to re-edit the JS file.

I still cant find the part of Script - i have tested it in compressed and uncompressed File. :cool:

vBulletin 3.8.1

And anyway why is the Fileedit needed? Xenon?s did not need any Fileedit. This seems to be too much work after every vBulletin Update for this Mod. Never seen a Mod which is using the uncompressed Files before.

Will use Xenon?s till there is a Update without any Fileedit needed. :(

Paul M 01-31-2009 06:20 PM

TBH, I give up. It works fine (as seen on this site, and my forum).

Im already sick of repeating that the code is there. FYI, the file edit is to make ajax merge work properly, I really dont care if you havent seen one that edits JS files before. This does, simple as that. This is the only update you will see so you will have a long wait for any other.

rizelim 01-31-2009 06:26 PM

Thanks Paul ! Thanks Xenon !

djbaxter 01-31-2009 06:46 PM

Thanks, Paul. [s]The only issue I see with the current version of this add-on is that the edits to vbulletin_quick_reply.js are going to need to be redone with each upgrade. I don't suppose there's any way around that, is there?[/s]

Never mind - clarified above. So if one decides not to bother with that edit, it will still work correctly but not update via Ajax (i.e., you'll have to refresh the page to see the automerge)... is that correct?

Martin9887 01-31-2009 06:46 PM

Works fine, very nice mod.

However, is it normal for it to create a new post when using quick reply?

Edit:

I think it's okay, it makes a second post when using quick reply but when I reload the thread it's only the one post.

IIAnDoII 01-31-2009 06:58 PM

works perfect thanks Paul

Paul M 01-31-2009 07:21 PM

Quote:

Originally Posted by djbaxter (Post 1730196)
So if one decides not to bother with that edit, it will still work correctly but not update via Ajax (i.e., you'll have to refresh the page to see the automerge)... is that correct?

I believe so (See below).


Quote:

Originally Posted by Martin9887 (Post 1730197)
Works fine, very nice mod.

However, is it normal for it to create a new post when using quick reply?

Edit:

I think it's okay, it makes a second post when using quick reply but when I reload the thread it's only the one post.

That means you havent done the JS edit (correctly).

redlabour 01-31-2009 07:32 PM

Quote:

Originally Posted by Paul M (Post 1730232)
I believe so (See below).

OK - then it means it works the Way Xenon?s does before. His one has the same small Problem all the Time.

pipin 01-31-2009 07:45 PM

Quote:

Originally Posted by redlabour (Post 1730116)
Does not work - the Code is still missing - searched more then one Time with Notepad++.



I still cant find the part of Script - i have tested it in compressed and uncompressed File. :cool:

vBulletin 3.8.1

Its there in the uncompressed file.

But could someone enlighten me, why the code is different in the compressed one?

Martin9887 01-31-2009 07:50 PM

Got it fully working now, excellent mod and much appreciated. I like many of your mods, Paul M.

Valter 01-31-2009 07:59 PM

Quote:

Originally Posted by Martin9887 (Post 1730197)
it makes a second post when using quick reply but when I reload the thread it's only the one post.

Great. I can upgrade now.

First I was happy to see new version is available, then disappointed by installation step where you need to edit vB file.

Thanks to both, Paul and Xenon.

Valter 01-31-2009 08:06 PM

Hmmm... You should move this:
Code:

---------- Post added at
----------
---------- Previous post was

to Phrase.

Something like:
Code:

Post added at {1}, previous post was {2}.

Kihon Kata 01-31-2009 08:27 PM

Quote:

Originally Posted by Paul M (Post 1730112)
Yes. On any upgrade you would need to re-edit the JS file.

Thanks for the reply Paul. I guess I won't update this. I know I'll forget to update the JS when I upgrade. Heck, I can't remember much these days. I know that I'll upgrade and it won't work, then I'll spend hours trying to figure out why. LOL


All times are GMT. The time now is 05:28 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.01878 seconds
  • Memory Usage 1,859KB
  • 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_code_printable
  • (20)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