Simple Machines forum Tips and secrets

Published Date
01 - Mar - 2007
| Last Updated
01 - Mar - 2007
Simple Machines forum Tips and secrets

Simple machines forum is probably the easiest forum to install and administrate out there, this month we provide you with tips and secrets to make life easier working with SMF. Before attempting any of these tips, especially the ones that deal with editing specific files, make sure to backup your forum. You can backup your forum through forum maintenance options in your forum administration page or your database program that your forum is running on, like MySQL. For theme based tweaks, go to your admin page, and click on 'Themes and Layout' under 'configuration'. Next scroll down to 'Install a new theme' and enter 'mytheme' in the 'Create a copy of default'. Choose this newly created theme to edit when given a choice to make sure your default themes stay intact. Now everything is locked and loaded, we can move onto the juicy tips.

Install error?

If you come across the following error when installing Simple Machines Forum –

'Please inform your host that the session.save_path specified in php.ini is not valid! It needs to be changed to a directory that exists, and is writable by the user PHP is running under.'

And if, for some reason, you simply want to make the forum running however possible for the time being, you can use this tip to bypass the session.save_path check. Note that the forum may not work properly, this tweak is recommended only for experimental reasons, it may or may not work properly. Anyway, here are the instructions to bypass the session save path check -

Go to your SMF install directory, open the install.php file using WordPad and look for the following lines –

elseif (session_save_path() == '/tmp' && substr(__FILE__, 1, 2) == ':')
  $error = 'error_session_save_path';

Change this code to -

if (false)

This will make the install skip the session save path check entirely and should allow you to continue the install without errors. The code may vary depending on your SMF version, you can search for 'session.save_path' in your text editor to find the code which should be similar to '$error = 'error_session_save_path';'. Replace the code from the place starting from the last 'elseif' function. The fix itself, (the 'if (false)' thingy) should work for all versions.

Delete the highlighted text and put in if (false) without the quotes to skip the check for session.save_path.jpg

Use a billboard

In case you are restoring an older database or making any changes which require you to keep the forum offline, instead of shutting down your entire web server you can simply turn on maintenance mode. Maintenance mode is a mode where users see a message when they try to access any URL within the forum. You can put the forum in maintenance mode by opening the settings.php file in notepad and changing '$maintenance=0' to '$maintenance=2'. Editing the message, which users see in maintenance mode, can be found further down the file.

Messed up settings? Don't bother restoring a backup.

If any of your core SMF settings turn out messy and prevent you from accessing the forum, instead of restoring your last backup, you can save time by simply downloading the repair_settings.php file from;filename=repair_settings.php. The repair_settings.php is very handy and allows you to reset any of your install settings according to your liking. Just place this file in your root SMF folder and access it by using https://www.yoursite.comforumrepair_settings.php. Remember to put your forum in maintenance mode (More on Maintenance mode in previous tip) and delete this file after you are done working with it, otherwise anyone will have access to it making your forum extremely vulnerable, as malicious users will be able to set their own password if they access this URL.

Make your own color scheme the easy way
Sick of that black text with yellow background used to highlight your search results? Or just about any colors for that matter and want to change them, but at the same time don't want to create an entire theme? Well, head on to themes and layout in the admin page, click on modify themes and finally click on 'modify this theme's stylesheet. Notice the weird mixture of numbers and letters next to 'color'? These are hex values of your colors that you can change to your liking. They are sorted in RGB format, for E.G. FFFFFF represents white, 000000 represents white, FF0000 represents red, 00FF00 represents green, while FFFF00 represents a mix of red and green and so on.

However instead of going through the headache of finding the proper hex value for your color, you can simply enter in text for standard colors like 'black' 'red', blue, or even 'skylightblue', 'lightblue', darkblue', 'darkblue' etc without the quotes in place of the hex gibberish. Experiment and find whether your particular color text gets accepted.

You can put in color names instead of the hex gibberish.jpg

Your own stars

You can add your own gif images for stars beneath your users' avatar, just take any gif image you wish to use and save your file in themesimages in your SMF directory. Note that you need to change the number of stars to one if you wish to use a single image, otherwise you will end up with 5 successive images for senior members A neat trick is to have a specific image (Like a black belt for admins) tethering to various member ranks, which look more appealing than any number of stars!

Change the agreement!

If you find the license agreement at the registration page rather drab you can change it to however you want. Just edit the agreement.txt to your liking, you can find this located in the root of the folder where SMF is installed. For E.g. –


Oops! I forgot my password!

In case you ever mess up forgetting your MySQL database password for SMF, you can find it by using the settings.php file located in your SMF directory. Open it in notepad and look in the 'database info' area where the username, password, database name etc will be there. These should be the same settings that you entered when installing SMF.

you can find your database password in the settings.php file.jpg

Say cheese

If you don't like the default code for your smileys 'E.G' – you'd rather have ':evil' as a trigger than something like ">:)" you can do so by opening the subs.php file in the sources folder in your SMF directory. This option is located somewhere around the middle of the file; search for an entry called 'parsesmileys' and you should get there. See the smileyfrom and smiley2 functions? These are the ones you need to edit; 'smileyfrom' is what you will be entering to trigger the corresponding gif image just below it in the 'smiley2' function.

the highlighted text being the 5th entry in smileyfrom will correspond to the 5th entry in smiley2 which is smiley.gif.jpg

Read the news

To add spice to your forum, you can add news items, which appear at the top of your forum. They can be anything you want, or even URLS. PHP code will work here, for E.G. you can have a link saying "Click here" directing to Just use the following format to do so –

[url=]Your text[/url]

For adding images use –


As mentioned, your PHP functions that you use to post in forums will work here.

You can put in URLs for news. php code is also possible here.jpg

It's boring without add-ons

It's worth noting that you can install additional packages quite fast by going to packages in the admin page. The forum will usually update the page and enabling you to install them directly without going through too much trouble. Just click on packages under 'Main' in the admin page, click on the package you want to install and click 'install now' to immediately download and install the package to your forum.

Spy Game

A mod available at allows you to track activities of any user, showing you users' activities in full view. To install and use it, download the file, which in some cases, may download as tracker.htm. Copy this file to your SMF folder, the same place where the Readme and SSI.php are located, and rename the tracker.htm file to tracker.php. This should finish the install.

To view a user's log, simply enter ' forum/tracker.php. There, you are all set. You can now view any user's log by simply entering the username in the text box. Again, this option is available only to admins, should users try to gain unauthorized access to this file they will receive an error, which again, you can customize by opening the tracker.php file and searching for and editing this line –

 echo "ERROR: You are not Staff.";

The ' staff' might vary depending on your SMF version. To find the line without any hassles type in "echo "ERROR" without the quotes in the search box using your text editor.

Register your users manually

You can manually register anyone through your admin page itself by clicking on 'Registration' under the 'members' area. This is useful when you have closed down registration for your forum and want to make a few exceptions. Note that you can also make the forum send an email to the user with his username and password.

Spy on the moderators

You can keep track of any moderator actions executed by your mod team or by yourself. Any actions exclusive to moderators can be logged after enabling the 'log moderation actions' under 'Features and options'. This log can be viewed at 'Moderation logs' in detail including the action taken, the username of the moderator and the IP address from which the action took place.

The moderation log allows you to see all your moderator's activities.jpg

Team DigitTeam Digit

All of us are better than one of us.