Hmmm, okay, let's try this with a real-world example. Currently, I have my members' area coded as follows (which worked prior to vB 3.5).
The authorisation code is contained in
checkauth.php located in the members' directory:
PHP Code:
<?
chdir("/path/to/public_html/forum/");
require('./global.php');
chdir("/path/to/public_html/members/");
if ($vbulletin->userinfo['userid']==0)
{
require('/path/to/public_html/members/login.php');
exit;
}
?>
A centralised include file called
global.php located in the members' directory is called at the top of every members' area page:
PHP Code:
<?
require_once('/path/to/public_html/members/checkauth.php');
include('/path/to/public_html/include/db.php');
?>
So, would I simply be able to do the following?
PHP Code:
<?
require_once('/path/to/public_html/members/global.php');
$vbulletin->input->clean_gpc('r', 'my_var', TYPE_INT);
$my_var = $vbulletin->GPC['my_var'];
$sql = "SELECT * FROM my_table WHERE my_id = '$my_var'";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result);
?>
Quote:
Originally Posted by RedFive
Hmmm, okay, let's try this with a real-world example. Currently, I have my members' area coded as follows (which worked prior to vB 3.5).
The authorisation code is contained in checkauth.php located in the members' directory:
PHP Code:
<?
chdir("/path/to/public_html/forum/");
require('./global.php');
chdir("/path/to/public_html/members/");
if ($vbulletin->userinfo['userid']==0)
{
require('/path/to/public_html/members/login.php');
exit;
}
?>
A centralised include file called global.php located in the members' directory is called at the top of every members' area page:
PHP Code:
<?
require_once('/path/to/public_html/members/checkauth.php');
include('/path/to/public_html/include/db.php');
?>
So, would I simply be able to do the following?
PHP Code:
<?
require_once('/path/to/public_html/members/global.php');
$vbulletin->input->clean_gpc('r', 'my_var', TYPE_INT);
$my_var = $vbulletin->GPC['my_var'];
$sql = "SELECT * FROM my_table WHERE my_id = '$my_var'";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result);
?>
|
In fact, I'll answer my own question.
It works like a dream. Thanks MarcoH64 for your assistance!
Regards,
Red.