Topics
- Administration
- Include the forum on your page
- Change the stylesheet
- Translating the interface
- Adding a note (or an ad) in the middle of the forum
- Changing colors and layout: basic
- Changing colors, text and layout: advanced
- Headlines
- Backup and restore
- Setting page title according to thread
Administration
Once you installed freeForum, log-on to the freeForum main folder for administration. For there you can
- create or delete categories,
- edit or delete posts,
- post messages with reserved user names,
- ban IP's.
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:
-
At the very top of your page, include the following statements
This statement is needed for session management and the lo-gin functions.<?
include('PATHTOFREEFORUM/top.inc.php');
?> - copy the file
style.css
where your page resides and include it in your page:<link rel="stylesheet" href="./style.css" type="text/css">
- Where you want the forum, include the following lines in you php file
This will load an English interface. The list of language codes is as follow<?
$languagefile = "en.php";
include('PATHTOFREEFORUM/forum.php');
?>- English:
en.php
- French:
fr.php
- Romanian:
ro.php
- German:
de.php
- Dutch:
nl.php
- Swedish:
sv.php
- Russian:
ru.php
- Chinese (traditional):
zh-TW.php
- Español:
es.php
- Polski:
pl.php
- Türkçe:
tr.php
- Bosanski:
bs.php
- Italiano:
it.php
- Bahasa Indonesia:
id.php
- Serbian:
sr.php
- Macedonian:
mk.php
- English:
For a multilingual interface, you can model yourself on the file index.php
from the main distribution. Here is the list
-
At the very top of your page, include the following statements
The first statement is needed for session management and login functions. The following are setting the language file.<? include('top.inc.php'); // Language switch // Leave as is or set $languagefile = "mylanguagefile.php"; if (isset($_GET['lang'])) {
$_SESSION['lang'] = $_GET['lang']; } if (isset($_SESSION['lang'])) { $lang = $_SESSION['lang']; } else { $lang = "en"; } switch($lang) { case "fr": $languagefile = "fr.php"; break; case "ro": $languagefile = "ro.php"; break; case "se": $languagefile = "sv.php"; break; case "nl": $languagefile = "nl.php"; break; case "ru": $languagefile = "ru.php"; break; case "de": $languagefile = "de.php"; break; case "zh-TW": $languagefile = "zh-TW.php"; break; case "es": $languagefile = "es.php"; break; case "pl": $languagefile = "pl.php"; break; case "tr": $languagefile = "tr.php"; break; case "bs": $languagefile = "bs.php"; break; case "id": $languagefile = "id.php"; break; case "it": $languagefile = "it.php"; break; case "da": $languagefile = "da.php"; break; case "sr": $languagefile = "sr.php"; break; case "mk": $languagefile = "mk.php"; break; default: $languagefile = "en.php"; break; } ?> - copy the file
style.css
where your page resides and include it in your page:<link rel="stylesheet" href="./style.css" type="text/css">
- Where you want the forum, include the following lines in you php file
This will load the forum and a language switch.<? // Language switch echo "<div align=\"center\" style=\"margin-bottom: 5px;\"> <A href=\"".$_SERVER["PHP_SELF"]."?lang=en\">English</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=fr\">Français</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=ro\">Româneste</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=se\">Svensk</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=nl\">Nederlands</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=ru\">Русский</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=de\">Deutsch</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=zh-TW\">繁體中文</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=es\">Español</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=pl\">Polski</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=tr\">Türkçe</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=bs\">Bosanski</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=it\">Italiano</a> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=id\">Bahasa Indonesia</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=da\">Dansk</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=sr\">Srpski</A> -- <A href=\"".$_SERVER["PHP_SELF"]."?lang=mk\">македонски јазик</A> </div> \n"; include('PATHTOFREEFORUM/forum.php'); ?>
Change the stylesheet
freeForum comes with three default stylesheets:
style.css
: grey interface (default),blue.css
: blue interfaceyellow.css
: yellow interfaceblack.css
: black interface
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:
Width of a table for all others:table.forumtable {
width: 82%;
}
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: $forumURL = "./forum.php"; include('freeForum-1.6/latestpost.php'); ?>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: $forumURL = "./forum.php"; include('freeForum-1.6/latestthread.php'); ?>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.
echo $googleadmain;?>