Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

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
  #52  
Old 07-12-2002, 12:08 PM
Mystislav's Avatar
Mystislav Mystislav is offline
 
Join Date: Jun 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

o.O...err ok I'll try.

--------


Heh, still did'nt work, well this is how it looks in the php file, can you see if its messed up there

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])){
 
$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($mess

age
)."','$allowsmilie','$signature','$ipaddress','$iconid','$visible')");
      } else {
            
$editedbysql="";
            if (
$showeditedby and $lastpost[dateline]<(time()-($noeditedbytime*60))) {
               
$editedbysql=",edituserid='$bbuserinfo[userid]',editdate='".time()."'";
            }            
            
unindexpost($lastpost[postid],$lastpost[title],$lastpost[pagetext]);
            
$DB_site->query("UPDATE post SET dateline='".time()."',pagetext='".addslashes($lastpost[pagetext]."\n\n".$message)."' WHERE 

postid="
.$lastpost[postid]);
            
indexpost($lastpost[postid],0);
            
$DB_site->query("UPDATE thread SET lastpost='".time()."' WHERE threadid='$threadid'");
            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;     
      } 
Reply With Quote
  #53  
Old 07-12-2002, 09:31 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, can't see whats wrong...

can you please highlight which of this line is the error producing line (as your errormsg says)

also please tell me the exact errormsg
Reply With Quote
  #54  
Old 07-13-2002, 03:42 AM
Mystislav's Avatar
Mystislav Mystislav is offline
 
Join Date: Jun 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, here is the message

Fatal error: Call to undefined function: unindexpost() in /home/sjmadho/public_html/board/newreply.php on line 288

and the exact newreply is in the attactments .. thanks alot.
Reply With Quote
  #55  
Old 07-13-2002, 09:32 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

mystislav: edit your post, you are not allowed to post full vb-files here!!!

second: than the problem isn't my hack. you have to have made some mistakes some time ago, the function unindexpost() is defined in functions.php on every vb. If you don't have it, you have messed up your functions.php
Reply With Quote
  #56  
Old 07-13-2002, 09:59 AM
Mystislav's Avatar
Mystislav Mystislav is offline
 
Join Date: Jun 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Aight, so if I upload a new functions it should work?
Reply With Quote
  #57  
Old 07-13-2002, 10:20 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,

Is there any way to add color to the DOUBLE POST FEATURE part of this line?

PHP Code:
$DB_site->query("UPDATE post SET dateline='".time()."',pagetext='".addslashes($lastpost[pagetext]."\n\nDOUBLE POSTING FEATURE\n\n".$message)."' WHERE postid=".$lastpost[postid]);
            
indexpost($lastpost[postid],0); 
Reply With Quote
  #58  
Old 07-13-2002, 04:18 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@Mystislav: yes, then it should work.

@Boofo: You can use every vb-code in the textpassage between post1 and post2, so if you have enabled the color-bbcode on your board you should be able to do that:
PHP Code:
$DB_site->query("UPDATE post SET dateline='".time()."',pagetext='".addslashes($lastpost[pagetext]."\n\n[b][color=red]DOUBLE POSTING FEATURE[/color][/b]\n\n".$message)."' WHERE postid=".$lastpost[postid]); 
for example
Reply With Quote
  #59  
Old 07-13-2002, 07:15 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had to replay to this message in order to see how you had the code (it was parsed here. The disable tags hack is great for this sort of thing!)

I was using [disable]<font color=\"yellow\"> and </font>[/disable]. That's where I messed up. Thanks for the fix.

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

Quote:
Originally posted by Xenon
PHP Code:
$DB_site->query("UPDATE post SET dateline='".time()."',pagetext='".addslashes($lastpost[pagetext]."\n\n[b][color=red]DOUBLE POSTING FEATURE[/color]<b>
@Boofo: You can use every vb-code in the textpassage between post1 and post2, so if you have enabled the color-bbcode on your board you should be able to do that:
</b>\n\n"
.$message)."' WHERE postid=".$lastpost[postid]); 
for example [/B]
Reply With Quote
  #60  
Old 07-13-2002, 07:27 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I forgot to add in my last message (you see...they really need this here for this kind of thing. ).

Is there a way to have it say like:

DOUBLE POSTING FEATURE - (post subject here)

in case they enter a post subject in the added message?

And have it show:

DOUBLE POSTING FEATURE

by itself it they don't?
Reply With Quote
  #61  
Old 07-14-2002, 07:55 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ups, damn i forgot code is parsed in [php]-tags too

yes, Having the Subejct is also possible:

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."\n\n".$message)."' WHERE postid=".$lastpost[postid]);[/disable
Reply With Quote
Reply

Thread Tools

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 06:42 AM.


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.04917 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
  • (5)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