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)

Xenon 12-23-2004 09:31 AM

just if $do_bump is set to true

cinq 12-23-2004 02:30 PM

Let's say a user makes a post and maxs out the number of attachments.
WHat happens when within the very short interval ( which considers the next post a double post ) , he posts again with an attachment.

Can this handle that ?

alqadir 12-25-2004 12:57 PM

hello all,
I have tried to install this hack but I get the following error:
Database error in vBulletin 3.0.3:
Code:

Invalid SQL:
                                                SELECT postid, pagetext, post.title, post.userid
                                                FROM post AS post
                                                LEFT JOIN deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
                                                WHERE threadid =
                                                        AND dateline > 1103982928
                                                        AND visible = 1 AND deletionlog.primaryid IS NULL
                                                ORDER BY dateline DESC
                                                LIMIT 1
                       
mysql error: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND dateline > 1103982928
                                                        AND visible = 1 AND deletionl

mysql error number: 1064

Can someone out their please help me out! thanks

Xenon 12-27-2004 02:52 PM

@cinq: actually the attachmentpart is the only little bug which is still there

you can add more attachments then allowed with the doublepost, as the avoidance would have produced too much queries....

@alquadir: the $threadinfo varialbe seems to be empty, you have either placed the code at the wrong place, or you have another hack, which is buggy
nothing i can solve.

cinq 12-28-2004 12:57 AM

Quote:

Originally Posted by Xenon
@cinq: actually the attachmentpart is the only little bug which is still there

you can add more attachments then allowed with the doublepost, as the avoidance would have produced too much queries....

So in this hack, it doesnt cater for that, and the post with new attachments will just be a new post, correct ?

If so, that's fine with me :)

Xenon 12-28-2004 08:42 PM

nope, it will just merge them, no matter if you get over the limit or not ;)

cinq 12-29-2004 12:11 AM

oic, so the first post will have more attachments than the max limit per post.

I'm fine with it too, but do let us know if you manage a workaround for it :)
thanks ! :D

Xenon 12-29-2004 04:54 PM

of course ;)

i'll work onit on my free days soon ;)

Xenon 01-03-2005 12:20 PM

Version 1.5 released

actually it's just a minor release, so i won't send an update mail

What has changed?
Bugfix: Doubleposts won't create posts with more than attachlimit attachments
Setting: I have created a settingarray at the top of the hack, allowing to easyly changint the timespan of when a post will be counted as doublepost.

No further changes are planned right now.

cinq 01-04-2005 11:45 PM

Just to confirm Stefan, only when a user posts within the time allocated in a particular thread that the posts are merged.

A scenario :
If he starts a new thread A, or makes a post B1 somewhere in another thread B, both the thread A or new post B1 should not get merged into the post C1 in thread C which he made 5 mins ago before making post B1 or new thread A, correct ?

( sorry if it sounds confusing, but it seems some of my members are complaining about this .... odd )

Xenon 01-05-2005 12:02 AM

sounds very confusing ^^

to make it short it just works in one thread, so he can start 4 new thread and nothing will be merged, just if someone makes a post in a thread where he already has the last post and it's not that long ago, then it will be merged ;)

cinq 01-05-2005 12:47 AM

Ah yes, that's what I thought too....I think my members are rather confused though. Will explain it to them :)

Thanks :D

Sel 01-05-2005 07:30 AM

Hi

Some of the users on the forum I moderate have pointed out a way to get around the hack.

If a user posts more than the max number of allowed smilies, a new post is added and the double post hack does not work.

For example the smilie limit on the forum is 3...

A user makes a post with 2 smilies, then the same user posts straight after with another 2 smilies, this breaks the smilie limit and causes a new post to be added rather than the 2 posts being merged.

Don't think this has been pointed out already so I thought I’d mention it. :nervous:

Thanks

Xenon 01-05-2005 01:30 PM

@Sel: well, yep thats know, but it's how the hack is designed.

i did it without the check before, and that lead to non editable posts after the merge, so this smilie check has to be in

i'd increase the ammount of smilies allowed ;)

Sel 01-05-2005 03:19 PM

