Cant select database!
online_shop.php
PHP Code:
<?php
header("refresh:10;url=./index.php"); //auskommentieren falls Funktion benötigt wird
session_start();
$file = 'online_shop';
include "config/config.php";
include "styles/style.php";
include "core/plugin.php";
include 'core/functions.php';
include 'core/classes.php';
include 'core/post_check.php';
include "core/core.php";
$tpl->assignGlobal("page_title", "Cash Market");
if( $User->LoggedIn == true )
{
$mode = "";
if(isset($_GET['mode'])) $mode=$_GET['mode'];
$Ctrl = new statpts();
$uid = $User->ID;
$userid = $uid;
$tpl->newBlock('online_shop');
$cashvalue = sprintf("SELECT cash FROM %s.bg_user WHERE user_code=$userid", $CMS_LCAuth);
$query = mysql_query($cashvalue);
$mycash = 'Error';
if($row = mysql_fetch_assoc($query))
{
$mycash = $row['cash'];
}
$tpl->Assign('mycash' , $mycash);
if($mycash != "Error")
{
if($mode == "specialname")
{
$charnames = array();
$valuenum = "";
$command = sprintf("SELECT a_nick FROM %s.t_characters WHERE a_user_index=$userid", $CMS_LCDb);
$query = mysql_query($command);
while($row = mysql_fetch_assoc($query))
{
$charnames[] = $row['a_nick'];
}
$result = count($charnames);
$radiochar = '<u>Please select a character:<br></u>';
for($forloop=0;$forloop<$result;$forloop++)
{
$checked = "";
if($forloop=="0")$checked = " checked";
$radiochar .= '<input type="radio" name="charname" value="'.$charnames[$forloop].'"'.$checked.'>'.$charnames[$forloop].'<br>';
}
$tpl->newBlock('specialname');
$tpl->Assign('radiochar', $radiochar);
}
else if($mode == "specialnameextended")
{
$charnames = array();
$valuenum = "";
$command = sprintf("SELECT a_nick FROM %s.t_characters WHERE a_user_index=$userid", $CMS_LCDb);
$query = mysql_query($command);
while($row = mysql_fetch_assoc($query))
{
$charnames[] = $row['a_nick'];
}
$result = count($charnames);
$radiochar = '<u>Please select a character:<br></u>';
for($forloop=0;$forloop<$result;$forloop++)
{
$checked = "";
if($forloop=="0")$checked = " checked";
$radiochar .= '<input type="radio" name="charname" value="'.$charnames[$forloop].'"'.$checked.'>'.$charnames[$forloop].'<br>';
}
$tpl->newBlock('specialnameextended');
$tpl->Assign('radiochar', $radiochar);
}
else if($mode == "buysn")
{
$toadd = '';
if(isset($_POST["submitbutt1"])) $toadd = '£É';
if(isset($_POST["submitbutt2"])) $toadd = '£Æ';
if(isset($_POST["submitbutt3"])) $toadd = '£Ç';
if(isset($_POST["submitbutt4"])) $toadd = '£Ê';
if(isset($_POST["submitbutt5"])) $toadd = '£Ë';
if(isset($_POST["submitbutt6"])) $toadd = '£Ì';
if(isset($_POST["submitbutt7"])) $toadd = '£Í';
if(isset($_POST["submitbutt8"])) $toadd = '£Î';
if(isset($_POST["submitbutt9"])) $toadd = '£Ï';
if(isset($_POST["submitbutt10"])) $toadd = '£Ð';
if(isset($_POST["submitbutt11"])) $toadd = '£Ñ';
if(isset($_POST["submitbutt12"])) $toadd = '£Ò';
$charname = $_POST["charname"];
$charname2 = $charname;
if($_POST["pos"] == "ahead") $charname2 = $toadd.$charname;
else if($_POST["pos"] == "behinde") $charname2 = $charname.$toadd;
else $charname2 = $charname.$toadd;
$newcash = $mycash - 5000;
if($newcash >= 0)
{
try
{
$cashvalue = sprintf("SELECT count(*) FROM %s.t_users WHERE a_portal_index=$userid AND a_zone_num>=0", $CMS_LCAct);
$query = mysql_query($cashvalue);
$count = mysql_result($query,0);
if($count == 0)
{
$cashvalue = sprintf("UPDATE %s.bg_user SET cash=$newcash WHERE user_code=$userid", $CMS_LCAuth);
$query = mysql_query($cashvalue);
$command = sprintf("UPDATE %s.t_characters SET a_nick='$charname2' WHERE a_nick='$charname'", $CMS_LCDb);
$query = mysql_query($command);
$tpl->newBlock('success');
$tpl->Assign('msg', 'You can now login ingame, thanks.<br>You will redirect in 10 seconds.');
header("refresh:10;url=./index.php");
}
else
{
$tpl->newBlock('error');
$tpl->Assign('msg', 'Please logout ingame first.<br>You will redirect in 5 seconds.');
header("refresh:5;url=./online_shop.php");
}
}
catch(Exception $e)
{
$tpl->newBlock('error');
$tpl->Assign('msg', 'Unknown error, please try again.<br>You will redirect in 5 seconds.');
header("refresh:5;url=./online_shop.php");
}
}
else
{
$tpl->newBlock('error');
$tpl->Assign('msg', 'Not enough cash.<br>You will redirect in 5 seconds.');
header("refresh:5;url=./donate.php");
}
}
else if($mode == "buysne")
{
$toadd = '';
if(isset($_POST["submitbutt1"])) $toadd = '£Á';
if(isset($_POST["submitbutt2"])) $toadd = '£Â';
if(isset($_POST["submitbutt3"])) $toadd = '£Ó';
if(isset($_POST["submitbutt4"])) $toadd = '£Õ';
if(isset($_POST["submitbutt5"])) $toadd = '£Õ';
if(isset($_POST["submitbutt6"])) $toadd = '£×';
if(isset($_POST["submitbutt7"])) $toadd = '£Ø';
$charname = $_POST["charname"];
$charname2 = $charname;
if($_POST["pos"] == "ahead") $charname2 = $toadd.$charname;
else if($_POST["pos"] == "behinde") $charname2 = $charname.$toadd;
else $charname2 = $charname.$toadd;
$newcash = $mycash - 10000;
if($newcash >= 0)
{
try
{
$cashvalue = sprintf("SELECT count(*) FROM %s.t_users WHERE a_portal_index=$userid AND a_zone_num>=0", $CMS_LCAct);
$query = mysql_query($cashvalue);
$count = mysql_result($query,0);
if($count == 0)
{
$cashvalue = sprintf("UPDATE %s.bg_user SET cash=$newcash WHERE user_code=$userid", $CMS_LCAuth);
$query = mysql_query($cashvalue);
$command = sprintf("UPDATE %s.t_characters SET a_nick='$charname2' WHERE a_nick='$charname'", $CMS_LCDb);
$query = mysql_query($command);
$tpl->newBlock('success');
$tpl->Assign('msg', 'You can now login ingame, thanks.<br>You will redirect in 10 seconds.');
header("refresh:10;url=./index.php");
}
else
{
$tpl->newBlock('error');
$tpl->Assign('msg', 'Please logout ingame first.<br>You will redirect in 5 seconds.');
header("refresh:5;url=./online_shop.php");
}
}
catch(Exception $e)
{
$tpl->newBlock('error');
$tpl->Assign('msg', 'Unknown error, please try again.<br>You will redirect in 5 seconds.');
header("refresh:5;url=./online_shop.php");
}
}
else
{
$tpl->newBlock('error');
$tpl->Assign('msg', 'Not enough cash.<br>You will redirect in 5 seconds.');
header("refresh:5;url=./donate.php");
}
}
else
{
$tpl->newBlock('my_shop');
}
}
else
{
$tpl->newBlock('error');
$tpl->Assign('msg', 'Cant select database!');
}
}
else
{
$tpl->newBlock('error');
$tpl->Assign('msg', 'Please Login!');
}
$tpl->printToScreen();
credit($_SESSION['LicencedVervion'],$_SESSION['LicencedOwner']);
include 'styles/'.$style.'/tpl/extras/footer.php';
?>
PHP Code:
<?php
//GM Guild Name (hides from ranks)
$gm_guild = "GameMaster";
// Footer Registered To Info
$_SESSION['LicencedOwner'] = "LastChaos";
$_SESSION['LicencedHost'] = "#";
// Mysql IP
$dbhash["cms_lc_host"] = 'localhost'; // dns or ip
// Mysql Login
$dbhash["cms_lc_username"] = 'root'; // Mysql username
$dbhash["cms_lc_password"] = ''; // Mysql password
// Mysql Databases
$dbhash["cms_lc_auth"] = "auth"; // auth database
$dbhash["cms_lc_db"] = "db"; // db database
$dbhash["cms_lc_data"] = "data"; // data database
$dbhash["cms_lc_site"] = "seite"; // Website Database Name
$dbhash["cms_lc_authORdb"] = "auth"; // t_users
// Status page settings
$ptime = "3"; // Timeout limit
$Lip = "213.136.89.159"; // Login IP
$Lport = "4001"; // Login Port
$Bip = "127.0.0.1"; // Billing IP
$Bport = "8888"; // Billing Port
$G1ip = "213.136.89.159"; // GS1 IP
$G1port = "4101"; //GS1 Port
$G2ip = "213.136.89.159"; // GS2 IP
$G2port = "4201"; //GS2 Port
$G3ip = "213.136.89.159"; // GS3 IP
$G3port = "4301"; //GS3 Port
$G4ip = "213.136.89.159"; // GS4 IP
$G4port = "4401"; //GS4 Port
$G5ip = "213.136.89.159"; // GS5 IP
$G5port = "4501"; //GS5 Port
$G6ip = "213.136.89.159"; // GS6 IP
$G6port = "4601"; //GS6 Port
// FOR EVENTS ADDS % CASH
// Say you run a cash event so when someone donates you give them 30% more cash you put 30 in below
$BonusCash = "0";
/* SMTP Server PHP Support
set to yes if your php supports smtp. Set to no if you get smtp error when registering. */
$Allow_Email_sending = 'no'; // no or yes
// IMPORTANT :
// Never share this salt with anyone!
//(you should change this to match your server if running ep2!!)
$config["Salt"] = 'phoohie1yaihooyaequae7PuiWoeNgahjieth3ru3yeeghaepahb7aeYaipe2we6zii6mai6uweig8siasheinoungeoyeiLohShi2xoh2xi8ooxee9ahpiehahc9Phe';
// Your Time Zone
// List of Supported Timezones
// http://php.net/manual/en/timezones.php
date_default_timezone_set('Europe/Berlin');
// RegisterGroup
// Set the Group which is user become by registration
// Change if you want start with other group
$registergroup = '2';
?>