qstr($module)." AND `key` = ".$tc_db->qstr($key)." LIMIT 1"; $result = $tc_db->GetOne($query); return $result; } function module_setting_set($module, $key, $value, $type = 'string') { global $tc_db; $exists = $tc_db->GetOne("SELECT COUNT(*) FROM `".KU_DBPREFIX."module_settings` WHERE `module` = ".$tc_db->qstr($module)." AND `key` = ".$tc_db->qstr($key)." LIMIT 1"); if ($exists > 0) { $result = $tc_db->Execute("UPDATE `".KU_DBPREFIX."module_settings` SET `value` = ".$tc_db->qstr($value).") WHERE `module` = ".$tc_db->qstr($module)." AND `key` = ".$tc_db->qstr($key).""); } else { $result = $tc_db->Execute("INSERT INTO `".KU_DBPREFIX."module_settings` (`module` , `key` , `value` , `type`) VALUES (".$tc_db->qstr($module).", ".$tc_db->qstr($key).", ".$tc_db->qstr($value).", ".$tc_db->qstr($type).")"); } return $result; } ?>