1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[bd] Widget Framework

Discussion in 'Add-on Releases [Archive]' started by xfrocks, Jan 31, 2011.

Thread Status:
Not open for further replies.
  1. xfrocks

    xfrocks Well-Known Member

    [bd] Widget Framework
    People love widgets

    1. Upload files and directories inside `upload` to XenForo's root directory. Select "Merge" for everything if you are asked
    2. Import the .xml file using XenForo addon importer
    3. Enjoy

    Currently, the addon is packed with the following widgets:
    1. Clear Sidebar
    2. Staff Online Now
    3. Members Online Now
    4. Forum Statistics
    5. Share This Page
    6. Users. 2 modes: order by register_date or message_count
    7. Threads. 4 modes: New threads, Recent threads, Popular threads or Polls
    8. Conditional HTML. Test a PHP expression and display HTML on sidebar
    9. Poll (since 1.0). 2 modes: feature poll and recent poll
    10. Visitor Panel (since 1.0.6)
    11. Recent Status (since 1.0.9)

    You can group your widgets with tabbed interface. If you happen to have too many widgets, you can use the "random" feature to display only one of them at a time.

    I have seen many people releasing sidebar related addon on xenforo.com. The idea is the same: adding something to a page's sidebar. With the hook, developer can easily modify XenForo's sidebar, no big deal. The problem is each developer prefers a different way to do the job and forums administrator will have difficulties to manage all the stuff on their sidebar. With this framework, that problem is gone. Adminsitrator can manage all the widgets in one place, temporary disable one widget is simple as a click. The order can also be changed (well, not support drag and drop yet, sorry for that).

    Also, anyone who wants to develop widget to use with the framework can do it in just a few steps. The framework will take care of everything and developers only need to focus on getting the business done. There are 2 things to do: listen to code event "widget_framework_ready", push your class name in to the array to register your widget renderer. After doing so, you can start coding your renderer by extending the base class "WidgetFramework_WidgetRenderer"
    class MyWidget_WidgetA extends WidgetFramework_WidgetRenderer {
    There are some abstract methods you will have to implement to make it work, just dig into the code and figure it out. If you got lost, feel free to contact me: pony@xfrocks.com

    One last thing, the framework really care about performance. In perfect conditions, no matter how many widgets you have, the framework only execute 1 additional query. I tried to cache as much as possible. The widget list is stored in XenForo's simple cache system while the rendered widgets are stored with Data Registry. Each renderer doesn't have to handle caching, the framework does that for all widgets. All templates are preloaded with the main page template also. Headache no more ;)

    Attached Files:

    RockyR, Sadik B, graham_w and 59 others like this.
  2. xfrocks

    xfrocks Well-Known Member

    Version 1.0.7, 17-04-2011
    - Added option to hide visitor panel in the Empty widget
    - Added option to show polls in the Threads widget
    - Added "random" group feature
    - Added Visitor Panel widget
    - Removed other add-on widgets
    - Changed Share widget to Share This Page. It can now be used with any position

    Version 1.0.4, 16-03-2011
    - Fix Threads widget cache issue

    Version 1.0.3, 11-02-2011
    - Fix tab group invalid characters

    Version 1.0.2, 11-02-2011
    - Fix Share widget
    - Fix Poll widget

    Version 1.0.1, 10-02-2011
    - Fix problem with "all" position

    Version 1.0, 10-02-2011
    - Expression for all widgets
    - Tabbed wrapper for all widgets
    - Now supports "all" position
    - Now supports multiple positions (comma separated)
    - Default widgets changed:
    + Threads: allow forums inclusion now
    + Forum Stats, Online Staff, Online Users: work across the forums now
    - Added new default widgets:
    + [Forum List Only] [GP] Donations (removed in 1.0.7)
    + [Forum List Only] TaigaChat (removed in 1.0.7)
    + xfShout (removed in 1.0.7)

    Attached Files:

    Moses, Rob Fritz, nrep and 23 others like this.
  3. ddmmh

    ddmmh Well-Known Member

    Nice, waiting for screenshots and zip file :)
  4. steven s

    steven s Well-Known Member

    >7. Threads. 4 modes: New threads, Recent threads, Popular threads or all of them (tabbed interface)<
    Will they be based on permissions?
  5. xfrocks

    xfrocks Well-Known Member

    Veer, karev, laztrix and 1 other person like this.
  6. steven s

    steven s Well-Known Member

    Peggy and karev like this.
  7. xfrocks

    xfrocks Well-Known Member

    Done :D
    laztrix likes this.
  8. yavuz

    yavuz Well-Known Member

    There is a lot of addons to lose now, thank you xfrocks. This addon just rock :)
  9. iTuN3r

    iTuN3r Well-Known Member

    Now that's one hell of a add-on :p You rock dude :)
  10. kkm323

    kkm323 Well-Known Member

    this looks great, thought, it would be greater if you can integrate statue update , recent activity
    and top poster for the last 30 days
    this mod rock thanks
    Veer likes this.
  11. xfrocks

    xfrocks Well-Known Member

    The idea is to make a solid framework so widget developing can be fun :D I have other things in priority but your idea is good to have anyway ;)
    Veer and laztrix like this.
  12. jadmperry

    jadmperry Well-Known Member

    Downloaded, Voted MOTM (oops, wrong site)!
  13. ragtek

    ragtek Guest

    nice one:)

    I also get the idea for a "sidebar widget add-on" yesterday, but nice to see that i don't need to code it:)

    You have realy great addons
  14. ragtek

    ragtek Guest

    holly **** this is really a nice one!!!!wow

    I have only two suggestion: use phrases for widget titles and the positioning (conditionals & display order) could be more userfriendly^^ (drag & drop and

    could be "hard" for the avarage users here;)
    Veer and Romchik® like this.
  15. JVCode

    JVCode Well-Known Member

    There's an issue with the lastest thread tabs when using a dark style

  16. ragtek

    ragtek Guest

    Are you sure that this works?

    ATM i have 30 queries on the index page
    when i deactive the addon => 25 queries

    so there are 5 new queries;)
    Romchik® likes this.
  17. Sador

    Sador Well-Known Member

    This looks really interesting. However, will this also take care of other addons which have placed things in the side bar before? If not, could there be a way to somehow be able to manage where they are located as well? Because I really like the idea, but if it only works with side bar things that are specifically created as a widget for your addon, it wouldn't be nearly as useful..
  18. ragtek

    ragtek Guest

  19. ragtek

    ragtek Guest

    I'm having problems creating own widgets!

    1. i've created my file
    class WidgetFramework_WidgetRenderer_Addons extends WidgetFramework_WidgetRenderer_Threads {

        protected function 
    _getConfiguration() {
            return array(
    'name' => 'Addons',
    'options' => array(
    'type' => XenForo_Input::STRING,
    'cutoff' => XenForo_Input::UINT,
    'limit' => XenForo_Input::UINT,
    'useCache' => true,
    'useWrapper' => false,

            protected function 
    _render(array $widget$templateName, array $paramsXenForo_Template_Abstract $renderTemplateObject) {
    $threadModel XenForo_Model::create('XenForo_Model_Thread');
    $nodeModel XenForo_Model::create('XenForo_Model_Node');

    $new $threadModel->getThreads(
    'forum_ids' => $forumId XenForo_Application::get('options')->ragtek_AddonForumId,
    'order' => 'post_date',
    'orderDirection' => 'desc',
    'join' => XenForo_Model_Thread::FETCH_AVATAR,
    // 'readUserId' => XenForo_Visitor::getUserId(),
                        // 'includeForumReadDate' => true,
    'limit' => $widget['options']['limit'],

    $renderTemplateObject->setParam('useTabs'$tabs 0);

    2. i'm injecting
    $renderers[] = 'WidgetFramework_WidgetRenderer_Addons';
    at event "widget_framework_ready"

    It seems that it's working, because i can create a new add-on widget, when i save it, i don't get an error message, it shows "widget saved successfully" but i can't see it on the widget list and it's also not saved in the xf_widget table.
  20. Alluidh

    Alluidh Well-Known Member


    Only a question. Why are checkboxes on the "List Widgets"-page? You are only able to see the status on this page but your not able to change the status there.
Thread Status:
Not open for further replies.

Share This Page