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 02-28-2003 10:52 AM

oh right, it's in the install file *gg*
(sometimes i forgot what i've already included in the hacks ^^)

PHP Code:

              if ($showeditedby and $lastpost[dateline]<(time()-($noeditedbytime*60))) {
                 
$editedbysql=",edituserid='$bbuserinfo[userid]',editdate='".time()."'";
              } 

it's in there, so it should show the edited by after 2 minutes with the original code...
be sure you have enabled the showedited by thing..

Xenon 03-05-2003 10:57 AM

oh, sorry, you were right :)

there was a little bug in it.

i've uploaded a new version, it should work now, also i've optimized the querie a bit, so i think it's good for everyone to install the new version :)

Boofo 03-05-2003 12:14 PM

How do we get the subject (title) back in the line now? ;) I have this but it doesn't seem to work.

PHP Code:

 $DB_site->query("UPDATE post SET dateline='" time() . "'" $editedbysql ",pagetext='" addslashes($lastpost[pagetext] . "\n\n[b][color=yellow]DOUBLE POSTING FEATURE[/color] - [color=black][size=1]".$title."[/size][/color][/b][color=black][size=1][/size][/color]\n\n".$message)."' WHERE postid=" $lastpost['postid']); 


Xenon 03-05-2003 12:58 PM

yeah, it's right it would work normally..

that part hasn't changed in my update, just a part before ;)

Boofo 03-05-2003 01:01 PM

I tried it with title and $lastpost[title] and all I get is a black line where the title should be. I'm looking at the old code I had from 6 months ago for this and seeing if I can figure it out. ;)

007 03-05-2003 01:04 PM

Oh cool. Thanks Xenon.

I have a question though, I tried making the edited by part the same as it is in editpost.php, which would look like:
PHP Code:

     else {
            
$editedbysql="";
  
if (
$showeditedby and $postinfo[dateline]<(time()-($noeditedbytime*60)) and !($getperms[ismoderator] and !$showeditedbyadmin)) {
    
$editedbysql=",edituserid='$bbuserinfo[userid]',editdate='".time()."'";
  } 

Except that for some reason it still shows the "Edited by" if I have admins set to not show edited by. I tried it with:
PHP Code:

else {
            
$editedbysql="";
            if (
$bbuserinfo['usergroupid'] == 6) {
               
$editedbysql="";
                     }
            if (
$showeditedby and $lastpost['dateline'] < (time() - ($noeditedbytime 60))) {
               
$editedbysql ",edituserid='$bbuserinfo[userid]',editdate='" time() . "'";
            } 

and that did work (I think, I tested it really quickly), but I want it to work with the setting in vb options in Admin CP. How would I do this?

Thanks. :)

Xenon 03-05-2003 01:11 PM

use that 006:

PHP Code:

else {
            
$editedbysql="";
            if (
$showeditedby and $lastpost['dateline'] < (time() - ($noeditedbytime 60))and !($getperms[ismoderator] and !$showeditedbyadmin))  {
               
$editedbysql ",edituserid='$bbuserinfo[userid]',editdate='" time() . "'";
            } 


007 03-05-2003 01:17 PM

I tried that and it shows the "edited by" no matter what I have selected in Admin CP. It's weird. :(

I have no clue why. :ermm:

Any ideas?

Xenon 03-05-2003 01:19 PM

sorry, no idea, it should work...

have you tried it on a post where the edited by wasn't there already, because it won't delete it if it's already ther..

007 03-05-2003 01:20 PM

yeah I made two new posts and then waited two minutes, then replied to one with "Show Admin Edit" turned on, and one with it turned off, and it showed "edited" both times.

Xenon 03-05-2003 01:22 PM

hmm, no idea then, it should work normally...

007 03-05-2003 01:25 PM

lol

Well if you don't know then it must be REALLY weird... I thought that would work too... Oh well, I can just tell admins if they don't want it to show "edited by" to just actually edit the post instead of replying. That's alright I guess. ;)

Thanks anyway. :)

Kars10 03-05-2003 01:40 PM

Man this hack rules!!
Exactly what i?ve been looking for!!

Thanks Stefan!!

[high]* Kars10 klicks install! ;)[/high]

