Shinobi Handbook

Shinobi is the lightest blog engine and PHP framework with full functionality that includes:

— usual things of blog engines (authorization, creating, editing, removing and output of notes and comments, pausing discussions and premoderated comments, listing recent comments, setting available tags in comments, paginated output of notes, text search, date and topic search, simple editing of topics, hidden notes, prohibition of comments, RSS, attachments, Ctrl+Enter to publish notes, alternative URLs for notes, quick tags, careful processing of program code in notes);

— possibility to keep the blog hidden, allowed to read just for its administrator;

— possibility to keep the whole site hidden;

— optional multiuser mode with possibilities to set default privileges and every user privileges, with optional external user registration and atribution of pages and notes;

— administrative options are the parts of the system: after you login you have more possibilities;

— drafts (you can move notes from drafts to the main part and back anytime);

— security: proceeding user and stored data;

— protection of users: included functionality to protect of a harmful code, captcha, nofollow/noindex;

— operations with usual text pages; every page can be set as the main page of the site;

— dynamical pages (plug-ins) and editing those through the web interface;

— optional comments for pages and plug-ins;

— special page to send emails for the administrator;

— prefernces for the blog and the website, including password changing;

— dynamical menu creation;

— editing layout templates, creating additional areas;;

— SEO: editing keywords and descriptions for search engines in every page or note, prohibiting to index some links; "robots.txt" file is created and edited by the engine;

— file manager;

— downloads functionality;

— multilingual interface: small text dictionary file is used for every language; deffault language is English, but there is the Russian language in the basic set as well; the language of the text editor depends on the selected language;

— 404 page edited;

— all addresses and file paths may be changed in the administrative interface, excepting core file, .htaccess, preferences file and reset file;

— backups: creating, managing (you can choose what you want to backup), restoring from files or from the interface;

— built-in documentation.


1. Information

Shinobi is the blog oriented framework, it requires PHP 4 or 5 and prefers Apache server. MySQL datbase is not required.

Just "index.php" file in the server root is required for the basic functionality in the unsafe mode (even if there is the unsafe mode, you should be calm about you preferences, password and users information privacy, because Shinobi adds a secure code into these files to avoid direct opening).

Otherwise, "index.php" and ".htaccess" files are required for normal work in the safe mode. The rest part of the files are created by the engine; anyway, the base package contains few folders and files preferred for a comfortable work (e.g. predefined styles, language files).

There is a default folder called "data" that is unavailable through the web; it stores notes, comments, config files, pages, plug-ins, "langs" folder to store language files (if the only English language is necessary, than this foldes and its content are not required), "docs" folder to store documentation files in different languages, and the foldars that are available through the web, like the following: "css" for styles, "js" for scripts and text editor with language files, "storage" for automatically uploaded files that are attached to the notes, "files" for user files, "images" for user images as design files (these two are optional). Icon file can be changed to any "favicon.ico".


2. Setup

You should know what the server root folder is before you start installing. It can be "www", "httpdocs", "htdocs", "public_html" or another. You should set the total access (777) for this folder.

You should unpack "shinobi.zip" archive and copy all unzipped files and folders into the server root folder. Set the total access (777) for "css", "data", "files", "images", "storage" folders and "css/style.css" file.

Now you can type the address of your server in the browser address bar and see your working website there.

You should type http://your-site/admin (http://your-site/?admin if unprotected mode) by default in the address bar to administrate your website and input 12345 password. After you login you should enter the Preferences page and change the password, and re-login then.


3. Preferences

All available options are gathered in the sidebar. Clicking "Preferences" link you can get options that specify website behavior; a part of those has default values, and the other part should be filled in. You are strongly recommended to fill in the "Your mailbox" (to get notifiction if those are switched on) and "Mailing box" ("from" e-mail of notofications; you can fill in an unreal one) fields. If you change page extension from slash to e.g. .html, then administrative board will be available as http://your-site/admin.html, i.e. the URL depends on extension chosen. You can set any extension at all (.htm, .html, .asp, .php, .jsp, .cfm, .wbp, .jhtml и т.п.), with dot, if this is not a slash. URLs followed with a slash are equal ones withou slash; i.e. http://your-site/search/ is equal with http://your-site/search. The rest of preferences can be clear because of titles in language chosen.

