Page 1 of 2

[ABD] User Online Time

Posted: Fri Nov 21, 2014 10:35 am
by Wolfsblvt
Image

Extension Name: User Online Time
Author: Wolfsblvt

Extension Description: Keeps track of user total and average online time. Adds it to the user profile.
Extension Version: 1.1.1

Requirements:
  • PHP: >= 5.4.0
Features:
Current Features
****************
  • Tracks online time of users (total and per day)
  • Calculates online time from configuration of 'load_online_time' for "who is online?" list
  • Shows it in easy to read format in member profile
  • Online time not visible on invisible users profile, except you can see invisibles
  • Permission to view online time
  • Permission to hide online time (bound to core permission "Can hide online status")
  • UCP option to hide online time
  • Permission to see even hidden online times (bound to core permission "Can view hidden online users")
  • Full subsilver2 support
Planned Features
****************
  • None
Screenshots:
Image

Image

Image

Demo URL: -

Extension Download: wolfsblvt.onlinetime.zip

More Information:
I've seen this feature in another board system, so I wanted to include it to phpBB. First as a very easy extension, nothing big, like you see it now. It keeps track of user online time, but before you ask: It starts counting from the first enable of this extension. There is no chance to get the correct online time for the past.

What I thought it would be cool, it uses the timespan how long you are visible in the "who is online?" list, but with a few exceptions. The online list shows you as online for X minutes until you are gone. This extension just counts the time if you do another action in this time frame.

There are permissions included and used in this extension.

If you have any corrections or improvements for my code, I would be very glad. Extension developing seems to be difficult :P
Bug reports in this thread or on github.
(Oh, and my english is not the best. If you have suggestions for translations or want to add another translation language, just use this thread too, or make a pull request)

Re: [DEV] User Online Time

Posted: Fri Nov 21, 2014 10:36 am
by Wolfsblvt
Changelog:
Actual Version
**************

-- Version 1.1.1 --------------
• Included subsilver2 support

###########################################################################
Past Versions
*************

-- Version 1.1.0 --------------
• Removed adding language files twice
• Implemented check for permissions
• Fix: Adding time to the next day if close after midnight
• Fix: Updating online time after display

-- Version 1.0.0 --------------
• First implementation for 3.1
• Included check for requirements

Re: [DEV] User Online Time

Posted: Fri Nov 21, 2014 11:02 am
by Meis2M
very lovely thanku

Re: [DEV] User Online Time

Posted: Fri Nov 21, 2014 11:34 am
by Cable Player
Edit:
Sorry, I didn't read the whole post, have now downloaded the core files too :)

Hi there, I've downloaded this extension from the OP, version 1.0.0 and when I go to enable it it says in a red box:

"The selected extension cannot be enabled, please verify the extension’s requirements."

I've not had this before, so not sure what to do. I uploaded it using the Upload Extensions Extension and have checked everything's in the right place.

Thanks

Re: [DEV] User Online Time

Posted: Fri Nov 21, 2014 11:36 am
by Wolfsblvt
You have to install and enable my core extension first.
(An extension where I gather my libraries, often used functions, etc)
Wolfsblvt wrote:And last, I know not everyone will be pleased with my decision to outsource much of my code to my core extensions. Yeah, you have to install two extensions. But that's not a big deal, isn't it? :P
It makes life easier for me.
So, don't forget to install and enable wolfsblvt\core first!
Just download and enable it first, this extension does nothing more than adding the libraries to the code.

EDIT:// Ah, you've seen that already, good :D

Re: [DEV] User Online Time

Posted: Fri Nov 21, 2014 11:39 am
by Cable Player
Yeah, thanks for the speedy response ;)

It's not displaying correctly in the profile at the moment but I think this is due to the phpBB 3.1 Friendslist Enhance 1.0.1.0076 extension I have installed (as it's displaying in the friendslist on the profile page). I'm using the PBTech style, does User Online Time 1.0.0 support custom styles?

