Location: PHPKode > projects > ZompLog > admin/loadplugins.php
<?php



// load list of plugins, and include the plugins

// check what's the current directory, to determine the path to there
$currentdir = getcwd();

// location: in the admin directory
if (preg_match("/admin/i", "$currentdir")) {
   $path = "../plugins/";
} 
// location: in the install directory
elseif (preg_match("/install/i", "$currentdir")) {
  $path = "../plugins/";
}
// location: in the folder of a plugin
elseif (preg_match("/plugins/i", "$currentdir")) {
  $path = "../";
}
// location: in the main Zomplog folder
else
{
$path = "plugins/";
}

$dp = opendir($path);
while($item = readdir($dp)){
if(substr($item,0,1)!='.'){



$query = "SELECT * FROM $table_plugins WHERE name = '$item' LIMIT 1";
$result = mysql_query($query,$link);
$plugin = mysql_fetch_array($result);

// check if plugin is active
if($plugin[active]){
include("$path$item/plugin.php");
}

}
}

?>
Return current item: ZompLog