[fix]profile book ordering default to last page

13 years 2 weeks ago #121221 by carsten888
profile book has the option to make the items appear in descending order (latest at the bottom). When using pagination, when entering a profilepage it shows the first page (oldest items, which will never change). How to get it to default show the last page with the latest items?

Post edited by: carsten888, at: 2010/01/11 16:21

Please Log in to join the conversation.

13 years 2 weeks ago #121438 by carsten888
the above post was when I was working in version 1.0.

I then found version 1.2. When you set the order of the profile book to 'ascending', you get the oldest one on top, but always go to the first page by default.

to go to the last page by default:

version: 1.2 RC2
file: components/com_comprofiler/plugin/user/plug_cbprofilebook/cb.profilebook.php
line: 628

[code:1]if ( $pagingParams === null )
$pagingParams = '0';
if ( $this->pbconfig->EntriesPerPage > $total )
$pagingParams = '0';


} else {
$pagingParams = '0';
}[/code:1]

change to:
[code:1]if ( $pagingParams === null )
$pagingParams = '0';
if ( $this->pbconfig->EntriesPerPage > $total )
$pagingParams = '0';

//calculate last limitstart-page
$totalpages = ceil($total/$this->pbconfig->EntriesPerPage);
$limitstart = (($totalpages-1)*$this->pbconfig->EntriesPerPage);

} else {
$pagingParams = '0';
}

//set default limitstart
if(JRequest::getVar('profilebookpbposts_limitstart', '')===''){
$pagingParams["pbposts_limitstart"] = $limitstart;
}[/code:1]

Please Log in to join the conversation.

13 years 2 weeks ago #121724 by beat
Thanks for the suggestion and proposal to improve.

#307

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.203 seconds

Facebook Twitter LinkedIn