You can set the mainpage of your website as well while filling in "Website start page" field ("blog" by default which shows the latest blog posts). Do not use page extensions, input page name only. Pages can be created using "Pages" option.


4. Advanced configuration and design

If the automatically generated HTML structure is enough, you just have to upload images for your design to any web available folder, e.g. "images" or "files", and edit style file through administrative interface.

If a special HTML is required, you should input into "Reload main template" field of "Edit structure" page the following:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<meta http-equiv="Pragma" content="no-cache">
	<meta http-equiv="Expires" content="0">
	<meta http-equiv="Content-Type" content="text/html; 
		charset=windows-1251">
	<meta name="keywords" content="{&KEYWORDS&}">
	<meta name="description" content="{&DESCRIPTION&}">
	<title>{&TITLE&}</title>
	<link rel="stylesheet" type="text/css" href="{&STYLE&}" 
		media="all">
	<link rel="shortcut icon" type="image/x-icon" 
		href="{&SITEROOT&}favicon.ico">
	{&RSS&}
</head>
<body class="{&BODYCLASS&}" id="{&BODYID&}">
	<div id="general">
		<div id="header">{&TITLEH&}</div>
		<div id="subheader">{&SUBTITLE&}</div>
		<div id="content">
		{&CONTENT&}
		</div>
		<div id="sidebar">
		{&SIDEBAR&}
		</div>
		<div id="footer">{&FOOTER&}</div>
	</div>
</body>
</html>

Then you should edit the template as required. Save changes. The template will be taken from the rewritten example, not from the core after that. Please notice that the parts that are surrounded with {&...&} (e.g. {&TITLE&}) are system ones: you should not remove those in order to save program components. None of those are not used in the default template in the core, but you can use those in your templates, notes, pages and sidebar:

{&VERSION&} outputs the version of the engine dot divided, e.g. 1.2.0.5;

{&ENGINE&} outputs engine name;

{&YEAR&} outputs current year as YYYY (2010);

{&EXT&} outputs the extension get from pregerences, e.g. .html or /;

{&URL&} outputs current URL (that is after server name, without slashes and page extension);

{&AUTH&} outputs the authorization form;

{&SEARCH&} outputs the search form at all pages except the search one;

{&LAST&} outputs the last blog notes (you can set quantity of those in the Preferences).


If you have to remove administrative or user menu from the sidebar to put those to other places in your template, you can use {&ADMIN&} и {&MENU&} labels putting these to the place you need.


Note structure in your blog you can setup in the “Reload post template” window at the same page. Default structure is like this:

{Onepost:HEADER}
{Onepost:ISHIDDEN}
{Onepost:DATE}
{Onepost:TOPICS}
{Onepost:AUTHOR}
{Onepost:ATTACH-IMG}
{Onepost:TEXT}
{Onepost:ATTACHMENTS}
{Onepost:EDIT}
{Onepost:COMMENTSLOAD}
{Onepost:COMMENTSCOUNT}

Here consequently go system marks for a heading, hidden note label, date, topics, author, attached images, note text, attachments of different types, edit link, comment text and comment link (these two sections can’t stay together); you can rearrange these marks and remove those you don’t need.


You can add menu of 2 types to the sidebar.

Menu shown for everyone is edited in "Visible user menu" section and it will be be displayed before the sidebar content if there is at least 1 string, but after the administrative links. Here is the menu format:

first = First page
second = Second page
folder/third = Nested page
http://www.fourth.com = External resource link

(key is a URL of a page; if it is a link to a page of the site, you should not specify root slash and extension).

