МЕТЕОКЛУБ : независимое сообщество любителей метеорологии (Европа и Азия) : ФОРУМ О ПОГОДЕ И ПРИРОДЕ - FAQ

Полезные ссылки:
Метеоцентр.Азия - наш сайт с высокодетализированными прогнозами погоды по пунктам Pоссии и мира
Облегчённая версия Метеоклуба (для смартфонов)

МЕТЕОКЛУБ : независимое сообщество любителей метеорологии (Европа и Азия) : ФОРУМ О ПОГОДЕ И ПРИРОДЕ - FAQ

Сейчас в Метеоклубе:
Участников - 0
Максимальное одновременное количество посетителей: 308 [2 Ноя 2013 22:42]
Гостей - 296 / Участников - 12

 - Начало - Статистика - Pегистрация - Поиск -

miniBB / Complete User and Administration Guide

September 17, 2005.
Copyright (c) 2001-2005 miniBB.net
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

  1. Introduction
    1. Requirements
    2. Copyright
  2. Installation
    1. File list
    2. Config: 1st step
    3. Creating forums
  3. Customization
    1. Config: 2nd step
    2. Templates
    3. Language packs
    4. Skins: CSS file
  4. Administrative options
    1. Admin panel
    2. "Hidden" admin forums options
    3. Moderators
  5. Forums-wide user options
    1. Users hierarchy
    2. User's registration
    3. User's login
    4. User's language
    5. New topics and replies
    6. Locking topics
    7. Editing messages
    8. Editing preferences
    9. Changing user password
    10. Forgotten password
    11. Forums search panel
    12. Statistics
  6. Some notes for developers
    1. Language packs
    2. Database modules
    3. Including in your own PHP script
    4. mod_rewrite (Apache) using
    5. PHP scripts
  7. Upgrading miniBB
  8. GNU Free Documentation License

Introduction

miniBB (an abbreviation of "minimalist bulletin board") is a flat-type (not threaded) bulletin board, discussion forums software, written in PHP and using mySQL or another PHP-compatible database as data backend. "Mini" doesn't mean "nothing". Specially developed for small and medium forum communities, which have less than 100 unique posts per day, miniBB also could be used in large projects. If you take a look at miniBB settings file, or this manual, you'll find a lot of options, both for users and administrator, which allow full and in-time control over the board.

This guide refers to almost all miniBB features and possibilities. It is created both for user and administrator, and is included in miniBB package as "default" FAQ. You can use this manual as basic user FAQ for your page under GNU Free Documentation License described below. If you are using this guide as FAQ in your forums, remove all administration and developers guide, described in "Installation", "Customization", "Administrative options" and "Some notes for developers" sections. Usual users should read about this possibilities.

Some options described in this manual requires basic HTML and PHP knowledge. If you are on beginner-user level, study it very carefully. Remember: nobody is able to let you understand, but somebody could give you chance in it.

Requirements

There are no special requirements about server type, OS, PHP or mySQL version. Every system that supports PHP/mySQL combination, should also support miniBB. We've got reports that miniBB was successfully up & running on Unix, Linux, Windows, Novell, MacOSX servers, with Apache or IIS installed. As about PHP or database version, we recommend to use ONLY FINAL and STABLE versions of these products.

Before installing miniBB, be sure you have PHP installed on your server, and you have mySQL host, login and password information which you'll need to put into configuration file.

Copyright

miniBB is a GPL project (read more on Free Software Foundation about GPL License), and you can copy/distribute/modify all scripts under terms of GPL. You may edit every file you get (incl. templates, CSS, language pack, plugins, addons, scripts), of course, replace our logo, maybe edit the menu on the top, also as put your own keywords and description in main heading file, but YOU MAY NOT remove our original copyright link string from the template "main_footer.html" (even you may edit it's look or location) and offer miniBB as "your" product or part of website, if you are using free GPL License, according to the sections 1 and 2c of this License. For removing the link and/or any copyright information, you need to buy miniBB commercial license. Read more about technical support on our site.

If you want to integrate miniBB into your own software, there are two ways of doing that: a) distributing your software for free with corresponding license, you should mention miniBB's authors copyright UNTOUCHED inside every script, and you can do that without any persmission from us, since GPL license covers that; b) distributing your software commercially, you should either to keep all miniBB copyright notices as in free software case, but if you want to remove all references to us, we need to sign special commercial agreement, which is discussed individually.

Visiting and keeping our sponsored link (eCoupons.com), you are helping miniBB project be on top of secure and reliable bulletin board software.

Installation

File list

For correct working, miniBB needs to have the following file & folders structure:

[IMG]
[LANG]
[TEMPLATES]
bb_admin.php
bb_codes.php
bb_cookie.php
bb_default_style.css
bb_func_checkusr.php
bb_func_confpwd.php
bb_func_delmsg.php
bb_func_deltopic.php
bb_func_editmsg.php
bb_func_editprf.php
bb_func_forums.php
bb_func_inslng.php
bb_func_ldisc.php
bb_func_locktop.php
bb_func_login.php
bb_func_man.php
bb_func_movetpc.php
bb_func_pthread.php
bb_func_ptopic.php
bb_func_regusr.php
bb_func_search.php
bb_func_sendpwd.php
bb_func_stats.php
bb_func_sticky.php
bb_func_txt.php
bb_func_unsub.php
bb_func_usernfo.php
bb_func_usrdat.php
bb_func_vforum.php
bb_func_viewip.php
bb_func_vthread.php
bb_func_vtopic.php
bb_functions.php
bb_plugins.php
bb_plugins2.php
bb_specials.php
COPYING
index.php
setup_mysql.php (or whatever your module is)
setup_options.php

Optionally, there can be also install files and modules for different databases.

[IMG], [LANG], and [TEMPLATES] are system directories. It is forbidden to rename them. They mean:

  • [IMG]: board's images are placed in this directory, incl. "hot-buttons" and "topic icons". Inside this, you'll find a directory called "forum_icons". You can place any forum icons there. Don't rename this directory!
  • [LANG]: a directory for keeping language packs.
  • [TEMPLATES]: a directory for HTML templates.

Read more about this below.

Other files means following:

  • bb_admin.php: your administration panel file. You need to rename it from default (see "options" below)!
  • bb_codes.php: two functions inside provides BB codes replacement independently for each miniBB update. Don't edit this file if you are unfamiliar with PHP and/or regular expressions. If you are, you can edit this and add your new BB-codes (f.e., specially for administrator). enCodeBB() function used in posting messages, deCodeBB() - in editing messages (converts actual HTML back to BB-codes).
  • bb_default_style.css - default CSS skin for your board (the same as on our forums), where you can change colors, table borders, fonts etc.; W3C-compliant.
  • bb_functions.php: don't touch this one, if you are unfamiliar with PHP. This is basic functions file for the whole engine.
  • bb_func_*.php files: don't touch them, if you are unfamiliar with PHP. They are modular functions files for the whole engine. Separate action functions are included in it.
  • bb_plugins.php: file with all necessary plugins includings BEFORE any action. By default, it is empty. This file is included in index.php once, and when you update your BB to new version, it is not necessary to edit index.php every time.
  • bb_plugins2.php: file with all necessary plugins includings AFTER any action.
  • bb_specials.php: file includes special forums definitions, like private, archive forums, user special rankings (see below for more).
  • index.php: the main calling file for miniBB. Usually, your sever should support it as "begin" file for any directory. If not, check your server/PHP options. Every action on the board is called from this file.
  • setup_mysql.php: default database (mySQL) module. Every mySQL request on the board included in it. You can also have another module (setup_mssql.php or setup_postgresql.php, for example).
  • setup_options.php: miniBB options file, incl. administrator data. You need definitely change it's content, but also don't rename it.
  • COPYING: GPL license. Please, read it before using miniBB!

Config: 1st step

Begin installation of miniBB is very simple. You need to create some database on your SQL server (f.e., "miniBB") with this command:

create database miniBB;

If you are unable to create a database, ask your server provider to do it for you; also ask him to provide you all database details - login, password, database and host. This data is required to know for running miniBB install and general scripts.

Unpack your minibb zip package somewhere on your disk. Be sure you are unpacked all files keeping original folders structure, so they are not located in one folder on your disk. Be sure you have [IMG], [LANG], [TEMPLATES] folders extracted.

Find the file called "setup_options.php". This is your main setup file. All engine is based on it.

Open options file with some plain text editor on your computer. Edit your php files with a quality text editor! We recommend Metapad, or regular Notepad, because these editors are not storing additional newlines, spaces or breaks before <?php and/or after ?>. It is forbidden, to have such kind of characters outside PHP execution code, because this may cause problems with your board (for example, you will be unable to log in, and kind of this error appears: Cannot modify header information - headers already sent by (output started at...) You will find a bunch of option variables, but it is not necessary to edit all of them in this 1st step. We will edit only necessary, and explain the others later. Let's begin.

  • $DB = 'mysql'; Depending on your database module, could be 'mysql', 'postgresql' or 'mssql'.
  • $DBhost='localhost'; Host name for your SQL setup. Most likely 'localhost'.
  • $DBname='miniBB'; Your SQL database name that you have just created.
  • $DBusr='USERNAME'; Your SQL username.
  • $DBpwd='PASSWORD'; Your SQL password.
  • $Tf='minibb_forums'; $Tp='minibb_posts'; $Tt='minibb_topics'; $Tu='minibb_users'; $Ts='minibb_send_mails'; $Tb='minibb_banned'; Database's table names - for preventing outside hacker attacks, you MUST rename these tables to something else, not like in default miniBB installation. On another hand, these names should not conflict with existing tables, if you have any.
  • $admin_usr = 'ADMIN_USR'; Administrator login, is inserted in database also as first engine username. You can change it anytime and update your settings from admin panel (see below). On symbols, there is only one limitation setting admin name: it can not contain "|" sign. This sign is used in board's engine, if you use it, you won't be able to login as admin.
  • $admin_pwd = 'ADMIN_PWD'; Admin password.
  • $admin_email = 'admin@email'; Admin email (also used as "from" email for all emailings on the forum). Must be correct email. In preferences, you can choose to not show it public (see below), but here you MUST enter it correctly.
  • $bb_admin = 'bb_admin.php?'; Admin panel FILENAME - we strongly recommend you to rename default bb_admin.php (administrative file) in a root directory to something else, for security reasons. Parameter must contain question mark at the end.
  • $main_url='http://www_yourdomain_url/forums'; Full URL (beginning with "http://") to the message board; WITHOUT slash at the end); used in email notifications and other scripting stuff, like redirect from one page to another. Must be set correctly in order the board works fine.

Set very carefully mysql user name, password, host and database. According to user privileges, it must be SUPER-USER, which can also create tables (if you will create them from the web via install from browser). Many users don't know much about these values, and getting errors like Database/configuration error. or Database/configuration error (DB is missing). are filling our support tasks with the same questions. miniBB don't use anything specific for connection to database - only regular PHP/mySQL functions. If you are getting errors, you have specified wrong settings, that's all we can say.

