Subversion-Projekte lars-tiefland.em_wm

Revision

Revision 94 | Revision 99 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

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