Strange error in custom library |
[eluser]Razican[/eluser]
Hello, I have modified the OnlineUsers library, and changed the file variable to one in the app/data/ directory. I have that section like this: Code: class Online_users{ It says that there is an error in Code: APPATH.'data/online_users.tmp'; Code: Parse error: syntax error, unexpected '.', expecting ',' or ';' in application/libraries/Online_users.php on line 15 How can I solve that?
[eluser]WanWizard[/eluser]
It's complaining about the concatenation dot, you can't put an expression in a class property declaration.
[eluser]Razican[/eluser]
I have changed that into this: Code: var $file = 'data/online_users.tmp'; But it tells me this: Code: Use of undefined constant APPATH - assumed 'APPATH' How can I use that constant into my library?
[eluser]Razican[/eluser]
Yes, that was the problem, but I get another error. Is it possible to know the online users with the session class? doing this? Code: function online() I mean, does the session class delete sessions from the database after $config['sess_time_to_update'] has gone? or it deletes them after $config['sess_expiration']? It would be easier for me that way. I only want to know how many people has the last activity later than time()-$config['sess_time_to_update']. |
Welcome Guest, Not a member yet? Register Sign In |