34,79 €
Drupal is ideally equipped to serve as a base system for creating a custom social networking site like Facebook or MySpace. While these large social networks have their place, niche social networking websites can help promote businesses, products, projects, and hobbies of any nature.
Drupal 7 Social Networking provides careful instructions and clear explanations to take you through the setup and management of your social network site, covering topics from users, to marketing, to maintenance. It will help you create your own social networking site, suitable for whatever audience you choose!
Starting from the very basics of both Drupal and Social Networking, right through to more complicated aspects, you will progressively learn how to add to and expand your social networking site and add more features. You will learn how to secure your social network, deploy it on the Internet, and keep it running and well maintained. As social networking sites rely on the participation of their users, this book helps you to structure your site in such a way so that users can easily and enjoyably contribute, thus creating a powerful social network.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 314
Veröffentlichungsjahr: 2011
Copyright © 2011 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2011
Production Reference:1150911
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B32PB, UK.
ISBN 978-1-849516-00-6
www.packtpub.com
Cover Image by Asher Wishkerman ( <[email protected]> )
Author
Michael Peacock
Reviewers
Kazi Ataul Bari
Nedo Laanen
Ronald J. Simon
Acquisition Editor
Sarah Cullington
Development Editors
Kartikey Pandey
Hithesh Uchil
Technical Editors
Pramila Balan
Joyslita D'souza
Project Coordinator
Joel Goveya
Proofreader
Aaron Nash
Indexer
Hemangini Bari
Graphics
Valentina D'silva
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
Michael Peacock (www.michaelpeacock.co.uk) is a web developer and Zend Certified Engineer from Newcastle, UK with a degree in Software Engineering from the University of Durham.
After working as Managing Director and Lead Developer overseeing the development team at the web agency he co-founded almost five years ago, Michael stepped back from the business and now acts as Senior/Lead Web Developer on the telemetry project for Smith Electric Vehicles.
In October 2010, Michael presented his thoughts on specific web application architectures at the popular PHP North West conference, and has presented to the PHP North East user group on automated deployment systems and to North East technical community group Super Mondays on Jenkins Continuous Integration.
Michael loves working on web related projects, and is currently incubating a number of ideas for launch through his latest venture, Central Apps Limited (www.centralapps.co.uk).
He is the author of Drupal 7 Social Networking, PHP 5 Social Networking, PHP 5 E-Commerce Development, Drupal 6 Social Networking, Selling online with Drupal e-Commerce and Building Websites with TYPO3. Michael acted as technical reviewer for other publications like Mobile Web Development and Drupal for Education and E-Learning.
You can follow Michael on Twitter: www.twitter.com/michaelpeacock or find out more about him through his blog: www.michaelpeacock.co.uk.
I'd like to thank all the staff at Packt Publishing, in particular: Douglas Paterson, for working with me to develop my first book ideas; Sarah Cullington for working with me on developing this book; Joel Goveya, the Project Co-ordinator for helping keep the project on track and Karthikey Pandey, the Development Editor. Thanks are also due to the Technical Reviewers: Kazi Ataul Bari, Nedo Laanen, and Ronald J. Simon, who helped ensure the technical quality of the book was up to scratch.
I'd also like to thank everyone who left feedback about Drupal 6 Social Networking; their feedback really helped shape this book, so that as well as being updated to cover Drupal 7, it is more relevant, more interesting, and builds a more powerful Social Networking site.
My thanks also go to my friends and family, in particular my fiancée Emma for her support while working on the book.
Finally, I'd like to thank you, the reader; I hope you enjoy this book and produce a fantastic social network of your own. I look forward to seeing what you come up with, and hope you will provide me with your feedback so that Drupal 8 Social Networking can be even better still!
Kazi Ataul Bari was born in Comilla, Bangladesh. He has been working on PHP and MySQL, JavaScript, jQuery,CMS (Joomla, Drupal), Adobe Photoshop, Adobe Flash, and Action Script 3.0 for three years. Currently, he is working for GraphicPeople | Enfatico | WPP as Web Developer. He also worked at BRACNet Limited, and GoldenHash Technology as a Software Engineer and Quality Assurance Officer.
I would like to thank Hithesh Uchil, Joel Goveya, my grand father for giving me the encouragement to explore new opportunities, and my friend Fatema Akter Puspo for supporting me to work hard. Also, I would like to thank my Mom and Dad.
Nedo Laanen graduated in 2003, where he studied Applied Mathematics and Computer Science. He then started working for a large company in the computer industry. There he worked for several clients as a Novell System Administrator. Soon he developed a keen interest in Linux and Open Source software and started to pursue a career as a Linux professional at a Utrecht based company. Nedo has worked for companies like the Dutch department of the World Wide Fund in Zeist and the Dutch Council for Refugees in Amsterdam, as well as for several different Dutch Hospitals. He was also involved in the 'Antonius Open' project at the Antonius Hospital in Utrecht/Nieuwegein, a prestigious project of the Antonius hospital to cut back costs by implementing Linux and Open Source software in their computer network, replacing expensive proprietary software and eliminating vendor lock-in.
In 2011, Nedo started his own business as an all-round Linux engineer, providing Open Source solutions for other businesses: http://www.laanen-ict.nl.
Next to Linux and Open Source he is also an enthusiastic photographer (http://www.nedolaanen.nl). In 2009, he therefore started the website http://www.opensourcephotography.org to promote Open Source photography.
Nedo has also been a reviewer for Packt Publishing on the book GIMP 2.6 Cookbook.
Ronald J. Simon has been working with the development of shared information and database design dating back to the days before the Internet and has worked in many different areas of information management and writing documentation to support users.
Ron is also an Adjunct Instructor for Grand Valley State University and has worked in the legal field in Document management and security.
He is also an owner of RJS Designs, which is a small business consulting company.
I would like to thank my Coffee Machine for always being by my side.
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
This book uses Drupal, a powerful and extendable Content Management System (CMS), to set up and manage a social networking website. This is achieved using a range of powerful and feature-rich social networking modules that are available, as well as creating a few of our own along the way. By using Drupal, the site can be built and extended rapidly and changed as the needs of our users and site change and evolve.
This book is packed with practical tips, not only for setting up a social networking site, but also for promoting and marketing the site, working with the site's users to help the social network grow, and preparing for growth so that our users get a reliable, enjoyable experience on the site.
Chapter 1, Drupal and Social Networking, looks into the basics, dealing with various social networking concepts, and also why you may wish to create a social network. You will start by looking at the concepts of social networking, Content Management Systems, and Drupal. Then you will be guided to install Drupal, look at its features, and see how it works.
Chapter 2, Preparing Drupal for a Social Networking Site, looks at Drupal in more detail, particularly at how to use its administration options, which should help you in building your site. This should prove to be a useful reference point in future. You'll be able to plan some of the static content for your site, and start to create content for it.
Chapter 3, User Content: Contributions, Forums, and Blogs, focuses very much on content; with these features in place you can now look at users, their profiles, and allow them to connect with one another to create a powerful social network.
Chapter 4, Users and Profiles, teaches how to manage users, roles, and their permissions. It talks about Gravatars and how to enable them. You'll learn how users can track the activity of each other and how to extend user profiles. Settings and rules for users will be talked about and you'll also learn how to give authenticated users a more relevant home page.
Chapter 5, Enabling User Interaction, explains how users can build relationships and friendships within the site, and how they can communicate with each other. With this, you will learn how to create a social site which is truly a network using Drupal.
Chapter 6, Social Seasoning, sprinkles in third-party social features to the site, including sharing content on other social networks, and using more advanced comment features from services such as Disqus.
Chapter 7, Module Development, rapidly teaches the basics of the Drupal 7 module system, through the creation of a suite of modules including a new bespoke content type and a map. This covers module development, extending the default content types, and allowing modules to interact with one another.
Chapter 8, Designing Our Site, discusses the default themes available to us, how we can customize it, where we can get new themes from, and the basics of the Drupal theming system. This provides the ground work for making your social network look the part.
Chapter 9, Communicating with Our Users, helps administrators communicate directly with users through e-mail, contact forms, and using the theme and reminders.
Chapter 10, Deploying and Maintaining Our Social Network, details the processes involved in taking a site from your local computer to the web. This discusses concepts including hosting, domain names, and the methods used to get the site running online. Once the site is online, it discusses how to maintain the social network.
Chapter 11, Easing Growing Pains, provides help and advice for scaling the social network and how to prepare with a large number of users. These tips speed up the site and show how to make the site more reliable when under load.
Chapter 12, Promotion, SEO, User Retention, and Monetization Strategies, looks into effectively marketing and promoting websites and social networking websites with online marketing techniques, search engine optimization, and user retention strategies. You'll also be looking briefly into how you may wish to monetize your site.
For this book you will need:
This book is aimed at anyone looking to create their own social networking website, including:
You don't need any experience of Drupal or PHP to use this book. If you are a Drupal user you will find this book a great way to rapidly tailor an existing installation into a socially orientated website.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail <[email protected]>.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the erratasubmissionform link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
Welcome to Drupal 7 Social Networking! During the course of this book we are going to learn how to develop a flexible, powerful, and interesting social networking site using the Content Management System, Drupal 7. We will start by looking at the concepts of social networking, Content Management Systems, and Drupal. Once we are more familiar with the concepts we will install Drupal, look at its features, and see how it works. By using a combination of existing features, modules, themes, and some simple custom development, we will enable user interaction, user contributions, and the ability for our users to communicate with each other.
In this chapter you will learn:
Throughout the book we will use Drupal, and our increasing knowledge of it to develop a site for a fictional project, DinoSpace!—a Social Networking site for keepers of pet dinosaurs.
Social Networks are a relatively new aspect to the Web that are really taking off. Many businesses, organizations, communities, and families are using social networking to promote themselves, communicate better with others, and to engage with their audience.
Social networking relies upon users building up their own network of contacts on the site, which in turn introduces them to new contacts. On many social networking websites, it allows them to be found more easily, and for new contacts to be recommended or introduced, helping to grow the user network.
Let's look at an example of how a user's network of contacts can be built up:
This social network representation shows the connections between contacts. It also illustrates how a user may be able to discover friends of a friend, and friend recommendations (based on friends in common), making it easy for the user to build up their social network, to communicate with new people, or reconnect with lost contacts.
Social networks generally serve two primary functions; firstly they allow users to connect with each other and build a contact network as we have just discussed. However, they also provide a community with collaboration and contribution features, allowing the content and information within the social network to be grown by the users themselves. Later in this chapter we will discuss some of the features available in existing social networks and social networking software, to build up a list of key features we will need to include, as well as things we might like to include.
There is some very compelling business logic to using both existing and custom social networks. Creating your own social network or social network tools gives a dedicated customer area where feedback on products and services can be obtained, for instance, use of support forums to discuss and resolve problems. Areas which allow customers to share tips, resources, and product care tips help promote those products and services.
There are some examples of businesses making great use of existing social networks and their own social networking type websites to improve their businesses. Let's have a look at a few specific examples:
Dell, a popular computer manufacturer, was recently able to attribute $2 million of sales to their Twitter account www.twitter.com/DellOutlet. By regularly posting discounts and discount codes to followers, Dell was able to entice more customers to their online shop to make a purchase. More information is available on the Mashable website: http://mashable.com/2009/06/11/delloutlet-two-million/.
NameCheap is a domain name registrar, and they use Twitter for two purposes. Firstly, they collect and respond to feedback from customers mentioning their company, and more prominently, they run various competitions giving away free domain names. These viral competitions encourage more users to follow them, and promote the competition, therefore increasing their own brand awareness. The NameCheap Twitter account is http://twitter.com/namecheap.
British Telecom uses Twitter to help improve customer service and manage their reputation. You may have seen this used in response to customer complaints to try and assist them with their problems, and escalate matters such as fault testing and engineer call out. This makes them seem more caring (also emphasized by their choice of Twitter username www.twitter.com/BTCare), and increases customer satisfaction by resolving problems more quickly.
While not strictly a social network, Netgear have various social aspects to their website, both through a dedicated community area and the support section of their website. The support section integrates community generated content from their discussion forums, and brings this into product pages, making it easier for customers to find answers to the questions that the staff have not answered directly. Discussion forum software is also quickly becoming social networking software to an extent, in its own right.
There are already a number of popular and powerful social networks available, which we will discuss in a moment, so why would we want to create our own social network? We will want to create a social network for the following reasons:
Some of the reasons I've just listed still don't answer why we should create our own social network, as opposed to using an existing one. Let's look at some of them in more detail.
There are many ways in which websites and social networks provide additional services which are relevant to the social network or the target audience, though these are often through third-party applications. For example, there are features for both Facebook and LinkedIn which can provide a list of books which a user has read; these link off to book retailers so that more information can be discovered and the books can be purchased. Additionally, some social networks contain knowledge bases of information which can be improved by the user.
With existing social networks, any additional service provided either directly through the social network or through third-party applications and plug-ins would, or could, be restricted in a number of ways. The terms and conditions of the social network would be the main restriction, followed by how the features themselves can be added.
For example, if we wanted to add a map of dinosaur-friendly restaurants to an existing social network, it would rely upon:
By tapping into the existing user base of established social networks, we can communicate with a new group of users, increasing awareness, and hopefully improving business. One slight flaw with existing social networks is providing extra enhancements.
Taking Facebook as an example, third-party developers create additional features, and embedded them as applications, and some of these applications add business functionality. One example allowed users to book a table at a restaurant. The limitation with using Facebook is that before information is sent to the application, the user is subjected to several dialogs asking for their confirmation. These dialogues are important to prevent abuse, and to ensure user data is used properly, however it is an obstacle for developers. As more and more applications become available, there is more competition for a user's attention, which recently has led to applications requesting users to invite their friends to use it. These mass invitations have the opposite effect, and discourage users from using the applications in question.
With our own social network, the data and functionality would be hosted by ourselves, giving us the freedom to extend the functionality of the social network to help us improve business as we see fit, leading to a more relevant and user friendly social network!
Social networks remove most barriers to communication, such as geographical location (the only barrier which remains is Internet access), and this is the case for both existing and custom Social Networks. The primary advantage over using our own system is that we are less restricted in how we can communicate with users. With existing social networks you must be connected to the user, and restrictions may be imposed over which communication methods you use within the social network, or which external communication details are shown to you.
There are many existing social networks available, some of which are already very popular, and have some excellent features. I'd imagine you have heard of all these before, and more likely use them on a regular basis, but let's take a look at the most prominent features of some of these more popular sites.
Facebook is very much a global social networking website for everyone over the age of 13, starting out for students at Harvard University, branching out to all universities, and now available for everyone. Features available include:
LinkedIn is a business social networking site which encourages business contacts to connect. Features available on LinkedIn include allowing users to:
MySpace is a social networking website used primarily by a younger audience, very popular with bands, particularly because of how many profiles can be customized with HTML, and how music can be embedded within profiles. Features available include:
Twitter is a microblogging social networking website, which primarily deals with very short messages of 140 characters or less. Despite this, it has a large number of prominent features, including:
The ease of use and small set of core features have made Twitter very popular.
