#327 Add method for getting MFH settings

This commit is contained in:
Mike Koch 2015-08-28 22:04:21 -04:00
parent 57c3e6aaa6
commit 4934c60e34

View File

@ -1982,4 +1982,15 @@ function mfh_getNumberOfDownloadsForAttachment($att_id, $table='attachments')
$res = hesk_dbQuery('SELECT `download_count` FROM `'.hesk_dbEscape($hesk_settings['db_pfix'].$table)."` WHERE `att_id` = ".intval($att_id));
$rec = hesk_dbFetchAssoc($res);
return $rec['download_count'];
}
function mfh_getSettings() {
global $hesk_settings;
$settings = array();
$res = hesk_dbQuery("SELECT `Key`, `Value` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` WHERE `Key` <> 'version'");
while ($row = hesk_dbFetchAssoc($res)) {
$settings[$row['Key']] = $row['Value'];
}
return $settings;
}