Editing the Users Online Now Widget Title

Discussion in '[bd] Widget Framework' started by DeltaHF, Sep 16, 2013.

  1. DeltaHF

    DeltaHF New Member

    I'd like to edit the title of the "Users Online Now" widget to include the total number of users online. For example, "123 Users Online". Is there any easy way to do this?

    If needed, I'm comfortable hacking the extraPrepareTitle function in the OnlineUsers.php widget renderer, I'll just need a bit of a hint on the variable name which contains the number of total users online.
     
  2. xfrocks

    xfrocks XenForo rocks!
    Staff Member

    Unfortunately, there is no easy way with the current release of [bd] Widget Framework.

    However, I have added support for that for future release. You can get it right now by using the files in the attachment:
    • Import the XML as an upgrade
    • Copy overwrite OnlineUsers.php to xenforo/library/WidgetFramework/WidgetRenderer/OnlineUsers.php
    • In the title of the widget, use {xen:phrase xf_x_users_online}, you can translate it if you want to. Supported variables are {total}, {members}, {guests}, {robots}.
     

    Attached Files:

  3. DeltaHF

    DeltaHF New Member

    Wow, that's great, it's working perfectly! Thanks so much for the excellent support! :D
     
    xfrocks likes this.
Loading...