Resource icon

[bd] Widget Framework 2.6.6

No permission to download
Thanks. What template should I edit?
File: xenforo/library/WidgetFramework/Extend/Model/Thread.php
Line 61
PHP:
if (!empty($fetchOptions['last_post_join']) AND empty($fetchOptions['join'])) {

Replace with
PHP:
if (!empty($fetchOptions['last_post_join'])) {

Please note that this edit is just a temporary workaround to make it works with User Essentials.
 
File: xenforo/library/WidgetFramework/Extend/Model/Thread.php
Line 61
PHP:
if (!empty($fetchOptions['last_post_join']) AND empty($fetchOptions['join'])) {

Replace with
PHP:
if (!empty($fetchOptions['last_post_join'])) {

Please note that this edit is just a temporary workaround to make it works with User Essentials.
It worked great!
 
Another question: How can I bypass the cache for "Recent threads". It take very long time for the avatars to show up. I'm not really sure what interval the refresh time is set to. I read something earlier in the thread about liveCache. Tried that code but I didn't see any difference.
 
Another question: How can I bypass the cache for "Recent threads". It take very long time for the avatars to show up. I'm not really sure what interval the refresh time is set to. I read something earlier in the thread about liveCache. Tried that code but I didn't see any difference.
You can force a refresh by going to that widget in AdminCP, click Save.
 
Hi,

I have modified the recent thread widget a little bit. Normally when an unregistered visitor is looking at the recent threads in the widget the avatars of the thread creators will be visible. My function will hide the avatar of the thread creator when presented if the visitor looking at it is unregistered in combination with the thread creator being a premium member.

You can see the result in the picture below:

new.webp

The code I use looks like this:

PHP:
<xen:foreach loop="$new" value="$thread">
                    <li>
                    <xen:if is="!{xen:helper ismemberof, $visitor, 2} AND {xen:helper ismemberof, $thread, 12}">
                        <a href="{xen:link members, $thread}" class="avatar Av{$thread.user_id}s" data-avatarHtml="true">
                        <span class="img s" style="background-image: url('styles/default/xenforo/avatars/avatar_s.png')"></span></a>
                    <xen:else />
                        <xen:avatar user="$thread" size="s" img="true" />
                    </xen:if>
                 
                        <xen:include template="wf_widget_threads_thread_title">
                            <xen:set var="$_showPrefix">{$widget.options.display.show_prefix}</xen:set>
                        </xen:include>
 
                        <div class="userTitle">{xen:phrase wf_x_posted, 'user=<a href="{xen:link 'members', {$thread}}">{$thread.username}</a>'} <xen:datetime time="{$thread.post_date}" /></div>
                    </li>
                </xen:foreach>

My problem now, when my special condition is true, is that when the avatar picture with a question mark on it is presented it's larger than the original ones.

When the original function uses <xen:avatar user="$thread" size="s" img="true" /> to present the avatars the sizes are correct for both avatars and generic avatar images. Somehow the following code is not working properly:

PHP:
<a href="{xen:link members, $thread}" class="avatar Av{$thread.user_id}s" data-avatarHtml="true">
                        <span class="img s" style="background-image: url('styles/default/xenforo/avatars/avatar_s.png')"></span></a>

Any pointers is appreciated on how to correct the problem.
 
Hi,

I have modified the recent thread widget a little bit. Normally when an unregistered visitor is looking at the recent threads in the widget the avatars of the thread creators will be visible. My function will hide the avatar of the thread creator when presented if the visitor looking at it is unregistered in combination with the thread creator being a premium member.

You should use it like this

Code:
<a href="{xen:link members, $thread}" class="avatar Av{$thread.user_id}s" data-avatarHtml="true">
                        <img src="styles/default/xenforo/avatars/avatar_s.png" width="48" height="48" alt="xfrocks"></a>

This is required because avatars on sidebar is resized using a CSS statement

Code:
.sidebar .avatarList .avatar img {
width: 32px;
height: 32px;
}
 
You should use it like this

Code:
<a href="{xen:link members, $thread}" class="avatar Av{$thread.user_id}s" data-avatarHtml="true">
                        <img src="styles/default/xenforo/avatars/avatar_s.png" width="48" height="48" alt="xfrocks"></a>

This is required because avatars on sidebar is resized using a CSS statement

Code:
.sidebar .avatarList .avatar img {
width: 32px;
height: 32px;
}
It works perfectly (y) Thanks once again!
 
im trying to show a widget for administrator only (group3) with a hook locations

I am using the following in the expression field.
XenForo_Template_Helper_Core::helperIsMemberOf($visitor, 3)

But its not working, am I missing something. Thanks
 
im trying to show a widget for administrator only (group3) with a hook locations

I am using the following in the expression field.
XenForo_Template_Helper_Core::helperIsMemberOf($visitor, 3)

But its not working, am I missing something. Thanks

It shows up for the wrong user group or else? Which position are you using? The conditional itself looks good enough.
 
It shows up for the wrong user group or else? Which position are you using? The conditional itself looks good enough.
Show up nothing , page container content top is the hook, if I remove the expression it works , I just want to show to me (admin) while i test it
 
Show up nothing , page container content top is the hook, if I remove the expression it works , I just want to show to me (admin) while i test it
Oh, $visitor is not available in the hook positions I think. The add-on only pass through hook params. I will manully add $visitor for all hook positions I think.
 
Back
Top Bottom