Configuració

(ho sento, encara no he tingut temps de traduir la pàgina)

This page explains how is this site built and how does it work.

General characteristics

The whole site is installed and runs on a hired hosting service. The main pieces of the installation are three different free software applications — WordPress, MediaWiki and BibCiter — that share a unique header and footer, including styles.

Thus, there is a folder called “common” that contains these common files retrieved by the other applications. The three of them have been (easily) purged so that only the “bodies” and “sidebars” remain in their respective places, then calling the rest of the pieces from the common folder, at the same time passing some parameters so that these common parts adapt some things (e.g. to highlight the section you’re visiting at the menu bar).

The static pages — except for a reduced number of them — are part of the blog installation, which acts as the main framework for the site.

Blog

The blog runs with a WordPress installation. The main plugins installed are Exec-PHP — which allows including PHP code in your posts, used here to be able to “share” the posts with the Review section — and MediaWiki Markup for WordPress — which lets you easily include links to (in this case) the Wiki section of the site.

As said, most of the static pages are made with this installation, that works perfect as a Content Management System. As per static pages, they usually have their own templates, which means, among other things, different sidebars (e.g. the Bio section).

Bibliography

The Bibliography runs on a BibCiter installation. No big comments here except the afore mentioned necessary coding so that BibCiter calls the common headers, footers, styles and javascript files.

Wiki

No big news here either. The Wiki section runs with MediaWiki and has also been adapted to call the common files. That certainly required more time and attention, but once it’s done, you find it easier to do than it appeared at first sight.

Hint: with MediaWiki, do not try to adapt an existing template. Begin from scratch: take (for instance) your WordPress template, clear out all of the blog functions, and then add, one by one, the MediaWiki functions.

The MediaWiki installation has an added plugin: the SlideShare Widget Extension, its purpose evident enough.

Events

The Events section is a second WordPress installation, completely independent from the previous one.

It’s main characteristic is the addition of two plugins — Event Calendar and Event Calendar Widget — that add a feature to WordPress so that it can be used as an event manager. At this time there are some other plugins doing the same task, but when I installed it, this was the best one I could find (and still might be, don’t know…).

FAA: No, I did not wanted to have my blog posts messed up with the events, this why two different installations with their respective independent databases.

Review

First things first: the Review is almost the same this as the blog. Better said: the Review is exactly the blog’s articles but the least relevant ones (e.g. announcements, posts about the setup of the blog, etc.) and in the formal shape of a review.

The question here is how to avoid copying the articles from one place to the other, or how to switch the template to make the Blog and the Review look different. The solution is as follows.

There are two different WordPress installations: one for the Blog, another one for the Review, each one with its own templates (though sharing the common files, blah, blah, blah). But they work with the same database. Yes, they do. As WordPress keeps information about URLs and templates in the database (not in a config file, which would make things pretty easier to solve), some hacking is needed.

First, you have to duplicate the following options in the options table of your WordPress database: siteurl, template, home, stylesheet, blogname (last two optional). You have to also give them a new name (see example below) and assign them the values corresponding to your alternate installation (in this case, the Review’s). Then, add some lines to the wp-includes\functions.php file in the alternate installation (in the example below, the last five lines) just after the place (the first line in the example) where the get_option is defined:

function get_option( $setting ) {

  if ($setting ==  'siteurl') {$setting = 'siteurl_review';}
  if ($setting ==  'template') {$setting = 'template_review';}
  if ($setting ==  'home') {$setting = 'home_review';}
  if ($setting ==  'stylesheet') {$setting = 'stylesheet_review';}
  if ($setting ==  'blogname') {$setting = 'blogname_review';}

By doing so, we intercept WordPress and force it to look at the options we want and not the ones that it would normally be reading. Then, you can forget about the Review installation. Each month, I just create a new page in the Blog installation with the table of contents of that month’s issue and update the sidebar of the Review. No need to copy the articles. No need to do anything more at all.

Hint: to avoid trouble, it’s good that you keep your alternate installation with exactly the same setup (version, plugins) than your primary one.

Hint: even if you’re not actually using your alternate installation’s database, it’s good to keep it as a backup of your primary one, so export/import exercises between both are a good practice.

Bio

As we have described before, most of the Bio section is made with the main WordPress installation by creating pages in it. A different template with a different sidebar is being used for this static pages.

The contact section — with its own template — is but a couple of pages (contact form and return from the contact form) with a little bit of code to draw the form and send its data by e-mail. There’s plenty of info out there. I don’t even remember where I got it, but I could code it now by myself. Honestly: no difficult at all.

The highlights section is yet another page with a different template. It does, nevertheless, get most of its information from an independent file that actually holds the highlighted items. This is done because this information is also called from the 404 error page (different template, same sidebar).

Works

The Works section is an alternate installation of BibCiter that retrieves data from the same database than the one used for the Bibliography while keeping different look and feel. Unlike WordPress, this is done very easily with BibCiter, by just changing in the config.php the parameters that you need. In my case, besides the evident (different URLs), I had to add the following line:

$oneauthor_id = 1;

so that BibCiter shows only the works of the author whose ID = 1 (me). Doing so, I can use BibCiter as a bibliographic manager, repository and publisher only for my own works.

Share: