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 08-18-2002 01:12 PM

you should tell me what you want to install too, maybe i can give a hint to you

LOD-squa 08-18-2002 03:31 PM

Umm right now I'm trying to fix a lil problem with the itemshop has soon has I do so I'll tell you :p.

Boofo 08-19-2002 07:36 PM

Xenon, is there a way to make this be able to turn it off and off in the Admin CP for site testing purposes on various hacks? An option, I mean. :)

Xenon 08-20-2002 08:29 PM

as you know everything is possible ;)

go to admin/settings.php and create new setting variablename: stopdoublepost
function to create: yesno

and then just before
PHP Code:

$lastpost[userid]!=$bbuserinfo[userid] || 

in newreply.php add this:
PHP Code:

!$stopdoublepost || 


Boofo 08-20-2002 10:39 PM

Stefan, thanks for the help. This is the part that has been stumped, though. :)

Code:

go to admin/settings.php and create new setting variablename: stopdoublepost
function to create: yesno


Silenced Soul 08-21-2002 06:53 AM

nice hack man. very nice :nod:

Boofo 08-21-2002 08:58 AM

I found out why I couldn't figure out what you meant, Stefan. The file I needed to set the option in was "admin/setting.php". I was looking for "admin/settings.php". DOHHH!!!

I did what you instructed and it works like a charm. Thank you very much, sir. :)

Edit: I just noticed that on the first post if I check the "Send User to forums" checkbox (from Firefly's hack), it sends the user back to the forum display. If I check it on a double post (when Prevent Double Posting is enabled), it will not send the user back to the forum display. Instead it sends the user back to view the message. Is there a way to fix that so it will work with the Send User back to forum hack?

Xenon 08-21-2002 03:29 PM

@boofo: damn 's' ;)

yes it is possible, look at this:
PHP Code:

            if ($visible) {
            
$goto="showthread.php?s=$session[sessionhash]&postid=".$lastpost[postid]."#post".$lastpost[postid];
              } else {
            
$goto="forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]";
              } 

and change it to:
PHP Code:

            $goto="forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]"

should work

Boofo 08-21-2002 05:37 PM

I'm sorry, my friend, now all it will do is send me back to the forum display no matter if the "send user back to forum" box is checked or not.

Edit: Fixed! :):):) (But only because of you, sir. :))

What I did was:

Replace:

PHP Code:

            if ($visible) {
            
$goto="showthread.php?s=$session[sessionhash]&postid=".$lastpost[postid]."#post".$lastpost[postid];
              } else {
            
$goto="forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]";
              } 

with:
PHP Code:

            if ($visible && !$sendtoforum) {
            
$goto="showthread.php?s=$session[sessionhash]&postid=".$lastpost[postid]."#post".$lastpost[postid];
              } else {
            
$goto="forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]"

Now it works according to if the box is checked or not and takes you where it should. :)

Xenon 08-21-2002 08:29 PM

ahh, sorry i didn't know the hack, i just thought you want everybody back to forumdisplay ;)

Boofo 08-21-2002 09:10 PM

No, don't be sorry. I want to thank you. If you hadn't shown me that piece of code (which I should have found myself, dummy me :)) then it never would have clicked with me the right way to do it. So, thank you again, my friend. :)

Quote:

Originally posted by Xenon
ahh, sorry i didn't know the hack, i just thought you want everybody back to forumdisplay ;)

Colon33 08-26-2002 01:36 PM

Quote:

Originally posted by Mystislav
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.

I am getting this exact error problem, and i looked in my functions.php file but where am i looking for an error? I had to change this line

$noshutdownfunc = 0; // #CHANGE ME IF YOU CAN'T USE register_shutdown_function

to this:

$noshutdownfunc = 1; // #CHANGE ME IF YOU CAN'T USE register_shutdown_function

because my thread views stopped working. Got any ideas where my functions.php file is messed up? Otherwise i dont know how to fix it... any assistance would be very helpful.

Bloodfist 09-11-2002 06:17 PM

For some reason, on my board "/" appear before " ' " in the second post.

Bloodfist 09-11-2002 06:18 PM

like 'this (test)

Xenon 09-12-2002 09:29 AM

yes, seems there was a addslashes function where it shouldn't be
corrected

Boofo 09-12-2002 09:38 AM

Stefan, can you let us know where that was at so we can correct it on what we already have installed? :)

Quote:

Originally posted by Xenon
yes, seems there was a addslashes function where it shouldn't be
corrected


Xenon 09-12-2002 09:50 AM

no problem
it was addslashes($message) and it should just be $message in the update post line :)

kikosho 09-14-2002 02:41 AM

Xenon...I am sorry, I am definitely missing something, so can you please clarify for us dense board admins? :)

