vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Prevent Doubleposting (https://vborg.vbsupport.ru/showthread.php?t=40145)

Boofo 07-14-2002 08:52 AM

Xenon,

Thank you very much, sir. That works great! Now (this is the last thing, I swear. :) ), Is there a way to have the date and time of the first post stay the same so we know when the post started and have the date and time of each additional post in the DOUBLE POSTING Feature right after the subject title? That way we know when the first message was (by the original date and time staying in tact) and the new date and time for each addition after the subject line.

Xenon 07-14-2002 09:13 AM

*ggg* in my first version of the hack the time stayed the same after posting, its just altered tu bump a thread.
if you want to stay the time just remove this part:
PHP Code:

dateline='".time()."'

from this line:
PHP Code:

$DB_site->query("UPDATE post SET dateline='".time()."',pagetext='".addslashes($lastpost[pagetext]."\n\n".$message)."' WHERE postid=".$lastpost[postid]); 

and then: yes you can add the time after the subject, but you have a small problem: the timeoffset can't be variable anymore in this timestamp ;)

just add something like that:
PHP Code:

[disable]$DB_site->query("UPDATE post SET dateline='".time()."',pagetext='".addslashes($lastpost[pagetext]."\n\n[b][color=red]DOUBLE POSTING FEATURE[/color][/b] - ".$title." posted at:".vbdate($dateformat,time())."\n\n".$message)."' WHERE postid=".$lastpost[postid]);[/disable


Boofo 07-14-2002 10:35 AM

I see what you mean about the time no longer working right when I add it to the middle of that line. I went back to the time changing in the main post and left it with just the title added. It doesn't do me any good if I can't pull the time out for each addition. Thanks, anyway, for trying. And thanks for putting up with all of my wacky ideas. :) You have a great hack here! Keep up the fantastic work! :)

Parker Clack 07-14-2002 09:27 PM

Xenon:

I made the following changes so that if the post is the same as the one that they just got through posting within the past hour then nothing new gets added to the thread or the post.
PHP Code:

 $lastpost $DB_site->query_first("SELECT * FROM post WHERE threadid = '$threadid' ORDER BY postid DESC");
      if(
$lastpost[userid]!=$bbuserinfo[userid] || (time()-$lastpost[dateline])>3600 || ($attachmentid and !$foruminfo[moderateattach]) || $lastpost[pagetext]!='".addslashes($message)."') {
            
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','$visible')");
      } else {
              if (
$visible) {

            
$goto="showthread.php?s=$session[sessionhash]&postid=".$lastpost[postid]."#post".$lastpost[postid];
              } else {
       
            
$goto="forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]";
              }
              eval(
"standardredirect(\"".gettemplate("redirect_postthanks")."\",\"$goto\");");
              exit;     
      } 

I also took out the edited by section because I didn't want the new post to show up at all.

--Parker

Xenon 07-15-2002 03:19 PM

you should put [php]-tag around your php-code ;)

but it's a good idea, i'll upload a new version, which doesn't update the old post if the message is the same as pagetext of the old one ;)

Parker Clack 07-15-2002 05:02 PM

Xenon:

Yeah I know. I forgot the phpcode. Sorry about that.

Thanks for including this with your great hack.

Parker

Darth Cow 07-25-2002 08:17 PM

One little issue... can you modify it so that it adds on a new post if that would make it go over the characters per post limit, instead of just editing the old one?

Xenon 07-25-2002 08:25 PM

ups, a feature i didn't use, so i've forgotten to add something for this ;)

find this line:
PHP Code:

if($lastpost[userid]!=$bbuserinfo[userid] || (time()-$lastpost[dateline])>3600 || ($attachmentid and !$foruminfo[moderateattach])) { 

and replace it with:
PHP Code:

if(((strlen($message)+strlen($lastpost[pagetext])>$postmaxchars and $postmaxchars!=0) || $lastpost[userid]!=$bbuserinfo[userid] || (time()-$lastpost[dateline])>3600 || ($attachmentid and !$foruminfo[moderateattach])) { 


Boofo 07-26-2002 11:10 PM

When I change the code you gave above, I get this error: :)

Quote:

Parse error: parse error, unexpected '{' in /home/boofo/public_html/forum/newreply.php on line 399

Xenon 07-26-2002 11:15 PM

damn ")" and "}"s ;)

ad a ) just before }
should work then ;)


All times are GMT. The time now is 06:32 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.01201 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
  • (6)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
  • (1)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