Nice one, thanks for the quick reply. Think I will increase the smilie limit then, three is a bit harsh!!

Great hack by the way!

Xenon 01-05-2005 04:08 PM

thanks :)

sbp 01-08-2005 06:10 AM

Thank you Xenon http://sbp777.homestead.com/files/kawaii.gif

Paul M 01-08-2005 11:32 AM

If you have previously installed Proxy ip to real ip conversion or Proxy Detector v3.1 then these install instructions will not work (or if you manage to find the block of code to replace, and then replace it as specified, your proxy hack will cease to function correctly).

This is because both proxy ip hacks add an extra field to all new posts. To fix this, edit the install instructions as follows.

find ;

PHP Code:

showsignatureipaddressiconidvisibleattach

and replace with;

PHP Code:

showsignatureipaddressproxyipiconidvisibleattach

also find ;

PHP Code:

'" . addslashes($post['ipaddress']) . "'$post[iconid], $post[visible], $totalattachments

and replace with ;

PHP Code:

'" . addslashes($post['ipaddress']) . "','" . addslashes($post['proxyip']) . "'$post[iconid], $post[visible], $totalattachments

You can then apply this hack. :)

Xenon 01-08-2005 11:43 AM

Thx for mentioning Paul, i included a link to your post in the first post :)

Baptizer 01-09-2005 01:40 AM

When someone double posts, is there a way to put a message above the merged post stating when the user double posted?

DrkFusion 01-09-2005 02:11 AM

Awesome work on that Xenon, I had something like this going, but this is much better, much more optimized, and well it works and it works good!

Regards,

Xenon 01-09-2005 02:00 PM

glad to hear Arunan :)

@Baptizer: i think i answered it already within the thread, but short again: you can change the \n\n in
PHP Code:

$post['message'] = $doublepost['pagetext'] . "\n\n" $post['message']; 

to add custom text between the posts as well.

Baptizer 01-09-2005 10:03 PM

Quote:

Originally Posted by Xenon
glad to hear Arunan :)

@Baptizer: i think i answered it already within the thread, but short again: you can change the \n\n in
PHP Code:

$post['message'] = $doublepost['pagetext'] . "\n\n" $post['message']; 

to add custom text between the posts as well.


THanks a bunch! Any way to get the time of the double post to display using the post viewers timezone? I am guessing not, correct?

Xenon 01-10-2005 01:08 PM

nope, that's not possible, at least not without adding extram fields to the post table (or creating something like a doublepost log)

eblivion 01-23-2005 02:50 PM

I installed the mod and didn't notice any code excluding administrators and moderators from the restriction. How can I prevent it from blocking admins & moderators?

Mechanical Mind 01-23-2005 03:45 PM

In this thread here: https://vborg.vbsupport.ru/showthrea...0603post600603
I posted twice in a row, and because it has the hack to show the first thread at the beginning of every page, it didn't merge my posts. It let me post at the end of one page and at the beginning of another???

Just an observation. I don't even have this hack installed.

UPDATE...

Xenon clarifies this below. It is not a bug.

Xenon 01-23-2005 03:59 PM

i have excluded the release forums from the automerge

Gary King 01-25-2005 10:43 PM

How can I put a separator to separate a first post and a second post when they both show up in the same post?

Xenon 01-26-2005 03:43 PM

as i said, you can put everything between the \n\n

this is already a seperator, put in some dashes or whatever ;)

Gary King 01-26-2005 04:14 PM

Quote:

Originally Posted by Xenon
as i said, you can put everything between the \n\n

this is already a seperator, put in some dashes or whatever ;)

I can't seem to put HTML in there. It just outputs <hr /> as &lt;hr /&gt;

Xenon 01-26-2005 04:24 PM

of course you can't

the seperator will become part of the post, and if you don't allow html in posts, you cannot use it ;)

TCattitude 02-06-2005 03:04 AM

Quote:

Originally Posted by eblivion
I installed the mod and didn't notice any code excluding administrators and moderators from the restriction. How can I prevent it from blocking admins & moderators?

