Preface

What Is XOOPS?

Before you dive into this book, I would like to first extend my warm welcome to you as you enter the world of XOOPS. XOOPS is an acronym of eXtensible Object Oriented Portal System. It is an open-source application platform and Content Management System (CMS) written in PHP. It is built for developing a variety of solutions in a modular fashion, for both small and large interactive dynamic community websites, company portals, intranets, weblogs, and much more. By installing different modules, you can build quite different websites.

XOOPS is released under the terms of the GNU General Public License (GPL) and is free to use and modify. It is also free to redistribute as long as you abide by the distribution terms of the GPL.

Why Use XOOPS?

XOOPS is shipped with a nice installer and can be easily deployed on a web-hosted server. In XOOPS 2.5, a more user-friendly backend administration has been introduced. This makes managing a complex website very easy and intuitive. You need almost no programming knowledge to build a website!

Due to the very flexible architecture of XOOPS, a developer (or even an advanced user), can create a vast variety of applications on top of XOOPS, including diaries, team rankings for sporting events, school administration systems, photo galleries, newspapers/magazines, and sophisticated ecommerce packages.

Powerful Modules

The most common application for XOOPS is as a CMS. With powerful modules contributed by developers all over the world, you can create and manage content easily.

Themes and Templates

XOOPS uses Smarty—one of the most popular template engines in PHP—as its template engine. This makes it easier for designers to get used to the syntax. You don’t have to deal with raw PHP code.

In addition, XOOPS is equipped with a lot of Smarty plug-ins to make life easier for designers.

User Management

XOOPS has a robust user management system. This is a key feature for applications like community websites. Users can search for other users by various criteria, or send email and private messages to other users through a template-based messaging system. And there are “social network” modules for XOOPS that can help enhance user interaction. XOOPS also has a powerful and user-friendly permissions system, which enables administrators to set permissions by group.

Supported Worldwide

XOOPS was created and is maintained by a team of several hard-working volunteers located all over the world. The XOOPS community has more than a dozen official support sites around the world for non-English-speaking users. XOOPS fully supports multi-byte languages, including Japanese, Simplified and Traditional Chinese, Korean, and so on.

If you have any questions, the community can always help you. And as you become an expert on XOOPS, please join the community and make your own contribution!

Brief History of XOOPS

The roots of XOOPS go back to PHPNuke, which was created by Francisco Burzi in 2000. As it sometimes happens within open source projects, a few of the developers who worked on PHPNuke decided to create something closer to their vision for a CMS, which they felt should be written with Object Oriented Programming (OOP) principles and technology. The result of their work became what we know today as XOOPS.

Over its 10 years of existence, XOOPS has reinvented itself many times. Besides being one of the OOP pioneers in the CMS area, it was also one of the first to add the Smarty templating system. Although Smarty is somewhat controversial, no one can deny that using it is much easier than using raw PHP code to create themes. In addition, we can take advantage of different Smarty plug-ins to enhance its flexibility.

Now XOOPS is evolving again. This time, it has been rewritten from scratch using the Zend Framework. While currently in Alpha release, the new version’s release is planned for the end of 2011.

What This Book Covers

This book covers the whole workflow of building a XOOPS theme from scratch.

Chapter 1, Before the Journey, generally describes the workflow and introduces the basic concepts that you need to know. It briefly covers how to set up Apache, PHP, and MySQL environments for XOOPS. I’ll also talk about what tools you need to build a theme.

Chapter 2, Elements of a XOOPS Theme, starts by introducing the plain framework for themes. Although you can build your theme from a blank XHTML file, it simply takes too much time and requires a lot of thinking. By using the simplest theme framework, I will introduce the template engine structures of XOOPS.

Chapter 3, Converting an Existing XHTML Template, mainly introduces how to apply an existing XHTML template to XOOPS. This will give you a more thorough look at the template engine.

Chapter 4, Styling XOOPS and Creating a Theme from 960, introduces more details on CSS styling. It will also illustrate how to create a XOOPS theme using 960 Framework for XOOPS, and how to make use of the theme framework to save time and code.

Chapter 5, jQuery and UI Libraries for XOOPS Themes, briefly discusses how to add jQuery and jQuery-based UI libraries to the theme to achieve complex effects. Two detailed case studies will help give you a deeper understanding of this subject.

Chapter 6, Module Template Override, covers the module template override. This allows you to control the template of each individual module by your XOOPS theme. jQuery integrations will also be discussed in this chapter

Chapter 7, Block Anywhere Techniques, mainly discusses “block anywhere” techniques.

Chapter 8, Case Study: My TinyMag, will summarize all you’ve learned in previous chapters in a case study: we’ll go from an idea to a complete website.

