vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Prevent Doubleposting (https://vborg.vbsupport.ru/showthread.php?t=59916)

chrisvonc 06-23-2004 01:33 PM

If I understand you right, post 24 (https://vborg.vbsupport.ru/showpost....5&postcount=24) has a tip that lets you define a comment for double posts. Also note the correction in post #25 as well. :)

Andreas 07-15-2004 09:16 PM

@Xenon
It seems like this hack does provide some kind of "backdoor": It allows the user to add more images to his post then he would normally be allowed to have.

Furthermore, it seems like this adds a query whenever a new reply is posted.
What about adding $threadinfo['lastposter'] == $bbuserinfo['username'] to the condition before $doublepost = ...?

As this evaluates to false if there is no double post (and thus the whole term will be false) it's not necessary to continue evaluating the query, or am I wrong?

Xenon 07-15-2004 11:17 PM

@Kirby: hmm, right, the backdoor is possible, will have to take a look at it...

As for the second part. yes, you can avoid the query in the if clause, by that, but you will still need the query when you update the post later (because of deleting the postindex, updating the pagetext...

Also as we have had some problems sometimes, when the lastposter cache isn't correctly or something like, then the string compare would resolve incorrectly.

I think it doesn't matter that much, but i'll consider it when i have the time to look through all of my hacks soon :)

Xenon 07-20-2004 04:34 PM

Hmm, i was just thinking: Sometimes, when users make doublepost it is, because they just can post a special ammount of images per post.

So, the question is, should i really fix that 'backdoor'?

Oblivion Knight 07-20-2004 05:18 PM

Quote:

Originally Posted by Xenon
Hmm, i was just thinking: Sometimes, when users make doublepost it is, because they just can post a special ammount of images per post.

So, the question is, should i really fix that 'backdoor'?

You raise a valid point, and in my opinion it shouldn't be fixed (or if it is, make it some kind of option if possible).

Boofo 07-20-2004 06:25 PM

Quote:

Originally Posted by Xenon
Hmm, i was just thinking: Sometimes, when users make doublepost it is, because they just can post a special ammount of images per post.

So, the question is, should i really fix that 'backdoor'?

Of course you should fix it. What is the sense of having an image limit if they can get around it like that? ;)

Xenon 07-20-2004 06:34 PM

nice to get two totally different answers ^^

well, i'll think about it ^^

Andreas 07-20-2004 07:28 PM

Well, actually I got a couple of users who explicitly use this got get more images into their posts :(

Xenon 07-20-2004 08:28 PM

Ok, i have uploaded Version 1.4.

It now checks if the new post is valid regarding the settings (max images/ max characters...)
If it is, then it will merge the post, if it's not, then the new post will be a true doublepost.

I did it that way, because the limit will appear when doing an edit on a merged post otherwise.

Also i have removed a bit overhead of the code.

My test worked well, but i consider it as RC, until some of you can confirm they don't have problems (there shouldn't be, but you cannot be too sure ;))

Merjawy 07-20-2004 08:34 PM

Really nice and needed hack thnx Xenon

my question and forgive me if it was mentioned before, what if a user clicks the Quick Reply icon to replay to the first post and clicked it again to replay lets say to the 3rd post in there and clicked again to reply to the 6th reply in there, would this hack merge all 3 posts as you see there seperate replies

Thnx

Andreas 07-20-2004 08:41 PM

Yes it will.

Xenon 07-20-2004 08:51 PM

That way, you have a multiple quote option included *ggg*

As mentioned in the description, this hack is for linear mode, threaded mode users, shouldn't use it.
but as there are more problems when someone enables threaded mode on his board, then he will know if or not to install this hack ;)

Oblivion Knight 07-20-2004 11:03 PM

Thanks for the update Stefan.. :)
I had a couple of modifications applied to this hack that were mentioned earlier in this thread, and have re-applied them but just wanted to make sure that they have been done correctly.


As I understand it, TIMENOW - 3600 now has 2 instances - so if I wanted to increase the time limit to 3 days, I'd replace BOTH instances of 3600, correct?

Also, I don't want admin posts to be merged no matter what, so applying a similar mod to last time should be ok, right? I now have this line:
Code:

                if ($type != 'thread' AND $bbuserinfo['usergroupid'] != 6 AND $threadinfo['lastpost'] > TIMENOW - 172800 AND $threadinfo['lastposter'] == $post['postusername'])
All seems to work as I want it to, but I thought I'd better make sure..

Andreas 07-20-2004 11:20 PM

I think you should use $bbuserinfo['permissions']['adminpermissions'] & CANCONTROLPANEL instead of checking for the usergroup, as admins could be in any usergroup ;)

I've also modified this so the time after which a post is considered a double post and if the post's timestamp should be modified are now settings in Message Posting & Editiong Options, so they can be changed easily :)

Boofo 07-20-2004 11:22 PM

Quote:

Originally Posted by KirbyDE
I think you should use $bbuserinfo['permissions']['adminpermissions'] & CANCONTROLPANEL instead of checking for the usergroup, as admins could be in any usergroup ;)

How would you use that for Admins, SuperMods and Mods?

Quote:

I've also modified this so the time after which a post is considered a double post and if the post's timestamp should be modified to be a setting (in Message Posting & Editiong Options), so it can be changed easily :)
Can you share that with us, sir? ;)