Re: [DEV] User Online Time

Posted: Fri Nov 21, 2014 11:45 am
by Wolfsblvt
User Online Time uses the memberlist_view_user_statistics_after event to add the template.
This is perfectly fine in prosilver, and as the name says, it should add content after the other statistics, also in custom styles :P

Can you check where this event is placed in your style?
If it is placed right but formatted wrong, you have to do the following:
- Go in onlinetime\styles and duplicate the "prosilver" folder. Rename it to your style.
- Go inside the style folder and template\event. Open the html file and change the html code the way you want it to look.

Re: [DEV] User Online Time

Posted: Fri Nov 21, 2014 11:50 am
by Cable Player
Ok, thanks for the info. I've not yet looked at the coding for the styles in 3.1 but was confident making changes with 3.0.x, so what I'll do is play around with the events to make it how I'd like.

Thanks for your help, if I have any questions I'll come back here :)

Re: [DEV] User Online Time

Posted: Mon Dec 08, 2014 8:56 pm
by Tuqe
ERROR wrote:Selected plug-ins can not be enabled, please verify the requirements of the plugin.
:oops:

Re: [DEV] User Online Time

Posted: Mon Dec 08, 2014 9:28 pm
by Wolfsblvt
Tuqe wrote:
ERROR wrote:Selected plug-ins can not be enabled, please verify the requirements of the plugin.
:oops:
Currently you have to install my core extension. (Read the start post for it)

But it will change soon, so that there are no dependencies.

Re: [DEV] User Online Time

Posted: Tue Dec 09, 2014 3:30 am
by wkuzma
Hi
When I enable your core I get this error
Parse error: syntax error, unexpected '[' in /public_html/new3/ext/wolfsblvt/core/core/requirements_helper.php on line 125

Re: [DEV] User Online Time

Posted: Tue Dec 09, 2014 4:48 am
by Allen142
How would you install that extension on your forum directory? But I need an extension that gives the forum time statistics which is this one:
Forum started on 22 Nov 2014, 23:04 and in existence for # years # months # days # hours # minutes # seconds

Re: [DEV] User Online Time

Posted: Tue Dec 09, 2014 8:07 am
by Niknovel
When the expansion of the error:

Parse error: syntax error, unexpected '[' in /home/u29186/electro-sila.ru/www/forum/ext/wolfsblvt/onlinetime/ext.php on line 64
Error 4: syntax error, unexpected '[' at file /home/u29186/electro-sila.ru/www/forum/ext/wolfsblvt/onlinetime/ext.php line 64

Re: [DEV] User Online Time

Posted: Tue Dec 09, 2014 1:00 pm
by Wolfsblvt
wkuzma wrote:Parse error: syntax error, unexpected '[' in /public_html/new3/ext/wolfsblvt/core/core/requirements_helper.php on line 125
Niknovel wrote:Parse error: syntax error, unexpected '[' in /home/u29186/electro-sila.ru/www/forum/ext/wolfsblvt/onlinetime/ext.php on line 64
You need PHP: >= 5.4.0 for this extension, as said in the requirements of the first post. So you can't get it to run, sadly, or you need to update your php version of your server.
Allen142 wrote:How would you install that extension on your forum directory? But I need an extension that gives the forum time statistics which is this one:
Forum started on 22 Nov 2014, 23:04 and in existence for # years # months # days # hours # minutes # seconds
This is not what this extension does, and it is not planned, sorry.

Re: [DEV] User Online Time

Posted: Tue Dec 09, 2014 5:55 pm
by wkuzma
You need PHP: >= 5.4.0 for this extension, as said in the requirements of the first post. So you can't get it to run, sadly, or you need to update your php version of your server.
now I have PHP Version 5.4.35 just did an update on php

but I get this error
Information
The selected extension cannot be enabled, please verify the extension’s requirements.
phpbb version 3.1.2