|
PHP and JQuery are two of the most famous open source tools used for
web development. This book will explain how to leverage their power by
building a core CMS, which can be used for most projects without needing
to be changed, and how to add custom plugins that can then be tailored
to the individual project.
This book walks you through the creation of a CMS core, including
basic page creation and user management, followed by a plugin
architecture, and example plugins. Using the methods described in this
book, you will find that you can create distinctly different websites
and web projects using one codebase, web design templates, and
custom-written plugins for any site-specific differences. Example code
and explanation is provided for the entire project.
This book describes how to use PHP, MySQL, and jQuery to build an
entire CMS from the ground up, complete with plugin architecture, user
management, template-driven site design, and an installer. Each
chapter walks you through the problems of various aspects of CMS design
and their solutions, with example code and explanation provided for the
chosen solutions.
A plugin architecture is explained and built, which allows you to
enhance your own CMS by adding site-specific code that doesn't involve
"hacking" the core CMS. By the end of the book, you will have
developed a full CMS, which can be used to create a large variety of
different site designs and capabilities.
An in-depth walk-through in building a PHP and jQuery plugin-based CMS project.
What you will learn from this book :
- Create your own plugin architecture
- Manage users, using e-mail verification, hashes, and captchas
- Enhance your administration forms using jQuery
- Test your system using virtual machines
- Write upgrade scripts that automatically patch your system
- Manage multiple site design templates using Smarty
- Learn how easy it can be to extend your own CMS from the multiple plugins that are provided and explained
- Learn how panels work, and use them to make flexible drag-and-drop layouts with widgets
- Create an installer, using virtual machines for the test environment of your CMS
Approach This is a practical, tutorial-style book that
develops a project from start to finish, explaining all aspects of the
project. Every chapter starts by explaining what is to be accomplished
and the various ways in which the problem may be tackled, followed by an
in-depth explanation of the chosen solution.
Who this book is written for If you want to see jQuery in action with PHP and MySQL code, in the
context of a real application, this is the book for you. It is written
for developers who have written multiple scripts or websites, and want
to know how to combine them all into one package that can be used to
simplify future scripts and sites. The book is aimed at people who
understand the basics of PHP and jQuery, and want to know how they can
be used effectively to create a large project that is user-friendly and
flexible.
About the Author Kae Verens is an owner manager of the web-development
company Webworks.ie and is currently secretary of the Irish PHP Users
Group. He has been writing in JavaScript since the mid 90s,
and in PHP since the late 90s. Kae is the creator of the file
management system KFM, the CMS WebME (used by Webworks.ie for over 200
separate clients), and the author of the Packt book jQuery 1.3 with PHP.
|
Preface
Chapter 1: CMS Core Design- The CMS's private and public areas
- The front-end
- The admin area
- Plugins
- Files and databases
- Directory structure
- Database structure
- The configuration file
- Hello World
- Setup
- Front controller
- Reading page data from the database
- Summary
Chapter 2: User Management- Types of users
- Roles
- Database tables
- Admin area login page
- Logging in
- Logging out
- Forgotten passwords
- User management
- Deleting a user
- Creating or editing a user
- Summary
Chapter 3: Page Management – Part One- How pages work in a CMS
- Listing pages in the admin area
- Hierarchical viewing of pages
- Moving and rearranging pages
- Administration of pages
- Filling the parent selectbox asynchronously
- Summary
Chapter 4: Page Management – Part Two- Dates
- Saving the page
- Creating new top-level pages
- Creating new sub-pages
- Deleting pages
- Rich-text editing using CKeditor
- File management using KFM
- Summary
Chapter 5: Design Templates – Part One- How do themes and templates work?
- File layout of a theme
- Setting up Smarty
- Front-end navigation menu
- Summary
Chapter 6: Design Templates – Part Two- Adding jQuery to the menu
- Preparing the Filament Group Menu
- Integrating the menu
- Choosing a theme in the administration area
- Choosing a page template in the administration area
- Running Smarty on page content
- Summary
Chapter 7: Plugins- What are plugins?
- Events in the CMS
- Page types
- Admin sections
- Page admin form additions
- Example plugin configuration
- Enabling plugins
- Handling upgrades and database tables
- Custom admin area menu
- Adding an event to the CMS
- Adding tabs to the page admin
- Summary
Chapter 8: Forms Plugin- How it will work
- The plugin config
- Page types in the admin
- Adding custom content forms to the page admin
- Defining the form fields
- Showing the form on the front-end
- Handling the submission of the form
- Sending by e-mail
- Saving in the database
- Exporting saved data
- Summary
Chapter 9: Image Gallery Plugin- Plugin configuration
- Page Admin tabs
- Initial settings
- Uploading the Images
- Handling the uploads
- Adding a kfmget mod_rewrite rule
- Deleting images
- Front-end gallery display
- Settings tab
- Grid-based gallery
- Summary
Chapter 10: Panels and Widgets – Part One- Creating the panel plugin
- Registering a panel
- The panel admin area
- Showing panels
- Creating the content snippet plugin
- Adding widgets to panels
- Showing widgets
- Dragging widgets into panels
- Saving panel contents
- Showing panels on the front-end
- Summary
Chapter 11: Panels and Widgets – Part Two- Widget forms
- Saving the snippet content
- Renaming widgets
- Widget header visibility
- Disabling widgets
- Disabling a panel
- Deleting a panel
- Panel page visibility – admin area code
- Panel page visibility – front-end code
- Widget page visibility
- Summary
Chapter 12: Building an Installer- Installing a virtual machine
- Installing VirtualBox
- Installing the virtual machine
- Installing the CMS in the VM
- Creating the installer application
- Core system changes
- The installer
- Checking for missing features
- Adding the configuration details
- Summary
Index
|