Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need some help with javascript & php please re Slideshow in a theme
#9
You guys know you can use php code in here right ?

PHP Code:
// list of images to display
    
var A_ITEMS = [<?php
        $s_path 
'img/';
        
$a_types = array ('jpg''gif''jpeg''png');
        
$a_images = array ();
        
$h_dir opendir($s_path);
        while (
$s_file readdir($h_dir)) {
            
$s_type strtolower(substr(strrchr($s_file'.'), 1));
            if (
in_array($s_type$a_types))
                
array_push($a_images"\n\t\t'$s_path$s_file'");
        }
        
closedir($h_dir);
        
sort($a_images);
        echo 
join(','$a_images);
?>
    ]; 
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply


Messages In This Thread
RE: Need some help with javascript & php please re Slideshow in a theme - by shawn_a - 2012-11-17, 04:25:30



Users browsing this thread: 1 Guest(s)