Pagination in Manage Connections

13 years 10 months ago #33025 by parth
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 . '/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

Attachment modifiedcomprofiler.zip not found


Php-Nuke to Mambo to Joomla...
My Evolution goes on!
Need Joomla Development?
Drop us mail! www.tekdi.net - sales@tekdi.net
Our CB extensions :
CB Adsense , CB User RSS, CB-Eventlist My Events & CB-Eventlist Attended Events, CB Network Suggest
Joomla Extensions, Training & Support
techjoomla.com/
Check Out our Joomla extensions at extensions.joomla.org/extensions/owner/tekdi/1
extensions.joomla.org/extensions/owner/techjoomla/1
Attachments:

Please Log in to join the conversation.

13 years 10 months ago #33026 by parth
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 us mail! www.tekdi.net - sales@tekdi.net
Our CB extensions :
CB Adsense , CB User RSS, CB-Eventlist My Events & CB-Eventlist Attended Events, CB Network Suggest
Joomla Extensions, Training & Support
techjoomla.com/
Check Out our Joomla extensions at extensions.joomla.org/extensions/owner/tekdi/1
extensions.joomla.org/extensions/owner/techjoomla/1

Please Log in to join the conversation.

13 years 9 months ago #34488 by tonymillan
Replied by tonymillan on topic Re:Get the Pagination hack for Manage Connections
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.

Please Log in to join the conversation.

13 years 9 months ago #34491 by parth
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 us mail! www.tekdi.net - sales@tekdi.net
Our CB extensions :
CB Adsense , CB User RSS, CB-Eventlist My Events & CB-Eventlist Attended Events, CB Network Suggest
Joomla Extensions, Training & Support
techjoomla.com/
Check Out our Joomla extensions at extensions.joomla.org/extensions/owner/tekdi/1
extensions.joomla.org/extensions/owner/techjoomla/1

Please Log in to join the conversation.

13 years 9 months ago #34623 by roverradio
Replied by roverradio on topic Re:Get the Pagination hack for Manage Connections
Same result here. Paginates correctly, but navigation buttons (next, page numbers, etc.) just display the first connections.

Please Log in to join the conversation.

13 years 6 months ago #40972 by dartagnan
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

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.415 seconds

Facebook Twitter LinkedIn