|", $log); $host = $log_arr[0]; if ($host==$ip) { return true; } } return false; } function blockdummy() { $refArray=parse_url($_SERVER["HTTP_REFERER"]); $ref = $refArray['host']; $ip = $_SERVER["REMOTE_ADDR"]; if ($ref == 'soft.zoneo.net') { if (!(isset($_COOKIE['phpTrafficA']))) { if (!isonline($ip)) { die("Server error"); } } } } blockdummy(); ?> freeForum - Usage Notes

freeForum basic usage note

Topics

Administration

Once you installed freeForum, log-on to the freeForum main folder for administration. For there you can

If a category is tagged as private, only the administrator can start a new thread, and general users can only answer. If a category is tagged as public, anyone can start a new thread and post answers.

Include the forum on your page

To accommodate the lo-gin functions and multilingual instructions, instructions for use have changed a little. First, it will depend on how many languages you want to provide.

For an interface in a single language only, do the following:

For a multilingual interface, you can model yourself on the file index.php from the main distribution. Here is the list

Change the stylesheet

freeForum comes with three default stylesheets:

To have the default colors, copy the file style.css where your page resides and include it in your page:

<link rel="stylesheet" href="./style.css" type="text/css">

To have the blue set of colors, copy the file blue.css where your page resides and include it in your page:

<link rel="stylesheet" href="./blue.css" type="text/css">

To have the yellow set of colors, copy the file yellow.css where your page resides and include it in your page:

<link rel="stylesheet" href="./yellow.css" type="text/css">

To have the black set of colors, copy the file black.css where your page resides and include it in your page:

<link rel="stylesheet" href="./black.css" type="text/css">

Translating the interface

Your language is not available? Well, don't worry, you will only need 20 to 30 minutes to translate the whole thing...

Open the language directory, copy the file en.php as XX.php, where XX is you language code, and start translating... Once you're done, drop us a note, as an email or in the forum, to let us know what you did and include your translation in future releases!

Adding a note (or an ad) in the middle of the forum

Simply define a php variable called $centralnote before calling the forum. This is how this website puts an add in the middle of the forum:

$centralnote = "Code for google ad";
$admin = 0;
include('PATHTOFREEFORUM/forum.php');

Changing colors and layout: basic

You can change colors and a lot of the design in the stylesheets style.css, blue.css, or yellow.css. Just play around and you'll find it fairly easy.

When changing the width of elements, you may run into trouble because of nasty bugs in Internet Explorer: everything works fine when you work in pixels, but engineers at Microsoft never understood the notion of percentages... It can turn into a nightmare! Now, here is the trick to define properties for IE only:

Width of a table for IE only:
table.forumtable {
width: 82%;
}
Width of a table for all others:
html>body table.forumtable {
width: 98%;
}

But play it easy first! Most of the time, there is no need to go through this, and you can use the first part of this CSS example for all browsers. Unfortunately, you have to try: IE's bugs are completely unpredictable.

Changing colors, text and layout: advanced

If you did not get enough with the stylesheet, well, head out for the template.php file and languages directory. You'll find the rest of the layout and language strings, and they are fully commented so you should be able to find your way around.

Headlines

If your want to include headlines somewhere else on your site, such as this one:

Latest post on the forum:
include the following php code:
Latest post on the <a href="forum.php">forum</a>:
<?
$forumURL = "./forum.php"; // Replace with the URL of your own forum
include('PATHTOFREEFORUM/latestpost.php');
?>

Similarly, if you want to include headlines related to the latest thread, such as this one

Latest thread on the forum:
include the following php code:
Latest thread on the <a href="forum.php">forum</a>:
<?
$forumURL = "./forum.php"; // Replace with the URL of your own forum
include('PATHTOFREEFORUM/latestthread.php');
?>

Backup and restore

Log-on to the administrator mode. In the backup tab, you will be able to generate a file with all posts and categories in the forum. To restore, simply use the restore function with the file generated in the backup.

Backup and restore functions only store posts and categories. Usernames or layout options will not be saved. Therefore, it can be used to transfer the forum content to a new site or server easily.

Setting page title according to thread

If you want to set the page title according to the name of thread when displaying a full thread, use the following php code at the top of your page

include("$pathtofreeforum/config.php");
include_once("$pathtofreeforum/func.inc.php");
include_once("$pathtofreeforum/func.echo.php");
if ($_GET['mode'] == 'thread') {
    $db=mysql_connect($hostname, $username, $password);
    if(!$db ) { print "Error connection $db"; exit; }
    if(!mysql_select_db($database,$db)) { print "Error ".mysql_error().">br>"; mysql_close($db); exit;}
    $thread = intval($_GET['thread']);
    $cat = intval($_GET['cat']);
    $cat = securecat($cat);
    $thread = securethread($thread,$cat);
    $threadinfo = getthreadinfo ($thread);
    $pagetitle = $threadinfo['subject'];
    mysql_close($db);
} else {
    // Define your own title...
}
and use the $pagetitle parameter to set you page title.