2003-12-21 05:55:48 +00:00
|
|
|
<?php
|
|
|
|
|
2007-11-12 22:28:17 +00:00
|
|
|
require_once("../inc/boinc_db.inc");
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/util.inc");
|
2003-12-21 05:55:48 +00:00
|
|
|
|
2005-01-18 19:56:18 +00:00
|
|
|
function show_profile_link($profile, $n) {
|
2003-12-21 05:55:48 +00:00
|
|
|
$user = lookup_user_id($profile->userid);
|
2005-12-26 20:03:06 +00:00
|
|
|
echo "<tr><td align=\"center\">".user_links($user)."</td><td align=\"center\">".date_str($user->create_time)."</td><td align=\"center\">".$user->country."</td><td align=\"center\">".(int)$user->total_credit."</td><td align=\"center\">".(int)$user->expavg_credit."</td></tr>\n";
|
2003-12-21 05:55:48 +00:00
|
|
|
}
|
|
|
|
|
2006-03-11 00:17:46 +00:00
|
|
|
$search_string = get_str('search_string');
|
|
|
|
$offset = get_int('offset', true);
|
2003-12-21 05:55:48 +00:00
|
|
|
if (!$offset) $offset=0;
|
|
|
|
$count = 10;
|
|
|
|
|
2003-12-22 23:41:36 +00:00
|
|
|
page_head("Profile search results");
|
2003-12-21 05:55:48 +00:00
|
|
|
|
|
|
|
echo "<h2>Profiles containing '$search_string'</h2>\n";
|
2007-11-12 22:28:17 +00:00
|
|
|
$profiles = BoincProfile::enum("match(response1, response2) against ('$search_string') limit $offset,$count");
|
2007-10-29 04:02:41 +00:00
|
|
|
echo "<table align=\"center\" cellpadding=\"1\" border=\"1\" width=\"90%\">
|
|
|
|
<tr><th align=\"center\">User name</th>
|
|
|
|
<th align=\"center\">Joined project</th>
|
|
|
|
<th align=\"center\">Country</th>
|
|
|
|
<th align=\"center\">Total credit</th>
|
|
|
|
<th align=\"center\">Recent credit</th></tr>
|
|
|
|
";
|
2003-12-21 05:55:48 +00:00
|
|
|
$n = 0;
|
2007-11-12 22:28:17 +00:00
|
|
|
foreach($profiles as $profile) {
|
2005-01-18 19:56:18 +00:00
|
|
|
show_profile_link($profile, $n+$offset+1);
|
2003-12-21 05:55:48 +00:00
|
|
|
$n += 1;
|
|
|
|
}
|
|
|
|
echo "</table>";
|
2007-10-29 04:02:41 +00:00
|
|
|
|
2003-12-21 05:55:48 +00:00
|
|
|
if ($offset==0 && $n==0) {
|
|
|
|
echo "No profiles found containing '$search_string'";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($n==$count) {
|
|
|
|
$s = urlencode($search_string);
|
|
|
|
$offset += $count;
|
|
|
|
echo "
|
|
|
|
<a href=profile_search_action.php?search_string=$s&offset=$offset>Next $count</a>
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
?>
|