Resource icon

[bd] Widget Framework 2.6.6

No permission to download
@xfrocks when using a Widget Page and setting it as your site index/homepage, the opengraph meta type for the page is being set to 'article' when it should be being set to 'website'.
Could this be corrected in the next release please.
 
I have a light & dark theme, and have a facebook "like" box for a facebook page. Sadly, facebook doesn't allow custom injection of CSS to modify any of their like boxes, the only option I have is to set their color scheme to either light or dark.

Dark = works good on the light theme
Light = works good on the dark theme

Can I have the dark version showing only on the dark theme and for the rest, the light version?
 
Hi there, great program by the way awesome.
I have advertisers that will give me a image and I link to thier site, is pretty easy concept.
How would I do that in the WFW ? all images will be small enough to add, so wondered how
and where they could be put using this. Newbie so could use specifics a bit too.

Thank You
 
You could use an HTML widget I think it would be Advanced HTML with or without wrapper. Xfrocks also has an add-on called rotating ads that could probably be better for what you are trying to achieve.
 
I have some questions regarding the Threads widget:
  1. Threads Cutoff means that it will ignore threads that are older than the value specified there? If so it's not working.
  2. How do I prevent closed threads from being displayed in the list?
  3. Why the thread prefixes aren't being displayed? What's the function of the Thread Prefixes setting? It allows to display prefixes? I have even tried to select the prefixes I want to get displayed but they aren't appearing.
And I think I found a bug:

In the Birthday widget, if you set the limit to "0" then it will properly displayed today's birthdays (56 in my case). However if you limit this (in my case, to 10) it will display just one birthday.
 
Last edited:
I have one question, I am using the feedreader widget but I want to know How I can wrap each title in <li> tags to seperate them more.
 
Anyone using, or know of, a geocoded weather applet/embed that can be utilised into a raw html widget?
 
Widget Framework clears the sidebar of other sidebar mods even if Clear Sidebar isn't used. I made the following change and it works now with other mods. Please update the add-on. I put comments in the new code to explain why the changes are needed.

In library/Widget_Framework/Core.php, find:
Code:
$originalHtml = isset($containerData['sidebar']) ? $containerData['sidebar'] : '';
Replace with:
Code:
        $originalHtml = '';

        // passed to container as $controller->responseView(..., ..., ..., $containerParams)
        // rarely used since Framework uses the below and XenForo is kind enough to overwrite $params with $extraContainerData
        // before reaching this step
        if (isset($params['sidebar']))
        {
            $originalHtml .= $params['sidebar'];
        }

        // passed as empty $__extraData to the template_post_render event
        // other listeners might populate it
        if (isset($containerData['sidebar']))
        {
            $originalHtml .= $containerData['sidebar'];
        }

        // aside from template_post_render, the only way other mods can store container sidebar after framework is enabled
        // due to XenForo behavior noted previously
        $extraContainerData = XenForo_Template_Public::getExtraContainerData();

        if (isset($extraContainerData['sidebar']))
        {
            $originalHtml .= $extraContainerData['sidebar'];
        }
 
Widget Framework clears the sidebar of other sidebar mods even if Clear Sidebar isn't used. I made the following change and it works now with other mods. Please update the add-on. I put comments in the new code to explain why the changes are needed.

In library/Widget_Framework/Core.php, find:
Code:
$originalHtml = isset($containerData['sidebar']) ? $containerData['sidebar'] : '';
Replace with:
Code:
        $originalHtml = '';

        // passed to container as $controller->responseView(..., ..., ..., $containerParams)
        // rarely used since Framework uses the below and XenForo is kind enough to overwrite $params with $extraContainerData
        // before reaching this step
        if (isset($params['sidebar']))
        {
            $originalHtml .= $params['sidebar'];
        }

        // passed as empty $__extraData to the template_post_render event
        // other listeners might populate it
        if (isset($containerData['sidebar']))
        {
            $originalHtml .= $containerData['sidebar'];
        }

        // aside from template_post_render, the only way other mods can store container sidebar after framework is enabled
        // due to XenForo behavior noted previously
        $extraContainerData = XenForo_Template_Public::getExtraContainerData();

        if (isset($extraContainerData['sidebar']))
        {
            $originalHtml .= $extraContainerData['sidebar'];
        }
Interesting. I wonder a few things...

PHP:
// passed to container as $controller->responseView(..., ..., ..., $containerParams)
        // rarely used since Framework uses the below and XenForo is kind enough to overwrite $params with $extraContainerData
        // before reaching this step
        if (isset($params['sidebar']))
        {
            $originalHtml .= $params['sidebar'];
        }
