Online Users library Addin |
Hello,
I am trying to use the Online Users library at: https://github.com/bcit-ci/CodeIgniter/w...line-Users In config/autoload.php I set: Code: $autoload['libraries'] = array('database','session','onlineusers'); I use Codeigniter v3.0.4 The problem is in set_data() it is not working, I use "Authme Authentication Library" * @author Gilbert Pellegrom * @LinK http://dev7studios.com * @version 1.0 I added the code to the libraries/Authme.php Code: $this->CI->onlineusers->set_data(array('username'=>$user->username,'id'=>$user->id), 1); Onlineusers.php, and Authme.php are attached. Can someone help me? Also I tried to use set_data in a controller; it is not working! ![]() Regards,
Because in CI 3 it's set_userdata()
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(01-23-2016, 04:39 AM)InsiteFX Wrote: Because in CI 3 it's set_userdata() Thank you InsiteFX, set_data is a function in the library class 'Onlineusers'. The problem in changing online guest to member, it requires 15 min to update him. I have two solutions: 1. Reducing the time out to a small number like 15 instead of 900 in line: $timeout = $now - 900; Is this bad a take more resources? 2. Loading online library only for logged in users; so there will be no guests. But I will not know online guests and bots. Does any one know another library depends on database not file and store online and today users? Regards,
In Onlineusers.php I changed set_data function to:
Code: function set_data($username, $id) { In Authme.php I changed Code: $this->CI->onlineusers->set_data(array('username'=>$user->username,'id'=>$user->id), 1); to Code: $this->CI->onlineusers->set_data($user->username,$user->id); in login function and Code: $this->CI->onlineusers->set_data('',''); now it is working fine. But I still think it is bad idea to use this library because it use file to store online information. Any ideas !!! |
Welcome Guest, Not a member yet? Register Sign In |