- user web: fix forum banishment vote stuff

svn path=/trunk/boinc/; revision=14256
This commit is contained in:
David Anderson 2007-11-19 05:14:37 +00:00
parent 615d4dcf22
commit e85f6d492e
4 changed files with 18 additions and 7 deletions

View File

@ -11327,3 +11327,13 @@ David 18 Nov 2007
db_update.php
user/
edit_forum_preferences_action.php
David 18 Nov 2007
- user web: fix forum banishment vote stuff
html/
inc/
forum_banishment_vote.inc
user/
forum_banishment_vote_action.php
edit_forum_preferences_form.php

View File

@ -42,7 +42,7 @@ function start_vote($config,$logged_in_user,$user,$category,$reason) {
echo "A banishment vote is already underway for this user.<p>";
return 0;
}
$query="insert into banishment_vote (userid,modid,start_time,end_time) values (".$user->id.",".$logged_in_user->getID().",".$now.",".$fin.")";
$query="insert into banishment_vote (userid,modid,start_time,end_time) values (".$user->id.",".$logged_in_user->id.",".$now.",".$fin.")";
$result = mysql_query($query);
if (!$result) {
echo "Database error attempting to insert to banishment_vote table.<p>";
@ -50,7 +50,7 @@ function start_vote($config,$logged_in_user,$user,$category,$reason) {
}
$voteid=mysql_insert_id();
$query="insert into banishment_votes (voteid,modid,time,yes) values (". $voteid .",". $logged_in_user->getID() .",". $now .",1)";
$query="insert into banishment_votes (voteid,modid,time,yes) values (". $voteid .",". $logged_in_user->id .",". $now .",1)";
$result = mysql_query($query);
if (!$result) {
echo "Database error attempting to insert to banishment_votes table.<p>";
@ -82,7 +82,7 @@ function vote_yes($config,$logged_in_user,$user) {
}
$voteid=$foobar->voteid;
// Check whether mod has voted already.
$query="select count(id) as count from banishment_votes where voteid=".$voteid." and modid=".$logged_in_user->getID();
$query="select count(id) as count from banishment_votes where voteid=".$voteid." and modid=".$logged_in_user->id;
$result = mysql_query($query);
$foobar = mysql_fetch_object($result);
if (!$foobar) {
@ -95,7 +95,7 @@ function vote_yes($config,$logged_in_user,$user) {
return 0;
}
// insert the vote
$query="insert into banishment_votes (voteid,modid,time,yes) values (" . $voteid .",". $logged_in_user->getID() .",". $now .",1)";
$query="insert into banishment_votes (voteid,modid,time,yes) values (" . $voteid .",". $logged_in_user->id .",". $now .",1)";
$result = mysql_query($query);
if (!$result) {
echo "Database error attempting to insert to banishment_votes table.<p>";
@ -123,7 +123,7 @@ function vote_no($config,$logged_in_user,$user) {
}
$voteid=$foobar->voteid;
// Check whether mod has voted already.
$query="select count(id) as count from banishment_votes where voteid=".$voteid ." and modid=".$logged_in_user->getID();
$query="select count(id) as count from banishment_votes where voteid=".$voteid ." and modid=".$logged_in_user->id;
$result = mysql_query($query);
$foobar = mysql_fetch_object($result);
if (!$foobar) {
@ -136,7 +136,7 @@ function vote_no($config,$logged_in_user,$user) {
return 0;
}
// insert the vote
$query="insert into banishment_votes (voteid,modid,time,yes) values (" . $voteid .",". $logged_in_user->getID() .",". $now .",0)";
$query="insert into banishment_votes (voteid,modid,time,yes) values (" . $voteid .",". $logged_in_user->id .",". $now .",0)";
$result = mysql_query($query);
if (!$result) {
echo "Database error attempting to insert to banishment_votes table.<p>";

View File

@ -91,7 +91,7 @@ if ($user->prefs->pm_notification){
}
row2("Private message email notification",
"<input type=\"checkbox\" id=\"pm_notification\" name=\"pm_notification\" ".$pm_notification.">
<label for=\"pm_notification\">Notify about new private messages by email</label>"
<label for=\"pm_notification\">Send email notification of new private messages </label>"
);
if ($user->prefs->hide_avatars){

View File

@ -3,6 +3,7 @@ $cvs_version_tracker[]="\$Id: forum_moderate_post_action.php 13718 2007-09-30 11
require_once("../inc/forum_db.inc");
require_once("../inc/forum_banishment_vote.inc");
$config = get_config();