How to Detect Whether a Plugin is Activated from external file?
#1
My next plugin is a security one, and thus, it should not be known that the plugin is even there.

Usually, from an external page, when a plugin controlling it isn't activated, the page turns blank. Is there a way I can set it so that it returns a 404 error instead? (Only when the plugin isn't activated)
Need web hosting? Try MyBBWebHost!
#1 for Running MyBB Communities
The world's only premium web host dedicated to MyBB forums.

Reply
#2
header("HTTP/1.0 404 Not Found");

?
Reply
#3
But I want it to do that ONLY if the plugin isn't activated. That's the real code I'm looking for.
Need web hosting? Try MyBBWebHost!
#1 for Running MyBB Communities
The world's only premium web host dedicated to MyBB forums.

Reply
#4
<?php
define("IN_MYBB", 1);
require_once "<PATH TO FORUM>/global.php";

$plugins = $cache->read("plugins");
if(!$plugins['active']['PLUGIN_NAME'])
{ /* REDIRECT STUFF */ }
?>

Didn't test it; but should be something like this =P
Reply
#5
Thanks Smile
Need web hosting? Try MyBBWebHost!
#1 for Running MyBB Communities
The world's only premium web host dedicated to MyBB forums.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)