Modern Guestbook maxPages Patch

 / Main / Articles / Modern Guestbook 1.6.11 maxPages patch

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

 

 

 


Top 10 Updates

Using lightbox without extension geändert am  13-Jun-2008 14:20:51
Custom field for GMENU alt text geändert am  13-Jun-2008 13:58:07
Extending typoscript properties with stdWrap geändert am  13-Jun-2008 13:54:32
Create menus using data from other tables than "pages" V2  geändert am  24-Mar-2008 13:02:09
Login geändert am  17-Mar-2008 12:47:52
Forum geändert am  17-Mar-2008 10:07:47
Who is Typo3wizard.com geändert am  26-Dec-2007 16:07:32
Menu as un-nested lists (iphone navigation) geändert am  29-Oct-2007 15:05:53
IF Conditions with AND and OR operators geändert am  16-Oct-2007 19:16:04
UserFunc to fix problems with HMENU type "special=updated"  geändert am  16-Oct-2007 18:58:40
Deutsch
Search: