SourceForge.net Project Page
Welcome to the world of mogul.x!

Online Manual


mogul.x websites
mogul.x lists
mogul.x misc
Index

General
mogul.x is a CMS script for smaller websites written in PHP (http://php.net) and using MySQL (http://mysql.com).

Copyright © by Thomas Maurer aka nookone <nookone@bluemail.ch>.

For questions, support, suggestions, bugs etc. please visit the sourceforge project page (Link) or drop me an email to nookone@bluemail.ch. If you are a user of mogul.x, please send me an email with the URL to your website. I'm very interested in every kind of feedback. Feel free to send comments.

I would like to thank all guys out there who use this script :).


About
What is mogul.x?
mogul.x is a simple Content Manage System (CMS). The whole website always links on one file (index.php). It is possible to create templates through the control panel which will be displayed over a 'View-Id'. The system is actually very simple, but very actual and practical.

What is mogul.x suitable for?
mogul.x is mainly suitable for smaller websites (about 30-40 Pages; but more possible). Each page is easy to edit. If for a personal website or an information website, mogul.x is the right script for homepages of that kind.

Why should I use mogul.x?
  • Extensive and secure admin control panel (Sessions and htaccess for Apache)
  • Fast editing of all pages possible!
  • Simple but actual template- and view-id system.
  • XHTML 1.0 W3 Standard used.
  • No unnecessary risks thanks to the database integration!
  • Using of a head- and foot-template and error- and css-template possible.
  • All pages are linked to one file. So you don't have to edit any code-files.
  • Fast displaying of the pages thanks to precaching of the templates.


Requirements
What you need (server software) for running mogul.x properly:
  • PHP - Version 4.2.1 or higher.
  • MySQL - Version 3.21.* or higher

PHP must be compiled with...
  • --with-mysql
  • --with-zlib (if you want to use output compression)


Installation
Follow the following instructions...

1. Extract the compressed file.
2. Edit admin/config.php; Fill in your database settings (host, user and password plus the database name).
3. Upload all the files and directories on your webserver. Don't rename or change anything!
4. Chmod the cache directory (/root/cache/) to 777 (writable).
5. Execute the SQL commands in the SQL-file (use phpMyAdmin, the SSH tool mysqldump or the SSH mysql client).
6. Login to your mogul.x control panel (http://example.com/admin). Default password: admin (Don't forget to change!)
7. That's it :). Now you can create and edit your website.

If you need help, use the user mailinglist (mogulx-user@lists.sourceforge.net) on sourceforge. Thanks :).


Views
Some notes about the view-id system:
  • You can use more then just one view-ids for one template. All view-ids of a template are displayed on the template edit page (at the bottom).
  • Via the link-tag to a view-id (syntax: {link:view}, replace 'view" with your view-id) you can link from view-id to view-id in your templates. Actually, "{link:home}" will be replaced by "index.php?view=home". When you use the export feature "{link:home}" will be replaced by "home.html" (if you don't change any filename all html-files should be linked correctly).


Replacements
All replacements you add in the database will be replaced by the value you set. You can you use all replacements in all templates (incl. the default templates).

The syntax is easy to use:
{replacement} - Don't forget the branches!

There are two default replacements which you can use:
  • {exectime} - The execution time of the script in seconds.
  • {queries} - The number of database queries.


PlugIns
With the mogul.x plugin system you can add several features or/and functions to your website.

Important note: Notice that the plugin sites will be loaded and generated dynamically from the database! This means more database queries. Only the static pages which are saved in the template-table are cached!

The system works like this:

You find all available plugins in the plugin package. There you find for each plugin several files, some for the root-directory of mogul.x and some for the admin directory. If you want to install a plugin on your website, you just have to copy them in the right directories, execute the sql-commands (if necessary) and add a link to the plugin page (admin/plugin.php) in your control panel. That's it :).

If you want to add a plugin to the plugin package of mogul.x notice the following:
  • Use the make-class for displaying admin interfaces.
  • Use the super global arrays introduced by PHP version 4.1.0!
  • PEAR coding standard!

The structure for a file in the root-directory of mogul.x has to be like this:
<?php

/**
* This script is part of mogul.x. For more informations
* about mogul.x please visit the sourceforge project page
* under http://sourceforge.net/projects/mogulx.
*
* Links:
*  - http://mogulx.sourceforge.net
*  - http://sourceforge.net/projects/mogulx
*
* [File: filename.php, 01.01.2003 12:00, editor]
*/

include_once "./require.php";

/* doc vars */
$table = $config['prefix']."plugin_table";  // if necessary


/*
    add here your plugin code.
    the content of the whole page you want to display has to be saved in the variable $content!
*/


include_once "./output.php";

?>

For a file in the admin-directory of mogul.x use the following code:
<?php

/**
* This script is part of mogul.x. For more informations
* about mogul.x please visit the sourceforge project page
* under http://sourceforge.net/projects/mogulx.
*
* Links:
*  - http://mogulx.sourceforge.net
*  - http://sourceforge.net/projects/mogulx
*
* [File: filename.php, 01.01.2003 12:00, editor]
*/

error_reporting(E_ALL);

require_once "./global.php";

/* doc vars */
$doctitle = "PlugIn name";
$table = $config['prefix']."plugin_table";


/*
    add here your plugin code.
    the content of the whole page you want to display has to be saved in the variable $content!
*/


?>



Files
What does which file?
  • index.php - gets main view if view not set, display content of view cachefile
  • global.php - global file for the plugins
  • output.php - outputs the default templates with the content of $content
  • admin/both.php - defines constants, set ini's, get database object and set database options
  • admin/classes.php - requires all needed classes (from admin/backend/)
  • admin/config.php - first config array (for database connection), default tempalte ids
  • admin/config2.php - second config array (+ merge them), session object
  • admin/export.php - export feature
  • admin/functions.php - function lib
  • admin/global.php - global file for all feature files!
  • admin/index.php - login/session management, frame displaying, navigation, index site
  • admin/manual.php - manual :)
  • admin/password.php - password feature (htaccess)
  • admin/phpinfo.php - php info
  • admin/plugin.php - plugin list
  • admin/replacement.php - replacement managment
  • admin/service.php - settings, cache update, mysqldump, database optimizing
  • admin/template.php - template managment
  • admin/view.php - view managment



Concept visualisation



Screenshots

Screenshots 1 - Indexsite



Screenshots 2 - Template Edit - Selection



Screenshots 3 - Template Edit



Screenshots 4 - View Edit



Screenshots 5 - Replacement Edit