| 130 |
lars |
1 |
<?php
|
|
|
2 |
date_default_timezone_set( "Europe/Berlin" );
|
|
|
3 |
|
| 117 |
lars |
4 |
if ( isset($_GET["XDEBUG_PROFILE"]) )
|
|
|
5 |
{
|
|
|
6 |
setcookie( "XDEBUG_PROFILE", $_GET["XDEBUG_PROFILE"] );
|
|
|
7 |
}
|
| 114 |
lars |
8 |
if ( !file_exists("include/config.xml") )
|
|
|
9 |
{
|
|
|
10 |
header( "Location: install.php" );
|
|
|
11 |
}
|
|
|
12 |
//Smarty
|
|
|
13 |
require_once ( "libs/Smarty.class.php" );
|
|
|
14 |
$smarty = new Smarty;
|
|
|
15 |
$smarty->use_sub_dirs = true;
|
|
|
16 |
$smarty->assign( "display_result", false );
|
|
|
17 |
$smarty->assign( "error", false );
|
|
|
18 |
$smarty->assign( "save", false );
|
|
|
19 |
$smarty->assign( "upd", false );
|
|
|
20 |
$smarty->assign( "meld", "" );
|
|
|
21 |
$smarty->assign( "h1", "" );
|
|
|
22 |
$smarty->assign( "mode", "" );
|
|
|
23 |
$smarty->assign( "db_meld", "" );
|
|
|
24 |
$smarty->assign( "u_type", 0 );
|
|
|
25 |
$smarty->assign( "id", 0 );
|
|
|
26 |
$smarty->assign( "u_name", "" );
|
|
|
27 |
$smarty->assign( "disabled2", "" );
|
|
|
28 |
function smarty_block_dynamic( $param, $content, &$smarty )
|
|
|
29 |
{
|
|
|
30 |
return $content;
|
|
|
31 |
}
|
|
|
32 |
$smarty->register_block( 'dynamic', 'smarty_block_dynamic', false );
|
| 98 |
lars |
33 |
|
| 114 |
lars |
34 |
//DB Connection
|
|
|
35 |
require_once ( "connect.php" );
|
| 64 |
lars |
36 |
|
| 114 |
lars |
37 |
//PEAR Packages
|
|
|
38 |
require_once ( "Text/Password.php" );
|
|
|
39 |
require_once ( "I18Nv2.php" );
|
|
|
40 |
require_once ( "Auth.php" );
|
|
|
41 |
require_once ( "Mail.php" );
|
|
|
42 |
require_once ( "Translation2.php" );
|
|
|
43 |
require_once ( "Log.php" );
|
| 64 |
lars |
44 |
|
| 114 |
lars |
45 |
$params_tr["strings_default_table"] = "i18n_%s";
|
|
|
46 |
$params_tr["string_text_col"] = "string";
|
|
|
47 |
$tr = &Translation2::factory( "db", $db, $params_tr );
|
| 64 |
lars |
48 |
|
| 114 |
lars |
49 |
$mail = &Mail::factory( "mail", array() );
|
| 98 |
lars |
50 |
|
| 114 |
lars |
51 |
//
|
|
|
52 |
require_once ( "user.class.php" );
|
|
|
53 |
require_once ( "config.php" );
|
|
|
54 |
$config = new Conf();
|
|
|
55 |
$year = $config->year;
|
|
|
56 |
$loc = &I18Nv2::createLocale( "en_US" );
|
|
|
57 |
require_once ( "functions.php" );
|
|
|
58 |
//
|
|
|
59 |
require_once ( "spiele.php" );
|
|
|
60 |
require_once ( "teams.php" );
|
|
|
61 |
require_once ( "orte.php" );
|
|
|
62 |
require_once ( "gruppen.php" );
|
|
|
63 |
require_once ( "types.php" );
|
| 16 |
lars |
64 |
|
| 114 |
lars |
65 |
//$l_g=new spiele(2*$config->groups*$config->teams_per_group);
|
|
|
66 |
$l_g = new spiele( $config->game_count );
|
|
|
67 |
if ( $l_g->g_g1 != $l_g->g_g2 )
|
|
|
68 |
{
|
|
|
69 |
define( "FINISHED", true );
|
|
|
70 |
$smarty->assign( "display_result", true );
|
|
|
71 |
$smarty->assign( "FINISHED", true );
|
|
|
72 |
$smarty->assign( "disabled2", "disabled=\"disabled\"" );
|
|
|
73 |
}
|
|
|
74 |
$smarty->assign( "version", $config->version );
|
|
|
75 |
if ( $config->logo )
|
|
|
76 |
{
|
|
|
77 |
$smarty->assign( "logo", "images/$config->logo" );
|
|
|
78 |
}
|
|
|
79 |
$max_anz = $config->max_anz;
|
|
|
80 |
$u = new User( "", "" );
|
|
|
81 |
$tr = &$tr->getDecorator( 'Lang' );
|
|
|
82 |
$tr->setOption( 'fallbackLang', 'en' );
|
|
|
83 |
$tr->setPageID( "common" );
|
|
|
84 |
$tr->setLang( $u->u_lang );
|
|
|
85 |
$common = $tr->getPage();
|
|
|
86 |
foreach ( $common as $key => $value )
|
|
|
87 |
{
|
|
|
88 |
$smarty->assign( strtoupper("L_$key"), $value );
|
|
|
89 |
}
|
|
|
90 |
if ( !defined("IN_ADMIN") )
|
|
|
91 |
{
|
|
|
92 |
$show = false;
|
|
|
93 |
}
|
|
|
94 |
else
|
|
|
95 |
{
|
|
|
96 |
$show = true;
|
|
|
97 |
}
|
|
|
98 |
$type = $common["$config->type"];
|
|
|
99 |
$f = sprintf( $common["finished"], $type );
|
|
|
100 |
$smarty->assign( "L_FINISHED", $f );
|
|
|
101 |
$a = user_login( $show );
|
|
|
102 |
if ( $a->getUserName() )
|
|
|
103 |
{
|
|
|
104 |
$u = $u->UserData( $a->getUserName() );
|
|
|
105 |
}
|
|
|
106 |
$u_loc = ( $u->u_lang == "de" ) ? "de_DE" : "en_US";
|
|
|
107 |
$tr->setPageID( "common" );
|
|
|
108 |
$tr->setLang( $u->u_lang );
|
|
|
109 |
$common = $tr->getPage();
|
|
|
110 |
$type = $common["$config->type"];
|
|
|
111 |
foreach ( $common as $key => $value )
|
|
|
112 |
{
|
|
|
113 |
$smarty->assign( strtoupper("L_$key"), $value );
|
|
|
114 |
}
|
|
|
115 |
$loc = &I18Nv2::createLocale( "$u_loc" );
|
|
|
116 |
$date = $loc->formatDateTime( time() );
|
|
|
117 |
$smarty->assign( "date", $date );
|
|
|
118 |
$smarty->assign( "year", $year );
|
|
|
119 |
$smarty->assign( "L_TYPE", $type );
|
|
|
120 |
$logger = create_logger();
|
| 3 |
lars |
121 |
?>
|