vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - Cel User Always Online (https://vborg.vbsupport.ru/showthread.php?t=309473)

cellarius 03-12-2014 11:00 PM

Cel User Always Online
 
1 Attachment(s)
What does it do?
This addon simply lets you define one or several users (or usergroups) that will be always shown as online in the Who's Online section and other parts of the forum.

How does it work?
It adds a cron job that updates the last activity entry in the session table for the given users. It is set to run every ten minutes. If your session length is shorter, you will need to adapt the cron job. (You can check your session timeout at AdminCP->Settings->Options->Cookies and HTTP Header Options, it needs to be more than 600, 900 is default).

How to install
Just download, upload the contents of the UPLOAD folder to your forum root, and import the product file of the addon. Then go to AdminCP->Settings->Options and enter the userid(s) of the users (or usergroup ids) you want to be always online in the Cel User Always Online section. Then the users need to log in once manually, to get things started.

Other versions of vB?
This addon should work with every Version of vB4, and most likely on vB3, too (not tested).

ozzy47 03-13-2014 12:05 PM

Cellarius, your missing the contents to upload. :)

New Joe 03-13-2014 12:44 PM

I see the xml file there...

webmastersun 03-13-2014 01:30 PM

Seem you uploaded missing files

Code:

    Warning: include_once([path]/./includes/cron/cel_user_always_online.php) [function.include-once]: failed to open stream: No such file or directory in [path]/admincp/cronadmin.php on line 116

    Warning: include_once() [function.include]: Failed opening '[path]/./includes/cron/cel_user_always_online.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/admincp/cronadmin.php on line 116

where is cel_user_always_online.php file ?

Imported XML file and config in option ACP but didn't show users on Who is online on my forum

I didn't understand this
Quote:

It adds a cron job that updates the last activity entry in the session table for the given users. It is set to run every ten minutes. If your session length is shorter, you will need to adapt the cron job.
I removed cron job function at footer template, it is reason cause error and didn't show users online by IDs ?

dandanch 03-13-2014 04:36 PM

I'll wait until the files are updated, but this looks promising;

cellarius 03-13-2014 09:51 PM

Sorry, I misclicked when uploading. Got the xml instead of the zip next to it - sorry, folks!

ozzy47 03-13-2014 10:26 PM

It happens to all of us brother. :)

tanzeelniazi 03-13-2014 10:42 PM

any screen shoot please

dandanch 03-13-2014 10:43 PM

Just ran this on test server and got this error:

Quote:

Database error in vBulletin 4.2.2:

Invalid SQL:

UPDATE session
SET lastactivity = NOW
WHERE userid IN (1);

MySQL Error : Unknown column 'NOW' in 'field list'
Error Number : 1054
Request Date : Friday, March 14th 2014 @ 12:37:17 AM
Error Date : Friday, March 14th 2014 @ 12:37:17 AM
Script : http://localhost/admin/cronadmin.php...on&cronid=1623
Referrer : http://localhost/admin/cronadmin.php?do=modify
Username : admin
Classname : vB_Database
MySQL Version : 5.1.72-cll

ForceHSS 03-13-2014 10:48 PM

Your cron brings an error
Code:

Database error in vBulletin 4.2.2:

Invalid SQL:

    UPDATE session
    SET lastactivity = NOW
    WHERE userid IN (1);

MySQL Error  : Unknown column 'NOW' in 'field list'
Error Number  : 1054
Request Date  : Thursday, March 13th 2014 @ 03:38:23 PM
Error Date    : Thursday, March 13th 2014 @ 03:38:23 PM
Script        : http://www.mystechtronics.net/another/cronadmin.php?do=runcron&cronid=90
Referrer      : http://www.mystechtronics.net/another/cronadmin.php?do=modify
IP Address    :
Username      :
Classname    : vB_Database
MySQL Version : 5.5.33-31.1


cellarius 03-13-2014 10:51 PM

Hm. It seens something went wrong when packing the thing. That clearly is an old version of the file. Let me check that out. I'm going to remove the file until for a moment.

Really sorry, guys - I should not have whipped this up during my lunch break...

cellarius 03-13-2014 10:58 PM

OK, I just reuploaded. For those who already installed: just replace the includes/cron/cel_user_always_online.php file, no changes in the product xml.

Thanks for your patience ;)

cellarius 03-13-2014 11:00 PM