Meny shown for the authorized administrator only is edited in "Hidden admin menu" section and it will be inside the administrative menu before the "Logout" link.

You can also rewrite hidden settings, paths to the files and folders and few else structure details of the framework. It can be done in "Reload system preferences" section of the same page with ini syntax:


key1 = value1
key2 = value2

Here you can find all keys with default values available for changes:


Extensions of used files (not in URL):

fxt = .php


Data folder:

data = data


Records folder:

records = records


Comments folder:

comments = comments


Last discussions gathering is switched on:

discussions = 1


Last comments file:

lastcomments = lastcomm


Comments amount at the discussions page:

discussionscount = 20


Folder for language files:

langs = langs


Folder for documentation files:

docs = docs


Folder for pages:

pages = pages


Folder for plug-ins and program components:

codes = codes


Folder for Tiles and included files, web unaccessible:

parts = parts


URL part followed with parameters:

param = /get/


Part of a snippet file name:

tile = tile


Topic registry file:

topics = topics


Notes alternative URL registry file:

alterurls = alterurls


Sidebar file:

sidebar = sidebar


User database file:

users = users


Atribution file (accordances of authors with pages and notes):

attribution = attribution


Attachment storage folder:

storage = storage


'robots.txt' file name constant:

robots = robots.txt


Styles folder:

stylestorage = css


Main style file:

style = style.css


Javascripts folder:

jsstorage = js


Text file to load alternative editor:

changeeditor = changeeditor.php


Text editor:

editor = editor.js


Part of URL to access blog:

blog = blog


Part of URL to access pages:

page = page


Part of URL to access a note:

post = post


Part of URL to access search system:

search = search


Part of URL to access administrative page:

admin = admin


Part of URL to access topics:

topic = topic


Part of URL to access dates:

date = date


Part of URL to access authors:

author = author


Part of URL to access RSS:

rss = rss


