DAT Stuff

Random thoughts and observations from DAT

Archive for the month “April, 2013”

Crapcha!

Tired of hard-to-read CAPTCHAs?  Try this:

Mobile Wiki Skin

The next step in reviving my wiki was to make it accesible on my iPhone.  A quick trip through Google, and I found an answer on Stack Overflow. I installed the extension and the skin, and it worked – for the most part.  It did format the content nicely, but I saw the following error at the top of the page.

WPtouchError

I haven’t done much with MediaWiki skins, but was hoping it wouldn’t be too hard to fix. So I searched my MediaWiki skins directory for the problematic function, and the following lines stood out:

I changed WPtouch.php to make it consistent with Vector.php, and the error went away. Following is a diff of the before (top) & after:

I also changed the Display_Actions flag, to enable mobile edits (among other things).  It worked, but the Portrait mode needs a little tweaking:

Portrait: Portrait

Landscape: Landscape

It’s not pretty, but it seems to work fine in landscape mode, so I’ll leave it alone for now.  If you’re on a mobile device, you can see it here: datguy.net/wiki

EDIT: I thought that there might be a newer version of the skin.  The Stack Overflow answer links to a 2010 page, but the mediawiki gallery links to a 2012 update.  I examined the download links and they seem to be the same.

Also, after posting my solution I got a reply from someone that had the same problem, and his solution to the “Actions” problem in portrait mode was to change the “Personal tools” text.  I changed mine to “My tools” (in ./languages/messages/MessagesEn.php), and that was enough to prevent Actions from wrapping onto the second line.

 

It’s alive!

I recently brought my wiki back to life at wiki.datguy.net datguy.net/wiki, consolidating my old wikis onto a newly upgraded MediaWiki installation.  After I went through and removed a lot of dead links, I decided it was time to work on the configuration.  The first thing that had to go was the default URL structure (i.e. http://wiki.datguy.net/index.php?title=Main_Page).  I was hoping to simplify it to http://wiki.datguy.net/Main_Page.

I found a page at mediawiki.org describing how to shorten the URL, but it recommended against page names in the root directory, with a link to a warning page.  As much as I want to have pages directly in the root, I didn’t want to deal with the complications yet – so I picked a random letter to use as a virtual directory, resulting in http://wiki.datguy.net/w/Main_Page.

EDIT

That extra virtual directory kept bugging me, so I moved the MediaWiki installation out of wiki.datguy.net into a directory underneath datguy.net, where I could use the /wiki path.  I changed the old domain to redirect to the new location — http://wiki.datguy.net/Main_Page redirects to http://datguy.net/wiki/Main_Page.  However, the wiki subdomain still has the problem that they recommend against — http://wiki.datguy.net/robots.txt is redirected as if it is a regular page, and displays an error when http://datguy.net/wiki/Robots.txt is not found.

Post Navigation