MyBB Community Forums
[How To?] Two Things - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [How To?] Two Things (/thread-226079.html)



Two Things - Smh - 2020-01-16

Hi,

Okay so I'm wondering how I would go on about changing the Time Spent Online to text for multiple users. I found this by effone and it seems to work, but I don't know how to extend it for 5+ users. If someone can help, I would appreciate it.

I have template conditionals installed, that's how I got it to work. I just don't know how to extend the code for 5 or more users.

<tr>
<td class="trow2"><strong>{$lang->timeonline}</strong></td>
<td class="trow2">
<if $memprofile['uid'] == 1 then>
Your text here
<else>
$timeonline
</if>
</td>
</tr>



RE: Two Things - .m. - 2020-01-17

you can use in_array function
eg. <if in_array($memprofile['uid'], array(a,b,c,d,e)) then> {note: a,b,c,d,e are user IDs}


RE: Two Things - Omar G. - 2020-01-17

I suppose you could add one custom user profile field for administrators to set a value on users, then check upon that field so you have a user friendly front-end on/off feature for it.

If you wanna go the complex way.