I'm trying to have some code displaying under the menu of my regular site if the user is logged into my forums.
Using a tutorial by this guy, it's gone great so far... but after scouring the phpbb code multiple times in a ton of different pages, I have no clue how to turn the unintelligable numbers of user_lastvisit in the mysql phpbb_users table into something like "Wed March 10..."
My code:
Code: Select all
<?php
include('data/global/config.php');
define('IN_PHPBB', true);
$site_root_path = '/home/yolegoma/public_html/'; //<-- Modify
$phpbb_root_path2 = '/themonkey/'; //<-- Modify
$phpbb_root_path = $site_root_path . $phpbb_root_path2;
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.php');
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
$loggedin = $userdata['session_logged_in'];
$username = $userdata['username'];
// Jump down to troublesome code
echo 'Welcome, ' .$username. '!';
echo '<br />';
// This is the code we are looking at
// It comes out as wierd numbers such as 1078949351
echo 'You last visited ' .$userdata['user_lastvisit']. '.';
echo '<br />';
$authorized = '<a href="admin.php">Admin Page</a>';
if($username == "myname") {
echo $authorized;
}
if($username == "myfriendsname") {
echo $authorized;
}
?>1078949351 into Wed March 10 blah blah.
If this has been asked before, I apologize. I spent an hour looking through the phpbb code, google, and these forums before asking!
- The Monkey