samtiria / nextgen-gallery

Automatically exported from code.google.com/p/nextgen-gallery
0 stars 0 forks source link

Adding gallery to the post in portions with offset #344

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Concept is to add whole gallery in blocks in different places in post, dividing 
gallery and not adding each image. 

ex. [nggallery id=19 pics=11 poffset=2]
pics-number of pictures(in this case 11 pictures)
offset-how many pics to skip.(in this case 2, so start from number 3)
then you can use [nggallery id=19 pics=2 poffset=13]
(this will show 2 pictures, skipping 13)
Changes in code:

shortcodes.php:
 function show_gallery( $atts ) {   
        global $wpdb;

        extract(shortcode_atts(array(
            'id'        => 0,
            'template'  => '',  
            'images'    => false,
            'poffset' =>0,//changes
            'pics'  =>false,//changes   
        ), $atts ));        
// backward compat for user which uses the name instead, still deprecated
        if( !is_numeric($id) )
            $id = $wpdb->get_var( $wpdb->prepare ("SELECT gid FROM $wpdb->nggallery WHERE name = '%s' ", $id) );

        $out = nggShowGallery( $id, $template, $images,$poffset,$pics );//changes       
        return $out;
    }

nggfunctions.php:
Attached file.

Original issue reported on code.google.com by jurij.cz...@gmail.com on 21 Feb 2011 at 9:40

Attachments: