<?
DEFINE ('MOBILEBB', true);
$dbhost='localhost'; // input here host name
$dbname='mobilebb'; // input here database name
$dbuser='sqlusername'; // input here mySQL user name
$dbpass='sqlpassword'; // input here mySQL password
$shaprefix = 'input any blowish word.';
// @mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error: No MySQL connection.');
// @mysql_connect($dbhost, $dbuser, $dbpass, FALSE, MYSQL_CLIENT_COMPRESS) or die(header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error - no database link.', true, 500));
@mysql_connect($dbhost, $dbuser, $dbpass, FALSE, MYSQL_CLIENT_COMPRESS) or die('Error: No MySQL DB link or service is under maintain.');
@mysql_select_db($dbname) or die ('Error: MySQL DB is missing.');
$board_title = 'MobileBB';
$forum_home = 'http://example.org/'; // WWW - don't forget last character must be /
$page_title='MobileBB - please change page_title';
$page_desc='';
$modrewrite = false; // SEO links in htaccess. Most free hosting will not work !
$topicsperpage=15; // pagination
$startfrom=0; // pagination count - for debug only
$user_id=0; // default user for guests
$subscribe= false; // force user to subcribe in topic when any reply.
$registermode=0; // during register new user, 0 - auto active, 1 - activate link will be send via email , 2 - never activate as lockdown or manual
$ads_intopic = false; // place ads file for replied topic.
$spam_maxpostlength = 12000; // limit post size
$spam_maxmailboxperhost = 25; // limit mailbox count per host ISP during registartion
$spam_maxmailboxperip = 10; // limit mailbox count per IP during registration
$spam_treshold = 25; // limit in seconds between submit to treshold spam
$spam_sec_num = true; // spam proteciton numeric captcha feature
$spam_maxwordlength = 30;
// -----------------------------------------------------------------------------
$row_colors = array(0=>"even",1=>"odd");
$row_color = true;
if(!get_magic_quotes_gpc())
{
$_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
else
{
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
$_COOKIE = array_map('stripslashes', $_COOKIE);
$_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
// PHP 5.3 check due goto feature we use instead of loop
goto php5check;
echo '<li> PHP5CHECK: Failed - PHP version<5.3 problem. halt.<br>';exit;
php5check:
// mail wrapper to remote mail call over curl when php host can't do native mail
function sendmail($to,$subject,$message,$headers)
{
mail ($to,$subject,$message,$headers);
// echo "To: $to, Subject: $subject, $message<br>"; // display mail syntax
// $curl_url = "exmaple.org?to=$to&subjet=$subject...";
} // function sendmail
function email2name($email)
{
$email=explode ("@",$email);
return $email[0];
} // function email2name
function email2host($email)
{
$email=explode ("@",$email);
return $email[1];
} // function email2name
function get_username($id)
{
$result = mysql_query("SELECT user_email from board_users WHERE user_id='$id' limit 1") or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
return email2name($row['user_email']);
}
} // function getusername
function get_topic_path($id)
{
$id=array ('id' => $id);
/* // ooops. too deep lookup from comment/post instead of topic level.
$result = mysql_query("SELECT post_parent_id from board_comments WHERE post_id='".$id['id']."' limit 1") or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
$id['post_parent_id']=$row['post_parent_id'];
} // while row
*/
$result = mysql_query("SELECT topic_id,topic_parent,topic_title from board_topics WHERE topic_id='".$id['id']."' limit 1") or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
$id['topic_id']=$row['topic_id'];
$id['topic_parent']=$row['topic_parent'];
$id['topic_title']=$row['topic_title'];
} // while row
$result = mysql_query("SELECT forum_id,forum_name from board_forums WHERE forum_id='".$id['topic_parent']."' limit 1") or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
$id['forum_id']=$row['forum_id'];
$id['forum_name']=$row['forum_name'];
} // while row
$id['html']="<div class='forumpath'>Your are here: <a href='?'>Home</a> > <a href='?action=vforum&id=".$id['forum_id']."'>".$id['forum_name']."</a> > <a href='?action=vtopic&id=".$id['topic_id']."'>".$id['topic_title']."</a></div><br>";
return ($id['html']);
unset ($id);
} // get topic path end
function get_topic_title($id)
{
$result = mysql_query("SELECT topic_title from board_topics WHERE topic_id='$id' limit 1") or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
return ($row['topic_title']);
}
} // function getusername
function is_topiclocked($id)
{
$locked= true;
$result = mysql_query("SELECT topic_locked from board_topics WHERE topic_id='".$id."' limit 1") or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
$locked=$row['topic_locked'];
} // while
return ($locked);
} // is topic locked end checker
function is_forumlocked($id)
{
$locked= true;
$result = mysql_query("SELECT forum_locked from board_forums WHERE forum_id='".$id."' limit 1") or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
$locked=$row['forum_locked'];
} // while
return ($locked);
} // is topic locked end checker