• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTForum! 1.0 Beta

can someone tell me what I'm doing wrong :(

I keep getting a blank page ;o

I've installed all :<
 
well i guess it has to do something with index.php

whenever i try to edit any names or add new lines it doesn't show up on the website

weird... :(
 
Oo! i only have a fail:

Warning: mysql_connect() [function.mysql-connect]: Access den
 
Sorry, cant edit....
Complete file:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\forum\config.php on line 25
 
Sorry, cant edit....
Complete file:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\forum\config.php on line 25

You gave wrong login or password in config.php in folder forum/
 
The forum works perfectly so I suppose that this error does not matter.
But this error is ugly for the web.
 
PHP:
<?PHP
//start :)
//phpinfo();
//exit;
session_start();
ob_start("ob_gzhandler");
//require('./exaBD.php');
function microtime_float()
{
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}
$time_start = microtime_float();
//##### CONFIG #####
include('config-and-functions.php');
$action = $_REQUEST['action'];
//##### LOGOUT #####
if($action == "logout") {
unset($_SESSION['account']);
unset($_SESSION['password']);
}
//##### LOGIN #####
//check is player logged
$logged = FALSE;
if(isset($_SESSION['account'])) {
	$account_logged = $ots->createObject('Account');
	$account_logged->load($_SESSION['account']);
	if($account_logged->isLoaded() && $account_logged->getPassword() == $_SESSION['password']) {
		$logged = TRUE;
		$group_id_of_acc_logged = $account_logged->getPageAccess();
	}
	else
	{
		$logged = FALSE;
		unset($_SESSION['account']);
		unset($account_logged);
	}
}
//login with data from form
$login_account = strtoupper(trim($_POST['account_login']));
$login_password = trim($_POST['password_login']);
if(!$logged && !empty($login_account) && !empty($login_password))
{
	$login_password = password_ency($login_password);
	$account_logged = $ots->createObject('Account');
	$account_logged->find($login_account);
	if($account_logged->isLoaded())
	{
		if($login_password == $account_logged->getPassword())
		{
			$_SESSION['account'] = $account_logged->getId();
			$_SESSION['password'] = $login_password;
			$logged = TRUE;
			$account_logged->setCustomField("page_lastday", time());
			$group_id_of_acc_logged = $account_logged->getPageAccess();
		} else
			$logged = FALSE;
	}
}
//#### LOAD PAGE ##########
//load subtopic page
if(empty($_REQUEST['subtopic'])) {
	$_REQUEST['subtopic'] = "latestnews";
	$subtopic = "latestnews";
}
switch($_REQUEST['subtopic']) {
	case "paypal";
		$subtopic = "paypal";
		$topic = "Paypal";
		include("paypal.php");
	break;

 	case "bugtracker";
  	        $topic = "Bug Tracker";
 	        $subtopic = "bugtracker";
 	        include("bug.php");
	break;  

  	case "polls";
		$topic = "Polls";
		$subtopic = "polls";
		include("polls.php");
	break; 	

	case "changelog";
   		 $topic = "Changelog";
  		 $subtopic = "changelog";
  		 include("changelog.php");
	break;  

  	case "bans":
 	         $topic = "Banishments";
    	         $subtopic = "bans";
    		 include("bans.php");
 	break;  

  	case "signature":
 	         $topic = "Signature";
    	         $subtopic = "signature";
    		 include("signature.php");
 	break; 

  	case "signatures":
 	         $topic = "Signature Generator";
    	         $subtopic = "signatures";
    		 include("signatures.php");
 	break; 

  	case "shopadmin":
 	        $topic = "Shopadmin";
    	        $subtopic = "shopadmin";
    		include("shopadmin.php");
 	break; 

	case "latestnews":
		$topic = "Latest News";
		$subtopic = "latestnews";
		include("latestnews.php");
	break;

        case "board";
        $subtopic = "board";
        $topic = "Forums Board";
        include("forum/board.php");
    
        break;
    
        case "thread";
        $subtopic = "thread";
        $topic = "Forums Board";
        include("forum/thread.php");
    
        break;
	
	case "creatures";
		$topic = "Creatures";
		$subtopic = "creatures";
		include("creatures.php");
	break;

	case "spells";
		$topic = "Spells";
		$subtopic = "spells";
		include("spells.php");
	break;
	
	case "experiencetable";
		$topic = "Experience Table";
		$subtopic = "experiencetable";
		include("experiencetable.php");
	break;
	
	case "characters";
		$topic = "Characters";
		$subtopic = "characters";
		include("characters.php");
	break;
	
	case "whoisonline";
		$topic = "Who is online?";
		$subtopic = "whoisonline";
		include("whoisonline.php");
	break;
	
	case "highscores";
		$topic = "Highscores";
		$subtopic = "highscores";
		include("highscores.php");
	break;
	
	case "killstatistics";
		$topic = "Last Kills";
		$subtopic = "killstatistics";
		include("killstatistics.php");
	break;
	
	case "houses";
		$topic = "Houses";
		$subtopic = "houses";
		include("houses.php");
	break;
	
	case "guilds";
		$topic = "Guilds";
		$subtopic = "guilds";
		include("guilds.php");
	break;
	
	case "accountmanagement";
		$topic = "Account Management";
		$subtopic = "accountmanagement";
		include("accountmanagement.php");
	break;
	
	case "createaccount";
		$topic = "Create Account";
		$subtopic = "createaccount";
		include("createaccount.php");
	break;
	
	case "lostaccount";
		$topic = "Lost Account Interface";
		$subtopic = "lostaccount";
		include("lostaccount.php");
	break;

	case "tibiarules";
		$topic = "Server Rules";
		$subtopic = "tibiarules";
		include("tibiarules.php");
	break;

	case "adminpanel":
		$topic = "Admin Panel";
		$subtopic = "adminpanel";
		include("adminpanel.php");
	break;
	
	case "forum":
		$topic = "Forum";
		$subtopic = "forum";
		include("forum/forum.php");
	break;
	
	case "team";
		$subtopic = "team";
		$topic = "Gamemasters List";
		include("team.php");
	break;

	case "downloads";
		$subtopic = "downloads";
		$topic = "Downloads";
		include("downloads.php");
	break;

	case "serverinfo";
		$subtopic = "serverinfo";
		$topic = "Server Info";
		include("serverinfo.php");
	break;

	case "shopsystem";
		$subtopic = "shopsystem";
		$topic = "Shop System";
		include("shopsystem.php");
	break;
	
	case "buypoints";
		$subtopic = "buypoints";
		$topic = "Buy Points";
		include("buypoints.php");
	break;

	case "gallery";
		$subtopic = "gallery";
		$topic = "Gallery";
		include("gallery.php");
	break;
	
	case "namelock";
		$subtopic = "namelock";
		$topic = "Namelock Manager";
		include("namelocks.php");
	break;
	
	case "archive";
		$subtopic = "archive";
		$topic = "News Archives";
		include("archive.php");
	break;
}
//generate title of page
if(empty($topic)) {
$title = $GLOBALS['config']['server']["serverName"]." - OTS";
$main_content .= 'Invalid subtopic. Can\'t load page.';
}
else
{
$title = $GLOBALS['config']['server']["serverName"]." - ".$topic;
}
//#####LAYOUT#####

$layout_header = '<script type=\'text/javascript\'>
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function MouseOverBigButton(source)
{
  source.firstChild.style.visibility = "visible";
}
function MouseOutBigButton(source)
{
  source.firstChild.style.visibility = "hidden";
}
function BigButtonAction(path)
{
  window.location = path;
}
var';
if($logged) { $layout_header .= "loginStatus=1; loginStatus='true';"; } else { $layout_header .= "loginStatus=0; loginStatus='false';"; };
$layout_header .= "var activeSubmenuItem='".$subtopic."';  var IMAGES=0; IMAGES='".$config['server']['url']."/".$layout_name."/images'; var LINK_ACCOUNT=0; LINK_ACCOUNT='".$config['server']['url']."';</script>";
include($layout_name."/layout.php");
ob_end_flush();
?>

This would be the first time i use a website properly :(

cheers!
 
Try mine:

PHP:
<?PHP
//start :)
//phpinfo();
//exit;
session_start();
ob_start("ob_gzhandler");
//require('./exaBD.php');
function microtime_float()
{
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}
$time_start = microtime_float();
//##### CONFIG #####
include('config-and-functions.php');
$action = $_REQUEST['action'];
//##### LOGOUT #####
if($action == "logout") {
unset($_SESSION['account']);
unset($_SESSION['password']);
}
//##### LOGIN #####
//check is player logged
$logged = FALSE;
if(isset($_SESSION['account'])) {
	$account_logged = $ots->createObject('Account');
	$account_logged->load($_SESSION['account']);
	if($account_logged->isLoaded() && $account_logged->getPassword() == $_SESSION['password']) {
		$logged = TRUE;
		$group_id_of_acc_logged = $account_logged->getPageAccess();
	}
	else
	{
		$logged = FALSE;
		unset($_SESSION['account']);
		unset($account_logged);
	}
}
//login with data from form
$login_account = strtoupper(trim($_POST['account_login']));
$login_password = trim($_POST['password_login']);
if(!$logged && !empty($login_account) && !empty($login_password))
{
	$login_password = password_ency($login_password);
	$account_logged = $ots->createObject('Account');
	$account_logged->find($login_account);
	if($account_logged->isLoaded())
	{
		if($login_password == $account_logged->getPassword())
		{
			$_SESSION['account'] = $account_logged->getId();
			$_SESSION['password'] = $login_password;
			$logged = TRUE;
			$account_logged->setCustomField("page_lastday", time());
			$group_id_of_acc_logged = $account_logged->getPageAccess();
		} else
			$logged = FALSE;
	}
}
//#### LOAD PAGE ##########
//load subtopic page
if(empty($_REQUEST['subtopic'])) {
	$_REQUEST['subtopic'] = "latestnews";
	$subtopic = "latestnews";
}
switch($_REQUEST['subtopic']) {
	case "latestnews":
		$topic = "Latest News";
		$subtopic = "latestnews";
		include("latestnews.php");
	break;
	
	case "creatures";
		$topic = "Creatures";
		$subtopic = "creatures";
		include("creatures.php");
	break;
	
	case "spells";
		$topic = "Spells";
		$subtopic = "spells";
		include("spells.php");
	break;
	
	case "experiencetable";
		$topic = "Experience Table";
		$subtopic = "experiencetable";
		include("experiencetable.php");
	break;
	
	case "characters";
		$topic = "Characters";
		$subtopic = "characters";
		include("characters.php");
	break;
	
	case "whoisonline";
		$topic = "Who is online?";
		$subtopic = "whoisonline";
		include("whoisonline.php");
	break;
	
	case "highscores";
		$topic = "Highscores";
		$subtopic = "highscores";
		include("highscores.php");
	break;
	
	case "killstatistics";
		$topic = "Last Kills";
		$subtopic = "killstatistics";
		include("killstatistics.php");
	break;
	
	case "houses";
		$topic = "Houses";
		$subtopic = "houses";
		include("houses.php");
	break;
	
	case "guilds";
		$topic = "Guilds";
		$subtopic = "guilds";
		include("guilds.php");
	break;
	
	case "accountmanagement";
		$topic = "Account Management";
		$subtopic = "accountmanagement";
		include("accountmanagement.php");
	break;
	
	case "createaccount";
		$topic = "Create Account";
		$subtopic = "createaccount";
		include("createaccount.php");
	break;
	
	case "lostaccount";
		$topic = "Lost Account Interface";
		$subtopic = "lostaccount";
		include("lostaccount.php");
	break;

	case "tibiarules";
		$topic = "Server Rules";
		$subtopic = "tibiarules";
		include("tibiarules.php");
	break;

	case "adminpanel":
		$topic = "Admin Panel";
		$subtopic = "adminpanel";
		include("adminpanel.php");
	break;
	
	case "forum":
		$topic = "Forum";
		$subtopic = "forum";
		include("forum/forum.php");
	break;
	
	case "team";
		$subtopic = "team";
		$topic = "Gamemasters List";
		include("team.php");
	break;

	case "downloads";
		$subtopic = "downloads";
		$topic = "Downloads";
		include("downloads.php");
	break;

	case "serverinfo";
		$subtopic = "serverinfo";
		$topic = "Server Info";
		include("serverinfo.php");
	break;

	case "shopsystem";
		$subtopic = "shopsystem";
		$topic = "Shop System";
		include("shopsystem.php");
	break;
	
	case "buypoints";
		$subtopic = "buypoints";
		$topic = "Buy Points";
		include("buypoints.php");
	break;

	case "gallery";
		$subtopic = "gallery";
		$topic = "Gallery";
		include("gallery.php");
	break;
	
	case "namelock";
		$subtopic = "namelock";
		$topic = "Namelock Manager";
		include("namelocks.php");
	break;
	
	case "archive";
		$subtopic = "archive";
		$topic = "News Archives";
		include("archive.php");
	break;
	
	case "board";
		$subtopic = "board";
		$topic = "Forums Board";
		include("forum/board.php");
	break;
	
	case "thread";
		$subtopic = "thread";
		$topic = "Forums Board";
		include("forum/thread.php");
	break;
	
}
//generate title of page
if(empty($topic)) {
$title = $GLOBALS['config']['server']["serverName"]." - OTS";
$main_content .= 'Invalid subtopic. Can\'t load page.';
}
else
{
$title = $GLOBALS['config']['server']["serverName"]." - ".$topic;
}
//#####LAYOUT#####

$layout_header = '<script type=\'text/javascript\'>
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function MouseOverBigButton(source)
{
  source.firstChild.style.visibility = "visible";
}
function MouseOutBigButton(source)
{
  source.firstChild.style.visibility = "hidden";
}
function BigButtonAction(path)
{
  window.location = path;
}
var';
if($logged) { $layout_header .= "loginStatus=1; loginStatus='true';"; } else { $layout_header .= "loginStatus=0; loginStatus='false';"; };
$layout_header .= "var activeSubmenuItem='".$subtopic."';  var IMAGES=0; IMAGES='".$config['server']['url']."/".$layout_name."/images'; var LINK_ACCOUNT=0; LINK_ACCOUNT='".$config['server']['url']."';</script>";
include($layout_name."/layout.php");
ob_end_flush();
?>
 
LoL! Check the error:

PHP:
//Host of your database
$dbhost = "localhost";
//Login yo your database
$dblogin = "root";
//Password to your database
$dbpass = "XXX";
//Name of your dataabse
$dbname = "XXX";
//Set to true when you configure everything, the forum will start working.
$install = true;
And no run, but if i put false in $install = true; it run.
 
Yay thanks, it is great!
Only one thing: it should load colors from layout config, not have fixed ones.
Anyway rep is going!!
 
Aehm sorry bro :( I'm such an dummy :d

see this line

//Set to true when you configure everything, the forum will start working.
$install = false;

i thought it mean to change it from false to true after i put all details for it to work, my mistake :( has to be false "install" :p


Thanks! :p
 
@forgot to add

People that don't know how to add new boards or re-name the first one

go to phpmyadmin, then to your db, then forums table

then in sql type this to add new board

INSERT INTO `forums` (`id`, `name`, `description`, `closed`, `access`) VALUES
(3, 'Sanura', 'Help.', 0, 0)

just change Sanura to board name and help to description

and ofc 3/4/5 etc are the ids.

not sure if Paxton already said this before :( didn't read the whole thread :p
 

Similar threads

Back
Top