"Who is online" plugin (onlinestats) - Page 2 "Who is online" plugin (onlinestats) - Page 2
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

"Who is online" plugin (onlinestats)

Started by Joachim Müller, January 16, 2006, 02:34:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lordprodigy


Joachim Müller

this is not a hotline - allow days for answers, not hours! The plugin contrib board is meant as a place for questions on the plugins, not for additional feature requests. You have been speed-posting in the past few days - please understand that the coppermine staff is not your personal helpdesk, try solving your issues on your own first.

Deus

Works brilliantly THANKYOU.
working on 2 standalone installs, and 1 bridged with phpbb.
Nice work nibbler.
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.
(https://daz-stuff.uk/daz/signature.png)

lordprodigy

sorry GauGau. didnt meant to upset you or anyone else. :-[

howie10

This is another great mod/plugin. thanks!

I wonder if there's an easy hack which would also enable you to see a full list of registered users (whether online or not), with the same clickable links to their profiles?  ;D

Paver

Have you seen the "Allow logged in users to view memberlist" setting in the config panel?  Then you should have a link to "usermgr.php" in the top menu.

howie10

Ahh yes, what a fool I am!

I would really like to have this clickable 'memberlist' link as an extra (last) line of the 'who is online' list. Would it be an easy thing to hack myself? I presume it's just a question of copying the code from the relevant section of the main page somewhere into codebase.php

It just seems useful to see which users are actually online, and then click on the full list of members.
Thanks.
:)

Paver

#27
Yup.  You can modify plugins/online/codebase.php yourself to add in that link.  Look for this line:
echo "Registered Users: {$logged_in_names}</td></tr>";
which is in the function online_mainpage().

Then, looking through this line at the lines above it, figure out where you want your link to be.  Then insert a line like the following:
echo '<a href="usermgr.php">Full Member List</a><br />';
(Customize to your liking.  Remember to keep track of the single quotes and double quotes to nest them correctly.)

Oh, if you want to add it after the line I mentioned above, you need to move the tags "</td></tr>" out of that line and into your line, at the end.  These tags close the table cell & row that is used for the who is online block.

edit: Thinking about it some more, I decided that I like it best to replace this line:
echo ($num_users == 1) ? "We have 1 registered user<br>" : "We have {$num_users} registered users<br>";
with this line:
echo "We have <a href=\"usermgr.php\">{$num_users} registered user".(($num_users > 1) ? 's' : '')."</a><br>";

Try it out and see if this is your "best" solution as well.   :)

scottking

I tried installing the plugin as instructed but get the following "There was an error copying the package to the plugins folder."

Any suggestions why I an getting this? Enable plugins is set to yes.

Thanks
Scott

Nibbler

Ensure the plugins directory is writable. If all else fails just extract the archive and upload the folder via FTP then install.

scottking

Quote from: Nibbler on February 05, 2006, 11:55:15 PM
Ensure the plugins directory is writable. If all else fails just extract the archive and upload the folder via FTP then install.


Thanks for the suggestion. It was a permisson issue.  How do I fix the date as it's out of wack. It's currently Feb 05, 2006 07:01 PM but the Users online is showing "Feb 06, 2006 at 04:01 AM"

We have 27 registered users
The newest registered user is nathy
In total there are 5 users online :: 3 Registered, and 2 Guests
Most users ever online: 5 on Feb 06, 2006 at 04:01 AM
Registered Users: Scott King, Catherine, tina

Paver

There's a config option in general settings for "time difference from GMT".

Nibbler

The plugin double counts the timezone I think, once when it writes to the db and then again when it reads.

howie10

Quote from: Paver on February 05, 2006, 09:23:36 PM
Yup.  You can modify plugins/online/codebase.php yourself to add in that link.  Look for this line:
<snip>

Excellent! Thank you. I did a bit more hacking to remove the "most ever.." line. I'm really pleased with it. For any interested parties, my page header code is here: www.pontinshistory.co.uk/images/

lordprodigy

Hello everyone,

As written in my question above, I would like non registered visitors not to be able to view the profiles of registered people. In the "Who is online" block is listed the registered users online and the latest registered user as links to their profiles no matter if Im logged in or not. I think for visitors, the names should be listed as non links, and for registered users as links. How can this be done?

I appreciate your help. thanks.

Nibbler

Should be able to change


        while ($row = mysql_fetch_assoc($result)) {
                $logged_in_array[] = "<a href=\"profile.php?uid={$row['user_id']}\">{$row['user_name']}</a>";
        }


to


        while ($row = mysql_fetch_assoc($result)) {
                $logged_in_array[] = USER_ID ? "<a href=\"profile.php?uid={$row['user_id']}\">{$row['user_name']}</a>" : $row['user_name'];
        }

Paver

@lordprodigy: Even if this plugin does not provide links for guest users, if the guest user types in the profile URL manually, it will be shown.  Keeping this in mind, here's how to remove the links for guest users.

The first change is the one Nibbler posted while I was typing this.

The second is to look for this line:
echo "The newest registered user is <a href=\"profile.php?uid={$newest_user_id}\">{$newest_user_name}</a><br>";
and replace it with this line:
echo "The newest registered user is ".(USER_ID ? "<a href=\"profile.php?uid={$newest_user_id}\">" : '') . $newest_user_name . (USER_ID ? "</a>" : '') . "<br>";

And that should do it.  If you are interested in blocking Guest Users from seeing user profiles, that's a support question outside the purview of this plugin.  You might think it's related, but it's really not since the user profiles are shown in a completely different file.  This plugin merely links to that file (or not, if you apply the changes I noted here).

lordprodigy

This is perfect. Its working great. Its exactly what I needed. Thank you very much for the quick response!

deejaymoni

Hi Paver,

awesome plugin thanks.

But I have a little problem. If I install the Add to Lightbox plugin and this plugin here the lightbox plugin doesn't work correctly the add to lightbox button at the bottom of every thumbnail view is missing.

I have tried to fix it by myself but no chance maybe you have an idea?

Nibbler

Adjust the plugin priority in the plugin manager so that the lightbox plugin is at the end of the list.