[Slashdotjp-dev 612] CVS update: slashjp/plugins/Search

Back to archive index

Tatsuki SUGIURA sugi****@users*****
2006年 9月 7日 (木) 14:33:50 JST


Index: slashjp/plugins/Search/Search.pm
diff -u slashjp/plugins/Search/Search.pm:1.5 slashjp/plugins/Search/Search.pm:1.6
--- slashjp/plugins/Search/Search.pm:1.5	Fri Jul 14 10:54:26 2006
+++ slashjp/plugins/Search/Search.pm	Thu Sep  7 14:33:50 2006
@@ -1,7 +1,7 @@
 # This code is a part of Slash, and is released under the GPL.
 # Copyright 1997-2005 by Open Source Technology Group. See README
 # and COPYING for more information, or see http://slashcode.com/.
-# $Id: Search.pm,v 1.5 2006/07/14 01:54:26 sugi Exp $
+# $Id: Search.pm,v 1.6 2006/09/07 05:33:50 sugi Exp $
 
 package Slash::Search;
 
@@ -11,7 +11,7 @@
 use vars qw($VERSION);
 use base 'Slash::DB::Utility';
 
-($VERSION) = ' $Revision: 1.5 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.6 $ ' =~ /\$Revision:\s+([^\s]+)/;
 
 # FRY: And where would a giant nerd be? THE LIBRARY!
 
@@ -43,7 +43,7 @@
 	my $columns;
 	$columns .= "primaryskid, url, discussions.uid AS author_uid, discussions.title AS title, ";
 	$columns .= "pid, subject, ts, date, comments.uid AS uid, cid, ";
-	$columns .= "discussions.id AS did";
+	$columns .= "discussions.id AS did, dkid, discussions.sid";
 	$columns .= ", TRUNCATE( "
 		. $self->_score('comments.subject', $form->{query}, $constants->{search_method})
 		. ", 1) AS score "
@@ -92,6 +92,15 @@
 	$other .= " LIMIT $start, $limit" if $limit;
 	my $search = $self->sqlSelectAllHashrefArray($columns, $tables, $where, $other );
 
+	my $desc = $reader->getDescriptions('discussion_kinds');
+	foreach my $c (@$search) {
+		# TODO: may fix in discussion table directly...
+		$desc->{$c->{dkid}} eq 'journal-story' and
+			$c->{url} = $constants->{rootdir}."/article.pl?sid=".$c->{sid};
+		delete $c->{dkid};
+		delete $c->{sid};
+	}
+
 	return $search;
 }
 


Slashdotjp-dev メーリングリストの案内
Back to archive index