Resource icon

[bd] Widget Framework 2.6.6

No permission to download
I'm trying to create a custom Renderer, but due to the lack of(Or inability to find) documentation I cannot for the life of me figure this out, I have the following code inside /library/WidgetFramework/WidgetRenderer/MCStats.php:

http://pastebin.com/b7a4G6sn

Yet I cannot figure out how to add this to the Add Widget->Renderer list, any help?

Register a code even listener for widget_framework_ready, something like this

PHP:
<?php

class YourAddOn_Listener {

public static function widget_framework_ready(array &$renderers) {
$renderers[] = 'YourAddOn_CustomRenderer';
}

}
 
I managed to work perfectly this add-on on XenForo 1.2 Beta 1 changing the entire contents of root/library/WidgetFramework/Extend/DataWriter/Discussion/Thread.php file by
PHP:
<?php
class WidgetFramework_Extend_DataWriter_Discussion_Thread extends XFCP_WidgetFramework_Extend_DataWriter_Discussion_Thread {
    protected function _postSaveAfterTransaction() {
        parent::_postSaveAfterTransaction();
     
        // commented out due to problem with high traffic board
        // since 1.3
        // WidgetFramework_Core::clearCachedWidgetByClass('WidgetFramework_WidgetRenderer_Threads');
        // WidgetFramework_Core::clearCachedWidgetByClass('WidgetFramework_WidgetRenderer_Poll');
    }
 
    protected function _discussionPostDelete() {
        parent::_discussionPostDelete();
     
        WidgetFramework_Core::clearCachedWidgetByClass('WidgetFramework_WidgetRenderer_Threads');
        WidgetFramework_Core::clearCachedWidgetByClass('WidgetFramework_WidgetRenderer_Poll');
    }
}

See on XenFacil.com/foro/

Salud2
I removed the "array, $messages" and $messages from lines 12 and 13 and it worked.

PHP:
  protected function _discussionPostDelete() {
     parent::_discussionPostDelete();


That worked, thanks.
Both carry the same solution

Salud2
 

Code:
An exception occurred: Argument 1 passed to WidgetFramework_WidgetRenderer::_helperGetForumIdsFromOption() must be an array, string given, called in /home/xxx/public_html/library/WidgetFramework/WidgetRenderer/Threads.php on line 73 and defined in /home/xxxx/public_html/library/WidgetFramework/WidgetRenderer.php on line 145

    XenForo_Application::handlePhpError() in WidgetFramework/WidgetRenderer.php at line 145
    WidgetFramework_WidgetRenderer->_helperGetForumIdsFromOption() in WidgetFramework/WidgetRenderer/Threads.php at line 73
    WidgetFramework_WidgetRenderer_Threads->_render() in WidgetFramework/WidgetRenderer.php at line 496
    WidgetFramework_WidgetRenderer->render() in WidgetFramework/Core.php at line 272
    WidgetFramework_Core->_renderWidgetsFor() in WidgetFramework/Core.php at line 202
    WidgetFramework_Core->renderWidgetsFor() in WidgetFramework/Listener.php at line 30
    WidgetFramework_Listener::template_post_render()
    call_user_func_array() in XenForo/CodeEvent.php at line 58
    XenForo_CodeEvent::fire() in XenForo/Template/Abstract.php at line 195
    XenForo_Template_Abstract->render() in XenForo/Template/Public.php at line 110
    XenForo_Template_Public->render() in XenForo/ViewRenderer/HtmlPublic.php at line 119
    XenForo_ViewRenderer_HtmlPublic->renderContainer() in XenForo/FrontController.php at line 601
    XenForo_FrontController->renderView() in XenForo/FrontController.php at line 156
    XenForo_FrontController->run() in /home/xxx/public_html/index.php at line 13
I removed the old framework completely when I upgraded to 1.2
I installed this version just fine, I went to add a "thread" widget and I get this when it's active.
Also I didn't have any options as to what kind of threads to pull like I did before.

Thanks

after playing around "saving and exit" I was able to see what I was expecting and the mod is working correctly.

Here is what I saw the first time when I did "save and continue" then what I'd see when I did "save and exit"

Thanks :)

I had to hit the back button a few times, but this is what it did look like along with the position and other info needed for that screen
wd-1.webp

wd-2.webp
 
Last edited:
It seems to fails javascript to load options form
...
Also I didn't have any options as to what kind of threads to pull like I did before.
Here is what I saw the first time when I did "save and continue" then what I'd see when I did "save and exit"
View attachment 49654
after playing around "saving and exit" I was able to see what I was expecting and the mod is working correctly.
I had to hit the back button a few times, but this is what it did look like along with the position and other info needed for that screen
View attachment 49655
After several attempts, it worked.
Sorry, it's unclear to me that whether you have it working or not?
Fails javascript to load options form? I'm not updated yet. This is what I mean.

Salud2
 
It seems to fails javascript to load options form

After several attempts, it worked.

Fails javascript to load options form? I'm not updated yet. This is what I mean.

Salud2

I guess the problem lies in JavaScript but I have it working in my test instance so... Will need to wait for his confirmation.
 
How to display a widget in a specific thread? :)
Also... it would be handy to be able to have blank title.
 
Last edited:
It would be just awesome somebody post the more advanced stuff to display in very specific places and positions, it would be great in one place to avoid all the questions. :)
Because it is hard to read a 60 pages thread to find where the X thing was posted.
 
It would be just awesome somebody post the more advanced stuff to display in very specific places and positions, it would be great in one place to avoid all the questions. :)
A single page: $page['node_id'] == 50 (change 50 your page id)
A single thread: $thread['thread_id']==31 (change 31 to your id)
A single category: $forum['parent_node_id'] == $3 (change 3 to your id)
Shown in forum 2 and 3: in_array($forum['node_id'], array(2,3))

Place above in box "expression"
 
I updated my forum to 1.1.5 and widget framework to latest version and every time I create a thread or reply it never posts. But when I disable the addon it works.

Any ideas?
 
Top Bottom