-
Notifications
You must be signed in to change notification settings - Fork 19
/
chess_statistics.php
138 lines (108 loc) · 3.99 KB
/
chess_statistics.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
////////////////////////////////////////////////////////////////////////////
//
// (c) phpChess Limited, 2004-2006, in association with Goliath Systems.
// All rights reserved. Please observe respective copyrights.
// phpChess - Chess at its best
// you can find us at http://www.phpchess.com.
//
////////////////////////////////////////////////////////////////////////////
define('CHECK_PHPCHESS', true);
$host = $_SERVER['HTTP_HOST'];
$self = $_SERVER['PHP_SELF'];
$query = !empty($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : null;
$url = !empty($query) ? "http://$host$self?$query" : "http://$host$self";
header("Content-Type: text/html; charset=utf-8");
session_start();
ob_start();
$isappinstalled = 0;
include("./includes/install_check.php");
if($isappinstalled == 0){
header("Location: ./not_installed.php");
}
// This is the vairable that sets the root path of the website
$Root_Path = "./";
$config = $Root_Path."bin/config.php";
$Contentpage = "cell_chess_statistics.php";
require($Root_Path."bin/CSkins.php");
//Instantiate the CSkins Class
$oSkins = new CSkins($config);
$SkinName = $oSkins->getskinname();
$oSkins->Close();
unset($oSkins);
//////////////////////////////////////////////////////////////
//Skin - standard includes
//////////////////////////////////////////////////////////////
$SSIfile = "./skins/".$SkinName."/standard_cfg.php";
if(file_exists($SSIfile)){
include($SSIfile);
}
//////////////////////////////////////////////////////////////
require($Root_Path."bin/CR3DCQuery.php");
require($Root_Path."bin/CTipOfTheDay.php");
include_once($Root_Path."bin/CAvatars.php");
require($Root_Path."includes/siteconfig.php");
require($Root_Path."includes/language.php");
//////////////////////////////////////////////////////////////
//Instantiate the Classes
$oR3DCQuery = new CR3DCQuery($config);
$oAvatars = new CAvatars($config);
$bCronEnabled = $oR3DCQuery->IsCronManagementEnabled();
//////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
//Check if the logged in user has access
if(!isset($_SESSION['sid']) && !isset($_SESSION['user']) && !isset($_SESSION['id']) ){
$_SESSION['PageRef'] = $url;
header('Location: ./chess_login.php');
}else{
$oR3DCQuery->CheckSIDTimeout();
if($oR3DCQuery->CheckLogin($config, $_SESSION['sid']) == false){
$_SESSION['PageRef'] = $url;
header('Location: ./chess_login.php');
}else{
$_SESSION['PageRef'] = "";
$oR3DCQuery->UpdateSIDTimeout($ConfigFile, $_SESSION['sid']);
$oR3DCQuery->SetPlayerCreditsInit($_SESSION['id']);
}
if(!$bCronEnabled){
if($oR3DCQuery->ELOIsActive()){
$oR3DCQuery->ELOCreateRatings();
}
$oR3DCQuery->MangeGameTimeOuts();
}
}
///////////////////////////////////////////////////////////////////////
$pid = trim($_GET['playerid']);
$name = trim($_GET['name']);
if($pid != ""){
$playerid = $pid;
}else{
$playerid = $_SESSION['id'];
}
?>
<html>
<head>
<title><?php echo GetStringFromStringTable("IDS_PAGETITLES_21", $config);?></title>
<META NAME="keywords" CONTENT="">
<META NAME="DESCRIPTION" CONTENT="">
<META NAME="OWNER" CONTENT="Christian">
<META NAME="RATING" CONTENT="General">
<META NAME="ROBOTS" CONTENT="index,follow">
<META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="English">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="<?php echo $Root_Path."skins/".$SkinName."/";?>layout.css" type="text/css">
<?php include($Root_Path."includes/javascript.php");?>
</head>
<body>
<?php include("./skins/".$SkinName."/layout_cfg.php");?>
</body>
</html>
<?php
//////////////////////////////////////////////////////////////
$oR3DCQuery->Close();
$oAvatars->Close();
unset($oR3DCQuery);
unset($oAvatars);
//////////////////////////////////////////////////////////////
ob_end_flush();
?>