Next step - you need to create structure of your database. Transfer all files via FTP or local network to some place on your server. Use quality FTP manager to do that! We recommend Total Commander; however, the main purpose is that you should store all files as their are originally, not broken or binary-converted.

Install

In the main directory, You will find _install.php file and, for mySQL for example, _install_mysql.sql file. "Sql" file is actually your dump. If you have capabilities to make database from SQL-shell, you can run it and insert all tables manually - but we do not recommend it, this is only for real professionals who are knowing what they do.

Run from your browser the _install.php file, it will create all tables according to their names in setup_options.php and insert all necessary values. Usually, it takes 1-2 seconds.

First screen will welcome you to enter setup. Click on "continue". If everything you typed in options file is correct, script will make all necessary tables described in .sql file. If not, pay attention to your config.

After "OK", you can start building your community! Easy, isn't it? But first, DELETE the _install.php file, also as ALL .sql files from directory. We don't need them anymore.

Creating forums

miniBB engine is using cookies for registered users and admin log in. PHP sessions could be used optionally, but we don't recommend it because of weak search engine mechanisms on sessions. Please refer to "logging" section for more info. So, turn on cookies in your browser for that stuff.

Do a login to your admin page. Usually is "bb_admin.php", but since your are renamed this file (did you?..), only you know what is admin panel URL. So, go to that panel, and probably you will be prompted for your admin login and password. Enter them, and you must go into admin panel. If the trouble appears and you're not able to login, double check your cookie path, domain and name, probably change them and, on IIS servers, try to uncomment "$metaLocation" option (see below).

There you will see a bunch of options for your miniBB forums. We will describe them later, but now we need to create some forums. So, click on "Add forum" link and... follow instructions on the screen! We guess, it will be very easy to create some forums. Refer to "Supertitles" secton - supertitles are actually replacement for subcategories.

Also, we don't recommend to give forums "large names". Be as laconic as possible. First, it is more rememberable, second, large names do not fit in topics or threads listing pages.

When you enter miniBB as administrator, you are also logged in as simple user. You can make posts under your name, edit other posts, make deletions etc. We'll talk about it later. Only one: by default, you should also see "admin panel" link beneath every page. And you can automatically reach your panel following this link.

Customization

Config: 2nd step

