<?php
include_once (DIRNAME(__FILE__) . '/globals.php');
### Start Configuration ###
$Config = array('EnergyRefill' => '10', 'WillRefill' => '10', 'BraveRefill' => '10', 'DonatorDays' => '10', 'Protection' => '10');
### End Configuration ###
$_GET['spend'] = isset($_GET['spend']) && !empty($_GET['spend']) && ctype_alpha($_GET['spend']) ? $_GET['spend'] : FALSE;
if (!function_exists('Error')) {
function Error($Message) {
global $h;
echo sprintf("<span style='color: #FF0000;'>Error!
%s</span>", stripslashes($Message));
exit($h->endpage());
}
}
if (!in_array($_GET['spend'], array('', 'EnergyR', 'WillR', 'BraveR',))) {
Error('Invalid Command!');
}
if (!$_GET['spend']) {
echo '<span style="text-decoration: underline; font-size: 14px; font-weight: 600">Welcome To The Crystal Temple!</span>
';
echo sprintf("You have [b]%s[/b] crystals.
", number_format($ir['crystals']));
echo 'What would you like to spend your crystals on?
';
echo sprintf("
[url='ctemple.php?spend=EnergyR']Energy Refill - %s Crystals[/url]
", number_format($Config['EnergyRefill']));
echo printf("[url='ctemple.php?spend=BraveR']Brave Refill - %s Crystals[/url]
", number_format($Config['BraveRefill']));
} else {
if ($_GET['spend'] == 'EnergyR') {
if ($ir['crystals'] < $Config['EnergyRefill']) {
Error('You Don\'t Have Enough Crystals!');
} else if ($ir['energy'] == $ir['maxenergy']) {
Error('You Already Have Full Energy.');
} else {
$db->query(sprintf("UPDATE users SET energy=maxenergy, crystals=crystals-%d WHERE userid=%d", $Config['EnergyRefill'], $userid));
echo sprintf("You Have Paid %d Crystals To Refill Your Energy Bar.", number_format($Config['EnergyRefill']));
}
} else if ($_GET['spend'] == 'BraveR') {
if ($ir['crystals'] < $Config['BraveRefill']) {
Error('You Don\'t Have Enough Crystals!');
} else if ($ir['brave'] == $ir['maxbrave']) {
Error('You Already Have Full Brave.');
} else {
$db->query(sprintf("UPDATE users SET brave=maxbrave, crystals=crystals-%d WHERE userid=%d", $Config['BraveRefill'], $userid));
echo sprintf("You Have Paid %d Crystals To Refill Your Brave Bar.", number_format($Config['BraveRefill']));
}
{$h->endpage();
?>
This is the error I get: syntax error, unexpected $end in /home/deadlyg1/public_html/crystaltemple.php on line 43