mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-09 06:35:42 +12:00
add stuff
This commit is contained in:
parent
7a54cd91d7
commit
4414da4648
5 changed files with 61 additions and 14 deletions
|
@ -71,16 +71,31 @@ if(!is_logged_in())
|
||||||
|
|
||||||
|
|
||||||
// Get account data
|
// Get account data
|
||||||
$money = getUserMoney($dbname, $_SESSION['PLAYER_ID']);
|
$newUser = getUserExistInExt($dbname, $_SESSION['PLAYER_ID']);
|
||||||
$bankMoney = getUserBankMoney($dbname, $_SESSION['PLAYER_ID']);
|
|
||||||
$loginDate = getUserLoginDate($dbname, $_SESSION['PLAYER_ID']);
|
|
||||||
$questPoints = getUserQuestPoints($dbname, $_SESSION['PLAYER_ID']);
|
|
||||||
$totalLogins = getUserTotalLogins($dbname, $_SESSION['PLAYER_ID']);
|
|
||||||
|
|
||||||
$subbed = getUserSubbed($dbname, $_SESSION['PLAYER_ID']);
|
if(!$newUser){
|
||||||
$subTime = getUserSubTimeRemaining($dbname, $_SESSION['PLAYER_ID']);
|
|
||||||
$playtime = getUserPlaytime($dbname, $_SESSION['PLAYER_ID']);
|
|
||||||
|
|
||||||
|
$money = getUserMoney($dbname, $_SESSION['PLAYER_ID']);
|
||||||
|
$bankMoney = getUserBankMoney($dbname, $_SESSION['PLAYER_ID']);
|
||||||
|
$loginDate = getUserLoginDate($dbname, $_SESSION['PLAYER_ID']);
|
||||||
|
$questPoints = getUserQuestPoints($dbname, $_SESSION['PLAYER_ID']);
|
||||||
|
$totalLogins = getUserTotalLogins($dbname, $_SESSION['PLAYER_ID']);
|
||||||
|
|
||||||
|
$subbed = getUserSubbed($dbname, $_SESSION['PLAYER_ID']);
|
||||||
|
$subTime = getUserSubTimeRemaining($dbname, $_SESSION['PLAYER_ID']);
|
||||||
|
$playtime = getUserPlaytime($dbname, $_SESSION['PLAYER_ID']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$money = 0;
|
||||||
|
$bankMoney = 0;
|
||||||
|
$loginDate = time();
|
||||||
|
$questPoints = 0;
|
||||||
|
$totalLogins = 0;
|
||||||
|
$subbed = false;
|
||||||
|
$subTime = 0;
|
||||||
|
$playtime = 0;
|
||||||
|
}
|
||||||
if($all_users_subbed)
|
if($all_users_subbed)
|
||||||
$subbed = true;
|
$subbed = true;
|
||||||
|
|
||||||
|
@ -183,8 +198,13 @@ h+=60;//h += 96;
|
||||||
$difference = $current_time - $loginDate;
|
$difference = $current_time - $loginDate;
|
||||||
$lastOn = $difference/3600;
|
$lastOn = $difference/3600;
|
||||||
|
|
||||||
|
if($newUser){
|
||||||
echo('It has been: '.number_format((float)$lastOn, 2, '.', '').' hours since you were last online. You have logged in '.$totalLoginsStr.' times.<BR>You have <B><FONT COLOR=005500>$'.$moneyStr.'</FONT></B> in Horse Isle money on hand and <B><FONT COLOR=005500>$'.$bankmoneyStr.'</FONT></B> in the bank.<BR>You have earned <B>'.(string)$questPoints.'</B> of <B>63005</B> total quest points (<B>'.(string)floor(($questPoints / 63005) * 100.0).'%</B> Complete)<BR>');
|
echo('<BR>You have a new account and have not yet logged in!<BR>');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
echo('It has been: '.number_format((float)$lastOn, 2, '.', '').' hours since you were last online. You have logged in '.$totalLoginsStr.' times.<BR>');
|
||||||
|
}
|
||||||
|
echo('You have <B><FONT COLOR=005500>$'.$moneyStr.'</FONT></B> in Horse Isle money on hand and <B><FONT COLOR=005500>$'.$bankmoneyStr.'</FONT></B> in the bank.<BR>You have earned <B>'.(string)$questPoints.'</B> of <B>63005</B> total quest points (<B>'.(string)floor(($questPoints / 63005) * 100.0).'%</B> Complete)<BR>');
|
||||||
if(!$subbed)
|
if(!$subbed)
|
||||||
{
|
{
|
||||||
echo('You have <B>'.(string)$playtime.'</B> minutes of playtime available. As a non-subscriber you get 1 additional minute every 8 minutes. <I>(subject to change based on load)</I> (<A HREF=/web/whylimited.php>why limited?</A>) <BR>');
|
echo('You have <B>'.(string)$playtime.'</B> minutes of playtime available. As a non-subscriber you get 1 additional minute every 8 minutes. <I>(subject to change based on load)</I> (<A HREF=/web/whylimited.php>why limited?</A>) <BR>');
|
||||||
|
|
|
@ -122,6 +122,20 @@ function getUserQuestPoints($database, $id)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getUserExistInExt($database, $id)
|
||||||
|
{
|
||||||
|
include('config.php');
|
||||||
|
$dbname = $database;
|
||||||
|
$connect = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to '$dbhost'");
|
||||||
|
$stmt = $connect->prepare("SELECT COUNT(*) FROM UserExt WHERE Id=?");
|
||||||
|
$stmt->bind_param("i", $id);
|
||||||
|
$stmt->execute();
|
||||||
|
$result = $stmt->get_result();
|
||||||
|
|
||||||
|
return intval($result->fetch_row()[0]) <= 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function getUserTotalLogins($database, $id)
|
function getUserTotalLogins($database, $id)
|
||||||
{
|
{
|
||||||
include('config.php');
|
include('config.php');
|
||||||
|
|
|
@ -8,8 +8,7 @@ if(session_status() !== PHP_SESSION_ACTIVE)
|
||||||
if(!function_exists('is_logged_in'))
|
if(!function_exists('is_logged_in'))
|
||||||
include('common.php');
|
include('common.php');
|
||||||
|
|
||||||
$host_names = explode(".", $host);
|
$host = $_SERVER['HTTP_HOST'];
|
||||||
$host = $host_names[count($host_names)-2] . "." . $host_names[count($host_names)-1];
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<HEAD>
|
<HEAD>
|
||||||
|
|
|
@ -122,6 +122,20 @@ function getUserQuestPoints($database, $id)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getUserExistInExt($database, $id)
|
||||||
|
{
|
||||||
|
include('config.php');
|
||||||
|
$dbname = $database;
|
||||||
|
$connect = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to '$dbhost'");
|
||||||
|
$stmt = $connect->prepare("SELECT COUNT(*) FROM UserExt WHERE Id=?");
|
||||||
|
$stmt->bind_param("i", $id);
|
||||||
|
$stmt->execute();
|
||||||
|
$result = $stmt->get_result();
|
||||||
|
|
||||||
|
return intval($result->fetch_row()[0]) <= 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function getUserTotalLogins($database, $id)
|
function getUserTotalLogins($database, $id)
|
||||||
{
|
{
|
||||||
include('config.php');
|
include('config.php');
|
||||||
|
|
|
@ -5,8 +5,8 @@ if(session_status() !== PHP_SESSION_ACTIVE)
|
||||||
if(!function_exists('is_logged_in'))
|
if(!function_exists('is_logged_in'))
|
||||||
include('../common.php');
|
include('../common.php');
|
||||||
|
|
||||||
$info = parse_url($_SERVER['HTTP_HOST']);
|
|
||||||
$host = $info['host'];
|
$host = $_SERVER['HTTP_HOST'];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<HEAD>
|
<HEAD>
|
||||||
|
|
Loading…
Add table
Reference in a new issue