View Full Version : Im not sure how to do this...
M4g!k
06-27-2003, 08:18 AM
hello. I've posted before about having a register and log-in feature on my website that works with my VB.
(i.e. so on the main page, you see...
"welcome! Register/log in..." and if you click any other link, you get the same thing....
then, once you've registered and logged in, you can view all of the content of the site, and post on the forums using the registername you just registered.
I've got my website design sorted, and my forums are working, now all i need is this.
I'm not sure how to do this. can someone please help me? :speechless:
thanks a lot :)
-Dave
Xenon
06-27-2003, 10:01 AM
you have to require global.php within your scripts.
do a search and you'll find a lot of threads where such things are explained detailed
M4g!k
06-27-2003, 10:31 AM
Today at 12:01 PM Xenon said this in Post #2 (https://vborg.vbsupport.ru/showthread.php?postid=413298#post413298)
you have to require global.php within your scripts.
what do you mean?
Xenon
06-27-2003, 10:34 AM
if you require global.php on your main sites php files, you can use the bbuserinfo aray of vbulletin and so can make conditions hwat users can see
M4g!k
06-27-2003, 10:38 AM
lol. im sorry, im totally new to all this stuff!
could you please explain everything in total DUMB language. I dont understand.
What do i have to do to my index.php to to this?
Xenon
06-27-2003, 11:09 AM
you have to add
chdir('forum');
require('./global.php');
chdir('..');
at the beginning of your file :)
M4g!k
06-27-2003, 12:16 PM
now thats added to all my files, what does that do?
Will i need to put in my global.php file?
*sorry about all this, but i'm learning :)*
M4g!k
06-27-2003, 09:05 PM
*bump* sorry. i know its bad....but i really need help with this :(
Gary King
06-27-2003, 10:55 PM
Actually, all you need is the following code in your files:
<?php
require("forum/global.php");
?>
You don't need the chdir, and don't forget to change the path to the global.php to wherever yours is located.
M4g!k
06-28-2003, 07:24 AM
so.......global.php is what makes it viewable to members only...correct? Then how do i get a page for non-members then?
Yesterday at 07:55 PM Gary W said this in Post #9 (https://vborg.vbsupport.ru/showthread.php?postid=413551#post413551)
You don't need the chdir, and don't forget to change the path to the global.php to wherever yours is located. [/B]
No, you need the chdir because global.php uses relative paths to include all the other important files (DB_mysql.php, config.php, functions.php)
M4g!k
06-28-2003, 11:44 AM
im sorry. i dont understand how to do it still......is there a tutorial about this sort of thing?
or can someone give me step-by step instructions to getting this to work?
thanks :P
So, you want only members to be allowed in a certain page?
<?php
$dir = getcwd();
chdir('./forums'); // replace with your forums directory
require('./global.php');
chdir($dir);
if($bbuserinfo['userid'] == 0) {
show_nopermission();
}
?>
text only viewable by members
M4g!k
06-28-2003, 12:00 PM
thanks. Now, how can i chage what non-members see?
I know, I'll upload my index.php, and can you edit it so that only members can see it and non-members are either redirected to somewhere else, or see soemthing else?
thanks again. i really appreacate this help :)
This will show the page to members and forward guests to /some-page-for-guests.php (you can change to whatever you want)
M4g!k
06-28-2003, 12:46 PM
thanks :)...Now.....you see the login bit in the top right hand side? is there a way i can get that to work with my Vb usernames? :pirate:
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.