Exactly, sorry for the poor phrasing, when saying "include" I actually meant the require() function as is already used now in plugins_function(). OWS_Matthew, plugins are "included" this way in every page, even though most of them won't use their functions.
Here's the example form plugin_functions.php:23
Here's the modified code:
I added is_file to the first check to avoid requiring directories, and then to check for the existance of a "plugin.php" file.
Note that the slash '/' is supposed to be fine for Win* platforms, and the "." and ".." directories are excluded from the list.
Here's the example form plugin_functions.php:23
Code:
foreach ($pluginfiles as $fi)
{
$pathExt = pathinfo($fi,PATHINFO_EXTENSION );
$pathName= pathinfo($fi,PATHINFO_FILENAME );
if ($pathExt=="php")
{
$pluginsLoaded=true;
require_once(GSPLUGINPATH . $fi);
}
}
Here's the modified code:
Code:
foreach ($pluginfiles as $fi)
{
$pathExt = pathinfo($fi,PATHINFO_EXTENSION );
$pathName= pathinfo($fi,PATHINFO_FILENAME );
if (is_file(GSPLUGINPATH . $fi)){
if($pathExt == "php"){
$pluginsLoaded=true;
require_once(GSPLUGINPATH . $fi);
}
} else {
if($fi != "." && $fi != ".." && is_file(GSPLUGINPATH . $fi . '/plugin.php')){
$pluginsLoaded=true;
require_once(GSPLUGINPATH . $fi . '/plugin.php');
}
}
}
I added is_file to the first check to avoid requiring directories, and then to check for the existance of a "plugin.php" file.
Note that the slash '/' is supposed to be fine for Win* platforms, and the "." and ".." directories are excluded from the list.
./tankmiche_