-
Notifications
You must be signed in to change notification settings - Fork 56
/
footer.php
142 lines (134 loc) · 5.78 KB
/
footer.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
//hide undefined variables in some cases (some errorpages for ex.)
if (!isset($debug))
error_reporting('E_NONE'); // fuck this, we need a real fix
// level 1 debug prints total queries,
// so we would have to close these, or we can't have debug output
if($debug)
{
if (isset($sql))
$sql->close();
if (isset($sqlr))
$sqlr->close();
if (isset($sqlc))
$sqlc->close();
if (isset($sqlm))
$sqlm->close();
if (isset($sqlw))
$sqlw->close();
// level 3 debug lists all global vars, but can't read classes
// level 4 debug prints all global arrays, but can't print content of classes
// so we would have to close these, or we can't have debug output
if(2 < $debug)
{
unset($sql);
unset($sqlr);
unset($sqlc);
unset($sqlm);
unset($sqlw);
}
}
// we start with a lead of 10 spaces,
// because last line of header is an opening tag with 8 spaces
// so if the file before this follows the indent, we will be at the same place it starts
// keep html indent in sync, so debuging from browser source would be easy to read
$output .= '
<!-- start of footer.php -->
</div>
<div id="body_buttom">';
// show login and register button at bottom of every page if guest mode is activated
if($allow_anony && empty($_SESSION['logged_in']))
{
$lang_login = lang_login();
$output .= '
<center>
<table>
<tr>
<td>
<a class="button" style="width:130px;" href="register.php">Register</a>
<a class="button" style="width:130px;" href="login.php">Login</a>
</td>
</tr>
</table>
<br />
</center>';
unset($lang_login);
unset($allow_anony);
}
$output .= '
<table class="table_buttom">
<tr>
<td class="table_buttom_left"></td>
<td class="table_buttom_middle">';
$lang_footer = lang_footer();
$output .=
$lang_footer['bugs_to_admin'].'<a href="mailto:'.$admin_mail.'"> '.$lang_footer['site_admin'].'</a><br />';
unset($lang_footer);
unset($admin_mail);
$output .= sprintf('
Execute time: %.5f', (microtime(true) - $time_start));
unset($time_start);
// if any debug mode is activated, show memory usage
if($debug)
{
$output .= '
Queries: '.$tot_queries.' on '.$_SERVER['SERVER_SOFTWARE'];
unset($tot_queries);
if (function_exists('memory_get_usage'))
$output .= sprintf('
<br />Mem. Usage: %.0f/%.0fK Peek: %.0f/%.0fK Global: %.0fK Limit: %s',memory_get_usage()/1024, memory_get_usage(true)/1024,memory_get_peak_usage()/1024,memory_get_peak_usage(true)/1024,sizeof($GLOBALS),ini_get('memory_limit'));
}
// links at footer
$output .= '
<p>
<a href="http://www.trinitycore.org/" target="_blank"><img src="img/logo-trinity.png" class="logo_border" alt="trinity" /></a>
<a href="http://www.php.net/" target="_blank"><img src="img/logo-php.png" class="logo_border" alt="php" /></a>
<a href="http://www.mysql.com/" target="_blank"><img src="img/logo-mysql.png" class="logo_border" alt="mysql" /></a>
<a href="http://validator.w3.org/check?uri=referer" target="_blank"><img src="img/logo-css.png" class="logo_border" alt="w3" /></a>
<a href="http://www.spreadfirefox.com" target="_blank"><img src="img/logo-firefox.png" class="logo_border" alt="firefox" /></a>
<a href="http://www.opera.com/" target="_blank"><img src="img/logo-opera.png" class="logo_border" alt="opera" /></a>
</p>
</td>
<td class="table_buttom_right"></td>
</tr>
</table>
<br />';
echo $output;
unset($output);
// we need to close $output before we start debug mode 3 or higher
// we will get double output if we don't
if(2 < $debug)
{
echo '
<table>
<tr>
<td align="left">';
$arrayObj = new ArrayObject(get_defined_vars());
for($iterator = $arrayObj->getIterator(); $iterator->valid(); $iterator->next())
{
echo '
<br />'.$iterator->key() . ' => ' . $iterator->current();
}
unset($iterator);
unset($arrayObj);
// debug mode 3 lists all global vars and their values, but not for arrays
// debug mode 4 branches all arrays and their content,
if(3 < $debug)
{
echo '
<pre>';
print_r ($GLOBALS);
echo '
</pre>';
}
echo '
</td>
</tr>
<table>';
}
?>
</div>
</div>
</center>
</body>
</html>