Location: PHPKode > projects > MembersGear > membersgear/includes/include_plugins.php
<?php
$phyDir=PHYSICAL_DIR;
$web_url=WEB_URL;

$plug_dir=PHYSICAL_DIR."/admin/plugins";
if (file_exists($plug_dir))
 {
     $enabledPlugins=array();
     $tempArray= array();
     $ignore = array( 'cgi-bin', '.', '..' );
     $dh = @opendir( $plug_dir );
     $counter=0;
     while( false !== ( $file = readdir( $dh ) ) )
       {
         
           if( !in_array( $file, $ignore ) )
            {
 
              if(is_dir("$phyDir/admin/plugins/$file")) 
               {
                   $plugin=false;
                   $ConfigFile="$phyDir/admin/plugins/$file/config.inc";
                   $settingFile="$phyDir/admin/plugins/$file/setting.php"; 
                   $pluginFile="$phyDir/admin/plugins/$file/plugin.php";  
                   $pluginImageEnable="$phyDir/admin/plugins/$file/images/enabled.gif";  
                   $pluginImageDisabled="$phyDir/admin/plugins/$file/images/disabled.gif"; 
             
                 
                    if(file_exists($ConfigFile) and file_exists($settingFile) and file_exists($pluginFile) and  file_exists($pluginImageEnable) and file_exists($pluginImageDisabled) )
                     {
                               $fileconc = $ConfigFile;
                               $lines =  file($fileconc);
                               $plugName=false;
                               $plugStatus=false;
                               foreach ($lines as $line)
                                {
                                   $fileCont=split("=", $line);
                                   if(is_array($fileCont))
                                    {
                                       if(strcasecmp(trim($fileCont[0]),'NAME')==0)
                                        {
                                          $pluginName=$fileCont[1];
                                          $plugName=true;
                                     
                                         }
                                         else if(strcasecmp(trim($fileCont[0]),'STATUS')==0) 
                                          {
                                             $pluginStatus=$fileCont[1];
                                              if(strcasecmp(trim($fileCont[1]),'ENABLED')==0 or strcasecmp(trim($fileCont[1]),'DISABLED')==0)
                                              {
                                                $plugStatus=true;
                                             
                                                }
                                         
                                            }
                                     
                                           if($plugStatus==true and $plugName==true)
                                               break;  
                                       }
                              
                             }                                              

                            if($plugStatus==true and $plugName==true)   
                              { 
                                     $pluginName=trim($pluginName);
                                     $status=trim($pluginStatus);
                                     
                                     if(strcasecmp(trim($status),'ENABLED')==0) 
                                      {                                              
                                         
                                         if(is_file($pluginFile) || is_readable($pluginFile)) 
                                          {
                                            @require_once("$pluginFile");   
                                             
                                            }
                                        
                                      }  
                                }
                    
                     }  
                     
               
               }                   
 
            
            }
            
       }    
    
 }                              
                         

?>
Return current item: MembersGear