MyBB Community Forums

Full Version: (Solved) THIS_SCRIPT for Archive?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Guys,

Im fixing a very old plugin for MyBB the problem I have at this final part is the next one:

The plugin in basic, change the format of the URL, that works OK, in all the forum I use, for example:

THIS_SCRIPT == "showthread.php" - etc etc

And thats works OK.-

But how I can put this condition to my function, for the archive? because the archive is /archive/index.php?123.html

Thanks!
basically THIS_SCRIPT is defined in regular php files of MyBB system.
to get plugins work on the archive section, you can try using archive_start hook
Try the IN_ARCHIVE constant.

if(defined('IN_ARCHIVE'))
{
	// we are in the archive.
}
Thanks .m. for the data that give me a good idea!



Hi Omar, Thanks for your time

I will check it.-



Well works OK with IN_ARCHIVE

I duplicate the function with another name put the hook to archive_start and define IN_ARCHIVE, works fine.-

Thanks to all for your time!