Tatsuki SUGIURA
sugi****@users*****
2006年 2月 16日 (木) 09:03:22 JST
Index: slashjp/plugins/Journal/Journal.pm diff -u slashjp/plugins/Journal/Journal.pm:1.4 slashjp/plugins/Journal/Journal.pm:1.5 --- slashjp/plugins/Journal/Journal.pm:1.4 Fri Nov 18 01:46:14 2005 +++ slashjp/plugins/Journal/Journal.pm Thu Feb 16 09:03:22 2006 @@ -1,7 +1,7 @@ # This code is a part of Slash, and is released under the GPL. # Copyright 1997-2003 by Open Source Development Network. See README # and COPYING for more information, or see http://slashcode.com/. -# $Id: Journal.pm,v 1.4 2005/11/17 16:46:14 tach Exp $ +# $Id: Journal.pm,v 1.5 2006/02/16 00:03:22 sugi Exp $ package Slash::Journal; @@ -15,7 +15,7 @@ use base 'Exporter'; use base 'Slash::DB::MySQL'; -($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/; +($VERSION) = ' $Revision: 1.5 $ ' =~ /\$Revision:\s+([^\s]+)/; # On a side note, I am not sure if I liked the way I named the methods either. # -Brian @@ -239,8 +239,10 @@ $self->sqlConnect; my $sql = <<EOT; -SELECT count AS c,nickname,users_journal.uid,date,jid AS id +SELECT count AS c,nickname,users_journal.uid,users_journal.date,jid AS id,description,journals_text.article FROM users_journal JOIN users USING (uid) +JOIN journals ON jid=journals.id +JOIN journals_text ON jid=journals_text.id ORDER BY date DESC LIMIT $limit EOT @@ -248,17 +250,6 @@ my $losers = $self->{_dbh}->selectall_arrayref($sql); return [ ] if !$losers || !@$losers; - my $id_list = join(", ", map { $_->[4] } @$losers); - my $loserid_hr = $self->sqlSelectAllHashref( - "id", - "id, description", - "journals", - "id IN ($id_list)"); - - for my $loser (@$losers) { - $loser->[5] = $loserid_hr->{$loser->[4]}{description}; - } - return $losers; } Index: slashjp/plugins/Journal/journal.pl diff -u slashjp/plugins/Journal/journal.pl:1.9 slashjp/plugins/Journal/journal.pl:1.10 --- slashjp/plugins/Journal/journal.pl:1.9 Wed Nov 9 04:04:13 2005 +++ slashjp/plugins/Journal/journal.pl Thu Feb 16 09:03:22 2006 @@ -2,7 +2,7 @@ # This code is a part of Slash, and is released under the GPL. # Copyright 1997-2004 by Open Source Development Network. See README # and COPYING for more information, or see http://slashcode.com/. -# $Id: journal.pl,v 1.9 2005/11/08 19:04:13 sugi Exp $ +# $Id: journal.pl,v 1.10 2006/02/16 00:03:22 sugi Exp $ use strict; use Slash 2.003; # require Slash 2.3.x @@ -12,7 +12,7 @@ use Slash::XML; use vars qw($VERSION); -($VERSION) = ' $Revision: 1.9 $ ' =~ /\$Revision:\s+([^\s]+)/; +($VERSION) = ' $Revision: 1.10 $ ' =~ /\$Revision:\s+([^\s]+)/; sub main { my $journal = getObject('Slash::Journal'); @@ -308,7 +308,8 @@ push @items, { title => $title, - 'link' => "$gSkin->{absolutedir}/~" . fixparam($entry->[1]) . "/journal/" + link => "$gSkin->{absolutedir}/~" . fixparam($entry->[1]) . "/journal/", + description => strip_notags($entry->[6]), }; }