Quote:

Originally Posted by tanzeelniazi (Post 2487052)
any screen shoot please

What do you expect to see? This addon just keeps certain users online permanently.

ForceHSS 03-13-2014 11:04 PM

Do members need to login first then it keeps them logged in before this works or does it matter

cellarius 03-13-2014 11:11 PM

Yes, they need to log in once, so there is a entry for them in the session table that can be updated.

ForceHSS 03-13-2014 11:28 PM

i logged in all members but only shows me ran the cron did not keep them logged in

ForceHSS 03-13-2014 11:36 PM

Logging them in again for longer and running cron to see if it works

dandanch 03-14-2014 01:22 AM

Works pretty good, but it's not showing them as logged in in there profile. Thanks for the mod:)

ForceHSS 03-14-2014 01:30 AM

Removed as it logs them out after a while

webmastersun 03-14-2014 02:15 AM

Quote:

Originally Posted by ForceHSS (Post 2487071)
i logged in all members but only shows me ran the cron did not keep them logged in

The same result.

I set UserIDs
Code:

18,185,28,36,68,95
in Cel User Always Online option
and I tried to log in some accounts but it was not working, didn't show usernames on forum home and keep them as logged in.

ForceHSS 03-14-2014 04:32 AM

To the op if you could make it that it picks all registered members per group you pick and auto loads them then it would work better

webmastersun 03-14-2014 05:09 AM

Quote:

Originally Posted by ForceHSS (Post 2487135)
To the op if you could make it that it picks all registered members per group you pick and auto loads them then it would work better

I agree with this idea or you can add a tick option to in user profile thus we will select "users always online" easily.
Not interested in using cron job for Mod. :)

cellarius 03-14-2014 08:13 AM

Quote:

Originally Posted by ForceHSS (Post 2487074)
Logging them in again for longer and running cron to see if it works

Quote:

Originally Posted by ForceHSS (Post 2487098)
Removed as it logs them out after a while

It definitely works for me. My session timeout is default at 900 sec, i.e. 15 minutes. If your session timeout is less than 600, your users will be logged out, and you'll need to adapt the cron settings to execute it more often.

Also, if you're testing this on a test installation with no real traffic, the cronjob will not be executed and your users will be logged out, too. I've been testing with an auto page refresh addon for chrome, refreshing the forum home page every 10 sec to simulate traffic.

Have my test users logged in on my test board for over seven hours straight now.

cellarius 03-14-2014 08:14 AM

Quote:

Originally Posted by dandanch (Post 2487096)
Works pretty good, but it's not showing them as logged in in there profile. Thanks for the mod:)

I'll look into that.

cellarius 03-14-2014 08:22 AM

Quote:

Originally Posted by ForceHSS (Post 2487135)
To the op if you could make it that it picks all registered members per group you pick and auto loads them then it would work better

I honestly would not have thought that you would want this for whole usergroups (using this on a large scale will spam your Who's online and confuse your users). Since the usergroup is not in the session, it will require an additional query. I'll think about it.

cellarius 03-14-2014 08:23 AM

Quote:

Originally Posted by webmastersun (Post 2487138)
I agree with this idea or you can add a tick option to in user profile thus we will select "users always online" easily.
Not interested in using cron job for Mod. :)

This will not happen. I just coded this since it was requested and I had an idea for a quick fix. If it is too cumbersome for you to add an userid to the list in the options, or it is somehow against your standards to use a cron job in an addon, then just don't use this. Good luck in finding another method.

cellarius 03-14-2014 08:29 AM

Quote:

Originally Posted by webmastersun (Post 2487107)
The same result.

Since you posted this in the other thread:
Quote:

Originally Posted by webmastersun (Post 2486933)
I removed cron job command at footer template, it is reason cause error and didn't show users online by IDs ?

Then, of course, this will not work. But you'll have other issues if your cronjobs do not work. Why in heaven would you remove the cronjob command?

BTW: If you want any answers from me, post in this thread. I will not monitor any other threads, and I don't do support by PN unless I request you contact me. Plus: Note that this addon is marked as beta, and as not supported. Also, you won't get any more answers if you don't mark the addon as installed.

webmastersun 03-14-2014 08:56 AM

Quote:

Originally Posted by cellarius (Post 2487152)
Then, of course, this will not work. But you'll have other issues if your cronjobs do not work. Why in heaven would you remove the cronjob command?

