Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 03-29-2001, 06:27 PM
JamesUS's Avatar
JamesUS JamesUS is offline
 
Join Date: Oct 2001
Posts: 347
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay I've seen a lot of demand for this so decided to give it a shot. It is still in BETA so please don't use it without taking full backups etc! I will release a final version in a week or so.

It was developed on v2 beta 3 but I would imagine it would work on any v2 beta.



1. Add a field to the forum table called "password". Make it CHAR of 50 characters. You can also run this SQL statement:
Code:
ALTER TABLE forum ADD password CHAR (50) not null

forumdisplay.php
Put this on line 33:
PHP Code:
if ($action == "dopassword") {
    if (
md5($password) == md5($foruminfo['password'])) {
        
vbsetcookie("bbforumpass[$forumid]"md5($foruminfo['password']),0);
    } else {
        eval(
"standarderror(\"".gettemplate('error_passwordrequired')."\");");
        exit;
    }
} else {
    if (
$foruminfo['password']) {
        if (
$bbforumpass[$forumid] != md5($foruminfo['password'])) {
             eval(
"standarderror(\"".gettemplate('error_passwordrequired')."\");");
            exit;
        }
    }

showthread.php
Insert on line 114:
PHP Code:

if ($forum['password']) {
    if (
$bbforumpass[$forumid] != md5($foruminfo['password'])) {
        eval(
"standarderror(\"".gettemplate('error_passwordrequired')."\");");
        exit;
    }

admin/forum.php
Line 94:
PHP Code:
  makeinputcode("Forum Password<br>(Max length of 50 characters)","password"); 
Change line 129 from:
PHP Code:
  (forumid,styleid,title,description,active,displayorder,parentid
to

PHP Code:
  (password,forumid,styleid,title,description,active,displayorder,parentid
Change line 119 from:
PHP Code:
  (NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid'
to
PHP Code:
  ('$password',NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid'
Insert on line 194:
PHP Code:
makeinputcode("Forum Password<br>(Max length of 50 characters)","password",$forum[password]); 
Change line 242 from:
PHP Code:
moderateattach='$moderateattach' 
to

PHP Code:
moderateattach='$moderateattach',password='$password' 
Templates
Add a template called error_passwordrequired. In it should be this:
Quote:
A password is required to enter this forum. Please enter it below: <br>
<form action="forumdisplay.php" method="POST">
<input type="password" name="password">
<br>
<input type="hidden" name="action" value="dopassword">
<input type="hidden" name="forumid" value=$foruminfo[forumid]>
<input type="submit" value="Submit">
</form>
Reply With Quote
  #2  
Old 03-29-2001, 06:37 PM
Guest
 
Posts: n/a
Default

Very Nice! This will come in very handy....thx James...
Reply With Quote
  #3  
Old 03-29-2001, 07:11 PM
Guest
 
Posts: n/a
Default

That make very long time than we wait that!!
Thx very much!!
Reply With Quote
  #4  
Old 06-21-2001, 09:47 AM
RaMMSTeiN RaMMSTeiN is offline
 
Join Date: May 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by JamesUS
[B]
1. Add a field to the forum table called "password". Make it CHAR of 50 characters. You can also run this SQL statement:
Code:
ALTER TABLE forum ADD password CHAR (50) not null
i have done everything but how do that?? above??
Reply With Quote
  #5  
Old 06-21-2001, 12:15 PM
kicks
Guest
 
Posts: n/a
Default

You can use phpmyadmin or do it from command line if you have shell access to your server
Reply With Quote
  #6  
Old 06-21-2001, 05:51 PM
RaMMSTeiN RaMMSTeiN is offline
 
Join Date: May 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

where can i find the PHPadmin?? or the commandline shell....

im just started
a guy had setup our forum, so im a newbee LOL
Reply With Quote
  #7  
Old 06-21-2001, 07:03 PM
JamesUS's Avatar
JamesUS JamesUS is offline
 
Join Date: Oct 2001
Posts: 347
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you have telnet or SSH access to your host?
Reply With Quote
  #8  
Old 06-21-2001, 07:21 PM
The Prohacker's Avatar
The Prohacker The Prohacker is offline
 
Join Date: Oct 2001
Location: Dayton, Ohio
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<?
require(".global.php");
cpheader();
$DB_site->query("ALTER TABLE forum ADD password CHAR (50) not null");
echo("Database altered successfully. Please ".makelinkcode("click here","./index.php?s=$session[sessionhash]")." to proceed to your Admin CP");
cpfooter();
?>
Put this in a file called pass-install.php
and upload it to your admin dir, now call it from your browser to install the sql for this hack, after installed, delete pass-install.php.

Hopefully this will help
Reply With Quote
  #9  
Old 06-21-2001, 07:57 PM
RaMMSTeiN RaMMSTeiN is offline
 
Join Date: May 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by JamesUS
Do you have telnet or SSH access to your host?
what is that???
i have a normal 56 K modem, a ISDN line & and a cable modem?? do i have one of the asked things???

thnx prohacker
Reply With Quote
  #10  
Old 06-22-2001, 07:53 AM
JaDy
Guest
 
Posts: n/a
Default

is that working for version 1.1.4 too ?
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:09 AM.


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.04275 seconds
  • Memory Usage 2,264KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (11)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (6)postbit_onlinestatus
  • (10)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_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