Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


<< Start < Prev 1 2 3 4 Next > End >>
Get the Pagination hack for Manage Connections
Date: 2007/03/10 06:56 By: parth Status: CB Doc subscriber  
Karma: 1  
Senior Joomlapolitan

Posts: 53
graphgraph
Hello Everyone.

Didnt get time to work on it myself as the main CB project i was working on had a large no of modifications in itself. So finally i got it done from a freelancer called Andrej (Russia). You can get him at Joomlancers. Definitely recommended.

Posting it here. I hope it will be added to next release of CB.
Small fix.

Instructions are as follows, for modified comprofiler.html.php files. For unmodified ones, patched file is attached.


To enable pagination in CommunityBuilder, you need to edit the comprofiler.html.php file located at '/components/com_profiler'. Find the following code around line 1542 ('---' separates code here):

---
<th style='text-align:center;'><?php echo _UE_CONNECTION; ?></th>
<th style='text-align:center;'><?php echo _UE_CONNECTIONTYPE; ?></th>
<th style='text-align:center;'><?php echo _UE_CONNECTIONCOMMENT; ?></th>
</tr></thead>
<tbody>
<?php
---

Exactly after '<?php' tag insert this:

---
/*** PREPARE PAGINATION START ***/
// number of connections per page
define('P_CONNECTIONS_PER_PAGE', 4);

global $Itemid, $limitstart, $limit;

// total number of connections
$total = count($connections);

// index of the first displayed connection
$limitstart = $limitstart ? $limitstart : 0;
$limit = $limit ? $limit : P_CONNECTIONS_PER_PAGE;

// modify array to contain only connections for this page
$connections = array_slice($connections, $limitstart, $limit);
/*** PREPARE PAGINATION END ***/
---

Then scroll down till you find the following code (around line 1600 after first edit):

---
echo "n</tr>";
$i= ($i==1) ? 2 : 1;
}
echo "</tbody>";
echo "</table><br />";
---

After 'echo "</table><br />";' insert this:

---
/*** PAGINATION LINKS START ***/
// include standard Joomla page navigation class
require_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/pageNavigation.php' );

// create the object
$pageNav = new mosPageNav( $total, $limitstart, $limit );

// base link
$link = "index.php?option=com_comprofiler&Itemid=$itemid&task=manageConnections";

// display pagination bar
echo '<center>' . $pageNav->writePagesLinks( $link ) . '</center>';
/*** PAGINATION LINKS END ***/
---

Save the file. Enjoy.



Hope this will be helpful.

Regards

Parth Lawate
File Attachment:
File name: modifiedcomprofiler.zip
File size:16651 bytes

Php-Nuke to Mambo to Joomla...
My Evolution goes on!
Need Joomla Development?
Drop me a mail!
Click here to see the profile of this user The administrator has disabled public write access.

Re:Get the Pagination hack for Manage Connections
Date: 2007/03/10 06:58 By: parth Status: CB Doc subscriber  
Karma: 1  
Senior Joomlapolitan

Posts: 53
graphgraph
You can see the site along with a lot of CB profile view enhancements at visacismag.com You can also see a preview of the pagination links there.
Php-Nuke to Mambo to Joomla...
My Evolution goes on!
Need Joomla Development?
Drop me a mail!
Click here to see the profile of this user The administrator has disabled public write access.

Re:Get the Pagination hack for Manage Connections
Date: 2007/03/28 03:25 By: tonymillan Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 20
graphgraph
The code does not work properly.

It does give you 4 connections per page, or whatever number you define, but when you click on the next page, to see the next 4 connections, you are taken to the same page and still see the first 4 connections.



I tried manually hacking comprofile.html.php and also tried uploading the file with no luck.
Click here to see the profile of this user The administrator has disabled public write access.

Re:Get the Pagination hack for Manage Connections
Date: 2007/03/28 04:00 By: parth Status: CB Doc subscriber  
Karma: 1  
Senior Joomlapolitan

Posts: 53
graphgraph
Thats funny, A it works on all the sites i tried it on. Have you put in the Pagination menu ( page links) in the correct place?
Php-Nuke to Mambo to Joomla...
My Evolution goes on!
Need Joomla Development?
Drop me a mail!
Click here to see the profile of this user The administrator has disabled public write access.

Re:Get the Pagination hack for Manage Connections
Date: 2007/03/30 02:46 By: roverradio Status: CB Doc subscriber  
Karma: 2  
Junior Joomlapolitan

Posts: 30
graphgraph
Same result here. Paginates correctly, but navigation buttons (next, page numbers, etc.) just display the first connections.
Click here to see the profile of this user The administrator has disabled public write access.

Re:Get the Pagination hack for Manage Connections
Date: 2007/07/15 04:46 By: dartagnan Status: User  
Karma: -1  
Junior Joomlapolitan

Posts: 46
graphgraph
Ok this patch works fine but,
I disabled most of my modules on cb profiles and when I click on some of my friends on the first page, no problem, but If I go on the last page of friends for example and click on one profile, I get all the modules like in the frontpage....

why's that?

thanks a lot for any help
Planet Asia Asian tradition culture and community
Click here to see the profile of this user The administrator has disabled public write access.

<< Start < Prev 1 2 3 4 Next > End >>

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC2)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC3, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers at this time.

CB Login