After upgrade to 3.0.5/3.0.6 i have the same thing here.
Before, admins (i don't know if mods or supermods too) were not affected by the anti-doublepost.

And now... works for admins too.
Anything wrong?
Obviously, i applied the hack again after upgrade.

How exclude admins?

FASherman 02-06-2005 05:33 PM

Has anyone every included the mod to this hack to update the editlog table? These forums are using it so I know it must exist.

FASherman 02-06-2005 06:27 PM

okay, okay...i figured it out myself.

FIND
PHP Code:

//Update forum if postdate has changed.
if ($dp_settings['dobump'])
{
    
$DB_site->query("
     UPDATE " 
TABLE_PREFIX "forum
     SET lastpost = " 
TIMENOW ",
     lastposter = '" 
addslashes($post['postusername']) . "',
     lastthread = '" 
addslashes($threadinfo['title']) . "',
     lastthreadid = 
$threadinfo[threadid],
     lasticonid = " 
iif($threadinfo['pollid'], -1$threadinfo['iconid']) . "
     WHERE forumid = 
$foruminfo[forumid]
    "
);


AFTER THAT, ADD:
PHP Code:

//Now lets update the editlog
$reason "Automerged Doublepost";
$lastedit $DB_site->query_first("
     SELECT postid, userid, username, dateline, reason 
     FROM " 
TABLE_PREFIX "editlog 
     WHERE postid = 
$post[postid]
"
);
if (
$lastedit['postid']) {
    
$DB_site->query("
     UPDATE " 
TABLE_PREFIX "editlog
     SET postid = 
$lastedit[postid],
     userid = 
$bbuserinfo[userid],
     username = '" 
addslashes($post['postusername']) . "',
     dateline = " 
TIMENOW ",
     reason = '" 
addslashes($reason) . "'
     WHERE postid = 
$post[postid]
    "
);
} else {
    
$DB_site->query("
     INSERT INTO " 
TABLE_PREFIX "editlog
     (postid, userid, username, dateline, reason)
     VALUES (
$post[postid]$bbuserinfo[userid]
     '" 
addslashes($post['postusername']) . "',
     " 
TIMENOW ",'" addslashes($reason) . "')
    "
);



Xenon 02-06-2005 07:24 PM

@FASherman: well, here on vb.org there are often some more features in my hacks than in the released version, as i don't release every single change immediatelly ;)

but i have uploaded the newest version now, which adds the editlog text ;)

Imperial Fritz 02-14-2005 01:37 AM

Thanks, this hack was much needed. :)

That Rob Guy 02-14-2005 07:02 PM

I love this hack...

/me clicks install. One of the easiest and worthy hacks to have.

JMH11788 02-14-2005 08:18 PM

i am going to install this mod but i want the option in the admincp to disable it. i know ill have to put it in <if condition> tags and then an <else> at the end but im not sure exactly how.

so i would need an if and else for the top two codes, and this one ^^ needs just and if..correct? so what would the codes be and what would the code i need to add for an ON and OFF radio button in the admin cp be?

thanks!

Xenon 02-14-2005 08:56 PM

it's not needed to post the hack instructions, everyone know them from the file ;)

and actually it's not hard to do.

first of all you have to enable debug mode of your vb.
then got to acp options and you see you can add new settings to the settinggroups
add one to the message posting options yesno as option code
for example:

varname: preventdoubleposts
title Preventing Doubleposting
optioncode yesno
default 1
vbulletin default no

then just change that line:
PHP Code:

if ($type != 'thread' AND $threadinfo['lastpost'] > TIMENOW $dp_settings['timespan'] AND $threadinfo['lastposter'] == $post['postusername']) 

into
PHP Code:

if ($vboptions['preventdoubleposts'] AND $type != 'thread' AND $threadinfo['lastpost'] > TIMENOW $dp_settings['timespan'] AND $threadinfo['lastposter'] == $post['postusername']) 

that's all you need

JMH11788 02-14-2005 10:54 PM

^^^
ahh ic...why do i have to put it in debug mode? and where is the option to put it in debug mode?

thanks


All times are GMT. The time now is 12:49 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.01393 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
  • (1)bbcode_code_printable
  • (10)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
  • (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