@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | // they've participated in |
| 34 | 34 | // |
| 35 | 35 | function get_other_projects($user) { |
| 36 | - $cpid = md5($user->cross_project_id . $user->email_addr); |
|
| 36 | + $cpid = md5($user->cross_project_id.$user->email_addr); |
|
| 37 | 37 | $url = "http://boinc.netsoft-online.com/get_user.php?cpid=".$cpid; |
| 38 | 38 | |
| 39 | 39 | // Check the cache for that URL |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | if (!NO_STATS) { |
| 174 | - $cpid = md5($user->cross_project_id . $user->email_addr); |
|
| 174 | + $cpid = md5($user->cross_project_id.$user->email_addr); |
|
| 175 | 175 | $x = ""; |
| 176 | 176 | shuffle($cpid_stats_sites); |
| 177 | 177 | foreach ($cpid_stats_sites as $site) { |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $u = normalize_user_url($user->url); |
| 256 | 256 | row2( |
| 257 | 257 | tra("URL"), |
| 258 | - $u?sprintf('<a href="%s">%s</a>', $u, $u):tra('Invalid URL') |
|
| 258 | + $u ?sprintf('<a href="%s">%s</a>', $u, $u) : tra('Invalid URL') |
|
| 259 | 259 | ); |
| 260 | 260 | } |
| 261 | 261 | if (USER_COUNTRY) { |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | // if $badge_height is > 0, show badges |
| 352 | 352 | // if $name_limit, limit name to N chars |
| 353 | 353 | // |
| 354 | -function user_links($user, $badge_height=0, $name_limit=0) { |
|
| 354 | +function user_links($user, $badge_height = 0, $name_limit = 0) { |
|
| 355 | 355 | BoincForumPrefs::lookup($user); |
| 356 | 356 | if (is_banished($user)) { |
| 357 | 357 | return "(banished: ID $user->id)"; |
@@ -366,13 +366,13 @@ discard block |
||
| 366 | 366 | $name = substr($name, 0, $name_limit)."..."; |
| 367 | 367 | } |
| 368 | 368 | $x .= " <a href=\"".url_base()."show_user.php?userid=".$user->id."\">".$name."</a>"; |
| 369 | - if (function_exists("project_user_links")){ |
|
| 369 | + if (function_exists("project_user_links")) { |
|
| 370 | 370 | $x .= project_user_links($user); |
| 371 | 371 | } |
| 372 | 372 | if ($badge_height) { |
| 373 | 373 | $x .= badges_string(true, $user, $badge_height); |
| 374 | 374 | } |
| 375 | - return $name_limit?"<nobr>$x</nobr>":$x; |
|
| 375 | + return $name_limit ? "<nobr>$x</nobr>" : $x; |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | function show_community_private($user) { |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | |
| 420 | 420 | // if there's a foundership request, notify the founder |
| 421 | 421 | // |
| 422 | - if ($user->id==$team->userid && $team->ping_user >0) { |
|
| 422 | + if ($user->id == $team->userid && $team->ping_user > 0) { |
|
| 423 | 423 | $x .= "<p class=\"text-danger\">".tra("(foundership change request pending)")."</p>"; |
| 424 | 424 | } |
| 425 | 425 | row2(tra("Member of team"), $x); |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | $x = "<a href=\"user_search.php\">".tra("Find friends")."</a><br/>\n"; |
| 445 | 445 | $n = count($friends); |
| 446 | 446 | if ($n) { |
| 447 | - foreach($friends as $friend) { |
|
| 447 | + foreach ($friends as $friend) { |
|
| 448 | 448 | $fuser = BoincUser::lookup_id($friend->user_dest); |
| 449 | 449 | if (!$fuser) continue; |
| 450 | 450 | $x .= friend_links($fuser); |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | // Returns a cacheable community links data object |
| 490 | 490 | // @param user The user to produce a community links object for |
| 491 | 491 | |
| 492 | -function get_community_links_object($user){ |
|
| 492 | +function get_community_links_object($user) { |
|
| 493 | 493 | $cache_object = new StdClass; |
| 494 | 494 | $cache_object->post_count = total_posts($user); |
| 495 | 495 | $cache_object->user = $user; |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | $cache_object->friends = array(); |
| 498 | 498 | |
| 499 | 499 | $friends = BoincFriend::enum("user_src=$user->id and reciprocated=1"); |
| 500 | - foreach($friends as $friend) { |
|
| 500 | + foreach ($friends as $friend) { |
|
| 501 | 501 | $fuser = BoincUser::lookup_id($friend->user_dest); |
| 502 | 502 | if (!$fuser) continue; |
| 503 | 503 | $cache_object->friends[] = $fuser; |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | return $cache_object; |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | -function community_links($clo, $logged_in_user){ |
|
| 508 | +function community_links($clo, $logged_in_user) { |
|
| 509 | 509 | $user = $clo->user; |
| 510 | 510 | $team = $clo->team; |
| 511 | 511 | $friends = $clo->friends; |
@@ -531,15 +531,15 @@ discard block |
||
| 531 | 531 | "<a href=\"friend.php?action=cancel_confirm&userid=$user->id\">".tra("Cancel friendship")."</a>" |
| 532 | 532 | ); |
| 533 | 533 | } else if ($friend) { |
| 534 | - row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>"); |
|
| 534 | + row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Request pending")."</a>"); |
|
| 535 | 535 | } else { |
| 536 | - row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>"); |
|
| 536 | + row2(tra("Friends"), "<a href=\"friend.php?action=add&userid=$user->id\">".tra("Add as friend")."</a>"); |
|
| 537 | 537 | } |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | if ($friends) { |
| 541 | 541 | $x = ""; |
| 542 | - foreach($friends as $friend) { |
|
| 542 | + foreach ($friends as $friend) { |
|
| 543 | 543 | $x .= friend_links($friend); |
| 544 | 544 | } |
| 545 | 545 | row2(tra("Friends")." (".sizeof($friends).")", $x); |
@@ -583,6 +583,6 @@ discard block |
||
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | |
| 586 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
| 586 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
| 587 | 587 | |
| 588 | 588 | ?> |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | require_once("../inc/boinc_db.inc"); |
| 22 | 22 | require_once("../inc/util.inc"); |
| 23 | 23 | |
| 24 | -define('CONSENT_TYPE_ENROLL','ENROLL'); |
|
| 24 | +define('CONSENT_TYPE_ENROLL', 'ENROLL'); |
|
| 25 | 25 | |
| 26 | 26 | function check_termsofuse() { |
| 27 | 27 | return defined('TERMSOFUSE_FILE') and file_exists(TERMSOFUSE_FILE); |
@@ -32,13 +32,13 @@ discard block |
||
| 32 | 32 | $source, $ctime = 0 |
| 33 | 33 | ) { |
| 34 | 34 | $mys = BoincDb::escape_string($source); |
| 35 | - if ($ctime==0) { |
|
| 35 | + if ($ctime == 0) { |
|
| 36 | 36 | $mytime = $user->create_time; |
| 37 | 37 | } else { |
| 38 | 38 | $mytime = $ctime; |
| 39 | 39 | } |
| 40 | 40 | return BoincConsent::insert( |
| 41 | - "(userid, consent_type_id, consent_time, consent_flag, consent_not_required, source) " . |
|
| 41 | + "(userid, consent_type_id, consent_time, consent_flag, consent_not_required, source) ". |
|
| 42 | 42 | "values($user->id, $consent_type_id, $mytime, $consent_flag, $consent_not_required, '$mys')" |
| 43 | 43 | ); |
| 44 | 44 | |
@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | // The integer is the consent_type_id- the id from consent_type table. |
| 64 | 64 | // If the boolean is FALSE, the integer returned is -1. |
| 65 | 65 | // |
| 66 | -function check_consent_type($name, $checkenabled=TRUE) { |
|
| 66 | +function check_consent_type($name, $checkenabled = TRUE) { |
|
| 67 | 67 | $ct = BoincConsentType::lookup("shortname = '{$name}'"); |
| 68 | - if ($ct and ( !$checkenabled or ($ct->enabled)) ) { |
|
| 68 | + if ($ct and (!$checkenabled or ($ct->enabled))) { |
|
| 69 | 69 | return array(TRUE, $ct->id); |
| 70 | 70 | } |
| 71 | 71 | return array(FALSE, -1); |
@@ -50,10 +50,10 @@ discard block |
||
| 50 | 50 | if ($checkct) { |
| 51 | 51 | $consent_result = BoincLatestConsent::lookup("userid={$user->id} AND consent_type_id=$ctid AND consent_flag=1"); |
| 52 | 52 | if ($consent_result) { |
| 53 | - return TRUE; |
|
| 53 | + return true; |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | - return FALSE; |
|
| 56 | + return false; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // Check if a particular consent_type name is available. |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | // The integer is the consent_type_id- the id from consent_type table. |
| 64 | 64 | // If the boolean is FALSE, the integer returned is -1. |
| 65 | 65 | // |
| 66 | -function check_consent_type($name, $checkenabled=TRUE) { |
|
| 66 | +function check_consent_type($name, $checkenabled=true) { |
|
| 67 | 67 | $ct = BoincConsentType::lookup("shortname = '{$name}'"); |
| 68 | 68 | if ($ct and ( !$checkenabled or ($ct->enabled)) ) { |
| 69 | - return array(TRUE, $ct->id); |
|
| 69 | + return array(true, $ct->id); |
|
| 70 | 70 | } |
| 71 | - return array(FALSE, -1); |
|
| 71 | + return array(false, -1); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | // When a user uses the Web site to login, this function checks the |