[Slashdotjp-dev 1139] [666] * Show mobile mode page when useragent matches " mobile_useragent_regex"

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 6月 19日 (木) 18:00:09 JST


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

Log Message:
-----------
* Show mobile mode page when useragent matches "mobile_useragent_regex"

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


-------------- next part --------------
Modified: slashjp/branches/2.5.0.192/Slash/Apache/Apache.pm
===================================================================
--- slashjp/branches/2.5.0.192/Slash/Apache/Apache.pm	2008-06-19 08:20:26 UTC (rev 665)
+++ slashjp/branches/2.5.0.192/Slash/Apache/Apache.pm	2008-06-19 09:00:09 UTC (rev 666)
@@ -394,6 +394,13 @@
 			if ($gSkin->{skid} == $constants->{mainpage_skid}) {
 				$r->filename("$basedir/$base.shtml");
 				$r->uri("/$base.shtml");
+				if ($constants->{mobile_enabled}) {
+					if (($constants->{mobile_useragent_regex} &&
+					     $r->header_in('user-agent') =~ $constants->{mobile_useragent_regex}) ||
+				            $r->args() =~ m{\bm=[1-9a-zA-Z]}) {
+						$r->uri($constants->{mobile_urlpath}."/$base.shtml");
+					}
+				}
 			} else {
 				$r->filename("$basedir/$gSkin->{name}/$base.shtml");
 				$r->uri("/$gSkin->{name}/$base.shtml");

Modified: slashjp/branches/2.5.0.192/debian/changelog
===================================================================
--- slashjp/branches/2.5.0.192/debian/changelog	2008-06-19 08:20:26 UTC (rev 665)
+++ slashjp/branches/2.5.0.192/debian/changelog	2008-06-19 09:00:09 UTC (rev 666)
@@ -29,8 +29,9 @@
   * 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
+  * Show mobile mode page when useragent matches "mobile_useragent_regex"
 
- -- Taku YASUI <tach****@osdn*****>  Thu, 19 Jun 2008 08:11:19 +0000
+ -- Taku YASUI <tach****@osdn*****>  Thu, 19 Jun 2008 08:59:14 +0000
 
 slash (2.5.0.192-12) unstable; urgency=low
 


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