2003-07-11 22:33:59 +00:00
|
|
|
<?php
|
|
|
|
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/db.inc");
|
|
|
|
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();
|
|
|
|
|
2003-12-22 23:41:36 +00:00
|
|
|
|
|
|
|
$cmd = $_GET['cmd'];
|
|
|
|
if ($cmd) {
|
|
|
|
execute_command($cmd);
|
|
|
|
exit();
|
2003-07-11 22:33:59 +00:00
|
|
|
}
|
|
|
|
|
2004-02-10 07:02:38 +00:00
|
|
|
page_head("Profile Zone");
|
|
|
|
|
2003-07-11 22:33:59 +00:00
|
|
|
|
|
|
|
start_table_noborder();
|
2003-07-15 19:04:55 +00:00
|
|
|
rowify("
|
2003-12-21 05:55:48 +00:00
|
|
|
User profiles provide a way for individuals to share backgrounds
|
|
|
|
and opinions with the " . PROJECT . " community.
|
|
|
|
Explore the diversity of your fellow searchers,
|
|
|
|
and contribute your own views for others to enjoy.
|
|
|
|
<p>
|
|
|
|
If you haven't already, you can
|
|
|
|
<a href=create_profile.php>create your own user profile</a>
|
|
|
|
for others to see!
|
2003-07-15 19:04:55 +00:00
|
|
|
");
|
2003-08-07 00:44:54 +00:00
|
|
|
rowify("<br>");
|
|
|
|
|
|
|
|
$today = getdate(time());
|
|
|
|
$UOTD_heading = "User of the Day -- " . $today['month'] . " " . $today['mday'] . ", " . $today['year'];
|
|
|
|
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>";
|
|
|
|
echo sub_sentence(strip_tags($profile->response1), ' ', 150, true);
|
|
|
|
}
|
|
|
|
|
2003-08-07 00:44:54 +00:00
|
|
|
echo "</td></tr>";
|
|
|
|
|
2003-07-15 19:04:55 +00:00
|
|
|
rowify("<br>");
|
|
|
|
row1("User Profile Explorer");
|
2003-07-22 20:36:54 +00:00
|
|
|
echo "<tr><td>
|
2003-12-21 05:55:48 +00:00
|
|
|
<ul>
|
2004-03-08 23:41:54 +00:00
|
|
|
<li>View the <a href=" . URL_BASE . "user_profile/user_gallery_1.html>User Picture Gallery</a>.
|
2004-03-20 01:35:37 +00:00
|
|
|
<li>Browse profiles <a href=" . URL_BASE . "user_profile/profile_country.html>by country</a>.
|
2003-12-21 05:55:48 +00:00
|
|
|
<li>Browse profiles <a href=" . $_SERVER['PHP_SELF'] . "?cmd=rand&pic=-1>at random</a>,
|
|
|
|
<a href=" . $_SERVER['PHP_SELF'] . "?cmd=rand&pic=1>at random with pictures</a>, or
|
|
|
|
<a href=" . $_SERVER['PHP_SELF'] . "?cmd=rand&pic=0>at random without pictures</a>.
|
|
|
|
|
|
|
|
<li>Alphabetical profile listings <i></i>:<br>
|
|
|
|
";
|
|
|
|
|
2004-03-05 22:20:32 +00:00
|
|
|
include( PROFILE_PATH . "profile_alpha.html" );
|
2003-12-21 05:55:48 +00:00
|
|
|
|
2003-07-22 20:36:54 +00:00
|
|
|
echo "<br></ul></td></tr>";
|
2003-07-15 19:04:55 +00:00
|
|
|
|
|
|
|
rowify("<br>");
|
2003-12-21 05:55:48 +00:00
|
|
|
row1("Search user names");
|
2003-07-11 22:33:59 +00:00
|
|
|
|
2003-12-21 05:55:48 +00:00
|
|
|
rowify("
|
2003-12-22 23:41:36 +00:00
|
|
|
<form action=user_search_action.php method=GET>
|
|
|
|
<input name=search_string>
|
2003-12-21 05:55:48 +00:00
|
|
|
<input type=submit value=OK>
|
|
|
|
</form>
|
|
|
|
");
|
|
|
|
row1("Search profile text");
|
|
|
|
rowify("
|
|
|
|
<form action=profile_search_action.php method=GET>
|
|
|
|
<input name=search_string>
|
|
|
|
<input type=submit value=OK>
|
|
|
|
</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();
|
|
|
|
|
2003-12-22 23:41:36 +00:00
|
|
|
function execute_command($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") {
|
2003-12-21 05:55:48 +00:00
|
|
|
if ($_GET['pic'] == 0) {
|
|
|
|
$result = mysql_query("SELECT userid FROM profile WHERE has_picture=0");
|
|
|
|
} else if ($_GET['pic'] == 1) {
|
|
|
|
$result = mysql_query("SELECT userid FROM profile WHERE has_picture=1");
|
|
|
|
} else if ($_GET['pic'] == -1) {
|
|
|
|
$result = mysql_query("SELECT userid FROM profile");
|
|
|
|
}
|
|
|
|
|
|
|
|
while ($row = mysql_fetch_row($result)) {
|
|
|
|
$userIds[] = $row[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (count($userIds) == 0) {
|
|
|
|
echo "No profiles matched your query.<br>";
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
shuffle($userIds);
|
|
|
|
header("Location: " . URL_BASE . "view_profile.php?userid=" . $userIds[0]);
|
|
|
|
exit();
|
2003-07-17 18:22:15 +00:00
|
|
|
}
|
2003-07-15 19:04:55 +00:00
|
|
|
}
|
|
|
|
|
2003-07-15 22:29:39 +00:00
|
|
|
?>
|