Yoshihisa Fukuhara
higef****@users*****
2006年 5月 19日 (金) 02:23:37 JST
Index: affelio/apps/bb/bb/Category.pm
diff -u affelio/apps/bb/bb/Category.pm:1.1 affelio/apps/bb/bb/Category.pm:1.2
--- affelio/apps/bb/bb/Category.pm:1.1 Thu Mar 23 12:46:14 2006
+++ affelio/apps/bb/bb/Category.pm Fri May 19 02:23:37 2006
@@ -104,7 +104,7 @@
my @same = $self->getall("SELECT category_id FROM $self->{category_tb} WHERE title='$title'");
$self->errorExit('<AF_M text="A category of the proposed name already exists.">') if($#same >= 0);
- $self->{dbh}->do("INSERT INTO $self->{category_tb} (title, timestamp, update_time, user, afid, last_user, last_afid, lock, ord) VALUES ('$title', $time, $time, '$user', '$afid', '$user', '$afid', 0, 0)");
+ $self->{dbh}->do("INSERT INTO $self->{category_tb} (title, timestamp, update_time, user, afid, last_user, last_afid, locked, ord) VALUES ('$title', $time, $time, '$user', '$afid', '$user', '$afid', 0, 0)");
}
##############################################
Index: affelio/apps/bb/bb/Comment.pm
diff -u affelio/apps/bb/bb/Comment.pm:1.5 affelio/apps/bb/bb/Comment.pm:1.6
--- affelio/apps/bb/bb/Comment.pm:1.5 Wed May 17 11:30:32 2006
+++ affelio/apps/bb/bb/Comment.pm Fri May 19 02:23:37 2006
@@ -40,7 +40,7 @@
my $action = $wi->PTN_mode($cgi->param("action"));
$bb->errorExit('<AF_M text="Please specify the forum.">') if ($bb->{f_id} =~ /ï¾ï½¥D/);
$bb->errorExit('<AF_M text="Please specify the Topic.">') if ($bb->{t_id} =~ /ï¾ï½¥D/ || $bb->{t_id} eq "");
- $bb->errorExit('<AF_M text="This topic is locked.">') if ($bb->getColumn("SELECT lock FROM $bb->{topic_tb} WHERE topic_id=$bb->{t_id}"));
+ $bb->errorExit('<AF_M text="This topic is locked.">') if ($bb->getColumn("SELECT locked FROM $bb->{topic_tb} WHERE topic_id=$bb->{t_id}"));
my $r_id = $wi->PTN_num($cgi->param("r_id"));
my $reply_title = $bb->escape_all($cgi->param("reply_title"));
my $comment = $bb->escape($cgi->param("comment"));
Index: affelio/apps/bb/bb/Forum.pm
diff -u affelio/apps/bb/bb/Forum.pm:1.4 affelio/apps/bb/bb/Forum.pm:1.5
--- affelio/apps/bb/bb/Forum.pm:1.4 Tue May 16 17:38:50 2006
+++ affelio/apps/bb/bb/Forum.pm Fri May 19 02:23:37 2006
@@ -221,7 +221,7 @@
my @same = $self->getall("SELECT forum_id FROM $self->{forum_tb} WHERE title='$title'");
$self->errorExit('<AF_M text="A forum of the proposed name already exists.">') if($#same >= 0);
- $self->{dbh}->do("INSERT INTO $self->{forum_tb} (category_id, title, description, timestamp, update_time, user, afid, pwd, last_user, last_afid, topics, posts, status, lock, ord) VALUES ($category_id, '$title', '$description', $time, $time, '$user', '$afid', '$crypt', '$user', '$afid', 0, 0,0,0,0)");
+ $self->{dbh}->do("INSERT INTO $self->{forum_tb} (category_id, title, description, timestamp, update_time, user, afid, pwd, last_user, last_afid, topics, posts, status, locked, ord) VALUES ($category_id, '$title', '$description', $time, $time, '$user', '$afid', '$crypt', '$user', '$afid', 0, 0,0,0,0)");
my $forum_id=$self->getColumn("SELECT MAX(forum_id) FROM $self->{forum_tb} WHERE category_id = $category_id");
$description =~ s/<br[^>]*>/\n/g;
Index: affelio/apps/bb/bb/PrefSet.pm
diff -u affelio/apps/bb/bb/PrefSet.pm:1.1 affelio/apps/bb/bb/PrefSet.pm:1.2
--- affelio/apps/bb/bb/PrefSet.pm:1.1 Thu Mar 23 12:46:14 2006
+++ affelio/apps/bb/bb/PrefSet.pm Fri May 19 02:23:37 2006
@@ -53,14 +53,14 @@
$title = $bb->escape_all($title);
# updatePreference
- $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$title' WHERE key = 'title'");
- $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$email' WHERE key = 'email'");
- $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$max_topics' WHERE key = 'max_topics'");
- $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$max_comments' WHERE key = 'max_comments'");
- $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$num_topics' WHERE key = 'num_topics'");
- $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$num_comments' WHERE key = 'num_comments'");
- $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$max_sbjlen' WHERE key = 'max_sbjlen'");
- $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$max_textlen' WHERE key = 'max_textlen'");
+ $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$title' WHERE key1 = 'title'");
+ $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$email' WHERE key1 = 'email'");
+ $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$max_topics' WHERE key1 = 'max_topics'");
+ $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$max_comments' WHERE key1 = 'max_comments'");
+ $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$num_topics' WHERE key1 = 'num_topics'");
+ $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$num_comments' WHERE key1 = 'num_comments'");
+ $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$max_sbjlen' WHERE key1 = 'max_sbjlen'");
+ $bb->{dbh}->do("UPDATE $bb->{pref_tb} SET value = '$max_textlen' WHERE key1 = 'max_textlen'");
}
my %pref = $bb->getPreference;
Index: affelio/apps/bb/bb/SetPermission.pm
diff -u affelio/apps/bb/bb/SetPermission.pm:1.1 affelio/apps/bb/bb/SetPermission.pm:1.2
--- affelio/apps/bb/bb/SetPermission.pm:1.1 Thu Mar 23 12:46:14 2006
+++ affelio/apps/bb/bb/SetPermission.pm Fri May 19 02:23:37 2006
@@ -79,7 +79,7 @@
foreach (@perm) {
push @perm_list,
{
- KEY => $_->{key},
+ KEY => $_->{key1},
SUPER => $_->{super},
USER => $_->{user},
};
@@ -95,7 +95,7 @@
my $super = (@$value[0] =~ /S/ || @$value[1] =~ /S/) ? "1" : "0";
my $user = (@$value[0] =~ /U/ || @$value[1] =~ /U/) ? "1" : "0";
- $self->{dbh}->do("UPDATE $self->{permission_tb} SET super = $super, user = $user WHERE key = '$key'");
+ $self->{dbh}->do("UPDATE $self->{permission_tb} SET super = $super, user = $user WHERE key1 = '$key'");
}
}
Index: affelio/apps/bb/bb/Topic.pm
diff -u affelio/apps/bb/bb/Topic.pm:1.5 affelio/apps/bb/bb/Topic.pm:1.6
--- affelio/apps/bb/bb/Topic.pm:1.5 Wed May 17 11:30:32 2006
+++ affelio/apps/bb/bb/Topic.pm Fri May 19 02:23:37 2006
@@ -67,21 +67,21 @@
# Do update
if($action eq "do_update"){
- updateTopic($bb, $new_forum, $bb->{t_id}, $title, $description, $topic->{icon}, $bb->{user}, $bb->{afid}, $status, $topic->{lock});
+ updateTopic($bb, $new_forum, $bb->{t_id}, $title, $description, $topic->{icon}, $bb->{user}, $bb->{afid}, $status, $topic->{locked});
$output_ref->{DONE} = "1";
- $output_ref->{T_ID} = $bb->{t_id};
+ $output_ref->{F_ID} = $bb->{f_id};
$output_ref->{MSG} = "The topic was updated.";
# Lock/unlock topic
}elsif($action eq "lock" && $status_edit){
- updateTopic($bb, $new_forum, $bb->{t_id}, $topic->{title}, $topic->{description}, $topic->{icon}, $bb->{user}, $bb->{afid}, $topic->{status}, abs($topic->{lock}-1));
- if ($topic->{lock}){
+ updateTopic($bb, $new_forum, $bb->{t_id}, $topic->{title}, $topic->{description}, $topic->{icon}, $bb->{user}, $bb->{afid}, $topic->{status}, abs($topic->{locked}-1));
+ if ($topic->{locked}){
$output_ref->{MSG}="The topic was unlocked.";
}else{
$output_ref->{MSG}="The topic was locked.";
}
$output_ref->{DONE} = "1";
- $output_ref->{T_ID} = $bb->{t_id};
+ $output_ref->{F_ID} = $bb->{f_id};
# Confirm delete topic
}elsif($action eq "confirm_delete" && $topic_delete){
$output_ref->{CONFIRM_DELETE} = "1";
@@ -223,7 +223,7 @@
my @same = $self->getall("SELECT topic_id FROM $self->{topic_tb} WHERE title='$title'");
$self->errorExit('<AF_M text="A topic of the proposed name already exists.">') if($#same >= 0);
- $self->{dbh}->do("INSERT INTO $self->{topic_tb} (forum_id, title, description, icon, user, afid, pwd, last_user, last_afid, view, posts, status, lock,timestamp, update_time) VALUES ($forum_id, '$title', '$description', '$icon', '$user', '$afid', '$crypt', '$user', '$afid', 0, 0, $status, 0, $time, $time)");
+ $self->{dbh}->do("INSERT INTO $self->{topic_tb} (forum_id, title, description, icon, user, afid, pwd, last_user, last_afid, view, posts, status, locked,timestamp, update_time) VALUES ($forum_id, '$title', '$description', '$icon', '$user', '$afid', '$crypt', '$user', '$afid', 0, 0, $status, 0, $time, $time)");
my $topic_id=$self->getColumn("SELECT MAX(topic_id) FROM $self->{topic_tb} WHERE forum_id = $forum_id");
@@ -256,7 +256,7 @@
##############################################
sub updateTopic {
- my ($self, $forum_id, $topic_id,$title, $description, $icon,$user, $afid, $status,$lock) = @_;
+ my ($self, $forum_id, $topic_id,$title, $description, $icon,$user, $afid, $status,$locked) = @_;
my $time = time;
$self->checkContent($title, $user, $afid, $description, $icon, "");
@@ -264,7 +264,7 @@
$self->errorExit('<AF_M text="A topic of the proposed name already exists.">') if($#same >= 1);
my $forum_old = $self->getColumn("SELECT forum_id FROM $self->{topic_tb} WHERE topic_id = $topic_id");
- $self->{dbh}->do("UPDATE $self->{topic_tb} SET forum_id = $forum_id, title='$title', description='$description', icon='$icon', status=$status, lock=$lock, user = '$user', afid = '$afid', timestamp = $time WHERE topic_id = $topic_id");
+ $self->{dbh}->do("UPDATE $self->{topic_tb} SET forum_id = $forum_id, title='$title', description='$description', icon='$icon', status=$status, locked=$locked, user = '$user', afid = '$afid', timestamp = $time WHERE topic_id = $topic_id");
if ($forum_old ne $forum_id){
updateForumCount($self,$forum_old);
updateForumCount($self,$forum_id);
Index: affelio/apps/bb/bb/ViewForum.pm
diff -u affelio/apps/bb/bb/ViewForum.pm:1.2 affelio/apps/bb/bb/ViewForum.pm:1.3
--- affelio/apps/bb/bb/ViewForum.pm:1.2 Tue May 16 19:14:01 2006
+++ affelio/apps/bb/bb/ViewForum.pm Fri May 19 02:23:37 2006
@@ -65,7 +65,7 @@
########### Get Topic List ####################################################
@topics = $bb->getall("SELECT * FROM $bb->{topic_tb} WHERE forum_id = $bb->{f_id} ORDER BY status DESC, update_time DESC");
- if ($#topics+1 >= int($bb->getColumn("SELECT value FROM $bb->{pref_tb} WHERE key = 'max_topics'"))){
+ if ($#topics+1 >= int($bb->getColumn("SELECT value FROM $bb->{pref_tb} WHERE key1 = 'max_topics'"))){
$can_add = "";
$opt_msg = '<AF_M text="This forum was cloesd. Please make a new forum.">';
}
@@ -106,7 +106,7 @@
}else{
$icon="normal";
}
- if ($_->{lock} == 1){
+ if ($_->{locked} == 1){
$icon.="_lock";
}
$icon.=".gif";
Index: affelio/apps/bb/bb/ViewTopic.pm
diff -u affelio/apps/bb/bb/ViewTopic.pm:1.2 affelio/apps/bb/bb/ViewTopic.pm:1.3
--- affelio/apps/bb/bb/ViewTopic.pm:1.2 Tue May 16 19:18:35 2006
+++ affelio/apps/bb/bb/ViewTopic.pm Fri May 19 02:23:37 2006
@@ -54,7 +54,7 @@
####### Can you reply to this topic? ##########################################
$can_reply="1" if ($bb->getPermission("comment_edit"));
- if ($current_topic->{lock}) {
+ if ($current_topic->{locked}) {
$can_reply = "";
$opt_msg = '<AF_M text="This topic is locked.">';
}
@@ -81,7 +81,7 @@
if ($rep_count < 0){
$bb->errorExit("ã³ã¡ã³ãç¨ã®ãã¼ã¿ãã¼ã¹ãåå¨ãã¾ããããã®ãããã¯ã䏿¦åé¤ãã¦ãå度ç»é²ãã¦ãã ããã");
}
- if ($rep_count >= int($bb->getColumn("SELECT value FROM $bb->{pref_tb} WHERE key = 'max_comments'"))){
+ if ($rep_count >= int($bb->getColumn("SELECT value FROM $bb->{pref_tb} WHERE key1 = 'max_comments'"))){
$can_reply = "";
$opt_msg = '<AF_M text="This topic was cloesd. Please make a new topic.">';
}
@@ -89,7 +89,7 @@
########### Set page index ####################################################
use integer;
my @page_index;
- my $num_comments = $bb->getColumn("SELECT value FROM $bb->{pref_tb} WHERE key = 'num_comments'");
+ my $num_comments = $bb->getColumn("SELECT value FROM $bb->{pref_tb} WHERE key1 = 'num_comments'");
my $i = (($rep_count-1)/$num_comments)+1;
my $page_num = $i;
while ($i>0){