Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Must Read Page >> Before Posting New Thread In Forum 1.01 Details »»
Must Read Page >> Before Posting New Thread In Forum 1.01
Version: 1.00, by N9ne N9ne is offline
Developer Last Online: Jul 2019 Show Printable Version Email this Page

Version: 2.3.x Rating:
Released: 03-15-2003 Last Update: Never Installs: 19
 
No support by the author.

Must Read Page Before Posting In A Forum
> A hack by N9ne, Copyright 2003+
> Hack created on March 16th 2003

Description: This hack will allow you to specify,
on a per forum basis, if a must read page comes up,
when someone tries to post a new thread in that
forum. You may use HTML code in the message.

After reading the page, the user is presented with two
options.

One: 'Proceed'; This will move them onto the page where
they can create the thread (ie. type up the post, subject,
etc.).

Two: 'Cancel'; This option will take them back to the forum.

Queries to run: 1

Files to modify:
admin/forum.php
newthread.php

Templates to add:
newthread_mustread

For: vB 2.x.x (created on 2.3.0)

ChangeLog
1.01: 2nd April 2003: BugFix: Post Preview now works.

Demo: Try posting a new thread in the full releases forum here, it brings up a must read page, i've re-created the system.

Credit: To DrkFusion for helping me with a HTTP_POST_VAR problem.

Note: Download the attached file and open in a text editor to view installation instructions!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #62  
Old 05-22-2003, 04:57 PM
N9ne N9ne is offline
 
Join Date: Feb 2002
Posts: 1,495
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #63  
Old 05-22-2003, 08:01 PM
Smoothie Smoothie is offline
 
Join Date: Oct 2001
Location: New York
Posts: 1,834
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #64  
Old 05-23-2003, 01:19 AM
DelFDgfd_gT DelFDgfd_gT is offline
 
Join Date: Oct 2001
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
  #65  
Old 05-23-2003, 01:48 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
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.
Reply With Quote
  #66  
Old 05-23-2003, 01:54 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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]); 
Reply With Quote
  #67  
Old 05-23-2003, 03:11 AM
Smoothie Smoothie is offline
 
Join Date: Oct 2001
Location: New York
Posts: 1,834
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #68  
Old 05-23-2003, 09:25 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try changing this:

PHP Code:
$mustreadtext addslashes($foruminfo[mustreadtext]); 
to this:

PHP Code:
$mustreadtext $foruminfo[mustreadtext]; 
Reply With Quote
  #69  
Old 05-25-2003, 07:14 AM
DelFDgfd_gT DelFDgfd_gT is offline
 
Join Date: Oct 2001
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can u make it for newreply.php too?
Reply With Quote
  #70  
Old 05-25-2003, 07:17 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #71  
Old 05-25-2003, 03:36 PM
Smoothie Smoothie is offline
 
Join Date: Oct 2001
Location: New York
Posts: 1,834
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


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 09:57 PM.


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.04858 seconds
  • Memory Usage 2,335KB
  • Queries Executed 27 (?)
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
  • (12)bbcode_php
  • (4)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
  • (3)pagenav_pagelink
  • (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_postinfo_query
  • fetch_postinfo
  • 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