Subversion-Projekte lars-tiefland.em_wm

Revision

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