Instructions
ezCMS is a simple Content Management System for small websites and it takes only a few minutes to setup and use. It requires only a little knowledge of FTP and HTML.
>> Demo
>> Download ezCMS here
Requirements
- PHP 5 (recommended)
- A plain text editor (e.g. Notepad++)
- An FTP client (e.g. FileZilla)
- JavaScript enabled.
- Firefox as a browser recommended.
Installation & Setup
Upload the files to your server.
Set file permission 777 to folders:
- backup
- content
- gallery
- images
Set file permission 777 also to the files in folder 'content'.
Login and password CMS
Open 'cms.php' in folder 'cms' in a plain text editor and look for the following lines:
//Define user and password.
$users = array(
array("admin","demo"),
);
Change username and password. Default is 'admin' and 'demo'.
Login to the administration area with 'http:\\www.yourwebsite.com\cms\cms.php'.
For more security you can change the name of folder 'cms' to e.g. 'cmsXd1P32' and the name of 'cms.php' to 'edit.php' or whatever you want.
Login and password Images and Gallery upload
Open 'upload.php' in folder 'images' and 'gallery' in a plain text editor and look for the following line:
$pass = 'demo';
Change password. Default is 'demo'.
A simple PHP Template Engine
You can use a simple PHP Template Engine, which separates content from design from code. This allows you to keep the same content format and just change the template in a new template.
Step 1
Copy and save the code below as 'index.php' in the root of your server.
<?php
//Uncomment or comment lines below depending on which site elements you are using.
//$layout = file_get_contents("content/_layout.tpl");
//$header = file_get_contents("content/_header.tpl");
//$menu = file_get_contents("content/_menu.tpl");
//$sidebarLeft = file_get_contents("content/_sidebarLeft.tpl");
//$sidebarRight = file_get_contents("content/_sidebarRight.tpl");
//$footer = file_get_contents("content/_footer.tpl");
if($_GET['content'] != '')
{
if(file_exists("content/" . $_GET['content'].".txt"))
{
$body = file_get_contents("content/" . $_GET
['content'].".txt");
} else
{
$body = file_get_contents("content/home.txt");
}
} else
{
$body = file_get_contents("content/home.txt");
}
//Uncomment or comment lines below depending on which site elements you are using.
//$layout = str_replace("{HEADER}", $header, $layout);
//$layout = str_replace("{MENU}", $menu, $layout);
//$layout = str_replace("{SIDEBAR LEFT}", $sidebarLeft, $layout);
//$layout = str_replace("{SIDEBAR RIGHT}", $sidebarRight, $layout);
//$layout = str_replace("{FOOTER}", $footer, $layout);
//$layout = str_replace("{CONTENT}", $body, $layout);
echo $layout;
?>
Step 2
From the code below you may notice {HEADER}, {MENU}, {SIDEBAR LEFT}, {SIDEBAR LEFT}, {CONTENT} and {FOOTER}. These are references so the engine will know, where it needs to place your menu, sidebars, content and footer.
Save the code below as '_layout.tpl' in folder 'content.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Your Sitename</title>
<link rel="stylesheet" type="text/css" href="css/_style.css" />
</head>
<body>
<div id="wrapper">
<div id="header">
{HEADER}
</div>
<div id="leftSidebar">
{SIDEBAR LEFT}
</div>
<div id="content">
{CONTENT}
</div>
<div id="rightSidebar">
{SIDEBAR RIGHT}
</div>
<div id="footer">
{FOOTER}
</div>
</div>
</body>
</html>
You can find a ready made '_layout.tpl' in folder 'content' for a simple 3 column layout as well as a '_style.css' for styling your website online. With this layout and the CSS you can create every kind of website you can imagine.
#Step 3
Create your template files, fill them with regular HTML code and content and save them in folder 'content'.
- _header.tpl
- _menu.tpl
- _sidebarLeft.tpl
- _sidebarRight.tpl
- _footer.tpl
You can find ready made '_*.tpl' files in folder 'content' for a simple 3 column layout as well as a '_style.css' for styling your website online.
#Step 4
Save the content for your homepage as 'home.txt' in folder 'content'.
With that data stored, you need to work out, which page you are actually on, if($_GET['content'] != '') checks to see, if you should be loading a content page, if not you get the contents of 'home.txt'.
#Step 5
Create your pages, e.g. 'about.txt', 'services.txt', 'products.txt' etc. Fill them with regular HTML code and content, save them in folder 'content' and set their file permission to 777.
Edit your '_menu.tpl' using the structure below. Notice how the 'index.php' refers to the different *.txt files:
Example:
<div id="menu">
<ul>
<li><a href='index.php'>Homepage</a></li>
<li><a href='index.php?content=about'>About Us</a></li>
<li><a href='index.php?content=services'>Services</a></li>
<li><a href='index.php?content=products'>Products</a></li>
etc.
</ul>
</div>