@@ -37,6 +37,9 @@ |
||
37 | 37 | $ops = number_format($ops, 2); |
38 | 38 | } |
39 | 39 | |
40 | +/** |
|
41 | + * @param boolean $bolden |
|
42 | + */ |
|
40 | 43 | function credit_string($credit, $bolden) { |
41 | 44 | $cobbs = number_format($credit, 0); |
42 | 45 |
@@ -69,6 +69,10 @@ discard block |
||
69 | 69 | function _mysql_fetch_row($r) { |
70 | 70 | return mysqli_fetch_row($r); |
71 | 71 | } |
72 | + |
|
73 | + /** |
|
74 | + * @param resource $r |
|
75 | + */ |
|
72 | 76 | function _mysql_fetch_assoc($r) { |
73 | 77 | return mysqli_fetch_assoc($r); |
74 | 78 | } |
@@ -132,6 +136,10 @@ discard block |
||
132 | 136 | function _mysql_fetch_row($r) { |
133 | 137 | return mysql_fetch_row($r); |
134 | 138 | } |
139 | + |
|
140 | + /** |
|
141 | + * @param resource $r |
|
142 | + */ |
|
135 | 143 | function _mysql_fetch_assoc($r) { |
136 | 144 | return mysql_fetch_assoc($r); |
137 | 145 | } |
@@ -103,6 +103,9 @@ discard block |
||
103 | 103 | |
104 | 104 | // Function prints a description of $table |
105 | 105 | // |
106 | +/** |
|
107 | + * @param integer $which |
|
108 | + */ |
|
106 | 109 | function print_describe_table_onecol($table, $which, $columns) { |
107 | 110 | $db = BoincDb::get(true); |
108 | 111 | $result = $db->do_query("SELECT * from $table LIMIT 1"); |
@@ -262,6 +265,10 @@ discard block |
||
262 | 265 | $this->urlquery .= "&clauses=$clause"; |
263 | 266 | } |
264 | 267 | } |
268 | + |
|
269 | + /** |
|
270 | + * @param string $name |
|
271 | + */ |
|
265 | 272 | function addeq($name) { |
266 | 273 | if (isset($_GET[$name])) { |
267 | 274 | $value = $_GET[$name]; |
@@ -273,6 +280,10 @@ discard block |
||
273 | 280 | $this->urlquery .= "&$name=".urlencode($value); |
274 | 281 | } |
275 | 282 | } |
283 | + |
|
284 | + /** |
|
285 | + * @param string $name |
|
286 | + */ |
|
276 | 287 | function addeq_not_CHOOSE_ALL($name) { |
277 | 288 | if (isset($_GET[$name])) { |
278 | 289 | $value = $_GET[$name]; |
@@ -287,6 +298,10 @@ discard block |
||
287 | 298 | $this->urlquery .= "&$name=".urlencode($value); |
288 | 299 | } |
289 | 300 | } |
301 | + |
|
302 | + /** |
|
303 | + * @param string $name |
|
304 | + */ |
|
290 | 305 | function addgt($name) { |
291 | 306 | if (isset($_GET[$name])) { |
292 | 307 | $value = $_GET[$name]; |
@@ -298,6 +313,11 @@ discard block |
||
298 | 313 | $this->urlquery .= "&$name=".urlencode($value); |
299 | 314 | } |
300 | 315 | } |
316 | + |
|
317 | + /** |
|
318 | + * @param string $name |
|
319 | + * @param string $order |
|
320 | + */ |
|
301 | 321 | function addsort($name, $order) { |
302 | 322 | if (isset($_GET[$name])) { |
303 | 323 | $value = $_GET[$name]; |
@@ -375,6 +395,9 @@ discard block |
||
375 | 395 | } |
376 | 396 | |
377 | 397 | |
398 | +/** |
|
399 | + * @param string $mq |
|
400 | + */ |
|
378 | 401 | function link_results($n, $mq, $query, $clauses) { |
379 | 402 | if ($n == '0') { // intentional compare by string |
380 | 403 | return "0"; |
@@ -824,6 +847,9 @@ discard block |
||
824 | 847 | return number_format($x/86400, 2)." days"; |
825 | 848 | } |
826 | 849 | |
850 | +/** |
|
851 | + * @param integer $x |
|
852 | + */ |
|
827 | 853 | function resource_name($x) { |
828 | 854 | switch ($x) { |
829 | 855 | case 2: return "CPU"; |
@@ -36,6 +36,9 @@ |
||
36 | 36 | return "$dirpath/$filename"; |
37 | 37 | } |
38 | 38 | |
39 | +/** |
|
40 | + * @param string $base |
|
41 | + */ |
|
39 | 42 | function dir_hier_url($filename, $base, $fanout) { |
40 | 43 | $dir = filename_hash($filename, $fanout); |
41 | 44 | return "$base/$dir/$filename"; |
@@ -208,6 +208,9 @@ discard block |
||
208 | 208 | // (to accommodate long [pre] lines) |
209 | 209 | // and the left column (author info) has fixed size |
210 | 210 | // |
211 | +/** |
|
212 | + * @param string[] $headings |
|
213 | + */ |
|
211 | 214 | function start_forum_table($headings) { |
212 | 215 | $a = array(); |
213 | 216 | foreach ($headings as $h) { |
@@ -488,6 +491,9 @@ discard block |
||
488 | 491 | // Display an individual post. |
489 | 492 | // Generates a table row with two cells: author and message |
490 | 493 | // |
494 | +/** |
|
495 | + * @param integer $controls |
|
496 | + */ |
|
491 | 497 | function show_post( |
492 | 498 | $post, $thread, $forum, $logged_in_user, $latest_viewed, |
493 | 499 | $controls=FORUM_CONTROLS, $filter=true |
@@ -852,6 +858,9 @@ discard block |
||
852 | 858 | // These take care of counts and timestamps. |
853 | 859 | // Don't do these things directly - use these functions |
854 | 860 | // |
861 | +/** |
|
862 | + * @param integer $parent_id |
|
863 | + */ |
|
855 | 864 | function create_post($content, $parent_id, $user, $forum, $thread, $signature) { |
856 | 865 | $content = substr($content, 0, 64000); |
857 | 866 | $content = BoincDb::escape_string($content); |
@@ -1084,6 +1093,9 @@ discard block |
||
1084 | 1093 | // $sort_style - string (checked by switch statement) |
1085 | 1094 | // $show_hidden - bool (not directly passed to SQL) |
1086 | 1095 | // |
1096 | +/** |
|
1097 | + * @param boolean $show_hidden |
|
1098 | + */ |
|
1087 | 1099 | function get_thread_posts($threadid, $sort_style, $show_hidden) { |
1088 | 1100 | $sql = "thread=$threadid"; |
1089 | 1101 | if (!$show_hidden) { |
@@ -1109,6 +1121,9 @@ discard block |
||
1109 | 1121 | // Show links for post moderation actions; |
1110 | 1122 | // logged in user has moderation rights. |
1111 | 1123 | // |
1124 | +/** |
|
1125 | + * @param string $config |
|
1126 | + */ |
|
1112 | 1127 | function show_post_moderation_links( |
1113 | 1128 | $config, $logged_in_user, $post, $forum, $tokens |
1114 | 1129 | ){ |
@@ -115,6 +115,10 @@ discard block |
||
115 | 115 | $db = BoincDb::get(); |
116 | 116 | return $db->enum('post', 'BoincPost', $clause); |
117 | 117 | } |
118 | + |
|
119 | + /** |
|
120 | + * @param string $query |
|
121 | + */ |
|
118 | 122 | static function enum_general($query) { |
119 | 123 | $db = BoincDb::get(); |
120 | 124 | return $db->enum_general('BoincPost', $query); |
@@ -175,6 +179,10 @@ discard block |
||
175 | 179 | $db = BoincDb::get(); |
176 | 180 | return $db->delete_aux('forum_preferences', "userid=$this->userid"); |
177 | 181 | } |
182 | + |
|
183 | + /** |
|
184 | + * @param string $clause |
|
185 | + */ |
|
178 | 186 | static function enum($clause=null) { |
179 | 187 | $db = BoincDb::get(); |
180 | 188 | return $db->enum('forum_preferences', 'BoincForumPrefs', $clause); |
@@ -290,6 +298,10 @@ discard block |
||
290 | 298 | } |
291 | 299 | |
292 | 300 | class BoincNotify { |
301 | + |
|
302 | + /** |
|
303 | + * @param string $clause |
|
304 | + */ |
|
293 | 305 | static function insert($clause) { |
294 | 306 | $db = BoincDb::get(); |
295 | 307 | $ret = $db->insert('notify', $clause); |
@@ -304,6 +316,10 @@ discard block |
||
304 | 316 | $db = BoincDb::get(); |
305 | 317 | return $db->enum('notify', 'BoincNotify', $clause); |
306 | 318 | } |
319 | + |
|
320 | + /** |
|
321 | + * @param integer $type |
|
322 | + */ |
|
307 | 323 | static function lookup($userid, $type, $opaque) { |
308 | 324 | $db = BoincDb::get(); |
309 | 325 | return $db->lookup('notify', 'BoincNotify', "userid=$userid and type=$type and opaque=$opaque"); |
@@ -316,6 +332,10 @@ discard block |
||
316 | 332 | $db = BoincDb::get(); |
317 | 333 | $db->delete_aux('notify', $clause); |
318 | 334 | } |
335 | + |
|
336 | + /** |
|
337 | + * @param string $query |
|
338 | + */ |
|
319 | 339 | static function enum_general($query) { |
320 | 340 | $db = BoincDb::get(); |
321 | 341 | return $db->enum_general('BoincNotify', $query); |
@@ -196,6 +196,10 @@ |
||
196 | 196 | |
197 | 197 | //////////////////// a banishment vote has been started /////////// |
198 | 198 | // |
199 | +/** |
|
200 | + * @param integer $duration |
|
201 | + * @param integer $end_time |
|
202 | + */ |
|
199 | 203 | function send_banish_vote_email($user, $duration, $reason, $end_time) { |
200 | 204 | global $master_url; |
201 | 205 | $now=time(); |
@@ -29,6 +29,9 @@ |
||
29 | 29 | return false; |
30 | 30 | } |
31 | 31 | |
32 | +/** |
|
33 | + * @param boolean $no_images |
|
34 | + */ |
|
32 | 35 | function show_forum_rss_item($thread, $userid, $threads_only, $no_images) { |
33 | 36 | $unique_url=secure_url_base()."forum_thread.php?id=".$thread->id; |
34 | 37 |
@@ -229,6 +229,9 @@ discard block |
||
229 | 229 | shmop_close ($shmid); |
230 | 230 | } |
231 | 231 | |
232 | +/** |
|
233 | + * @param GeoIP $gi |
|
234 | + */ |
|
232 | 235 | function _setup_segments($gi){ |
233 | 236 | $gi->databaseType = GEOIP_COUNTRY_EDITION; |
234 | 237 | $gi->record_length = STANDARD_RECORD_LENGTH; |
@@ -311,6 +314,10 @@ discard block |
||
311 | 314 | return $gi; |
312 | 315 | } |
313 | 316 | |
317 | +/** |
|
318 | + * @param string $filename |
|
319 | + * @param integer $flags |
|
320 | + */ |
|
314 | 321 | function geoip_open($filename, $flags) { |
315 | 322 | $gi = new GeoIP; |
316 | 323 | $gi->flags = $flags; |
@@ -419,6 +426,9 @@ discard block |
||
419 | 426 | return false; |
420 | 427 | } |
421 | 428 | |
429 | +/** |
|
430 | + * @param integer $ipnum |
|
431 | + */ |
|
422 | 432 | function _get_org($gi,$ipnum){ |
423 | 433 | $seek_org = _geoip_seek_country($gi,$ipnum); |
424 | 434 | if ($seek_org == $gi->databaseSegments) { |
@@ -443,6 +453,9 @@ discard block |
||
443 | 453 | return _get_org($gi, $ipnum); |
444 | 454 | } |
445 | 455 | |
456 | +/** |
|
457 | + * @param integer $ipnum |
|
458 | + */ |
|
446 | 459 | function _get_region($gi,$ipnum){ |
447 | 460 | if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){ |
448 | 461 | $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV0; |