[Slashdotjp-dev 1138] [665] Fix linkStory() for mobile mode

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 6月 19日 (木) 17:20:27 JST


Revision: 665
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=665
Author:   tach
Date:     2008-06-19 17:20:26 +0900 (Thu, 19 Jun 2008)

Log Message:
-----------
Fix linkStory() for mobile mode

Modified Paths:
--------------
    slashjp/branches/2.5.0.192/Slash/Utility/Display/Display.pm
    slashjp/branches/2.5.0.192/debian/changelog


-------------- next part --------------
Modified: slashjp/branches/2.5.0.192/Slash/Utility/Display/Display.pm
===================================================================
--- slashjp/branches/2.5.0.192/Slash/Utility/Display/Display.pm	2008-06-19 07:19:42 UTC (rev 664)
+++ slashjp/branches/2.5.0.192/Slash/Utility/Display/Display.pm	2008-06-19 08:20:26 UTC (rev 665)
@@ -526,6 +526,7 @@
 
 	my $skin = $reader->getSkin($story_link->{skin});
 	$url = $skin->{rootdir} || $constants->{real_rootdir} || $gSkin->{rootdir};
+	$url = $constants->{real_rootdir} if ($user->{mobile});
 
 	if (!$static && $dynamic) {
 		$url .= "/$script?";
@@ -546,7 +547,11 @@
 		# but we would need to `mv articles mainpage`, or ln -s, and it just seems better
 		# to me to keep the same URL scheme if possible
 		my $skinname = $skin->{name} eq 'mainpage' ? 'articles' : $skin->{name};
-		$url .= "/$skinname" unless ($url =~ /\/${skinname}$/);
+		if ($user->{mobile}) {
+			$skinname = $constants->{mobile_urlpath};
+			$skinname =~ s/^\/*//;
+		}
+		$url .= "/$skinname" if ($skinname && $url !~ /\/${skinname}$/);
 		$url .= "/" . ($story_link->{sid} || $story_ref->{sid}) . ".shtml";
 		# manually add the tid(s), if wanted
 		if ($constants->{tids_in_urls} && $params{tids}) {

Modified: slashjp/branches/2.5.0.192/debian/changelog
===================================================================
--- slashjp/branches/2.5.0.192/debian/changelog	2008-06-19 07:19:42 UTC (rev 664)
+++ slashjp/branches/2.5.0.192/debian/changelog	2008-06-19 08:20:26 UTC (rev 665)
@@ -28,8 +28,9 @@
     - Make same as mainpage story list
   * Change mobile mode default charset from Shift_JIS to UTF-8
   * Fix to specify correct ssi include file for mobile mode
+  * Fix linkStory() for mobile mode
 
- -- Taku YASUI <tach****@osdn*****>  Thu, 19 Jun 2008 07:18:22 +0000
+ -- Taku YASUI <tach****@osdn*****>  Thu, 19 Jun 2008 08:11:19 +0000
 
 slash (2.5.0.192-12) unstable; urgency=low
 


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