I added back {vb:raw cronimage} to footer template and amazing that why I added 4 UserIDs but only 1 userid is showed always online :)
must wait for 15 minutes to Cron runs ?

cellarius 03-14-2014 09:33 AM

You need to log in every user at least once, so there is an entry in the session table that can be updated. If you don't do that, it will not work.

The cron runs every ten minutes, and you'll notice a difference only if
1) more time goes by than your normal session timeout (since after that time the user would normaly be no longer shown as currently online)
2) that user does not have any other activity during that time, since then he would be shown as currently online anyway.

I wonder how you would even tell if this addon works if you don't wait at least as long as your session timout. (But keep in mind there needs to be activity on your board for the cron to run, as explained above).

Once again: If you want further answers, mark this addon as installed. I have asked you to do that before, and I think its not too much to ask. I will ignore further questions until you do that.

cellarius 03-14-2014 09:51 AM

New version: 4.2.002

- added option to select usergroups to be always online
- fixed inactivity issue on profile page.

webmastersun 03-14-2014 10:35 AM

Quote:

Originally Posted by cellarius (Post 2487155)
You need to log in every user at least once, so there is an entry in the session table that can be updated. If you don't do that, it will not work.

The cron runs every ten minutes, and you'll notice a difference only if
1) more time goes by than your normal session timeout (since after that time the user would normaly be no longer shown as currently online)
2) that user does not have any other activity during that time, since then he would be shown as currently online anyway.

I wonder how you would even tell if this addon works if you don't wait at least as long as your session timout. (But keep in mind there needs to be activity on your board for the cron to run, as explained above).

I think you should improve it to easy for users. According to me, it's rather complex for using and controlling. May be I set session time out higher than you thus I got result not as my expectation.
It is possible to have a radio button on each user profile so when we can update ( turn on/off status) to show user online immediately ? without waiting for Cron runs. :cool:

or other way to show user that don't need to wait them must not login once to forum ? ...etc

Just my ideas.

Thanks for your new version and I will update next versions and hope it will better than previous.

cellarius 03-14-2014 11:11 AM

You need to log the user in once to create a valid entry in the session table, and you need the cron to simulate user activity. And no, what you suggest is not possible - that's just not how vB works.

If it is really too much trouble for you to install this, enter some userids or usergroup ids in the AdminCP and then log in the users you want this for once, then I'm sorry. This addon does what you asked for in the other thread, in the only way possible that I can think of. If it does not meet your comfort standards, then don't use it. You can always hope someone will come up with a better idea.

I really just whipped this up to help you out. I don't even have use for this myself. (And to tell the truth, this "it's too hard to use, make it easier, do it different although I have no clue myself"-attitude reminds me of why I once decided not to do stuff like that anymore...)

ozzy47 03-14-2014 11:24 AM

Also one of the ways a user may not appear online, that logged in, and you have them set to stay logged in, is if they manually clicked on the log out button. Because what that does is remove their info from the session table, unless of course Cellarius wrote something it to prevent that, I am not sure though, as I have not looked into the code.

cellarius 03-14-2014 11:28 AM

Quote:

Originally Posted by ozzy47 (Post 2487169)
Also one of the ways a user may not appear online, that logged in, and you have them set to stay logged in, is if they manually clicked on the log out button. Because what that does is remove their info from the session table, unless of course Cellarius wrote something it to prevent that, I am not sure though, as I have not looked into the code.

No, I did not provide for that. If people specifically log out, then this is probably what they want to do (and it also is the way to end being permanently online).

ozzy47 03-14-2014 11:30 AM

Absolutely, I was just letting people know another reason someone may not appear as online, and try and blame the mod as not working. :)

cellarius 03-14-2014 11:31 AM

Quote:

Originally Posted by ozzy47 (Post 2487174)
Absolutely, I was just letting people know another reason someone may not appear as online, and try and blame the mod as not working. :)

And right you are :)

webmastersun 03-14-2014 11:48 AM

Quote:

Originally Posted by ozzy47 (Post 2487169)
Also one of the ways a user may not appear online, that logged in, and you have them set to stay logged in, is if they manually clicked on the log out button. Because what that does is remove their info from the session table, unless of course Cellarius wrote something it to prevent that, I am not sure though, as I have not looked into the code.

I think so, It may be reason why user didn't appear online :)

Quote:

