@@ -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"; |
@@ -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; |
@@ -324,6 +324,11 @@ discard block |
||
324 | 324 | // so it's OK to show the domain name etc. |
325 | 325 | // If private is false, show the owner's name only if they've given permission |
326 | 326 | // |
327 | +/** |
|
328 | + * @param integer $i |
|
329 | + * @param boolean $show_owner |
|
330 | + * @param boolean $any_product_name |
|
331 | + */ |
|
327 | 332 | function show_host_row($host, $i, $private, $show_owner, $any_product_name) { |
328 | 333 | $anonymous = false; |
329 | 334 | if (!$private) { |
@@ -503,6 +508,9 @@ discard block |
||
503 | 508 | // that their time intervals are disjoint. |
504 | 509 | // So the CPU/OS checks don't have to be very strict. |
505 | 510 | // |
511 | +/** |
|
512 | + * @param boolean $show_detail |
|
513 | + */ |
|
506 | 514 | function hosts_compatible($host1, $host2, $show_detail) { |
507 | 515 | // A host is "new" if it has no credit and no results. |
508 | 516 | // Skip disjoint-time check if one host or other is new |
@@ -642,6 +650,9 @@ discard block |
||
642 | 650 | return "hosts_user.php?sort=$sort&rev=$rev&show_all=$show_all$x"; |
643 | 651 | } |
644 | 652 | |
653 | +/** |
|
654 | + * @param string $sort |
|
655 | + */ |
|
645 | 656 | function link_url_rev($actual_sort, $sort, $rev, $show_all) { |
646 | 657 | if ($actual_sort == $sort) { |
647 | 658 | $rev = 1 - $rev; |
@@ -661,6 +672,9 @@ discard block |
||
661 | 672 | echo "<p>"; |
662 | 673 | } |
663 | 674 | |
675 | +/** |
|
676 | + * @param boolean $any_product_name |
|
677 | + */ |
|
664 | 678 | function user_host_table_start( |
665 | 679 | $private, $sort, $rev, $show_all, $any_product_name |
666 | 680 | ) { |
@@ -65,6 +65,10 @@ |
||
65 | 65 | return $forum->parent_type == 0 && ($forum->title === $forum_name); |
66 | 66 | } |
67 | 67 | |
68 | +/** |
|
69 | + * @param integer $start |
|
70 | + * @param integer $count |
|
71 | + */ |
|
68 | 72 | function show_news($start, $count) { |
69 | 73 | $forum = news_forum(); |
70 | 74 | if (!$forum) { |
@@ -27,6 +27,10 @@ discard block |
||
27 | 27 | echo "</div>\n"; |
28 | 28 | } |
29 | 29 | |
30 | +/** |
|
31 | + * @param null|integer $teamid |
|
32 | + * @param string $error |
|
33 | + */ |
|
30 | 34 | function pm_team_form($user, $teamid, $error=null) { |
31 | 35 | global $bbcode_html, $bbcode_js; |
32 | 36 | $team = BoincTeam::lookup_id($teamid); |
@@ -78,6 +82,9 @@ discard block |
||
78 | 82 | page_tail(); |
79 | 83 | } |
80 | 84 | |
85 | +/** |
|
86 | + * @param string $error |
|
87 | + */ |
|
81 | 88 | function pm_form($replyto, $userid, $error = null) { |
82 | 89 | global $bbcode_html, $bbcode_js; |
83 | 90 | global $g_logged_in_user; |
@@ -196,6 +203,9 @@ discard block |
||
196 | 203 | return "<a href=pm.php>".tra("Private message%1 from %2, subject:" , "</a>", $from_user->name )." $pm->subject"; |
197 | 204 | } |
198 | 205 | |
206 | +/** |
|
207 | + * @param boolean $send_email |
|
208 | + */ |
|
199 | 209 | function pm_send_msg($from_user, $to_user, $subject, $content, $send_email) { |
200 | 210 | $sql_subject = BoincDb::escape_string(sanitize_tags($subject)); |
201 | 211 | $sql_content = BoincDb::escape_string($content); |
@@ -224,6 +234,9 @@ discard block |
||
224 | 234 | BoincNotify::insert("(userid, create_time, type, opaque) values ($to_user->id, ".time().", ".NOTIFY_PM.", $mid)"); |
225 | 235 | } |
226 | 236 | |
237 | +/** |
|
238 | + * @param integer $duration |
|
239 | + */ |
|
227 | 240 | function pm_count($userid, $duration) { |
228 | 241 | $time = time() - $duration; |
229 | 242 |