MyBB Community Forums

Full Version: MYBB THIS_SCRIPT?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I make this work wit MYBB THIS_SCRIPT  ?

$script = basename($_SERVER["SCRIPT_FILENAME"]);

if (($script == 'editpost.php'))
Hey, I didn't quite understand your question,

THIS_SCRIPT refers to the actual page the code is being executed in, if you want to compare it to a constant, you could use :

<?php

if(defined('THIS_SCRIPT') && THIS_SCRIPT == 'editpost.php') {
    // we are in editpost.php
}
Exactly thanks very much. I want the script run only if the page is editpost.php Smile