-
Notifications
You must be signed in to change notification settings - Fork 35
/
converter.php
58 lines (48 loc) · 1.7 KB
/
converter.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
<?php
define('INSIDE', true);
$_DontCheckPolls = TRUE;
$_DontShowMenus = true;
$_DontShowRulesBox = true;
$_AllowInVacationMode = true;
$_EnginePath = './';
include($_EnginePath.'common.php');
loggedCheck();
$Title = $_Lang['BattleConverter_title'];
$ReportID = (isset($_GET['id']) ? floor(floatval(trim($_GET['id']))) : 0);
if($ReportID > 0)
{
$Report = doquery("SELECT * FROM {{table}} WHERE `ID` = {$ReportID};", 'battle_reports', true);
if($Report)
{
$Owners = array_merge(explode(',', $Report['id_owner1']), explode(',', $Report['id_owner2']));
if(in_array($_User['id'], $Owners))
{
includeLang('converter');
include_once($_EnginePath.'includes/functions/ConvertBattleReport.php');
$_Lang['Title'] = $_Lang['BattleConverter_title'];
$Settings = array
(
'colorTheme' => (isset($_POST['colorTheme']) && $_POST['colorTheme'] == '2' ? 2 : 1),
'colorArray' => null
);
$Settings['colorArray'] = $_Lang['Conv_Colors'][$Settings['colorTheme']];
$_Lang['Set_ColorTheme_'.$Settings['colorTheme'].'_Check'] = 'selected';
$_Lang['ReportCode'] = ConvertBattleReport($Report, $Settings);
$Page = parsetemplate(gettemplate('converter'), $_Lang);
}
else
{
message("<b class=\"red\">{$_Lang['BattleReportConverter_CannotConvert']}</b>", $Title);
}
}
else
{
message("<b class=\"red\">{$_Lang['BattleReport_DoesntExist']}</b>", $Title);
}
}
else
{
message("<b class=\"red\">{$_Lang['BattleReport_NoIDGiven']}</b>", $Title);
}
display($Page, $_Lang['BattleConverter_title'], false);
?>