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)
-   -   Must Read Page >> Before Posting New Thread In Forum 1.01 (https://vborg.vbsupport.ru/showthread.php?t=50238)

N9ne 04-02-2003 11:48 AM

How about this:

PHP Code:

// ############################### start new thread ###############################
if ($action=="newthread" and $foruminfo[mustread]=="1") {
        
$mustreadtext addslashes($foruminfo[mustreadtext]);
        eval(
"dooutput(\"".gettemplate("newthread_mustread")."\");");
        exit;
} elseif ((
$HTTP_POST_VARS['action']=="postnewthread" and $foruminfo[mustread]=="1") or ($action=="newthread" and $foruminfo[mustread]=="0") or ($HTTP_POST_VARS['action']=="vbform")) { 


Smoothie 04-02-2003 11:54 AM

Same results...

N9ne 04-02-2003 11:58 AM

Ok, I've found a fix!

Use this block of code instead!:

PHP Code:

// ############################### start new thread ###############################
if ($action=="newthread" and $foruminfo[mustread]=="1" and !$previewpost and !$preview) {
        
$mustreadtext addslashes($foruminfo[mustreadtext]);
        eval(
"dooutput(\"".gettemplate("newthread_mustread")."\");");
        exit;
} elseif ((
$HTTP_POST_VARS['action']=="postnewthread" and $foruminfo[mustread]=="1") or ($action=="newthread" and $foruminfo[mustread]=="0") or ($previewpost)) { 


N9ne 04-02-2003 12:03 PM

1.01 Released
Fix: Post Preview: When posting a new thread, you don't get the must read page, when you click on preview post.

First Post and DB Entry updated. New fixed attachment uploaded in first post. Everyone should re-do the step to newthread.php.

Credit: Smoothie for testing out fixes which didn't work lol, and um, me, for finding the simplistic fix :D.

trafix 04-02-2003 12:32 PM

that means that i can install it now???

well....... right after i update to vb2.3.0

N9ne 04-02-2003 12:33 PM

Yep, you can install it now, should work fine :). Enjoy.

Smoothie 04-02-2003 05:49 PM

yep, preview works fine now. :)

N9ne 04-02-2003 05:54 PM

Glad to hear that :).

kira 04-13-2003 07:51 PM

This seems like a perfect hack for certain forums on my site! Great work.

Quick question though -- will this "must read" page show up for everyone who tries to post a new thread, or just new posters who haven't done this before? If it's the former, I'm just worried that oldtimers might get a little annoyed if, every time they post, they're confronted by the same "must read" page that they've already read!

And I have no idea if that paragraph made any sense. :)

N9ne 04-13-2003 09:03 PM

Kira, you are correct, everytime someone opts to post a new thread in the forum, the must read page comes up. However it shouldn't annoy anyone too much, as it only requires simply pressing the Proceed button to continue :)

Please click install if you use the hack :).

cinq 04-28-2003 01:26 AM

Just wondering if anyone got it working in 2.2.9 ?

Koutaru 04-28-2003 01:31 AM

:) is there any way to disable the "proceed" button for a few minutes/seconds? It may be a template mod

Smoothie 04-28-2003 03:32 AM

Quote:

Yesterday at 10:26 PM cinq said this in Post #51
Just wondering if anyone got it working in 2.2.9 ?
yes, it works fine in 2.2.9

eoc_Jason 04-28-2003 08:33 AM

I think it would be cool you could add a feature in so they only had to click agree once, unless you made a change to that page then you could reset everyone's info and it would popup the page again for them. Otherwise they might get used to just scrolling and clicking okay without actually reading what is there.

I realize doing that would probably create a lot of extra work thought... ;)

Koutaru - you might be able to disable the button using javascript.

This is a pretty sweet hack, I am planning on adding it in my forum soon.

DelFDgfd_gT 05-21-2003 03:24 AM

I have a little request. Instead of making this work in a certain forum, how can it be done when visiting the index.php?

Basically, when you visit my site, you get the MUST READ page, you click Proceed, and you can view the forums.

Also, I'd like it so that you only have to click it ONE time...

If the index.php must read is too much for you, can you tell me two things...
1. how to enable it in newreply.php
2. only click proceed once.


==========

BUG REPORT

==========

If you put a ' in your Must Read message in Admin CP, it will come up with an error.

Example:
Quote:

