Tag Archives: wordpress

ADMIN: This site in mobile browsers

I have a smart phone, too, now – an Android phone – and was curious for how this site looks like in a mobile browser recently:

See the message on Twitter.

The dictionary page as displayed on my phone
The dictionary page as displayed on my phone

The biggest problem at least on mobile Chrome seems to be that the submenus don’t work – in a non-mobile browser, you hover the cursor over a navigation-bar menu item and a submenu pops up in some cases. If on a touchscreen, you tap on an item in the navigation bar with your finger, instead of a submenu popping up and staying there for you to choose maybe an item from the submenu, the page reloads with the link behind the navigation-bar menu item you tapped on, except if you are quick enough to unfocus the link by slightly dragging your finger away to the side. This certainly isn’t optimal, especially since my server logs suggest that rather many visitors use their phone or tablet to access this site, so I think that I should accommodate those visitors.

WordPress is fortunately flexible enough that porting a site from one theme (currently a modification of Twentyeleven) to another isn’t too big of a deal, but it’s still work that I don’t really have the time for right now, what with the semester at university having just started again. I guess, for the time being, just keep in mind that I’m aware that this site isn’t really good to use on a phone and maybe, if you want to more seriously look around here, probably better do so with a non-mobile browser.

Of course, if you know any workable fix for the menu bar issue, let me know. My own googling wasn’t so successful in this regard, except that I found other people have the same problem and were told to simply use a different, more recent theme that’s explicitly marked as suitable for mobile browsers (the buzzword here being “responsive”).

ADMIN: Site layout and Dictionary reworked

As you can see, I’ve reworked the site layout. Actually, this started when I felt like generally reworking the dictionary front- and querying backend some two weeks ago.

Back when I designed the old layout of the site, I just made a hard copy of the theme my design was based on, unaware that it’s much easier and space-saving to simply create a child theme. I’ve done so now, hopefully giving you a still functional way to access this website, in spite of all the CSS styling bells and whistles I couldn’t resist playing with.

As for the dictionary, it’s always annoyed me a little that there were two subpages for searching – one for simple queries, one for more complex ones – that repeated more or less the same (terrible and messy) code also in two separate PHP files that would do the database requests. I’ve now condensed everything into just one file each, i.e. one page for the form presented to users and one file for querying the database. I’ve also rewritten the querying script from scratch, so I hope I didn’t break any functionality. Due to my lack in expertise on MySQL, I wasn’t yet able to make querying tags for dictionary entries possible. I may want to try and find out and add this function later, though. One thing that I managed to add easily, however, is suggesting existing, similar-sounding entries from the database if a search didn’t return any results. This is achieved with MySQL’s SOUNDEX( ) function, which has an anglocentric caveat, though:

This function, as currently implemented, is intended to work well with strings that are in the English language only. Strings in other languages may not produce reliable results.
— MySQL 5.6 Reference Manual

I think it still works OK, though. You can test this by searching, for example, for *tounce.

  • “SOUNDEX(str).” MySQL 5.6 Reference Manual. MySQL. Revision 33321. Oracle, 2012. Web. 1 Dec. 2012. ‹http://dev.mysql.com/
  • Search by tags is possible as well now after some more tinkering, but note that so far, only rather recent additions to the dictionary have been tagged. Since I’ve recently added a whole bunch of vulgarities, don’t be surprised if you get a whole lot of entries for naughty words.

Simple Interlinear Glosses Shortcode Plugin for WordPress

  • I don’t actively develop this plugin anymore, since things have so far been working reasonably well enough for my purposes. For something more modern and Javascript based, you may want to have a look at Leipzig.js.

[Last updated: 2012-02-16] For a long time I’ve been slightly annoyed of formatting interlinear glosses in HTML by hand. I had hoped that there would be a plugin for WordPress at least, as a widely used content management system, that would do things automatically and to my liking. But as far as I can tell, nobody has published anything like that so far. Thus, I finally tried and programmed a shortcode plugin for very simple interlinear glosses myself, hoping that it may be useful for others, too. Especially blogging linguists and conlangers, of course 🙂 Continue reading Simple Interlinear Glosses Shortcode Plugin for WordPress

ADMIN: Media Page and Advanced Search

Over the past weeks I’ve tweaked the “Media” page and the “Advanced Search” page of the dictionary a little. I hope that it’s clearer now that you can actually click on the headings on the left side so as to get the menu for that heading. Hovering over a heading turns its background gray, and the mouse pointer changes to the one used for links to suggest that this element is clickable. Continue reading ADMIN: Media Page and Advanced Search

