Version: 1.00, by mcahill
Developer Last Online: Dec 2012
Version: 3.0.0
Rating:
Released: 02-02-2004
Last Update: Never
Installs: 74
No support by the author.
This is a simple modification to do, and adds a lot of value to your homepage.
Notes:
1. This script can occassionally have conflicts with other javascripts. Test before you deploy.
2. If you use and include to put the file on your page, be sure that the chdir and the require for global.php is in the head of the main document.
3. It is assumed that you are using a php page, and that you have already got connectivity with your database.
The code:
At the top of the document, before the <html> or <head> tags (edit to provide the path for your particular installation):
Before requesting support, please check the following:
1. Make sure you have the path to your forum in the chdir. If you haven't done this, you will get a "can't include" error.
2. Make sure you have the chdir in the main document. If it isn't you will get a "can't modify header" error.
3. If those don't resolve the issue, try putting the login in a separate file, with no other code. If it works there, then you will know that you have a conflict with one of the scripts on the page you are trying to add the login to. I can't help you if you've got a conflict with another script.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I was having trouble using this method without generating errors. I found the solution and thought I would share it.
The code at the begining:
<?php
chdir("forum/");
require('./global.php');
chdir("../");
?>
This can cause problems if your vB uses a different DB since it connects to that DB and then returns but never reconnects to the orginial DB. This cause mysql fetch array errors for me.
Add this line after the last chdir:
mysql_select_db("your_mainDB_name_goes_here");
Should look like this now:
<?php
chdir("forum/");
require('./global.php');
chdir("../");
mysql_select_db("your_mainDB_name_goes_here");
?>
Next, make sure you have the same admin user for the forum DB also listed as a user in the main DB will all permissions. If not, create a matching forum admin account in your main DB.
This should clear up any issues when using this with 2 DB's.
Hey, I installed this script, and it worked fine on the same domain... but I want this to work on a different domain than what the forum is on.
I have tried changing the directory for it to find the global.php like this:
<?
chdir("/home/vgcorec/public_html/forum");
require('./global.php');
chdir("/home/xbcore/public_html/");
?>
and I have also tried just running it on the vgcorec site and then using a php include on the xbcore site and it does not work right.
It shows the login forms, but it will not detect that you are already logged in if you are.
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/ross/public_html/login.php on line 11