svnno****@sourc*****
svnno****@sourc*****
2008年 6月 16日 (月) 16:10:09 JST
Revision: 661 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=661 Author: tach Date: 2008-06-16 16:10:09 +0900 (Mon, 16 Jun 2008) Log Message: ----------- * Fix: Automatic adding related stories and comments - Check sid existance - Select enable/disable to add related comments using variable "related_cid_disabled" Modified Paths: -------------- slashjp/branches/2.5.0.192/debian/changelog slashjp/branches/2.5.0.192/plugins/Admin/admin.pl slashjp/branches/2.5.0.192/sql/mysql/defaults.sql -------------- next part -------------- Modified: slashjp/branches/2.5.0.192/debian/changelog =================================================================== --- slashjp/branches/2.5.0.192/debian/changelog 2008-05-20 01:12:51 UTC (rev 660) +++ slashjp/branches/2.5.0.192/debian/changelog 2008-06-16 07:10:09 UTC (rev 661) @@ -19,8 +19,12 @@ * Add feature to enable/disable PERL / RAWPERL directives on Template - use constant 'enable_template_evalperl' * Add feature to create slashhead/slashfoot file for mobile mode + * Fix: Automatic adding related stories and comments + - Check sid existance + - Select enable/disable to add related comments using variable + "related_cid_disabled" - -- Taku YASUI <tach****@osdn*****> Tue, 20 May 2008 01:11:50 +0000 + -- Taku YASUI <tach****@osdn*****> Mon, 16 Jun 2008 07:07:32 +0000 slash (2.5.0.192-12) unstable; urgency=low Modified: slashjp/branches/2.5.0.192/plugins/Admin/admin.pl =================================================================== --- slashjp/branches/2.5.0.192/plugins/Admin/admin.pl 2008-05-20 01:12:51 UTC (rev 660) +++ slashjp/branches/2.5.0.192/plugins/Admin/admin.pl 2008-06-16 07:10:09 UTC (rev 661) @@ -1589,7 +1589,11 @@ # Extract sids from urls in introtext and bodytext foreach ($form->{introtext}, $form->{bodytext}) { next unless ($_); - push @$related, $1 while /$match/g; + while (/$match/g) { + next unless $slashdb->getStory($1); + push @$related, $1; + } + next if ($constants->{related_cid_disabled}); push @$related_cids, $1 while /$match_cid/g; } Modified: slashjp/branches/2.5.0.192/sql/mysql/defaults.sql =================================================================== --- slashjp/branches/2.5.0.192/sql/mysql/defaults.sql 2008-05-20 01:12:51 UTC (rev 660) +++ slashjp/branches/2.5.0.192/sql/mysql/defaults.sql 2008-06-16 07:10:09 UTC (rev 661) @@ -1148,6 +1148,7 @@ INSERT IGNORE INTO vars (name, value, description) VALUES ('mobile_encoding','Shift_JIS','Content encoding for mobile webpages (static html files)'); INSERT IGNORE INTO vars (name, value, description) VALUES ('mobile_staticdir','','Path for mobile static html files (disabled if empty)'); INSERT IGNORE INTO vars (name, value, description) VALUES ('enable_template_evalperl','0','Add "EVAL_PERL" to Template option to be able to use "PERL" and "RAWPERL" directives'); +INSERT IGNORE INTO vars (name, value, description) VALUES ('related_cid_disabled','0','If set, then disable inserting cid to related story list'); UPDATE vars SET value='text/html; charset=UTF-8' WHERE name='content_type_webpage'; UPDATE vars SET value='0' WHERE name='draconian_charset'; UPDATE vars SET value='UTF-8' WHERE name='rdfencoding';