Drupal 7 Social Networking
()
About this ebook
Michael Peacock
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 two books himself (and working on his third): Selling online with Drupal e-Commerce Packt, and Building websites with TYPO3 Packt. He has also done technical reviews of two other books: Mobile Web Development Packt, and Drupal Education & E-Learning Packt. You can follow Michael on Twitter.
Related to Drupal 7 Social Networking
Related ebooks
Learning Drupal 6 Module Development Rating: 3 out of 5 stars3/5Competitive Selling: The Guidebook to Resilient Virtual Selling Rating: 0 out of 5 stars0 ratingsDreamweaver CC For Dummies Rating: 0 out of 5 stars0 ratingsPractical Plone 3: A Beginner's Guide to Building Powerful Websites Rating: 0 out of 5 stars0 ratingsWordPress Web Application Development Rating: 5 out of 5 stars5/5WordPress 3.7 Complete Rating: 5 out of 5 stars5/5SilverStripe 2.4 Module Extension, Themes, and Widgets: Beginner's Guide Rating: 0 out of 5 stars0 ratingsElgg 1.8 Social Networking Rating: 0 out of 5 stars0 ratingsLearning Drupal 8 Rating: 0 out of 5 stars0 ratingsDrupal for Education and E-Learning Rating: 3 out of 5 stars3/5Drupal For Dummies Rating: 4 out of 5 stars4/5Liferay Portal 6.2 Enterprise Intranets Rating: 5 out of 5 stars5/5Moodle Administration Rating: 4 out of 5 stars4/5Drupal for Education and E-Learning - Second Edition Rating: 0 out of 5 stars0 ratingsMoodle 3 Administration - Third Edition Rating: 0 out of 5 stars0 ratingsActive Directory For Dummies Rating: 0 out of 5 stars0 ratingsASP.NET 3.5 Social Networking Rating: 0 out of 5 stars0 ratingsWordPress Web Application Development - Second Edition Rating: 0 out of 5 stars0 ratingsProfessional Plone 4 Development Rating: 3 out of 5 stars3/5Blackboard Learn Administration Rating: 4 out of 5 stars4/5WordPress in 20 Steps Rating: 0 out of 5 stars0 ratingsCMS Made Simple 1.6 Beginner's Guide Rating: 5 out of 5 stars5/5WordPress Bible Rating: 3 out of 5 stars3/5Building Websites with VB.NET and DotNetNuke 4 Rating: 1 out of 5 stars1/5FuelPHP Application Development Blueprints Rating: 0 out of 5 stars0 ratingsMoodle E-Learning Course Development - Third Edition Rating: 0 out of 5 stars0 ratingsAlfresco 3 Enterprise Content Management Implementation Rating: 3 out of 5 stars3/5WordPress 3 Plugin Development Essentials Rating: 4 out of 5 stars4/5Odoo 10 Development Essentials Rating: 0 out of 5 stars0 ratings
Information Technology For You
Health Informatics: Practical Guide Rating: 0 out of 5 stars0 ratingsCompTIA ITF+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam FC0-U61 Rating: 0 out of 5 stars0 ratingsHow To Use Chatgpt: Using Chatgpt To Make Money Online Has Never Been This Simple Rating: 0 out of 5 stars0 ratingsWordPress Plugin Development: Beginner's Guide Rating: 0 out of 5 stars0 ratingsWindows Registry Forensics: Advanced Digital Forensic Analysis of the Windows Registry Rating: 4 out of 5 stars4/5How to Write Effective Emails at Work Rating: 4 out of 5 stars4/5AWS Certified Cloud Practitioner: Study Guide with Practice Questions and Labs Rating: 5 out of 5 stars5/5The Ultimate Guide to Landing a Network Engineering Job Rating: 0 out of 5 stars0 ratingsComputer Science: A Concise Introduction Rating: 4 out of 5 stars4/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Practical Ethical Hacking from Scratch Rating: 5 out of 5 stars5/5Data Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5An Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5Hacking Essentials - The Beginner's Guide To Ethical Hacking And Penetration Testing Rating: 3 out of 5 stars3/5The Basics of Hacking and Penetration Testing: Ethical Hacking and Penetration Testing Made Easy Rating: 4 out of 5 stars4/5Inkscape Beginner’s Guide Rating: 5 out of 5 stars5/5The Certified Fintech Professional Rating: 5 out of 5 stars5/5The Programmer's Brain: What every programmer needs to know about cognition Rating: 5 out of 5 stars5/5DNS in Action Rating: 0 out of 5 stars0 ratingsQuantum Computing for Programmers and Investors: with full implementation of algorithms in C Rating: 5 out of 5 stars5/5Summary of Super-Intelligence From Nick Bostrom Rating: 5 out of 5 stars5/5CompTIA Network+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008 Rating: 0 out of 5 stars0 ratingsA Civic Technologist's Practice Guide Rating: 0 out of 5 stars0 ratingsSupercommunicator: Explaining the Complicated So Anyone Can Understand Rating: 3 out of 5 stars3/5Computer Organization and Design: The Hardware / Software Interface Rating: 4 out of 5 stars4/5ChatGPT: The Future of Intelligent Conversation Rating: 4 out of 5 stars4/5CompTIA A+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Core 1 Exam 220-1101 Rating: 0 out of 5 stars0 ratingsCybersecurity for Beginners : Learn the Fundamentals of Cybersecurity in an Easy, Step-by-Step Guide: 1 Rating: 0 out of 5 stars0 ratings
Reviews for Drupal 7 Social Networking
0 ratings0 reviews
Book preview
Drupal 7 Social Networking - Michael Peacock
Table of Contents
Drupal 7 Social Networking
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Drupal and Social Networking
Social Networking: An introduction
Business logic to social networks
Examples: Businesses making use of existing social networks and their own social networks
Dell: Twitter
NameCheap: Twitter
BT: Twitter
Netgear: Custom
Why not join or use an existing social network?
Provide a service
Improve business
Improve communications
Existing social networks
MySpace
Drupal
What is a CMS?
What is Drupal?
Drupal as a social networking platform
Alternatives to Drupal
Roll your own
Elgg
Hybrid approaches
DinoSpace!
Installing Drupal
Requirements
Download
Installation
Extracting the Drupal files
Creating the database
Running the Drupal installer
Configuring Drupal
People: Account settings
System: Site information
Other configuration options
People: IP address blocking
System: Actions
System: Cron
Content authoring: Text formats
User interface: Shortcuts
Media: File system
Media: Image styles
Media: Image toolkit
Development: Performance
Development: Logging and errors
Development: Maintenance mode
Search and metadata: Search settings
Search and metadata: URL aliases
Search and metadata: Clean URLs
Web Services: RSS publishing
Regional and language: Regional settings
Regional and language: Date and time
Summary
2. Preparing Drupal for a Social Networking Site
How Drupal works
An abstract framework
Nodes
Modules and themes
Administering Drupal—An overview
Logging in
Dashboard
Content
Content statuses
Promoted content
Sticky content
Creating content
Comments
Structure
Blocks
Content types
Menus
Taxonomy
Appearance
People
Permissions
Roles
Modules
Configuration
Reports
Help
Content types and taxonomy: A detailed look
Creating a new content type
Adding fields to the content type
Linking taxonomy to the content type
Customizing how the taxonomy works with the content type
Test content in action!
Planning our site
Static content
Grouping content
Starting to build our site
Using taxonomy
Creating the vocabulary
Summary
3. User Content: Contributions, Forums, and Blogs
Our site
User roles: An important note
Drupal modules
Managing comments
Comments within DinoSpace!
Forums
Planning our forum structure
Creating and managing forums and containers
Viewing our forums
Creating a forum topic
Taxonomies
Planning: How will roles fit in?
Setting up and using blogs
Viewing blogs and the blog menu
Using the blog
Collaborative writing
Creating a book
Creating pages in the book
Outline
Permissions and roles
Why not grant all permissions?
Polls
Adding roles
Contributions in the form of pages
Permissions and roles
Uploaded files
Roles
Anonymous role permissions
Authenticated users
Additional roles
Contributors
Moderators
Power contributors
Summary
4. Users and Profiles
What are we going to do and why?
Getting set up
Users, roles, and permissions
User management
Users: Viewing, searching, sorting, and filtering
Creating a user
Editing a user
Suspending / blocking a user
Canceling and deleting a user account
Bulk user operations
Roles
Permissions
Creating customizable user profiles
Listing your dinosaurs
Linking to other social network profiles
Profile in action
Globally recognized avatars: Enabling Gravatars
Tracking user activity
User centric home page
Account settings
Summary
5. Enabling User Interaction
DinoSpace!: A review
Preparation: Installing the modules
Relationships
Planning user relationships
Managing and creating relationships
Creating a relationship type
Creating a two-way relationship which requires approval
Creating a one-way relationship
Creating default relationships
Settings
General settings
Customizing e-mail notifications
Customizing on-screen messages
Sharing content
Other settings
Permissions
Relationships in action
Befriending users
Approving requests
Related user activity stream
A template for each relationship type
A rule for each relationship type
Activity stream in action
Contacting users
Groups
Groups for DinoSpace!
Using the organic groups module
Creating a group content type
Configuring content types
Formatting groups
Adding some user context to the group
Using panels to structure the group page
Using views to pull in group content
Creating a group
Adding content to a group
Viewing our group
Commenting on user profiles
The guestbook module
What to look out for
Summary
6. Social Seasoning
Let's prepare our modules
Encouraging discussion with Disqus
Register for Disqus
Sharing content with AddThis
Leverage other features
Like this on Facebook
Enabling PHP in content blocks
Like this page
Creating the block
Tweet this
Find us on Facebook
Latest tweets
Summary
7. Module Development: Rapidly Improve your Social Network
Dinosaur-friendly venues
Useful resources
Building our module
Installation files
Map installer: dino_friendly_places/dfp_map.install
Venue installer: dino_friendly_places/dfp_venue.install
Module information files
Map information file
Venue information file
Module files
Create the map module file
Venue: no module file required
Template files
Map: node--dino_friendly_places_map.tpl.php
Venue: node--dino_friendly_places_venue.tpl.php
Module in action
Install the module
Creating a map
Creating a venue
Viewing a map
Viewing a venue
Summary
8. How We Can Design Our Site
Drupal themes
Theme management and pre-installed themes
Bartik
Garland
Seven
Stark
Contributed themes
Installing contributed themes
Customizing the default theme
Color scheme
Custom color sets
Color set preview
Toggle display
Logo image
Shortcut icons
The basics of creating a theme
Structure of a theme
Overriding specific parts of Drupal with a theme
Creating the .info file
Rapidly building a theme
Building a theme properly
Summary
9. Communicating with Our Users
Getting started
A look back
Modules send e-mails too!
Direct contact with a user
Mailing lists
External mailing lists
Automatic signup on user creation
Signup for anonymous users
Alternative e-mailing options
PHPList
Simplenews
Sending a newsletter with simplenews
Amazon Simple Email Service
Using content blocks to get our message across
Using theme customisations to indirectly communicate with our users
Inactive users: Please come back
Summary
10. Deploying and Maintaining Your Social Network
Installing the modules
Security
Security advisories
Server security
Software
Securing the site with a firewall
Shared hosting precautions
CAPTCHA
The CAPTCHA module
The reCAPTCHA module
SPAM prevention
Mollom
Passwords
Deploying
Choosing a domain name
Registering a domain name
Popular domain name registrars
Signing up with a hosting provider
Choosing a web hosting provider
Considerations for hosts for social networking websites
Popular web hosting providers
Setting the nameservers for the domain
Creating a database on the hosting account
With cPanel hosting control panel
With appropriate privileges on PHPMyAdmin
Exporting our local database
Importing our local database to the hosting account
Changing the database settings
Uploading the site
Testing
Maintenance
Cron
Looking up the secure cron URL
Performing maintenance
Upgrading Drupal
Reports
How can these help?
Backing up and restoring your social network
With cPanel
Restoring the site and database
Using the command line
Command-line access and Putty
Backing up the site and database
Restoring the site and the database
Do they work?
Summary
11. Easing Growing Pains
Basic performance tips
Introduction to caching and caching options
NoSQL options
Can't someone else do it?
Statistics
Sending e-mails
E-mail services
Hosted Apache Solr search
Using content delivery networks
CDN module
Code improvements and custom modules
Code profiling
Slow queries
Compression
Server performance and configuration
Apache
MySQL
Alternative web servers
Scaling our resources
VPS cloud hosting
Additional servers
Adding redundancy to our setup
Keep an eye out…
Summary
12. Promotion, SEO, User Retention, and Monetization Strategies
Promotion and marketing
Online advertising
Pay-Per-Click
Search engine PPC networks
Pay-Per-Action—A look to the future
Advertising space
Warning: Keep the search engines happy!
Getting penalized by search engines
Keeping them happy
Newsletter advertising
Newsletters
Social marketing
Viral marketing campaigns
RSS feeds
Search Engine Optimization
On-site SEO
Headings
Internal links
Up-to-date, relevant content
Page meta data
Site speed
Search engine goodies! Sitemaps and tools
Off-site SEO
What to look for in an SEO company
User retention
E-mails for the user's action
User feedback
Hello there!
Monetization options
Final tips: Web stats
Modules to consider
Summary
A. Setting up a Local Development Environment
WampServer for Windows
Installing WAMPServer
WAMPServer overview
Configuring WampServer
GD2
Rewrite module
Linux
Install Apache
Enable the rewrite module and restart Apache
Install PHP
Enable MySQL and GD
Install MySQL
Install phpMyAdmin
Mac
Summary
B. Installed Modules
Chapter 1 to Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7 to Chapter 8
Chapter 9
Chapter 10
Chapter 11 to Chapter 12
Index
Drupal 7 Social Networking
Drupal 7 Social Networking
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 ( <a.wishkerman@mpic.de> )
Credits
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
About the Author
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.
Acknowledgement
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!
About the Reviewers
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.
www.PacktPub.com
Support files, eBooks, discount offers and more
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
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.
Why Subscribe?
Fully searchable across every book published by Packt
Copy and paste, print and bookmark content
On demand and accessible via web browser
Free Access for Packt account holders
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.
Preface
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.
What this book covers
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