svnno****@sourc*****
svnno****@sourc*****
2008年 9月 19日 (金) 12:45:55 JST
Revision: 761 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=761 Author: tach Date: 2008-09-19 12:45:55 +0900 (Fri, 19 Sep 2008) Log Message: ----------- add getThemeType() method to check theme type Modified Paths: -------------- slashjp/branches/2.5.0.192/plugins/Journal/Journal.pm slashjp/branches/2.5.0.192/plugins/Journal/journal.pl -------------- next part -------------- Modified: slashjp/branches/2.5.0.192/plugins/Journal/Journal.pm =================================================================== --- slashjp/branches/2.5.0.192/plugins/Journal/Journal.pm 2008-09-19 03:29:37 UTC (rev 760) +++ slashjp/branches/2.5.0.192/plugins/Journal/Journal.pm 2008-09-19 03:45:55 UTC (rev 761) @@ -338,15 +338,21 @@ sub themes { my($self) = @_; - my $uid = getCurrentUser('uid'); - my $sql; - $sql .= "SELECT name from journal_themes"; - $self->sqlConnect; - my $themes = $self->{_dbh}->selectcol_arrayref($sql); + return [ keys %{$self->{themes}} ] if ($self->{themes}); + my $sql = "SELECT name,type from journal_themes"; + $self->{themes} = $self->sqlSelectAllKeyValue('name,type', 'journal_themes'); - return $themes; + return [ keys %{$self->{themes}} ]; } +sub getThemeType { + my ($self, $theme) = @_; + + return undef unless ($theme); + $self->themes unless ($self->{themes}); + return $self->{themes}{$theme}; +} + sub searchUsers { my($self, $nickname) = @_; my $slashdb = getCurrentDB(); Modified: slashjp/branches/2.5.0.192/plugins/Journal/journal.pl =================================================================== --- slashjp/branches/2.5.0.192/plugins/Journal/journal.pl 2008-09-19 03:29:37 UTC (rev 760) +++ slashjp/branches/2.5.0.192/plugins/Journal/journal.pl 2008-09-19 03:45:55 UTC (rev 761) @@ -591,7 +591,7 @@ my $show_discussion = $form->{id} && !$constants->{journal_no_comments_item} && $discussion; my $zoo = getObject('Slash::Zoo'); - slashDisplay($theme, { + slashDisplay('theme_'.$journal_reader->getThemeType($theme), { theme => $theme, articles => \@sorted_articles, uid => $uid,