Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter sjdellis

    (@sjdellis)

    Ok fine. I did it myself from my iPhone. If anyone else needs it… BTW it’s probably badly written – I’m not a programmer. Tks again for NextGen Gallery – brilliant.  

    Edited: nextgen-gallery/lib/shortcodes.php

    Added to: function NextGEN_shortcodes()    
    add_shortcode( ‘galdate’, array(&$this, ‘show_galdate’) );

    Added to: class NextGEN_shortcodes
    function show_galdate( $atts ) {
            
      global $wpdb;
     
      extract(shortcode_atts(array(
                ‘pdate’       => ”,
                ‘template’    => ”
            ), $atts));
          
       $tempdate = date(‘d/m/Y’,strtotime($pdate));

            $pids = $wpdb->get_col(“SELECT pid FROM $wpdb->nggpictures WHERE DATE_FORMAT(imagedate,’%d/%m/%Y’) = ‘{$tempdate}'”);

       $picturelist = nggdb::find_images_in_list( $pids );

    // show gallery
            if ( is_array($picturelist) )
                $out = nggCreateGallery($picturelist, false,”);
            return $out;
        }

    Usage: 
         * [galdate pdate=”M d, Y” template=”filename”] 
         * – pdate is the image date (eg: August 12, 2010)
         * – template is a name for a gallery template, which is located in themefolder/nggallery or plugins/nextgen-gallery/view 

Viewing 1 replies (of 1 total)