Yoshihisa Fukuhara
higef****@users*****
2006年 3月 8日 (水) 00:47:48 JST
Index: affelio/apps/diary/Diary/ShowDiary.pm
diff -u affelio/apps/diary/Diary/ShowDiary.pm:1.5 affelio/apps/diary/Diary/ShowDiary.pm:1.6
--- affelio/apps/diary/Diary/ShowDiary.pm:1.5 Wed Mar 8 00:24:59 2006
+++ affelio/apps/diary/Diary/ShowDiary.pm Wed Mar 8 00:47:48 2006
@@ -65,14 +65,20 @@
$diary->errorExit("The specified article does not exist") unless existsEntry($diary,$id);
debug_print("Diary::ShowDiary::get diary. $id");
+ my $category="";
my $entry = getEntry($diary,$id);
my ($sec, $min, $hour) = localtime($entry->{timestamp});
-
- my $category = $diary->getColumn("select category from $diary->{category_table} where id=$entry->{c_id}");
-
+ debug_print("Diary_test::ShowDiary::show cate1.");
+ my $query="select category from $diary->{category_table} where id=$entry->{c_id}";
+ eval{
+ my $sth = $diary->{dbh}->prepare($query);
+ $sth->execute;
+ };
+ if (!$@){
+ $category = $diary->getColumn("select category from $diary->{category_table} where id=$entry->{c_id}");
+ }
debug_print("Diary::ShowDiary::get diary. $entry->{title}");
-# Diary
my $images="";
if (!($entry->{contents} =~ s/<image=\"([A-Za-z0-9\-\_]*\.(jpg|png|gif|bmp|jpeg))\">/<a href=\"show_image.cgi\?id=$entry->{id}&filename=$1&size=l\"><img src=\"show_image.cgi\?id=$entry->{id}&filename=$1&size=s\" border=\"0\"><\/a>/ig)){
$images=getUploadedImages($diary, $entry->{id}, 300, 300);
@@ -89,7 +95,6 @@
$output_ref->{"IMAGES"} = $images;
$output_ref->{"USERNAME"} = $entry->{user};
-
# Comment
if($diary->getCommentsNo($id) > 0) {
$output_ref->{"HAS_COMMENTS"} = "1";
@@ -109,7 +114,6 @@
$output_ref->{"COMMENTS"} = \@comments_param;
}
-
$output_ref->{"install_title"} = $diary->{afap}->get_app_info("install_title");
debug_print("Diary::ShowDiary::show end.");
}