4
« on: May 05, 2003, 03:52:31 PM »
Hi! I have tried my hand at making a mod to integrate YaBBSE forum with the gallery script. What i actually tried to achieve is to provide a link in the forum such that when the user click on that, if the user is already logged in to the fourm he wil be autmatically logged in to the gallery and redirected to the index.php of the gallery.
I created a gallery.php and put it in my forum directory and my gallery is a directory lower than that. In the gallery.php file, I manage to extract info about my logged in user info such as his username and password. I tried to pass those values into login.php. However when I do that, I get this error message "Fatal error: ob_start() [ref.outcontrol]: Cannot use output buffering in output buffering display handlers". I have no idea what this means. Below is the code for gallery.php
<?php
global $pwseed, $db_prefix, $username, $cookiepassword;
checkSession('get');
LoadCookie();
//if ($cookieusername && $cookiepassword) {
$username = (int) $username;
$request = mysql_query("SELECT passwd, realName, emailAddress, websiteTitle, websiteUrl, signature, posts, memberGroup, ICQ, AIM, YIM, gender, personalText, avatar, dateRegistered, location, birthdate, timeFormat, timeOffset, hideEmail, ID_MEMBER, memberName, MSN, lngfile FROM {$db_prefix}members WHERE ID_MEMBER='$username' LIMIT 1;") or database_error(__FILE__, __LINE__);
if (mysql_num_rows($request) != 0)
{
/* Initialize the settings array */
$settings = mysql_fetch_row($request);
$user_password = $settings[0];
$user_name = $settings[21];
if ($user_name && $user_password) {
define('GET_CACHES', 1);
define('ROOT_PATH', '/my_path_to/gallery/');
define('GET_USER_ONLINE', 1);
include(ROOT_PATH.'global.php');
include(ROOT_PATH.'includes/sessions.php');
header("Location: ".$site_sess->url(ROOT_PATH."login.php", "&"));
}
}
?>
Can someone tell me what I did wrong? Or since I can get the username and password from my forum, how to pass those values to the gallery script so that it will logged in the user? Thanks.