73.3 °F

Hum: 25% Dew: 35.3 °F
Baro: 1019.44 hPa
Wind: NE @ 3.6 mph
Rain: No Rain Today
Data Updated: 14:00
TNET Weather Station - Mesa, AZ USA
Home   Forecasts   Graphs   Radar   Trends   Webcams   Weather Links   Archives   PROJECTS & SCRIPTS   About Us
TNET Weather Based Projects and Scripts > EU Cookies Permission Script > Pkgs > SMF (Simple Machines Forum)

SMF (Simple Machines Forum)

Add the hook code just after the <?php tag at the top of the index.php file used by the forum.

Normally, this would be in /forum/index.php or could just be if you are using the forum as a primary site, just in the index.php file.

<?php

if(!isset($_COOKIE['permission_cookie'])) {
    $okay =0;

    // No... lets see if this is a spider/crawler or bot
    if (isset($_SERVER['HTTP_USER_AGENT'])) {
        if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"bot" ) !==FALSE ||
            strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"spider" ) !==FALSE ||
            strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"crawler" ) !==FALSE) {
            // YES Lest set Okay
            $okay= 1;
        }
    }
    // Not a bot, so we send them to our cookie permission page
    if(!$okay) {
        header("Location: /cookies.php");
        exit;
    }
}

/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines http://www.simplemachines.org
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.2
.
.
.
Copyright © 2018 TNET Systems Inc. - All rights reserved. Weather Collection for this website is done via Cumulus 1.9.4 build #1093 and Weather Display
Boltwire Cumulus Plugin by TNET using Boltwire v3.4.16 Hosting by TNET
Protens Server - IP: 54.227.6.156 [ec2-54-227-6-156.compute-1.amazonaws.com] - Views #27