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 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 06:04 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.02146 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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