Is the system multilingual (default isn't) and can be set through Cookies:

multilingual = 0


Part of URL to change language:

setlanguage = setlanguage


Part of URL to access file to download:

download = download


Downloadable files storage folder:

downloadstorage = files/downloads


Part of URL to access pages out of used template:

freeoftemplate = takenaked


Part of URL to access random page:

random = random


Part of URL to access page with letter for the author:

letterpage = letter


Part of URL to access page with letter sending result:

lettersent = letter


Part of URL to access registration page:

registration = registration


Part of URL to access registration result page:

registrationcomplete = registration


Interceptor file:

interceptor = interceptor


Part of URL to access logout page:

logout = logout


Part of URL when comments are separately loaded:

withcomments = -with-comments


Anchor to get comments:

sharpcomments = comments


User directory:

userfilesdir = files/users


404 error URL and filename:

pagenotfound = 404


You can change just a part of these properies. E.g. this

logout = exit
search = find
rss = feed

causes logout to be proceeded by http://your-site/exit/ link, and a search system is at http://your-site/find/ page, and RSS feed is available on http://your-site/feed/.


You can add aliases for every URL when changing structure in Pseudonyms field.


Tiles should be especially mentioned: those are short codes that should be changed with dynamically formed files (like Java Struts Tiles or PHP Frameworks Snippets). Tile constant is equal "tile" string by default. This means that if there is {&tile-1&} string in a template or in a page, then it should be changed to the dynamical output of the "data/parts/tile-1.php" file; {&tile-2&} should be changed to the dynamical output of the "data/parts/tile-2.php" file. You can use up to 100 marks and files and skip numbers. The output in Tile files should be contained in $tile variable.

The Tiles are very comfortable to use for varying contents. E.g., there is an additional menu under the header in a part of pages, and there is no menu in other pages; you should just write a logics of loading this varying part in a Tile to include it in one place.


5. Extended functionality

If you want to add a dynamical page to the website, you should create a PHP file with a standard extension (e.g. "new555.php") and put it to the folder associated with codes constant and called "codes" in default settings (inside the "data"). There should not exist direct output to a browser in the file; the output should be written into $data variable, and it can be read with framework; you can also use framework functions, constants and variables (see below). After that you can access to the page as http://your-site/new555/, because the framework will detect that the file exists in the "codes" folder. If there are files with the same name are situated both in "codes" and "pages" folders, then the "codes" file will be have more priority while loading, and the "page" file will be ignored.

Dynamical pages can receive parameters. To get that you can form a URL as "page" + "param constant value" + "sent string". Param constant is equal with "/get/" string by default. So if there is "/abc/get/5/" in URL after a server name, then the framework will try to find "abc.php" file in "data/codes" folder, and pass $param variable to it, while the value of this variable is "5" now. You can set new values to $metakw and $metadscr variables to change SEO keywords and desrciptions in plug-ins and at the dynamical pages.

A URL of the current page without the starting slash, the extension and all the parameters is stored in $live variable. Text databases, included modules and other files, which are required by the scripts and have not be accessed in a browser directly, are preferred to be stored in folder parts (default "data/parts").

You can plug interceptors in. These are functions that intercept code on different stages of page building. If you describe your own interceptor functions, those have to be saved in "data/parts/interceptor.php" file (if the path is not redefined). You can use up to 10 interceptors, connected with concrete fragments of the framework code. If these functions are not described, the core code works as usually. The names are:

interceptor1(string) — intercepts the text before its translation to the defined language;

interceptor2(string) — intercepts comments block;

interceptor3(string) — intercepts a note block;

interceptor4(string) — intercepts block of all notes;

interceptor5(string) — intercepts date navigation block;

interceptor6(string) — intercepts topic navigation block;

interceptor7(string) — intercepts formed menu;

interceptor8(string) — intercepts authorization form;

interceptor9(string) — intercepts $rq variable, where there is a query string that defines the type of loaded page;

interceptor10(string) — intercepts ready page.

Besides, you can define and describe other functions here in this file: it is included after the description of base functions and before the determining of templates. Finally, you can additionally include your own libraries in this file.


6. Languages

The language depends on chosen preferences. Language detecting is given to a translateAll(string, dictionary) function, where you can pass an array with translations of terms as the 2nd parameter (the main dictionary is plugged for translations as default). The 2nd parameter is equal to the system folder with language files by default, so it can be passed when you call the function. If the language detecting is used in your plug-in, you should create your own language files and put those in defined folder. You should call getDict(folder, language chosen) to plug your dictionary in. Files should look like this:

term1 = translation1
term2 = translation2

The terms in the default (English) language should be written as {;;term1;;}, {;;term2;;}. The output string should be concluded to the function of language detecting: $data = translateAll($data, dictionary).

The language can be set through Cookies as well: you should call a URL like /setlanguage/ru/ (where language is the system label in URLs, and ru is the language file name without any extensions). Cookie definition has more priority over the preferences defined language. You can reset language Cookies with URL like this: /setlanguage/default/.

The current language name is stored in the $lngs variable.

You can switch on the Cookie language switching with changing multilingual from 0 to 1 at "Edit structure" page (but this doesn't add new elements to the interface). If there are pages with the same name, and the 1st is located at the URL defined path, and the 2nd in the folder, which name is the same with plugged language, then the 2nd will be called and proceeded. E.g., if /page1/ is called, and the Russian languages is switched on, then /russian/page1/ will be requested and displayed; when searching and administrating, the output doesn't depend on the language selected. Language files contain 4 obligatory sections: with id key (language name in this language), date template, and date search template, and topic template (templates for creating headers on the topic and date search pages). The rest are facultative: if those are missed, there will be English terms on pages. So you can modify the main dictionary, redefining the section to differ from the default language (which doesn't require a special dictionary).

The selected language causes framework to select language file for the JavaScript editor in the forms and the language of the documentation. So the full localization of Shinobi to a new language includes:

1) dictionary file,

2) language file for JavaScript editor,

3) documentation file,