To take it to the next level, see the materials available on the book’s support site at http://insraq.me/book/. If you have the ebook, you were also given a file named cny_sale_package.zip that contains premium themes (which I hope will help your studies), free to those who purchase this book. If you purchased a hard copy, you can get these themes by going to http://insraq.me/book/—follow the instructions there and use the coupon code DFXT11.

What You Need to Know

This is a designer’s guide. So I assume that you know XHTML and CSS quite well.

A little prior knowledge of XOOPS is very helpful. You should at least know how to install XOOPS and conduct basic operations. And your knowledge of other CMSes might also help you.

There are also some things you don’t need to know:

  • PHP know-how is not necessary. In fact, I will not talk about PHP at all. Many great PHP programmers develop XOOPS to save designers from the dealing with PHP code.

  • In-depth JavaScript knowledge is not required, though a basic understanding of JavaScript is quite useful. This book focuses on jQuery, a JavaScript Library that allows designers to write less and do more. It is much easier than the traditional JavaScript approach.

  • Unix/Linux server-related knowledge is not needed (though it is recommended for webmasters). This book focuses on the designing process. In fact, the main operating system used here is Windows. Server-related configuration is not covered.

Who Is This Book For?

If you fall into any of these categories, this book is for you:

  • You are running a XOOPS website and have some basic understanding of the framework. Now you want to customize the look of your website. This book includes in-depth discussions on designing techniques and tricks.

  • You have planned several other websites powered by XOOPS, but you want to improve your design skills with regard to XOOPS. You will definitely benefit from the comprehensive coverage of XOOPS design, especially the last case study, which explains how to turn an idea into a full-featured website.

  • You are a designer and new to XOOPS, and you want to design for XOOPS to extend your career opportunities. This book makes several comparisons between (X)HTML template and the XOOPS theme engine. There is also a tutorial on how to port an existing (X)HTML template to XOOPS in Chapter 3.

For absolute beginners, I will not go through the basic concepts here. But XOOPS is quite easy to use, especially the latest version, 2.5, which has a very intuitive backend. And you can always get help from the XOOPS community at www.xoops.org. After you have some basic knowledge of XOOPS, this book will quickly deepen your understanding of XOOPS themes and templates.

Conventions Used in This Book

The following typographical conventions are used in this book:

Italic

Indicates file names, directories, new terms, URLs, clickable items in the interface such as menu items and buttons, and emphasized text.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.

Constant width bold

Shows commands or other text that should be typed literally by the user, as well as the filename at the beginning of a code example.

Constant width italic

Shows text that should be replaced with user-supplied values or by values determined by context.

Note

This icon signifies a tip, suggestion, or general note.

Warning

This icon indicates a warning or caution.

Path and Folders

XOOPS represents your XOOPS root path. Therefore, XOOPS may translate to C:\XAMPP\htdocs\XOOPS\ on your computer.

XOOPS/themes means the themes folder in your XOOPS root. You might notice that Windows uses the backslash (\)—but I will use slash (/), which is the convention in Linux.

Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Designing for XOOPS by Sun Ruoyu. Copyright 2011 XOOPS Foundation, 978-1-449-30896-4.”

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .

We’d Like to Hear from You

Please address comments and questions concerning this book to the publisher:

O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
(800) 998-9938 (in the United States or Canada)
(707) 829-0515 (international or local)
(707) 829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at:

http://oreilly.com/catalog/9781449308964/

To comment or ask technical questions about this book, send email to:

For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://www.youtube.com/oreillymedia

Safari® Books Online

Note

Safari Books Online is an on-demand digital library that lets you easily search over 7,500 technology and creative reference books and videos to find the answers you need quickly.

With a subscription, you can read any page and watch any video from our library online. Read books on your cell phone and mobile devices. Access new titles before they are available for print, and get exclusive access to manuscripts in development and post feedback for the authors. Copy and paste code samples, organize your favorites, download chapters, bookmark key sections, create notes, print out pages, and benefit from tons of other time-saving features.

O’Reilly Media has uploaded this book to the Safari Books Online service. To have full digital access to this book and others on similar topics from O’Reilly and other publishers, sign up for free at http://my.safaribooksonline.com.

Acknowledgments

First, I have to thank the core developers of XOOPS—without them, I could not have written this book. Also thanks to the many module developers whose modules I made use of while putting together this book.

Publishing the book is not easier than writing it; I got a lot of help from the community. I want to especially thank Michael (Mamba), who helped me deal with the publishing world. Mirza (Bleekk) reviewed the technical details of the book, and provided a lot of useful feedback. The editor of this book, Julie Steele; production editor Kristen Borg; and the whole O’Reilly team have done a wonderful job during the publishing process.

Finally, I want to thank my friends and family, who have always been supporting me and made this happen.

Get Designing for XOOPS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.