#################################################################################################
#
# project : phpBook
# filename : config.php
# version : 1.50
# last modified by : Erich Fuchs
# e-mail : office@smartisoft.com
# purpose : Configuration File
# last modified : 10/26/2002
#
#################################################################################################
// mySql Configuration
$server = "localhost"; // Your mySQL Server, most cases "localhost"
$db_user = "web110"; // Your mySQL Username
$db_pass = "bwthx0"; // Your mySQL Password
$database = "usr_web110_1"; // Database Name
// GB Parameters
$adminpass = "killorama4ever"; // Password for Administration
$guestbook_head = "kill the book!!!"; // Guestbook Header (Name)
$gb_desc = "if there's a guestbook that sucks, here it is!";// Enter your description here
$url_to_start = "http://www.killorama.de/killbook.php"; // NO trailing slashes
$gb_notify = "killbook@killorama.de"; // leave it empty -> disable notify
$language = "killorama.php"; // for e.g. German enter german.php (see languages sub-dir)
$locations = "worldlong.inc"; // for e.g. Europe enter europe.inc (see locations sub-dir)
$lang_dir = "guestbook/languages"; // Language Directory, no trailing slashes
$loc_dir = "guestbook/locations"; // Locations Directory, no trailing slashes
$image_dir = "guestbook/images"; // Image Directory, no trailing slashes
$limit = array(5 ,1000); // Message Limits (min,max)
$timelimit = "30"; // Submit timeout in minutes (Cookiebanning), disabled if "";
$perpage = "8"; // how much Entry's per page
$pperpage = "9"; // how much PageBreak's per page, should be like 5,7,9,11,13
$table_width = "100%"; // enter value in pix (e.g. "600") or in % (e.g. "80%")
$table_height = ""; // "" means the table is variable
$table_align = "center";
$dateformat = "eu"; // for european Date&Time-Format enter "eu"
$book_version = "1.50"; // DO NOT CHANGE THIS
$show_sysinfo = true; // show the systeminformation on every bottom page
$supportpwd = ""; // pwd for support-info, paranoid-setting is ""
#################################################################################################
# End Configuration
#################################################################################################
#
# !!! DO NOT EDIT ANYTHING BEHIND THIS LINE !!!
#
#################################################################################################
error_reporting(E_ALL & ~(E_WARNING | E_NOTICE));
require ("$lang_dir/$language");
require ("$lang_dir/admin.php");
# Functions
#################################################################################################
function str_repeats($input, $mult) {
$ret = "";
while ($mult > 0) {
$ret .= $input;
$mult --;
}
return $ret;
}
function died($message) { //when we die, than with a nice screen ;-) // tbd. NOT nice yet :-) btw. maybe next releases
echo $message;
exit;
}
function isbanned() {
global $REMOTE_ADDR,$database;
$ban_query = mysql_db_query($database, "SELECT * FROM banned_ips") or died("Database Query Error");
while ($ip = mysql_fetch_row($ban_query)) {
if ($ip["0"] == $REMOTE_ADDR) {
return 1;
exit;
}
}
return 0;
}
function encode_msg ($msg) {
global $image_dir,$database;
if ($msg) {
$msg = str_replace("\r", "", $msg); // Replace carrige return
$msg = str_replace("\n", "
", $msg); // Replace newline with
$result = mysql_db_query($database, "SELECT * FROM smilies") or died("Query Error");
while ($db = mysql_fetch_array($result)) {
$msg = str_replace($db[code], "", $msg); // Smilie
}
}
return $msg;
}
function urlcode_msg($msg) {
if (get_magic_quotes_gpc()!=1) { $msg=addslashes($msg); }
$msg = nl2br($msg);
## selbst reingemacht
$msg = str_replace("
", "", "$msg");
$msg = stripslashes($msg);
## Ende selbst reingemacht
$msg = ereg_replace("javascript","",$msg);
$msg = eregi_replace(quotemeta("[b]"),quotemeta(""),$msg);
$msg = eregi_replace(quotemeta("[/b]"),quotemeta(""),$msg);
$msg = eregi_replace(quotemeta("[i]"),quotemeta(""),$msg);
$msg = eregi_replace(quotemeta("[/i]"),quotemeta(""),$msg);
$msg = eregi_replace(quotemeta("[u]"),quotemeta(""),$msg);
$msg = eregi_replace(quotemeta("[/u]"),quotemeta(""),$msg);
$msg = eregi_replace("\\[url\\]www.([^\\[]*)\\[/url\\]", "\\1",$msg);
$msg = eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","\\1",$msg);
$msg = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","\\2",$msg);
$msg = eregi_replace("\\[email\\]([^\\[]*)\\[/email\\]", "\\1",$msg);
$msg = eregi_replace("\\[img\\]([^\\[]*)\\[/img\\]","",$msg);
$msg = eregi_replace("\\[swf width=([^\\[]*) height=([^\\[]*)\\]([^\\[]*)\\[/swf\\]","", $msg);
return $msg;
}
function wordwrap_msg($msg, $maxwordlen=45) { //Wert geändert von AS, Standard : 50
$eachword = explode(" " , eregi_replace("
"," ",$msg));
for ($i=0; $i$maxwordlen) {
$msg = eregi_replace($eachword[$i], chunk_split($eachword[$i],$maxwordlen), $msg);
}
}
return $msg;
}
function censor_msg($msg, $admin=0) { // Badword-Replacement
global $database;
$msg= urlcode_msg($msg);
$msg= wordwrap_msg($msg);
$eachword = explode(" " , eregi_replace("
"," ",$msg)); // temp remove
$result = mysql_db_query($database, "SELECT * FROM badwords") or died("Query Error");
while ($db = mysql_fetch_array($result)) {
for ($i=0; $i".$eachword[$i]."", stripslashes($msg)); // Badword
} else {
$msg = eregi_replace($eachword[$i], str_repeats("*", strlen($eachword[$i])), stripslashes($msg)); // Badword
}
}
}
}
return $msg;
}
function decode_msg ($msg) {
global $image_dir,$database;
if ($msg) {
$msg = str_replace("
", "\n", $msg); // Replace newline with
$result = mysql_db_query($database, "SELECT * FROM smilies") or died("Query Error");
while ($db = mysql_fetch_array($result)) {
$msg = str_replace("",$db[code],$msg); // Smilie
}
}
return $msg;
}
function strip_array ($in) { //foreach()-Replacement !!!
reset($in);
while ($array=each($in)) {
$ckey=$array['key'];
$cvalue=$array['value'];
$cvalue = str_replace("'", "''", $cvalue);
$cvalue = stripslashes($cvalue);
$cvalue = strip_tags($cvalue);
$out[$ckey] = $cvalue;
}
return $out;
}
#################################################################################################
# EOF
?>