Base converter shortcode WordPress plugin

A plugin to convert numbers in base 10 to other number bases, including their decimal places. You can insert this into pages and posts with a shortcode:

[​base no="NUMBER" base="BASE TO CONVERT TO" prec="DECIMAL PLACES" show="SHOW BASE AS INDEX"​]

  • no is a real number, decimal places are set off by a dot, so a valid input is e.g. 12.3456.
  • base is the base you want to convert to as an integer, e.g. 12.
  • prec is an integer number that defines how many places you want after the decimal point. If you leave this out, the number returned will have the same number of places after the dot as the input. A valid input would be e.g. 3.
  • show is a boolean value, i.e. either 0 for ‘no’ or 1 for ‘yes’, that enables or disables showing the base of the result as an index after it, like 10A₁₂. If you leave this out, 0 will be assumed.

For example, the following codes gives the following result:

[​base no="1234" base="2" show="1"​]
10011010010₂

[​base no="123.4567" base="16" show="0"​]
7B.74EA

The script can also round up or down:

[​base no="0.142857" base="12" prec="20"]
0.186A348718B4610B5534

The same, shortened to 3 places:
[​base no="0.142857" base="12" prec="3"​]
0.187

The same, shortened to 5 places:
[​base no="0.142857" base="12" prec="5"​]
0.186A3

Download

ADMIN: New old page

I took lots of effort recently to shoehorn this site into WordPress, which replaces my old clumsy custom-built content management system. The contents of the site have been overhauled as well, most importantly the dictionary.

Granted, the tabular layout of the new dictionary may not be as pretty as the file-card records the database spat out earlier, however, this way, maintaining the code is much easier, as well as adjusting the output if fields in the database change. The advanced search of the dictionary now also offers a couple more options, e.g. searching with regular expressions. As the script that queries the dictionary database is now called dynamically by a jQuery function (Yes, you must have Javascript enabled in order to use the dictionary!), forms will not be empty anymore after the request is sent. The only thing the advanced search can’t handle so far is searching by multiple attributes of a word, that is, something along the lines of “Return all words that are 3rd person singular animate,” which would return a number of pronouns. At the time of writing this, building such a function with MySQL seems a little overkill, as you’d ideally do it with Temporary Tables or Views and I still need to read up on that. However, the advanced search feature of the old website couldn’t deal with this either.

The database behind the dictionary is now entirely managed offline on my own computer, where it is safe – hopefully – except for blunders caused by myself. I will occasionally synchronize it with the version that runs on my host’s server. As a means of security which I had overlooked before (shame on me!), the database that is on the web now is only readable and query strings are checked for stray apostrophes and inverted commas, as well as malicious keywords, such as “DROP”. As for the administration frontend, I was surprised how easy it was to construct it with Django only by abstraction from the tutorials on the Django website and with no previous knowledge of Python. No tedious handcrafting of HTML forms and PHP scripts to read and write data for hours on end, yay! Another invisible improvement is that whereas non-ASCII characters were stored as HTML entities (e.g. ā for ā) before, they are stored in plain Unicode format now, as I’ve finally found out why why why the heck Unicode would be stubbornly returned as just question marks and saved as weird things like Ä°, i.e. mistakenly iso-8859-1 encoded Unicode: I didn’t know you need to specify that the MySQL connection use utf-8. It took me 6 freaking years to find that out 😡

As the Daléian script as well as the vine-like script I devised years ago as an experiment are not actually used to write Ayeri, I’ve now removed them from this site. I might put them up again on a separate subpage, though. I’ve also rewritten the Alphabet page almost completely. Also, no inconsistently handwritten graphics there anymore. Yes, there is a font, however it does not yet work as I’d like it to because OpenType is extremely unfriendly towards custom alphabets that are not ciphers of existing alphabets, so I had to use a graphics program to get the diacritics over the consonant letters. I will not yet make a public release of it. Kudos to you if you manage to decipher the writing in the header image 🙂

The archive on the Media page now contains all years on the same page for your enjoyment. For fun, you may want to compare something very old with something very recent…

Another new thing I’ve included is a blog category on “Grammar musings”. There I will put entries that are about my latest thoughts on Ayeri grammar. So far I’ve only posted them on the ZBB, but posting them here will hopefully give you some insight into the process that is behind conlanging. This category will probably not be updated too often, though, as the language is now in a rather stable state.