Done.
Open: [code:1]/components/com_comprofiler/comprofiler.html.php[/code:1]
Locate:
[code:1] // Tab 1: Manange Connections:
echo $tabs->startTab("myCon",_UE_MANAGECONNECTIONS,"connections"«»);
[/code:1]
Add the following directly below it:
[code:1]
global $database, $my;
$cbCon = new cbConnection($my->id);
$total = $cbCon->getConnectionsCount($my->id);
$connectionsNumber = 10;
$pagingParams = $tabs->_getPaging(array(),array("connections_"«»));
if ($pagingParams["connections_limitstart"] === null)
$pagingParams["connections_limitstart"] = "0";
if ($connectionsNumber > $total)
$pagingParams["connections_limitstart"] = "0";
$query = "SELECT DISTINCT m.*,u.name,u.email,u.username,u.lastvisitDate,c.avatar,c.avatarapproved, u.id, IF(s.session_id=null,0,1) AS 'isOnline' "
. "\n FROM #__comprofiler_members AS m"
. "\n LEFT JOIN #__comprofiler AS c ON m.memberid=c.id"
. "\n LEFT JOIN #__users AS u ON m.memberid=u.id"
. "\n LEFT JOIN #__session AS s ON s.userid=u.id"
. "\n WHERE m.referenceid=". (int) $my->id .""
. "\n AND c.approved=1 AND c.confirmed=1 AND c.banned=0 AND u.block=0 AND m.accepted=1"
. "\n LIMIT ".($pagingParams["connections_limitstart"]?$pagingParams["connections_limitstart"]:"0"«»).",".$connectionsNumber;
;
$database->setQuery( $query );
$connections = $database->loadObjectList();
[/code:1]
Locate: [code:1]foreach($connections AS $connection) {[/code:1]
Scroll to: [code:1]echo "</table><br />";[/code:1]
Add the following directly below it:
[code:1] if ($connectionsNumber < $total) echo "<div style='width:95%;text-align:center;'>".$tabs->_CONSwritePaging($pagingParams,"connections_",$connectionsNumber,$total)."</div>";
[/code:1]
Default connection limit is 10 per page. You may change this by editing:
[code:1]$connectionsNumber = 10;[/code:1]
Open:
[code:1]/administrator/components/com_comprofiler/plugin.class.php[/code:1]
Find:
[code:1]function _writePaging[/code:1]
Add the following function:
[code:1] function _CONSwritePaging( $pagingParams, $postfix, $limit, $total, $task = 'manageConnections' )
{
$base_url = 'index.php?option=com_comprofiler&task='.$task;
$prefix = $this->_getPrefix( $postfix );
return writePagesLinks( $pagingParams[$postfix . 'limitstart'], $limit, $total, $base_url, null, $prefix );
}
[/code:1]
Save and that's it. Manage Connections tab is now paginated.
Post edited by: krileon, at: 2008/12/02 18:17
Post edited by: krileon, at: 2008/12/02 18:46