

The documentation of Modern Guestbook "ve_guestbook" Extension (Version 1.6.11) says that it is possibile to limit the pages displayed in the pageBrowser using maxPages. I was trying that but, I wasn't successful. After looking at the source code i saw, that the code to limit the pages was missing. Now I decided to code that functionality.
To use this you have to add the following lines after line 335 in the file typo3conf/ext/ve_guestbook/pi1/class.tx_veguestbook_pi1.php:
if(ceil($actualPage - $this->internal['maxPages']/2) > 0){
$firstPage=ceil($actualPage - $this->internal['maxPages']/2);
$addLast=0;
}else{
$firstPage=0;
$addLast=floor(($this->internal['maxPages']/2)-$actualPage);
}
if(ceil($actualPage + $this->internal['maxPages']/2) <= $pages){
$lastPage=ceil($actualPage + $this->internal['maxPages']/2) > 0 ? ceil($actualPage + $this->internal['maxPages']/2) : 0;
$subFirst=0;
}else{
$lastPage=$pages;
$subFirst=ceil($this->internal['maxPages']/2-($pages-$actualPage));
}
$firstPage=($firstPage-$subFirst)>0?($firstPage-$subFirst):$firstPage;
$lastPage=($lastPage+$addLast)<=$pages?($lastPage+$addLast):$pages;
or simply download the patch below and copy it to
typo3conf/ext/ve_guestbook/pi1/
Now change to that directory and use the following command:
patch -p0 class.tx_veguestbook_pi1.php class.tx_veguestbook_pi1.php.patch
Download:
class.tx_veguestbook_pi1.php.patch
Have Fun
Helmuth Antholzer


Comments (0)