Topic: [Request] Where a user is online

Right now on my website I'm using common.php so that it counts users online on the website as well as the forums. What I would like to do if it is even possible is have a page when you click on users online that will show what page all the guests/users are on.

I couldn't find any mods/hacks that do this type of thing. How would I go about even attempting to do this? I know some basic PHP but I'm by no means an expert at any of this. Anyone have any ideas where I could start?

Re: [Request] Where a user is online

Mmm, maybe add a bit to the online table about last_page, make the function add that data in, and have a page that displays what you want from that?

3

Re: [Request] Where a user is online

like this http://dev.hostel.nstu.ru/resources/online.php ? smile

Re: [Request] Where a user is online

it's possable but I'm not sure how to do it.

5 (edited by kurisu 2005-03-28 04:16)

Re: [Request] Where a user is online

Maybe, I'm not quite sure. I don't read Russian tongue

Mind sharing what you did there though big_smile

Edit: After running it through Babelfish... yes, that is exactly what I was looking for big_smile

6

Re: [Request] Where a user is online

ok, i'll share it when i extract it from my site smile
BTW its just a small rewrite of punonline mod for punbb 1.1.5

Re: [Request] Where a user is online

I made a hacked version for 1.2.4 but I advise you not to use it unless you are determind.

Re: [Request] Where a user is online

XuMiX wrote:

ok, i'll share it when i extract it from my site smile
BTW its just a small rewrite of punonline mod for punbb 1.1.5

Great! I can't wait big_smile

Re: [Request] Where a user is online

Maybe i'll release a mod with this when I have time making it. It's not that complicated to do actually but I still need some time to get it right. I'll look at it later today.

10

Re: [Request] Where a user is online

Any news on the progess big_smile

11

Re: [Request] Where a user is online

http://hostel.nstu.ru/~xumuk/punonline.zip

12 (edited by HMEternity 2005-04-04 21:10)

Re: [Request] Where a user is online

Here's my "quick and dirty" translation into English. I wrote it to give users and (especially admins) the most privacy. (I.E. I generalized what they were doing and for admin actions I wrote "Viewing board index")

I had trouble installing this mod, so I did it manually. There are still some bugs in this script, but the script is still very nice. Thank you!

<?php

$lang_online = array(

'Detailed list'              =>        'Detailed List',
'Online list'                =>        'Online List',
'IP'                         =>        'IP',
'Guest'                      =>        'Guest',
'Last action'                =>        'Last Action',
'Time'                       =>        'Time',
'No users'                   =>        'No Users online.',
'online.php'                 =>        'Viewing users online list',
'register.php'               =>        'Registering',
'faq.php'                    =>        'Viewing FAQ',
'calendar.php'               =>        'Viewing Calendar',
'misc.php'               =>            'Miscellaneous',
'message_list.php'           =>        'Managing private messages',
'message_send.php'           =>        'Managing private messages',
'message_delete.php'         =>        'Managing private messages',
'index.php'                  =>        'Viewing board index',
'help.php'                   =>        'Viewing help files',
'login.php'                  =>        'Logging in...',
'post.php'                   =>        'Posting a new message',
'edit.php'                   =>        'Editing...',
'delete.php'                 =>        'Deleting Message(s)',
'profile.php'                =>        'Viewing profile',
'search.php'                 =>        'Searching...',
'userlist.php'               =>        'Viewing user list',
'viewtopic.php'              =>        'Viewing topic',
'viewforum.php'              =>        'Viewing forum',
'admin_index.php'            =>        'Viewing board index',
'admin_bans.php'             =>        'Viewing board index',
'admin_categories.php'       =>        'Viewing board index',
'admin_censoring.php'        =>        'Viewing board index',
'admin_forums.php'           =>        'Viewing board index',
'admin_maintenance.php'      =>        'Viewing board index',
'admin_options.php'          =>        'Viewing board index',
'admin_permissions.php'      =>        'Viewing board index',
'admin_prune.php'            =>        'Viewing board index',
'admin_ranks.php'            =>        'Viewing board index',
'admin_reports.php'          =>        'Viewing board index',
'admin_users.php'            =>        'Viewing board index',
'admin_modules.php'          =>        'Viewing board index',

);

