havalite Havalite CMS Liteweight blogging
Version: 1.1.4

How to - Documentation

Havalite, a lightweight, open source CMS Blog based on php and SQLite db. It's licensed under the GNU General Public License.

Features

  1. Simple 1 step wizard installation
  2. Text, Images and swf files all saved as data in Sqlite Database
  3. Two different image sizes: Original and Thumnail
  4. Many image filters (require GD Extenssion)
  5. Export database to any Server without changing a single line or database structure
  6. Backup for the whole system including images in only one Sqlite file.
    Backup current database OR all databases as zip file
  7. Run multiple databases according to subdomains
    Install once and use for many subdomains
  8. A lite weight and clear interface
  9. Support for 37 international languages
    Many Interface languages done on the fly with our language Creator Tool
  10. CKEditor a great WYSIWYG Text-Editor
  11. integration of third-party Plugins and Sidebar Widgets, specially jQuery, with the ability of plugin configuration
  12. plenty of useful functions for Theme creation + Theme PreviewPlugins Creation, and Sidebar Widgets
  13. RSS Feeds for Posts, Categories and Comments
  14. A Mobile Detector to switch in Mobile mode
  15. Live update within 2 seconds (version 1.1.3 and above)

Requirements

  1. Apache webserver with mod_rewrite and .htaccess file support enabled
  2. php5 or above with PDO and SqLite3 driver enabled
  3. a powerfull Browser (such as Firefox5, Google Chrom) with activted javaScript

Settings

Blog Informations

Title of your blog You can show the tag line on you page as explanation for your site This description is used in you meta tags for search engines The blog url must be exactly the same of your page url View latest posts on the start OR view a static page (static pages are defined under the static category) You can define keywords for every post and show them under your post with a link to the search function Save Settings

Design

Settings Design Theme Chooser - If you have more than 1 theme in your themes folder, they will be all listed here and you can choose which one to be used for your home page Category for Static Pages - These pages are always present on top of your site Theme Viewer - Click to see how your page would look like with the choosen Theme Post Amount on every page Date/Time formatting - the way you like to! Uploaded large images will be automatically resized Set size of thumbnail images Mobile Theme - If you have a special designed theme for a mobile (saved as mobile.php in your theme folder) Page NOT Found - In case no informations found, you can view some Text or image (use HTML) Choose Gravatar for Comments Subscriber Set Size of Gravatar Set External Image as Gravatar End result of the Gravatar Save Setting Theme Preview

System

Change language of your Havalite system The view of the latest written posts can be limited Send Email to Admin by new Comment! allow normal Text or HTML comments to the Users Board (in Dashboard) Define the names of the 5 levels of your system members Add some sytling to the dashboard Download the current database as *.db3 OR as zip file including all databases which defined in your config file Save Settings

Developer Documentation

Themes

  1. Themes info
  2. Functions

Plugins

  1. Functions Reference

Themes

Functions

hava_sqlite($sql); Get values from the database by sending sql command and retrieve an array as result;
This function is mostly used for all operations by retrieving data from sqlite db.
Hint: This won't save values to database

$result = hava_sqlite('SELECT * FROM posts');

hava_single_query($sql, $col=''); Returns single array.
If $col is set, returns result:

echo hava_single_query("SELECT * FROM cat", 'name');

hava_options($opt);

hava_options('tagline')

Get single option from Table "options"
$opt is one of the following properties:
  • title (The Blog Title)
  • tagline
  • description
  • url
hava_template_url($theme=''); Get path of the template folder url
save_comment($p, $name, $email, $comment, $website=''); Saving comments to database: Returns 1=success or 0=Failed
  • $p = post id
  • $name
  • $email
  • $comment
  • $website (or leave empty)
validate($email); Validating email. This function is also used by save_comment();
hava_gravatar($email); Gravatar image
hava_num_rows($table='posts') Get number of rows of any table
hava_single_post($id, $dataName, $slice='0'); Get a single post
  • $id = the post id
  • $dataName = the column name from the table "posts": (title, cat, author, tags, text, date, prop)
  • $slice = slice the post text (0 or leave empty = all text) (1 to any number = the first x chars)
