Book review: Drupal 6 Social Networking

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Anonymous's picture

[First published on http://stevepurkiss.com]

Recently I was lucky enough to be sent a copy of a new Drupal book to review: "Drupal 6: Social Networking" by Michael Peacock, a UK-based web developer and author. Having built social networks for ten years, the last five of those using Drupal, and knowing how hard it can be to know which of the many available approaches to use, I was very interested to see what the book had in store for the prospective reader.

I was pleasantly surprised as whilst the book is quite small compared to some other computer books at 280 pages, Michael managed to cover a wide spectrum of topics in a way which I believe is easy for anyone with the will to sit and try things out to master. Throughout the book he builds the "DinoSpace!", a social network for keepers of pet dinosaurs - always a good thing to do as you can build with each chapter and of course adapt to your particular needs.

Below is an overview of the chapters, followed by my conclusion then some sample content from the book to whet your appetite:

Chapter 1 - "Drupal and Social Networking" covers the usual basics such as What is Social Networking, What is Drupal, installation, and basic configuration, along with a nice little section on why you would want to create your own social network as opposed to joining one - well worth showing the boss or client, and indeed worth a re-read when you get frustrated because you can't figure something out and wondering why you started in the first place ;)

Chapter 2 - "Preparing Drupal for a Social Networking Site" walks the reader through some of the Drupal basics - for example how to manage users, blocks, themes, modules, etc. I particularly liked Michael's description of a Node as not some part of some network but as a single piece of a puzzle placed on your site by you or your site users. I must admit I used this in my 'Drupal 101' tutorial I held recently here in Brighton!

Chapter 3 - "User Content: Contributions, Forums, and Blogs" covers all the major ways of content creation from users - forums, blogs, etc. By the end of this chapter you should have a great overall view of the system and be fired up with lots of ideas on what you want to build!

Chapter 4 - "Users and Profiles" covers custom profile generation and topics such as blog themes and enabling login via OpenID. I must admit through experience I don't use the way Michael describes to extend user profiles as I want them to be nodes, however for the new user adding profile attributes is the easiest way. Profiles are one of the areas of Drupal which is under heavy development so it's always a tricky situation when you want to publish a book on the subject.

Chapter 5 - "Enabling User Interaction" does exactly what it says on the tin and goes through how users can interact with each other, build and maintain relationships, form groups, and provide activity streams like there are on many other networks. As with the previous chapter, this is an area under heavy development so there are a number of options for which modules to use to achieve these goals.

Chapter 6 - "Communicating with our Users" is a relatively short chapter at only 10 pages and covers how you can communicate with your users either individually or via a mailing list. The author details the 'simplenews' module which I have used on many occasion but for some reason omits the 'simplenews_template' module when discussing HTML emails. I'm not sure if he just has the same hate of HTML email as the rest of us, hadn't used the module, or just didn't have the space, but for those who do want to send out HTML emails I would highly recommend using the simplenews_template module.

Chapter 7 - "Improving our Network with Custom Modules" does something very brave and quickly takes the reader through creating a custom module - this one for displaying Dinosaur-friendly venues on a Google map. Creating custom modules is a subject for an entire book however Michael does a good job of providing a little taster for those interested to go and find further material to play with.

Chapter 8 - "Designing our Site" provides an overview of themeing and whilst not covered in the book, at least there is a mention of the starter themes around such as Zen which make it, IMHO, a whole load easier to build your own theme from. The speed that projects such as Zen progress though I understand that the info in a book would have been out-of-date by the time it was published so see why this approach was taken.

Chapter 9 - "Deploying and Maintaining our Social Networking Site" gives a good overview of how you can take measures to secure your site, get it up online, and keep it up-to-date. One 'hack' I would add though is that I find if I have to move a database, for example from a dev machine to a live server, I generally empty out any cache tables as often it can corrupt the importing process. Again I see why this isn't included in a basic book, but could've been put in as an additional note.

Chapter 10 - "Promoting our Site" covers a number of ways you can get the word out about your new site, of course another huge area but a great little kick-start for those now with a lovely new Drupal social network!

Finally there's an Appendix which covers installing the stack - the webserver, database, etc. Since the book was written, Acquia, a company formed by the founder of Drupal and some investors, now have a full one-click install of Drupal with a number of useful modules already included in the distribution. I would highly recommend any new user to visit the Acquia site and take a look around.

Conclusion

With over 4,400 modules, Drupal can be daunting to those wanting to use it, and I wish I'd have had this book around when I first started out!

Whilst it's not comprehensive in coverage of every bit of detail, I believe Michael's book gives the reader enough of an overall grounding in the system and various modules to get their own social network up and running - anything more would just serve to confuse the newbie.

For the more experienced user there are still tips to be learned, especially if you've not built social networks with Drupal, however as an advanced user I'd like to see something like the "Drupal Social Networking Bible" published, but wouldn't like to be the person who has to write it ;)

All in all, a really good book for anyone wanting to delve into Drupal to build a Social Network. A pleasure to read, and I'm honoured to be able to provide a review.

Book excerpts

Drupal 6 Social Networking: Communicating with Users

Our users can communicate with one another, which is great, but quite often as an administrator the need may arise for us to communicate with a user or users on our site. It may be to remind them about the web site or to inform active users about new changes to the site, which they may not have been made aware of.

This article is extracted from the "Drupal 6 Social Networking" book. In this article, you will learn:

  • About mailing lists, and how to use them with our Drupal social network
  • How to use an offline approach for contacting our users
  • How to use blocks of content to get a message across to your users

Getting started

We are going to look at a few different modules, some of which we will use. These need to be installed first, so let's do that now to save us time.

The modules

We need to download the following modules:

And extract them to our sites/all/modules folder, and enable them via the administration interface.

A look back

We have already looked at one very important aspect to communicate with our users - user e-mail settings. Within the User settings page (Administer | User management | User settings), we have a group of settings under the heading User e-mail settings. These are various email templates that are sent to our users upon certain events, such as registration, account activation, password reset, account being blocked or account being deleted. The content of these emails can be very important depending on the nature of the web site. In our Dino Space site, we may use a very informal, welcoming and fun tone for our automated emails. But for a business-oriented social network, we would want to use a much more formal tone.

Modules

Don't forget, many modules also have their own email templates for sending emails to users, all of which can normally be changed easily from their respective sections in the administration area.

Communicating on an individual basis

As we have installed the contact form module on our site, we can also communicate with our users on an individual basis using the contact forms on their profiles. This is handy for those times when we do need to contact an individual user, maybe because of complaints against them by other members of the community, or perhaps to invite them to become a moderator or contributor to the site.

Alternatively, we can contact the user directly via their email addresses listed in their accounts, as this is viewable from the administration area.

Inactive users

We may wish to contact users who have not been active on the site for a long time, to remind them that the site is still there, and that they would be welcome to become active in the community once again. Drupal records the time a user was last active, which allows us to easily sort the list of users by their activity.

A module (Inactive user) is available for Drupal 5, which is intended to contact inactive users automatically, but (at the time of writing this) one is not available for Drupal 6. You may wish to keep watch on the modules list on the Drupal.org web site to see if anything comes up in future http://drupal.org/project/inactive_user

Communicating with individuals publicly

Don't forget, we also have access to all of the communication methods available for our users to communicate with one another, such as replying to posts, commenting on content, or posting on their profiles. So if we need to contact a user, and we can contact them publicly, we can use these features.

Mailing lists

Drupal has a number of modules available for sending emails to our users. Many of them are still currently under heavy development, or had their development stopped after the release of a previous version of Drupal. One of these modules is Simplenews, which is a native Drupal system for managing newsletters.

One limitation of the Simplenews module, and most of the modules available, is that it can't send to all our users; it requires users to subscribe to the mailing list.

We can manage the Simplenews module via Administer | Newsletter. The features available to us are quite comprehensive. Let's have a look at how the module works:

  • Newsletters are created and managed from here
  • Users subscribe to various Newsletters
  • Users can be imported into Newsletters to become a subscriber
  • A message is sent to a newsletter (this is referred to as an issue) by creating Newsletters content
  • Issues which have been sent are saved within the module
  • Issues which have not yet been sent are saved within the module as drafts

By default, we have a newsletter, which is generic to our site based on our site name.

Only local images are allowed.

From here we can also create new Newsletters should we wish so. The Subscriptions tab allows us to see and manage the subscriptions to our various newsletters, the Sent issues tab lists issues sent out to the newsletter lists, and the Drafts tab lists issues which are still being written. From within the Settings tab, we can set how new issues for newsletters are created, as well as the email address shown as the sender of issues.

Don't forget to set the permissions; you want your users to be able to subscribe to newsletters.

Users can subscribe to newsletters from within their account, or we can enable blocks for the relevant newsletters we have on our site.

Only local images are allowed.

To send an "issue" to our newsletter list, we need to create the issue as a new content element via Create content | Newsletter issue.

We enter the subject of our email as the Title, select the newsletter to send the message to from the Newsletter drop-down list, and the message is entered into the Bodybox.

Only local images are allowed.

Beneath these options, we have some newsletter specific-options within the Newsletter sending options box. These options allow us to set the priority of the email message (this is often ignored by email clients), if we wish to request a receipt to see if a user has read the message (this is also often ignored by email clients) and finally, we can select a sending method.

There are three sending methods, which are:

  • Don't send now - this won't send the message, and will save it as a draft.
  • Send one test newsletter to the test address - this will send the email message to the test email addresses, which we can set in the administration area. This allows us to review the newsletter, as if we were a subscriber, make any final alterations and then send it to our list.
  • Send newsletter - this sends the email to our newsletter list.

How to send an email to all our users?

We can use the module to send an email to all of our users, by taking advantage of the subscriber import feature. Within Administer | Content management | Newsletters | Subscriptions, we have the ability to Import subscriptions, as shown in the following screenshot:

Only local images are allowed.

Importing subscribers consists of entering the E-mail addresses (separated by a comma) and selecting the newsletter which we wish the user to subscribe to. To get all of our current members to subscribe to the mailing list, we could export all of our users' email addresses directly from the Drupal database, using a tool such as phpMyAdmin. If we use the tool correctly, we can even get the data in a comma-separated list ready to be pasted into the form.


 

Drupal 6 Social Networking

 

Only local images are allowed.
  • Build a social or community web site, with friends lists, groups, custom user profiles, and much more
  • Step-by-step instructions for putting together a social networking site with Drupal 6
  • Customize your Drupal installation with modules and themes to match the needs of almost any social networking site
  • Allow users to collaborate and interact with each other on your site
  • Requires no prior knowledge of Drupal or PHP; but even experienced Drupal users will find this useful to modify an existing installation into a social web site

  http://www.packtpub.com/build-social-networking-website-with-drupal-6/book

 


HTML emails

In order to send HTML (that is, nicely formatted) emails, and emails as attachments to our newsletters, we would need to install the Mime Mail module from http://drupal.org/project/mimemail.

Give it a try
We have covered module installation and configuration extensively; so why not try and install the module yourself and experiment with HTML newsletters.

Legalities

There are legalities involved with sending bulk emails, and mailing lists, especially with regards to SPAM. Most countries have their own laws relating to this.

Throttling

When web sites send out bulk email campaigns, it is important to be careful about their frequency of emails. If all emails in the campaign are sent at once, this could be seen as a sign of SPAM, leading to blacklisting on mail servers, and also penalties from many shared hosts. If emails are sent out slowly, it may take a long time for a campaign to be sent out to all recipients.

The Simplenews module allows us to configure the frequency of the emails sent. These settings can be accessed from Administer | Site configuration | Simplenews | Send mail. Here the cron box is checked, indicating that emails are sent each time the Drupal cron script is called. The Cron throttle defines how many newsletters are sent each time the Drupal cron script is called. By default, it is set to 20, which is very low. So this should be changed perhaps to 100 or 500. You may wish to contact your hosting company for advice on email limits imposed by them.

Third-Party Services

Besides allowing us to run our own email newsletter service from within Drupal, a number of the available modules allow us to make use of third-party mailing list systems.

PHPList

PHPList is a popular mailing list system written in PHP, if we were to use this system (particularly useful if our Drupal social network is part of a group of sites, or part of a larger site which does not use Drupal), we can use the PHPList integration module to:

  • Synchronize users from Drupal to our PHPList system
  • Send targeted mailings based on the values of a user's profile
  • Allow users to manage their PHPList subscriptions from within their account
  • Bulk import into PHPList, if we already have a Drupal installation running with many users
    • A simple bar of information, perhaps relating to a specific feature
    • CSS (cascading style sheets) pop ups with information
    • A collapsible message, where the user can click an icon to expand an administrative message, which we can update periodically
    • Newsletters and mailing lists
    • Third-party mailing lists
    • Content blocks
  • This module can be downloaded from http://drupal.org/project/phplist, while PHPList can be downloaded from http://www.phplist.com

    PHPList involves some server configuration; so if PHPList is the solution for you, make sure you read the documentation thoroughly.

    Constant contact

    Constant contact (http://www.constantcontact.com/index.jsp) is an online email marketing service, which manages newsletter subscriptions itself, with a particular focus on privacy and security for subscribers on mailing lists. Drupal 5 had a module to easily link into a constant contact account, http://drupal.org/project/constant_contact. This module, at the time of writing is not available for Drupal 6. But it is worth looking out for updates of this module or an alternative module to take its place if you wish to use constant contact to provide newsletters for your social network.

    Google Groups

    Google Groups are essentially mini social networks that operate in a way similar to groups in our network with the Organic Groups module. Many organizations and projects, such as open source software projects, make use of Google Groups to complement their communication and collaboration areas. If you wish to use Google Groups to complement your social network, then there is a module to allow users to subscribe to your group directly from the site. The module can be downloaded from http://drupal.org/project/google_groups. This module would probably be of little use if you used the organic groups module because the organic groups module provides very similar functionality. Problems with using a service such as Google Groups is that we are limited in terms of controlling the layout of our communications losing any branding associated with our site, and a potential loss of revenue when we may have used advertisements on our site or on our own newsletter.

    Direct contact

    If our social network is an extension of something else, for instance an online supplement to an organization dedicated to the promotion and support of keeping dinosaurs as pets, then we may wish to contact users of our social network using an offline method.

    The Address module allows users to supply a physical address and a telephone number, which means we could post newsletters to our users. This would primarily be of use to organizations which are already producing paper mailers to a wide audience, where the online social network is used to complement the services provided by these organizations; otherwise offline contacting may not be cost effective.

    The address module

    Having installed the address module, and having given users permissions to create an address book, we can collect the addresses, telephone numbers, and fax numbers of our users.

    User's perspective

    From the user's perspective, they can easily store and edit addresses and contact details from within their accounts, via the Address Book tab.

    Only local images are allowed.

    Administrator's perspective

    Unfortunately, this module was designed to complement other modules (for example, the e-Commerce module) in providing a convenient location for users to store their address for later use (such as ordering products for delivery with the e-Commerce module). There is no back-end interface to allow us, as administrators, to view the contact details of our users. We can, however, gain access to the information from the database directly, and can then maintain our own records from there, or from the $user array via custom PHP code. An alternative would be to create additional user profile fields, which can be read only by administrators.

    Content blocks

    Modules and themes often make use of blocks to display small blocks of content in specific areas of the web site, generally including the web sites header, the sidebars on the left and right-hand side of the screen, the footer, and the main content area, as well as dynamic functionality, such as group information in the Organic groups module. Blocks we have previously been using, such as with the Organic groups module, are dynamic and populated by the modules that created them. Blocks don't have to be dynamic; we can create blocks of our own to display content that doesn't change dynamically.

    We can make use of these blocks to display information and messages to our users. For instance, if we wanted to communicate with guest users, we could create a content block with information on the benefits of joining the site.

    Creating a content block for anonymous users

  • Navigate to Administer | Site building | Blocks.
  • Select the Add block tab.
  • Enter a Description, Title and Body for the block, with the benefits of joining in the Block body box.
  • Under Role-specific visibility settings, select Show blog for specific roles for anonymous users.
  • Under Page-specific visibility settings, select the block to be visible on all pages.
  • Save block.
  • Only local images are allowed.

    Once created, the block is displayed on our site for users who are not logged in:

    Only local images are allowed.

    Theme customizations for communication

    We could also use the look and feel of our site to communicate with our users. The following are some examples of what we could do:

    These options require knowledge of HTML, CSS, and Drupal themes.

    Summary

    In this article, we looked at how weóas administrators can communicate with our users using a variety of methods including:

    We now have a fully functional social network. Our users can contribute to the site, communicate with each other, and we can communicate with them.


 

Drupal 6 Social Networking

 

Only local images are allowed.
  • Build a social or community web site, with friends lists, groups, custom user profiles, and much more
  • Step-by-step instructions for putting together a social networking site with Drupal 6
  • Customize your Drupal installation with modules and themes to match the needs of almost any social networking site
  • Allow users to collaborate and interact with each other on your site
  • Requires no prior knowledge of Drupal or PHP; but even experienced Drupal users will find this useful to modify an existing installation into a social web site

  http://www.packtpub.com/build-social-networking-website-with-drupal-6/book

 


 

About the Author

 

Michael Peacock is a web developer from Newcastle, UK and has a degree in Software Engineering from the University of Durham. After meeting his business partner at Durham, he co-founded Peacock Carter, a Newcastle based creative consultancy specializing in web design, web development and corporate identity.

Michael loves working on web related projects. When he is not working on client projects, he is often tinkering with a web app of his own.

He has been involved with a number of books, having written three books: Drupal Social Networks, Selling Online with Drupal e-Commerce, Building Web Stes with TYPO3, and acted as technical reviewer for Mobile Web Development and Drupal Education & E-Learning.

You can follow Michael on Twitter

Comments

In this article, we looked

nonamez's picture

In this article, we looked at how weóas administrators can communicate with our users using a variety of methods including:

We now have a fully functional social network. Our users can contribute to the site, communicate with each other, and we can communicate with them.

Forum

Brighton

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week