Exclude pages in the future from next/previous block

Permalink
Is there a way of excluding pages with a future date from showing within the next/previous block? Currently I'm using Concrete 5.6.1.2. I know you can do this when running a pagelist using
$pl->filter('cvDatePublic', date('Y-m-d H:i:s'), '<');

 
hutman replied on at Permalink Reply
hutman
In order to do this you would need to override the block controller and change the queries in the getNextCollection and getPreviousCollection functions.
magpie replied on at Permalink Reply
So the following statement will need tot be edited?

$cID = $db->GetOne('select Pages.cID from Pages inner join CollectionVersions cv on Pages.cID = cv.cID where cvIsApproved = 1 and cvDatePublic > ? and cParentID = ? ' . $systemPages . ' order by cvDatePublic asc', array($currentPage->getCollectionDatePublic(), $currentPage->getCollectionParentID()));


Any thoughts on how this could be done?
hutman replied on at Permalink Reply
hutman
Are you using Concrete 5.6 or 5.7? I can send you a file that should do this.
magpie replied on at Permalink Reply
I'm using 5.6. Thank you that would be very helpful.
hutman replied on at Permalink Best Answer Reply 1 Attachment
hutman
Take this file and rename it from .txt to .php and put it in you /blocks/next_previous directory (you probably have to create this) and clear the cache on your site. Should do the trick for you.