Welcome Guest, Not a member yet? Register   Sign In
Where to put a "global variable" for the entire website
#9

[eluser]xwero[/eluser]
chakhar86, simshaun is autoloading the library. But that is not the main problem.

The main problem is the library gets loaded when the user_id is in the session or not, making database calls when they aren't needed.

The cur_user_level data is only useful when a user is logged in or you have to see the not logged user as a user_level. but that can be checked as follows
Code:
if( ! $this->session->userdata('cur_user_level'))
{
   // not logged in
}
else
{
    // do something with cur_user_level here
}


Messages In This Thread
Where to put a "global variable" for the entire website - by El Forum - 11-26-2008, 08:08 PM
Where to put a "global variable" for the entire website - by El Forum - 11-26-2008, 09:21 PM
Where to put a "global variable" for the entire website - by El Forum - 11-26-2008, 09:24 PM
Where to put a "global variable" for the entire website - by El Forum - 11-26-2008, 09:28 PM
Where to put a "global variable" for the entire website - by El Forum - 11-26-2008, 09:39 PM
Where to put a "global variable" for the entire website - by El Forum - 12-29-2008, 07:37 PM
Where to put a "global variable" for the entire website - by El Forum - 12-30-2008, 02:31 AM
Where to put a "global variable" for the entire website - by El Forum - 12-30-2008, 02:51 AM
Where to put a "global variable" for the entire website - by El Forum - 12-30-2008, 03:07 AM
Where to put a "global variable" for the entire website - by El Forum - 12-30-2008, 04:32 AM
Where to put a "global variable" for the entire website - by El Forum - 12-30-2008, 05:04 AM
Where to put a "global variable" for the entire website - by El Forum - 12-30-2008, 09:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB