[PHP8] Fixes for some errors that PHP8 puts out. Fixes #882

pull/1094/head
Andreas 2021-07-20 15:07:55 +02:00
rodzic d118c5fef5
commit 4e5144066e
2 zmienionych plików z 23 dodań i 19 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
/*
Class: Options_model
This model handles all database interactions for the options table
This model handles all database interactions for the options table
used for global settings within cloudlog.
*/
@ -12,7 +12,7 @@ class Options_model extends CI_Model {
{
parent::__construct();
}
// Returns all options that are autoload yes
function get_autoloads() {
$this->db->where('autoload', "yes");
@ -25,7 +25,11 @@ class Options_model extends CI_Model {
$query = $this->db->get('options');
$row = $query->row();
return $row->option_value;
if (isset($row->option_value)) {
return $row->option_value;
}
return null;
}
/*
@ -50,7 +54,7 @@ class Options_model extends CI_Model {
'option_value' => $option_value,
'autoload' => $autoload,
);
// Save to database
$this->db->insert('options', $data);
@ -70,25 +74,25 @@ class Options_model extends CI_Model {
$this->db->where('option_name', $option_name);
$query = $this->db->get('options');
$data = array(
'option_name' => $option_name,
'option_value' => $option_value,
);
if($query->num_rows() > 0) {
// Update the Entry
$data = array(
'option_name' => $option_name,
'option_value' => $option_value,
);
$this->db->where('option_name', $option_name);
$this->db->update('options', $data);
return TRUE;
} else {
} else {
// Save to database
$this->db->insert('options', $data);
return FALSE;
}
}
}
}
?>
?>

Wyświetl plik

@ -276,13 +276,13 @@ class User_Model extends CI_Model {
'user_measurement_base' => $u->row()->user_measurement_base,
'user_date_format' => $u->row()->user_date_format,
'user_stylesheet' => $u->row()->user_stylesheet,
'user_sota_lookup' => $u->row()->user_sota_lookup,
'user_show_notes' => $u->row()->user_show_notes,
'user_column1' => $u->row()->user_column1,
'user_column2' => $u->row()->user_column2,
'user_column3' => $u->row()->user_column3,
'user_column4' => $u->row()->user_column4,
'user_column5' => $u->row()->user_column5,
'user_sota_lookup' => isset($u->row()->user_sota_lookup) ? $u->row()->user_sota_lookup : 0,
'user_show_notes' => isset($u->row()->user_show_notes) ? $u->row()->user_show_notes : 1,
'user_column1' => isset($u->row()->user_column1) ? $u->row()->user_column1: 'Mode',
'user_column2' => isset($u->row()->user_column2) ? $u->row()->user_column2: 'RSTS',
'user_column3' => isset($u->row()->user_column3) ? $u->row()->user_column3: 'RSTR',
'user_column4' => isset($u->row()->user_column4) ? $u->row()->user_column4: 'Band',
'user_column5' => isset($u->row()->user_column5) ? $u->row()->user_column5: 'Country',
);
$this->session->set_userdata($userdata);