Originally Posted by cellarius (Post 2487167)
You need to log the user in once to create a valid entry in the session table, and you need the cron to simulate user activity. And no, what you suggest is not possible - that's just not how vB works.

If it is really too much trouble for you to install this, enter some userids or usergroup ids in the AdminCP and then log in the users you want this for once, then I'm sorry. This addon does what you asked for in the other thread, in the only way possible that I can think of. If it does not meet your comfort standards, then don't use it. You can always hope someone will come up with a better idea.

I really just whipped this up to help you out. I don't even have use for this myself. (And to tell the truth, this "it's too hard to use, make it easier, do it different although I have no clue myself"-attitude reminds me of why I once decided not to do stuff like that anymore...)

I thought it can be easier but no, it depends on vB works, I see that and appreciated your efforts although it's in beta version.

I thought have a better way without using cron job and session, just creating a tick button in user profile to update their status immediately and show them on forum home. But if it's impossible with the way vB works then I can accept that.

For me, a great add-on is easy in using and full functions what a user needs and can run well on all versions or their configurations. :D

I see because this is only your beta version.

Thanks Cellarius!

cellarius 03-14-2014 12:07 PM

Once again: Since the session is the thing that vB determines by whether a user is currently online or not, you can't do it without sessions. Just as you can't show threads without the thread table or posts without the posts table. Like it or not.

So, I'm sorry this does not qualify as a great addon on your scale, but I can live with that. Sadly I have to work with what vB makes possible, not what you wish for. You can always file a suggestion in JIRA, and good luck with that.

Adding a button in the profile to do what the cronjob does for a single user would not be that hard. But what I really can't follow is why you'd rather click on a button in every user's profile every 15 minutes than to have that done automatically with a cronjob, but hey - each to his own I guess. Do you have partners to click through the nightshifts?

Anyway, I still find your attitude extremly annoying. If there was someone out there who coded a perfectly working addon for free on my request, I would surely not continously post that I felt it was too complicated, not comfortable enough and done the wrong way.

And now, just when you're finally forcing yourself to at least "appreciate the effort" and mutter a "thank you", you can't resist to state that you can perfectly understand why it is "only beta" and really not a great addon. As I said before, its miserable figures like you that make coders think twice before offering help.

Just for the record: This addon is no longer beta, and from now on, is (really) unsupported - maybe I'll do bugfixing if a bug in current functionality should be found. It is what it is now, and will not be improved upon. It works as it is, so take it or leave it.

webmastersun 03-14-2014 12:26 PM

Quote:

Originally Posted by cellarius (Post 2487178)
Once again: Since the session is the thing that vB determines by whether a user is currently online or not, you can't do it without sessions. Just as you can't show threads without the thread table or posts without the posts table. Like it or not.

So, I'm sorry this does not qualify as a great addon on your scale, but I can live with that. Sadly I have to work with what vB makes possible, not what you wish for. You can always file a suggestion in JIRA, and good luck with that.

Adding a button in the profile to do what the cronjob does for a single user would not be that hard. But what I really can't follow is why you'd rather click on a button in every user's profile every 15 minutes than to have that done automatically with a cronjob, but hey - each to his own I guess. Do you have partners to click through the nightshifts?

Anyway, I still find your attitude extremly annoying. If there was someone out there who coded a perfectly working addon for free on my request, I would surely not continously post that I felt it was too complicated, not comfortable enough and done the wrong way.

And now, just when you're finally forcing yourself to at least "appreciate the effort" and mutter a "thank you", you can't resist to state that you can perfectly understand why it is "only beta" and really not a great addon. As I said before, its miserable figures like you that make coders think twice before offering help.

Just for the record: This addon is no longer beta, and from now on, is (really) unsupported - maybe I'll do bugfixing if a bug in current functionality should be found. It is what it is now, and will not be improved upon. It works as it is, so take it or leave it.

Exactly :D and of course, everyone is always to find a new & better way for them and the same to me, I will use new add-on if it suits my requirements better yours. But at this time, no more add ons on vB can do better than yours thus I will still use yours although it's not as my expectation ;)

Nirjonadda 03-14-2014 08:45 PM

Please can you try add option "How many time show user online" If member does not come back this period than goes to auto offline. Also add option Enable Mod on/off.


All times are GMT. The time now is 06:18 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02006 seconds
  • Memory Usage 1,854KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete