admin\applications\forums\sources\classes\forums\class_forums.php
$forum_data['full_last_title'] = isset( $forum_data['last_title'] ) ? $forum_data['last_title'] : '';
Add below:
/* (SOS30) Usuários Visualizando Fóruns v1.0.0 */
if ( in_array( $this->memberData['member_group_id'], explode( ',', $this->settings['uvf_grupos'] ) ) )
{
$this->calc();
$forum_data['nmvf'] = $this->get_viewing( $forum_data['id'] );
}
Find:
public function lastXThaw( $idString=array() )
{
return unserialize( $idString );
}
Add below:
/* (SOS30) Usuários Visualizando Fóruns v1.0.0 */
public function get_viewing($f)
{
$v = $this->settings['uvf_subf'] ? $this->calc_viewing( $f ) : $this->data[ $f ];
$v = intval($v);
if ( !$this->settings['uvf_zero'] AND $v == 0 )
{
return null;
}
return str_replace('{num}', $this->registry->getClass('class_localization')->formatNumber(intval($v)), $this->lang->words['sos_nmvf']);
}
public function calc_viewing($f=0, $v=0)
{
$v += intval($this->data[ $f ]);
if (isset( $this->registry->getClass('class_forums')->forum_cache[ $f ] ) && is_array( $this->forum_cache[ $f ] ) )
{
foreach ( $this->registry->getClass('class_forums')->forum_cache[ $f ] as $d )
{
$v = $this->calc_viewing( $d['id'], $v );
}
}
return $v;
}
public function calc()
{
$this->data = array();
$c = ($this->settings['au_cutoff'] != '') ? intval($this->settings['au_cutoff'])*60 : 900;
$t = time()-$c;
$this->DB->build( array( 'select' => 'location_2_id', 'from' => 'sessions', 'where' => "LOWER(location_2_type)='forum' AND running_time>{$t} AND in_error=0"));
$this->DB->execute();
while ($r = $this->DB->fetch())
{
$this->data[intval($r['location_2_id'])]++;
}
}