• 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

Paxton - Victor is actually right on this one. Add an exclamation mark in front of the variable.
Like so.
PHP:
if(!$install) exit;

btw, how your and marcinek paladinek's~(rudolf c~, emma watson) forum going?
 
btw, how your and marcinek paladinek's~(rudolf c~, emma watson) forum going?
We're actually working on different forums, he's making one for Gesior's Account Manager and I'm just making a general forum (Progress can be seen on MadPHP.org , although it is currently postponed due to another project ;_) which I won't be going into~).
 
PHP:
CREATE TABLE IF NOT EXISTS `posts` ( 
  `id` int(11) NOT NULL auto_increment, 
  `title` varchar(255) default NULL, 
  `icon` int(5) default NULL, 
  `date` varchar(45) default NULL, 
  `time` varchar(30) default NULL, 
  `author` varchar(30) default NULL, 
  `board` int(5) default NULL, 
  `thread` int(20) default NULL, 
  `post` text, 
  `signature` int(5) default NULL, 
  PRIMARY KEY  (`id`) 
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 

CREATE TABLE IF NOT EXISTS `threads` ( 
  `id` int(11) NOT NULL auto_increment, 
  `name` varchar(255) default NULL, 
  `icon` int(5) default NULL, 
  `closed` int(5) default NULL, 
  `stick` int(5) NOT NULL, 
  `date` varchar(45) default NULL, 
  `time` varchar(30) default NULL, 
  `author` varchar(30) default NULL, 
  `board` int(5) default NULL, 
  `views` int(20) default NULL, 
  `last` int(40) default NULL, 
  PRIMARY KEY  (`id`) 
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1; 

CREATE TABLE IF NOT EXISTS `forums` ( 
  `id` int(11) NOT NULL auto_increment, 
  `name` varchar(255), 
  `description` text, 
  `closed` int(5) default NULL, 
  `access` int(5) NOT NULL, 
  PRIMARY KEY  (`id`) 
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 

-- 
-- Zrzut danych tabeli `forums` 
-- 

INSERT INTO `forums` (`id`, `name`, `description`, `closed`, `access`) VALUES 
(2, 'First forum.', 'This is your first forum.', 0, 0);

I must all cimport to database?
 
PHP:
CREATE TABLE IF NOT EXISTS `posts` ( 
  `id` int(11) NOT NULL auto_increment, 
  `title` varchar(255) default NULL, 
  `icon` int(5) default NULL, 
  `date` varchar(45) default NULL, 
  `time` varchar(30) default NULL, 
  `author` varchar(30) default NULL, 
  `board` int(5) default NULL, 
  `thread` int(20) default NULL, 
  `post` text, 
  `signature` int(5) default NULL, 
  PRIMARY KEY  (`id`) 
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 

CREATE TABLE IF NOT EXISTS `threads` ( 
  `id` int(11) NOT NULL auto_increment, 
  `name` varchar(255) default NULL, 
  `icon` int(5) default NULL, 
  `closed` int(5) default NULL, 
  `stick` int(5) NOT NULL, 
  `date` varchar(45) default NULL, 
  `time` varchar(30) default NULL, 
  `author` varchar(30) default NULL, 
  `board` int(5) default NULL, 
  `views` int(20) default NULL, 
  `last` int(40) default NULL, 
  PRIMARY KEY  (`id`) 
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1; 

CREATE TABLE IF NOT EXISTS `forums` ( 
  `id` int(11) NOT NULL auto_increment, 
  `name` varchar(255), 
  `description` text, 
  `closed` int(5) default NULL, 
  `access` int(5) NOT NULL, 
  PRIMARY KEY  (`id`) 
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 

-- 
-- Zrzut danych tabeli `forums` 
-- 

INSERT INTO `forums` (`id`, `name`, `description`, `closed`, `access`) VALUES 
(2, 'First forum.', 'This is your first forum.', 0, 0);

I must all cimport to database?

Yes, you do.
 
Paxton, great job like I said before. Are you planning for any other releases also? Like so you'll be able to edit your posts, forum pictures support etc.
 
Emma Watson said they are doing they own one, so I think there is no point.

But I'll think about it, and I would need to rewrite the hole code for better quality.

I'm in development of something else now :):thumbup:
 
Emma Watson said they are doing they own one, so I think there is no point.

But I'll think about it, and I would need to rewrite the hole code for better quality.

I'm in development of something else now :):thumbup:

I can PM to you what Ive done, which is not that much, since I think we will work on MadAAC with Chris, his old project, so the forum will be written for this one.
 
I can PM to you what Ive done, which is not that much, since I think we will work on MadAAC with Chris, his old project, so the forum will be written for this one.
>: ( which part of 'which I won't be going into~' don't you understand noob >: (
 
Paxton say me say me if good mum php ?

There are my php files.

index.php
PHP:
<?PHP
//start :)
session_start();
ob_start("ob_gzhandler");
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->getCustomField("page_access");
	}
	else
	{
		$logged = FALSE;
		unset($_SESSION['account']);
		unset($account_logged);
	}
}
//login with data from form
$login_account = trim($_POST['account_login']);
$login_password = trim($_POST['password_login']);
if(!$logged && !empty($login_account) && !empty($login_password)) {
	if(!is_numeric($login_account)) {
		$show_msgs[] = "Login account is not numeric.";
	}
	if(!check_password($login_password)) {
		$show_msgs[] = "Login password contains illegal chars or lenght.";
	}
	$login_password = password_ency($login_password);
	if(empty($show_errors)) {
		$account_logged = $ots->createObject('Account');
		$account_logged->load($login_account);
		if($account_logged->isLoaded()) {
			if($login_password == $account_logged->getPassword()) {
				$_SESSION['account'] = $login_account;
				$_SESSION['password'] = $login_password;
				$logged = TRUE;
				$account_logged->setCustomField("page_lastday", time());
				$group_id_of_acc_logged = $account_logged->getCustomField("page_access");
			} 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 "test";
        $subtopic = "test";
        $topic = "Tutor Test";
        include("test.php");
    break; 

	case "wars";
		$subtopic = "wars";
		$topic = "Wars";
		include("wars.php");
	break;


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

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

    case "bounty-hunters";
        $topic = "Bounty Hunters";
        $subtopic = "bounty-hunters";
        include("bounty-hunters.php");
    break; 

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

    case "polls";
        $topic = "Polls";
        $subtopic = "polls";
        include("polls.php");
    break;
	
	case "experiencetable";
		$topic = "Experience Table";
		$subtopic = "experiencetable";
		include("experiencetable.php");
	break;
	
	case "characters";
		$topic = "Characters";
		$subtopic = "characters";
		include("characters.php");
	break;

	case "stats";
		$topic = "Graphical Statistics";
		$subtopic = "stats";
		include("stats.php");
	break;
	
	case "nolife";
		$topic = "Top On-Line Time";
		$subtopic = "nolife";
		include("nolife.php");
	break;

	case "whoisonline";
		$topic = "Who is online?";
		$subtopic = "whoisonline";
		include("whoisonline.php");
	break;

	case "story";
		$topic = "Story";
		$subtopic = "story";
		include("story.php");
	break;
	
	case "highscores";
		$topic = "Highscores";
		$subtopic = "highscores";
		include("highscores.php");
	break;

	case "start";
		$topic = "How to get started?";
		$subtopic = "start";
		include("start.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 "board"; 
                $subtopic = "board"; 
                $topic = "Forums Board"; 
                include("forum/board.php"); 
        break; 
     
        case "thread"; 
                $subtopic = "thread"; 
                $topic = "Forums Board"; 
                include("forum/thread.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 "shopadmin";
    $subtopic = "shopadmin";
    $topic = "Shop Admin";
    include("shopadmin.php");
  break;  

	case "gallery";
		$subtopic = "gallery";
		$topic = "Gallery";
		include("gallery.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='http://".$_SERVER['SERVER_NAME'].$config['site']['subfolder']."/".$layout_name."/images'; var LINK_ACCOUNT=0; LINK_ACCOUNT='http://".$_SERVER['SERVER_NAME'].$config['site']['subfolder']."';</script>";
include($layout_name."/layout.php");
ob_end_flush();

?>

folder forum/ config.php
PHP:
<?
//Host of your database
$dbhost = "localhost";
//Login yo your database
$dblogin = "root";
//Password to your database
$dbpass = "my password to database";
//Name of your dataabse
$dbname = "name database";
//Set to true when you configure everything, the forum will start working.
$install = start;

//Max amount of threads per page
$max_threads = 10;
//Max amount of posts per page
$max_posts = 10;
//Name of the server
$world_name = "name world";
//Login to admin
$admin_login = "My login";
//Password to admin
$admin_password = "my password";

//Dont touch
	mysql_connect($dbhost, $dblogin, $dbpass);
	mysql_select_db($dbname);
?>

and What further? Is there all goods files? please help
 
Paxton say me say me if good mum php ?

There are my php files.

index.php
PHP:
<?PHP
//start :)
session_start();
ob_start("ob_gzhandler");
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->getCustomField("page_access");
	}
	else
	{
		$logged = FALSE;
		unset($_SESSION['account']);
		unset($account_logged);
	}
}
//login with data from form
$login_account = trim($_POST['account_login']);
$login_password = trim($_POST['password_login']);
if(!$logged && !empty($login_account) && !empty($login_password)) {
	if(!is_numeric($login_account)) {
		$show_msgs[] = "Login account is not numeric.";
	}
	if(!check_password($login_password)) {
		$show_msgs[] = "Login password contains illegal chars or lenght.";
	}
	$login_password = password_ency($login_password);
	if(empty($show_errors)) {
		$account_logged = $ots->createObject('Account');
		$account_logged->load($login_account);
		if($account_logged->isLoaded()) {
			if($login_password == $account_logged->getPassword()) {
				$_SESSION['account'] = $login_account;
				$_SESSION['password'] = $login_password;
				$logged = TRUE;
				$account_logged->setCustomField("page_lastday", time());
				$group_id_of_acc_logged = $account_logged->getCustomField("page_access");
			} 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 "test";
        $subtopic = "test";
        $topic = "Tutor Test";
        include("test.php");
    break; 

	case "wars";
		$subtopic = "wars";
		$topic = "Wars";
		include("wars.php");
	break;


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

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

    case "bounty-hunters";
        $topic = "Bounty Hunters";
        $subtopic = "bounty-hunters";
        include("bounty-hunters.php");
    break; 

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

    case "polls";
        $topic = "Polls";
        $subtopic = "polls";
        include("polls.php");
    break;
	
	case "experiencetable";
		$topic = "Experience Table";
		$subtopic = "experiencetable";
		include("experiencetable.php");
	break;
	
	case "characters";
		$topic = "Characters";
		$subtopic = "characters";
		include("characters.php");
	break;

	case "stats";
		$topic = "Graphical Statistics";
		$subtopic = "stats";
		include("stats.php");
	break;
	
	case "nolife";
		$topic = "Top On-Line Time";
		$subtopic = "nolife";
		include("nolife.php");
	break;

	case "whoisonline";
		$topic = "Who is online?";
		$subtopic = "whoisonline";
		include("whoisonline.php");
	break;

	case "story";
		$topic = "Story";
		$subtopic = "story";
		include("story.php");
	break;
	
	case "highscores";
		$topic = "Highscores";
		$subtopic = "highscores";
		include("highscores.php");
	break;

	case "start";
		$topic = "How to get started?";
		$subtopic = "start";
		include("start.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 "board"; 
                $subtopic = "board"; 
                $topic = "Forums Board"; 
                include("forum/board.php"); 
        break; 
     
        case "thread"; 
                $subtopic = "thread"; 
                $topic = "Forums Board"; 
                include("forum/thread.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 "shopadmin";
    $subtopic = "shopadmin";
    $topic = "Shop Admin";
    include("shopadmin.php");
  break;  

	case "gallery";
		$subtopic = "gallery";
		$topic = "Gallery";
		include("gallery.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='http://".$_SERVER['SERVER_NAME'].$config['site']['subfolder']."/".$layout_name."/images'; var LINK_ACCOUNT=0; LINK_ACCOUNT='http://".$_SERVER['SERVER_NAME'].$config['site']['subfolder']."';</script>";
include($layout_name."/layout.php");
ob_end_flush();

?>

folder forum/ config.php
PHP:
<?
//Host of your database
$dbhost = "localhost";
//Login yo your database
$dblogin = "root";
//Password to your database
$dbpass = "my password to database";
//Name of your dataabse
$dbname = "name database";
//Set to true when you configure everything, the forum will start working.
$install = start;

//Max amount of threads per page
$max_threads = 10;
//Max amount of posts per page
$max_posts = 10;
//Name of the server
$world_name = "name world";
//Login to admin
$admin_login = "My login";
//Password to admin
$admin_password = "my password";

//Dont touch
	mysql_connect($dbhost, $dblogin, $dbpass);
	mysql_select_db($dbname);
?>

and What further? Is there all goods files? please help

Set $install = start; to false :|
 

Similar threads

Back
Top