cool tech general

bemis

33334
Low rep power
Joined
Mar 7, 2024
Posts
79
Rep Power
160
original phrase:

Code:
... and {count} more.
replaced with:
Code:
... and more, but the widget is too retarded to count how many.

phrase name: ellipsis_and_x_more
I only know xenforo uses PHP, which I admittedly never look at unlessI have to. In PHP though if `count` is a variable, wouldn't it need to be something like:
PHP:
... and {$count} more.
or if it's the `count` function, and there is some object `$users_online` or something like that, something like:
PHP:
... and {count($users_online)} more.
 

Moonlight-Moonlight

11111
Staff member
Elite rep power
Joined
Nov 30, 2023
Posts
9,698
Rep Power
7,540
newp, that just made it appear as {$count}
i changed it to {count} so you can look at it under inspect element if u want
 

bemis

33334
Low rep power
Joined
Mar 7, 2024
Posts
79
Rep Power
160
newp, that just made it appear as {$count}
i changed it to {count} so you can look at it under inspect element if u want
I think that would just show me the rendered HTML output by the server, I don't think I can see the PHP script itself (if I could that wouldn't be good). Is it a commonly used script though? I could try looking at the source for it
 

Moonlight-Moonlight

11111
Staff member
Elite rep power
Joined
Nov 30, 2023
Posts
9,698
Rep Power
7,540
this is the actual template:

Code:
<xf:css src="at_lmo_widget.less"  />

<div class="block"{{ widget_data($widget) }}>
    <div class="block-container">
        <h3 class="block-minorHeader">{{ $title }}</h3>
        <div class="block-body block-row">
            <xf:if is="$outputUsers is not empty">
                <ul class="listInline listInline--comma">
                    <xf:foreach loop="$outputUsers" value="$user"><xf:trim>
                        <li><xf:username user="$user" rich="true" class="{{ !$user.visible ? 'username--invisible' : '' }}" /></li>
                    </xf:trim></xf:foreach>
                </ul>
                <ul class="listInline">
                    <xf:if is="$at_lmo_usercounted_more >= 0">
                        {{ phrase('ellipsis_and_x_more', {'count': $at_lmo_usercounted_more}) }}
                    </xf:if>
                </ul>
            <xf:else />
                {{ phrase('at_lmo_no_members_online_x', {'time': $options.at_lmo_time}) }}
            </xf:if>
        </div>
        <xf:if is="$options.at_lmo_usercount">
            <div class="block-footer">
                <span class="block-footer-counter">{{ phrase('at_lmo_usercount_x_in_y',{
                'count': $at_lmo_usercounted,
                'time': $options.at_lmo_time}) }}</span>
            </div>
        </xf:if>
    </div>
</div>
 

Moonlight-Moonlight

11111
Staff member
Elite rep power
Joined
Nov 30, 2023
Posts
9,698
Rep Power
7,540
widget:
[AnzahTools] Last Member Online 1.2.1
 

Moonlight-Moonlight

11111
Staff member
Elite rep power
Joined
Nov 30, 2023
Posts
9,698
Rep Power
7,540
ellipsis_and_x_more works when it's used in other places, for example followers/following:


it correctly says
>... and 6 more.
considering that the follower counter (which works) uses this
Code:
{{ phrase('ellipsis_and_x_more', {'count': $followingCount - count($following)}) }}
whereas the last members online counter uses this
Code:
{{ phrase('ellipsis_and_x_more', {'count': $at_lmo_usercounted_more}) }}

the problem must be with $at_lmo_usercounted_more



as a temporary measure, im just making it so this is never triggered for now
 

bemis

33334
Low rep power
Joined
Mar 7, 2024
Posts
79
Rep Power
160
considering that the follower counter (which works) uses this
Code:
{{ phrase('ellipsis_and_x_more', {'count': $followingCount - count($following)}) }}
whereas the last members online counter uses this
Code:
{{ phrase('ellipsis_and_x_more', {'count': $at_lmo_usercounted_more}) }}

the problem must be with $at_lmo_usercounted_more



as a temporary measure, im just making it so this is never triggered for now
I think you're right, the underlying script rendering the template maybe isn't injecting that variable as you'd expect it to, or it's of some type/class where you need to call a method on it? e.g. $at_lmo_usercounted_more.count(). otherwise template and things seem to lint properly
 

i…amstevehead

11222
High rep power
Joined
Dec 9, 2023
Posts
4,009
Rep Power
1,791
try inserting this code into the mainframe :weed:

Code:
{{ phrase('nigger_and_butthole_fgt', {'count': $dogecoinCount - count($following)}) }}
 


Write your reply...
Top