Closed (fixed)
Project:
Node Gallery
Version:
6.x-2.0-alpha7
Component:
Code
Priority:
Critical
Category:
Feature request
Assigned:
Reporter:
Created:
27 May 2009 at 06:39 UTC
Updated:
24 Jul 2009 at 22:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
Plazmus commentedPagination is something that definitely should be included in this brilliant gallery module and as we waiting for Views integration I'm happy that someone wrote a patch.
You saying that it will add pager for gallery list which is absolutely great, but there is still need to put a pager into single galleries for images list.
Can you include that in your patch as well ?
I uploaded 15 images to gallery and I would like to display i.e. 12 on one page.
Comment #2
ranjeeta commentedhey , i got this done for you
just add the attached patch,i hope this is exactly what you are looking for.
Comment #3
mssarath commentedThank you for the code,
for new 2.0 alpha1 release , the code change is implemented in
node_gallery.inc , comment line number 106 , and add this code
$result = pager_query($sql, 20, 0, NULL, $node->nid);
and in node_gallery.module insert this line in line number 513
$vars['gallery'] .= theme('pager', NULL, variable_get('default_nodes_main', 10));
sarath
Comment #4
Plazmus commentedThanks @ranjeeta for the patch and @mssarath for update!
What I think is that maybe one of you guys could add option on "node gallery" configuration page to let specify number of galleries per node and images per gallery after which pager will appear? I assume that not everyone would like to have i.e. the same number of images per gallery page.
Then maintainer of this module could include it in next release.
I can confirm that patch for 6.x-1.x-dev version is working.
Comment #5
dddave commentedWhen the lack of pagination throws a memory error this should be critical, shouldn't it?
Comment #6
ranjeeta commentedi completely agree to you dddave, this is critical, i really dont understand how the pagination part has been missed in this module.
Displaying all the galleries and images in a single page is really not feasible and for huge data it becomes critical.
Comment #7
mssarath commentedHere is the code which add a textfield in common settings section in node gallery section. which ask for number of images to be displayed per gallery
file : node_gallery.admin.inc
line number 26
added , another text field in the same function to hold the value for number of images.
and in node_gallery.inc
line number 105 i changed the $result to
$result = pager_query($sql, variable_get('node_images_page_number', 10), 0, NULL, $node->nid);
giving full function below commented old $result.
and in node_gallery.module in function function node_gallery_preprocess_node(&$vars)
line number 536 added a pager to the galler node
$vars['gallery'] .= theme('pager', NULL, variable_get('default_nodes_main', 10));
complete if statement is given below for reference.
Comment #8
wilson98 commentedcommitted, thanks.
Comment #9
Tally commentedI assume this comment belongs here.
As I am adding more and more images into galleries, I notice that the pagination is off.
For example, I have a gallery with 18 images in it. Node Gallery is set to display 10 images per gallery. When I display the gallery with 18 images, I have 4 pages listed for my pagination. Page 1 has 10 images. Page 2 has 8 images. Pages 3 and 4 are empty and the message: There are no photos in this gallery currently. Upload Some! is displayed.
I have another gallery with 6 images. All six show up on one page in the gallery node, but the pagination links are displayed. The second page has no images displayed.
Now, this is the interesting part. The above is true only for the user who is viewing his own gallery. If another user views the same gallery, the pagination is correct and works as expected.
Comment #10
kmonty#9. - I could not replicate the problem that you described. It seems to work fine for me. If you are still noticing the problem, please reopen the ticket.