protected function user_get_preference($key, $userId = null)
{
if ($userId === null) {
$userId = $this->kga['user']['userID'];
}
$table = $this->getPreferencesTable();
$userId = MySQL::SQLValue($userId, MySQL::SQLVALUE_NUMBER);
$key2 = MySQL::SQLValue($key);
$query = "SELECT `value` FROM {$table} WHERE userID = {$userId} AND `option` = {$key2}";
$this->conn->Query($query);
if ($this->conn->RowCount() == 1) {
$row = $this->conn->RowArray(0, MYSQLI_NUM);
return $row[0];
}
return null;
}