Documentation |
Getting started and advanced tips |
|
On this page you'll find documentation on the installation and configuration of CompactCMS.
1 RequirementsBefore you consider to install CompactCMS on your server to manage your next or current website, it is important that you understand that CompactCMS has a few, although standard, system requirements you need to meet for the CMS to work. If you're not sure whether you meet the requirements stated below, please refer to your hosting company.
2 Quick installationAfter downloading the package, you should follow the numbered steps below to get you started with the CompactCMS installation.
That is all there is to it. The installer should guide you through the necessary steps. If anything goes wrong, refer to the next chapter for manual installation instructions. To start designing your own template, take a look at the included examples. Chapter seven lists all of the template variables that you can use. 3 Manual installation instructionsStep 1: extract files Step 2: edit configuration file Tip: if you later on run intro trouble, please make sure these settings are correct. Database name, username and password are case-sensitive. Step 3: edit .htaccess file If you have installed CompactCMS in another directory than the root, you should open up the ”.htaccess” file included within the archive. By default the root configuration is enabled. If you want to use the sub directory configuration you should set the RewriteBase variable appropriately. # For an installation under root (default) # Example: www.mysite.com/index.php RewriteBase / # For an installation under /cms # Example: www.mysite.com/cms/index.php # RewriteBase /cms/ # For an installation under /test/compactcms # Example: www.mysite.com/test/compactcms/index.php # RewriteBase /test/compactcms/ Also see the file itself for further details. In case you already have such a file, you should merge the two together into one file. Step 4: create database structure The instructions below indicate on how to import the structure.sql file.
Step 5: upload to server Step 6: set permissions
A note on file permissions: 4 Configuration variablesBelow you'll find a list of all the variables currently used by CompactCMS. The standard variables (4.1) and MySQL variables (4.4) need changing for CompactCMS to work. The other variables should work out of the box and should be changed when in need of changed behavior of CompactCMS. 4.1 Standard variablesVariable: $cfg['sitename'] Examples: $cfg['sitename'] = "CompactCMS" $cfg['sitename'] = "Soccer Fansite"; Variable: $cfg['language'] Examples: $cfg['language'] = "en"; //-> english $cfg['language'] = "nl"; //-> dutch $cfg['language'] = "de"; //-> german Variable: $cfg['rootdir'] Examples: $cfg['rootdir'] = "/"; //-> For an install under root (www.yoursite.com/) $cfg['rootdir'] = "ccms/"; //-> If under a sub directory (www.yoursite.com/ccms/) $cfg['rootdir'] = "tests/cms/"; //-> For www.yoursite.com/tests/cms/ Variable: $cfg['authcode'] Examples: $cfg['authcode'] = "12345"; $cfg['authcode'] = "A1b2C"; 4.2 Extended configuration Variable: $cfg['version'] [true|false] Examples: $cfg['version'] = "true"; //-> Check for new version on initial load (default) $cfg['version'] = "false"; //-> Disable checking for a new version Variable: $cfg['iframe'] [true|false] Examples: $cfg['iframe'] = "false"; //-> Do not support iframe management (default) $cfg['iframe'] = "true"; //-> Enable support for iframe management Variable: $cfg['wysiwyg'] [true|false] Examples: $cfg['wysiwyg'] = true; //-> Enable the WYSIWYG editor [true/false] 4.3 Security variablesVariable: $cfg['protect'] Examples: $cfg['protect'] = true; //-> This will require you to login. 4.4 MySQL database variables Variable: $cfg['mysql_host'] Examples: $cfg['mysql_host'] = "localhost"; $cfg['mysql_host'] = "127.0.0.1"; Variable: $cfg['mysql_user'] Example: $cfg['mysql_user'] = "root"; Variable: $cfg['mysql_pass'] Example: $cfg['mysql_pass'] = "compactcms"; Variable: $cfg['mysql_db'] Example: $cfg['mysql_db'] = "compactcms"; 4.5 Other variables Variable: $cfg['restrict'] ! Use the filenames without extension. Examples:
$cfg['restrict'] = array("sitemap", "phpform");
$cfg['restrict'] = array("sitemap");
$cfg['restrict'] = array("faq", "contact", "newsletter");
Tip: to see if you configured this variable right, open up the admin and check whether the edit and preview links are replaced by “Restriced content” for the specified pages. 5 MySQL database structureBelow you'll find the contents of the "structure.sql" file. If you know how to use this syntax, then go ahead and copy & paste the code. Otherwise use the structure.sql file included with the archive and import it into your database using PhpMyAdmin. See step 4 above on how to import the structure.sql file.
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- --------------------------------------------------------
--
-- Table structure for table `ccms_cfgcomment`
--
DROP TABLE IF EXISTS `ccms_cfgcomment`;
CREATE TABLE IF NOT EXISTS `ccms_cfgcomment` (
`cfgID` int(5) unsigned zerofill NOT NULL AUTO_INCREMENT,
`pageID` varchar(100) CHARACTER SET latin1 NOT NULL,
`showLocale` varchar(5) CHARACTER SET latin1 NOT NULL DEFAULT 'eng',
`showMessage` int(5) NOT NULL,
PRIMARY KEY (`cfgID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `ccms_cfgnews`
--
DROP TABLE IF EXISTS `ccms_cfgnews`;
CREATE TABLE IF NOT EXISTS `ccms_cfgnews` (
`cfgID` int(5) NOT NULL AUTO_INCREMENT,
`pageID` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`showLocale` varchar(5) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'eng',
`showMessage` int(5) NOT NULL DEFAULT '3',
`showAuthor` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`showDate` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`showTeaser` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
PRIMARY KEY (`cfgID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Configuration variables for modNews' AUTO_INCREMENT=2 ;
-- --------------------------------------------------------
--
-- Table structure for table `ccms_cfgpermissions`
--
DROP TABLE IF EXISTS `ccms_cfgpermissions`;
CREATE TABLE IF NOT EXISTS `ccms_cfgpermissions` (
`manageUsers` int(1) NOT NULL DEFAULT '3' COMMENT 'From what user level on can users manage user accounts (add, modify, delete)',
`manageOwners` int(1) NOT NULL DEFAULT '3' COMMENT 'To allow to appoint certain users to a specific page',
`managePages` int(1) NOT NULL DEFAULT '1' COMMENT 'From what user level on can users manage pages (add, delete)',
`manageMenu` int(1) NOT NULL DEFAULT '2' COMMENT 'From what user level on can users manage menu preferences',
`manageTemplate` int(1) NOT NULL DEFAULT '3' COMMENT 'From what user level on can users manage all of the available templates',
`manageModules` int(1) NOT NULL DEFAULT '5' COMMENT 'From what user level on can users manage modules',
`manageActivity` int(1) NOT NULL DEFAULT '2' COMMENT 'From what user level on can users manage the activeness of pages',
`manageVarCoding` int(1) NOT NULL DEFAULT '3' COMMENT 'From what user level on can users set whether a page contains coding (wysiwyg vs code editor)',
`manageModBackup` int(1) NOT NULL DEFAULT '3' COMMENT 'From what user level on can users delete current back-up files',
`manageModNews` int(1) NOT NULL DEFAULT '2' COMMENT 'From what user level on can users manage news items through the news module (add, modify, delete)',
`manageModLightbox` int(1) NOT NULL DEFAULT '2' COMMENT 'From what user level on can users manage albums throught the lightbox module (add, modify, delete)',
`manageModComment` int(1) NOT NULL DEFAULT '2' COMMENT 'The level of a user that is allowed to manage comments'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `ccms_cfgpermissions`
--
INSERT INTO `ccms_cfgpermissions` (`manageUsers`, `manageOwners`, `managePages`, `manageMenu`, `manageTemplate`, `manageModules`, `manageActivity`, `manageVarCoding`, `manageModBackup`, `manageModNews`, `manageModLightbox`, `manageModComment`) VALUES (3, 0, 2, 2, 4, 4, 2, 4, 3, 2, 2, 2);
-- --------------------------------------------------------
--
-- Table structure for table `ccms_modcomment`
--
DROP TABLE IF EXISTS `ccms_modcomment`;
CREATE TABLE IF NOT EXISTS `ccms_modcomment` (
`commentID` int(5) unsigned zerofill NOT NULL AUTO_INCREMENT,
`pageID` varchar(100) NOT NULL,
`commentName` varchar(100) NOT NULL,
`commentEmail` varchar(100) NOT NULL,
`commentUrl` varchar(100) DEFAULT NULL,
`commentContent` text NOT NULL,
`commentRate` enum('1','2','3','4','5') NOT NULL,
`commentTimestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`commentHost` varchar(20) NOT NULL,
PRIMARY KEY (`commentID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Table containing comment posts for CompactCMS guestbook mo' AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `ccms_modnews`
--
DROP TABLE IF EXISTS `ccms_modnews`;
CREATE TABLE IF NOT EXISTS `ccms_modnews` (
`newsID` int(5) unsigned zerofill NOT NULL AUTO_INCREMENT,
`userID` int(5) unsigned zerofill NOT NULL,
`pageID` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`newsTitle` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
`newsTeaser` text COLLATE utf8_unicode_ci NOT NULL,
`newsContent` text COLLATE utf8_unicode_ci NOT NULL,
`newsModified` datetime NOT NULL,
`newsPublished` enum('0','1') COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`newsID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `ccms_modules`
--
DROP TABLE IF EXISTS `ccms_modules`;
CREATE TABLE IF NOT EXISTS `ccms_modules` (
`modID` int(5) unsigned zerofill NOT NULL AUTO_INCREMENT,
`modName` varchar(200) COLLATE utf8_unicode_ci NOT NULL COMMENT 'File name',
`modTitle` varchar(200) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Friendly name',
`modLocation` text COLLATE utf8_unicode_ci NOT NULL,
`modVersion` decimal(5,2) NOT NULL,
`modPermissionName` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`modActive` enum('0','1') COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`modID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Table with the installed modules, their version and activene' AUTO_INCREMENT=4 ;
--
-- Dumping data for table `ccms_modules`
--
INSERT INTO `ccms_modules` (`modID`, `modName`, `modTitle`, `modLocation`, `modVersion`, `modPermissionName`, `modActive`) VALUES
(00001, 'News', 'News', './lib/modules/news/news.Manage.php', 1.00, 'manageModNews', '1'),
(00002, 'Lightbox', 'Lightbox', './lib/modules/lightbox/lightbox.Manage.php', 1.00, 'manageModLightbox', '1'),
(00003, 'Comment', 'Comments', './lib/modules/comment/comment.Manage.php', 1.10, 'manageModComment', '1');
-- --------------------------------------------------------
--
-- Table structure for table `ccms_pages`
--
DROP TABLE IF EXISTS `ccms_pages`;
CREATE TABLE IF NOT EXISTS `ccms_pages` (
`page_id` int(5) unsigned zerofill NOT NULL AUTO_INCREMENT,
`user_ids` varchar(300) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0' COMMENT 'Separated by ||',
`urlpage` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`module` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'editor',
`toplevel` tinyint(5) DEFAULT NULL,
`sublevel` tinyint(5) DEFAULT NULL,
`menu_id` int(5) DEFAULT '1',
`variant` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'ccms',
`pagetitle` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`subheader` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
`description` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
`keywords` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`srcfile` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`printable` enum('Y','N') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Y',
`islink` enum('Y','N') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Y',
`iscoding` enum('Y','N') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'N',
`published` enum('Y','N') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Y',
PRIMARY KEY (`page_id`),
UNIQUE KEY `urlpage` (`urlpage`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='Table with details for included pages' AUTO_INCREMENT=3 ;
--
-- Dumping data for table `ccms_pages`
--
INSERT INTO `ccms_pages` (`page_id`, `user_ids`, `urlpage`, `module`, `toplevel`, `sublevel`, `menu_id`, `variant`, `pagetitle`, `subheader`, `description`, `keywords`, `srcfile`, `printable`, `islink`, `iscoding`, `published`) VALUES
(00001, '0', 'home', 'editor', 1, 0, 1, 'ccms', 'Home', 'The CompactCMS demo homepage', 'The CompactCMS demo homepage', 'compactcms, light-weight cms', 'home.php', 'Y', 'Y', 'N', 'Y'),
(00002, '0', 'contact', 'editor', 2, 0, 1, 'sweatbee', 'Contact form', 'A basic contact form using Ajax', 'This is an example of a basic contact form based using Ajax', 'compactcms, light-weight cms', 'contact.php', 'Y', 'Y', 'Y', 'Y');
-- --------------------------------------------------------
--
-- Table structure for table `ccms_users`
--
DROP TABLE IF EXISTS `ccms_users`;
CREATE TABLE IF NOT EXISTS `ccms_users` (
`userID` int(5) unsigned zerofill NOT NULL AUTO_INCREMENT,
`userName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`userPass` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`userFirst` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`userLast` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
`userEmail` varchar(75) COLLATE utf8_unicode_ci NOT NULL,
`userActive` tinyint(1) NOT NULL,
`userLevel` tinyint(1) NOT NULL,
`userToken` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`userLastlog` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`userTimestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`userID`),
UNIQUE KEY `userName` (`userName`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Table with users for CompactCMS administration' AUTO_INCREMENT=2 ;
--
-- Dumping data for table `ccms_users`
--
INSERT INTO `ccms_users` (`userID`, `userName`, `userPass`, `userFirst`, `userLast`, `userEmail`, `userActive`, `userLevel`, `userToken`, `userLastlog`, `userTimestamp`) VALUES
(00001, 'admin', '52dcb810931e20f7aa2f49b3510d3805', 'Xander', 'G.', 'xander@compactcms.nl', 1, 4, '5168774687486', '2010-09-01 06:00:00', '2010-09-01 09:00:00');
6 Upgrading instructionsYou are encouraged to do a clean install if upgrading to 1.4.1. The file structure has significantly changed. Make sure you back-up your /content/ and media directories, your templates and database tables. You can - after doing a clean install - restore these manually. In doing so, please make sure that:
I apologize for making upgrading to 1.4.1 relatively hard. If unsure, consider not upgrading at all. Otherwise, be sure to keep a back-up of your current pages, media, templates and database data while trying to manually upgrade to 1.4.1. 7 Template variablesThe default templates give you a working example of the various variables that can be used within your template to show content from your CompactCMS back-end. For example when you request the file "contact.html" all of the variables below will be filled with the appropriate content. The variable {%urlpage%} becomes "contact" and the {%pagetitle%} could become something like "Contact us now!" depending what value you have entered in the back-end. Please refer to the example templates for a demonstration of how these variables are used.
>> General variables
- {%urlpage%} | The current filename that is being shown
- {%rootdir%} | The directory your CCMS is installed under, relative to the root (for external files)
- {%title%} | Use this tag within you <title></title> tag for optimal SEO
- {%pagetitle%} | Displays the current pagetitle (good for a <h1> tag)
- {%subheader%} | A short slogan, descriptive text for the current page (<h2>)
- {%sitename%} | Use this anywhere you want to show your sitename (e.g.: copyright)
- {%desc%} | An "extensive" description of the current page (use as meta description)
- {%keywords%} | Keywords (tags) for the current page as specified in the back-end (use as meta keywords)
- {%breadcrumb%} | Show the breadcrumb/pathway to the current file
- {%printable%} | Use as: {%IF printable (eq Y)%}<a href="print/{%urlpage%}.html">Print</a>{%/IF printable%}
>> Menu items
- {%mainmenu%} | Prints an ordered list (<ul>) with all current published files in specified menu
- {%leftmenu%} | ''
- {%rightmenu%} | ''
- {%footermenu%} | ''
- {%extramenu%} | ''
>> Content tag
- {%content%} | The content from the current file that is being requested
|
© 2012 CompactCMS | Maintained with CompactCMS