{"id":1311,"date":"2011-11-16T23:48:08","date_gmt":"2011-11-17T04:48:08","guid":{"rendered":"http:\/\/bitpost.com\/news\/?p=1311"},"modified":"2011-11-25T10:53:58","modified_gmt":"2011-11-25T15:53:58","slug":"wptouch-beautiful-automatic-mobile-skins-for-wordpress-and-mediawiki-in-15-minutes","status":"publish","type":"post","link":"https:\/\/bitpost.com\/news\/2011\/wptouch-beautiful-automatic-mobile-skins-for-wordpress-and-mediawiki-in-15-minutes\/","title":{"rendered":"WPTouch: Beautiful automatic mobile skins for WordPress and Mediawiki in 15 minutes"},"content":{"rendered":"<p>Hey all you bloggers and publishers. If, like me, you&#8217;ve been putting off updating your blogs and wikis to show up nicely on smartphones, fear not, there are DIRT SIMPLE FAST solutions available today to set up special skins for mobile browsers that are gorgeous. As of today, here are the instant solutions.<\/p>\n<p style=\"font-size: large;\">WordPress<\/p>\n<ul>\n<li>Right inside your admin panel in WordPress, click on the Plugins button in the left pane.<\/li>\n<li>Select Add New.<\/li>\n<li>Punch in WPTouch and hit &#8220;Search Plugins&#8221;.<\/li>\n<li>There it is, now install it!<\/li>\n<li>That&#8217;s it. Seriously. You can play with the settings if you want (like <a href=\"http:\/\/qvassist.com\/2010\/techtips\/customizing-wptouch-mobile-plugin\/\" title=\"Change the WPTouch Logo\">changing the logo<\/a>), but you don&#8217;t need to. Wow!<\/li>\n<\/ul>\n<p style=\"font-size: large;\">Mediawiki<\/p>\n<ul>\n<li><a title=\"WPtouch for mediawiki\" href=\"http:\/\/www.mediawiki.org\/wiki\/Manual:Gallery_of_user_styles#WPtouch\">This skin<\/a> is the one you want, but it has a few issues.<\/li>\n<li><a title=\"WPtouch patched\" href=\"http:\/\/thedigitalmachine.com\/files\/WPTouch_mediawiki_skin.tar.gz\">Here<\/a> is a corrected version, use it to take your chance for it to work &#8220;out of the box&#8221; \ud83d\ude42  Download and untar it from within your [mediawiki\/skins] folder.  The changes I made are listed at the end of this post.<\/li>\n<li>Now users can select the skin in their preferences, but we want automatic! Update your LocalSettings.php file to set $wgDefaultSkin as follows:\n<pre><code>if (preg_match(\"\/iphone\/i\", $_SERVER['HTTP_USER_AGENT'])) {\r\n    $wgDefaultSkin = 'wptouch';\r\n} elseif (preg_match(\"\/android\/i\", $_SERVER['HTTP_USER_AGENT'])) {\r\n    $wgDefaultSkin = 'wptouch';\r\n} elseif (preg_match(\"\/webos\/i\", $_SERVER['HTTP_USER_AGENT'])) {\r\n    $wgDefaultSkin = 'wptouch';\r\n} elseif (preg_match(\"\/ipod\/i\", $_SERVER['HTTP_USER_AGENT'])) {\r\n    $wgDefaultSkin = 'wptouch';\r\n} elseif (preg_match(\"\/opera mini\/i\", $_SERVER['HTTP_USER_AGENT'])) {\r\n    $wgDefaultSkin = 'wptouch';\r\n} else {\r\n    $wgDefaultSkin = 'vector';\r\n}<\/code><\/pre>\n<li>Go enjoy it!<\/li>\n<\/ul>\n<p>Easy and beautiful!<\/p>\n<p><!--more--><\/p>\n<p style=\"font-size: large;\">The Gory Details<\/p>\n<p>The following changes were made to the awesome WPtouch mediawiki skin that I believe originally came from <a href=\"http:\/\/www.memorydeleted.com\/?p=210\">here<\/a>.  Update the site paths in this file:<\/p>\n<pre><code>mediawiki\/skins\/wptouch\/css\/style-compressed.css<\/code><\/pre>\n<p>The site paths were changed assuming you followed the <a title=\"Short URLs in mediawiki\" href=\"http:\/\/www.mediawiki.org\/wiki\/Manual:Short_URL\">short url mediawiki setup<\/a> (you definitely should).  So the site paths had to change from [\/mediawiki\/] to [\/w\/].<\/p>\n<p>The logo URL is also wrong, fix it here:<\/p>\n<pre><code>skins\/WPtouch.php<\/code><\/pre>\n<p>It was changed from this:<\/p>\n<pre><code>global $wgSitename, $wgUser;<\/code><\/pre>\n<p>to this:<\/p>\n<pre><code>global $wgSitename, $wgUser, $wgLogo, $wgScriptPath;<\/code><\/pre>\n<p>and this:<\/p>\n<pre><code><img decoding=\"async\" id=\"logo-icon\" src=\"\/apple-touch-icon.png\" alt=\"<?php $this->msg('sitetitle') ?>\" \/>\r\n< a href=\"\/\"><?php $this->msg('sitetitle') ?><\/a>\r\n<\/code><\/pre>\n<p>to this:<\/p>\n<pre><code>\r\n< a href=\"<?php echo $wgScriptPath ?>\"><img decoding=\"async\" id=\"logo-icon\" src=\"<?php echo $wgLogo ?>\" alt=\"<?php $this->msg('sitetitle') ?>\" \/> <?php $this->msg('sitetitle') ?><\/a>\r\n <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hey all you bloggers and publishers. If, like me, you&#8217;ve been putting off updating your blogs and wikis to show up nicely on smartphones, fear not, there are DIRT SIMPLE FAST solutions available today to set up special skins for mobile browsers that are gorgeous. As of today, here are the instant solutions. WordPress Right [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[135,19,24,20],"tags":[],"class_list":["post-1311","post","type-post","status-publish","format-standard","hentry","category-mediawiki","category-opensource","category-php","category-wordpress"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9M11L-l9","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/1311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/comments?post=1311"}],"version-history":[{"count":28,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/1311\/revisions"}],"predecessor-version":[{"id":1345,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/1311\/revisions\/1345"}],"wp:attachment":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/media?parent=1311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/categories?post=1311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/tags?post=1311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}