<?php
$querySelect = "SELECT COUNT(`name`) FROM `setting` WHERE `name`='Domain Passwords are Encrypted'";
$result = mysql_query($querySelect) or die("ERROR in query: $querySelect");
list($nameCount) = mysql_fetch_row($result);
if($nameCount < 1){
    if (extension_loaded('mcrypt')) {
        $queryInsert = "INSERT INTO `setting` (`id`, `name`, `value`, `description`, `type`, `isrequired`, `istruefalse`, `istextarea`, `isfromoptions`, `myorder`, `helpid`, `plugin`, `ispassword`, `ishidden`) VALUES (NULL, 'Domain Passwords are Encrypted', 1, 'This setting allows to encrypt Domain Passwords. When the encryption is done, this setting is set to true.', 1, 0, 1, 0, 0, 0, 0, 0, 0, 1)";
    }else{
        $queryInsert = "INSERT INTO `setting` (`id`, `name`, `value`, `description`, `type`, `isrequired`, `istruefalse`, `istextarea`, `isfromoptions`, `myorder`, `helpid`, `plugin`, `ispassword`, `ishidden`) VALUES (NULL, 'Domain Passwords are Encrypted', 0, 'This setting allows to encrypt Domain Passwords. When the encryption is done, this setting is set to true.', 1, 0, 1, 0, 0, 0, 0, 0, 0, 1)";
    }
    mysql_query($queryInsert) or die("ERROR in query: $queryInsert");
}
?>
