Something like http://www.accuweather.com/en/free-weather-widgets suitable?Anyone using, or know of, a geocoded weather applet/embed that can be utilised into a raw html widget?
$originalHtml = isset($containerData['sidebar']) ? $containerData['sidebar'] : '';
$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...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:
Replace with:Code:$originalHtml = isset($containerData['sidebar']) ? $containerData['sidebar'] : '';
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']; }
// 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'];
}
// 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();
This doesn't seem to work as @Russ also said.
I guess you can use this: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?
!in_array($_WidgetFramework_positionCode, array('report_list', 'report_view'))
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?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.
What is the difference beetwen:I guess you can use this:
PHP:!in_array($_WidgetFramework_positionCode, array('report_list', 'report_view'))
and!in_array($contentTemplate, array
?!in_array($_WidgetFramework_positionCode, array
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
$contentTemplate is a variable in PAGE_CONTAINER template. You can only use it for that template or its hook.What is the difference beetwen:
and
?
What is the recommended code?
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.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.
We use essential cookies to make this site work, and optional cookies to enhance your experience.