Support » Plugin: Google XML Sitemap for Images » [Plugin: Google XML Sitemap for Images] How to include galleries

Viewing 7 replies - 1 through 7 (of 7 total)
  • same problem, fixed it with same changes
    added this after foreach ($posts as $post) {

    //begin read ngg-pics,
          // post contents [gallery=?] ?, find gallery id / query in wp_ngg_pictures for galleryid,filename,description,alttext
          $content = '';
          $search_expr = '/gallery[ id ]?=[0-9]{0,3}\]/'; //could be better, regex isn't my favourite :-)
          preg_match($search_expr, $post->post_content, $found, PREG_OFFSET_CAPTURE);
          if (count($found) > '0') {
            $foundstring = implode(',',$found[0]);
            $number = '/(\d{1,3})/ '; //find id between 1 - 999
            preg_match($number, $foundstring, $found2, PREG_OFFSET_CAPTURE);
            $gallery = $found2[0][0];
            $_path = $wpdb->get_results ("SELECT path FROM {$wpdb->prefix}ngg_gallery
    							WHERE gid = '".$gallery."'"); // get gallery path
            $pics = $wpdb->get_results ("SELECT filename, description, alttext FROM {$wpdb->prefix}ngg_pictures
    							WHERE galleryid = '".$gallery."'"); //get fileinformation , should be made with one query using JOINS ???
    	      if (empty ($pics)) {
    		    //no pics? do nothing
            	} else { //pics found!
               $domain = get_bloginfo('url');
               $path = $_path[0];
               foreach ($pics as $pic) {
                $content .= '<img src="http://'.$domain.'/'. $path->path .'/'. $pic->filename.'"><br> ';
          $post->post_content .= $content; //attach pics to the original post

    just a beginning, should search also for ‘slideshow’ and ‘album’ and all other nggallery shortcodes.

    i have the same problem… can you please tell me into which file i should insert the code?

    into the image_sitemap.php in the pluginfolder, only tested with the 1.0.1 version of the Google XML Sitemap for Images Plugin. Backup your files bevor!

    Thanks! Will try now….

    unfortunately no success – I am using version 1.0.1 but when added code to file the following warning appears above the header/logo on both my site & admin and the plugin just generated the same sitemap as before with no NextGEN galleries/images:

    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /nfs/c06/h01/mnt/87305/domains/ in /nfs/c06/h01/mnt/87305/domains/ on line 33

    Any advise you may have would be much appreciated!


    headers already sent,
    please read this:
    any blanks or other letters before the <? php in google-image-sitemap.php?
    other suggestion, your editor adds a BOM at the beginning.

    I created a multi-faceted plugin for the same – check it out here

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Google XML Sitemap for Images] How to include galleries’ is closed to new replies.