Look for This code in member.php function BxDolMember($iMember, &$aSite, &$aDir) { $this->iMember = (int)$iMember; $this->aMemberInfo = getProfileInfo($this->iMember); $this->aConfSite = $aSite; $this->aConfDir = $aDir; parent::BxDolPageView('member'); } And insert this code right after it. function getBlockCode_Members() { $iMaxNum = (int) getParam( "top_members_max_num" ); // number of profiles $aCode = $this->getMembers('Members', array(), $iMaxNum); return $aCode; } function getMembers ($sBlockName, $aParams = array(), $iLimit = 16, $sMode = 'last') { $aDefFields = array( 'ID', 'NickName', 'Couple', 'Sex' ); $iOnlineTime = (int)getParam( "member_online_time" ); //main fields $sqlMainFields = ""; foreach ($aDefFields as $iKey => $sValue) $sqlMainFields .= "`Profiles`. `$sValue`, "; $sqlMainFields .= "if(`DateLastNav` > SUBDATE(NOW(), INTERVAL $iOnlineTime MINUTE ), 1, 0) AS `is_online`"; // possible conditions $sqlCondition = "WHERE `Profiles`.`Status` = 'Active' and (`Profiles`.`Couple` = 0 or `Profiles`.`Couple` > `Profiles`.`ID`)"; if (is_array($aParams)) { foreach ($aParams as $sField => $sValue) $sqlCondition .= " AND `Profiles`.`$sField` = '$sValue'"; } // top menu and sorting $aModes = array('last', 'top', 'online'); $aDBTopMenu = array(); $sMode = (in_array($_GET[$sBlockName . 'Mode'], $aModes)) ? $_GET[$sBlockName . 'Mode'] : $sMode = 'last'; $sqlOrder = ""; foreach( $aModes as $sMyMode ) { switch ($sMyMode) { case 'online': if ($sMode == $sMyMode) { $sqlCondition .= " AND `Profiles`.`DateLastNav` > SUBDATE(NOW(), INTERVAL ".$iOnlineTime." MINUTE)"; $sqlOrder = " ORDER BY `Profiles`.`Couple` ASC"; } $sModeTitle = _t('_Online'); break; case 'last': if ($sMode == $sMyMode) $sqlOrder = " ORDER BY `Profiles`.`Couple` ASC, `Profiles`.`DateReg` DESC"; $sModeTitle = _t('_Latest'); break; case 'top': if ($sMode == $sMyMode) { $oVotingView = new BxTemplVotingView ('profile', 0, 0); $aSql = $oVotingView->getSqlParts('`Profiles`', '`ID`'); $sqlOrder = $oVotingView->isEnabled() ? " ORDER BY `Profiles`.`Couple` ASC, (`pr_rating_sum`/`pr_rating_count`) DESC, `pr_rating_count` DESC, `Profiles`.`DateReg` DESC" : $sqlOrder; $sqlMainFields .= $aSql['fields']; $sqlLJoin = $aSql['join']; $sqlCondition .= " AND `pr_rating_count` > 1"; } $sModeTitle = _t('_Top'); break; } $aDBTopMenu[$sModeTitle] = array('href' => "{$_SERVER['PHP_SELF']}?{$sBlockName}Mode=$sMyMode", 'dynamic' => true, 'active' => ( $sMyMode == $sMode )); } $iCount = (int)db_value("SELECT COUNT(`Profiles`.`ID`) FROM `Profiles` $sqlLJoin $sqlCondition"); $aData = array(); $sPaginate = ''; if ($iCount) { $iNewWidth = BX_AVA_W + 6; $iPages = ceil($iCount/ $iLimit); $iPage = (int)$_GET['page']; if ($iPage < 1) $iPage = 1; if ($iPage > $iPages) $iPage = $iPages; $sqlFrom = ($iPage - 1) * $iLimit; $sqlLimit = "LIMIT $sqlFrom, $iLimit"; $sqlQuery = "SELECT " . $sqlMainFields . " FROM `Profiles` $sqlLJoin $sqlCondition $sqlOrder $sqlLimit"; $rData = db_res($sqlQuery); $iCurrCount = mysql_num_rows($rData); $aOnline = array(); while ($aData = mysql_fetch_assoc($rData)) { $sCode .= '