@@ -244,7 +244,7 @@ |
||
244 | 244 | // SMF itself |
245 | 245 | echo ' |
246 | 246 | <div class="cat_bar"> |
247 | - <h3 class="catbg">', $txt['credits_forum'],' ', $txt['credits_copyright'], '</h3> |
|
247 | + <h3 class="catbg">', $txt['credits_forum'], ' ', $txt['credits_copyright'], '</h3> |
|
248 | 248 | </div> |
249 | 249 | <div class="windowbg noup"> |
250 | 250 | ', $context['copyrights']['smf'], ' |
@@ -31,9 +31,10 @@ discard block |
||
31 | 31 | <div class="selectbox floatright" id="upper_show">', $txt['who_show1'], ' |
32 | 32 | <select name="show_top" onchange="document.forms.whoFilter.show.value = this.value; document.forms.whoFilter.submit();">'; |
33 | 33 | |
34 | - foreach ($context['show_methods'] as $value => $label) |
|
35 | - echo ' |
|
34 | + foreach ($context['show_methods'] as $value => $label) { |
|
35 | + echo ' |
|
36 | 36 | <option value="', $value, '" ', $value == $context['show_by'] ? ' selected' : '', '>', $label, '</option>'; |
37 | + } |
|
37 | 38 | echo ' |
38 | 39 | </select> |
39 | 40 | <noscript> |
@@ -71,9 +72,10 @@ discard block |
||
71 | 72 | ', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt['profile_of'] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] . '"') . '>' . $member['name'] . '</a>', ' |
72 | 73 | </span>'; |
73 | 74 | |
74 | - if (!empty($member['ip'])) |
|
75 | - echo ' |
|
75 | + if (!empty($member['ip'])) { |
|
76 | + echo ' |
|
76 | 77 | (<a href="' . $scripturl . '?action=', ($member['is_guest'] ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $member['id']), ';searchip=' . $member['ip'] . '">' . $member['ip'] . '</a>)'; |
78 | + } |
|
77 | 79 | |
78 | 80 | echo ' |
79 | 81 | </td> |
@@ -103,9 +105,10 @@ discard block |
||
103 | 105 | <div class="selectbox floatright">', $txt['who_show1'], ' |
104 | 106 | <select name="show" onchange="document.forms.whoFilter.submit();">'; |
105 | 107 | |
106 | - foreach ($context['show_methods'] as $value => $label) |
|
107 | - echo ' |
|
108 | + foreach ($context['show_methods'] as $value => $label) { |
|
109 | + echo ' |
|
108 | 110 | <option value="', $value, '" ', $value == $context['show_by'] ? ' selected' : '', '>', $label, '</option>'; |
111 | + } |
|
109 | 112 | echo ' |
110 | 113 | </select> |
111 | 114 | <noscript> |
@@ -134,17 +137,19 @@ discard block |
||
134 | 137 | |
135 | 138 | foreach ($context['credits'] as $section) |
136 | 139 | { |
137 | - if (isset($section['pretext'])) |
|
138 | - echo ' |
|
140 | + if (isset($section['pretext'])) { |
|
141 | + echo ' |
|
139 | 142 | <div class="windowbg noup"> |
140 | 143 | <p>', $section['pretext'], '</p> |
141 | 144 | </div>'; |
145 | + } |
|
142 | 146 | |
143 | - if (isset($section['title'])) |
|
144 | - echo ' |
|
147 | + if (isset($section['title'])) { |
|
148 | + echo ' |
|
145 | 149 | <div class="cat_bar"> |
146 | 150 | <h3 class="catbg">', $section['title'], '</h3> |
147 | 151 | </div>'; |
152 | + } |
|
148 | 153 | |
149 | 154 | echo ' |
150 | 155 | <div class="windowbg2 noup"> |
@@ -152,17 +157,18 @@ discard block |
||
152 | 157 | |
153 | 158 | foreach ($section['groups'] as $group) |
154 | 159 | { |
155 | - if (isset($group['title'])) |
|
156 | - echo ' |
|
160 | + if (isset($group['title'])) { |
|
161 | + echo ' |
|
157 | 162 | <dt> |
158 | 163 | <strong>', $group['title'], '</strong> |
159 | 164 | </dt> |
160 | 165 | <dd>'; |
166 | + } |
|
161 | 167 | |
162 | 168 | // Try to make this read nicely. |
163 | - if (count($group['members']) <= 2) |
|
164 | - echo implode(' ' . $txt['credits_and'] . ' ', $group['members']); |
|
165 | - else |
|
169 | + if (count($group['members']) <= 2) { |
|
170 | + echo implode(' ' . $txt['credits_and'] . ' ', $group['members']); |
|
171 | + } else |
|
166 | 172 | { |
167 | 173 | $last_peep = array_pop($group['members']); |
168 | 174 | echo implode(', ', $group['members']), ' ', $txt['credits_and'], ' ', $last_peep; |
@@ -175,9 +181,10 @@ discard block |
||
175 | 181 | echo ' |
176 | 182 | </dl>'; |
177 | 183 | |
178 | - if (isset($section['posttext'])) |
|
179 | - echo ' |
|
184 | + if (isset($section['posttext'])) { |
|
185 | + echo ' |
|
180 | 186 | <p class="posttext">', $section['posttext'], '</p>'; |
187 | + } |
|
181 | 188 | |
182 | 189 | echo ' |
183 | 190 | </div>'; |
@@ -192,26 +199,29 @@ discard block |
||
192 | 199 | </div> |
193 | 200 | <div class="windowbg noup">'; |
194 | 201 | |
195 | - if (!empty($context['credits_software_graphics']['graphics'])) |
|
196 | - echo ' |
|
202 | + if (!empty($context['credits_software_graphics']['graphics'])) { |
|
203 | + echo ' |
|
197 | 204 | <dl> |
198 | 205 | <dt><strong>', $txt['credits_graphics'], '</strong></dt> |
199 | 206 | <dd>', implode('</dd><dd>', $context['credits_software_graphics']['graphics']), '</dd> |
200 | 207 | </dl>'; |
208 | + } |
|
201 | 209 | |
202 | - if (!empty($context['credits_software_graphics']['software'])) |
|
203 | - echo ' |
|
210 | + if (!empty($context['credits_software_graphics']['software'])) { |
|
211 | + echo ' |
|
204 | 212 | <dl> |
205 | 213 | <dt><strong>', $txt['credits_software'], '</strong></dt> |
206 | 214 | <dd>', implode('</dd><dd>', $context['credits_software_graphics']['software']), '</dd> |
207 | 215 | </dl>'; |
216 | + } |
|
208 | 217 | |
209 | - if (!empty($context['credits_software_graphics']['fonts'])) |
|
210 | - echo ' |
|
218 | + if (!empty($context['credits_software_graphics']['fonts'])) { |
|
219 | + echo ' |
|
211 | 220 | <dl> |
212 | 221 | <dt><strong>', $txt['credits_fonts'], '</strong></dt> |
213 | 222 | <dd>', implode('</dd><dd>', $context['credits_software_graphics']['fonts']), '</dd> |
214 | 223 | </dl>'; |
224 | + } |
|
215 | 225 | echo ' |
216 | 226 | </div>'; |
217 | 227 | } |
@@ -226,16 +236,18 @@ discard block |
||
226 | 236 | <div class="windowbg noup">'; |
227 | 237 | |
228 | 238 | // Display the credits. |
229 | - if (!empty($context['credits_modifications'])) |
|
230 | - echo ' |
|
239 | + if (!empty($context['credits_modifications'])) { |
|
240 | + echo ' |
|
231 | 241 | ', implode(' |
232 | 242 | <br>', $context['credits_modifications']); |
243 | + } |
|
233 | 244 | |
234 | 245 | // Legacy. |
235 | - if (!empty($context['copyrights']['mods'])) |
|
236 | - echo (empty($context['credits_modifications']) ? '<br>' : ''), |
|
246 | + if (!empty($context['copyrights']['mods'])) { |
|
247 | + echo (empty($context['credits_modifications']) ? '<br>' : ''), |
|
237 | 248 | implode(' |
238 | 249 | <br>', $context['copyrights']['mods']); |
250 | + } |
|
239 | 251 | |
240 | 252 | echo ' |
241 | 253 | </div>'; |
@@ -1,9 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
6 | -else |
|
6 | +} else { |
|
7 | 7 | exit; |
8 | +} |
|
8 | 9 | |
9 | 10 | ?> |
10 | 11 | \ No newline at end of file |
@@ -1,9 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Try to handle it with the upper level index.php. (it should know what to do.) |
4 | -if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) |
|
4 | +if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) { |
|
5 | 5 | include (dirname(dirname(__FILE__)) . '/index.php'); |
6 | -else |
|
6 | +} else { |
|
7 | 7 | exit; |
8 | +} |
|
8 | 9 | |
9 | 10 | ?> |
10 | 11 | \ No newline at end of file |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | <div class="windowbg2 noup"> |
27 | 27 | <dl class="settings"> |
28 | 28 | <dt> |
29 | - <a href="', $scripturl, '?action=helpadmin;help=search_weight_frequency" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a><label for="weight1_val"> |
|
29 | + <a href="', $scripturl, '?action=helpadmin;help=search_weight_frequency" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a><label for="weight1_val"> |
|
30 | 30 | ', $txt['search_weight_frequency'], ':</label> |
31 | 31 | </dt> |
32 | 32 | <dd> |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | <span id="weight1" class="search_weight">', $context['relative_weights']['search_weight_frequency'], '%</span> |
35 | 35 | </dd> |
36 | 36 | <dt> |
37 | - <a href="', $scripturl, '?action=helpadmin;help=search_weight_age" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a><label for="weight2_val"> |
|
37 | + <a href="', $scripturl, '?action=helpadmin;help=search_weight_age" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a><label for="weight2_val"> |
|
38 | 38 | ', $txt['search_weight_age'], ':</label> |
39 | 39 | </dt> |
40 | 40 | <dd> |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | <span id="weight2" class="search_weight">', $context['relative_weights']['search_weight_age'], '%</span> |
43 | 43 | </dd> |
44 | 44 | <dt> |
45 | - <a href="', $scripturl, '?action=helpadmin;help=search_weight_length" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a><label for="weight3_val"> |
|
45 | + <a href="', $scripturl, '?action=helpadmin;help=search_weight_length" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a><label for="weight3_val"> |
|
46 | 46 | ', $txt['search_weight_length'], ':</label> |
47 | 47 | </dt> |
48 | 48 | <dd> |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | <span id="weight3" class="search_weight">', $context['relative_weights']['search_weight_length'], '%</span> |
51 | 51 | </dd> |
52 | 52 | <dt> |
53 | - <a href="', $scripturl, '?action=helpadmin;help=search_weight_subject" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a><label for="weight4_val"> |
|
53 | + <a href="', $scripturl, '?action=helpadmin;help=search_weight_subject" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a><label for="weight4_val"> |
|
54 | 54 | ', $txt['search_weight_subject'], ':</label> |
55 | 55 | </dt> |
56 | 56 | <dd> |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | <span id="weight4" class="search_weight">', $context['relative_weights']['search_weight_subject'], '%</span> |
59 | 59 | </dd> |
60 | 60 | <dt> |
61 | - <a href="', $scripturl, '?action=helpadmin;help=search_weight_first_message" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a><label for="weight5_val"> |
|
61 | + <a href="', $scripturl, '?action=helpadmin;help=search_weight_first_message" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a><label for="weight5_val"> |
|
62 | 62 | ', $txt['search_weight_first_message'], ':</label> |
63 | 63 | </dt> |
64 | 64 | <dd> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <span id="weight5" class="search_weight">', $context['relative_weights']['search_weight_first_message'], '%</span> |
67 | 67 | </dd> |
68 | 68 | <dt> |
69 | - <a href="', $scripturl, '?action=helpadmin;help=search_weight_sticky" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a><label for="weight6_val"> |
|
69 | + <a href="', $scripturl, '?action=helpadmin;help=search_weight_sticky" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a><label for="weight6_val"> |
|
70 | 70 | ', $txt['search_weight_sticky'], ':</label> |
71 | 71 | </dt> |
72 | 72 | <dd> |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | { |
141 | 141 | echo ' |
142 | 142 | <dt> |
143 | - <input type="radio" name="search_index" value="fulltext"', !empty($modSettings['search_index']) && $modSettings['search_index'] == 'fulltext' ? ' checked' : '', empty($context['fulltext_index']) ? ' onclick="alert(\'' . $txt['search_method_fulltext_warning'] . '\'); selectRadioByName(this.form.search_index, \'fulltext\');"': '', ' class="input_radio"> |
|
143 | + <input type="radio" name="search_index" value="fulltext"', !empty($modSettings['search_index']) && $modSettings['search_index'] == 'fulltext' ? ' checked' : '', empty($context['fulltext_index']) ? ' onclick="alert(\'' . $txt['search_method_fulltext_warning'] . '\'); selectRadioByName(this.form.search_index, \'fulltext\');"' : '', ' class="input_radio"> |
|
144 | 144 | ', $txt['search_method_fulltext_index'], ' |
145 | 145 | </dt> |
146 | 146 | <dd> |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | echo ' |
192 | 192 | <dt> |
193 | 193 | <input type="radio" name="search_index" value="', $api['setting_index'], '"', !empty($modSettings['search_index']) && $modSettings['search_index'] == $api['setting_index'] ? ' checked' : '', ' class="input_radio"> |
194 | - ', $api['label'] ,' |
|
194 | + ', $api['label'], ' |
|
195 | 195 | </dt>'; |
196 | 196 | |
197 | 197 | if ($api['desc']) |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | <div class="windowbg2 noup"> |
112 | 112 | <dl class="settings">'; |
113 | 113 | |
114 | - if (!empty($context['table_info'])) |
|
115 | - echo ' |
|
114 | + if (!empty($context['table_info'])) { |
|
115 | + echo ' |
|
116 | 116 | <dt> |
117 | 117 | <strong>', $txt['search_method_messages_table_space'], ':</strong> |
118 | 118 | </dt> |
@@ -125,6 +125,7 @@ discard block |
||
125 | 125 | <dd> |
126 | 126 | ', $context['table_info']['index_length'], ' |
127 | 127 | </dd>'; |
128 | + } |
|
128 | 129 | echo ' |
129 | 130 | </dl> |
130 | 131 | ', $context['double_index'] ? '<div class="noticebox"> |
@@ -146,16 +147,17 @@ discard block |
||
146 | 147 | <dd> |
147 | 148 | |
148 | 149 | <span class="smalltext">'; |
149 | - if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) |
|
150 | - echo ' |
|
150 | + if (empty($context['fulltext_index']) && empty($context['cannot_create_fulltext'])) { |
|
151 | + echo ' |
|
151 | 152 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createfulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_create'], '</a>]'; |
152 | - elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) |
|
153 | - echo ' |
|
153 | + } elseif (empty($context['fulltext_index']) && !empty($context['cannot_create_fulltext'])) { |
|
154 | + echo ' |
|
154 | 155 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_fulltext_cannot_create']; |
155 | - else |
|
156 | - echo ' |
|
156 | + } else { |
|
157 | + echo ' |
|
157 | 158 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removefulltext;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_method_fulltext_remove'], '</a>]<br> |
158 | 159 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['fulltext_length']; |
160 | + } |
|
159 | 161 | echo ' |
160 | 162 | </span> |
161 | 163 | </dd>'; |
@@ -168,25 +170,27 @@ discard block |
||
168 | 170 | </dt> |
169 | 171 | <dd> |
170 | 172 | <span class="smalltext">'; |
171 | - if ($context['custom_index']) |
|
172 | - echo ' |
|
173 | + if ($context['custom_index']) { |
|
174 | + echo ' |
|
173 | 175 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_already_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>]<br> |
174 | 176 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
175 | - elseif ($context['partial_custom_index']) |
|
176 | - echo ' |
|
177 | + } elseif ($context['partial_custom_index']) { |
|
178 | + echo ' |
|
177 | 179 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_index_partial'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=removecustom;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_remove'], '</a>] [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex;resume;', $context['session_var'], '=', $context['session_id'], ';', $context['admin-msm_token_var'], '=', $context['admin-msm_token'], '">', $txt['search_index_custom_resume'], '</a>]<br> |
178 | 180 | <strong>', $txt['search_index_size'], ':</strong> ', $context['table_info']['custom_index_length']; |
179 | - else |
|
180 | - echo ' |
|
181 | + } else { |
|
182 | + echo ' |
|
181 | 183 | <strong>', $txt['search_index_label'], ':</strong> ', $txt['search_method_no_index_exists'], ' [<a href="', $scripturl, '?action=admin;area=managesearch;sa=createmsgindex">', $txt['search_index_create_custom'], '</a>]'; |
184 | + } |
|
182 | 185 | echo ' |
183 | 186 | </span> |
184 | 187 | </dd>'; |
185 | 188 | |
186 | 189 | foreach ($context['search_apis'] as $api) |
187 | 190 | { |
188 | - if (empty($api['label']) || $api['has_template']) |
|
189 | - continue; |
|
191 | + if (empty($api['label']) || $api['has_template']) { |
|
192 | + continue; |
|
193 | + } |
|
190 | 194 | |
191 | 195 | echo ' |
192 | 196 | <dt> |
@@ -194,12 +198,13 @@ discard block |
||
194 | 198 | ', $api['label'] ,' |
195 | 199 | </dt>'; |
196 | 200 | |
197 | - if ($api['desc']) |
|
198 | - echo ' |
|
201 | + if ($api['desc']) { |
|
202 | + echo ' |
|
199 | 203 | <dd> |
200 | 204 | <span class="smalltext">', $api['desc'], '</span> |
201 | 205 | </dd>'; |
202 | 206 | } |
207 | + } |
|
203 | 208 | |
204 | 209 | echo ' |
205 | 210 | </dl> |
@@ -44,10 +44,11 @@ discard block |
||
44 | 44 | <dt>', $txt['users_online_today'], ':</dt> |
45 | 45 | <dd>', $context['online_today'], '</dd>'; |
46 | 46 | |
47 | - if (!empty($modSettings['hitStats'])) |
|
48 | - echo ' |
|
47 | + if (!empty($modSettings['hitStats'])) { |
|
48 | + echo ' |
|
49 | 49 | <dt>', $txt['num_hits'], ':</dt> |
50 | 50 | <dd>', $context['num_hits'], '</dd>'; |
51 | + } |
|
51 | 52 | |
52 | 53 | echo ' |
53 | 54 | </dl> |
@@ -71,17 +72,19 @@ discard block |
||
71 | 72 | <dt>', $txt['gender_stats'], ':</dt> |
72 | 73 | <dd>'; |
73 | 74 | |
74 | - foreach ($context['gender'] as $g => $n) |
|
75 | - echo $g, ': ', $n, '<br>'; |
|
75 | + foreach ($context['gender'] as $g => $n) { |
|
76 | + echo $g, ': ', $n, '<br>'; |
|
77 | + } |
|
76 | 78 | |
77 | 79 | echo ' |
78 | 80 | </dd>'; |
79 | 81 | } |
80 | 82 | |
81 | - if (!empty($modSettings['hitStats'])) |
|
82 | - echo ' |
|
83 | + if (!empty($modSettings['hitStats'])) { |
|
84 | + echo ' |
|
83 | 85 | <dt>', $txt['average_hits'], ':</dt> |
84 | 86 | <dd>', $context['average_hits'], '</dd>'; |
87 | + } |
|
85 | 88 | |
86 | 89 | echo ' |
87 | 90 | </dl>'; |
@@ -105,14 +108,15 @@ discard block |
||
105 | 108 | </dt> |
106 | 109 | <dd class="statsbar">'; |
107 | 110 | |
108 | - if (!empty($item['percent'])) |
|
109 | - echo ' |
|
111 | + if (!empty($item['percent'])) { |
|
112 | + echo ' |
|
110 | 113 | <div class="bar" style="width: ', $item['percent'], '%;"> |
111 | 114 | <span class="righttext">', $item['num'], '</span> |
112 | 115 | </div>'; |
113 | - else |
|
114 | - echo ' |
|
116 | + } else { |
|
117 | + echo ' |
|
115 | 118 | <div class="bar empty"><span class="righttext">', $item['num'], '</span></div>'; |
119 | + } |
|
116 | 120 | |
117 | 121 | echo ' |
118 | 122 | </dd>'; |
@@ -144,9 +148,10 @@ discard block |
||
144 | 148 | <th>', $txt['stats_new_members'], '</th> |
145 | 149 | <th>', $txt['most_online'], '</th>'; |
146 | 150 | |
147 | - if (!empty($modSettings['hitStats'])) |
|
148 | - echo ' |
|
151 | + if (!empty($modSettings['hitStats'])) { |
|
152 | + echo ' |
|
149 | 153 | <th>', $txt['page_views'], '</th>'; |
154 | + } |
|
150 | 155 | |
151 | 156 | echo ' |
152 | 157 | </tr> |
@@ -165,9 +170,10 @@ discard block |
||
165 | 170 | <th>', $year['new_members'], '</th> |
166 | 171 | <th>', $year['most_members_online'], '</th>'; |
167 | 172 | |
168 | - if (!empty($modSettings['hitStats'])) |
|
169 | - echo ' |
|
173 | + if (!empty($modSettings['hitStats'])) { |
|
174 | + echo ' |
|
170 | 175 | <th>', $year['hits'], '</th>'; |
176 | + } |
|
171 | 177 | |
172 | 178 | echo ' |
173 | 179 | </tr>'; |
@@ -184,9 +190,10 @@ discard block |
||
184 | 190 | <th>', $month['new_members'], '</th> |
185 | 191 | <th>', $month['most_members_online'], '</th>'; |
186 | 192 | |
187 | - if (!empty($modSettings['hitStats'])) |
|
188 | - echo ' |
|
193 | + if (!empty($modSettings['hitStats'])) { |
|
194 | + echo ' |
|
189 | 195 | <th>', $month['hits'], '</th>'; |
196 | + } |
|
190 | 197 | |
191 | 198 | echo ' |
192 | 199 | </tr>'; |
@@ -203,9 +210,10 @@ discard block |
||
203 | 210 | <td>', $day['new_members'], '</td> |
204 | 211 | <td>', $day['most_members_online'], '</td>'; |
205 | 212 | |
206 | - if (!empty($modSettings['hitStats'])) |
|
207 | - echo ' |
|
213 | + if (!empty($modSettings['hitStats'])) { |
|
214 | + echo ' |
|
208 | 215 | <td>', $day['hits'], '</td>'; |
216 | + } |
|
209 | 217 | |
210 | 218 | echo ' |
211 | 219 | </tr>'; |
@@ -41,37 +41,43 @@ discard block |
||
41 | 41 | define('TIME_START', microtime(true)); |
42 | 42 | |
43 | 43 | // Just being safe... |
44 | -foreach (array('db_character_set', 'cachedir') as $variable) |
|
44 | +foreach (array('db_character_set', 'cachedir') as $variable) { |
|
45 | 45 | if (isset($GLOBALS[$variable])) |
46 | 46 | unset($GLOBALS[$variable]); |
47 | +} |
|
47 | 48 | |
48 | 49 | // Get the forum's settings for database and file paths. |
49 | 50 | require_once(dirname(__FILE__) . '/Settings.php'); |
50 | 51 | |
51 | 52 | // Make absolutely sure the cache directory is defined. |
52 | -if ((empty($cachedir) || !file_exists($cachedir)) && file_exists($boarddir . '/cache')) |
|
53 | +if ((empty($cachedir) || !file_exists($cachedir)) && file_exists($boarddir . '/cache')) { |
|
53 | 54 | $cachedir = $boarddir . '/cache'; |
55 | +} |
|
54 | 56 | |
55 | 57 | // Don't do john didley if the forum's been shut down competely. |
56 | -if ($maintenance == 2) |
|
58 | +if ($maintenance == 2) { |
|
57 | 59 | die($mmessage); |
60 | +} |
|
58 | 61 | |
59 | 62 | // Fix for using the current directory as a path. |
60 | -if (substr($sourcedir, 0, 1) == '.' && substr($sourcedir, 1, 1) != '.') |
|
63 | +if (substr($sourcedir, 0, 1) == '.' && substr($sourcedir, 1, 1) != '.') { |
|
61 | 64 | $sourcedir = dirname(__FILE__) . substr($sourcedir, 1); |
65 | +} |
|
62 | 66 | |
63 | 67 | // Have we already turned this off? If so, exist gracefully. |
64 | -if (file_exists($cachedir . '/cron.lock')) |
|
68 | +if (file_exists($cachedir . '/cron.lock')) { |
|
65 | 69 | obExit_cron(); |
70 | +} |
|
66 | 71 | |
67 | 72 | // Before we go any further, if this is not a CLI request, we need to do some checking. |
68 | 73 | if (!FROM_CLI) |
69 | 74 | { |
70 | 75 | // We will clean up $_GET shortly. But we want to this ASAP. |
71 | 76 | $ts = isset($_GET['ts']) ? (int) $_GET['ts'] : 0; |
72 | - if ($ts <= 0 || $ts % 15 != 0 || time() - $ts < 0 || time() - $ts > 20) |
|
73 | - obExit_cron(); |
|
74 | -} |
|
77 | + if ($ts <= 0 || $ts % 15 != 0 || time() - $ts < 0 || time() - $ts > 20) { |
|
78 | + obExit_cron(); |
|
79 | + } |
|
80 | + } |
|
75 | 81 | |
76 | 82 | // Load the most important includes. In general, a background should be loading its own dependencies. |
77 | 83 | require_once($sourcedir . '/Errors.php'); |
@@ -123,8 +129,9 @@ discard block |
||
123 | 129 | global $smcFunc; |
124 | 130 | |
125 | 131 | // Check we haven't run over our time limit. |
126 | - if (microtime(true) - TIME_START > MAX_CRON_TIME) |
|
127 | - return false; |
|
132 | + if (microtime(true) - TIME_START > MAX_CRON_TIME) { |
|
133 | + return false; |
|
134 | + } |
|
128 | 135 | |
129 | 136 | // Try to find a task. Specifically, try to find one that hasn't been claimed previously, or failing that, |
130 | 137 | // a task that was claimed but failed for whatever reason and failed long enough ago. We should not care |
@@ -159,14 +166,12 @@ discard block |
||
159 | 166 | // Update the time and go back. |
160 | 167 | $row['claimed_time'] = time(); |
161 | 168 | return $row; |
162 | - } |
|
163 | - else |
|
169 | + } else |
|
164 | 170 | { |
165 | 171 | // Uh oh, we just missed it. Try to claim another one, and let it fall through if there aren't any. |
166 | 172 | return fetch_task(); |
167 | 173 | } |
168 | - } |
|
169 | - else |
|
174 | + } else |
|
170 | 175 | { |
171 | 176 | // No dice. Clean up and go home. |
172 | 177 | $smcFunc['db_free_result']($request); |
@@ -187,8 +192,9 @@ discard block |
||
187 | 192 | if (!empty($task_details['task_file'])) |
188 | 193 | { |
189 | 194 | $include = strtr(trim($task_details['task_file']), array('$boarddir' => $boarddir, '$sourcedir' => $sourcedir)); |
190 | - if (file_exists($include)) |
|
191 | - require_once($include); |
|
195 | + if (file_exists($include)) { |
|
196 | + require_once($include); |
|
197 | + } |
|
192 | 198 | } |
193 | 199 | |
194 | 200 | if (empty($task_details['task_class'])) |
@@ -204,8 +210,7 @@ discard block |
||
204 | 210 | $details = empty($task_details['task_data']) ? array() : json_decode($task_details['task_data'], true); |
205 | 211 | $bgtask = new $task_details['task_class']($details); |
206 | 212 | return $bgtask->execute(); |
207 | - } |
|
208 | - else |
|
213 | + } else |
|
209 | 214 | { |
210 | 215 | log_error('Invalid background task specified: (class: ' . $task_details['task_class'] . ', ' . (empty($task_details['task_file']) ? ' no file' : ' to load ' . $task_details['task_file']) . ')'); |
211 | 216 | return true; // So we clear it from the queue. |
@@ -224,8 +229,9 @@ discard block |
||
224 | 229 | $scripturl = $boardurl . '/index.php'; |
225 | 230 | |
226 | 231 | // These keys shouldn't be set...ever. |
227 | - if (isset($_REQUEST['GLOBALS']) || isset($_COOKIE['GLOBALS'])) |
|
228 | - die('Invalid request variable.'); |
|
232 | + if (isset($_REQUEST['GLOBALS']) || isset($_COOKIE['GLOBALS'])) { |
|
233 | + die('Invalid request variable.'); |
|
234 | + } |
|
229 | 235 | |
230 | 236 | // Save some memory.. (since we don't use these anyway.) |
231 | 237 | unset($GLOBALS['HTTP_POST_VARS'], $GLOBALS['HTTP_POST_VARS']); |
@@ -246,26 +252,28 @@ discard block |
||
246 | 252 | global $modSettings; |
247 | 253 | |
248 | 254 | // Ignore errors if we're ignoring them or they are strict notices from PHP 5 (which cannot be solved without breaking PHP 4.) |
249 | - if (error_reporting() == 0 || (defined('E_STRICT') && $error_level == E_STRICT && !empty($modSettings['enableErrorLogging']))) |
|
250 | - return; |
|
255 | + if (error_reporting() == 0 || (defined('E_STRICT') && $error_level == E_STRICT && !empty($modSettings['enableErrorLogging']))) { |
|
256 | + return; |
|
257 | + } |
|
251 | 258 | |
252 | 259 | $error_type = 'cron'; |
253 | 260 | |
254 | 261 | log_error($error_level . ': ' . $error_string, $error_type, $file, $line); |
255 | 262 | |
256 | 263 | // If this is an E_ERROR or E_USER_ERROR.... die. Violently so. |
257 | - if ($error_level % 255 == E_ERROR) |
|
258 | - die('No direct access...'); |
|
259 | -} |
|
264 | + if ($error_level % 255 == E_ERROR) { |
|
265 | + die('No direct access...'); |
|
266 | + } |
|
267 | + } |
|
260 | 268 | |
261 | 269 | /** |
262 | 270 | * The exit function |
263 | 271 | */ |
264 | 272 | function obExit_cron() |
265 | 273 | { |
266 | - if (FROM_CLI) |
|
267 | - die(0); |
|
268 | - else |
|
274 | + if (FROM_CLI) { |
|
275 | + die(0); |
|
276 | + } else |
|
269 | 277 | { |
270 | 278 | header('Content-Type: image/gif'); |
271 | 279 | die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B"); |
@@ -12,7 +12,8 @@ |
||
12 | 12 | header('Location: ' . $boardurl); |
13 | 13 | } |
14 | 14 | // Can't find it... just forget it. |
15 | -else |
|
15 | +else { |
|
16 | 16 | exit; |
17 | +} |
|
17 | 18 | |
18 | 19 | ?> |
19 | 20 | \ No newline at end of file |
@@ -12,7 +12,8 @@ |
||
12 | 12 | header('Location: ' . $boardurl); |
13 | 13 | } |
14 | 14 | // Can't find it... just forget it. |
15 | -else |
|
15 | +else { |
|
16 | 16 | exit; |
17 | +} |
|
17 | 18 | |
18 | 19 | ?> |
19 | 20 | \ No newline at end of file |
@@ -12,7 +12,8 @@ |
||
12 | 12 | header('Location: ' . $boardurl); |
13 | 13 | } |
14 | 14 | // Can't find it... just forget it. |
15 | -else |
|
15 | +else { |
|
16 | 16 | exit; |
17 | +} |
|
17 | 18 | |
18 | 19 | ?> |
19 | 20 | \ No newline at end of file |