Fork me on GitHub

online/offline user  Bottom

  • I tried to add in an EZComment comment the online/offline status near the name of the user with modifier.onlineoffline.php doing something like that:

    Code

    <!--[$comment.pn_uname]--> - <!--[$comment.pn_uid|onlineoffline|pnvarprepfordisplay]-->


    The code shows the user correctly and then the number of pn_uid icon_frown but the plugin should show "online" or "offline"
    What's wrong with it?



    edited by: arkanoyd, Aug 10, 2009 - 01:05 AM
  • http://code.zikula.org/core/browser/development/zikula-1/system/pnRender/plugins/modifier.onlineoffline.php

    Original description: Smarty modifier to turn a boolean value into a suitable language string

    Code

    <!--[$myvar|onlineoffline|pnvarprepfordisplay]-->
    returns Online if $myvar = 1 and Offline if $myvar = 0


    Code

    function smarty_modifier_onlineoffline($string)
    {
        if ($string != '0' && $string != '1') return $string;

        if ((bool)$string) {
            return _ONLINE;
        } else {
            return _OFFLINE;
        }
    }


    And you are using the user-id - not a boolean.
  • ok, thank you very much, I understood but... didn't solved my problem. Which variable can y use to get that result?



    edited by: arkanoyd, Aug 10, 2009 - 02:55 AM

This list is based on users active over the last 60 minutes.