Lineman28645 03-10-2003 02:16 PM

I love this hack. It pisses most the members off because they cant get more posts.

TranceMaster 03-17-2003 09:26 AM

works perfect man
thanks for another amazing hack
1 quick eustion
am i right in saying that if u want to change the amount of time given before a new post is made i just edit this line
if ($showeditedby and $lastpost['dateline'] < (time() - ($noeditedbytime * 60))) {
and change the 60 into whatever i want?

sabret00the 03-17-2003 11:28 AM

this is a great hack, should be a default in vB will have to install it later

Xenon 03-17-2003 12:11 PM

Quote:

Today at 12:26 TranceMaster said this in Post #135
works perfect man
thanks for another amazing hack
1 quick eustion
am i right in saying that if u want to change the amount of time given before a new post is made i just edit this line
if ($showeditedby and $lastpost['dateline'] < (time() - ($noeditedbytime * 60))) {
and change the 60 into whatever i want?


nope, you have to change the 3600 in this line:
PHP Code:

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


TranceMaster 03-17-2003 03:41 PM

oooops
ok thanks for the help man :)

that 3600, is that seconds?
lets say i wanted to make it for 24 hours, would i just find out how many seconds are in 24 hours, and put it in?

Xenon 03-17-2003 04:10 PM

exactly ;)

or to make it easier to read just write 3600 * 24 ;)

yxboom 03-24-2003 03:19 PM

I think I may have found a bug. I have the post limit at 18000 characters. I have posts being ammended going beyond that. One guy kept reposting and reposting and it kept being ammended to the previous post so his single post has 42000 characters now.

Xenon 03-24-2003 03:27 PM

hmm, yeah i know that "bug".
but i wasn't sure if it would disturb or not... at least sometimes that could have been the reason for the "doublepost"

for a quickfix use this:

before:
PHP Code:

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

add this:
PHP Code:

$newmessage $lastpost[pagetext] . "\n\n" $message;
  if (
strlen($newmessage)>$postmaxchars and $postmaxchars!=0) {
    eval(
"standarderror(\"".gettemplate("error_toolong")."\");");
  } 


yxboom 03-24-2003 03:52 PM

Thanks a lot for the hack and help. On my board the post limit has its reasons cause of too many people making too many points that by the time someone responds they have to deal with 30 points instead of a simple 2-3 point rebuttal so this helps significantly.

jancarlo 03-24-2003 09:37 PM

ok anche in vb 230 :)

bello script!!! :D

jancarlo



ok also in vb 230:)

beautiful script!!! :D

jancarlo

sabret00the 03-25-2003 09:45 AM

installed and works great, should really be default to vB, very awesome hack Xenon

and you're an admin now, add the mini section ;)

Opie 04-09-2003 03:32 AM

Can someone let me know how to exclude some forums from the hack? I only want it on a few.

Also a way to stop if from counting points(store hack) if it was a double post?

Xenon 04-09-2003 11:23 AM

for the storehack i can't help ya, because i don't use it.

i think all you have to do ist to put the add to storpoint part of newreply under the user post count update part.

to exclude forums:
change this:
PHP Code:

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

into this:
PHP Code:

if(in_array($threadinfo['forumid'], array(x,y,z)) or $lastpost['userid'] != $bbuserinfo['userid'] OR (time() - $lastpost['dateline']) > 3600 OR ($attachmentid and !$foruminfo['moderateattach'])) { 

and change x,y,z into the forumids you want to exclude

Boofo 04-09-2003 05:49 PM

Is the guy who wrote this (in the message above)

$threadinfor['forumid']

the same guy who got me on the nothing and anything words the other day? ;) :p

Is this a new variable in vb3? ;)

Xenon 04-09-2003 09:12 PM

:p

mine is just a typing, yours was sensechanging :p ;)

