Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Who's Online

123457

Comments

  • Ahh i see. So it probably would be worth adding them into the standard .htaccess for friendly urls incase anything else uses relative links?
  • so wait, what exactly is a phantom user ? i seem to have one on my site often
  • A phantom user is someone who's opted out of the list and is hiding. If it's a small forum, you can easily do a user search and do a sort:Date; to narrow down who it might be.
  • Hi! Is it possible to move online users list from left panel to separate page Who's Online (page is like Settings, Account etc )?
  • Where do you propose we move it? I am sure it CAN be moved though.
  • For example, we can make a page (maybe with page manager extension) Who's OnLine. This idea has become only because I assume, that with the big number of users calculation and printing of all users can become the reason of slow loading. I am not right?
  • The added load time for the panel should be negligable. The database queries are very light, and even with a lot of active users, you're still not looking at as much data as a very involved thread.

    With that said, it *is* possible to make it a seperate page. But I don't have the spare cycles to do it.
  • In order to get this working with modrewrite set, I changed the link to use GetUrl as Vanilla uses internally.
    $Panel->AddListItem($ListName, $Context->GetDefinition($name["Name"]), "account.php?u=" . $name["UserID"],NULL,"title=\"$TimePast\"");
    replaced with
    $Panel->AddListItem($ListName, $Context->GetDefinition($name["Name"]), GetUrl($Context->Configuration, 'account.php', '', 'u', $name["UserID"]), NULL,"title=\"$TimePast\"");
  • All right. Here is what I need:

    I want to specify who can see the "Who's Online" section. Basically, I only want admins to see it, and for it to not exist to anyone else. Any suggestions of how to setup permissions for this?
  • *bump* - anyone?
  • Bumping again. Any chance of putting permissions on this extension so its only available to those who has been assigned an enabled role?
  • edited September 2006
    Ok, so - me, not being a coder, I decided to take a stab at it. This is what I added to default.php:

    Under
    $Context->Dictionary["MenuOptions"] = "Menu Options"; $Context->Dictionary["HideWhosOnline"] = "Hide the \"Who's Online\" panel"; $Context->Dictionary["Phantom"] = "Hide my username from the \"Who's Online\" panel"; I added:
    $Context->Dictionary['PERMISSION_SEE_WHOS_ONLINE'] = "See \"Who's Online\" panel";

    Then, to set up the actual permission, I added:
    // Default permissions $Context->Configuration['PERMISSION_SEE_WHOS_ONLINE'] = '0';
    This put a new option in my role/permission menu. I gave the admin the ability to see it and left the normal member-role unchecked.

    When I logged in through a member-based account, I could still see it.

    So, I obviously can put the option in the role menu, however, its not actually creating that specific permission. How do I do that?

    I borrowed my additional coding from the new Attachments default.php, but I'm not at the level of understanding where I can see what I am missing.
  • edited September 2006
    I also added this:
    if ($Context->Session->UserID == 0 || ( $AccountUser->UserID != $Context->Session->UserID && !$Context->Session->User->Permission("PERMISSION_SEE_WHOS_ONLINE") )) { header('location:'.GetUrl($Configuration, 'index.php')); die(); } per this discussion

    Still not working. Any thoughts?
  • You don't want hat last block. It code redirects to the main page (sets browser location to index.php).

    Give this a try:if ( $Context->Session->UserID > 0 && $Context->Session->User->Permission('PERMISSION_SEE_WHOS_ONLINE') ) { // extension code that adds list to the panel goes here }
    The code literally means If somebody is signed in, and they have the permission, then do the code between the { }

    If that doesn't work, rather than add your own permission, (Your code looks good to me, but I am not yet that familiar with permissions) you can piggy back this in on another existing permission:if ( $Context->Session->UserID > 0 && $Context->Session->User->Permission('PERMISSION_EDIT_COMMENTS') ) { // code goes here }
  • I tried both, but neither seemed to work as is. Should I be changing anything that you wrote?

    But, regardless, this is how my code currently looks, and no matter if the permission is checked or unchecked, I can still see the Users Online area.

    $Context->Dictionary["MenuOptions"] = "Menu Options"; $Context->Dictionary["HideWhosOnline"] = "Hide the \"Who's Online\" panel"; $Context->Dictionary["Phantom"] = "Hide my username from the \"Who's Online\" panel"; $Context->Dictionary['PERMISSION_SEE_WHOS_ONLINE'] = "See \"Who's Online\" panel"; // Default permissions $Context->Configuration['PERMISSION_SEE_WHOS_ONLINE'] = '0'; if ( $Context->Session->UserID > 0 && $Context->Session->User->Permission('PERMISSION_SEE_WHOS_ONLINE') ) { // extension code that adds list to the panel goes here }
  • I'm still very lost on this. I've read all the documentation, I've searched up and down in the forum, and I just can't see anything that would help me in my quest. Maybe I'm missing something in the Wiki, but is there something that shows you exactly how to set up permissions based on user-roles here in Vanilla?
  • Um, I'm pretty sure that right there should work? That's the way I do it in my extensions.
  • So if its not, what would be causing it from working?
  • That i'm afraid i cant answer. Does the permission setting come up on the roles and permissions screen?
  • Yah, everything appears to be working. However, when I uncheck it for a member, save it, it certainly saves, but it does not effect the user-experience of that role: they can still see Who's Online, regardless of whether or not they have permission to do so.
This discussion has been closed.