4) translations of all text pages,

5) if it is necessary, translations of terms at dynamical pages.


7. Comments

Users can comments both blog notes and pages in Shinobi. Comments are switched on for notes by default and off for pages by default. You can prohibit all comments in preferences; if there are comments in your website already, you don't lose those. For every note you can individually switch comments off when creating or editing note. For every text page you have to switch comments on when editing page. For every dynamical page comments can be switched on with a string in any place of its PHP code:

$usecomments = 1;

Everywhere you can pause comments displaying those comments that already exist. For this you need enter editing comments and tick off the checkbox there. Comments will be displayed, but the form for new comments will be hidden.

Comments may be premoderated with a point in the Preferences: updates will be gargered at the Discussions page, and notifications will be sent, but comments will be visible just with the administrative login. You can also allow tags in comments (list those comma divided in Preferences).

You can switch on the mode when comments are appeared at the special page but not at the page of a post or a page.


8. Multiuser mode

Shinibi blog is single-user by default. Authorization form in that case is a password field. If the multiuser mode is switched on in Preferences, then all users and even the administrator ought to type login in a special field of the changed form, not only password (administrative login is 'Administrator' by default, but it can be changed as well). There appears a link in the sidebar in multiuser mode in authorized state: this link leads to a pege, where the administrator can manage users (add, edit and delete). By default there are following privileges for new users:

new, discussions, docs, hidden, myfiles

It means that a new user can create new notes, read the list of the last discussions, documentation and hidden notes and pages. This is a full list if privilege marks (you can change default list in the Preferences):

secretblog — reading secret blog

closed — reading closed website

hidden — reading hidden notes and pages

edit — editing notes

editcomments — editing comments

myfiles — working with files in a personal folder

new — creating new notes

discussions — reading and cleaning last discussions

drafts — reading drafts

topics — editing topics

pages — creating, editing and removing pages

files — using file manager

prefs — editing preferences

sidebar — editing sidebar

css — editing CSS

structure — editing layout structure and system settings

dynamic — editing dynamic pages

users — managing users

backups — working with backups

docs — reading documentation

Privileges of every user are editable (except Administrator, because he/she has all privileges). There is no batch editing of privileges, but you can block all users at the same time by switching multiuser mode off (every user info will be kept). You can temporarily block every user except Administrator (when editing user); this will not cause removing of this user. Every user except Administrator can be removed forever as well.

User can edit and remove notes and pages he has created only, if he is not an administrator.

You can switch external registration on, if a small project with eventual users is planned. Every new registratnt will get the set of privileges added in the Preferences. Every new registrant appears in user list and can be viewed and edited through administrative pages. If the external registration is switchen on, the authorization form is followed by a link to the registration page. By default a URL of the registration page and a URL of a registration result page are the same, but this can be redefined (the same for letter page), like all the system paths.


9. Different

To cause file to be downloaded instead of opened you should put it to "/files/downloads" folder and access it as /download/filename.

If you create your own "404.php" error page, it will be loaded instead of system error message.

CSS file address in templates is generated with a suffix, that is based on the last modification date, so you have not to care about caching styles.

You can type /random/ to get a random page from existing ones in "data/pages" and "data/codes".

You can type /takenaked/your_page_URL to get page (or note, or plug-in) off the main template (comfortable for AJAX). All these paths are editable.

Shinobi version number is saved in code and formed as four-digit number, e.g. 1.2.5.8, where:

1 — release number,

2 — new functional possibilities,

5 — addings to the existing possibilities,

8 — corrections and bug fixes.

Every updated left number makes all right digits to be zero; for example, you can get 3.0.0.0 after 2.8.0.5.


10. Functions library


trimslasher($s)

removes left and right slashes from $s string


cleaner($s)

removes divider marks from $s string when saving


protectFromUsers($s)

leaves useful tags in $s string and fights against javascript-injections


filereader($f, $mode)

