I'm using v1.8 of cmsms. I've added a jquery slideshow that uses PHP to dynamically grab the images from a given folder. Unfortunately, it also grabs the thumbnail that cmsms generates.
I’m using this code to render images in a given folder for a dynamic slideshow. However, it is including the thumbnails.
The solution I’ve been given is to change the if command:
Code: Select all
$directory = 'uploads/images/slideshow/' . $row['imageName'];
try {
// Styling for images
echo "<div id=\"myslides\">";
foreach ( new DirectoryIterator("" . $directory) as $item ) {
if ($item->isFile()) {
$path = "/newsite/" . $directory . "/" . $item;
echo "<img src=\"" . $path . "\" />";
}
}
echo "</div>";
}
catch(Exception $e) {
echo '<div style=\"line-height: 186px; text-align: center;\">No images found for this player.</div>';
}
Code: Select all
$directory = 'uploads/images/slideshow/' . $row['imageName'];
try {
// Styling for images
echo "<div id=\"myslides\">";
foreach ( new DirectoryIterator("" . $directory) as $item ) {
if ($item->isFile() && !preg_match(‘/^thumb_/’, $item)) {
$path = "/newsite/" . $directory . "/" . $item;
echo "<img src=\"" . $path . "\" />";
}
}
echo "</div>";
}
catch(Exception $e) {
echo '<div style=\"line-height: 186px; text-align: center;\">No images found for this player.</div>';
}
Invalid code entered.
Code: Select all
[color=red]Parse error: syntax error, unexpected '^' in /home/keepsake/public_html/newsite/admin/edituserplugin.php(108) : eval()'d code on line 6[/color]