Location: PHPKode > projects > ZompLog > admin/plugins.php
<?php
/* Written by Gerben Schmidt, http://scripts.zomp.nl */

ob_start();
include_once("functions.php");
include('config.php');
include("session.php");
include("header.php");

$user = loadUser($_SESSION['login'],$link,$table_users);
if(!$_SESSION["loggedIn"] || !$user['admin']){ echo "You don't have enough privileges to view this page."; exit; }
else
{


?>

<div id="submenu"><a href="plugins.php" class="sub"><?php echo "$lang_plugins"; ?></a></div>


<div id="side">
<div class="title">&nbsp;</div>
<div class="box"><?php
if(!empty($messages)){
	displayErrors($messages);
}

elseif($_GET[message] && empty($messages)){
displayMessage($_GET[message]);
  }

else{
echo "$lang_message016";
}  
  
?>
</div></div>


<div id="main">


<form name="myform" method="post" enctype="multipart/form-data">
<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="text">
        <tr>
          <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="2"><h1><?php echo "$lang_plugins"; ?></h1>
            <?php echo "$lang_plugins_need_more"; ?><br /><br />
</td>
        </tr>
      </table></td>
        </tr>
        <tr>
          <td colspan="2">
              
                  <?php
    
$dir = "../plugins/";
$dh  = opendir($dir);
while (false !== ($filename = readdir($dh))) {
    $files[] = $filename;
}

sort($files);

foreach($files as $item){
if(substr($item,0,1)!='.' && $item != 'sec_patch'){

include("../plugins/$item/plugin.php");

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

?>
<fieldset id="titlediv">
      <legend><?php echo "$item"; ?></legend>	 <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="text">
            

<tr>
                  
    <td colspan="5"><?php 
	
	$filename = "../plugins/$item/admin.php";
	
	// check if plugin has already been installed
	if(!$plugin[installed] && !$plugin[active]){
	echo "<a href='../plugins/$item/install.php'>$lang_install_plugin</a><br />";
	}
	elseif(!$plugin[active])
	{
	echo "<a href='plugin_activate.php?action=activate&amp;plugin=$item'>$lang_activate_plugin</a><br />";
	}
	else
	{
	echo "$lang_plugin_is_active<a href='plugin_activate.php?action=deactivate&amp;plugin=$item'>$lang_deactivate_plugin</a><br /><br />";
	
	if (file_exists($filename)) {
   echo " <a href='$filename'>$lang_plugin_control</a>"; 
	}
	
	}

	 
	

	
	
	?></td>
              </tr>
			  <tr><td colspan="5">&nbsp;</td></tr>
                  <tr>

    <td colspan="5"><?php echo "$lang_author $plugin_author"; ?><br />
	<?php echo "$lang_description $plugin_description"; ?><br />
<?php echo "$lang_version $plugin_version"; ?></td>
  </tr>

  </table>
          </fieldset>
		  <br />
  <?php

}
}


?>
            
          </td>
          </tr>
     
        
       
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>

      </table>
</form>
</div>

<?php

}
include('footer.php');
?>
Return current item: ZompLog