diff --git a/application/controllers/Welcome.php b/application/controllers/Welcome.php
index adefaf27..7435c897 100644
--- a/application/controllers/Welcome.php
+++ b/application/controllers/Welcome.php
@@ -12,7 +12,7 @@ class Welcome extends CI_Controller {
public function index()
{
- if($this->config->item('option_version2_trigger') == "false") {
+ if($this->optionslib->get_option('version2_trigger') == "false") {
$data['page_title'] = "Welcome to Cloudlog Version 2.0";
// load stations model
@@ -31,7 +31,8 @@ class Welcome extends CI_Controller {
$this->load->model('note');
$data['NumberOfNotes'] = $this->note->CountAllNotes();
- if(!$data['CountAllStationLocations'] && !$data['NumberOfStationLogbooks'] && !$data['NumberOfAPIKeys'] && !$data['NumberOfNotes']) {
+
+ if($data['CountAllStationLocations'] == 0 || $data['NumberOfStationLogbooks'] == 0 || $data['NumberOfAPIKeys'] == 0 || $data['NumberOfNotes'] > 0) {
// load views
$this->load->view('interface_assets/mini_header', $data);
$this->load->view('welcome/index');
diff --git a/application/models/Note.php b/application/models/Note.php
index 816d904c..0ace033a 100644
--- a/application/models/Note.php
+++ b/application/models/Note.php
@@ -57,9 +57,9 @@ class Note extends CI_Model {
function CountAllNotes() {
// count all notes
- // where user_id is not NULL
- $this->db->where('user_id !=', NULL);
- return $this->db->count_all('notes');
+ $this->db->where('user_id', NULL);
+ $query = $this->db->get('notes');
+ return $query->num_rows();
}
}
diff --git a/application/views/welcome/index.php b/application/views/welcome/index.php
index 3ec40c0f..b9740f69 100644
--- a/application/views/welcome/index.php
+++ b/application/views/welcome/index.php
@@ -116,10 +116,9 @@
-
-
+ 0) { ?>
Looks like you have some notes saved, we need to assign them to your username.