-BETA-<br>
Please make sure you have replied to www.forum.com.<br>
If you haven't, please so now.
Error Message:


Database error in vBulletin Control Panel 2.2.9:

Invalid SQL: UPDATE forum
SET
styleid='1', title='Public Chat', description='',
active='1', displayorder='1', parentid='1', parentlist='2,1,-1',
allowposting='1', cancontainthreads='1', daysprune='30',
newpostemail='', newthreademail='',
moderatenew='0', allowhtml='1', allowbbcode='1',
allowimages='1', allowsmilies='1', allowicons='1',
styleoverride='0', allowratings='0', countposts='1',
moderateattach='0', mustread='1',mustreadtext='-BETA-<br>
Please make sure you have replied to [url]www.forum.com.[/url

If you haven'
t, please so now.', security='1', forumpass='', passtimeout='0'
WHERE forumid='2'
mysql error: You have an error in your SQL syntax near 't, please so now.', security='1', forumpass='', passtimeout='0'
' at line 10


mysql error number: 1064



The code works from start of the bold to end of bold then stops.
The code in bold and underline error says invalid syntax for '.

Reporting this bug.

DelFDgfd_gT 05-22-2003 03:17 AM

well there is no help, so Im un-installing.

Boofo 05-22-2003 03:30 AM

Smoothie, have you run into this problem yet?

Smoothie 05-22-2003 07:30 AM

Quote:

Today at 12:30 AM Boofo said this in Post #57
Smoothie, have you run into this problem yet?
yes I have.

Smoothie 05-22-2003 07:31 AM

oh N9ne-

We need a bug fix please!

Boofo 05-22-2003 08:02 AM

I'm sure it only needs an addslashes somewhere. ;)

N9ne 05-22-2003 04:57 PM

Hmm, that's odd, see, in newthread.php you put this code from this hack:

PHP Code:

// ############################### start new thread ###############################
if ($action=="newthread" and $foruminfo[mustread]=="1" and !$previewpost and !$preview) {
        
$mustreadtext addslashes($foruminfo[mustreadtext]);
        eval(
"dooutput(\"".gettemplate("newthread_mustread")."\");");
        exit;
} elseif ((
$HTTP_POST_VARS['action']=="postnewthread" and $foruminfo[mustread]=="1") or ($action=="newthread" and $foruminfo[mustread]=="0") or ($previewpost)) { 

It already has an addslashes there, so I don't know why it's doing this...

I'm out of ideas, maybe I'll think of something later. Right now I can't do anything as I have some huge exams to take, this whole week actually [some may have noticed my absence at vb.org], I've only got my last 2 tomorrow and then I will be back :D

Smoothie 05-22-2003 08:01 PM

N9ne-

yep, noticed this little bug a few weeks ago and forgot to mention it here. Hopefully there will a fix upcoming when you have time.

DelFDgfd_gT 05-23-2003 01:19 AM

I have a little request. Instead of making this work in a certain forum, how can it be done when visiting the index.php?

Basically, when you visit my site, you get the MUST READ page, you click Proceed, and you can view the forums.

Also, I'd like it so that you only have to click it ONE time...

If the index.php must read is too much for you, can you tell me two things...
1. how to enable it in newreply.php
2. only click proceed once. (cookies)

Boofo 05-23-2003 01:48 AM

Quote:

Today at 12:57 PM N9ne said this in Post #61
Hmm, that's odd, see, in newthread.php you put this code from this hack:

PHP Code:

// ############################### start new thread ###############################
if ($action=="newthread" and $foruminfo[mustread]=="1" and !$previewpost and !$preview) {
        
$mustreadtext addslashes($foruminfo[mustreadtext]);
        eval(
"dooutput(\"".gettemplate("newthread_mustread")."\");");
        exit;
} elseif ((
$HTTP_POST_VARS['action']=="postnewthread" and $foruminfo[mustread]=="1") or ($action=="newthread" and $foruminfo[mustread]=="0") or ($previewpost)) { 

It already has an addslashes there, so I don't know why it's doing this...

I'm out of ideas, maybe I'll think of something later. Right now I can't do anything as I have some huge exams to take, this whole week actually [some may have noticed my absence at vb.org], I've only got my last 2 tomorrow and then I will be back :D

You are adding slashes as you pull it from the db. You need to add slashes when you add it to the db in the query.

Boofo 05-23-2003 01:54 AM

Smoothie, try changing this:

PHP Code:

mustreadtext='$mustreadtext' 

to this in the forum.php:

PHP Code:

mustreadtext='".addslashes($mustreadtext)."' 

and let me know what happens. Also take this code out from the code above before you test this.

PHP Code:

$mustreadtext addslashes($foruminfo[mustreadtext]); 


Smoothie 05-23-2003 03:11 AM

Quote:

Yesterday at 10:54 PM Boofo said this in Post #65
Smoothie, try changing this:

PHP Code:

mustreadtext='$mustreadtext' 

to this in the forum.php:

PHP Code:

mustreadtext='".addslashes($mustreadtext)."' 

and let me know what happens. Also take this code out from the code above before you test this.

PHP Code:

$mustreadtext addslashes($foruminfo[mustreadtext]); 


If I use your code, I can add a must read in the admin cp for a forum that has a ' character. But when i click on new thread, the must read contains no text. If I change only the first code in forum.php, it works, but I get this: haven/t instead of haven't.

Boofo 05-23-2003 09:25 AM

Try changing this:

PHP Code:

$mustreadtext addslashes($foruminfo[mustreadtext]); 

to this:

PHP Code:

$mustreadtext $foruminfo[mustreadtext]; 


DelFDgfd_gT 05-25-2003 07:14 AM

can u make it for newreply.php too?

Boofo 05-25-2003 07:17 AM

Quote:

05-23-03 at 05:25 AM Boofo said this in Post #67
Try changing this:

PHP Code:

$mustreadtext addslashes($foruminfo[mustreadtext]); 

to this:

PHP Code:

$mustreadtext $foruminfo[mustreadtext]; 


Smoothie, did this work for you?

Smoothie 05-25-2003 03:36 PM

Quote:

Today at 04:17 AM Boofo said this in Post #69
Smoothie, did this work for you?
Haven't tried it yet

Smoothie 05-25-2003 03:40 PM

I'm a bit confused. Change this
PHP Code:

mustreadtext='$mustreadtext' 

To this in forum.php
PHP Code:

mustreadtext='".addslashes($mustreadtext)."' 

Now where does this code go
PHP Code:

$mustreadtext $foruminfo[mustreadtext]; 


Boofo 05-25-2003 03:47 PM

This is the code you need to change the last part in:

PHP Code:

// ############################### start new thread ###############################
if ($action=="newthread" and $foruminfo[mustread]=="1" and !$previewpost and !$preview) {
        
$mustreadtext addslashes($foruminfo[mustreadtext]);
        eval(
"dooutput(\"".gettemplate("newthread_mustread")."\");");
        exit;
} elseif ((
$HTTP_POST_VARS['action']=="postnewthread" and $foruminfo[mustread]=="1") or ($action=="newthread" and $foruminfo[mustread]=="0") or ($previewpost)) { 


Smoothie 05-25-2003 06:13 PM

yes! Will test more, but it looks like that fixed it.

Boofo 05-25-2003 06:38 PM

Ok, test it out and post the changes in here for anyone else who has run into this problem. ;)

cinq 08-03-2003 09:12 AM

Was this eventually fixed ?
:)

The Realist 08-25-2003 01:08 PM

tried it, getting a parse error.

Quote:

05-25-03 at 09:17 AM Boofo said this in Post #69
Smoothie, did this work for you?

The Realist 08-25-2003 01:26 PM

Sorted out my parse error. when peeps click on new thread the proceed and cancel shows up ok, but no text. Also if they click reply it does not show at all and they can post without seeing the must read screen?

How can this hack be done so it shows up when they enter a section and not post a thread or reply?

Thanks.

Quote:

Today at 03:08 PM The Realist said this in Post #76
tried it, getting a parse error.

corsacrazy 09-16-2003 03:24 PM

wont allow the use of html all i get is
Code:


      <img border=\"0\" src=\"http://www.XXX.com/yyyl.jpg\" alt=\"text\" width=\"142\" height=\"149\">


and vb code is [*img] doesnt work either :(

gunn0r 01-31-2007 03:19 PM

Hi there,

does anyone know if this works with vBulletin 3.6.3?

Thanks for any info!


All times are GMT. The time now is 11:44 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.01401 seconds
  • Memory Usage 1,867KB
  • 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
  • (18)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (39)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