returns contents of $f file as a string, if it exists; else returns empty string ($mode can be b for working with binary files)


paragrapher($s)

splits $s string to paragraphs, processing tables and codes correctly


advanced_reader($s)

if there are paragraph or line breaks in $s string, returns the string as is, else proceeds it with paragrapher() function


advanced_filereader($f)

returns $f file contents as a string, proceeded with advanced_reader() function


filewriter($f, $what, $how='smile', $mode)

writes $what string before existing content (if the 3rd parameter is 'before'), after it (if it is 'after') or instead (in any other case or without the 3rd parameter) into $f file; if file does not exist, it is created; if the path to the filedoes not exist, then all necessary folders are created; this function returns the final contents of the $f file ($mode can be b for working with binary files)


equalizer($s)

creates an associative array like array('key1'=>'value1') of $s string (one or more lines) with ini syntax (key = value in each line); used for registries and menu


xmler($string_name,$tag_name)

returns the content of $tag_name tag in $string_name string (tag name should be specified without angle brackets); if you have to use nesting, then build a path to the tag with slashes, e.g. xmler($string_name,'blockquote/test') returns the content of <test> tag inside the <blockquote> tag; this acts with all tags without attributes


dateBasedCached($filename)

returns $filename file name followed with a suffix based on the file last modification date (useful for style and javascript files to avoid incorrect browser caching)


scanfs($dirname)

returns paths of all files in $dirname folder (including nested folders)


validname($filename)

causes $filename file name to be correct


fileUpload($info,$where,$validate=1,$modify=0)

uploads file, which is transferred into $info files array from $_FILES, into $where folder; it corrects file name if $validate is 1; if the file with such the name exists and if $modify is 1, it modifies its file name; this functions returns the changed final file name


f_env($s)

creates an DIV envelope for $s element


f_success($text='{;;Changes saved;;}')

returns success message with text specified in $text


f1($id='form1',$where)

creates initiating tag of form with identificator and name formed of $id, with action parameter filled with $where; with method and enctype specified; you should metion that $where must be filled with the result of the setURL() function


form1($s)

shortened variant of the f1() function; it receives $s string only to form identificator and name; action value is equal with the current page URL


f2($word = '{;;Save;;}')

adds finalizing tag to the form and submit button with $word text


f_required($s)

marks $s element as required (adds an asterisk with SPAN and required CSS class before closing <label> tag)


f_text($name,$label='',$string='',$disable=0)

form element: text field with $name name, $label text before the field, $string value, inactive if $disable is 1


f_password($name,$label='',$string='')

form element: password field with $name name, $label text before the field, $string value


f_hidden($name,$string='')

form element: hidden field with $name name, and $string value


f_file($name,$label='')

form element: file upload field with $name name, and $label text before the field


f_textarea($name,$label='',$string='',$editor=0)

form element: multiline text field with $name name, $label text before the field, $string value, with JavaSript text editor if $editor is 1


f_check($name,$label='',$checked=0)

form element: chechbox field with $name name, $label text after the field, unticked by default


f_checkbox($name,$label='',$checked=0)

pseudonym for f_check() function


f_select($name,$label='',$equalizee,$selected_value='',$size=1,$multiselect=0)

form element: dropping list with $name name, and $label text, which takes $equalizee array to form values and texts, by default without value selected, and one-line, and without multiselect


f_radio($name,$equalizee,$selected_value='')

form element: radio switcher with $name name, which takes $equalizee array to form values and texts, by default without value selected


captcha($suffix='')

form element: text field for user answer: s/he has to specify answer for a mathematical task; you can specify $suffix to improve protection from spam bots


You should mention that if <label> is used, it is related automatically to the field identificator, i.e. all necessary attributes and additional element are created automatically. Besides, input has CSS class that is equal with its type, i.e. "text", "checkbox", "password" etc.


