Oh okay! Only addons I know that do something like that is Jaxel'x XenPorta, xFrock's Widget Framework, EasyTarget's Poor Man's Portal and Wordpress bridge addons and Mythocal's Portal addon.It doesn't work because the variable (with the online members) isn't available.
You would need an add-on to fetch & output it where ever you want.
<?php
class OnlineUsers_Listener
{
public static function frontControllerPreView(XenForo_FrontController $fc, XenForo_ControllerResponse_Abstract &$controllerResponse, XenForo_ViewRenderer_Abstract &$viewRenderer, array &$containerParams)
{
// First 2 checks are for forum sections that already has the totals so we don't get them twice
if ($controllerResponse instanceof XenForo_ControllerResponse_View && isset($controllerResponse->params['onlineUsers']['total']))
{
$containerParams['totalUsers'] = $controllerResponse->params['onlineUsers']['total'];
}
elseif ($controllerResponse instanceof XenForo_ControllerResponse_View && isset($controllerResponse->params['onlineTotals']['total']))
{
$containerParams['totalUsers'] = $controllerResponse->params['onlineTotals']['total'];
}
else
{
$visitor = XenForo_Visitor::getInstance()->toArray();
$sessionModel = XenForo_Model::create('XenForo_Model_Session');
$onlineUsers = $sessionModel->getSessionActivityQuickList(
$visitor,
array('cutOff' => array('>', $sessionModel->getOnlineStatusTimeout())),
($visitor['user_id'] ? $visitor : null)
);
$containerParams['totalUsers'] = $onlineUsers['total'];
}
}
public static function templatePostRender($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
{
if ($templateName == 'PAGE_CONTAINER')
{
$pos = strpos($content, '<div class="pageBanner"></div>');
if ($pos === false)
return;
$content = substr($content, 0, $pos) . $template->create('online_users', $template->getParams()) . substr($content, $pos);
}
}
}
Please make it an addon sir!!! It's not that I can't be assed, I'm just really busy. I failed an open-book test the other day cause I was spending too much time trying to fix my site. I have never failed an open-book test in my life...8thos - if you're interested in learning I highly recommend giving it a go.
If, like "Jessica Rabbit" you "can't be assed" then let me know, and I'll make it into an add on for you with that code kindly provided by Robbo
No. If anyone is willing to make this an addon that actually works please be my guest. I'd even donate next time I get paid.Were you able to make it work?
Doesn't work.the above posted addon is searching for
so add this to your footer and then it should workCode:<div class="pageBanner"></div>
We use essential cookies to make this site work, and optional cookies to enhance your experience.