1 | <?php
|
---|
2 |
|
---|
3 |
|
---|
4 | // level 1 debug prints total queries,
|
---|
5 | // so we would have to close these, or we can't have debug output
|
---|
6 | if($debug)
|
---|
7 | {
|
---|
8 | if (isset($sql))
|
---|
9 | $sql->close();
|
---|
10 | if (isset($sqlr))
|
---|
11 | $sqlr->close();
|
---|
12 | if (isset($sqlc))
|
---|
13 | $sqlc->close();
|
---|
14 | if (isset($sqlm))
|
---|
15 | $sqlm->close();
|
---|
16 | if (isset($sqlw))
|
---|
17 | $sqlw->close();
|
---|
18 |
|
---|
19 | // level 3 debug lists all global vars, but can't read classes
|
---|
20 | // level 4 debug prints all global arrays, but can't print content of classes
|
---|
21 | // so we would have to close these, or we can't have debug output
|
---|
22 | if(2 < $debug)
|
---|
23 | {
|
---|
24 | unset($sql);
|
---|
25 | unset($sqlr);
|
---|
26 | unset($sqlc);
|
---|
27 | unset($sqlm);
|
---|
28 | unset($sqlw);
|
---|
29 | }
|
---|
30 | }
|
---|
31 |
|
---|
32 | // we start with a lead of 10 spaces,
|
---|
33 | // because last line of header is an opening tag with 8 spaces
|
---|
34 | // so if the file before this follows the indent, we will be at the same place it starts
|
---|
35 | // keep html indent in sync, so debuging from browser source would be easy to read
|
---|
36 | $output .= '
|
---|
37 | <!-- start of footer.php -->
|
---|
38 | </div>
|
---|
39 | <div id="body_buttom">';
|
---|
40 | // show login and register button at bottom of every page if guest mode is activated
|
---|
41 | if($allow_anony && empty($_SESSION['logged_in']))
|
---|
42 | {
|
---|
43 | $lang_login = lang_login();
|
---|
44 | $output .= '
|
---|
45 | <center>
|
---|
46 | <table>
|
---|
47 | <tr>
|
---|
48 | <td>
|
---|
49 | <a class="button" style="width:130px;" href="register.php">Register</a>
|
---|
50 | <a class="button" style="width:130px;" href="login.php">Login</a>
|
---|
51 | </td>
|
---|
52 | </tr>
|
---|
53 | </table>
|
---|
54 | <br />
|
---|
55 | </center>';
|
---|
56 | unset($lang_login);
|
---|
57 | unset($allow_anony);
|
---|
58 | }
|
---|
59 | $output .= '
|
---|
60 | <table class="table_buttom">
|
---|
61 | <tr>
|
---|
62 | <td class="table_buttom_left"></td>
|
---|
63 | <td class="table_buttom_middle">';
|
---|
64 | $lang_footer = lang_footer();
|
---|
65 | $output .=
|
---|
66 | $lang_footer['bugs_to_admin'].'<a href="mailto:'.$admin_mail.'"> '.$lang_footer['site_admin'].'</a><br />';
|
---|
67 | unset($lang_footer);
|
---|
68 | unset($admin_mail);
|
---|
69 | $output .= sprintf('
|
---|
70 | Execute time: %.5f', (microtime(true) - $time_start));
|
---|
71 | unset($time_start);
|
---|
72 |
|
---|
73 | // if any debug mode is activated, show memory usage
|
---|
74 | if($debug)
|
---|
75 | {
|
---|
76 | $output .= '
|
---|
77 | Queries: '.$tot_queries.' on '.$_SERVER['SERVER_SOFTWARE'];
|
---|
78 | unset($tot_queries);
|
---|
79 | if (function_exists('memory_get_usage'))
|
---|
80 | $output .= sprintf('
|
---|
81 | <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'));
|
---|
82 | }
|
---|
83 |
|
---|
84 | // links at footer
|
---|
85 | $output .= '
|
---|
86 | <p>';
|
---|
87 | if ($server_type)
|
---|
88 | $output .= '
|
---|
89 | <a href="http://www.trinitycore.org/" target="_blank"><img src="img/logo-trinity.png" class="logo_border" alt="trinity" /></a>';
|
---|
90 | else
|
---|
91 | $output .= '
|
---|
92 | <a href="http://getmangos.com/" target="_blank"><img src="img/logo-mangos.png" class="logo_border" alt="mangos" /></a>';
|
---|
93 | unset($server_type);
|
---|
94 | $output .= '
|
---|
95 | <a href="http://www.php.net/" target="_blank"><img src="img/logo-php.png" class="logo_border" alt="php" /></a>
|
---|
96 | <a href="http://www.mysql.com/" target="_blank"><img src="img/logo-mysql.png" class="logo_border" alt="mysql" /></a>
|
---|
97 | <a href="http://validator.w3.org/check?uri=referer" target="_blank"><img src="img/logo-css.png" class="logo_border" alt="w3" /></a>
|
---|
98 | <a href="http://www.spreadfirefox.com" target="_blank"><img src="img/logo-firefox.png" class="logo_border" alt="firefox" /></a>
|
---|
99 | <a href="http://www.opera.com/" target="_blank"><img src="img/logo-opera.png" class="logo_border" alt="opera" /></a>
|
---|
100 | </p>
|
---|
101 | </td>
|
---|
102 | <td class="table_buttom_right"></td>
|
---|
103 | </tr>
|
---|
104 | </table>
|
---|
105 | <br />';
|
---|
106 | echo $output;
|
---|
107 | unset($output);
|
---|
108 | // we need to close $output before we start debug mode 3 or higher
|
---|
109 | // we will get double output if we don't
|
---|
110 | if(2 < $debug)
|
---|
111 | {
|
---|
112 | echo '
|
---|
113 | <table>
|
---|
114 | <tr>
|
---|
115 | <td align="left">';
|
---|
116 | $arrayObj = new ArrayObject(get_defined_vars());
|
---|
117 | for($iterator = $arrayObj->getIterator(); $iterator->valid(); $iterator->next())
|
---|
118 | {
|
---|
119 | echo '
|
---|
120 | <br />'.$iterator->key() . ' => ' . $iterator->current();
|
---|
121 | }
|
---|
122 | unset($iterator);
|
---|
123 | unset($arrayObj);
|
---|
124 | // debug mode 3 lists all global vars and their values, but not for arrays
|
---|
125 | // debug mode 4 branches all arrays and their content,
|
---|
126 | if(3 < $debug)
|
---|
127 | {
|
---|
128 | echo '
|
---|
129 | <pre>';
|
---|
130 | print_r ($GLOBALS);
|
---|
131 | echo '
|
---|
132 | </pre>';
|
---|
133 | }
|
---|
134 | echo '
|
---|
135 | </td>
|
---|
136 | </tr>
|
---|
137 | <table>';
|
---|
138 | }
|
---|
139 |
|
---|
140 | ?>
|
---|
141 |
|
---|
142 | </div>
|
---|
143 | </div>
|
---|
144 | </center>
|
---|
145 | </body>
|
---|
146 | </html>
|
---|