Previous and Next image in gallery is always the same as the current image..

Author Message

Felix Laate

Wednesday 10 November 2004 2:03:33 am

Hi all!

In a gallery the links to the previous and next image always results in the same image as currently is shown...

Here's the code:


 previous_image=fetch_alias( subtree, hash( parent_node_id, $node.parent_node_id,
                                                class_filter_type, include,
                                                class_filter_array, array( 'image' ),
                                                limit, 1,
                                                attribute_filter, array( and, array( $sort_column, $sort_order|choose( '>', '<' ), $sort_column_value ) ),
                                                sort_by, array( $sort_column, $sort_order|not ) ) )
     next_image=fetch_alias( subtree, hash( parent_node_id, $node.parent_node_id,
                                            class_filter_type, include,
                                            class_filter_array, array( 'image' ),
                                            limit, 1,
                                            attribute_filter, array( and, array( $sort_column, $sort_order|choose( '<', '>' ), $sort_column_value ) ),
                                            sort_by, array( $sort_column, $sort_order ) ) ) }



        {section show=is_unset( $versionview_mode )}
        <div class="content-navigator">
			
			<!-- Forrige dersom det finnes -->
		
            {section show=$previous_image}
                
                    <a href={$previous_image[0].url_alias|ezurl} title="{$previous_image[0].name|wash}"><img src="/design/news/images/tilbake.gif"></a>
                
			
			<!-- Dersom forrige ikke finnes -->	
				
            {section-else}
                
                    <img src="/design/news/images/tilbake_tom.gif">
              
            {/section}           

			<!-- Dersom neste bilde finnes -->
			
            {section show=$next_image}
               
                    <a href={$next_image[0].url_alias|ezurl} title="{$next_image[0].name|wash}"><img src="/design/news/images/fram.gif"></a>
                
							
			<!-- Dersom det ikke finnes -->	
				
            {section-else}
                
                    <img src="/design/news/images/fram_tom.gif">
                
            {/section}

Happy for any help!

felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Wenyue Yu

Wednesday 10 November 2004 2:38:49 am

Hi,

I guess the problem is because of fetch_alias operator which may have potential bug. Try fetch function instead.

Regards,
wenyue

Felix Laate

Wednesday 10 November 2004 5:52:12 am

Thanx for your swift answer..

I changed fetch_alias to fetch (and only that). But it didn't do the trick. Di I need to change the whole fetch-funcions?

felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Felix Laate

Wednesday 10 November 2004 11:45:11 am

Ahaaa.. found it. Was obvious I guess.


next_image=fetch('content','tree', hash(parent_node_id, $node.parent_node_id,
                                            class_filter_type, include,
                                            class_filter_array, array( 'image' ),
                                            limit, 1,
                                            attribute_filter, array( and, array( $sort_column, $sort_order|choose( '<', '>' ), $sort_column_value ) ),
                                            sort_by, array( $sort_column, $sort_order ) ) ) }

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 09:09:22
Script start
Timing: Jan 31 2025 09:09:22
Module start 'layout'
Timing: Jan 31 2025 09:09:22
Module start 'content'
Timing: Jan 31 2025 09:09:22
Module end 'content'
Timing: Jan 31 2025 09:09:22
Script end

Main resources:

Total runtime0.0218 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0080 588.6328151.2734
Module start 'layout' 0.00800.0038 739.906336.7266
Module start 'content' 0.01180.0082 776.632894.3750
Module end 'content' 0.02000.0017 871.007837.9922
Script end 0.0218  909.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002611.9576140.0002
Check MTime0.00115.0610140.0001
Mysql Total
Database connection0.00135.801110.0013
Mysqli_queries0.005424.625830.0018
Looping result0.00000.086410.0000
Template Total0.00146.410.0014
Template load0.00104.770110.0010
Template processing0.00041.613710.0004
Override
Cache load0.00073.210010.0007
General
dbfile0.003214.458080.0004
String conversion0.00000.041540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs