Installing Drupal

Now, we have arrived at the fun stuff. I am going to install Drupal on my local server first and at the end, I'll duplicate the installation to my web server section 9.11 . Let's get started 2. Upload the Drupal files to your web server, look for the hidden files as well Be sure to use the binary upload mode in your ftp program2. 2The FTP programs I prefer are gFTP and Konqueror for Linux, and Firefox's FireFtp Add-on cross-platform . 3. Check that all file permissions are set to 755 chmod 755...

This code will float the fields next to each other Displaying it in the profile

The photo gallery is a part of the user profile page, so this is where we want to display it. We can get it there by using almost the same technique as with the avatar. Instead of doing it the same way with a Views panel , we'll explore a slightly different way of embedding views into panels with a Views block . We'll create a Views block that's called Photogallery fig 5.3 2. Row style nodes no teasers or links . 4. The empty text is a bit elaborate5 mynode content_profile_load profile, idn1...

Community status

First, let's take a look at a way to integrate with Facebook itself. Since Facebook publishes your status as a RSS feed, it is possible to display a user's Facebook status on your Drupal site. The module Facebook Status will help you through the process. Our options stretch much further though. The module Twitter allows you to aggregate your user's status from Twitter. The crown to it all is the Activity Stream module fig 7.13 , which tracks your users on any site you want. Their own blogs,...

More Panels

We'll create a separate panel for each content type, in order to display the node itself fig 6.6 . This means that, whenever somebody clicks on a question, showcase, job offer, etc. S he will be taken to a panel page with that particular content in it. This works in exactly the same way as with the Photo Gallery panel page section 5.1.2 . We alter the context node ID to include displays for the other content types. Each of these content types will get its own menu in the content section of the...

What you can do right now

Very often, users register because they want to reply to a post, ask a question, etc. Once they have done that, you need to inform them about what else they can do. I have created a block to put on the front page fig 9.2 that will do just that. For each thing they can do, I've uploaded small icons in sites default files icons 12. Here is the code of the block Heie a f a few things you can do right now Share your List a Ask a Show off your knowing job question sites Heie a f a few things you can...

Adding a nice button that links to the profile

We don't want to completely take over the My Account page, because some modules might actually add useful information to this page. So the users will have a My Account page, where they can manage their password etc and a profile page with their social preferences and information about themselves. In section 4.2.1 we have already added the teaser of the profile to the My Account page. Let's make this a bit fancier, so people will click on it more easily. We will replace the default teaser with a...

User tag cloud

A tag cloud is a cloud of keywords, each of different size, depending on their popularity fig 5.19 . In this case, they refer to the keywords that our users specified in their profiles section 4.2.4 . The Tagadelic module gives us the possibility to create a user tag cloud. This module provides a block on the block administration page that says Tags in Some keywords about me or the name of your user tags vocabulary . We can configure the name of the block to something more easy to understand,...

Configuring the node display

The gallery looks great in the profile, but if someone clicks on the title it will simply display the node, which looks less than optimal. We can overtake this node by a panel page, like we did with the profile. We just modify the profile panel to include a content display for photo gallery nodes as well. Just edit the node ID context of the profile panel at to also provide a display for photogallery. We can arrange this display in any way we like, by adding blocks and panes to it at One custom...

Community features

Drupal Standardforum

In this chapter, we'll further explore some community features. Most of these facilitate the communication between users and allow them to find each other. Remember our common location requirement from the first chapter It's important that the users feel connected somehow. Drupal offers us a standard forum module fig 7.1 , which is simple and quite good, so it really does not need a big explanation. You just enable the module and you are good to go. Since forum posts are basically just nodes...

User points

A nice added feature for your site is the Userpoints module. This allows your users to earn points or karma, or whatever you want to call it, by posting certain content. Since the module provides an API, other modules can easily build upon it. What this means for us is that our users can earn points, not only by posting content, but also by voting, inviting other users, buying products, logging in etc. There is a module available that saves you the time of downloading each module separately. It...

