AndrewCzach on "[Plugin: NextGen Gallery] Slideshow to display image title, not description"

June 4, 2011

Hey man, don’t know why no one has responded to this, it’s a pretty easy fix. You need to go into the imagerotator.php file which is actually located in the “XML” folder of the Next Gen. Gallery Folder.

Once you open it you’ll prob see what you need relatively quickly but here it is. There is a section of code under “//Create XML Output” that looks something like this you’ll need to change the code I’ve put in bold:

// Create XML output
header(“content-type:text/xml;charset=utf-8″);

echo “<playlist version=’1′ xmlns=’http://xspf.org/ns/0/’>\n”;
echo ” <title>”.stripslashes(nggGallery::i18n($thepictures[0]->name)).”</title>\n”;
echo ” <trackList>\n”;
if (is_array ($thepictures)){
foreach ($thepictures as $picture) {
echo ” <track>\n”;
if (!empty($picture->description))
echo ” <title>”.strip_tags(stripslashes(html_entity_decode(nggGallery::i18n($picture->description)))).”</title>\n”;
else if (!empty($picture->alttext))
echo ” <title>”.stripslashes(nggGallery::i18n($picture->alttext)).”</title>\n”;
else
echo ” <title>”.$picture->filename.”</title>\n”;
echo ” <location>”.$siteurl.”/”.$picture->path.”/”.$picture->filename.”</location>\n”;
echo ” </track>\n”;
}
}

Change that to $picture->filename or alttext or whatever you want to use instead.

The way it will be written now is whether or not you have descriptive text associated with that picture it will display the title or filename or whatever you changed it too. This is my first post on here so I hope the code posts correctly.

Leave a Comment

Previous post:

Next post: