Subversion-Projekte lars-tiefland.em_wm

Revision

Revision 94 | Revision 99 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

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