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'), '<');
In order to do this you would need to override the block controller and change the queries in the getNextCollection and getPreviousCollection functions.
So the following statement will need tot be edited?
Any thoughts on how this could be done?
$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?
Are you using Concrete 5.6 or 5.7? I can send you a file that should do this.
I'm using 5.6. Thank you that would be very helpful.
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.