1 (edited by Chrippa 2004-01-03 18:13)

Topic: PunOnline

##
##
##        Mod title:  PunOnline
##
##      Mod version:  1.0
##   Works on PunBB:  1.1
##     Release date:  2004-01-03
##           Author:  Christopher Rosell (chrippa@chrippa.org)
##
##      Description:  This mod adds a page where you can see what the logged
##                    in users are doing and if logged in as admin or moderator 
##                    you'll see their IP.
##
##   Affected files:  header.php and index.php 
##
##       Affects DB:  Yes
##
##            Notes:  This is my first PunBB mod. ;)
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

Download here

My first mod, hope everything works.
I have only tested it with 1.1 but it will probably work with other versions too.

Re: PunOnline

Very nice! I believe something like this has been requested before, so good job :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: PunOnline

Wow cool! This makes PunBB even better! Thank you Chrippa! I really like this mod!  big_smile

4

Re: PunOnline

It can't be that hard to make this tiny plugin to fit in pun 1.1.1. Can someone please do it? smile

Re: PunOnline

I've already done it, pick the files from PunBB++ if you want 'em

Note: The files are more or less completely rewritten

6

Re: PunOnline

I'm running PunBB 1.1.2 and I took a chance on installing this mod (I just changed the array to 1.1.2 in install_mod.php)
It loaded OK but doesn't seem to work. Any ideas?

I've been down so long it's beginning to look like up..

Re: PunOnline

Maybe you can gice us a little more information? Like exactly what isn't working? :P

8 (edited by JohnS 2004-03-19 10:46)

Re: PunOnline

It's OK. Works fine now (forgot to upload revised header.php).

I've been down so long it's beginning to look like up..

Re: PunOnline

I tried to install this mod on 1.1.2 but when I ran install_mod.php it returned a statement claiming that it would only work with 1.1.1.

Is there any way around this?

Thanks for th excellent work.

10

Re: PunOnline

Yeah.. As I said above, just open install_mod.php and change the value in the array to 1.1.2 and it will work fine.

I've modified my installation slightly so that only admin and moderators see the 'Detailed List' link so only they can view what members are doing. This was just a personal preference because I didn't want normal users to think that all their activities were being monitored.

I've been down so long it's beginning to look like up..

Re: PunOnline

Great!  Sorry I missed that part.  I appreciate the help.

Thanks again.

12

Re: PunOnline

update_online.php should be like this, not like it is in original

<?php
   $pathinfo = pathinfo($_SERVER['PHP_SELF']);
   $current_page = $pathinfo['basename'];
   $current_ip = get_remote_address();
   if ($current_page == "viewforum.php" || $current_page == "viewtopic.php" || $current_page == "profile.php" || $current_page == "post.php")
   {
    if ($_GET['id']) { $current_page_id = $_GET['id']; $current_page_id=intval($current_page_id); }
    if ($_GET['pid']) {
      $current_topic_id = $db->query('SELECT topic_id FROM '.$db->prefix.'posts WHERE id=\''.$_GET["pid"].'\'') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
      $current_page_id = $db->result($current_topic_id, 0);
    }
    if ($_GET['tid']) { $current_page_id = $_GET['tid']; $current_page_id=intval($current_page_id); }
    
    if ($_GET['fid']) { $current_page_id = $_GET['fid']; $current_page_id=intval($current_page_id); }

   }
//by xumix
   else  $current_page_id = 0;
    if($cur_user['id'] == '')
         
    {   
        $db->query('UPDATE '.$db->prefix.'online SET current_page=\''.$current_page.'\', current_ip=\''.$current_ip.'\', current_page_id=\''.$current_page_id.'\',  user_id=\'0\'') or error('Unable to update online list', __FILE__, __LINE__, $db->error());
    }
//end by xumix
   else $db->query('UPDATE '.$db->prefix.'online SET current_page=\''.$current_page.'\', current_ip=\''.$current_ip.'\', current_page_id=\''.$current_page_id.'\' WHERE user_id='.$cur_user['id'].'') or error('Unable to update online list', __FILE__, __LINE__, $db->error());

13 (edited by Razmooze 2004-06-26 12:24)

Re: PunOnline

Wouldn't it be better if update_online.php was put in its own folder punonline under include? (like the case with punpoll and pms)
I think it would be more well structured that way wouldn't it?

I guess it is only a matter of updating point 6 in the install instructions though...

No electrons were harmed in the creation of this post.
However, many were excited and some may have enjoyed the experience.