Location: PHPKode > scripts > MobileBB > mobilebb_2.9.7/mobilebb/index.php
// error_reporting(0);
include './include/config.php';
include './include/language.php';
include './include/spam.php';
echo chr(60).chr(63);
* MobileBB - Copyright Tomasz Malewski - 2012 - varsovie()o2.pl
* https://sourceforge.net/projects/mobilebb
* go to ./include/config.php and set database connection settings.
* then ./include/install.php will insert tables and one admin account.
?>xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<link rel="stylesheet" type="text/css" href="./mobilebb-droid.css"/>
<link rel="stylesheet" type="text/css" href="./style.css"/>
<link rel="shortcut icon" href="/favicon.ico"/>
if(!isset($_GET['action'])) $_GET["action"]='vforum';
$page_title_prefix = '';
if ($_GET['action']=='vtopic') {
	if(isset($_GET['id'])) {
		$id=substr($_GET["id"],0,7);	// for purity
		$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))
			$page_title_prefix = $row['topic_title'].' / ';
			$page_desc = $row['topic_title'].' / ';
			}	// wile row
		}	//if isset get id 
	}	// if get action vtopic
?><title><? echo $page_title_prefix.' '.$board_title;?></title>
<meta name="title" content="<? echo $page_title_prefix.' '.$page_title;?>"/>
<meta name="Description" content="<? echo $page_desc;?>"/>
<meta name="Keywords" content=""/>
<meta name="SearchTitle" content=""/>
<meta name="SearchDescription" content=""/>
<meta http-equiv="cache-control" content="Public"/>
<meta name="cultureCode" content="en-us"/>
<meta name="direction" content="ltr"/>
<meta name="revisit-after" content="5 days"/>
<meta name="robots" content="index, follow"/>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
$user_id = false;
$user_level = 0;
$user_ip = $_SERVER["REMOTE_ADDR"];
if (isset($_COOKIE['email']) && isset($_COOKIE['password'])) {
	$result = mysql_query("select user_id,user_email,user_level from board_users where `user_email`='".$_COOKIE['email']."' and user_locked=0 and user_pass='".sha1($shaprefix.$_COOKIE['password'])."' limit 1"); // or die(mysql_error());
	if (mysql_num_rows($result)==1) 	
		$row = mysql_fetch_assoc($result);
		mysql_query("UPDATE board_users set `user_lastlogin_dt`='".(time()+(60*15))."' where user_id='".$user_id."' and `user_lastlogin_dt`<'".time()."' LIMIT 1") or die(mysql_error());	// we put date in future to track [NEW] topics in last session.
		} 	// if mysql_num_rows
	}	// if isset cookie

echo "<div class='top'><a href='?'><img src='./images/logo.gif' align='left' alt='logo'/>".$board_title."</a>";
if ($user_level==9) echo ' | <a href=\'?action=admin\'><font color=red> Configure Panel</font></a>';
echo "<strong> <a href='?action=search'>Search</a> | ";
if ($user_id==0)
	echo "<a href='?action=register'>Register</a> | <a href='?action=login'>Login</a></strong>";
	echo "<a href='?action=logout'> Logout ".email2name($user_email)."</a></strong>";
	}	// if user_id==0
echo "</div>\r\n<br/><br/>";

if ($user_level==1) { echo '<div class="notice">User account is not activated yet. Please check mailbox / spam.</div>'; }

// we ban every user who try to manipulate forms
if (isset($_POST['seccodeverify']) && $user_id>0) 
	if ( strlen($_POST['seccodeverify'])>0 ) 
		mysql_query ("UPDATE board_users SET `user_locked`=1 where `user_id`='".$user_id."' limit 1") or die(mysql_error());
		echo "<div class=error>Your account was banned.</div>";exit;
		}	// if strlen
	} // if isset post seccodeverify

switch ($_GET['action']) {
    case "activate": include 'register.php'; break;
    case "admin": include './include/admin.php'; break;
    case "forgot": include 'login.php'; break;
    case "login": include 'login.php'; break;
    case "logout": include 'logout.php'; break;
    case "register": include 'register.php'; break;
    case "search": include 'search.php'; break;
    case "vforum": include 'vforum.php'; break;
    case "vtopic": include 'vtopic.php'; break;
    default: include 'vforum.php';
	}	// switch

echo "<br><div class=disabled> Powered by MobileBB 2.9.7</div>";
//echo memory_get_usage() . "\n";
Return current item: MobileBB