At this moment, your miniBB should be running already! Go to index.php and check this. But, there is a lot of other options that probably you want to change. Let's refer to setup_options.php again. Note for PHP newbies: //$a='b'; string actually means nothing, and this setting will not work in any case, because this statement is COMMENTED (two slashes before). Removing slashes means UNCOMMENT or ENABLE this setting. For changing setting, change its content between apostrophes (''). Numerical settings may also not contain apostrophes.

  • $lang='eng'; Language used in miniBB interface. Just check how your language file in directory "lang" is called (example: eng.php is 'eng', rus.php is 'rus'). By default, only english language file is included. For more language packs, refer to our site.
  • $skin='default'; The name of the CSS-skin (in this case, "bb_default_style.css"). Exambles for using skin: 'default', 'light' or 'classic'. For more skins, refer to our site. In many cases, you need to leave the title and edit default skin itself.
  • $sitename='Community supported by miniBB forum software script'; Forum's title. Appears on all pages + in email subjects and bodies.
  • $emailadmin=1; Email admin if new topics or replies are posted, also if new user is registered. 0 for no 1 for yes. Replies/topics emails are sent if admin is not the message poster.
  • $emailusers=1; If 1, users can subscribe to email notification on all topics and posts they make (even if they are not authors of these topics or posts). Recommended only for small and medium forums. If your forums have a lot of visitors and posters, we recommend to turn this to 0. This setting doesn't affect forgotten password sendings and registration password sendings (see below). Beginning from the version RC3a, it is possible to define, if users may receive notifications on their chosen language (set $emailusers=2;). In this case, you should create email notification files with language 3 letters postfix, for example: email_reply_notify_rus.txt, email_user_register_rus.txt, email_user_password_rus.txt for Russian language (if you defined $lang='rus';). If these files do not exist, default language pack file (email_reply_notify_eng.txt, email_user_register_eng.txt or email_user_password_eng.txt) will be taken. For admin and system notifications, default language pack is taken with ('_eng' postfix).
  • $userRegName = '_A-Za-z0-9 '; Via registration, users can use only these symbols in their login name. You can add "international" letters (f.e., specific russian symbols under special encoding table). String is based on REGEXP match, so if you are not sure, don't touch it. Also DON'T ADD "|" sign please, and other specific symbols too (especially like <>, apostrophe ' and quotes ").
  • $l_sepr is a symbol to separate some values like menu items. For example, set it to '·' and you'll get small middle dot.
  • $post_text_maxlength='10240'; Max characters and spaces allowed in 1 message. Don't set to 0 - then your visitors will not be able to post anything.
  • $post_word_maxlength=70; Max amount of chars, allowed in 1 word. Used for disabling "long URLs destroys your design" thing.
  • $topic_max_length=70; Max amount of chars, allowed in topic title.
  • $viewmaxtopic=30; How many topics to show on one page.
  • $viewlastdiscussions=30; How many last discussions to show on 1st page, 0 disables last discussions (see below what means "last discussions").
  • $viewmaxreplys=30; How many replies to show on one page.
  • $viewmaxsearch=40; Max search results per page.
  • $viewpagelim=50; Max pages you can view in either search, posts or topics list.
  • $viewTopicsIfOnlyOneForum=0; If you have only one forum, topics inside can be automatically displayed on 1st page. 1 for yes, 0 for no.
  • $protectWholeForum = 0; Should we protect all forums by one password? If value is 1, two values below are defined as well. Else set to 0.
  • $protectWholeForumPwd = 'SOME_PWD'; Password for protecting the whole forum.
  • $postRange = 60; Antispam: time range in secs. User can not post a message less than after this time. Attention: zero (0) disables antispam!
  • $dateFormat = 'j F Y H:i:s'; Date format for displaying in forums. The same syntax as in PHP itself. Textual English month titles defined by 'F' are replaced to months definitions taken from language file.
  • $cookiedomain = ''; Cookie domain. Most likely you need to leave this blank, however, if you have problems logging into the forum, set this to your domain name, without the http://. F.e., if your forum is at http://www.mysite.com/miniBB then set this value to "www.mysite.com".
  • $cookiename = 'miniBBsite'; Cookie name.
  • $cookiepath = ''; Cookie setting. Usually you don't need to change this.
  • $cookiesecure = FALSE; Cookie setting. Usually you don't need to change this.
  • $cookie_expires = 3600; This is the number of seconds that a session lasts for, 3600 = 1 hour, 2592000 = 30 days. The session will exprire if the user doesn't view a page on the forum within this amount of time. If you are experiencing problems with international users, set this to 25 hours.
  • $cookie_renew = 1800; This is the time after which session is sent again; for example, user was logged once, then logs again (password is not asked), works and this amount of time is reached. Usually it is not necessary to change this.
  • $disallowNames=array('anonymous', 'ass', 'etc.'); This feature prevents users from registering forbidden names. In apostrophes, define unwelcomed user registration names. If you are using more than 1 language pack, define here all strings under name $l_anonymous in language pack, else visitor will be able to register under 'Anonymous' name, for example. Case doesn't matter when you define a word. You could also define a word fragment here, so users will not be able to register login name which contains this fragment.
  • $disallowNamesIndex=array('admin'); Combined together with $disallowNames, allows to set list of prohibited usernames which cannot be used via user's registration. The difference is that script checks for a word fragment defined in $disallowNames and exact match with words defined in $disallowNamesIndex. For example, having "admin" in $disallowNames you prohibit users register even the names like "badminton". So, put fragments in the first array and exact matches in the second.
  • $sortingTopics=0; If 1, topics are sorted by new topics even for anonymous users; else they are sorted by new answers.
  • $topStats=4; Must be either 1, 2, 3 or 4 - correspondly for statistics' Top5, Top10, Top20 and Top40.
  • $genEmailDisable=0; 1 totally disables system email sendings: forgotten password sending and registration password sending, if you enabled $closeRegister (see below). Useful for those who has no sendmail or another program installed on the server.
  • $defDays=365; Default term value which defines statistics for that days period (for example, if you want to show statistics within 1 month as a default value, set it to 30).
  • $userUnlock=0; If it is set to 0, registered user can not unlock his topic again after it was locked (by admin or himself), and vice versa. If set to 2, users are not able to lock their topics in general (avail. from ver. 2.0 RC3).
  • $emailadmposts=0; It means that admin receives emails only about new user registration. If $emailadmposts is set to 1, admin also will receive notification about every new post. If it is not set, or is equal to 0, admin will not receive those emails, but will be able to subscribe to topics manually.
  • $useredit=86400; Parameter defines number of seconds, after which user WILL NOT BE ABLE to edit his message. By default is 1 day (86400 sec.) If 0 or not set, user will be able to edit his post everytime.
  • //$metaLocation='go'; This option should solve login/logout problem which has been experienced by some users on IIS servers and other exotic servers. These servers can not send 2 headers (cookie and location) one after another. Having go.html file (or any other file, cause filename can be set here) in the templates forums directory with meta header in it, you first will visit that file, and then you'll be relocated from it to another place. You can edit go.html if your wish; for now, its structure is very simple and it redirects within 0 seconds, so probably you won't ever actually see it. This option is not turned on by default.
  • //$closeRegister=1; It is possible to avoid "open" registrations, when user registers, he enters desired login/password and from the first step becomes a registered user. Avoid incorrect email address upon registration: if you set this to 1 (default is still 0 or unset), on the registration form user will not see the password field, and will receive it via email (password will be generated automatically). In the user_dataform.html you should have <!--PASSWORD--><!--/PASSWORD--> tags. Upon registration, the content within them will be removed. When user changes data, they will be shown. Having this option set, you SHOULD set $genEmailDisable parameter equal to 0. And of course you should have sendmail working ok. If you set this option to 1, don't forget to edit registration message $l_goToLogin in language pack, when you should inform the user that he will get his password on email. Alternatively, in your forums manual mention that registered users should enter their correct email address, because password will be sent here.
  • //$timeDiff=21600; Allows you to set time difference between you and server, so all dates are displayed in your time zone. This could be a rare thing and necessary only if you, for example, have server in US and are visiting it from Norway. You need to set up $timeDiff in seconds. Positive 21600 sets up +6 hours of time difference. Note that miniBB is still saving server time into SQL database. This option will only re-calculate the server times in your format. Setting this, of course, will slow down the execution of scripts.
  • //$stats_barWidthLim='31'; this setting affects statistics bar length. In most cases, you do not change this.
  • $dbUserSheme=array(
    'username'=>array(1,'username','login'),
    'user_password'=>array(3,'user_password','passwd'),
    'user_email'=>array(4,'user_email','email'),
    'user_icq'=>array(5,'user_icq','icq'),
    'user_website'=>array(6,'user_website','website'),
    'user_occ'=>array(7,'user_occ','occupation'),
    'user_from'=>array(8,'user_from','from'),
    'user_interest'=>array(9,'user_interest','interest'),
    'user_viewemail'=>array(10,'user_viewemail','user_viewemail'),
    'user_sorttopics'=>array(11,'user_sorttopics','user_sorttopics'),
    'language'=>array(14,'language','language'),
    'num_topics'=>array(16,'num_topics',''),
    'num_posts'=>array(17,'num_posts',''),
    'user_custom1'=>array(18,'user_custom1','user_custom1'),
    'user_custom2'=>array(19,'user_custom2','user_custom2'),
    'user_custom3'=>array(20,'user_custom3','user_custom3')
    );

    This database scheme array describes relations between field names in user_data_form.html (registration, profile) correspondingly to database, and database indexes used in userinfo viewing. So, you can use your own database table for usernames (for example, as another part of your site) and only define relations here. Relation format: [MINIBB DEF] => array([NUMERICAL_INDEX_KEY],[TABLE_FIELD_NAME],[FORM_FIELD_NAME]); Pay attention that the structure of fields, their types must be default as in miniBB database, for example, user_password must be saved in md5 format. Edit this option ONLY if you are NOT NEWBIE!

    How the registration/profile script works: it goes through every [MINIBB DEFINITION], and correspondly parses a $_POST[FORM_FIELD_NAME]. When viewing profile, [INDEX] is taken into consideration. Fields like "user_regdate" or "activity" are not defined by user, so, it is not necessary (and even forbidden) to define them here.

    Second password field must be named 'passwd2'.

    All values in a form must be named as their fields. Example: field "login" will be valued as "{$login}".

    For viewing new or custom fields on User Info page, you need to set corresponding $l_usrInfo variable. Keys of this array are the same as keys for table fields (for example, if key for user_icq is 5, ICQ language definition is $l_usrInfo[5]). user_custom1, user_custom2, user_custom3 database fields can be displayed on the user info page as well you will need to add corresponding values for these to the language pack though: $l_usrInfo[12], $l_usrInfo[13] and $l_usrInfo[14] ,- accordingly. You may also add additional custom fields, naming them so they contain 'user_custom' in the system key definition. In that case, set corresponding $l_usrInfo so it begins from 15. For example, if you have 'user_custom1', 'user_custom2', 'user_custom_name', 'user_custom_surname' listed in order one by one, $l_usrInfo keys are 12, 13, 14, 15.

    If you have enabled email notifications about new user registrations and/or send registration information to user's email, you MUST also fix variables defining user data, in the templates: templates: email_admin_userregister.txt, email_user_register.txt. Variables must correspond to your registration form fields (for example, if you have form field named "email", variable will be {$email}). With default miniBB database structure, no need to change these templates.

  • $dbUserId='user_id'; $dbUserDate='user_regdate'; $dbUserDateKey=2; $dbUserAct='actusr'; $dbUserNp='usr_newpasswd'; $dbUserNk='usr_newpwdkey'; Field names that are updated AUTOMATICALLY. DO NOT include them in db scheme list.
  • $enableNewRegistrations=TRUE; If you want to enable new users register themselves; FALSE in another case.
  • $enableProfileUpdate=TRUE; If you want user would able to update their profiles themselves; FALSE in another case.
  • $indexphp='index.php?'; The name of your index file; you can rename it to something else if miniBB's index is conflicting with existing site's index name. Don't forget to put "?" after filename.
  • $useSessions=FALSE; If you want to use sessions for user logging procedures, set to TRUE. We don't recommend to send this for public sites, and probably only for intranet users, who have problems with cookies. For search engines, it is BAD, if they 'see' some big session ID in URL, so you forums will not be indexed well. If you enable to use sessions, and user has cookies turned off for rare case, session ID will be handled via URL. Sessions will not work if $mod_rewrite option (see below) is set to TRUE.
  • $usersEditTopicTitle=TRUE; If you want topic authors may edit their topic's title; else FALSE.
  • $pathToFiles='./'; Full file system path to your miniBB files (could be, /usr/home/public_html/forum/ for example, on Linux). Must have SLASH at the end. You may use one copy of general miniBB core, but having just different index and options file, create many communities based on this core. This option also could solve some file including problems on systems like Novell. You can set the full path to the scripts, or leave default if the board is working normally. This option also is necessary if you include your own php header and footer (see below).
  • //$includeHeader='header.php'; Uncomment and set alternate header, if you don't want to use miniBB's default main_header.html (useful if you use some header.php from your own site, for better integration).
  • //$includeFooter='footer.php'; The same as above, for footer. Don't forget that our copyright link must migrate from our footer to yours in this case.
  • //$emptySubscribe=TRUE; Uncomment and set to TRUE if you want your users may subscribe to the topic without posting some text.
  • //$allForumsReg=TRUE; If you want to make all forums for registered only users by one touch; else FALSE.
  • //$registerInactiveUsers=TRUE; If you want all registered users become inactive until you accept them. Used for manual user activity acceptions. If activity field's value in database is "1", user is able to make new topics, posts and another operations on forum. If "0", user is able only to login, but not use anything. It means his account is in database, but has been blocked for a while. With this, miniBB turns into a powerful anti-flood message board: you can make all your forums for registered users only with one option; you can use only "live" emails, sending registration passwords there, you can set an option to view all new registrations on your email, and even if flooder has been registered, entering his Profile, you as admin or moderator can disable his activity (if you are logged as admin, at the end of member's profile, you will see a cell "Member" and "Yes/No" in it. Clicking on Yes, you enable member status, and vice versa). In combination with sending all new user registration on admin's email, you always will know who was registered on your forums.

    If user is registered and not accepted, he will always see a message "You don`t have access to this forum." or something else defined in language's $l_privateForum. Correct this variable according to your needs OR just mention in your forum rules, that user is inactive until accepted.

  • $enableViews=TRUE; By default, miniBB counts topic views, but does it only by simple way, when user opens some topic from the first page. Actually, topic views is not really necessary column, but could be useful for small communities. When counting views, SQL-server makes an UPDATE request; on large databases, it could cause speed problems. So there is also possibility to comment or set this option to FALSE so this kind requests will not happen.
  • //$mod_rewrite=TRUE; Set only if you are using Apache server and would to use "virtual addresses" via it in miniBB. Read for more below. Not for newbies!
  • //$userInfoInPosts=array($dbUserSheme['user_from'][1], $dbUserSheme['user_website'][1]); Available from version 2.0 RC2b, this option defines list of user's table fields, which values may be displayed in every post user makes. You can put exact field values here (not based on $dbUserSheme), for example:
    $userInfoInPosts=array('user_from', 'user_website');
    
    but be sure these fields are appearing in user's table itself. After setting this, in main_posts_cell.html template you can set, for example, {$userInfo_user_from[$poster_id]} and {$userInfo_user_website[$poster_id]}, and you will get actual values instead of variables when template will be parsed. Operating with user's info table this way, you can get the value of any user field (like avatar, signature etc.) Combining this with plugins, we are achieving very smart level of customization.
  • //$userDeleteMsgs=1; Available from version 2.0 RC3a, this option allows users to delete their own topics and/or messages (set 1 for allowing to delete only replies, 2 - for deleting both topics and replies). This option is tied up with $userEdit option (see above) - when topic or message is expired for editing, it can not be deleted anymore. When deleting a record, PHP script makes many updates in another fields (number of posts per forum, posts per topic, posts per user etc.) - so, use this function on your own risk. Creating/deleting their topics often, users may overload your database.
  • //$textLd=1; Available from 2.0 RC4, setting $textLd=1; or $textLd=2; you will get {$lastPostText} variable available in latest discussions section on the first page (templates/main_last_discuss_cell.html). If set to 2, all HTML formatting is removed from the post text, and you can use it in <acronym> tag, for example. If set to 1, post text is left as it is.
  • $startIndex='index.php'; Available from 2.0 RC5, this obligatory option sets the basic filename of "index" file, which will be displayed in backlinks to the main forum on the intermediate forum pages. Prevents duplicated content of search engines indexing. Default is 'index.php'. Set 'index.html' for mod_rewrite (when only setting mod_rewrite "index.html" rule - read below).
  • $manualIndex='index.php?action=manual'; The same principle as for obligatory setting above; displays backlink to manual page. You may set 'manual.html' for mod_rewrite.
  • //$enableGroupMsgDelete=TRUE; Available from 2.0 RC5, enables or disables group messages deleting by admin or moderator - he is able to delete many messages at once, checkmarking them and clicking on necessary link. Specially useful on anonymous boards, when you are forced to fight the spam or flood. For enabling this option, just uncomment the variable and set it any value.
  • //$post_text_minlength=10; Available from 2.0 RC5, this not obligatory option sets minimum amount of symbols needed for posting a message, preventing unmeaningful posts. Default is 10 symbols. Uncomment and set to 0 if you want to disable this.

That's all, folks! We did the advanced miniBB setup. After that, your forums will work according to your needs and preferencec. But, you need to do something corresponding to your page's design, didn't you? So, let's go to the next level.

Templates

Templates are used to separate HTML code from PHP. They are located in "templates" directory and are usual HTML files (or TXT files - if we talk about email templates). If you don't like our templates, you can change them or design yours. It is important to save all variables (they look like usual PHP "variable variables": {$...}) like shown. Template parser turns every of this variables in its VALUE, giving necessary results.

We don't recommend editing templates with WYSIWYG editors. Try to work with "clear" code, since all PHP variables included in templates will not work in HTML separately. We hope, that it will be enough for you to use any kind of simple text editor with our templates: they are very clean and tide, "hand-made". We tried to make all templates compliant to W3C recommendations. We can't guarantee, that they will work as 100% W3C standart works, but they look the same in different browsers.

If you decide to change templates, you need to refer to the miniBB logic in building them. We hope, all templates names are pretty clear to understand, what they mean. Also, try to leave ALL the variables inside the templates as they shown, else we are not responsible for anything.

Most templates are used in different operations (that's why we call this "mini-BB ). F.e., user_dataform.html is used both for registering new user and editing user preferences, main_post_form.html is used on all posts, topics and editing pages.

It is necessary to pay attention to email templates (begins with "email_" and ends with ".txt"). They have special format: first line of every template should contain SUBJECT<<...>> line, with some text instead of "...". As you understand, between "SUBJECT<<" and ">>" there is subject of email. Don't remove this line, else you emails will be garbled!

In main_header.html, you will find page title as <title>$title</title>. Don't worry about your forums will containing the same title on each page. Title is changing dynamically according to the page, f.e., on topic page it becomes topic name, and on topic lists it becomes forum name. This is very smart feature for search indexers (like Google or AllTheWeb for example) to INDEX your forum, since these engines are working mostly with page titles. Also, that's why we recommend to think about "right" forum names: as more simple they will be, as better. In this case, also don't forget to include (or change) META-tags in header.

Custom templates

There is possibility to make a custom template and call it from the script. For example, you need to create separate page before user registration (agreement): you can add any custom template, which is not included in miniBB. Design your template as usual (all script pre-defined variables also work), put it in "/templates" directory and call from the script like:

index.php?action=tpl&tplName=custom_template

where tplName is a name for your created template (in this case, "custom_template.html").

In that way you can also create stuff like "Most loved topics and answers" with the direct list of topics, any FAQs, manuals, description pages, agreements etc., etc., as like as the WHOLE site! ;)

Language packs

For international (non-english) users, we offer "language packs" feature. You can find them on our downloads page. If you have not found a pack for your language, you can fill it yourself and sent it to us. This way, you'll help many users from your country.

Language packs can be found in "lang" directory. Usually, only "eng.php" pack is included for default english language on the board. Language pack name is changed in options file.

Language pack simply contains PHP variables with their values. Note for editors: use ` instead of ' in the sentences, or use slashed apostrophe \'. Technically, it is better to use apostrophes (' ') instead of quotes (" "), because of the engine's speed increase.

We hope, it is pretty simple to understand, what's going on inside of language pack, if you want to change it :). Despite, there are some notes more:

  • $Lang:English:$ string is referred to language "name", which appears in "Language" menu. When making another version of pack, write language name in English between "$Lang:" and ":$"
  • $l_meta tag is META-LANGUAGE value for your html encoding. Usually it looks like '<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">' where you need to change only charset value. Refer to W3C docs for more info on encoding. Note: if you want users to make posts on different language encodings (f.e., english, russian and latvian on the same forum), make l_meta blank ('').
  • $l_months variable defines array of month names separated by ":". Be sure to include EXACTLY 12 values!

Other variables are in assorting order. While working on miniBB, we have added them in "order of appearance".

Just one more thing: if you will see a string like "Language variables miniBB vX.X", it means that, variables following this string are added or changed for corresponding version. If we add more features, we will also add variables, and for better finding they will be added in another section.

Language packs describe ALL language used in board, incl. admin panel.

Important: language pack's filename can have only of 3 letters (examples: eng.php, alb.php, rus.php).

If you have multilanguage forum, it would be a good idea to create many manuals on each language, naming it manual_LNG.html, where LNG is the prefix for your language pack. By default, only manual_eng.html is included. If there is no manual for user's language, empty page will be displayed.

Skins: CSS file

CSS (cascading style sheet named bb_default_style.css) is designed to fit all font colors, table borders and sizes on the page in one file. It is included only once in main_header.html. It is W3C compliant. You can edit it as you wish, to fit your forums design to your page's design. In our download section, you will find some free examples of another styles/skins. Even if you don't know CSS, it is very easy to change mostly a couple of colors in HEX, fonts and sizes in pixels/points. Some example CSS skins downloadable from our site can also contain icon packages and image backgrounds and it's easy to add your own background to any CSS skin. You can find skin parameter description in CSS file itself - all main parts of it have small notes explaining the meaning of subsequent font/color/border and other parameters.

Administrative options

Admin panel

You can go to the admin panel "by hand", typing in your browser admin panel's filename which you have entered in options file. But usually, you only need to login as admin into forums, and you'll see admin panel link at the bottom of each page.

Admin panel is very small and very simple. Here is the list of options:

  • Add forum. We have talked about it earlier. With this operation, you can add forum name, description, icon. Forum icons are displayed near forums table. They are placed in directory /img/forum_icons. Icon should be .GIF or .JPG with the size of 16x16 pixels. Here you just need to type a filename of image WITHOUT directory name. If no image specified, default.gif is loaded. You may use straight HTML in forum's name or description, putting, for example, direct HTML links there.
  • Edit forum. Click on it, choose forum to edit from drop-down list. Editing form appears. You can change forum name, description, and order there. For editing, press "Edit form" button. Below you can see fast preview of how forums will look like. Re-ordering forums is simple: you just need to click on ↑ or ↓ symbols to "move" forum up or down (this is avalable only beginning from version 2.0 RC3).

    From this menu you can also DELETE forum. Note that deleting forum will immediately deletes ALL posts and topics corresponding to it. We don't recommend to do that, 'cause there is no way back. If you still need to delete forum, just click on the checkbox saying "Delete forum" and press "Edit". Forum will be deleted and there will be NO ASKING TWICE, so be careful with this thing.

    Deleting forums brings us headache, so, if you will never delete forums, open your admin panel file for editing, find the following line:

    case 'editforum3':
    and add after it the following line:
    if(isset($_POST['deleteforum'])) unset($_POST['deleteforum']);
    You should have:
    case 'editforum3':
    if(isset($_POST['deleteforum'])) unset($_POST['deleteforum']);
    $forumname=(isset($_POST['forumname'])?$_POST['forumname']:'');
    $forumdesc=(isset($_POST['forumdesc'])?$_POST['forumdesc']:''); ...
    
    etc. This will avoid forum deleting in any case - even if intruders will know out about your password (we hope this never happens).

    Forums supertitles (categories). Since miniBB is designed for small/medium communities, we have not planned to make splitting forums list by additional category. If you have 4-5 forums, there is no need to create categories, because in this case, your forums will look badly organised. However, there is a possibility to emulate categories for forums, this feature is invented since version 2.0 RC3 and called "supertitles". Supertitles appear BEFORE main forum title, emulating category, and you probably may add supertitles AFTER you created a list of forums and arranged them in desired order. Go to forums preview when editing any forum, click on forum's title when you want to put supertitle, and add it in corresponding field. Notice that moving the main forum title affects also supertitle, so putting one forum from one "category" to another means actually that you need to remove supertitle from this forum and add it to another forum's title. You may use straight HTML in supertitles.

  • Remove user. This immediately deletes selected user. You need to write in user's ID. How to know about that ID? Go to the forums, search for user you want to delete, find user message and mouse over your cursor on member's title below the username. The link will be something like http://.......?action=userinfo&user=243. The last digit (f.e., 243) will be user ID.

    Checking box, you can also remove all user MESSAGES and TOPICS (with other user's messages). And all user email notifications, too. We do not recommend to do this. If you won't check this box, only info about registered user will be removed, and all his topics and posts left will be signed as if he is unregistered user (and from now on he will be, actually). See below miniBB users hierarchy.

    Note: on large forums, it takes some time to remove user with topics and posts. Be patient.

    Programming notes: removing user operation can cause some bad forums security issues(if someone knows your password, of course). For disabling delete, find this line in your admin PHP file:

    case 'removeuser2':
    and add after it the following line:
    if(isset($_POST['removemessages'])) unset($_POST['removemessages']);
    You should have:
    case 'removeuser2':
    if(isset($_POST['removemessages'])) unset($_POST['removemessages']);
    $userID=(isset($_POST['userID'])?$_POST['userID']:0);
    ...
    
  • Ban user IP. We have, basically, the simplest and the strongest bans. They are based on user IP (usual proxies also checked), and prohibit user even to enter forums. For banning user IP, just enter his correct IP (contained maximum 15 symbols, including dots). You can also ban so called IP "mask", entire network. Example: if IP to ban is 191.88.32.12, you can ban all IPs within local network (enter 191.88.32.+, or more stronger - 191.88.+.

    How to know about user IP? Log into forums as admin, and open any thread. In every user message, you will see his IP.

    Extended feature: clicking on this IP, you can see a list of usernames, under which posts were made. It is nice option for viewing all "anonymous" user nicknames. This options is also available for moderators.

    For unsetting ban on IP, just do "Unset/unban selected IPs" in the admin panel. When you click on this link, a list of all bans is offered. Just check necessary bans and press the button.

  • Ban user by ID. You can also ban registered users by their ID. This is really useful if, for example, you have forums only for registered members, and someone begins to flood the board. This operation can be done in the same form where you can ban user ID (see above), you need only to enter correct user ID, not IP. You can view user's ID clicking on his "Member" title (ID goes straight after "user=" in URL string). You can't ban user with 0 (zero) ID.
  • Search users. Admin is allowed to search users by ID, username (login) or email, also inactive users (haven't posted anything since registration) and haven't made new posts since defined date. Each record found displays user's login with link to userinfo on the board, registration date, email (even if "hidden") and last reply's post date. In some cases, also found records' count is displayed. Search users results are splitted by pages, if results count is really big.

    Searching on ID, you need to enter decimal. Searching on email or login, you need to enter some string. If you do not enter something on ID or login, ALL users list will be displayed.

    When searching inactive users, you do not need to enter something. Receiving inactive users list, you can delete many of them by one-time, checking boxes and clicking "Delete" button.

    When you search users that haven't posted anything since [date], you need to define this date in YYYY-MM-DD format, which means: "4-digits-year"-"2-digits-month"-"2-digits-day". Script is looking for people, who's last reply date is EARLIER than entered date (not including!). That means, if you enter 2002-03-07, for example, you will look for people, who's last reply was earlier than on 7th March, 2002. People with last reply on 7th March will not be shown, also as "inactive" users, too.

    Clicking on [Delete], you can pop-up window with "Remove user" option, where user's ID will be automatically written in form. "Remove user" operation is described above.

  • Delete email notifications. If "user emailing" option in your setup is set to 1, it may happen, that some users emails are already "dead". In this case, you, as the administrator, should receive "mailer-daemon feedback" messages saying "Could not deliver message" or something.

    In that case you can simply delete dead emails. To do that, type in an email to delete or simply press button for clearing up the whole table.

  • Export emails. This operation is necessary, if you want to make a mass-mail for your users. PLEASE, DON'T SPAM YOUR FORUM USERS! You need the email list only for important news, f.e., site's moving to new address, forums reconstruction etc.

    You can extract only emails or email+username, use tab separator or comma between these values, and output emails to the screen or separate file attachment. If you've chosen last one you will get a download window after pressing submit button.

  • Restore Admin data in database. This option updates users table and sets new admin password, username and email if you have changed any of these in the options file. Yes, you can change your admin name anytime you want, more so - we recommend to do it regularly.

"Hidden" admin forums options

Private (closed from public) forums. Only site owner can define private forums and users which are allowed to post and view them. Edit bb_specials.php file, find variable $clForums=array(); and add $clForumsUsers[]=array();. $clForums array defines closed forums ID(s), and $clForumsUsers[] elements defines users which are allowed to post in this forum. Here is an example:

$clForums=array(1,3,6);
$clForumsUsers[1]=array(2,5);
$clForumsUsers[3]=array(10,11);
$clForumsUsers[6]=array(12,22);

That means: forums with IDs 1,3,6 are private. Users with IDs 2 and 5 are allowed to post and view forum under ID 1, users with IDs 10 and 11 are allowed to post and view forum under ID 3, users with IDs 12 and 22 are allowed to post and view forum under ID 6. It seems a little bit difficult, but usually site has only one private forum and 5-10 allowed users, thus not everyone needs this feature - that's why we have not implemented graphical interface for it.

If you don't want to have private forums, leave these arrays blank (but don't remove them!).

Note 1: when setting $clForums array without $clForumsUsers array, you won't get any results, and these forums will be available to anyone, until you define user IDs, which have access to a private forum. Another words, these settings are working only together, not separately.

Note 2: it is not necessary define admin ID (1), because admin can enter any private forum and has full access to it.

Note 3: topic titles from private forums don't appear on statistics, last discussions, user info and search pages, and first forums page, too. Anyway, if allowed user or admin is logged, they will appear everywhere automatically.

Archive forums. Site owner can create so called "archive" forums. Edit bb_specials.php with array variable $roForums in it. Like in private forums (see above), add read-only comma-separated forums IDs into this array. In read-only forums, nobody except admin can make or edit posts.

Post-only forums. Site owner can create so called "post-only" forums. That means, users can do anything except for creating new topics in these forums. It is very useful, if you combine your forums with guestbook or news flash, for example. Edit bb_specials.php with array variable $poForums in it. Like in private forums (see above), add read-only comma-separated forums IDs into this array. In post-only forums, no one except admin can make or edit topics.

Example:

$poForums=array(1);

That means, forum with ID 1 is "post-only".

If you have "post-only" forum as guestbook, for example, or just want to redirect user to some thread exactly when he is clicking on forum's title to view topics, you can define it in bb_specials.php as $redthread array. Example from our forums:

$redthread=array(8=>355);

means when user visits some forum with ID 8, he will redirected to the topic with ID 355, so the full URL will be like action=vthread&forum=8&topic=355. This is optional feature, it is not necessary to include this array if you don't need it.

User rankings. miniBB doesn't use ranking system (user ranks like 'Administrator', 'Member' are displayed only, and if it is anonymous user, nothing is displayed). But it is possible to define special user rankings, for "special" members (for example, most-active-poster-of-all-time). Open bb_specials.php for that, find $userRanks array, and edit it. It is based on PHP syntax, so let's give an example with no more talk:

$userRanks=array(1=>'Boss', 17=>'Team member', 9=>'Team member');

That means, user's rank with ID 1 is Boss (of course! :), and users with IDs 17 and 9 are "Team members". These rankings will be displayed under nickname in every post. In this way, you also can define so called "avatars" (just use your imagination, how to do that).

Registered-users-only forums. These forums mean, that only registered (and logged correspondly) users can make new topics, new posts and edit their messages here. Variable $regUsrForums=array(); in bb_specials.php means array of forums IDs which are protected.

Example:

$regUsrForums=array(1,2);

That means, forums with ID 1,2 are only for registered users.

In a case of registered-user-only forums, the post-topic or post-thread box with login information WILL APPEAR even if user is not logged in. User will be able to enter his login/pass to make a post. Anonymous or incorrectly logged users will be informed with "Access denied" message. In many cases, they can loose the information they typed, so please warn users of your board someway, that they must register before making any post!

Moderators definition. Moderators are people who can help admin in managing forums (read more in moderators section. Variable $mods=array(); in bb_specials.php defines the the array of forum/user IDs which have moderators possibilities.

Example:

$mods=array(
1=>array(9,996),
2=>array(9)
);

means that user with ID = 9 is the moderator for forums with IDs 1 and 2, and user 996 is moderator for forum 1.

Moderators have access only to specified forum.

Displaying list of moderators is available on the first forums page. In default version, it is hidden. If you want to display this list, in HTML template main_forums_cell.html add variable {$moderatorsList} (for example, directly after {$forum_desc}). It will display usernames of moderators for current forum. If there is no moderator specified, nothing will be displayed.

Excluding last discussions. If you want to exclude some forum from "Last discussions" list, you can set it in the bb_specials array $lastOut. For example: $lastOut=array(6); excludes forum with ID 6 from "Last discussions" list on the first page. It's not necessary to add this new value if you don't need this.

Sorting specific thread in DESC order. You can specify the ID of the thread (topic), which messages can be sorted in DESC order. By default, every thread is sorted in ASC order. Specially useful for questbooks. For this, set new array in your bb_specials.php file:

$themeDesc=array(THREAD_IDs);

where THREAD_IDs can be array of IDs of topics. For example:

$themeDesc=array(355,11);

will set DESC order for topics with ID 355 and 11.

Note that this option will not affect page listing in last discussions and topics list. When some topic is splitted by pages, last replies will be available when you click on topic's title. If you have such kind of sorted thread (like guestbook), it is better to exclude it from last discussions and set the exact redirect (see "Post-only forums").

When you set this kind of topic, near its title, users will see an icon from /img/topic_reverse.gif.

Deleting messages. Only admin is allowed to delete user messages. Admin needs to be logged into the system. For deleting any message, go to the topic/thread list and click on "Delete" on the top of the message. JavaScript alert should appear; click "Ok", and the post will be deleted. After delete, message is not available for recovering.

NOTE: you can not delete FIRST message of the topic. That's because the first message in thread list is TOPIC TEXT in reality. If you want to delete first message, it means you want to delete the WHOLE TOPIC. For this, see "Deleting topics".

Deleting topics. Only admin (or moderator) is allowed to delete user topics. Login, go to the bottom of topic page. You will find something like "Delete topic". Click on it. JavaScript alert should appear; click "Ok", and topic will be deleted, with all associated posts, too. Click on "Cancel", and you'll keep the old things. After delete, topic is not available for recovering.

"Cleaning up the board" solution. When your board runs for a big time, you'll probably want to remove some old necessary topics. miniBB has a smart solution build-in, how to do it easy (beginning from version 2.0 RC2). Login as admin and in your Preferences, set default sorting to "New topics", then go to some forum, which you want to clean-up, and go to the last page of topics within this forum. Another words, begin the cleaning from the oldest topics to the newest topics. Go inside some topic, review it, and if you find it unnecessary, delete it as described above. After that, you will be redirected to the page where topic was previously found; near next topic that you need to check, you will find a little mark '»'. This will help you to not lose the last topic you stayed on.

Editing messages. Board administrator can edit any message from the forum at any time, plus, if it is "new topic text", he can edit also topic title. Moderator can edit any message within allowed forum at any time, and also change topic's title. For editing the message, click on "Edit" link on the top of each message in posts list (it appears when allowed person is logged in).

When editing message, admin or moderator can choose, either this message could be edited by user after, or not. Beginning from version 2.0 RC2, by default, all messages become opened for further editing; however, checking the box marked as "Edit", admin or moderator can disable this.

If you want to override "strike through Edit" text near checkbox, when editing a message as admin or moderator, just add $l_editLock='Mark as edited and lock post'; in your language pack (if $l_editLock variable is set, it will overwrite default setting).

Message author can edit topic's title only, if administrator has set necessary option (see above).

When admin or moderator edits his own message, "Edited by" string will show his name instead of simple "Admin" or "Moderator" title when editing/disabling another's message; at the same time, if admin or moderator do not check "Edit" box when editing another's message, status of this message will be kept as it was (or like it was not edited by admin at all).

Moving topics. Only administrator can move topics from one forum to another. Moving topics is a specific operation, we don't recommend to do it often (since many users will not understand what's going on). Do it only if topics thematics is not the same as the one of a forum. After decision, login as admin, go to the bottom of the topic page, click on "Move topic" and move topic correspondly to the forum you want. You can move topic only to the "another" forum, else there is no sense for this action (don't move topic to the same forum). When moving topics, only forum info is updated, nor datetime or anything. If topic is moved from one closed forum to another, and subscribers are NOT in this forum, their subscriptions will be DELETED.

Locking topics. This is very smart "censorship" operation, which prohibits users from making new posts in special topics. For locking topic, log in as admin, go to the bottom of each page. You will find kinda "lock topic" link. When you press it, topic will be locked. On an old place instead of "lock topic" you should see "unlock topic" link. Click on it, and topic will be unlocked.

Both topic's author (if he is a registered user) and admin can lock/unlock topics. Even if admin has locked this topic, registered author can unlock it - if the corresponding value not set in your options (see $userUnlock option above).

Beginning from version 2.0 RC3, it is also could be prohibited, that topic's author can not lock his topic at all (see $userUnlock option above). At the same time, when topic is locked, nobody from participants of topic is not able to edit his message anymore.

"Stickying" topics. "Sticky topic" means the topic, which will be shown on the top of the topics list every time. This is useful for some announcements or really hot discussions, which you want to present first. Sticky topics appear ONLY in topics list. Last discussions page stays untouched! Last discussions is actually fresh meat, there is no necessarity to show sticky posts every day, in the time when new stuff is going.

Sticky topics are available for setting both for admin and moderators. For stickying topic, go to the bottom of the thread and find the "Make sticky" link. Just click on it. When the topic is already sticky, you will find the "Make unsticky" link.

Sticky topics also can be locked. If you lock sticky topic, and then unlock it again, the sticky status will be kept, and vice versa.

Viewing subscriptions. Entering topic, logged admin can view which users are subscribed to this topic ("Subscriptions" link). Entering view panel, admin can also delete unwanted subscriptions, checking boxes near user's email.

Note: if there are no subscriptions, link will not appear.

"Preferences" for admin

Actually, admins preferences doesn't change anything special. As usual user, Admin can go to that panel and edit something, but all forums-working datas (Admin email, login and password) are taken from options file. In the admin panel, you will find operation called "Restore Admin data in database", clicking on it, you will automatically copy (or insert) your options data to corresponding Admin field in database. Then you can choose another email and other stuff (ICQ, for example) that will be shown on the "about user" page. So, your email shown in the above mentioned user info page can be independent on the email in the setup options file.

If you are using "Direct email" plugin, you can set another email for emailing admin, so you can have 2 different emails for system messages and direct user emailing.

Moderators

Concepts and possibilities

In miniBB concepts, moderators are people who can:

  1. Lock, unlock, delete and move any topic - the same way as admin;
  2. Edit any message (with topic's title) - the same way as admin;
  3. Post a new topic in post-only forum;
  4. View poster IP (and view all users that have posted under this IP).

Moderators have no admin's privileges and have no access to the administration panel.

Moderators privileges are splitted by forums.

Each moderator can be defined only by administrator in bb_specials.php file (see above).

Each moderator has special description near his nickname (defined in $l_moderator variable in language). If moderator has special rank, his rank will be displayed instead of it.

Forums-wide user options

Users hierarchy

There is "liberal" users hierarchy in miniBB. Topics can be made both by anonymous users and registered users. Let's see what happens.

  • Anonymous users. If you are lazy, or do not register for some reasons, you can make anonymous post, even under your usual nick, if it's not taken by another already. Simply type your username in "Login" field without password, and make a post under this name. If you leave both fields blank, your name automatically will be "Anonymous" (it depends on forums language setup even). However, if you will enter the nick which corresponds to any registered user you won't be able to post. This feature is only available, if forum's administrator has not set the forums for registered users. Notice that Administrator may disable some anonymous nicknames for using - in that case, your nickname will be posted as default "Anonymous".
  • Registered users. WE STRONGLY RECOMMEND all users to register - in any way, will you visit this forum often or not. Why? First, no one else will take your "unique" username/nick, and anonymous users will not be able to post messages under your nick. Second, if you will post some messages under your nick, and register it later, it is NOT POSSIBLE to edit these "anonymous messages" anymore. And finally, any registered user can take your "anonymous" or not registered nick simply by filling registration form.

User info is displayed on the separate page. On the threads page, you'll find only user's nick and, if this user is registered, a "member" beneath. Clicking on it, you'll get all possible info about user, which either is specified/allowed or not (see below). NOTE: by clicking on user's nickname, you "quote" his nickname in the reply form!

User's login

Users must have cookies enabled in the browser. Cookie passwords are saved in encrypted format. User login form is located on every topics or threads page, as well as on the first page. On the topic or thread pages, you are able just to log-in without posting any text. You need to type your login and password correctly.

Depending on forums setup, user login can expire in different time. Usually it expires within 1-2 hours, but administator can also make more longer expire (especially on international forums). Cookies renew mechanism also allows users to stay logged during longer periods of time - until the browser is closed. Anyway, we recommend to do logout before you are leaving forums.

Anonymous users also receive cookie that goes from one page to another. Enjoy comfort!

User's language

Registered users can change their board's interface language in their profile, choosing from dropdown list. However, administrator of multilanguage board also can set some links for anonymous users, so they will be able to view the board on desired language. For this, you need to put the link containing variable "setlang" and the value corresponding to the language file name. Example: http://.......index.php?setlang=rus will display board in Russian; however this setting will not affect logged-in user.

User's registration (Sign Up)

For registering, just click on "Registration" menu and fill in the form.

Necessary fields are:

  • LOGIN: your username, must be unique - if a user with the identical login already exists, you won't be able to register. Login must contain only symbol combination defined by admin. Usually, we recommend to use only A-Z letters, digits and maybe "_" sign. But, if admin defines more symbols, you can also use them. There is only one possibility to view defined symbols - to make a mistype in username. Then you will see them in error message. Anyway, don't choose "exotic" usernames - at least, it is stupid. You can use a name with length from 3 to 40 symbols.
  • PASSWORD: your password for BB. Must contain only A-Z letters, digits and "_" sign (no spaces!). You can use password with length from 5 to 32 symbols. Why exactly 32? We don't know ;) If seriously, try to use not more than 10 symbols.
  • PASSWORD ONCE AGAIN: this must be the same symbol combination, as the "PASSWORD". This is just for checking - have you entered password correctly, or not. Pay attention: all passwords are saved in encoded way. There is no possibility to view user password even by admin! Despite you can anyway receive new password via email, but it will be different from your orignal one (randomly generated).
  • EMAIL: your email. Must be also unique (no 2 users with the same email are possible). Email is checked by simple regular expression for avoiding "stupid" emails. If you can't register some email, please report to admin, or at least, miniBB team. Even we have checked this combination in many cases, there are some "exotic" emails that can not be validated with our function. But this is a rare thing.

Depending on what option current forum has, you can be registered just after filling the form, and can login to forums straight forward after it. Otherwise, if administrator has set avoiding of open registration, you'll need to check for the password your email first. When open registrations are forbidden, your password will be generated by the system, that's why you need to enter the correct email-address.

Beginning from the version 2.0 RC4, it is allowed for admin to disallow user registrations (set $enableNewRegistrations=FALSE; in setup_options.php), but at the same time, to register them, logging as admin and visiting the link under ?action=registernew. For example, paste in your templates/admin_panel.html:

<!-- Register new user --><li><a href="{$indexphp}action=register">New user Sign Up</a></li>

this link will drive you in registration form. Enter necessary user data, click "Submit" button - you will see regular registration message, and your new user will be created with the data you provided. An implementation for those who want to open forums only for REALLY trusted users!

New topics and replies

New topic form is placed at the bottom of each topics listing page. You need to type topic's title ("New topic") and body ("Message"). At least, "New topic" field must be filled in. If you write in it and don't write in "Message", message will be automatically equal to topic's title.

New post form is located at the bottom of each threads page.

Note: if the anti-spam protection is enabled (usually it is), you can make posts and topics only once-per-defined-time. Usually, this time is 1-2 minutes - and it means, you can make posts not often than 1 per 1-2 minutes as well.

Note 2: before making a post, make sure you have corresponding ENCODING for this. F.e., if you have to make post on non-english language, let's say, chinese, be sure your browser encoding is set to it. To do it:

  • In Internet Explorer, click the right mouse button on the screen, choose "Encoding", and then set it;
  • In Netscape Navigator/Opera, choose menu's "View" -> "Character Set (Encoding)" and then set it.

Note 3: text breaks (newlines+carriage returns) are automatically converted to "physical" breaks.

Note 4: don't use a lot of apostrophes, quotes and specific tags in your messages. Actually, they are converted to "real" HTML-tags like "&#039;" (apostrophe), "&amp;" (& sign) etc. As you see, HTML special char takes at least 4 times more space than usual symbol. So, if topic's title limitation is set, let's say, to 70 symbols by administrator, your sentence can contain maximum 17 special symbols. Practical example: your topic is "Quick brown fox jumps over lazy dog's ears & nose" (49 symbols). Actual title is converted to: "Quick brown fox jumps over lazy dog&#039;s ears &amp; nose" (58 symbols). If the limitation would be 50 symbols, the sentence would be cutted to "Quick brown fox jumps over lazy dog's ears" (minus "nose" minus 5 special-symbols).

Email notifications

Email notifications can be enabled or disabled by forums admin. Usually, on large forums they are disabled. If enabled, every user who makes a post, can subscribe to them. Alternatively, there us also a way to make notifications available without posting some text. Notifications are sent to user's email when someone replies to the topic after this user. Users can subscribe to notifications even if they are not topic authors. Users can also unsubscribe from notifications. For that, got to the desired topic and find "Unsubscribe" link instead of notifications checkbox, and just click on it.

According to the setup, user may receive notifications on custom language (in multilanguage forums). Admin receives notifications on default board's language.

Automatic links highlighting

If you are using links like http://www.minibb.net (beginning with "http://", "https://", "ftp://", "www" or "mailto:"), they are automatically converted to "real" links. But, when checking "Disable" box, links ARE NOT automatically highlighted, both as BB-codes (see below).

BB Codes

In miniBB, there is no possibility to include HTML in topics or posts. They can contain only "BB-codes" - special HTML-code replacements, that "emulate" HTML code. Since HTML is not supported in our board, most popular BB-codes are good alternative when posting new message or topic. miniBB has improved JavaScript text editor for Internet Explorer and Mozilla, which will make the creating of your codes easily.

Currently, miniBB supports following codes:

  • [url=SOMEURL]SOMETEXT[/url] where SOMEURL is URL like http://www.minibb.net, SOMETEXT is alternate text to URL. DON'T USE QUOTATION MARKS OR APOSTROPHES INSIDE THIS TAG. In a post, these tags are replaced like following: <a href='SOMEURL'>SOMETEXT</a>.
  • [imgs(left|right)]http://www.someserver.com/images/image.gif[/img] where http://www.someserver.com/images/image.gif is exact URL for an image file (.JPG or .GIF). Alternatively, you can use "left" and "right" tags (without trailing space!) followed exact after "imgs". They place image left or right on the page, in the same way like HTML does. Usually, only [imgs] tag is used, but in systems like "forum news" you can also use left/right aligns. This tag is replaced with: <img src='http://www.someserver.com/images/image.gif' border='0' align='left OR right OR nothing' alt=''>. (Example: [imgsleft]http://www.someserver.com/images/image.gif[/img]) Note: because of hack protection, you can include images only from http:// servers, also as with only extensions like .gif or .jpg. Beginning from the version 2.0 RC4, all posted images are shrinked to the witdh of 150 pixels, so they can not break the look of the thread.
  • [b]Bold[/b] where "Bold" is the text you want to markup as in a "bold" style. Example: [b]Attention[/b] produces Attention.
  • [i]Italic[/i] where "Italic" is the text you want to markup as in an "italic" style. Example: [i]I apologize[/i] produces I apologize.
  • [u]Underlined[/u] where "Underlined" is the text you want to markup as in an "underlined" style. Example: [u]Don't write me an email[/u] produces Don't write me an email.

Note that the case of BB codes doesn't matter. You can type "[URL]" or "[uRL]" or whatever. Only opening and closing tags ([urL]...[/uRL]) are important, also tags CAN NOT CONTAIN SPACES!

There is no necessary to know exactly what do you need to type for corresponding tag. Each template message form contains JavaScript buttons that helps you to insert these tags into your post.

Both anonymous and registered users can use BB-codes, but also you can DISABLE BB-code in your post, checking "Disable" flag. Usually this is not necessary, because BB-codes allow posts be more organized and good-looking messages. But if you need to post something using not BB-code, but actual info containing BB-code, it is useful. For avoiding BB-codes, you can also put spaces inside them.

It is possible to combine tags with each other, f.e., to make "bold+italic" or "bold link". But be careful again with opening and closing tags correspondly. Example:


'This General Public License [b]does not permit[/b] incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.

Return to [url=http://www.fsf.org/home.html]GNU's home page[/url].

FSF & GNU inquiries & questions to gnu AT gnu.org. Other ways to [b][url=http://www.fsf.org/home.html#ContactInfo]contact the FSF[/url][/b].

Comments on these web pages to webmasters AT gnu.org.

[b][u]Copyright notice above[/u][/b].

[i]Free Software Foundation, Inc[/i]., [i][u]59 Temple Place - Suite 330, Boston, MA 02111, USA[/u][/i]'


produces:

'This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.

Return to GNUs home page.

FSF & GNU inquiries & questions to gnu AT gnu.org. Other ways to contact the FSF.

Comments on these web pages to webmasters AT gnu.org.

Copyright notice above.

Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA'


If you need to post 100% "tagged" URL, it is better to do it with tags, since automatic replacements can't work in some cases. F.e., the following example will not work: [b]http://www.minibb.net[/b]. It is only "bolded", but not "highlighted". For bolding url links, use [url] tag.

Note: you can use tags also for multi-line text. Example:

[b]Text1

Text2[/b]

(text contains two paragraphs) produces:

Text1

Text2

ADVANCED: Admin can use "color tags" for various text colors in messages:

  • [font#(HEX-COLOR)]Colored Text[/font]

This option is not available for simple users, because of its restrictions and format. Do you want your forum to look like a rainbow? We guess, not. Please, use this code very carefully and only when it is really necessary. As admin, you can use ONLY correct hex-code of color, containig combination of 6 capitalized letters A-F + digits 0-9. "#" sign at the beginning is necessary. Values like "red", "yellow" won't work. Example:

[font#FF0000]Attention![/font]

produces red-colored "Attention!".

These examples will not work:

  • [font#ff0000]Attention![/font] (non-capitalized)
  • [font#red]Attention![/font] (non-hex)
  • [font#F000]Attention![/font] (only 5 letters - incorrect)

By default, there is no "hot button" for this option in the templates.

Users also can use any HTML decimal codes in their messages. This is done mostly for international forums, when user's encoding is set to different language, in which he posts a message. You can use any code beginning from "&#" and ending with ";". For example, it is useful for displaying both BB-codes with their interpretators. This:

[b]Use bold[/b]: &#91;b]Use bold&#91;/b]

will produce: Use bold [b]Use bold[/b]

Note that decimal codes are not replaced back, when you edit your message. They are displaying like they are.

Quoting messages

Topic posters can quote other messages. There is no "quote" BB-code included, as on some bulletin boards. Instead of it, you can use "italic" style to separate quotes. For better comfort, there is a "quote" link near every post made. For making a quote, you need to select some text and press this link. Selected text will be automatically inserted into reply box at the bottom of the page.

This feature is based on JavaScript code and works only in newest browser versions. Specific or old browsers users may experience some troubles with it.

Locking topics

Topic authors can lock their topics, if they think it is correct. In order to do it, topic author needs to be logged in. At the bottom of the topic's page he must see small "lock topic" link. Clicking on it, topic becomes closed.

Nobody except topic author or administrator can lock the topic. If topic was locked by admin, topic author can unlock it ONLY if it is defined in forum options (in most cases it's not).

Editing messages

Registered users (and only registered) can edit THEIR messages, but only if they are cookie-logged and only if the time of the message is not expired. For this, just click on "Edit" near each post (if it is your message, you'll see the link, else not). When editing message, "automatic highlights" are replaced with "real" BB-codes, so there is no need to delete them once again. Also, "real" HTML tags are replaced back to codes. Via editing, user can add new BB-codes, links etc. - like in any new post or topic. User can edit only his POST, not topic's title, even if he is the author of the topic. After message is edited by user, info about that is displayed near each post.

There is no way to delete your message (and if not allowed, to edit topic's title), if you are topic's author. Only admin can do this.

In some cases, after administrator has edited user's message, for user, it is no way to edit it once again.

Editing preferences

For editing user preferences, you need to log in and go to the "preferences" appearing in menu. You can type new data for your account, except login, that can not be changed. If you don't want to change your password leave the password field and go next to the fields you want to edit, you don't need to write your password once more, 'cause are already logged. Then done just press submission button below.

This action works exactly like registration: you need to type grammatically correct data. Thus, you can not change your email to the one of someone who already registered (incl. admin's email ;) ). Updating preferences, you don't need to enter password, if you don't want to change it. Just leave these fields blank.

Two exceptions:

  • Show email public?: that option allows (or not) other users to view your email in user info. It does not affect emailing notifications etc.
  • Sort topics by: that option switches sorting filter. On topics and last discussions pages, you can view topic names sorted by new topics or new posts. This is one of the points of why to register: logging into the forums, you can quickly view, what's new. This option is saved on all pages, since anonymous users will need to click on "sort" every time.

Changing user password

Login, go to the preferences, type new password 2 times in "password" fields. Your password will be updated to the new one.

Note: after changing password your old password will not be valid, and you will need to re-login on the login page. If you will edit more settings, you'll get the message "not allowed" or something similar.

Changing forgotten password

miniBB passwords are encrypted using MD5 algorithm. You can decode MD5-hash only with special hacker tools, using forces or dictionaries; it is impossible to decode it in "easy way". As longer password you have, as it more difficult to encode it. If you have forgotten your password, PHP-script can't restore it anymore, but instead, it generates new random password.

Follow these steps to receive new password:

  • Click on "password" links near login form;
  • Enter an email you've mentioned in the registration form;
  • If your email is correct (we hope, yes :) you will receive further instructions via email;
  • Follow link described in email and confirm your password;
  • Your password will be changed only after confirmation. You will be able to change it to something "human" in "preferences".

Forums search panel

You can quickly search forums for keywords. Search panel is placed under the "Search" link in menu. You can search text in topics and posts, in topics only, in poster names, in specified forums, by all words, any words or the whole phrase. Newest messages are shown first.

Search phrase length can't be more than 100 chars. Minimum length of any word is 3 symbols. As more search parameters you specify, as more longer by time and specific by content will be search results.

Search within specified forums is also available. You can either search in all forums or choose a forum you want to search in.

Search algorithm tries to perform a search on a comprehend words. By fragment, we mean here fragment of the whole word from the beginning. For example if you search for a word "fox", it will be found in the sentense "The quick brown fox jumps over the lazy dog.", also as the word "jump" will be found. But the word "foxy" will not be found, also as "row" won't be found. Searching by whole phrase, script will find "fox jumps over", but won't find "fox dog" - use "Words or fragments" criteria for finding many words in the text at the same time.

Statistics

In the "statistics" menu, you can get all available information about forums. This is the most "not needed" part of a forum. In statistics, you will find:

  • Total number of registered users (except admin);
  • Total number of topics;
  • Total number of posts;
  • Who is administrator;
  • Who is last registered user;
  • Most popular topics list (top 5, top 10, top 20, top 40), which is generated according to how many answers were posted in topic;
  • Most viewed topics list (top 5, top 10, top 20, top 40), which is generated according to how many views each topic has;
  • Most active registered users list (top 5, top 10, top 20, top 40).

You can define period of days which will be used in calculating stats (this setting affects only most popular topics and most viewed topics, username stats are NOT affected). Setting $l_stats_popular, $l_stats_aUsers, $l_stats_viewed in language pack to empty values (for example, $l_stats_aUsers='';), will remove corresponding panel from Statistics page.

Some notes for developers

Please, don't read this section if you are unfamiliar with PHP, mySQL and programming at all, more so - don't even try described below. We are not giving additional support on these topics. They all are working like described; if something is not working on your side, miniBB is not the reason here.

Database modules

Default version of miniBB is supported only by mySQL database. Anyway, we have developed special SQL-functions module which contains basic SQL-functions, which could be extended by another databases, supported by PHP. We plan to work on it in near future, but every developer who can help us in making another DB module is welcome. You'll get all necessary credits.

Making a DB module is average simple. Since SQL functions are mostly the same (at least, by logic), in many cases you just need to make another database connection which is supported by PHP, and design database request if necessary. SQL requests mostly are parsed into array pointers, which can be accessed, f.e., via mysql_fetch_row() function. Probably, most databases can support this operation. In other words: just look, how mySQL parser works, and include other commands. Note: don't change names of variables, like $result or $sus, because some are called from the outside script.

Below are described miniBB general/universal functions available in setup_mysql.php and prepared for programmers who want to extend plugins via this SQL-module separately.

string makeLim (int page,int numRows,int viewMax)

Returns SQL-string like "limit 10,20" prepared for inserting in SQL-request. If page=0, returns only single like "limit 10" string. numRows is the amount of total database request rows received via request. vieMax is the maximum amount of rows should be displayed (set in setup_options.php).

string getClForums (array closedForums, string more, string prefix, string field, string syntax, string condition)

Returns SQL-string like "where id=1 or id=2 or id=3" prepared for inserting additionally in SQL-request. "closedForums" must be a simple array of values which request will be compared to. "more" could be 'where' or simply ''. "prefix" inserts a point "." after table name. "field" is field name which values are compared to. "syntax" is alternatively 'and' or 'or'. "condition" is '=' or '!='. Example: if $closedForums=array(6,7)

$xtr=getClForums($closedForums,'where','','forum_id','and','!=');

returns:

where forum_id!=6 and forum_id!=7

resource db_simpleSelect (boolean sus, [string table, [string fields, [string uniF, [string uniC, [string uniV, [string orderby, [string limit, [string uniF2, [string uniC2, [string uniV2]]]]]]]]])

Returns resource identifier on successfull SQL-request or FALSE on failure. "sus" determines either we need to make a first request (if 0) or just go through request rows (1). "table" is table name, "fields" are request fields separated by comma. "uniF", "uniC", "uniV" describes correspondly unique values which is used in additional request like "where id=1", if set. "orderby" specifies field name which is used in ordering result, and "limit" adds 'limit' statement (could be set via makeLim() function). "uniF2", "uniC2", "uniV2" are another set of additional unique fields. Example:

db_simpleSelect(0, 'minibb_topics', 'topic_id, topic_title','topic_id','>','10', 'topic_id DESC', 20, 'topic_id', '!=', 25')

return resource ID for the following request:

select topic_id, topic_title from minibb_topics where topic_id>10 and topic_id!=25 order by topic_id DESC limit 20

int insertArray (array insertArray, string tabh)

Returns SQL error-number after executing the request like "insert into users (id, name) values (1, 'Paul')". "insertArray" must be prepared simple array of variable names which MUST correspond to their values. In the given example, it should be array('id','name'), and in that case, in the script itself, there must be variable $id and $name, and their values correspondly must be 1 and 'Paul'. "tabh" is table name where values must be inserted ('users' in the given example).

int updateArray (array updateArray, string tabh, string uniq, string uniqVal)

Returns affected rows amount after executing an update request. In many cases similar to insertArray(). "updateArray" must be the same type array, and "tabh" is table name. "uniq" is unique field's name, and "uniqVal" is it's value. Example: if we have $updateArray=array('id','name'), and variable names, $tabh are the same as in the insertArray() example, and $uniq='user_id' and $uniqVal='2', SQL-command will be the following:

update users set id=1, name='Paul' where user_id=2

int db_delete (string table, [string uniF, [string uniC, [string uniV, [string uniF2, [string uniC2, string[uniV2]]]]]])

Executes DELETE request in SQL-query, return amount of affected rows. Field names mean the same as in db_simpleSelect.

int db_calcAmount (string tbName, string tbKey, string tbVal, string setName, string setField)

Function to get amount of values from table $tbName by criteria $tbKey='$tbVal'; then update another necessary table's $setName field $setField by this amount. Call this function after deleting reply, topic, user, or moving topic, or inserting new reply.

Another functions in SQL-module are specific. They either don't fit to described universal functions or are too complex for designing something special for them. You can make your own specific functions, identificating them with prefix "db_" at the beginning.

Including in your own PHP script

If you are the creator of your own PHP site, you probably have the same header and footer for the whole site, or just want to use another functions that fit into your project and miniBB together. As usual, they are .php files, and are included in, for example, index.php. Since miniBB owns the same index.php in its structure by default, you can change the name of miniBB's index to something else, setting $indexphp option in setup_options.php. Including forums from your own script requires a knowledge of PHP and things what are happening inside of miniBB. If you simply include your board using include(); you will get errors like "Headers already sent" or similar. This could happen when user loggs in to the forums, and cookies are set (they can not be set in that case, because some of your HTML stuff goes before include(); ). In this case, miniBB is a stick on two ends. The most efficient solution is to include your board this way:

<?php
$displayForum=1;

if(isset($_POST['mode']) and $_POST['mode']=='login') $loginForums=TRUE; else $loginForums=FALSE;

if($loginForums
or (isset($_GET['mode']) and $_GET['mode']=='logout')
or (isset($_POST['action']) and ($_POST['action']=='pthread'
or $_POST['action']=='ptopic' or $_POST['action']=='editmsg2'))) $displayForum=0;

/* On all conditions above, forums will do a re-location to another page,
so for avoiding header errors, we don't include any output here */

if($displayForum==1){

/* Output your header here */
include ('../inc/header.php');

include ('./forum.php');

/* Output your footer here */
include ('../inc/footer.php');
}

else {

if($loginForums) ob_start();
//there could be invalid login info, so we need to handle output there

include ('./forum.php');

if($loginForums and isset($loginError) and $loginError==1) {

//user logged incorrectly - handle this
$flushed=ob_get_contents();
ob_end_clean();

/* Output your header here */
include ('../inc/header.php');

echo $flushed;

/* Output your footer here */
include ('../inc/footer.php');

}

}
?>

where include ('./inc/header.php'); goes for the output of your common header, and include ('./inc/footer.php'); goes for the output of your common footer.

This little code actually shows, that if you have some action which will sent HTTP-headers (via PHP's header(); ), it is better to not include your header before. This could happen when user logs in or out. There also can be another redirections, described in the manual, but not included by default. In any case, you need to insert some condition to check what miniBB is doing right now.

This is an example of files structure, when you keep header.php and footer.php in a folder called "inc", and forums are kept in a folder "forum", besides default forums file is renamed from index.php to forum.php, and the script itself is kept in a "forum" folder named as index.php.

Most probably you will have completely another paths and filenames; we hope you are able to turn your imagination on for changing them. You may also change $pathToFiles setting in setup_options.php, which will make your life easier with including files from different paths.

mod_rewrite (Apache) using

If you have Apache server with mod_rewrite module turned on, you probably already know what benefits it could give to you. We will not give advices here, how you could enable this feature in Apache; you'll find tons of documentation in Internet.

How could you use mod_rewrite with miniBB? Actually, it could be used only for one purpose - so your miniBB's URLs look not like ./index.php?action=vtopic&forum=4 for example, or ./index.php?action=vthread&forum=1&topic=75, but: 4_0.html or 1_75_0.html. These links will be more likely interpreted with search crawlers like Google, for example, and probably you'll get your forums pages indexed more faster and more higher, than usual .php pages.

miniBB will build some of internal links of this type automatically (for example, when building splitting pages), and for this, you need to enable (uncomment and set to TRUE) $mod_rewrite option in setup_options.php.

Notice that only links to threads and forums listings will be 'replaced'. There is no special need in changing links to Registration, Statistics, User profiles and other pages. Search indexers need just your content.

Beginning from version 2.0 RC2, links inside templates are changed automatically depending on your $mod_rewrite setting.

As you might imagine, links are build under the following scheme:

  • List of topics: [FORUM_ID]_[PAGE].html
  • List of threads: [FORUM_ID]_[TOPIC_ID]_[PAGE].html

Hope you see the logics in it?

Now, when your miniBB is prepared, and you are sure that mod_rewrite module is working correctly on your site, you need to create .htaccess file and place it in forums directory. It should look like this:

RewriteEngine On
RewriteRule ^index\.html$ ./index.php?mdrw=on
RewriteRule ^manual\.html$ ./index.php?action=manual&mdrw=on
RewriteRule ^([0-9]+)_([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vthread&forum=$1&topic=$2&page=$3&mdrw=on
RewriteRule ^([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vtopic&forum=$1&page=$2&mdrw=on

where index.php is your forums file.

Be sure you have no .HTML files under the same scheme in the forums directory! Else they will not be displayed.

.htaccess example above is similar to what we are using on miniBB.net/forums. If you don't want index.php would be interpreted as index.html, remove the second line in the mentioned code. Your forums manual could be also interpreted as content page; if you want to avoid it, remove the third line in the code.

Beginning from version 2.0 RC5, pay attention at "mdrw" variable, it must be set ONLY in .htaccess configuration, telling the script to put "NOINDEX,NOFOLLOW" tags in the HTML header. So crawlers will index your mod_rewrite-like pages, 1_0.html, for example, but not index.php?action=vforum&forum=1. These 2 different addresses point to the same page, and it could be interpreted as duplicated content. So, putting "mdrw" variable, we force search crawler to not index your .php page, if it's URL already publically available as .html. If you use mod_rewrite, providing links to your forum pages from another sources, try to avoid .php addresses for content pages.

PHP scripts

In PHP scripts, no tabs were used by us. All functions and operations are separated by newlines only. Most of the comments were removed in final miniBB release, however, there are some very necessary comments left, that will help you understand what's going on. Also, in many string variables cases we have used apostrophes ('') instead of quotes (""), because that increases the speed of the scripts dramatically.

Upgrading miniBB

If you want to have always up-to-date miniBB version, check for updates constantly. All our plugins are tested only with the latest release, so having newest version, you get a bigger chance to expand your forums. Our RSS feed contains any news related to miniBB new versions. When new version is coming out, it is recommended, for all users, upgrade immediately. As soon you upgrade - as easy will be your next upgrade.

For upgrading miniBB, you will need to do the following:

  • BACK UP YOUR CURRENT FILES AND DATABASE - else you may lose your work, and there won't be any return;
  • almost always overwrite core script files;
  • in some cases update customized files, settings, laguage pack and/or templates;
  • in rare cases update database structure.

By "core script files", we mean here basic .php scripts, which in most cases are not necessary to edit. You probably could change these files only if you have heavily customized your version. In this case, you are losing possibility to upgrade easily. All core scripts in the package by default have prefix "bb_", also as "index.php", "setup_mysql.php" are also core scripts. Exceptions are:

  • bb_codes.php - this file could be modified to have your own BB codes;
  • bb_cookie.php - could be modified to have your own authorization routine;
  • bb_default_style.css - could and should be modified to have your own unique colors/fonts layout;
  • bb_plugins.php - could be modified to have various extensions (addons and plugins);
  • bb_specials.php - could be modified to have additional special options of forums

One file you modify in any case, is called "setup_options.php". This is a settings file, and upgrading miniBB, you should never to overwrite this file, keeping your settings. Additionally, you may add new settings at the end of file, if needed. We are always adding new options at the end of this file in new version.

Customizing your board, you probably always will change the template called "main_header.html". It is kept in /templates/ directory amongst other HTML templates. Upgrading miniBB, keep in mind all templates you have upgraded. If some changed template is mentioned in upgrade history, you can either overwrite it, either edit it, changing updated code or variables, and keeping your previous work.

Language pack (eng.php or whatever is placed in /lang/ directory) is also subject to update in many cases. Since we ourselves are supporting only English version of the board, other language packs, created by 3rd party, most commonly need to be updated, if English pack is changed. If you have other language than English, or have made some changes even to your default English version, you shouldn't overwrite new original language pack, bud edit your own.

miniBB 2.x series releases contain very detailed upgrading history. It is kept in a file called "!UPDATE.txt", which you can find inside the main miniBB archive package, or download separately in our "Downloads" section. This file contains a list of all changes, which have been done from version to version. History begins from the release 2.0 RC1, the first release of 2.x series - if you're uprading from older 1.x series, start checking from this section.

Before upgrade, you must get the clue how you'll upgrade (hopefully, you got it from the description above), and to know your current version of miniBB. It is hidden from public for security reasons; however, it is always kept in a file "bb_functions.php". Edit this file and notice your version at the very top.

In most common cases, you should close your forums before upgrade, so users don't affect database with new postings or registrations. Rename your default forums index file, commonly "index.php", to "index_u.php", and then set the option $indexphp in setup_options.php as 'index_u.php?'. You can set another filename, of course, any filename. Create a NEW index.php file and put there simple text like "We are upgrading. Please, come again in few minutes!", then upload it to server. In that case, users visiting your forum, will see the warning message, at the time only you will know the name of temporary index file, and will be able to run it in order to see your results after upgrading.

When you are ready to upgrade, download latest miniBB release, and start checking !UPDATE.txt file from the version you currently have. For example, if you're having version "2.0 RC1f", find the section "Changes comparision: 2.0 RC1f - 2.0 RC1g" and follow down below the history file content until the end. So you should pass all comparision versions: 2.0 RC1g - 2.0 RC2, 2.0 RC2 - 2.0 RC2a, 2.0 RC2a - 2.0 RC2b etc. Each section provides you detailed information, on which core files you need to overwrite, which customized files you should modify, and which SQL commands you should execute in order for upgrading your database structure.

Take all newest files from the latest release, despite they are mentioned as earlier versions. If you will some way notice or remember, which files you have overwritten already, it is not necessary to upgrade them twice, if they are mentioned in the next history sections. For example, "index.php" of "bb_functions.php" are 2 files which are almost always necessary to upgrade. So you just need to ovewrite these files once, despite they are mentioned in many cases.

When adding new option(s), language variables, special arrays, take a look at the default file(s) from the latest package - in most common cases, you need to paste these options the same way in your modified files.

History file may also contain some non-critical updates, or just mention miniBB changes, which will not affect your old installation. They are mentioned just for your knowledge, and there is nothing to upgrade.

After you have done all upgrade changes, test your board, manually pointing to the "index_u.php" file you have renamed before. If there are no critical errors shown from the first step, and you are able to login/out, post new topic and reply - the board should work ok. In any way, if some errors will be found after your upgrade, users will notice you. Obligately create new topic titled "Forum software upgraded" and notice the users about your software changes.

Finally, rename your index file back and put it's name in setup_options.php file. Forums are ready to rock again!

If upgrading process seems difficult to you, we are always ready to help you for a reasonable rate. Check our Paid Support section for more details.

GNU Free Documentation License

Version 1.1, March 2000

Copyright (C) 2000  Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

0. PREAMBLE

The purpose of this License is to make a manual, textbook, or other written document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.

This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.

We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.

1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you".

A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.

The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License.

The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License.

A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only.

The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.

2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and you may publicly display copies.

3. COPYING IN QUANTITY

If you publish printed copies of the Document numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

  • A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
  • B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has less than five).
  • C. State on the Title page the name of the publisher of the Modified Version, as the publisher.
  • D. Preserve all the copyright notices of the Document.
  • E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
  • F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
  • G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
  • H. Include an unaltered copy of this License.
  • I. Preserve the section entitled "History", and its title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
  • J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
  • K. In any section entitled "Acknowledgements" or "Dedications", preserve the section's title, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
  • L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
  • M. Delete any section entitled "Endorsements". Such a section may not be included in the Modified Version.
  • N. Do not retitle any existing section as "Endorsements" or to conflict in title with any Invariant Section.

If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.

You may add a section entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.

You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.

5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice.

The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections entitled "History" in the various original documents, forming one section entitled "History"; likewise combine any sections entitled "Acknowledgements", and any sections entitled "Dedications". You must delete all sections entitled "Endorsements."

6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.

7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an "aggregate", and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate.

8. TRANSLATION

Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail.

9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

10. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.



Поддержка: miniBB forum software © 2001-2024