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)

Xenon 06-25-2002 03:58 PM

well it is possible, that another hack has changed that line

you have to compare the changes my hack does to the original file and try to include it into your file.

as i said, make a backup of your newreply.php, include the hack, if it doesn't work, use the backup again

Smoothie 06-25-2002 05:03 PM

I have the same code as X-Fan, using 2.2.2

Xenon 06-25-2002 11:39 PM

hmm *wondering*

try just to replace all $title with $subject in my instructions, but make a backup of your file before implementing it. :)

Webmasta XT 06-26-2002 12:13 AM

THis is a very cool hack, stops ppl from spamming, lol

Xenon 06-26-2002 01:06 PM

Have uploaded a new version.
Changes:
The added text will be included in the searchindex now.
Also the Dateline of the post and the lastpost time of the thread are updated after someone make such a doublepost, so it is counted as a new post, if a user has logged out between the original post and the addition :)

deFunx 07-11-2002 09:31 AM

Cool man, I like the hack...

Mystislav 07-11-2002 09:57 AM

Hmm, when I installed it, when you post it has a white screen with a error on line 288... and im on vb 2.2.6

Xenon 07-11-2002 11:15 AM

you must have made an mistake when installing my hack
it works perfect in vb2.2.6

use a backup of your file, and follow the instructions carefully...

Mystislav 07-12-2002 10:26 AM

Dayum... No matter what I do it still says a error is on line 288 or 289...++++.

Xenon 07-12-2002 11:27 AM

post 5 lines above and below line 288, perhaps i can see your fault

Mystislav 07-12-2002 12:08 PM

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;     
      } 


Xenon 07-12-2002 09:31 PM

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 ;)

Mystislav 07-13-2002 03:42 AM

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.

Xenon 07-13-2002 09:32 AM

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

Mystislav 07-13-2002 09:59 AM

Aight, so if I upload a new functions it should work?

Boofo 07-13-2002 10:20 AM

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); 


Xenon 07-13-2002 04:18 PM

@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

Boofo 07-13-2002 07:15 PM

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]

Boofo 07-13-2002 07:27 PM

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?

Xenon 07-14-2002 07:55 AM

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


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 ;)

Boofo 07-26-2002 11:29 PM

Thank you, sir. Worked like a charm. :)

Thewnagchung 07-29-2002 08:58 PM

Warning: Unexpected character in input: '' (ASCII=16) state=1 in /home/videogam/public_html/forum/newreply.php on line 307

im getting this error, what should i do?

Sadie Frost 07-30-2002 01:56 AM

Thank you so much for this hack (from someone often called the Double-Posting Nazi) ;)

Xenon 07-31-2002 10:55 AM

Quote:

Originally posted by Thewnagchung
Warning: Unexpected character in input: '' (ASCII=16) state=1 in /home/videogam/public_html/forum/newreply.php on line 307


im getting this error, what should i do?

have you done all steps correct? this error never occures to someone else

LOD-squa 08-18-2002 12:14 AM

I like it.

*clicks install*

LOD-squa 08-18-2002 12:19 AM

but I have a problem It won't work on my quick reply.

Xenon 08-18-2002 12:22 AM

hmm, as i know it works with fireflys quickreply, if you use anotherone, you have to add some similar lines of code to the quickreply section...

LOD-squa 08-18-2002 12:22 AM

lol I noticed I didn't upload newreply.php lol.

sorry for the trouble.

Xenon 08-18-2002 12:26 AM

loool

np :)

LOD-squa 08-18-2002 12:28 AM

I need suggestion. I want to install another hack but I don't know what could you suggest me something?


All times are GMT. The time now is 12:13 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.01412 seconds
  • Memory Usage 1,878KB
  • 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
  • (11)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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