News:

Wondering if this will always be free?  See why free is better.

Main Menu

[PHP] Detect if on forum index or not

Started by MobileCS, February 12, 2025, 04:35:17 PM

Previous topic - Next topic

MobileCS

In PHP, how you you detect if you are on the main page (forum index)?

This is for SMF 2.1.4

Sesquipedalian

You can use the following inside any PHP file that is part of SMF 2.1 (including mods and theme files):

$on_forum_home_page = ($_SERVER['REQUEST_URL'] === $GLOBALS['scripturl']);
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

MobileCS


Advertisement: