| 
Welcome, Guest

Pagination in Manage Connections
(1 viewing) (1) Guest

TOPIC: Pagination in Manage Connections

Get the Pagination hack for Manage Connections 4 years, 11 months ago #33025

  • Posts:
  • Karma:
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

Attachment modifiedcomprofiler.zip not found

Attachments:
Php-Nuke to Mambo to Joomla...
My Evolution goes on!
Need Joomla Development?
Drop us mail! www.tekdi.net - This e-mail address is being protected from spambots. You need JavaScript enabled to view it
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
The topic has been locked.

Re:Get the Pagination hack for Manage Connections 4 years, 11 months ago #33026

  • Posts:
  • Karma:
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 - This e-mail address is being protected from spambots. You need JavaScript enabled to view it
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
The topic has been locked.

Re:Get the Pagination hack for Manage Connections 4 years, 10 months ago #34488

  • Posts:
  • Karma:
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.
The topic has been locked.

Re:Get the Pagination hack for Manage Connections 4 years, 10 months ago #34491

  • Posts:
  • Karma:
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 - This e-mail address is being protected from spambots. You need JavaScript enabled to view it
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
The topic has been locked.

Re:Get the Pagination hack for Manage Connections 4 years, 10 months ago #34623

  • Posts:
  • Karma:
Same result here. Paginates correctly, but navigation buttons (next, page numbers, etc.) just display the first connections.
The topic has been locked.

Re:Get the Pagination hack for Manage Connections 4 years, 7 months ago #40972

  • Posts:
  • Karma:
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
The topic has been locked.
Time to create page: 0.73 seconds