summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoka2015-05-27 23:04:46 (GMT)
committerJoao Ventura2015-05-27 23:04:46 (GMT)
commitf41919b70546a2fd77d6f735d75925f2e263777b (patch)
tree407fdd5fe925dcd661861947eac469501e35ed78
parente083beb155785c7002660c0e778a8ecd6c4b1071 (diff)
Issue #1175194 by doka: Simply use all images in slideshow dir
-rw-r--r--page.tpl.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/page.tpl.php b/page.tpl.php
index 75cd61f..052e4bf 100644
--- a/page.tpl.php
+++ b/page.tpl.php
@@ -188,9 +188,15 @@
<?php endif; ?>
<?php if (!$page['slideshow']) : ?>
<div class="slideshow">
- <img src="<?php print $base_path . $directory; ?>/images/slideshows/sea.jpg" width="950" height="355" alt="slideshow 1"/>
- <img src="<?php print $base_path . $directory; ?>/images/slideshows/noon.jpg" width="950" height="355" alt="slideshow 2"/>
- <img src="<?php print $base_path . $directory; ?>/images/slideshows/snow.jpg" width="950" height="355" alt="slideshow 3"/>
+ <!-- GP start header rotation -->
+ <?php
+ $mask = '/\.(?:jp[e]?g|gif|png)$/i';
+ $files = file_scan_directory(drupal_get_path('theme', 'danland') . '/images/slideshows', $mask);
+ foreach ($files as $filename => $data) {
+ ?>
+ <img src="<?php print $filename; ?>" width="950" height="355" alt="slideshow"/>
+ <?php } ?>
+ <!-- end header rotation -->
</div> <!-- end slideshow -->
<?php endif; ?>
</div>
@@ -345,4 +351,4 @@
<div style="clear:both"></div>
<div id="notice"><p>Theme by <a href="http://www.danetsoft.com">Danetsoft</a> and <a href="http://www.danpros.com">Danang Probo Sayekti</a> inspired by <a href="http://www.maksimer.no">Maksimer</a></p></div>
-</div> \ No newline at end of file
+</div>