Documentation
System requirements
- Apache Webserver with mod_rewrite and .htaccess files enabled
- PHP 5 with SQLite enabled (SQLite is included with PHP 5)
Installation
- phpSQLiteCMS works without installation. The only thing to do might be changing the write permission for the subdirectory templates_c (CHMOD 770).
- Browse to where you uploaded phpSQLiteCMS (for example http://your-domain.tld/path/to/phpsqlitecms/) and you should see the index page.
- To administrate the page, go to http://your-domain.tld/path/to/phpsqlitecms/cms/. The default admin userdata is: username: admin, password: admin.
- Make sure the following subdirectories are writable (CHMOD 777) if you want to use these features:
- File and image uploader: files, images
- Caching feature: cache
Directory structure
- cache: Directory to store cached pages. This directory requires write permission if you want to use the caching feature (CHMOD 777).
- cms: The application files are stored here. Go here to administrate your phpSQLiteCMS page.
- data: The data (content, settings, entries...) is stored in this directory (in the file content.sqlite is the main content, in entries.sqlite are comments and guestbook entries).
- files: Here you can store files like HTML or ZIP files. This directory requires write permission if you want to use the file uploader (CHMOD 777).
- images: Directory for images. This directory requires write permission if you want to use the file uploader (CHMOD 777).
- lang: The files for the language settings (charset, messages etc.) are stored here.
- templates: The Smarty templates are stored here.
- templates_c: In this directory Smarty stores compiled templates. Requires write permission (CHMOD 770).
Customizing the Layout
phpSQLiteCMS uses Smarty as template engine so just take a look at the Smarty Crash Course. The templates are stored in the subdirectory "templates". You can specify the template in the page properties when editing or creating a page.
Creating a page
Log in, click on Create new page, fill out and submit the form. Additional options like the used template are set under "Properties".
Adding a page to the menu
Go to the admin menu and select Menus. Choose the menu you want to edit. In the edit form you can then add the page. The categories are for highlighting active menu items (like now "Documentation"). To use this you also have to specify the category in the page properties.
News and overview pages
First create a new page. Select "News page" or "Overview Page" as page type in the properties. To insert a page into the news or overview page, edit or create a new page, switch to "Include" and select the page on which it should be included ("Include in:"). Then specify the teaser headline and the teser - this will be shown on the news or overview page. With "Order nr." you can order the teasers in overview pages. The order in news pages is chronological.
RSS Feeds and XML Sitemaps
Like into overview pages you can include pages into RSS Feeds and XML Sitemaps. Create a new page with page type RSS Feed or XML Sitemap, then include the pages you like into it (Include » Include in: RSS Feed / XML Sitemap). The title of the RSS Feed will be the page title, the description the description in "Properties".
Photo pages
First you have to create a photo gallery. Therefor go to Admin menu » Photo galleries » Create new gallery. Here you can add/upload photos and write titles and descriptions. After you created a photo gallery you have to insert it into a page: Edit or crate a new page, select "Photo page" as page type and specify the gallery name in the field next to it.
Language forwarding
You can setup a page (e.g. the index page) which forwards the users according to their language settings. Therefor specify the page type "language forwarding" in the page properties and add e.g. "en,index_en;es,index_es;de,index_de". This will refer the users to index_en, index_es or index_de according to their language settings if their preferred language is available. Example...
Other page types
In the page properties you can furthermore specify the following page types:
- Commentable page: Pages on which users can add comments. Comments can be managed in the Admin area » Comments.
- Formmailer: Contact form which sends an e-mail to the e-mail address specified in the settings.
- Guestbook: Provides a guestbook. Entries can be managed directly on the page when when logged in.
- Forwarding: Forwards to a specified page.
- Notes page: Includes a notes section. See example...
- Newsletter subscription: Provides a newsletter subscription form and collects the E-Mail addresses of suscribers. The e-mail addresses are managed directly an the page when logged in. To send newsletters, use your e-mail programm and copy the address list into the BCC field.
- Search: Provides a search function. Searched are titles, contents, sidebars, descriptions and keywords of the pages. In the advanced settings you can exclude pages from searching (search_excluded_pages, pages separated by commas)
If you want to create a custom page type, create a page type script in the folder cms/page_types/ and specify it in the file cms/config/page_types.conf.php.
Auto HTML
There's an option "Auto HTML" for some content fields. This function adds <p>...</p> around paragraphs and replaces line breaks by <br />. Disable this function for HTML code.
Global content blocks
You can specify global content blocks and include them on several pages or in a template. The following template code includes the global content block #1 of the page properties:
{$gcb[$gcb_1]}
...or this way to display it within a container:
{if $gcb_1 && $gcb[$gcb_1]}
<div>{$gcb[$gcb_1]}</div>
{/if}
This displays the global content block with ID 1 on all pages:
{$gcb[1]}
Data synchronisation
Since SQLite is file based synchronisation is easy: If you edit something on your localhost you can synchronise the data by uploading the file cms/content.sqlite. But don't upload cms/entries.sqlite as this will delete all comments, guesbook entries and collected newsletter addresses. You can download both files for backup purpose.
Spam protection
You can specify not accepted words, IPs and user agents and you can use Bad Behavior and Akismet for spam protection (see spam protection in the admin menu).
Caching
With the caching feature enabled (Settings) you can speed up the parsing of pages and save server performance. Note that the directory cache needs to be writable for this purpose!
At the first request of a page a cache file of the page is created. On the following requests only the cache file is displayed without parsing or database requests.
Please note the following when using the caching feature:
- The cache is cleared automatically when editing pages or changing settings.
But: If you make changes on the templates or load up data files (see Data synchronisation) you have to clear the cache manually (Admin menu » clear cache). - As no database request takes place when the page is already cached, the IP/user agent filters and the Bad-Behavior spam protection is not active on normal page requests. They will work only if data is posted (e.g. when submitting a comment).
WYSIWYG editor
phpSQLiteCMS is ready for FCKeditor. But due to the large file size you have to download it separately and copy the folder fckeditor into cms/modules/. You can then change the edit mode to WYSIWYG when editing a page. To be able to use all features of FCKeditor like the image uploader you have to edit some settings of the FCKeditor.