Image gallery content type

Up until now, we have only used an image for the avatar. The handling of the photo gallery images is going to be done in a very similar way, using Imagefield, Imagecache and Thickbox. Only this time, we are going to create a new content type to hold the photo gallery images, instead of adding a field to the profile. 1. Create a new content type admin content types and call it Photo Gallery of the type photogallery 1Drupal 5 users Use this content type as a nodeprofile for users with maximum...

Special offer Download Drupalfun

Due to popular demand, I have decided to make the source code of drupal-fun.com available for download. Drupalfun is the showcase of this ebook, and has been updated to use the latest modules. Get your copy here The Drupalfun v2.0 package contains all the files of the Drupalfun.com site, as it is now. configured database without content . All modules have been updated to the latest versions today at May 22th, 2009 and include With this package and some basic knowledge on how to set up a Drupal...

Fan one way

This will allow our users to become friends after approval by the other party. Users can also become a fan of other users. An extension that you could add here, would be to create a relationship called hero, which is automatically implied after someone becomes a fan of the hero fig 7.7 . Check this it the requestee must approve the relationship After how many days should a request of this type be removed Ofor never Check this if this relationship should only go one way ex Manager, Subscriber...

Multiple Albums per User

We also have the option to give our users multiple picture albums. This option requires a slightly different approach, which I did not implement at Drupalfun. Still, I want to elaborate on it. In the case of multiple albums per users, the photo album content type, should not be a content profile, but instead just a regular content type. We would need a view called My Photo Albums, to embed on the profile panel page. This view should display all of the albums nodes of type photogallery of the...

Menu link to my profile

We are going to create a button or a text link My profile to put in a sidebar block. This will offer the users a direct way to access their profile. The code used in the block is the following lt php global user myuid user- gt uid 11Drupal 5 users remember to replace content_profile by nodeprofile node content_profile_load profile, myuid profile above the name of our content type profileid node- gt nid print l 'My profile','node '. profileid l is a function provided by Drupal that creates a...

Profile fields

Our content profile is configured, but has remained largely empty up until now. Let's start adding the basic information fields, which I'll refer to as profile fields. This step does requires some thinking Do some research and find the best fields for you to add. Some classics are about me, gender, hobbies, job,. . . To define extra fields, we need the CCK module Content Construction Kit . There are dozens of CCK-related modules that define extra field types, such as Date and Link. I recommend...

Figure A photo gallery node Pictures Page

I wanted to give the users the opportunity to browse the latest image galleries fig 5.6 . Therefore, I have created a Views page called pictures. Here are some of the settings of the pictures page fig 5.9 8Note not available with Views 1. To display a grid with Views 1, use the extension module Views Bonus Pack currently alpha version . group multiple values, will give you the album covers. Display it with a new Imagecache preset you create see below . 4. Field user name, label By or just add...

Layout

Even though the node is displayed in a panel, we still need to make sure the layout of the node itself looks alright. In most cases, we can sufficiently control the layout node and teaser from the content type configuration pages at Displaying certain fields and moving their order around is often enough. In the case of the photo gallery however, we have made use of Contemplate to change the node layout section 5.1.1 . We've used the same technique in the case of the showcase site, where we've...

Displaying search results on a map

As mentioned in section 5.4.2, we can use Views to display the node results as a map. The idea is that we display a node with the view, but instead of displaying the normal fields, we display lattitude and longitude in a gmap. Because the markers on the map show the teaser View my profile , we can use a map to display any view that lists profile nodes these have location information . We can again use the filters as we have done in section 5.5.1. The following settings are critical in your node...

Showing the avatar

Our goal is to display the avatar on the left column of the panel, next to the profile, like in fig 4.1. In order to achieve this, we have to create a pane that shows only the avatar. The incredible Views module lets us do just that. Let's start by making a few preparations to handle the images correctly. Drupal is not that great on its own with images. However, with the Imagecache, Imagefield and Thickbox modules enabled, it will provide incredible and nice looking overall image handling. The...