2010-12-04, 10:15 PM
(2010-12-04, 10:14 PM)MattRogowski Wrote: [ -> ]Put
error_reporting(E_ALL);
after the <?php and try again.
<?php
error_reporting(E_ALL);
....
still blank.(2010-12-04, 10:14 PM)MattRogowski Wrote: [ -> ]Put
error_reporting(E_ALL);
after the <?php and try again.
<?php
error_reporting(E_ALL);
....
still blank.(2010-12-04, 10:59 PM)euantor Wrote: [ -> ]That's odd. I'll see if it works for me tomorrow and try post a working script for youIs there anything else I should try?
<?php
error_reporting(E_ALL);
define('IN_MYBB', 1);
require_once '/home/vol4/byethost11.com/b11_6630766/camods.net/htdocs/forum/global.php';
//Get the IP of the user.
$ip = $_SERVER['REMOTE_ADDR'];
$query = $db->query("SELECT username,postnum,usergroup,additionalgroups,lastip FROM mybb_users WHERE lastip='$ip'");
$user = $db->fetch_array($query);
if($user['username'] == NULL)
{
die("Invalid User");
}
$username = $user['username'];
$posts = $user['postnum'];
$usergroup = $user['usergroup'];
$additional = $user['additionalgroups'];
echo $username . "<br>";
echo $posts . "<br>";
echo $usergroup . "<br>";
echo $additional . "<br>";
?>
(2010-12-05, 12:29 PM)euantor Wrote: [ -> ]It all seems fine to me at first glance. I'll try it on my site for you and try to get it working.Did it work? :C
<?php
error_reporting(E_ALL);
define('IN_MYBB', 1);
include('/home/vol4/byethost11.com/byethostusername/camods.net/forum/global.php');
//Get the IP of the user.
$ip = $_SERVER['REMOTE_ADDR'];
$query = $db->query("SELECT username,postnum,usergroup,additionalgroups,lastip FROM mybb_users WHERE lastip='$ip'");
$user = $db->fetch_array($query);
if($user['username'] == NULL)
{
die("Invalid User");
}
$username = $user['username'];
$posts = $user['postnum'];
$usergroup = $user['usergroup'];
$additional = $user['additionalgroups'];
echo $username . "<br>";
echo $posts . "<br>";
echo $usergroup . "<br>";
echo $additional . "<br>";
?>
define('THIS_SCRIPT', 'portal.php');
// set the path to your forums directory here (without trailing slash)
$forumdir = "./";
// end editing
$change_dir = "./";
if(!@chdir($forumdir) && !empty($forumdir))
{
if(@is_dir($forumdir))
{
$change_dir = $forumdir;
}
else
{
die("\$forumdir is invalid!");
}
}
require_once $change_dir."/global.php";
// Fetch the current URL
$portal_url = get_current_location();
add_breadcrumb($lang->nav_portal, "portal.php");
// This allows users to login if the portal is stored offsite or in a different directory
if($mybb->input['action'] == "do_login" && $mybb->request_method == "post")
{
$plugins->run_hooks("portal_do_login_start");
// Checks to make sure the user can login; they haven't had too many tries at logging in.
// Is a fatal call if user has had too many tries
$logins = login_attempt_check();
$login_text = '';
if(!username_exists($mybb->input['username']))
{
error($lang->error_invalidpworusername.$login_text);
}
$user = validate_password_from_username($mybb->input['username'], $mybb->input['password']);
if(!$user['uid'])
{
my_setcookie('loginattempts', $logins + 1);
$db->update_query("users", array('loginattempts' => 'loginattempts+1'), "LOWER(username) = '".$db->escape_string(my_strtolower($mybb->input['username']))."'", 1, true);
if($mybb->settings['failedlogintext'] == 1)
{
$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
}
error($lang->error_invalidpassword.$login_text);
}
my_setcookie('loginattempts', 1);
$db->delete_query("sessions", "ip='".$db->escape_string($session->ipaddress)."' AND sid != '".$session->sid."'");
$newsession = array(
"uid" => $user['uid'],
);
$db->update_query("sessions", $newsession, "sid='".$session->sid."'");
$db->update_query("users", array("loginattempts" => 1), "uid='{$mybb->user['uid']}'");
my_setcookie("mybbuser", $user['uid']."_".$user['loginkey'], ($mybb->input['remember'] == "yes" ? null : 0), true);
my_setcookie("sid", $session->sid, -1, true);
if(function_exists("loggedIn"))
{
loggedIn($user['uid']);
}
$plugins->run_hooks("portal_do_login_end");
redirect("portal.php", $lang->redirect_loggedin);
}
$plugins->run_hooks("portal_start");