# Creating A Slideshow Using Views Slideshow In Drupal 7

Recently I’ve been trying to rebuild a website I previously built for a Malaysian company using Drupal. When I first made that website, I created a small content management system from scratch using PHP. It was part of a technical exercise for me, and it was only after that that I realised how faster and easier it would have been if I had built it using ready-made content management systems (CMS) like Drupal or Joomla.

For this particular website, I needed to recreate a slideshow which is displayed on the front page. I googled for tutorials and found that the easiest way to achieve this is through the use of the Views module, in particular the Slideshow sub-module. Unfortunately, the tutorials and how-tos I came across for setting up a simple slideshow were poorly written and very difficult to understand. After I finally got my slideshow up and running, I decided that it was best for me to write this small tutorial for others who want to do the same, and also for myself as a reference note for future use in case I ever need it.

# Setting up Wysiwyg editor + IMCE in Drupal 7

Once you’ve set up your Drupal installation, you will undoubtedly want to start adding contents. The Filtered HTML format works for the most parts, but what if you wanted to add tables or images into your content? Well, that where the Full HTML format comes in handy. But let’s face it, not everyone is a coder, and HTML is pretty much Greek to them (unless you are Greek, of course).

This is where What You See Is What You Get (Wysiwyg) editors come in handy. Wysiwyg editors allow users to write content as they would on any word processor such as Word. You can set the text format, font size and colour of the content and see how it would look like once it’s published. You can also insert tables and images and position them anywhere you’d like within your content (to a certain degree), and you don’t even need to know any HTML to achieve this. The Wysiwyg editor does that for you.

Unfortunately, Drupal 7 does not come with a Wysiwyg editor as standard like, for example, Wordpress does. But that’s OK, because I’m going to show you how to quickly get a Wysiwyg editor up and running in Drupal. This tutorial will also cover instructions on how to set up a file manager to use with your Wysiwyg editor.

# Creating a Multilingual Drupal site

Recently I’ve been working a lot with MODX, and in case you don’t know what MODX is, it’s a great content management system designed with PHP developers, such as myself, in mind. You can check it out here.

The projects I have been working on using MODX are mostly multilingual sites. MODX Evolution has a great multilingual module called YAMS (Yet Another Multilingual Solution) and it allows me to create a page with multiple resources in multiple languages. Did that sound right? Well, basically you can have a page in multiple languages, and you can switch between languages by modifying the URL - usually by adding a two-letter combination of the language you want (eg. en for English, fr for French, ru for Russian). This is great, because all the pages can use the same template so they all look the same, but by adding a language tag to the URL visitors can view the same page in different languages.

Then I wanted to make the same thing work in Drupal. I got to know that there’s also a multilingual solution for Drupal, namely the Internationalization module. I went through a few tutorials that explained how to set this up, which was fine, but it was until I found this tutorial that I managed to get a multilingual front page up and running.

So in this tutorial, I’ll be showing you how to set up a multilingual site with a fully functioning multilingual front page and nice clean URL paths to boot.

# Get N Items From Multiple Arrays With Condition

The title may be a bit confusing, but recent I have come to need a function that retrieves the latest items from my database object arrays in one of my PHP project. I have three object arrays obtained using the mysql_fetch_object function, and I needed to get the latest items based on the timestamp they were posted. Before you tell me I should have used better SQL queries, I should mention that the MySQL tables have different data structures, but with the same column names.

I googled around hoping that there would be some simple solution to my needs – a function that will retrieve a preset number of items based on a condition from an array and output them as a new array. But the search was taking too long and Google was showing me too many irrelevant results. This prompted me to write my own solution, as usual.

# Tutorial: How to enable PHP5's imageantialias on Ubuntu 10.10

I am currently working on a small project that requires me to use Apache on a Linux server. Since I am more accustomed to Ubuntu, I decided to install Ubuntu 10.10 on one of my virtual machines. So I installed everything I needed like Apache, MySQL and PHP5. Unfortunately, when I ran my PHP script, I hit a small problem. I kept getting an error 500 and it turned out that apparently the function imageantialias was not available in the PHP installation on my server.

After a bit of research, it turned out that the GD package used in Ubuntu is different to that used in other Linux distros. I looked around for a viable solution and finally discovered that the best way to overcome this problem was to compile PHP5 from source. Here’s how I did it.