hava_comments($p, $prop);

hava_comment(3, "name, date, website,email");

This will sort all approved comments in a post:. We get one or more values, which are set in <span> tag with id value same as columne name + the word commen_ (e.g. <span id="comment_date">01.09.2011, 1:00</span>)
The whole comment ist set to a DIV Tag with id = comment_frame
  • $p = the post id
  • $prop = name (subscriber name), date, website, email

Hint: You can also use hava_sqlite($sql); function instead
$sql = "SELECT * FROM comments WHERE id='$p' AND approved = 1";

hava_date($myDate, $formate=""); View date as set in the admin setting:
  • $myDate = the date retrieved from the database
  • $formate = leave empty or change ((d/m/Y), (d.M.y, H:i) etc...)
Sidebar
hava_sidebar_links(); View links in <ul><li> Tags
hava_sidebar_posts($limit=''); View linked posts in <ul><li> Tags
  • $limit = Set number of posts or leave empty
hava_sidebar_pages(); View linked Pages in <ul><li> Tags
hava_sidebar_cat(); View linked Category titles in <ul><li> Tags
hava_sidebar_comments($limit=''); View comments in <ul><li> Tags
  • $limit = Set number of comments or leave empty
hava_search_form($submitValue='') The Search form is set in a <span> Tag, id="the_search_form"

form name="search_form" id="search_form"
input name="s" type="text" id="s", id="search_input"
submit name="search_submit" id="search_submit" value= $submitValue

hava_comment_form($name='', $email='', $website='', $comment='', $submit='') The Comment form is set in a <span> Tag, id="the_comment_form"

form name="comment_form" id="comment_form"
Inputs are set in <label> Tags. Names can be changed to any language:

  1. $name
  2. $email
  3. $website
  4. $comment
  5. $submit
Javascript
hava_jQuery() include the last jQuery framework (Learn more about jQuery)

Hint: jQuery is automatically included to the head part the_head();

Plugins development

Plugins in Havalite need always to be set in a folder. The folder name must be the same as the plugin name! The plugin folder must have 4 different files:

  1. the plugin file (same name as the folder)
  2. info.txt (infomations about the plugin)
  3. index.php (leave empty or let the user do his own settings)
  4. plugin image. (an png image with same name as the plugin, max width/height = 50px)

example:
Plugin folder = myPlugin,
plugin name = myPlugin.php,
image name = myPlugin.png,
info file = info.txt,
settings file = index.php

When Plugins are registered by the user, they get beside there name and id three different empty values (value1, value2, value3) in the database. The plugin developer can use these values to save data.

$pluginId The Id number of your registered plugin
$hava_plugin_data;

Plugin developers can save informations in the database, which can be retrieved from this variable.

Returns array:

  1. id
  2. name
  3. value1
  4. value2
  5. value3

$myPluginName = $hava_plugin_data['name'];

add_filter($func, $pos); $func = the function to add
$pos = the position where to set the function
  1. the_head
  2. the_content
  3. the_sidbar

Default IDs, Elements, which are usefull for Javascript/jQuery

  1. #the_head
  2. #the_content
  3. #the_sidebar
    • <ul><li>
  4. #the_search_form
    • #search_input
    • #search_submit
  5. #the_comment_form
    • <label>
      1. #name
      2. #email
      3. #website
      4. #comment
      5. #submi
 
   

 

Admin Variables

header.php
$userName Name of the logged in User
$userLvl Level of the User
hava_func.php
$version Current Havalite Version
$sys_lang System Language
$commentCount Comments amount
$commNew 1 = new comment, 0 = no comments
$postCount Posts amount
$draftCount Drafts amount
$pagesCat Name of the category for static pages
$pagesCount Pages amount
$imageCount Images amount
$linkCount Links amount
$catCount Categories amount
$limit_res Limit pro Page
   
Functions
hava_single_query($sql, $col=''); returns single array
if $col is set, returns result:

echo hava_single_query("SELECT * FROM cat", 'name');

   

 

Programs and Tools in Use

A lot of great Tools from great developer are used in Havalite to prevent a simple and powerfull system:

Back to main page of Havalite CMS