2003-07-11 22:33:59 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2003-07-11 22:33:59 +00:00
|
|
|
|
2007-07-02 13:57:46 +00:00
|
|
|
|
2007-10-29 04:02:41 +00:00
|
|
|
require_once("../inc/boinc_db.inc");
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/profile.inc");
|
2004-06-07 03:34:07 +00:00
|
|
|
require_once("../inc/uotd.inc");
|
2003-07-11 22:33:59 +00:00
|
|
|
|
|
|
|
db_init();
|
|
|
|
|
2007-01-12 19:48:01 +00:00
|
|
|
$option = get_str('cmd', true);
|
2007-01-12 19:53:08 +00:00
|
|
|
if ($option) {
|
2007-01-12 19:48:01 +00:00
|
|
|
select_profile($option);
|
2003-12-22 23:41:36 +00:00
|
|
|
exit();
|
2003-07-11 22:33:59 +00:00
|
|
|
}
|
|
|
|
|
2008-07-13 16:28:01 +00:00
|
|
|
page_head(tra("Profiles"));
|
2004-02-10 07:02:38 +00:00
|
|
|
|
2007-11-06 00:45:45 +00:00
|
|
|
echo "
|
2008-08-07 20:43:52 +00:00
|
|
|
<p>".tra("%1Profiles%2 let individuals share backgrounds and opinions with the %3 community.", "<b>", "</b>", PROJECT)." ".
|
|
|
|
tra("Explore the diversity of your fellow volunteers, and contribute your own views for others to enjoy.")."
|
|
|
|
<p>".tra("If you haven't already, you can %1create your own user profile%2 for others to see!", "<a href=\"create_profile.php\">", "</a>");
|
2008-07-13 16:28:01 +00:00
|
|
|
|
2007-11-06 00:45:45 +00:00
|
|
|
start_table_noborder();
|
2003-08-07 00:44:54 +00:00
|
|
|
|
|
|
|
$today = getdate(time());
|
2008-07-13 16:28:01 +00:00
|
|
|
$UOTD_heading = tra("User of the Day")." -- " . $today['month'] . " " . $today['mday'] . ", " . $today['year'];
|
2003-08-07 00:44:54 +00:00
|
|
|
row1($UOTD_heading);
|
|
|
|
echo "<tr><td>";
|
2004-06-07 03:34:07 +00:00
|
|
|
$profile = get_current_uotd();
|
|
|
|
if ($profile) {
|
|
|
|
$user = lookup_user_id($profile->userid);
|
|
|
|
echo uotd_thumbnail($profile, $user);
|
|
|
|
echo user_links($user)."<br>";
|
2007-07-02 13:57:46 +00:00
|
|
|
echo sub_sentence(output_transform(strip_tags($profile->response1)), ' ', 150, true);
|
2004-06-07 03:34:07 +00:00
|
|
|
}
|
|
|
|
|
2003-08-07 00:44:54 +00:00
|
|
|
echo "</td></tr>";
|
|
|
|
|
2008-07-13 16:28:01 +00:00
|
|
|
row1(tra("User Profile Explorer"));
|
2003-07-22 20:36:54 +00:00
|
|
|
echo "<tr><td>
|
2003-12-21 05:55:48 +00:00
|
|
|
<ul>
|
2008-07-13 16:28:01 +00:00
|
|
|
<li>".tra("View the %1User Picture Gallery%2.", "<a href=\"" . URL_BASE . "user_profile/user_gallery_1.html\">", "</a>")."</li>
|
|
|
|
<li>".tra("Browse profiles %1by country%2.", "<a href=\"" . URL_BASE . "user_profile/profile_country.html\">", "</a>")."</li>
|
2009-02-17 17:39:57 +00:00
|
|
|
<li>".tra("Browse profiles %1at random%2, %3at random with pictures%2, or %4at random without pictures%2.", "<a href=\"?cmd=rand&pic=-1\">", "</a>",
|
|
|
|
"<a href=\"?cmd=rand&pic=1\">", "<a href=\"?cmd=rand&pic=0\">")."</li>
|
2003-12-21 05:55:48 +00:00
|
|
|
";
|
2007-01-12 19:48:01 +00:00
|
|
|
if (file_exists(PROFILE_PATH . "profile_alpha.html")) {
|
2008-07-13 16:28:01 +00:00
|
|
|
echo "<li>".tra("Alphabetical profile listings:")."<br>";
|
2003-12-21 05:55:48 +00:00
|
|
|
|
2007-01-12 19:48:01 +00:00
|
|
|
include( PROFILE_PATH . "profile_alpha.html" );
|
|
|
|
}
|
|
|
|
echo "</ul></td></tr>";
|
2003-07-15 19:04:55 +00:00
|
|
|
|
2008-07-13 16:28:01 +00:00
|
|
|
row1(tra("Search profile text"));
|
2003-12-21 05:55:48 +00:00
|
|
|
rowify("
|
2007-01-12 19:48:01 +00:00
|
|
|
<form action=\"profile_search_action.php\" method=\"GET\">
|
|
|
|
<input name=\"search_string\">
|
2008-07-13 16:28:01 +00:00
|
|
|
<input type=\"submit\" value=\"".tra("Search")."\">
|
2003-12-21 05:55:48 +00:00
|
|
|
</form>
|
|
|
|
");
|
2003-07-11 22:33:59 +00:00
|
|
|
end_table();
|
2003-12-21 05:55:48 +00:00
|
|
|
|
2003-07-11 22:33:59 +00:00
|
|
|
page_tail();
|
|
|
|
|
2007-01-12 19:48:01 +00:00
|
|
|
function select_profile($cmd) {
|
2003-12-21 05:55:48 +00:00
|
|
|
// Request for a random profile.
|
|
|
|
//
|
2003-12-22 23:41:36 +00:00
|
|
|
if ($cmd == "rand") {
|
2007-10-29 04:02:41 +00:00
|
|
|
$profiles = array();
|
2003-12-21 05:55:48 +00:00
|
|
|
if ($_GET['pic'] == 0) {
|
2007-11-06 00:45:45 +00:00
|
|
|
$profiles = BoincProfile::enum("has_picture=0", "limit 1000");
|
2003-12-21 05:55:48 +00:00
|
|
|
} else if ($_GET['pic'] == 1) {
|
2007-11-06 00:45:45 +00:00
|
|
|
$profiles = BoincProfile::enum("has_picture=1", "limit 1000");
|
2003-12-21 05:55:48 +00:00
|
|
|
} else if ($_GET['pic'] == -1) {
|
2007-11-06 00:45:45 +00:00
|
|
|
$profiles = BoincProfile::enum(null, "limit 1000");
|
2003-12-21 05:55:48 +00:00
|
|
|
}
|
|
|
|
|
2007-10-29 04:02:41 +00:00
|
|
|
if (count($profiles) == 0) {
|
2008-07-13 16:28:01 +00:00
|
|
|
page_head(tra("No profiles"));
|
|
|
|
echo tra("No profiles matched your query.");
|
2007-10-29 04:02:41 +00:00
|
|
|
page_tail();
|
2003-12-21 05:55:48 +00:00
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2007-10-29 04:02:41 +00:00
|
|
|
shuffle($profiles);
|
|
|
|
$userid = $profiles[0]->userid;
|
2007-11-18 22:42:47 +00:00
|
|
|
header("Location: ".URL_BASE."view_profile.php?userid=$userid");
|
2003-12-21 05:55:48 +00:00
|
|
|
exit();
|
2003-07-17 18:22:15 +00:00
|
|
|
}
|
2003-07-15 19:04:55 +00:00
|
|
|
}
|
|
|
|
|
2008-08-05 22:43:14 +00:00
|
|
|
$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit
|
2003-07-15 22:29:39 +00:00
|
|
|
?>
|