Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Prevent Doubleposting Details »»
Prevent Doubleposting
Version: 1.00, by Xenon Xenon is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 06-21-2002 Last Update: Never Installs: 92
 
No support by the author.

This is why i really want a Mini-Hack section here, please Chen

What this hack does:
When a User posts to a thread where he already has the lastpost, no new post will be added. The lastpost of him will be edited and the new text is put after his first message.
This would not be done, if he has an attachment in his new post or the old post is older than 1 hour (you can change this timespan yourself )

Known bugs: None

Hope someone can use it, i do

Believe this hack includes just 1!! codehack.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #62  
Old 07-14-2002, 08:52 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #63  
Old 07-14-2002, 09:13 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*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
Reply With Quote
  #64  
Old 07-14-2002, 10:35 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #65  
Old 07-14-2002, 09:27 PM
Parker Clack Parker Clack is offline
 
Join Date: Oct 2001
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #66  
Old 07-15-2002, 03:19 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #67  
Old 07-15-2002, 05:02 PM
Parker Clack Parker Clack is offline
 
Join Date: Oct 2001
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Xenon:

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

Thanks for including this with your great hack.

Parker
Reply With Quote
  #68  
Old 07-25-2002, 08:17 PM
Darth Cow's Avatar
Darth Cow Darth Cow is offline
 
Join Date: Nov 2001
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #69  
Old 07-25-2002, 08:25 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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])) { 
Reply With Quote
  #70  
Old 07-26-2002, 11:10 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #71  
Old 07-26-2002, 11:15 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

damn ")" and "}"s

ad a ) just before }
should work then
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:30 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07452 seconds
  • Memory Usage 2,336KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete