mirror of https://github.com/BOINC/boinc.git
- web: if user has profile photo, use it instead of head_20.
svn path=/trunk/boinc/; revision=14438
This commit is contained in:
parent
11dac5e80c
commit
724e89ebab
|
@ -12467,3 +12467,15 @@ David 21 Dec 2007
|
||||||
setup_project.py
|
setup_project.py
|
||||||
tools/
|
tools/
|
||||||
make_project
|
make_project
|
||||||
|
|
||||||
|
David 23 Dec 2007
|
||||||
|
- web: if user has profile photo, use it instead of head_20.
|
||||||
|
|
||||||
|
html/
|
||||||
|
inc/
|
||||||
|
boinc_db.inc
|
||||||
|
db_conn.inc
|
||||||
|
user.inc
|
||||||
|
util.inc
|
||||||
|
user/
|
||||||
|
forum_moderate_thread.php
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
require_once("../html/inc/page_translate.inc");
|
require_once("../html/inc/page_translate.inc");
|
||||||
find_translation("dg.html");
|
find_translation("dg.html");
|
||||||
|
|
||||||
Header("Location: http://boinc.berkeley.edu/trac/wiki/VirtualCampusSupercomputerCenter");
|
Header("Location: http://boinc.berkeley.edu/trac/wiki/DesktopGrid");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -205,6 +205,10 @@ class BoincAppVersion {
|
||||||
}
|
}
|
||||||
|
|
||||||
class BoincProfile {
|
class BoincProfile {
|
||||||
|
static function lookup_fields($fields, $clause) {
|
||||||
|
$db = BoincDb::get();
|
||||||
|
return $db->lookup_fields('profile', 'BoincProfile', $fields, $clause);
|
||||||
|
}
|
||||||
static function lookup($clause) {
|
static function lookup($clause) {
|
||||||
$db = BoincDb::get();
|
$db = BoincDb::get();
|
||||||
return $db->lookup('profile', 'BoincProfile', $clause);
|
return $db->lookup('profile', 'BoincProfile', $clause);
|
||||||
|
|
|
@ -34,6 +34,17 @@ class DbConn {
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function lookup_fields($table, $classname, $fields, $clause) {
|
||||||
|
$query = "select $fields from DBNAME.$table where $clause";
|
||||||
|
$result = $this->do_query($query);
|
||||||
|
if (!$result) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$obj = mysql_fetch_object($result, $classname);
|
||||||
|
mysql_free_result($result);
|
||||||
|
return $obj;
|
||||||
|
}
|
||||||
|
|
||||||
function lookup($table, $classname, $clause) {
|
function lookup($table, $classname, $clause) {
|
||||||
$query = "select * from DBNAME.$table where $clause";
|
$query = "select * from DBNAME.$table where $clause";
|
||||||
$result = $this->do_query($query);
|
$result = $this->do_query($query);
|
||||||
|
|
|
@ -232,7 +232,7 @@ function show_user_info_private($user) {
|
||||||
$x = "";
|
$x = "";
|
||||||
foreach($friends as $friend) {
|
foreach($friends as $friend) {
|
||||||
$fuser = BoincUser::lookup_id($friend->user_dest);
|
$fuser = BoincUser::lookup_id($friend->user_dest);
|
||||||
$x .= user_links($fuser);
|
$x .= " ". user_links($fuser);
|
||||||
}
|
}
|
||||||
row2("Friends", $x);
|
row2("Friends", $x);
|
||||||
}
|
}
|
||||||
|
@ -308,7 +308,7 @@ function show_user_summary_public($user) {
|
||||||
$x = "";
|
$x = "";
|
||||||
foreach($friends as $friend) {
|
foreach($friends as $friend) {
|
||||||
$fuser = BoincUser::lookup_id($friend->user_dest);
|
$fuser = BoincUser::lookup_id($friend->user_dest);
|
||||||
$x .= user_links($fuser);
|
$x .= " ".user_links($fuser);
|
||||||
}
|
}
|
||||||
row2("Friends", $x);
|
row2("Friends", $x);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ require_once("../inc/db.inc");
|
||||||
require_once("../inc/boinc_db.inc");
|
require_once("../inc/boinc_db.inc");
|
||||||
require_once("../inc/translation.inc");
|
require_once("../inc/translation.inc");
|
||||||
require_once("../inc/forum.inc");
|
require_once("../inc/forum.inc");
|
||||||
|
require_once("../inc/profile.inc");
|
||||||
|
|
||||||
ini_set("memory_limit", "64M");
|
ini_set("memory_limit", "64M");
|
||||||
|
|
||||||
|
@ -549,7 +550,13 @@ function user_links($user) {
|
||||||
}
|
}
|
||||||
$x = "<a href=\"".URL_BASE."show_user.php?userid=".$user->id."\">".$user->name."</a>";
|
$x = "<a href=\"".URL_BASE."show_user.php?userid=".$user->id."\">".$user->name."</a>";
|
||||||
if ($user->has_profile) {
|
if ($user->has_profile) {
|
||||||
$x .= ' <a href="'.URL_BASE.'view_profile.php?userid='.$user->id.'"><img title="View the profile of '.$user->name.'" border="0" src="'.URL_BASE.'img/head_20.png" alt="Profile"></a>';
|
$profile = BoincProfile::lookup_fields("has_picture", "userid=$user->id");
|
||||||
|
if ($profile && $profile->has_picture) {
|
||||||
|
$img_url = profile_thumb_url($user->id);
|
||||||
|
} else {
|
||||||
|
$img_url = URL_BASE."img/head_20.png";
|
||||||
|
}
|
||||||
|
$x .= ' <a href="'.URL_BASE.'view_profile.php?userid='.$user->id.'"><img title="View the profile of '.$user->name.'" border="0" align=top src="'.$img_url.'" alt="Profile"></a>';
|
||||||
}
|
}
|
||||||
if ($user->donated == 1) {
|
if ($user->donated == 1) {
|
||||||
require_once("../project/donations.inc");
|
require_once("../project/donations.inc");
|
||||||
|
|
|
@ -61,7 +61,7 @@ if (get_str('action')=="hide") {
|
||||||
}
|
}
|
||||||
|
|
||||||
row2("Reason<br>Mailed if nonempty",
|
row2("Reason<br>Mailed if nonempty",
|
||||||
"<textarea name=\"reason\"></textarea>");
|
"<textarea rows=10 cols=80 name=\"reason\"></textarea>");
|
||||||
|
|
||||||
row2(
|
row2(
|
||||||
"",
|
"",
|
||||||
|
|
Loading…
Reference in New Issue