<?
//board-tnk v2.1
// MySQL Configuration and some general settings
//usr login, password, etc
$username ="user"; // user name for mysql
$password ="password"; // mysql password
$dbhost = "localhost"; //mysql host
$database = "board"; // database
$admin_password="password"; //admin password CHANGE IT!!
$time_cookie="600"; //Time for admin cookie password
// KONQUEROR users in kde <= 2.2.1: change 600 to at least 5400
// There is a bug in KONQUEROR for cookies expiration date (1 hour less...)
// Prefix for tables names: if your website is on an ISP server, perhaps you are allowed only to one database
// In that case, you have to use a prefix for the name of your forums tables
// if you want a forum zzzz, than the name of the table will be $prefixzzzz in order to allow
// board-tnk to recognize the tables of the forum. For example, $prefix="myforum_" will create myforum_zzzz table for zzzz forum.
// The name zzzz will correctly appear in the pages
// BE CAREFUL: do not use the prefix inside the name of a forum!!! if your prefix is myforum_, do not call a forum xxmyforum_ww !!!
// If you are allowed to have as many databases as you want, or if you are on your own server
// you can leave $prefix="" as I think that it is better to have forum tables in its own database
$prefix="";
// email admin when a new message is posted
$prevenir="0"; // 0 for no mail, 1 for mail
$mailadmin="hide@address.com"; //admin email adress
// Background colors
$bg_head="#92bdd5"; // color of message list head
$bg_row="#9FCFE8"; // color of messages in a thread
$bg_row1=" #a4d6e3"; //first color of threads
$bg_row2="#9FCFE8"; //decond color of threads
$bg_body="#cbe5ff"; // general background color
//max posts per page
$max_posts="10";
// cooky image to choose or to put in icons_board directory
$cooky="cooky.jpg";
// Language
$lang="french"; //available english, french, german, dutch, italian, spanish
//turkish, serbian, danish, polish
// Don't change anything below !!!!!!!!!!!!!!!!!!!!!!!!!
//############################################################
//Crypt password
$admin_password=crypt($admin_password,"tn");
// Base for $PHP_SELF
$SELF=basename($PHP_SELF);
// Name of board adn admin_board for admininstration
$BOARD_NAME="board.php";
$BOARD_ADMIN_NAME="board_admin.php";
// language file
$lang_file=$lang."_board.inc";
// Language
include("locale/$lang_file");
$loctime=setlocale("LC_TIME","$lang");
// number of icons-row and icons per row and total number of icons
$nb_icons_rows="4";
$nb_icons_inline="20";
$nb_icons_click_rows="4";
$nb_icons_click_inline="20";
$nb_icons=$nb_icons_rows*$nb_icons_inline;
$talk_init="29";
$nb_html="10";
// Simplified HTML
$tag=array(
"[url]",
"[/url]",
"[email]",
"[/email]",
"[b]",
"[/b]",
"[i]",
"[/i]",
"[u]",
"[/u]"
);
// filtering of the messages
function htmlfilt($filt,$nb_icons) {
//change < to < and > to >.
$filt=eregi_replace("<","<",$filt);
$filt=eregi_replace(">",">",$filt);
// changing the icons text to images
for($i=1;$i<=$nb_icons;$i++){
$filt=eregi_replace("/ICONBOARD".$i."/","<img src=\"icons_board/icon$i.gif\" border=\"0\" alt=\"icon\">",$filt);
}
// Replace some asci icons by gifs
$filt=eregi_replace(quotemeta(";-)"),"<img src=\"icons_board/icon12.gif\" border=\"0\" alt=\"icon\">",$filt);
$filt=eregi_replace(quotemeta(";)"),"<img src=\"icons_board/icon12.gif\" border=\"0\" alt=\"icon\">",$filt);
$filt=eregi_replace(quotemeta(":-)"),"<img src=\"icons_board/icon9.gif\" border=\"0\" alt=\"icon\">",$filt);
$filt=eregi_replace(quotemeta(":)"),"<img src=\"icons_board/icon18.gif\" border=\"0\" alt=\"icon\">",$filt);
$filt=eregi_replace(quotemeta(":-("),"<img src=\"icons_board/icon14.gif\" border=\"0\" alt=\"icon\">",$filt);
$filt=eregi_replace(quotemeta(":("),"<img src=\"icons_board/icon14.gif\" border=\"0\" alt=\"icon\">",$filt);
// Simplified HTML
$filt=eregi_replace(quotemeta("[b]"),quotemeta("<b>"),$filt);
$filt=eregi_replace(quotemeta("[/b]"),quotemeta("</b>"),$filt);
$filt=eregi_replace(quotemeta("[i]"),quotemeta("<i>"),$filt);
$filt=eregi_replace(quotemeta("[/i]"),quotemeta("</i>"),$filt);
$filt=eregi_replace(quotemeta("[u]"),quotemeta("<u>"),$filt);
$filt=eregi_replace(quotemeta("[/u]"),quotemeta("</u>"),$filt);
// URL
$filt=eregi_replace("http://","",$filt);
$filt=eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"http://\\1\" target=_blank>\\1</a>",$filt);
// Email
$filt=eregi_replace("\\[email\\]([^\\[]*)\\[/email\\]","<a href=\"mailto:\\1\">\\1</a>",$filt);
// Replace newline by <br>
$filt=nl2br($filt);
$filt=eregi_replace("<br />","<br>",$filt);
return $filt;
}
//Reverse filtering of the messages
function backhtmlfilt($filt,$nb_icons) {
//<br> to newline
$filt=eregi_replace("<br>","",$filt);
//email
$filt=eregi_replace("<a href=\"mailto:([^\\[<]*)\">([^\\[<]*)</a>","[email]\\1[/email]",$filt);
$filt=eregi_replace("<a href=\"http://([^\\[<]*)\" target=_blank>([^\\[<]*)</a>","[url]\\1[/url]",$filt);
// Simplified HTML
$filt=eregi_replace(quotemeta("<b>"),"[b]",$filt);
$filt=eregi_replace(quotemeta("</b>"),"[/b]",$filt);
$filt=eregi_replace(quotemeta("<i>"),"[i]",$filt);
$filt=eregi_replace(quotemeta("</i>"),"[/i]",$filt);
$filt=eregi_replace(quotemeta("<u>"),"[u]",$filt);
$filt=eregi_replace(quotemeta("</u>"),"[/u]",$filt);
// changing the icons text to images
for($i=1;$i<=$nb_icons;$i++){
$filt=eregi_replace("<img src=\"icons_board/icon$i.gif\" border=\"0\" alt=\"icon\">","/ICONBOARD".$i."/",$filt);
}
$filt=eregi_replace("<","<",$filt);
$filt=eregi_replace(">",">",$filt);
return $filt;
}
function tr_color($i){
if($i/2 != ceil($i/2)){
print("<tr class=\"row1\">\n");
}else{
print("<tr class=\"row2\">\n");
}
}