You meant dev can put sidebar into $params (the third parameter of responseView) and have it show up? I believe the correct way to generate sidebar from a template is using <xen:sidebar /> and the compiler tag will put contents into $containerParams.


PHP:
// aside from template_post_render, the only way other mods can store container sidebar after framework is enabled
        // due to XenForo behavior noted previously
        $extraContainerData = XenForo_Template_Public::getExtraContainerData();
XenForo merge container data from templates and put them all into ExtraContainerData to use later (when rendering PAGE_CONTAINER). The idea here is to change sidebar of the current template only, that means renderWidgetsFor may run for more than once for a request and change sidebar a few times as needed.

So, I'm not going to merge your change unless you can demonstrate some conflict. I can only think of one case where this matters: some controller use XenForo_ControllerResponse_View with subView and admin configure widgets for the wrapper template. In that case the wrapper's sidebar will overwrite the subView's sidebar (XenForo_Application::mapMerge replace the string completely, it doesn't append) therefore clearing subView's sidebar.
 
This doesn't seem to work as @Russ also said.
Hey @xfrocks quick question have a client who's using a global sidebar with the clear all state, except it removes everything in the report area too, is there some conditional around this, such as using position all, but an expression to not clear it on the reports page?
I guess you can use this:

PHP:
!in_array($_WidgetFramework_positionCode, array('report_list', 'report_view'))
 
Interesting. I wonder a few things...

I can only think of one case where this matters: some controller use XenForo_ControllerResponse_View with subView and admin configure widgets for the wrapper template. In that case the wrapper's sidebar will overwrite the subView's sidebar (XenForo_Application::mapMerge replace the string completely, it doesn't append) therefore clearing subView's sidebar.
This is actually the case I am dealing with. I spent hours last night trying to find out what was happening. Is there a way to work around this issue?
 
Currently trying out the new XF 1.3 with this add-on on my test site and I have noticed that when using the widgets in a sidebar on non-forum pages I am seeing this query twice:

Code:
SELECT session_activity.*
    ,
    user.*,
    user_profile.*,
    user_option.*
FROM xf_session_activity AS session_activity

    LEFT JOIN xf_user AS user ON
        (user.user_id = session_activity.user_id)
    LEFT JOIN xf_user_profile AS user_profile ON
        (user_profile.user_id = user.user_id)
    LEFT JOIN xf_user_option AS user_option ON
        (user_option.user_id = user.user_id)
WHERE (session_activity.view_date > 1394552872)
ORDER BY session_activity.view_date DESC

Run Time: 0.000644
Select Type    Table    Type    Possible Keys    Key    Key Len    Ref    Rows    Extra
SIMPLE    session_activity    system    view_date                   1    
SIMPLE    user    const    PRIMARY    PRIMARY    4    const    1    
SIMPLE    user_profile    const    PRIMARY    PRIMARY    4    const    1    
SIMPLE    user_option    const    PRIMARY    PRIMARY    4    const    1

One the forum index, it only appears once though? If I disable the Staff/Members online now widgets it disappears.
 
What is the difference beetwen:

and

?
What is the recommended code?
$contentTemplate is a variable in PAGE_CONTAINER template. You can only use it for that template or its hook.
$_WidgetFramework_positionCode is a special [bd] Widget Framework variable. You can use it in any widgets. Its value is the position being rendered.

Currently trying out the new XF 1.3 with this add-on on my test site and I have noticed that when using the widgets in a sidebar on non-forum pages I am seeing this query twice:

Code:
SELECT session_activity.*
    ,
    user.*,
    user_profile.*,
    user_option.*
FROM xf_session_activity AS session_activity

    LEFT JOIN xf_user AS user ON
        (user.user_id = session_activity.user_id)
    LEFT JOIN xf_user_profile AS user_profile ON
        (user_profile.user_id = user.user_id)
    LEFT JOIN xf_user_option AS user_option ON
        (user_option.user_id = user.user_id)
WHERE (session_activity.view_date > 1394552872)
ORDER BY session_activity.view_date DESC

Run Time: 0.000644
Select Type    Table    Type    Possible Keys    Key    Key Len    Ref    Rows    Extra
SIMPLE    session_activity    system    view_date                   1   
SIMPLE    user    const    PRIMARY    PRIMARY    4    const    1   
SIMPLE    user_profile    const    PRIMARY    PRIMARY    4    const    1   
SIMPLE    user_option    const    PRIMARY    PRIMARY    4    const    1

One the forum index, it only appears once though? If I disable the Staff/Members online now widgets it disappears.
The widget will not execute its query in forum_list because it knows it can reuse data, therefore you will only see one query there. For any other pages, it will execute its own query so you may see two queries.
 
Top Bottom