CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #2004

M-ID/0000466: List of todays online users does not work correctly

Added by Björn Detert over 4 years ago. Updated over 2 years ago.

Status:Rejected Start date:0011-02-08
Priority:-- undefined -- Due date:
Assignee:- % Done:

0%

Category:Portal information
Target version:-
Votes: 0

Description

The rendering of the todays onliner does something completely wrong.
The function getTodayUsers calls the function getUsersFromTime with todays starttime.
getUsersFromTime searches users by online sessions.
But Users which where online early in the morning won't have any entries in the session table left to which whe may compare the date of this day. So in the list "today was online" many people got lost due to the wrong db query.

My solution was to copy the getUsersFromTime function into getTodayUsers and simplifying this to work as aspected.
Since I'm not able to make a diff at the moment I copy the correct function into the additional Information Field

Additional Information:

function getTodayUsers() {
$time = $this->getTodayDate();
$result = Array(
'users','mods',"admins",'count'
);

$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'u.usergroup, u.'.tx_mmforum_pi1::getUserNameField().', u.uid',
'fe_users u',
'u.lastlogin >= "'.$time.'" AND u.deleted=0 AND u.disable=0 '.$this->getUserPidQuery('u'),
'',
'username ASC'
);
while($arr = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if($postCount) {
$res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'COUNT(*)',
'tx_mmforum_posts',
'poster_id="'.$arr['uid'].'" AND post_time >= "'.$time.'"'.$this->cObj->enableFields('tx_mmforum_posts').' '.$this->getPidQuery()
);
$arr2 = $GLOBALS['TYPO3_DB']->sql_fetch_row($res2);
$arr['postCount'] = $arr2[0];
}
if(t3lib_div::inList($arr['usergroup'],$this->conf['adminGroup'])) $result['admins'][] = $arr;
elseif(t3lib_div::inList($arr['usergroup'],$this->conf['modGroup'])) $result['mods'][] = $arr;
else $result['users'][] = $arr;
}
$result['count'] = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
return $result;
}

History

Updated by Björn Detert over 4 years ago

  • Category set to Portal information

Updated by Martin Helmich over 4 years ago

  • Status changed from New to Accepted
  • Priority changed from -- undefined -- to Should have
  • Target version changed from 0.1.7 to 0.1.8
  • Estimated time set to 2.00

Patch will be included in next version.

Updated by Martin Helmich about 4 years ago

  • Status changed from Accepted to Rejected
  • Priority changed from Should have to -- undefined --
  • Target version deleted (0.1.8)
  • Estimated time deleted (2.00)

The function getTodayUsers() does not query the fe_sessions table, but rather the sys_stat table.

Also available in: Atom PDF