Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorbjrn
    • CommentTimeMay 10th 2007
     # 51
    Unless you want something like a Settings preference, or a per-user preference, you can just edit the code of the extension. On line 31 it says $s->AddWhere("u", "DateLastActive", "", "DATE_SUB(NOW(), INTERVAL 5 MINUTE)", ">=", NULL, NULL, 0);
    Just change the 5 to the amount of minutes it should check for, or change 5 MINUTE into 1 DAY to get a whole day.
    • CommentAuthorjehul
    • CommentTimeMay 25th 2007
     # 52
    hi!

    i noticed, that users who logged out are also seen as online until the 5 minute timeout.
    how about adding an "is_online" column, which is also set to true in the UpdateDateLastActive() function.
    after logout is_online is set to false.

    in the GetWhosOnline() we add
    date_sub(...) and is_online=true

    how about this idea?
  1.  # 53
    What determines the order of the Who's Online list? It's not alphabetized and I'm always on top of my list.
  2.  # 54
    Most recent activity I think. Everyone will probably be at the top of their own list.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeJul 3rd 2007
     # 55
    Any chance of someone packing all the enhancements/bugfixes up and making an unofficial release? Or better still, just getting it updated on the addons site :)
    •  
      CommentAuthorsjeeps
    • CommentTimeJul 4th 2007
     # 56
    Is there a way to show the total members and guests count not just when someone is signed in?
    •  
      CommentAuthorMr Do
    • CommentTimeJul 5th 2007
     # 57
    Ok to make whos online appear on pages that use postbackaction (ie PageMaker addon) you need to change the big if statement to this:
    if ((in_array($Context->SelfUrl, array("categories.php", "index.php", "post.php", "comments.php")) && !isset($_GET['PageID']) || ($Context->SelfUrl == "index.php" && isset($_GET['PostBackAction'])))
    && $Context->Session->UserID > 0 && !$Context->Session->User->Preference("HideWhosOnline") ) {

    To make it show count when not signed in, add this code to the end of the file (outside all other methods / ifs):
    if ((in_array($Context->SelfUrl, array("categories.php", "index.php", "comments.php")) && !isset($_GET['PageID']) )
    && $Context->Session->UserID == 0 ) {
    $ListName = $Context->GetDefinition("Who's Online");
    $Panel->AddList($ListName,501);
    $online_list = $WhosOnline->GetWhosOnline();
    $guest_count = $WhosOnline->GetGuestCount();
    $phantom_count = 0;
    $user_count = 0;
    if ($online_list) {
    foreach ($online_list as $name) {
    if ($name["Phantom"]) {
    $phantom_count++;
    }
    if (!$name["Phantom"] || !isset($name["Phantom"]) || $Context->Session->User->Permission("PERMISSION_WHOS_PHANTOM")) {
    $user_count++;
    }
    }
    if ($user_count > 0) {
    $user_string = "$user_count registered user";
    if ($user_count > 1)
    $user_string .= "s";
    $Panel->AddListItem($ListName,'','',$user_string);
    }
    if ($phantom_count > 0) {
    $phantom_string = "$phantom_count phantom user";
    if ($phantom_count > 1)
    $phantom_string .= "s";
    $Panel->AddListItem($ListName,'','',$phantom_string);
    }
    if ($guest_count > 0) {
    $guest_string = "$guest_count guest";
    if ($guest_count > 1)
    $guest_string .= "s";
    $Panel->AddListItem($ListName,'','',$guest_string);
    }
    } else {
    $Panel->AddListItem($ListName,'','',$Context->Dictionary['None online']);
    }
    }
    •  
      CommentAuthor[-Stash-]
    • CommentTimeJul 5th 2007
     # 58
    Go on Mr Do - package up all the fixes/enhancements and create an unofficial update, be a saint ;)
    •  
      CommentAuthorØ
    • CommentTimeJul 5th 2007
     # 59
    With an option for the inline names display please ;)
    •  
      CommentAuthorMr Do
    • CommentTimeJul 5th 2007
     # 60
    hehe okey. i will look into it latertoday. but how/where do I upload such a file? Since im not the OP, I cant edit his stuff.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeJul 5th 2007
     # 61
    Just pop it on your own webspace and leave a link in here, then a mod can update the official one if they want. If you don't have spac eyou can pop it on, just email me and I'll host it.
    •  
      CommentAuthorMr Do
    • CommentTimeJul 6th 2007 edited
     # 62
    Ok here is a link to my version of WhosOnline. It has pagemanager support, shows numbers for guests and shows more than one member per line. Role colouring is commented out. I will make a version with options when I have the time..

    http://alek-3d.be/WhosOnline.rar
  3.  # 63
    Most recent activity I think. Everyone will probably be at the top of their own list.

    Hm. I had someone ask me why they are always at the bottom. The list order doesn't seem to change, for example, I'm always on top and, if Silver is online, she's always second, and deebee is always at the bottom. So if I've got 15 people online the order will never change with those 15.
  4.  # 64
    User ID?
    •  
      CommentAuthorMr Do
    • CommentTimeJul 13th 2007
     # 65
    add this on line 29 (in the function whoisonline, after the $s->AddSelect [..]) $s->AddOrderBy("DateLastActive",'i','DESC');
    and get back to me if that doesnt work.
    • CommentAuthorbjork24
    • CommentTimeJul 26th 2007
     # 66
    For some reason, this extension really slows down my forum. When I SSH in to check the load average, it jumps from 0.10 to 3+ when Who's Online is activated. Anyone else experiencing this problem?
    •  
      CommentAuthorrayk
    • CommentTimeJul 27th 2007
     # 67
    I get the following error when viewing site from another computer and no one is online:

    Notice: Undefined index: None online in .../forums/extensions/WhosOnline/default.php on line 237
    •  
      CommentAuthorrayk
    • CommentTimeJul 28th 2007
     # 68
    Hmm temp fix ;) - error_reporting(E_ALL ^ E_NOTICE); , stick that into top of file... Any one have an idea what is wrong with the Mr Do's version? Line 237 looks like this:
    }
    } else {
    $Panel->AddListItem($ListName,'','',$Context->Dictionary['None online']);
    }
    •  
      CommentAuthorØ
    • CommentTimeJul 30th 2007
     # 69
    I had this issue, and if I remember well, the dictionary definition is missing. Try adding this to your language file:
    $Context->Dictionary["None online"] = "Nobody is online.";
    •  
      CommentAuthorrayk
    • CommentTimeJul 30th 2007
     # 70
    That seems to have worked!
    • CommentAuthorairlock
    • CommentTimeAug 2nd 2007
     # 71
    Hi guys,

    This plugin is giving us serious overhead issues. With the plugin disabled system load looks like this:

    10:23am up 226 days 0:47, 1 user, load average: 0.05, 0.27, 0.23

    With it enabled system load looks like this:

    10:23am up 226 days 0:07, 1 user, load average: 65.32, 45.22, 23.01

    In fact load increases exponentially until the site grinds to a halt and we have to restart the database process.

    We obvioulsy want to use the plugin, but can't in its current form. Has anyone else experienced this issue? And does anyone have any suggestions for reducing the plugins database requirement?

    We recieve around 2 million impressions a month btw.
  5.  # 72
    Hmmm...it seems that this extension doesnt use any sort of caching method so it's performing 2 sql queries for every page load and several calculations following that. My best suggestion is for you (if you're capable) to implement something so that it writes the information to a text file every 5 minutes or so and then just reads from the text file until the information is deemed invalid. Naturally this will cause some delay on the accuracy of the data but it should reduce the load significantly.
    • CommentAuthorairlock
    • CommentTimeAug 2nd 2007
     # 73
    Thanks for this. We have a developer looking at amending the plugin on this basis at the moment. We'll publish the source code here once complete.
  6.  # 74
    Excellent news. I believe the statistics extension uses a form of caching if your developer wants to check that out for some ideas. It shouldn't be too challenging though..
    • CommentAuthorairlock
    • CommentTimeAug 3rd 2007
     # 75
    Hello all,

    We've now finished updating this plugin - you can see results (when signed in) here: http://andymurray.com/community/

    I'll post the update shortly.
    • CommentAuthordyohn
    • CommentTimeAug 25th 2007
     # 76
    Another newbie user question. I just installed "Who's Online" and it shows up in the left frame, however it shows the eight most recent users, not necessarily who is currently on line. The mouse over shows their last activity information (such as 7 hours ago,) the same as appears on their member page. I am interested in knowing who is currently logged in, not who the last eight users were.

    Is there a function I need to enable or something that needs changed in the default.php file?

    Thanks again!
    •  
      CommentAuthor[-Stash-]
    • CommentTimeAug 26th 2007
     # 77
    airlock, any chance of getting the update posted somewhere so we can spread the love throughout the Vanilla community? :)
    •  
      CommentAuthorMr Do
    • CommentTimeSep 4th 2007
     # 78
    @dyohn : The problem with what your looking for is that it is by and large, impossible. The only way the system can show on one computer, what other computers are using the system, is to log requests. In other words, the only time information is traded is on page loads. I can not tell you if there is someone watching their computer screen, only that 20 seconds (or 7 hours ago) their machine requested a page from the system. There is a variable you can set somewhere in the addon (dont have it within easy reach atm) where you can set how long ago you consider (currently online), but thats pretty much all that is possible i am afraid.
  7.  # 79
    I'm sure i posted here....could this be a timezone issue?
    • CommentAuthordyohn
    • CommentTimeSep 4th 2007
     # 80
    Thank you Mr. Do. I understand.

    re: the "7 hours ago" thing. I posted another thread about this, but all users who are either currently logged on or have logged off within the past 7 hours always show their time of last activity as "7 hours ago." It could be some incompatibility with other extensions. I will try disabling everything by Who's Online ans see what happens.
    • CommentAuthorcircuit
    • CommentTimeSep 10th 2007
     # 81
    mr do:
    the fix you suggested for ordering by most recently active user does not work for me.

    $s->AddOrderBy("DateLastActive",'i','DESC');

    i put it on line 29 in the function GetWhosOnline() but i got an undefined index on 'i'.
  8.  # 82
    Try a 'u' instead of the 'i'
    • CommentAuthorcircuit
    • CommentTimeSep 10th 2007
     # 83
    perfect. thank you.
    • CommentAuthorcircuit
    • CommentTimeSep 10th 2007 edited
     # 84
    ooh, another idea:

    say the timeout is set at 15 mins. it'd be nice to be able to style the users active within the last minute as one colour (let's say black), within 5 dark grey, 10 mid grey, and so on.

    when ordered correctly, the username would fade away!

    i haven't got the skills for this but if anyone can teach me i'll try it out! :)


    edit: and maybe it'll work via ajax eh? ;P
    •  
      CommentAuthorblizeH
    • CommentTimeSep 11th 2007
     # 85
    Wouldn't using Ajax add unnecessary strain to the server?
    • CommentAuthorcircuit
    • CommentTimeSep 11th 2007
     # 86
    it's just a 'what if', i wasn't entirely serious, hence the liil' wink at the end.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeSep 11th 2007
     # 87
    You could do it without AJAX, just by wrapping older names in a class (eg. new, old, older) and then adding a little CSS.
    • CommentAuthorcircuit
    • CommentTimeSep 11th 2007
     # 88
    yeah, that's that i thought, i'm not sure i have the skills to do it but it would be cool.
    (sorry, the ajax suggestion was a separate thing and i might have confused the issue a little.)
    •  
      CommentAuthornk
    • CommentTimeSep 12th 2007
     # 89
    Props to Mr Do, thanks for the updated version.
    •  
      CommentAuthorskube
    • CommentTimeDec 31st 2007
     # 90
    Is there an easy way to change the order? (i.e. Order by most recently online instead of listing by User ID)
    • CommentAuthorLoOkHerE
    • CommentTimeJan 20th 2008
     # 91
    Any update on this airlock? I'm having issues with this putting a strain on our server; any chance we could have a look at your version?
    •  
      CommentAuthorskube
    • CommentTimeJan 25th 2008
     # 92
    Is there an easy way to count the number of users currently online?
    •  
      CommentAuthorklip
    • CommentTimeFeb 13th 2008
     # 93
    I'd like to use this add-on (my users request this function), but the latest version from Mr Do gives me 404 and airlock silents.

    Any news, please?
    •  
      CommentAuthorØ
    • CommentTimeMar 2nd 2008
     # 94
    I, too, would like to know if an official update could be made. I'm a bit lost with all of the hacks above :/
    • CommentAuthorbrandonc
    • CommentTimeApr 9th 2008 edited
     # 95
    two things.

    first, there's a fairly serious sql-injection problem with some of the queries in this extension. the contents of the IpHistoryID cookie are not being escaped before being used in a database query.

    here's a quick-fix diff:

    --- WhosOnline-2007-03-14/WhosOnline/default.php 2007-03-14 16:58:58.000000000 -0700
    +++ WhosOnline-2007-03-14-fixed/WhosOnline/default.php 2008-04-09 09:04:34.000000000 -0700
    @@ -103,7 +103,7 @@

    if (isset($_COOKIE['IpHistoryID'])) {
    $s->SetMainTable("IpHistory", "i");
    - $s->AddWhere("i", "IpHistoryID", "", $_COOKIE['IpHistoryID'], "=");
    + $s->AddWhere("i", "IpHistoryID", "", FormatStringForDatabaseInput($_COOKIE['IpHistoryID']), "=");
    $this->Context->Database->Delete($s, $this->Name, "UpdateDateLastActive", "An error occurred while deleting guest pr
    ofile");
    setcookie('IpHistoryID', '', time() - 3600);
    }
    @@ -120,7 +120,7 @@
    $s->Clear();
    $s->SetMainTable("IpHistory", "i");
    $s->AddFieldNameValue("DateLogged", "now()", 0);
    - $s->AddWhere("i", "IpHistoryID", "", $_COOKIE['IpHistoryID'], "=");
    + $s->AddWhere("i", "IpHistoryID", "", FormatStringForDatabaseInput($_COOKIE['IpHistoryID']), "=");
    $result = $this->Context->Database->Update($s, $this->Name, "UpdateGuestLastActive", "An error occurred while loggin
    g user data.");
    } else {
    $my_ip = GetRemoteIp(1);



    second, if you want to order by date last active (most recently active at the top), add the line:

    $s->AddOrderBy("DateLastActive", "u", "desc");

    after the AddWhere statement on line 31.
    •  
      CommentAuthorWanderer
    • CommentTimeApr 9th 2008
     # 96
    What's this line all about... ???

    @@ -120,7 +120,7 @@
  9.  # 97
    That's part of the diff output. It means at line 120 take out the next 7 lines and replace them with the new 7.
    •  
      CommentAuthorHamed
    • CommentTimeApr 9th 2008
     # 98
    and what happens when you do that?
  10.  # 99
    It solves the possible SQL injection stuff he was talking about.
    •  
      CommentAuthorblizeH
    • CommentTimeApr 9th 2008
     # 100
    Many thanks for the neat changes; just tried it though and got this:

    Parse error: parse error, unexpected '-', expecting T_VARIABLE or '$' in /hsphere/local/home/z3std3si/zestdesign.net/_msc/php/extensions/WhosOnline/default.php on line 119

    Which bits exactly did I have to copy, and to where? I copied all of the above code to line 120 but didn't have much luck unfortunately ^

    Cheers