- web: Drupal stuff

svn path=/trunk/boinc/; revision=20418
This commit is contained in:
David Anderson 2010-02-04 16:55:16 +00:00
parent e44ac6dede
commit 5f1bf70056
6 changed files with 119 additions and 27 deletions

View File

@ -879,3 +879,16 @@ David 4 Feb 2010
stats_sites.inc
user/
hosts_user.php
David 4 Feb 2010
- web: Drupal stuff
html/
drupal/
home
view_profile
hosts_user
inc/
user.inc
user/
home.php

23
html/drupal/home Normal file
View File

@ -0,0 +1,23 @@
<?php
$original_cwd = getcwd();
chdir('includes/boinc');
require_once('user.inc');
function display_account($userid) {
$user = BoincUser::lookup_id($userid);
if (!$user) {
echo "<h3>No such user</h3>\n";
return;
}
show_account_private($user);
}
$userid = arg(2);
if (!$userid) $userid = 1;
$userid = 1;
display_account($userid);
chdir($original_cwd);
?>

23
html/drupal/hosts_user Normal file
View File

@ -0,0 +1,23 @@
<?php
$original_cwd = getcwd();
chdir('includes/boinc');
require_once('host.inc');
function display_hosts($userid) {
$user = BoincUser::lookup_id($userid);
if (!$user) {
echo "<h3>No such user</h3>\n";
return;
}
show_user_hosts($userid, true, true, "total_credit", false);
}
$userid = arg(2);
if (!$userid) $userid = 1;
$userid = 1;
display_host($userid);
chdir($original_cwd);
?>

30
html/drupal/view_profile Normal file
View File

@ -0,0 +1,30 @@
<?php
$original_cwd = getcwd();
chdir('includes/boinc');
require_once('profile.inc');
function display_profile($userid) {
$user = BoincUser::lookup_id($userid);
if (!$user) {
echo "<h3>No such user</h3>\n";
return;
}
$profile = get_profile($userid);
if (!$profile) {
echo "<h3>No profile exists for that user ID $userid</h3>";
return;
}
echo "<table>";
show_profile($user, null);
echo "</table>";
}
$userid = arg(2);
if (!$userid) $userid = 1;
$userid = 1;
display_profile($userid);
chdir($original_cwd);
?>

View File

@ -329,10 +329,9 @@ function show_user_summary_public($user) {
}
}
/**
* Returns a cacheable community links data object
* @param user The users to produce a community links object for
*/
// Returns a cacheable community links data object
// @param user The user to produce a community links object for
function get_community_links_object($user){
$cache_object->post_count = total_posts($user);
$cache_object->user = $user;
@ -395,6 +394,32 @@ function show_profile_link($user) {
}
}
function show_account_private($user) {
start_table_noborder();
echo "<tr><td valign=top>";
start_table();
show_user_info_private($user);
if (!no_computing()) {
show_user_stats_private($user);
}
if (file_exists("../project/donations.inc")) {
require_once("../project/donations.inc");
if (function_exists('show_user_donations_private')) {
show_user_donations_private($user);
}
}
end_table();
show_other_projects($user, true);
project_user_page_private($user);
echo "</td><td valign=top>";
start_table();
show_community_private($user);
end_table();
echo "</td></tr></table>";
}
function is_banned_email_addr($email_addr) {
global $banned_email_domains;
if (isset($banned_email_domains)) {

View File

@ -49,29 +49,7 @@ if ($init) {
page_head(tra("Your account"));
}
start_table_noborder();
echo "<tr><td valign=top>";
start_table();
show_user_info_private($user);
if (!no_computing()) {
show_user_stats_private($user);
}
if (file_exists("../project/donations.inc")) {
require_once("../project/donations.inc");
if (function_exists('show_user_donations_private')) {
show_user_donations_private($user);
}
}
end_table();
show_other_projects($user, true);
project_user_page_private($user);
echo "</td><td valign=top>";
start_table();
show_community_private($user);
end_table();
echo "</td></tr></table>";
show_account_private($user);
page_tail();