13 (edited by Ataxy 2005-04-04 22:25)

Re: [Request] Where a user is online

the installer gives me this
The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory

but i dont see where to add whats missing

14 (edited by Gizzmo 2005-04-04 22:59)

Re: [Request] Where a user is online

right above the include config add
  define('PUN_ROOT','./');
and it should work

i am workin on updating the code to get it to fit in pun 1.2

EDIT: http://justgizzmo.com/FILES/punonline.zip
the update is done, i just did a little updating of the code so it fits with the pun 1.2 layout and stuff

XuMix if youd like to take this and add this to punres that would be great

15

Re: [Request] Where a user is online

i noticed that it was displaying the ip is it for everybody

16

Re: [Request] Where a user is online

thx giz by the way

17

Re: [Request] Where a user is online

the ip only shows for mods and admin. i checked it on my site.

18 (edited by kurisu 2005-04-05 00:56)

Re: [Request] Where a user is online

Hey,

I installed it on my PunBB and it works very nicely. Very quick and easy to install. Nice work! One question I have though about it.

I include common.php on my website so that I can integrate users online on the forum with users online on the website. When I view the users online page from the mod it shows errors for people that are on my regular website pages and not the forums.

Notice: Undefined index: antileech.php in /full/path/to/online.php on line 56

Do I have to add a line to the lang file for each of my website pages (I have over 200)? Is there any way to just say "Viewing Website" or something like that if they are not on a forum page? Also I believe if they are on my webpage index.php it still says they are on my bb/index.php . I don't know for sure it just seemed like way too many people were on my forums main page. Maybe there is a way to store the full path to the file so that /index.php and /bb/index.php are different.

Great mod just wondering if any of those are possible big_smile

Thanks so much for making this available! Great work!


--------------------
Edit:

I changed line 56 in online.php to:

echo"\t\t\t\t\t".'<td>'.@$lang_online[$user_data['current_page']].'</td>'."\n";

and it fixed that error from showing up even though it's technically still there.


Would there be a way to set a default tag to use if the page the user is on is not in the list in the lang file?

19 (edited by kurisu 2005-04-05 02:13)

Re: [Request] Where a user is online

Ok with my really bad PHP knowledge this is what I came up with:

First I changed current_page to varchar(50) because 20 characters was not long enough for some of my pages.

Then I added the code by line 56 of online.php:

    if ((@$lang_online[$user_data['current_page']]) == '')
    {
        $lang_online[$user_data['current_page']] = "<a href=\"http://www.website.com/".$user_data['current_page']."\">".$user_data['current_page']."</a>";
        echo"\t\t\t\t\t".'<td>'.$lang_online[$user_data['current_page']].'</td>'."\n";
    }     
    else
        echo"\t\t\t\t\t".'<td>'.$lang_online[$user_data['current_page']].'</td>'."\n";

I realize it's really ugly but it gets the job done. If you have any ideas for some nicer/cleaner code please share big_smile

Ignore everything I just wrote I managed to get it all working big_smile Thanks for the great mod!

20 (edited by XuMiX 2005-04-07 14:19)

Re: [Request] Where a user is online

Notice: Undefined index: antileech.php in /full/path/to/online.php on line 56

just add

'antileech.php'               =>        'Smth you can define',

to your lang file ( i just don't like @function use cases)
2 gizmo: thx a lot, I'm not a html guru, so it would take a long time to adapt this mod to punbb 1.2.x
edit:

Do I have to add a line to the lang file for each of my website pages (I have over 200)?

huh... than if its so bad, your decision is the right one

21

Re: [Request] Where a user is online

btw: http://www.punres.org/viewtopic.php?id=308

Re: [Request] Where a user is online

Thanks. It works

23 (edited by Romuald 2005-04-09 15:51)

Re: [Request] Where a user is online

It seems to work fine on 1.2.5. (just modified install_mod.php fort '1.2.5')

// edit :

Bug found.
All the link are <a href"/'.$bla.'"> the / did not return the good URL. Just need to remove it.

Sorry for my french english.
GT4 Club driver France & Forum - Lingerie.