If the form leads to the same page where it is, and it is used just once at the page, than destination page contains fields that are filled automatically with values transferred, if these values are not empty. It is comfortable, if user filled a part of fields and the form is to be repeated once more: specified values are not lost.


captcha_check($suffix='')

function to check if captcha() is filled correctly; returns 1 in case of correct answer, or -1 in case of empty value, or -2 in case of incorrect answer, and 0 in all undefined cases; $suffix has to be equal with $suffix of captcha()


defineURL($s)

returns blog note URL, based on $s real URL: alternative URL (if this exists in alternative URLs registry) or else real one


setURL($s)

returns page URL, based on $s string; this functions specifies root folder and page extension


getUsers()

returns two-dimensional array with user data; the 1st level keys are identificational numbers, the 2nd level ones are name, grants etc, i.e. details about selected users


getGrants($perm)

returns 1 (allowed) or 0 (prohibited) depending on conditions: if a user is not authorized, then it is always 0; if the user is administrator, then it is always 1; if the user is not administrator and is authorized, then 1 (if $perm is in his privileges list) or else 0


getDict($folder=langs, $selLang='')

returns dictionary array to localizate page; it is read from files in $folder folder with $selLang selected language


getLangTerm($term, $wordlist='')

translates $term term from {;;term;;} to the language based on $wordlist language


translateAll($s, $wordlist='')

translates all terms of $s string from {;;terms;;} to the language based on $wordlist language


saveRobots()

saves or rewrites "robots.txt" file with new preferences


createMenu($equal, $selected='', $splitter='', $envelope='', $pref='', $path='')

creates menu from $equal array with selected point decorated with $selected tag name; if $splitter is specified, it is used as a splitter between points; if $envelope is is specified, it is used as an envelope for each element of menu, and $pref is a prefix for identificators of envelope elements; current page is not a link and contained in $selected tag; if the current page is nested for one of the menu points, this point of menu is a link with holder CSS class. If $path is not empty, every link follows the equal path to a page. If there specified multilingual = 1 in "reset.php" (0 by default), you can add a menu to switch languages: there must be setlanguage constant value in link string, e.g. setlanguage/ru, setlanguage/default or setlanguage/no — in these cases the menu point will be active, which has set the language and is written into the Cookies


authForm()

returns authorization form


searchForm()

returns search form


In addition, here are important variables to reuse:


$rq

current page URL (includes $param and $live, if the page is dynamical); blog notes URLs are real


$saverq

current page URL (includes $param and $live, if the page is dynamical); blog notes URLs are pseudonyms


$param

parameter for dynamical pages


$live

page address without any parameters for dynamical pages


$lngs

current language


$dictionary

main dictionary


$metakw

SEO keywords for current page


$metadscr

SEO description for current page


$protectedMode

mode: 1 is protected, 0 is unprotected


$resetEnabled

checks if layout elements and constants are rewritten: 1 if "reset.php" exists, else 0


$resetPrefsList

array of rewritten constants


$resetHTML

rewritten layout template


$resetPostML

rewritten blog note template


$userMenu

ini list of links for user menu


$admin

checks if user is authorized: OK if he is, else empty string


$allowblog

blog is allowed (1) or prohibited (0) to view for all; it is allowed for the administrator always


$allowsite

website is allowed (1) or prohibited (0) to view for all; it is allowed for the administrator always


Constants based on main ones:


siteroot

website root folder


recDir

full path to the folder with blog notes


commentDir

full path to the folder with comments


pagesDir

full path to the folder with static pages


codesDir

full path to the folder with dynamic pages


partsDir

full path to the folder with plug-ins, menu, Tiles and other files unavailable through the web


topicsFile

full path to the file with topics


sidebarFile

full path to the file with sidebar


CSS classes used in the system:


.important

important inscriptions, mainly for the administrator


.message

message about an executed task


.error

error while proceeding a task


.success

message about an successfully executed task


.form-elem

envelope of a form element


.required

mark about field required to fill


.holder

class of a link to a page nesting other pages, if one of those is active