/[pkg-tikiwiki]/trunk/tiki-listmovies.php
ViewVC logotype

Contents of /trunk/tiki-listmovies.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11 - (show annotations) (download)
Tue Jul 11 06:27:24 2006 UTC (6 years, 10 months ago) by marcusb-guest
File size: 1124 byte(s)
Imported into trunk (integration branch).
1 <?php
2 // Initialization
3 require_once('tiki-setup.php');
4
5 if ($handle = opendir('tikimovies')) {
6 while (false !== ($file = readdir($handle))) {
7 if (substr($file,-4,4) == '.swf' and ($file != 'controller.swf')) {
8 $movies[] = $file;
9 }
10 }
11 sort($movies);
12 closedir($handle);
13 }
14
15 // Get the page from the request var or default it to HomePage
16 if(isset($_GET["movie"])) {
17 $movie = $_GET["movie"];
18 } else {
19 $movie = "";
20 }
21
22 $smarty->assign_by_ref('movie',$movie);
23 $smarty->assign_by_ref('movies',$movies);
24
25 if ($movie) {
26 // Initialize movie size
27 $confFile = 'tikimovies/'.substr($movie,0,-4).".xml";
28 //trc('confFile', $confFile);
29 $fh = fopen($confFile,'r') or die($php_errormsg);
30 $config = fread($fh, 1000);
31 fclose($fh) or die($php_errormsg);
32 $width = preg_replace("/^.*?<MovieWidth>(.*?)<\/MovieWidth>.*$/ms", "$1", $config);
33 $height = preg_replace("/^.*?<MovieHeight>(.*?)<\/MovieHeight>.*$/ms", "$1", $config);
34 $smarty->assign('movieWidth',$width);
35 $smarty->assign('movieHeight',$height);
36 }
37 // Display the template
38 $smarty->assign('mid','tiki-listmovies.tpl');
39 $smarty->display("tiki.tpl");
40 ?>

  ViewVC Help
Powered by ViewVC 1.1.5