I'd like to override pageWindowSize for modules/core/classes/GalleryTheme.class
Where would I set these value? I tried to set it in themes.inc:
function MatrixTheme() {
global $gallery;
$this->setId('matrix');
$this->setName($gallery->i18n('Matrix'));
$this->setDescription($gallery->i18n('Standard Gallery2 look and feel'));
$this->setVersion('1.0.0');
$this->setRequiredCoreApi(array(6, 5));
$this->setRequiredThemeApi(array(2, 1));
$this->setStandardSettings(
array('rows' => 3, 'columns' => 3,
'showImageOwner' => 0, 'showAlbumOwner' => 1,
'albumFrame' => '', 'itemFrame' => '', 'photoFrame' => '',
'colorpack' => '',
'pageWindowSize' => 20,
'showMicroThumbs' => 0,
'sidebarBlocks' => serialize(array(
array('search.SearchBlock', array('showAdvancedLink' => true)),
array('core.ItemLinks', array('useDropdown' => false)),
array('core.PeerList', array()),
array('imageblock.ImageBlock', array()))),
'albumBlocks' => serialize(array(
array('comment.ViewComments', array()))),
'photoBlocks' => serialize(array(
array('exif.ExifInfo', array()),
array('comment.ViewComments', array())))));
}
This did not work for me. Any suggestions?
Posts: 32509
jumpRange and totalPages must be set, to be able to set pageWindowSize too.
the corresponding code is
if (isset($load['jumpRange']) && isset($theme['totalPages'])) {
load -> jumpRange (4th argument of loadCommonTemplateData())
params -> pageWindowSize (3rd argument of loadCommonTemplateData())
totalPages -> set by loadTemplate, usually set for album pages.
Posts: 26
This didn't really help me out.
jumpRange and totalPages is set in the code and pageWindowSize defaults to 6 since the variable is not defined.
where would I define and set this variable?
Posts: 32509
totalPages is a result of the number of items in your album and the number of items you choose to display per page.
pageWindowSize (number) can be set by you in the params array of loadCommonTemplateData()
and jumpRange (true, false) can be set by you in the load array of loadCommonTemplateData().
Posts: 26
Ok, Now we're back to my original question.
I tried to set pageWindowSize in $params (in theme.inc) but it didn't work. What did I do wrong? I don't want to hardcode a value (I did it for now) just in case I start using a different theme...
/*
* --------------------------------------------------------------------------------------
* 'jumpRange'
*/
if (isset($load['jumpRange']) && isset($theme['totalPages'])) {
$page = GalleryUtilities::getRequestVariables('page');
if (empty($page)) {
$page = 1;
}
$windowSize = isset($params['pageWindowSize']) ? $params['pageWindowSize'] : 20;
Posts: 32509
you need to set the $params['pageWindowSize'] in function showAlbumPage() before the loadCommonTemplateData() call.
or
set it in the theme constructor before the theme gets installed.
Posts: 52
Thanks a million Valiant! It just wasn't clear to me at all where this needed to be placed. I was adding in elsewhere in the theme.inc file, in a place where other variables in the $param array were getting declared.
So adding
$params = array_merge(array('pageWindowSize' => 25), $params);
right before the call to the loadCommonTemplateData() function. It worked liked a charm. But then, you already knew it would.
Thanks again for the help. I greatly appreciate it.
Posts: 53
Hello,
I will like to increase the number of page 1… 234567… 10 for example 35
I put the fontion in theme.inc but that does not go.
how then I to make?
or is my error
thank you
best regard
nad
Gallery version = 2.1.2 noyau 1.1.0.2
PHP version = 5.1.6 apache
Serveur Web = Servage.net Cluster (Enhanced Apache)
Base de données = mysql 5.0.15, lock.system=flock
Boîtes à outils = ArchiveUpload, Getid3, NetPBM, ImageMagick, Thumbnail, Gd
Accélération = none, none
Système d'exploitation = Linux node2.c17 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:08:39 EDT 2005 i686
Thème par défaut = matrix
Langage = fr_FR
Navigateur Web = Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Posts: 324
I have been looking for the answer to this for quite some time...thanks for the solution! Now all my page numbers appear on each page and the problem I had with duplicate page number links has stopped. Does anyone have a recommendation for a max number of pages to display at any one time in terms of usability?
Andrew
Architectural Photography
Cityscape and Night Photography
Landscape Photography
Posts: 110
I've been through this and other posts in the forum similar to this, and I simply just don't understand.
Maybe I’m not thinking hard enough about it.
But what I was wondering is, how would I get the pagination in my theme (classic)
To look like this:
Ohh. And if anyone wants to see: http://gallery.picsbypros.com
Posts: 110
I'm gonna bump this and hope for someone to come to my rescue.