|
Previous
·
Next
|
bernd
|
Date: 5/20/2008 3:38 am · Subject: Update of UsersOnline macro · Rating: 0
I am in the process of updating the UsersOnline macro which has been submitted for WebGUI 6. I am almost there. However, there remains an issue with time stamps.
Active users are found by the following SQL query:
SELECT COUNT(DISTINCT userId) FROM userSession where (lastPageView >= $epoch) and (userId != 1)
The original code relied on WebGUI::DateTime functions for creating the timestamp in $epoch:
$epoch = WebGUI::DateTime::time(); $epoch = WebGUI::DateTime::addToTime($epoch, 0, -$minutes, 0);
Unfortunately, these functions have disappeared in WebGUI 7. I tried to replace them by
$epoch = time() - $minutes*60;
However, I get unreasonable results. So how do I create correct timestamps in WebGUI 7 such that there compatible with the ones used in the database backend?
-- Trying to build a non-profit community portal for free-climbers around Magdeburg/Germany. Check out http://kletterfreunde-md.kashyyyk.de (under construction).
|
| Back to Top |
Rate [ | ]
|
| |
JT
|
Date: 5/20/2008 7:26 am · Subject: Re: Update of UsersOnline macro · Rating: 0
Have a look at webgui::session::datetime, aka $session->datetime
JT On May 20, 2008, at 3:38 AM, <spunky@kashyyyk.de> wrote:
bernd wrote:
I am in the process of updating the UsersOnline macro which has been
submitted for WebGUI 6. I am almost there. However, there remains an issue
with time stamps.
Active users are found by the following SQL query:
SELECT COUNT(DISTINCT userId) FROM userSession where (lastPageView >=
$epoch) and (userId != 1)
The original code relied on WebGUI::DateTime functions for creating the
timestamp in $epoch:
$epoch = WebGUI::DateTime::time(); $epoch =
WebGUI::DateTime::addToTime($epoch, 0, -$minutes, 0);
Unfortunately, these functions have disappeared in WebGUI 7. I tried to
replace them by
$epoch = time() - $minutes*60;
However, I get unreasonable results. So how do I create correct timestamps
in WebGUI 7 such that there compatible with the ones used in the database
backend?
-- Trying to build a non-profit community portal for free-climbers
around Magdeburg/Germany. Check out http://kletterfreunde-md.kashyyyk.de (under
construction).
http://www.plainblack.com/webgui/dev/discuss/update-of-usersonline-macro
--
Plain Black, makers of WebGUI http://plainblack.com
|
| Back to Top |
Rate [ | ]
|
| |
bernd
|
Date: 5/20/2008 3:49 pm · Subject: Re: Update of UsersOnline macro · Rating: 0
Have a look at webgui::session::datetime, aka $session->datetime
JT
I found it. Thanks! The macro seems to work again. I am going to submit it after I have added some documentation.
Is there a chance it can make it into the core? Let us assume for a moment that it supports templates, internationalization, uses the API exclusively and is documented well?
Bernd
|
| Back to Top |
Rate [ | ]
|
| |
JT
|
Date: 5/20/2008 4:00 pm · Subject: Re: Update of UsersOnline macro · Rating: 0
> I found it. Thanks! The macro seems to work again. I am going to
> submit it after I have added some documentation. Is there a chance
> it can make it into the core? Let us assume for a moment that it
> supports templates, internationalization, uses the API exclusively
> and is documented well?
I'm not even sure what it is that you're working on, I just offered
help based upon what you asked. But yeah, there's a chance that
anything can make it into the core provided it follows all the
guidelines for submitting stuff to the core.
JT Smith
ph: 703-286-2525 x810
fx: 312-264-5382
Create like a god. Command like a king. Work like a slave.
|
| Back to Top |
Rate [ | ]
|
| |
bernd
|
Date: 5/21/2008 12:59 am · Subject: Re: Update of UsersOnline macro · Rating: 0
I'm not even sure what it is that you're working on, I just offered help based upon what you asked. But yeah, there's a chance that anything can make it into the core provided it follows all the guidelines for submitting stuff to the core.
The macro is meant to display users (members and visitors) that are currently active on a site. Optionally, a list of members with links to their profiles can be displayed.
I think this is a very nice extension for community portals. At the moment, however, the macro is still very unflexible. In addition, it uses direct queries for finding active users. I was wondering if there are any appropriate API functions for replacing these?
-- Trying to build a non-profit community portal for free-climbers around Magdeburg/Germany. Check out http://kletterfreunde-md.kashyyyk.de (under construction).
|
| Back to Top |
Rate [ | ]
|
| |
JT
|
Date: 5/22/2008 12:05 pm · Subject: Re: Update of UsersOnline macro · Rating: 0
That seems like a nice idea. There's one thing I need you to agree to however. Something new we're trying to avoid the dump and run syndrome of the past. I need you to agree to support your code (bug fix wise) for at least one year after it gets added to the core. Can you agree to that?
On May 21, 2008, at 12:59 AM, <spunky@kashyyyk.de> <spunky@kashyyyk.de> wrote:
bernd wrote:
I'm not even sure what it is that you're working on, I just offered help based upon what you asked. But yeah, there's a chance that anything can make it into the core provided it follows all the guidelines for submitting stuff to the core.
The macro is meant to display users (members and visitors) that are currently active on a site. Optionally, a list of members with links to their profiles can be displayed. I think this is a very nice extension for community portals. At the moment, however, the macro is still very unflexible. In addition, it uses direct queries for finding active users. I was wondering if there are any appropriate API functions for replacing these? -- Trying to build a non-profit community portal for free-climbers around Magdeburg/Germany. Check out http://kletterfreunde-md.kashyyyk.de (under construction).
http://www.plainblack.com/webgui/dev/discuss/update-of-usersonline-macro/4
--
Plain Black, makers of WebGUI http://plainblack.com
JT Smithph: 703-286-2525 x810fx: 312-264-5382 Create like a god. Command like a king. Work like a slave.
|
| Back to Top |
Rate [ | ]
|
| |
bernd
|
Date: 5/23/2008 12:57 am · Subject: Re: Update of UsersOnline macro · Rating: 0
That seems like a nice idea. There's one thing I need you to agree to however. Something new we're trying to avoid the dump and run syndrome of the past. I need you to agree to support your code (bug fix wise) for at least one year after it gets added to the core. Can you agree to that?
Not sure. I am only a perl newbie and have little time for coding. I am not even sure whether I will be able to implement everything I want. So let me finish the macro first. Then we can talk again. In any case there is the possibilty to submit to the add-ons section.
Bernd
BTW, where can I find guidelines for submitting "stuff" to the core?
-- Trying to build a non-profit community portal for free-climbers around Magdeburg/Germany. Check out http://www.klettern-md.de (under construction).
|
| Back to Top |
Rate [ | ]
|
| |
JT
|
Date: 5/23/2008 1:31 pm · Subject: Re: Update of UsersOnline macro · Rating: 0
> BTW, where can I find guidelines for submitting "stuff" to the core?
http://www.webgui.org/community-wiki/how-to-add-a-feature-to-webgui-core
JT Smith
ph: 703-286-2525 x810
fx: 312-264-5382
Create like a god. Command like a king. Work like a slave.
|
| Back to Top |
Rate [ | ]
|
| |
|
|
Re: External Links by bepo - Wed @ 03:30am
|