Andreas 07-20-2004 11:31 PM

Quote:

How would you use that for Admins, SuperMods and Mods?
For Supermods it is
PHP Code:

$bbuserinfo['permissions']['adminpermissions'] & ISMODERATOR

For Mods it's a bit more difficult. You could use can_moderate() - which might cause an extra query then (without my Show ModCP link being installed).

Quote:

Can you share that with us, sir?
It's pretty easy:
Create two new settings (I called them dblpostthreshold and bumpdblpost) where you want them. The first one being an input (for the seconds, could also be minutes or hours - then you would have to add the appropriate multiplier to the code) and the second being a yesno option.

Then replace
PHP Code:

TIMENOW 3600 

with
PHP Code:

TIMENOW $vboptions['dblpostthreshold'

And
PHP Code:

$do_bump 

with
PHP Code:

$vboptions['bumpdblpost'

And delete
PHP Code:

// change this to false if you don't want doubleposts changing post's dateline
$do_bump true

As it is not needed any longer.

Xenon 07-21-2004 02:26 PM

*gg*

I'm always to lazy to create settings ;)

@OKnight: correct, both instances have to be changed.

the other code is correct (at least if you just consider the main usergroup of admins ;))

Oblivion Knight 07-21-2004 07:02 PM

Thanks for the confirmation Stefan.. :)


Quote:

Originally Posted by KirbyDE
For Supermods it is
PHP Code:

$bbuserinfo['permissions']['adminpermissions'] & ISMODERATOR

For Mods it's a bit more difficult. You could use can_moderate() - which might cause an extra query then (without my Show ModCP link being installed).

So if we have your ModCP Link hack installed, I'd change this:
Code:

$bbuserinfo['usergroupid'] != 6
To this:
Code:

can_moderate()
Which would exempt Mods, Supermods and Admins.. Correct? :nervous:

Andreas 07-21-2004 07:07 PM

Yup. Of yourse you can also just check the usergroup id - as long as you don't have admins, supermods oder mods in other usergroups then the standard groups ;)

Oblivion Knight 07-21-2004 07:48 PM

Using can_moderate() doesn't work..

My double posts are getting merged.

Andreas 07-21-2004 07:55 PM

Hmm ... mine don't :)
Could you post the exact if () you are using?

Oblivion Knight 07-21-2004 08:01 PM

Here you go.. :)

Code:

                if ($type != 'thread' AND can_moderate() AND $threadinfo['lastpost'] > TIMENOW - $vboptions['dblpostthreshold'] AND $threadinfo['lastposter'] == $post['postusername'])

Andreas 07-21-2004 08:13 PM

Well, that's wrong :)

You want the doublepost filter for all those who can not moderate, therefore it must be
PHP Code:

!can_moderate() 


Oblivion Knight 07-21-2004 08:44 PM

Whoops.! :o

Hehe, thanks again Kirby.

Dead End Society 07-26-2004 08:55 AM

Installed.

A life saver.

Datenpapst 07-26-2004 01:26 PM

install clicking all the time :D

Hiro 08-08-2004 08:22 PM

Wheres the install button

Xenon 08-08-2004 08:26 PM

at the top right of each showthread page :)

Hiro 08-08-2004 08:35 PM

It doesnt have one on my skin?

Hiro 08-08-2004 08:38 PM

anyone?

Blam Forumz 08-08-2004 08:53 PM

Then use a different skin :P

Skaterscafe.com 08-09-2004 03:26 AM

AWSOME!!! Works like a charm, thanks!!!

Xenon 08-09-2004 12:44 PM

Quote:

Originally Posted by vBRat
It doesnt have one on my skin?

as far as i can see every style has the button..

qxh 08-13-2004 05:24 PM

tHANKS ALOT!

Woops ^^.

deathemperor 08-15-2004 06:38 AM

*installed*

very 9 hac

Xcist 08-25-2004 02:39 AM

Quote:

Originally Posted by Baptizer
Is there a way to add an 'edit' comment to the thread that got merged because of a double post? Currently, when a user double posts it does not say ' Last edited by xxx : 21. Jan 2004 at 16:47. Reason: '

Great hack! I've installed myself, and works wonders. :) My mods are staring in awe. ~_^

Now, I'm wondering if it's possible to do what Baptizer suggested? I would really like a little line stating when the edit was made. Thanks again. *clicks install*

Xenon 08-26-2004 06:41 AM

Hmm, shouldn't be that hard to add, i'll put it on my list :)

bluesteel 08-26-2004 08:46 AM

Cheers Xenon.
Perfect to stop my users double-posting to earn cash for the Arcade!
*clicks install*

Mosh 08-29-2004 05:24 AM

Xenon,

Thanks for this.

I am trying to tweak it so that it always merges the post, no matter what the time limit is.

So what would I need to change to prevent double posting, full stop?

Will definately click install when I can do this.

Cheers for the help in advance,

JD. :)

Xenon 08-29-2004 10:12 AM

very easy, just remove that line:

Code:

AND dateline > " . (TIMENOW - 3600) . "
and that part:
PHP Code:

AND $threadinfo['lastpost'] > TIMENOW 3600 



All times are GMT. The time now is 08:57 AM.

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.01493 seconds
  • Memory Usage 1,828KB
  • 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_code_printable
  • (9)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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