what php or template file needs to be edited so that I can remove the slashes from the double post actions? (and if possible, can you include which line it's on?) thanks.

Xenon 09-14-2002 11:06 AM

you have to edit newreply.php and change addslashes($message) into $message in the part of my hack..

Colon33 09-14-2002 01:22 PM

Does this fix that unindex error i am getting? I was told to upload a new functions.php.. did that, doesnt work, still unindex error

Xenon 09-14-2002 06:40 PM

nope the unindex error you posted seems to be another problem
my hack doesn't change this function.

as you can read in the message unindexpost function isn't declared for some reason.
have you upload an unhacked version of functions.php

if problem stays you should open a thread in support forum

yzztik 09-22-2002 05:43 PM

Quote:

Originally posted by Xenon
you have to edit newreply.php and change addslashes($message) into $message in the part of my hack..
when I search for this it appears 4 times in this order:

Code:

if ($prevpost=$DB_site->query_first("SELECT attachmentid,postid,visible FROM post WHERE threadid='$threadid' AND username='".addslashes($postusername)."' AND userid='$bbuserinfo[userid]' AND title='".addslashes(htmlspecialchars($title))."' AND dateline>$datecut AND pagetext='".addslashes($message)."'")) {
Code:

      $DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid',attachmentid='$attachmentid' WHERE postid='$postid'");
Code:

$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')");
Code:

$DB_site->query("UPDATE post SET pagetext='".addslashes($lastpost[pagetext]."\n\n".addslashes($message))."' WHERE postid=".$lastpost[postid]);
any idea which one I should change?

Xenon 09-22-2002 08:14 PM

the last one

yzztik 09-22-2002 08:22 PM

Thanks a lot! It worked great!

yzztik 10-09-2002 03:34 AM

How could I make certain usergroups like mods/super mods/admins excempt from this rule? Meaning so that members can't double post but they can. And could it be a toggle so they could choose to bypass it or not?

Xenon 10-09-2002 09:33 AM

the first thing is easy:
find
PHP Code:

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

and just add the usergroupconditions:
PHP Code:

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

a toggle would also be possible (with a bit more work), but i don't see the effect there?
i mean if they want to add it to the last post mods should be able to edit ;)

N9ne 10-18-2002 08:56 PM

I love this hack, excellent work Xenon :)

yzztik 12-03-2002 12:23 PM

Quote:

Originally posted by Xenon
as you know everything is possible ;)

go to admin/settings.php and create new setting variablename: stopdoublepost
function to create: yesno

and then just before
PHP Code:

$lastpost[userid]!=$bbuserinfo[userid] || 

in newreply.php add this:
PHP Code:

!$stopdoublepost || 


I think I am missing something here ... how exactly do I create this variable? I don't see it :$

Xenon 12-03-2002 03:45 PM

you have to go to admin/settings.php

there you can set up a new vb-option called stopdoublepost.
just add yesno to the field function to create...

after that you'll have a new option in your vb-options within acp

yzztik 12-03-2002 04:21 PM

Ok, I am sorry to sound dumb, but how exactly do I do that? There are several sections in the file. Where and how do I add it? Does it go under "start add" or someplace else? And is it like the makeinputcode thing?

Xenon 12-03-2002 04:25 PM

admin/setting.php

Posting Code allowances (vB code / HTML / etc) [edit] [remove] [add setting]

click add setting

Title: Enable Doublepost checking
Variable Name: stopdoublepost
Value: 0
Code to generate option: yesno
Order: 1 (or something else)

yzztik 12-03-2002 04:32 PM

ok NOW I feel really dumb :$ I was opening the PHP file instead of going to the file on my browser. Dunno why I didnt think of trying that. So so sorry :(

Xenon 12-04-2002 11:44 AM

*gggg*

no problem :)

partang2 12-26-2002 03:39 PM

Works great on 2.2.9 with fireflys quickreply installed!

*Clicks install*

N9ne 02-10-2003 05:42 PM

Xenon, I have a question. How can I exempt one thread from the double post prevention?

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

Is it something to do with this line? Do I just add || $threadid=2171 to it???

Xenon 02-10-2003 05:50 PM

yes right, but you should use $threadinfo['threadid'] == 2171 :)

N9ne 02-10-2003 05:52 PM

Ah ok, yesterday I decided to pick up my php book and learn each page from the start slowly step by step, so hopefully in a few months i'll be able to hack much bigger hacks :). Thanks for the code though.

007 02-27-2003 08:02 PM

Is there a way to make this say edited by "name" on "date"

you know, the standard edit text when someone posts?

Is it possible to make it do this after the same amount of time that my normal time is set ebfore having it diplay edited by?

I have it set to 2 minutes, so how would I do this?

I tried:
PHP Code:

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

without any luck... Probably something stupid I didn't think of.. :ermm:

Xenon 02-27-2003 10:16 PM

have you applied th edited by thing i posted in the thread here already?

007 02-27-2003 10:37 PM

Quote:

Originally posted by Xenon
Velocd: i have updated the installation file, now it should add an edited by message :)
??? I assumed this was in the installation file now. I looked around and am not seeing it. Can you maybe give me the post # of it? Thanks. :)


All times are GMT. The time now is 09:05 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.01440 seconds
  • Memory Usage 1,853KB
  • 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
  • (5)bbcode_code_printable
  • (11)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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