but yeah i try to convince the devs to add this as a new vb3 var ;)

Boofo 04-09-2003 09:48 PM

Quote:

Today at 05:06 PM Xenon said this in Post #148
:p

mine is just a typing, yours was sensechanging :p ;)



Yes, but I'm allowed to butcher the English language because it is my native language. ;)

Quote:

but yeah i try to convince the devs to add this as a new vb3 var ;)
Great! Then you don't ever have to worry if it is misspelled again huh? ;)

solent 04-25-2003 07:47 AM

small easy and cool hacks by Xenon. this is vey cool as most of the users dunno what the edit button does and most of the times the reply 3-4 times with a newreply instead of editing.

Hobbes 04-26-2003 06:15 AM

i have one question....heh....i hope this thread is like....still loooked at!!!!

anyway....

the attachment is the Double Post Prevention Hack before I installed

Anime-loo 's Post Redirect Hack.

I was wondering what i would change in the code so that it will show

"Double Posting are we?"

between each post, instead of right after the text like it's doin now....if needed, i'll attach another screenshot of how it looks now....

I hooooppppe someone can answer this *dances*

Hobbes 04-26-2003 06:20 AM

:bunny: well...i'm bored....so i'll show ya how it looks now...


the attachment actually shows

(1) how it was [in the quote]

(2) how it is now [after i installed Anime loo's Post Redirect hack.

heeelp??

:bunny:

Xenon 04-26-2003 03:47 PM

hmm, i can't really see the sense for this, but all you have to change is this:

PHP Code:

addslashes($lastpost[pagetext] . "\n\n" $message

the string \n\n produces two enters, but you can replace it with everything you want to be between the two posts.
if you left out the \n tags, it will lead to your problem.

if they're in, maybe you have to ask anime about his hack ;)

Hobbes 04-26-2003 05:26 PM

*dances*....

THANKS !!!!!!!! \n\n did the trick! w00t!

Opie 04-29-2003 06:19 PM

Quote:

[i]04-09-03 at 07:23 AM Xenon said this in Post #146

to exclude forums:
change this:
PHP Code:

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

into this:
PHP Code:

if(in_array($threadinfo['forumid'], array(x,y,z)) or $lastpost['userid'] != $bbuserinfo['userid'] OR (time() - $lastpost['dateline']) > 3600 OR ($attachmentid and !$foruminfo['moderateattach'])) { 

and change x,y,z into the forumids you want to exclude [/B]
When I do this I get this error:

Parse error: parse error, unexpected ',' in /home/opie/public_html/forums/newreply.php on line 296

I'm running 2.2.7 if that matters.

Xenon 04-29-2003 09:06 PM

if you have made everything right, there couldn't be such a parse error.

you should check your php syntax on mistakes you have made

Opie 04-30-2003 07:50 PM

Code:

if($threadinfo['forumid'], array(10,11,13)) or $lastpost['userid'] != $bbuserinfo['userid'] OR (time() - $lastpost['dateline']) > 3600 OR ($attachmentid and !$foruminfo['moderateattach'])) {

That's what I put and those are valid forum ids, but still the error... weird.

Xenon 04-30-2003 08:02 PM

whats wierd?

you clearly forgot half of the codechanges......
why haven't you put the word in_array in your code as i stated?

Opie 05-01-2003 02:11 AM

Sorry I don't know too much about php, so instead of array put "in_array" ?

I didn't see where you said put "in_array".

DigitalDesktops 05-01-2003 02:45 AM

use this code instead, it seems VB took out in_array :p lol:

[sql]
if(in_array($threadinfo['forumid'], array(x,y,z)) or $lastpost['userid'] != $bbuserinfo['userid'] OR (time() - $lastpost['dateline']) > 3600 OR ($attachmentid and !$foruminfo['moderateattach'])) {
[/sql]


All times are GMT. The time now is 08:07 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.01445 seconds
  • Memory Usage 1,862KB
  • 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
  • (1)bbcode_code_printable
  • (13)bbcode_php_printable
  • (4)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