Book Image

Elgg 1.8 Social Networking

By : Cash Costello
Book Image

Elgg 1.8 Social Networking

By: Cash Costello

Overview of this book

As an updated version of the first ever Elgg book, this is an excellent resource for those interested in Elgg development due to its attention to detail, clearly written style and knowledgeable author. - Dave Tosh, Elgg co-founder. In his book, Cash Costello makes full use of his skills in development and communication to tackle the complex subject of Elgg social networking. This easy-to-read guide gives end users, new developers, and old pros alike a solid base to start their venture into social media with Elgg. I highly recommend it as a useful and enjoyable read. - Brett Profitt, Elgg Lead Developer The web is becoming increasingly social as millions of people use it to blog, share, post, 'friend', 'unfriend' (which was made the Oxford word of the year in 2009), comment, and chat. Elgg ñ your award-winning open source social networking engine ñ is tailor-made to create any social networking or social media website you can imagine. If you want to create a social networking website from scratch using Elgg, then this book is exactly what you need.Elgg 1.8 Social Networking covers everything you need to know about building a social networking site with Elgg. It begins with instructions for installing Elgg, continues with a guided tour of its capabilities, and finishes with practical advice on deploying Elgg on a production server. And in between, it is packed with information on configuring and customizing Elgg through plugins and themes.This book is a learn-by-doing guide to creating your own social networking site. It includes three sample case studies on how Elgg could be used as an e-learning tool, an intranet application for organizations, and a niche social networking site. Step by step it takes you through the installation, configuration, and customization of Elgg. Valuable advice is sprinkled throughout the book to enable you to build your site like an expert. For developers, this book provides a multitude of options. First, there is a tutorial-based section that systematically teaches you how to build plugins. Soon you will have ten plugins for use on your site in addition to all the knowledge you have gained. Second, if you prefer a quick overview, this book has an appendix that describes Elgg using the terminology and design patterns common in web development. Third, if you are interested in creating a theme, it also includes a design tutorial and a catalog of Elgg's view templates. The book then goes on to describe what is involved in running a production website. It has sections on selecting a hosting provider, configuring and tuning the server, backing up the site, and dealing with spammers.
Table of Contents (21 chapters)
Elgg 1.8 Social Networking
Credits
Foreword
About the Author
About the Author of 1st edition
About the Reviewers
www.PacktPub.com
Preface
Index

Overview of Elgg as a framework


This overview covers basic questions about Elgg such as whether it is object-oriented and what kind of template language is used. These are the sorts of questions that are valuable to have answers to before looking at the design and structure of a framework.

What is Elgg?

Elgg is an open source framework for developing social networking and social media websites. It is written in PHP, uses MySQL for data persistence, and includes jQuery for client-side scripting.

Object-oriented or procedural?

The answer is both. The data model of Elgg is primarily object-oriented, while the rest of the framework is mostly procedural. This provides flexibility to plugin developers. For example, a page controller in Elgg can be a script, a function, or a class method. The choice is left up to the developer.

Does it use the Model-View-Controller pattern?

Elgg is not a textbook implementation of the Model-View-Controller (MVC) pattern. Elgg does not use the terminology of MVC, which can make it difficult at first to see the pattern. Viewing it from an MVC perspective, though, does make it easier to grasp Elgg's design.

Convention or configuration?

The answer to this question is also both. The model and controller use configuration exclusively and the view system is primarily convention-based with some configuration.

Is it extensible?

Elgg has a modular architecture that uses plugins to extend or modify the core engine. Without any plugins enabled, an Elgg site supports account creation, user settings, administration and not much else. This plugin-based approach gives developers flexibility and control when building web applications with Elgg.

Extensibility is also provided through an event-based hook system. Rather than editing core code, developers can modify the behavior of the framework by registering callbacks for an event. The callbacks perform their own processing of the data, prevent the core from taking an action, or change the output of a function. For example, every time a blog post is saved, an event is fired. A callback function registered for that event could check for spam and reject the post.

What template engine is used?

Elgg uses PHP as its template engine. This results in a flexible view system since the full power of PHP is available. Developers also do not have to learn a new template language to use Elgg as they would with an engine like Smarty. On the downside, an expressive template language such as PHP is a temptation to mix controller code into the views.