Move configuration of server name into client configuration file

This commit is contained in:
Robert Miles 2019-10-08 18:13:41 +00:00
parent af2cd047bb
commit 20ceaa73c6
2 changed files with 6 additions and 4 deletions

View File

@ -5,4 +5,7 @@
// Host and Port of BBJ instance // Host and Port of BBJ instance
define("BBJ_HOST","127.0.0.1"); define("BBJ_HOST","127.0.0.1");
define("BBJ_PORT",7099); define("BBJ_PORT",7099);
// Name of BBJ instance
define("BBJ_NAME","tildeverse BBJ");
?> ?>

View File

@ -2,21 +2,20 @@
include 'client/config.php'; include 'client/config.php';
include 'bbj.php'; include 'bbj.php';
$bbj = new BBJ(BBJ_HOST,BBJ_PORT); $bbj = new BBJ(BBJ_HOST,BBJ_PORT);
$name = "tildeverse BBJ";
if (isset($_GET["thread_id"])) { if (isset($_GET["thread_id"])) {
$thread = $bbj->thread_load($_GET["thread_id"]); $thread = $bbj->thread_load($_GET["thread_id"]);
if ($thread["error"]!=null) { if ($thread["error"]!=null) {
$title = "Unknown Thread | ".$name; $title = "Unknown Thread | ".BBJ_NAME;
include 'client/header.php'; include 'client/header.php';
echo "\t\t<p>No such thread exists. <a href='/'>Go home.</a></p>"; echo "\t\t<p>No such thread exists. <a href='/'>Go home.</a></p>";
include 'client/footer.php'; include 'client/footer.php';
die(); die();
} else { } else {
$title = $thread["data"]["title"]." by ".$thread["usermap"][$thread["data"]["author"]]["user_name"]." | ".$name; $title = $thread["data"]["title"]." by ".$thread["usermap"][$thread["data"]["author"]]["user_name"]." | ".BBJ_NAME;
} }
} else { } else {
$title = $name; $title = BBJ_NAME;
} }
include 'client/header.php'; include 'client/header.php';