MyBB Community Forums

Full Version: Show Useragents on Online.php page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
its because he is using the UID for the query, it should be using the session ID. try this:
(2011-04-28, 02:38 PM)pavemen Wrote: [ -> ]
if ($mybb->user['usergroup'] == 4)
{
$query = $db->simple_select("sessions", "useragent", "sid='{$user['sid']}'");
$useragent = $db->fetch_field($query, "useragent");
$user['useragents'] = '<span style="float: right; font-size: 9px;">Useragent: '.$user['useragent'].'</span>';
} 

Thank you very much. This code works. You are amazing Smile

Nice work yaldaram..Its possible to put this on their profile?
(2011-04-30, 04:32 AM)kadhafi Wrote: [ -> ]Nice work yaldaram..Its possible to put this on their profile?

Yes, you've to edit member.php file and add the above php code near memprofile_start hook. After that, add the {$useragents} variable in member_profile template.
Hmm ok i will try it on my test site..Smile
I dont know which part of member.php file i will put those codes..Can you tell me which part? I cant find the memprofile_start hook..
thanks
Thanks.
lol all user agent are all desame...
(2012-01-26, 05:33 AM)rzoneph Wrote: [ -> ]lol all user agent are all desame...

URL or any screenshot ?
(2011-04-28, 02:38 PM)pavemen Wrote: [ -> ]for performance reasons, I would put the query inside the usergroup check as well. no point in running a query that you wont be using

if ($mybb->user['usergroup'] == 4)
{
$query = $db->simple_select("sessions", "useragent", "uid='{$user['uid']}'");
$useragent = $db->fetch_field($query, "useragent");
$user['useragents'] = '<span style="float: right; font-size: 9px;">Useragent: '.$user['useragent'].'</span>';
}

I was gonna say... Smile
It doesn't work when I permit a special usergroup to see the user agents. There is only "Useragent: " displayed. With the orignal code from the first post however it works. Why is that?
Pages: 1 2 3