- user web: bug fixes

svn path=/trunk/boinc/; revision=14204
This commit is contained in:
David Anderson 2007-11-14 21:55:05 +00:00
parent 6e57bbebc8
commit 9970e2c71b
7 changed files with 38 additions and 4 deletions

View File

@ -10925,3 +10925,16 @@ David 15 Nov 2007
client/
sim.C
cpu_sched.C
David 15 Nov 2007
- user web: bug fixes
html/
inc/
forum_db.inc
ops/
db_update.php
user/
forum_edit.php
forum_user_posts.php
team_manage.php

View File

@ -96,7 +96,7 @@ alter table category
add unique cat1(name, is_helpdesk);
alter table forum
add unique(category, title);
add unique pct (parent_type, category, title);
alter table thread
add fulltext index thread_title(title);

View File

@ -14,10 +14,20 @@ class BoincCategory {
}
class BoincForum {
static function insert($clause) {
$db = BoincDb::get();
$ret = $db->insert('forum', $clause);
if (!$ret) return null;
return $db->insert_id();
}
static function lookup_id($id) {
$db = BoincDb::get();
return $db->lookup_id($id, 'forum', 'BoincForum');
}
static function lookup($clause) {
$db = BoincDb::get();
return $db->lookup('forum', 'BoincForum', $clause);
}
static function enum($clause) {
$db = BoincDb::get();
return $db->enum('forum', 'BoincForum', $clause);

View File

@ -490,11 +490,16 @@ function update_11_8_2007() {
do_query("alter table forum add parent_type integer not null");
}
function update_11_14_2007() {
do_query("alter table forum drop index category");
do_query("alter table forum add unique pct (parent_type, category, title)");
}
// modify the following to call the function you want.
// Make sure you do all needed functions, in order.
// (Look at your DB structure using "explain" queries to see
// which ones you need).
//update_11_8_2007();
//update_11_14_2007();
?>

View File

@ -70,7 +70,7 @@ page_head('Forum');
$forum = BoincForum::lookup_id($thread->forum);
$category = BoincCategory::lookup_id($forum->category);
show_forum_title($logged_in_user, $category, $forum, $thread);
show_forum_title($logged_in_user, $category, $forum, $thread, true);
if ($preview == tra("Preview")) {
$options = null;

View File

@ -30,7 +30,8 @@ if($hide) {
$n = 0;
start_table();
foreach ($posts as $post) {
show_post2($post, $n+$offset+1);
$thread = BoincThread::lookup_id($post->thread);
show_post($post, $thread, $logged_in_user, $n+$offset+1);
$n++;
}
echo "</table>\n";

View File

@ -20,6 +20,9 @@ function show_admin_page($user, $team) {
| <a href=team_delta.php?teamid=$team->id&xml=1>XML</a>
<br><span class=note>See when members joined or quit this team</span>
";
// founder-only stuff follows
//
if ($team->userid == $user->id) {
$tokens = url_tokens($user->authenticator);
if ($team->ping_user > 0) {
@ -39,6 +42,8 @@ function show_admin_page($user, $team) {
<li><a href=team_manage.php?teamid=$team->id&action=delete&$tokens>Remove team</a>
<br><span class=note>Allowed only if team has no members</a>
<li><a href=team_forum.php?teamid=$team->id&cmd=manage>Message board</a>
<br><span class=note>Create or manage team message board</span>
";
}
echo "