diff --git a/html/inc/uotd.inc b/html/inc/uotd.inc index d38f9d9fcd..932a4c5f9f 100644 --- a/html/inc/uotd.inc +++ b/html/inc/uotd.inc @@ -47,7 +47,7 @@ function show_uotd($profile) { // return the last UOTD profile, or null // function get_current_uotd() { - $profiles = BoincProfile::enum("uotd_time is not NULL", "ORDER BY uotd_time DESC LIMIT 1"); + $profiles = BoincProfile::enum("uotd_time is not NULL and uotd_time>0", "ORDER BY uotd_time DESC LIMIT 1"); if (sizeof($profiles)) { return $profiles[0]; } @@ -112,7 +112,7 @@ function select_uotd($force_new = false) { // If all verified profiles have been selected as UOTD, // reshow the one that was shown least recently. // - $result = $db->do_query("SELECT * FROM profile,user WHERE profile.userid=user.id AND verification=1 ORDER BY uotd_time ASC LIMIT 1"); + $result = $db->do_query("SELECT * FROM profile,user WHERE profile.userid=user.id AND verification=1 AND uotd_time>0 ORDER BY uotd_time ASC LIMIT 1"); } if (!$result || $result->num_rows == 0) { @@ -164,7 +164,7 @@ function default_uotd_candidates_query(){ $query = "SELECT * FROM profile,user WHERE profile.userid=user.id "; $query .= " AND verification=1 "; $query .= " AND expavg_credit>1 "; - $query .= " AND uotd_time IS NULL "; + $query .= " AND (uotd_time IS NULL or uotd_time=0) "; $query .= "ORDER BY RAND()"; return $query; } diff --git a/html/ops/profile_screen_form.php b/html/ops/profile_screen_form.php index 8213d02c30..ff0cb6d50b 100644 --- a/html/ops/profile_screen_form.php +++ b/html/ops/profile_screen_form.php @@ -46,7 +46,7 @@ if (function_exists('profile_screen_query')) { $query = "select * from profile, user where profile.userid=user.id " ." and has_picture>0 " ." and verification=0 " - ." and uotd_time is null " + ." and (uotd_time is null or uotd_time=0) " ." and expavg_credit>1 " ." and (response1 <> '' or response2 <> '') " ." order by recommend desc limit 20"