return $mime;
}
-function embed_video($h) {
- /*JASPER FIX, use config->systemurl */
- ?>
- <!-- begin embedded WindowsMedia file... -->
- <table border='0' cellpadding='0' align="center">
- <tr><td>
- <OBJECT id='mediaPlayer'
- classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'
- codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
- standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
- <param name='fileName' value="http://master.squasher.netformatie.nl/?x=asx&f=<?=$h;?>">
- <param name='animationatStart' value='true'>
- <param name='transparentatStart' value='true'>
- <param name='autoStart' value="true">
- <param name='showControls' value="true">
- <param name='loop' value="true">
- <param name="BufferingTime" value="3">
- <EMBED type='application/x-mplayer2'
- pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
- id='mediaPlayer' name='mediaPlayer' autosize='1'
- bgcolor='darkblue' showcontrols="true" showtracker='-1'
- showdisplay='0' showstatusbar='-1' videoborder3d='-1' width='480' height='320'
- src="http://master.squasher.netformatie.nl/?x=asx&f=<?=$h;?>" autostart="true" designtimesp='5311' loop="true">
- </EMBED>
- </OBJECT>
- </td></tr>
- <!-- ...end embedded WindowsMedia file -->
- <!-- begin link to launch external media player... -->
- <tr><td align='center'>
- <a href="http://master.squasher.netformatie.nl/?x=asx&f=<?=$h;?>" style='font-size: 85%;' target='_blank'>Launch in external player</a>
- <!-- ...end link to launch external media player... -->
- </td></tr>
- </table>
- <?
- }
-
-function create_playlist($h, $t='asx', $title='Title') {
- switch ($t) {
-
- case 'asx':
-
- header('Content-Disposition: attachment; filename="stream.asx"');
- echo '<ASX version="3.0">
-<title>Squasher Streaming Video</title>
- <Entry>
- <title>Video Stream</title>
- <ref HREF="http://master.squasher.netformatie.nl/?a=x&f='.$h.'"/>
- </Entry>
-</ASX>';
-
- break;
-
- case 'vlc':
- header('Content-Disposition: attachment; filename="stream.'.$t.'"');
- echo '#EXTM3U
-#EXTINF:-1,Squasher Streaming Video - '.$title.'
-http://master.squasher.netformatie.nl/?a=x&f='.$h.'';
-
- break;
-
- case 'm3u':
- default:
- header('Content-Disposition: attachment; filename="stream.m3u"');
- echo '#EXTM3U
-#EXTINF:-1,Squasher Streaming Video - '.$title.'
-http://master.squasher.netformatie.nl/?a=x&f='.$h.'';
-
- break;
- }
- }
}
// vim: syntax=php ts=4 sw=4 sts=4 sr noet
?>
//get the config of requested file
$request = $squashweb->get_config($_GET['f']);
- //------------------------------------
- //-check-file-and-request-type--start-
- //------------------------------------
- if (strpos($request['mime'],'ideo') && isset($_GET['d'])) { //embed video
- $squashweb->embed_video($_GET['f']);
- }
- elseif (strpos($request['mime'],'ideo') && isset($_GET['x'])) { //show stream playlist
- $squashweb->create_playlist($_GET['f'],$_GET['x'],$request[2]);
- }
- else { //show requested file
- # header('Cache-control: private');
- header('Content-Disposition: attachment; filename="'.$request[2].'"');
- header("Content-Type: ".$request['mime']);
- if ($request[3])header('Content-Length: '.$request[3]);
- #@ob_flush();
- @flush();
- $squashweb->print_files($request['path'], $request[2]);
- }
- //---------------------------------
- //-check-file-and-request-type-end-
- //---------------------------------
+ //show requested file
+ #header('Cache-control: private');
+ header('Content-Disposition: attachment; filename="'.$request[2].'"');
+ header("Content-Type: ".$request['mime']);
+ if ($request[3])
+ header('Content-Length: '.$request[3]);
+ #@ob_flush();
+ @flush();
+ $squashweb->print_files($request['path'], $request[2]);
} elseif (@$_GET['tools']=="hide" && @$_GET['h']) {
if ($_SESSION['creds']['user_level'] > 99) {
+++ /dev/null
-{literal}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<title>Squasher</title>
-<style>
-
-body{
-background-color:#E2EBD8;
-min-width:1000px;
-font-family:Arial Narrow;
-font-size:16px;
-}
-
-.wrapper{
-width: 1000px;
-margin: 10px auto;
-}
-
-.container{
-border:5px solid;
-border-color:#FFFFFF;
-color:#FFFFFF;
-left:50%;
-background: #FFFFFF;
-}
-
-.control{
-float:right;
-text-align:right;
-}
-
-.menucontainer{
-background-color:#FFFFFF;
-}
-
-.menu{
-text-align:center;
-}
-
-.menuhead{
-float:left;
-background-color:#66CC00;
-color:#003300;
-margin:1px;
-border:1px solid;
-border-color:#66CC00;
-}
-
-.menuitem{
-float:left;
-background-color:#C7F09E;
-color:#003300;
-margin:1px;
-border:1px solid;
-border-color:#E2EBD8;
-}
-
-.menuitem:hover{
-background-color:#339900;
-color:#FFFFFF;
-}
-
-.content{
-float:left;
-padding-right:5px;
-}
-
-.item, .status1, .status2, .status3{
-position:relative;
-color:#003300;
-width:400px;
-height:50px;
-border:2px solid;
-border-color:#FFFFFF;
-font-size:12px;
-}
-
-.item{
-background-color:#E2EBD8;
-}
-.status1{
-background-color:#FFCCCC;
-}
-.status2{
-background-color:#FFFFCC;
-}
-.status3{
-background-color:#CCFFCC;
-}
-
-.name{
-float:left;
-left:1px;
-top:1px;
-padding-left:1px;
-z-index:50;
-}
-
-.center{
-float:left;
-height:inherit;
-padding-left:1px;
-}
-
-.chunks{
-float:right;
-padding-left:2px;
-padding-right:3px;
-}
-
-.size{
-float:right;
-padding-left:2px;
-padding-right:3px;
-}
-
-.added{
-float:left;
-padding-left:2px;
-padding-right:3px;
-}
-
-.updated{
-float:left;
-padding-left:2px;
-padding-right:3px;
-}
-
-.status{
-float:right;
-top:1px;
-padding-right:2px;
-text-align:right;
-z-index:10;
-}
-
-.stream{
-float:right;
-padding-left:1px;
-padding-right:2px;
-}
-
-.download{
-float:right;
-padding-left:1px;
-padding-right:2px;
-}
-
-.clear{
-clear:both;
-height:1px;
-font-size: 0;
-}
-
-.spacer{
-clear:both;
-height:10px;
-}
-
-.videoframe{
-float:left;
-width:500px;
-height:400px;
-padding-left:25px;
-}
-
-.banner{
-background-color:#66CC00;
-text-align:center;
-width:100%;
-height:45px;
-background:#66CC00 url(img/squash.gif) no-repeat 30px 50%;
-}
-
-.titel{
-background-color:#66CC00;
-text-align:center;
-}
-
-.footer{
-background-color:#66CC00;
-text-align:center;
-background:#66CC00 url(img/gplogobottomright.gif) no-repeat 100%;
-}
-
-.bottomimage{
-background: #FFFFFF url(img/gp1.gif) no-repeat 95% 95%;
-float:right;
-width:300px;
-height:146px;
-}
-
-a{
-color:#003300;
-}
-
-a:hover{
-color:#FF6600;
-}
-
-</style>
-</head>
-{/literal}
-<body style="min-width:1000px;">
-<div class="wrapper">
-<div class="container">
-
- <div class="banner"> <div class="control">{if $user_level > 99}<a href="?">home</a> | <a href="?tools=access">access</a> |{/if}{if $user_level > 99} <a href="?tools=users">users</a> |{/if} <a href="index.php?tools=logout">logout({$user_name})</a> </div></div>
-
- <div class="spacer"></div>
-
- <div class="menucontainer">
-
- <div class="menu">
-
- <div class="menuhead">current folder</div>
-
- {foreach item=crumb key=cookie from=$base}<div class="menuitem" onClick="location.href='?path={$cookie}'" style="cursor:pointer" >{$crumb}</div>{/foreach}
-
- </div>
-
- <div class="clear"></div>
-
- <div class="menu">
-
- <div class="menuhead">subfolders</div>
-
- {foreach item=folder key=folderpath from=$subfolders}<div class="menuitem" onClick="location.href='?path={$folderpath}'" style="cursor:pointer" >{$folder}</div>{/foreach}
-
- </div>
-
- <div class="clear"></div>
-{*
- <div class="menu">
-
- {foreach item=dir key=path from=$paths}{if $path!=$currentfolder}<div class="menuitem" onClick="location.href='squasher.php?path={$path}'" style="cursor:pointer" >{$dir}</div>{/if}{/foreach}
-
- </div>
-
-
-
- <div class="clear"></div>*}
-
- </div>
-
- <div class="spacer"></div>
-
-<div class="content">
-{foreach item=item key=id from=$squashed}
-
-{if $item.squashed}{*These items are in chunks / uploaded by the squasher tool*}
-
-{if $item.hidden eq false OR $user_level > 99 }
- <div class={if $item.finished==true}"status3"{elseif $item.finished!=true && $item.embedable==true}"status2"{elseif $item.finished!=true && $item.embedable!=true}"status1"{else}"item"{/if}>
-
- <div class="name">{$item.name} {if $user_level > 99}{if $item.hidden}<font color=red>|<a href='?tools=unhide&h={$id}'>publish</a>|</font>{else}<font color=green>|<a href='?tools=hide&h={$id}'>hide</a>|</font>{/if}{if $user_level > 199}<font color=red>|<a href='?tools=delete&h={$id}' onClick="javascript:return confirm('Are you sure you want to permanently delete {$item.name}?')">delete</a>|</font>{/if}{/if}</div>
-
- <div class="status">status: {$item.status}</div>
-
- <div class="clear"></div>
-
- <div class="added">added: {$item.date}</div>
-
- <div class="chunks">({math equation="(y / x) * 100" x=$item.chunks y=$item.chunks_finished format="%.0f"}%)</div>
- <div class="size">size: {if $item.size>(1024*1024)}{math equation="((x / 1024) / 1024) * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.2f"} / {math equation="(x / 1024) / 1024" x=$item.size format="%.2f"}mb{elseif $item.size>(1024)}{math equation="(x / 1024) * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.2f"} / {math equation="(x / 1024)" x=$item.size format="%.2f"}kb{else}{math equation="x * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.0f"} / {$item.size}b{/if}</div>
-
- <div class="clear"></div>
-
- <div class="updated">last updated: {$item.lastchange}</div>
-
-
-{if $item.finished==true}
- <div class="download"><a href='?f={$id}'>download</a></div>
-{/if}
-{if $item.embedable==true}
- {if $item.finished==false}
- <div class="download"><a href='?f={$id}'>download</a></div>
- {/if}
- {if $item.mime=='video/mpeg'}
- <div class="stream"><a href='?d=x&f={$id}' target='videoframe'>sttreaming(embedded)</a></div>
- {/if}
- <div class="stream"><a href='?x=vlc&f={$id}'>streaming(vlc)</a></div>
- <!--div class="stream">streaming </div-->
-{/if}
-
- </div>
-
-{/if}
-
-{else}{*These items plain files / uploaded manually by the user via ftp*}
-
-{if $item.hidden eq false OR $user_level > 99 }
- <div class={if $item.finished==true}"status3"{elseif $item.finished!=true && $item.embedable==true}"status2"{elseif $item.finished!=true && $item.embedable!=true}"status1"{else}"item"{/if}>
-
- <div class="name">{$item.name} {if $user_level > 99}{if $item.hidden}<font color=red>|<a href='?tools=unhide&h={$id}'>publish</a>|</font>{else}<font color=green>|<a href='?tools=hide&h={$id}'>hide</a>|</font>{/if}{if $user_level > 199}<font color=red>|<a href='?tools=delete&h={$id}' onClick="javascript:return confirm('Are you sure you want to permanently delete {$item.name}?')">delete</a>|</font>{/if}{/if}</div>
-
- <div class="status">status: {$item.status}</div>
-
- <div class="clear"></div>
-
- <div class="added">added: {$item.date}</div>
-
- <div class="size">size: {if $item.size>(1024*1024)}{math equation="(x / 1024) / 1024" x=$item.size format="%.2f"}mb{elseif $item.size>(1024)}{math equation="(x / 1024)" x=$item.size format="%.2f"}kb{else}{$item.size}b{/if}</div>
-
- <div class="clear"></div>
-
- <div class="updated">last updated: {$item.lastchange}</div>
-
-
-{if $item.finished==true}
- <div class="download"><a href='?f={$id}'>download</a></div>
-{/if}
-{if $item.embedable==true}
- {if $item.finished==false}
- <div class="download"><a href='?f={$id}'>download</a></div>
- {/if}
- {if $item.mime=='video/mpeg'}
- <div class="stream"><a href='?d=x&f={$id}' target='videoframe'>embed</a></div>
- {/if}
- <div class="stream"><a href='?x=vlc&f={$id}'>vlc</a></div>
- <div class="stream">streaming: </div>
-{/if}
-
- </div>
-
- <div class="clear"></div>
-{/if}
-{/if}
-{/foreach}
-
- </div>
-
- <iframe class="videoframe" NAME='videoframe' FRAMEBORDER=0 SCROLLING=0 ></iframe>
-
- <div class="bottomimage"></div>
-
- <div class="clear"></div>
-
- <div class="spacer"></div>
-
- <div class="footer"> </div>
-
-</div>
-</div>
-{if $debug}{debug}{/if}
-</body>
-</html>
+++ /dev/null
-{literal}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<title>Squasher</title>
-<style>
-
-body{
-background-color:#E2EBD8;
-min-width:1000px;
-font-family:Arial Narrow;
-font-size:16px;
-}
-
-.wrapper{
-width: 1000px;
-margin: 10px auto;
-}
-
-.container{
-border:5px solid;
-border-color:#FFFFFF;
-color:#FFFFFF;
-left:50%;
-background: #FFFFFF;
-}
-
-.control{
-float:right;
-text-align:right;
-}
-
-.menucontainer{
-background-color:#FFFFFF;
-}
-
-.menu{
-text-align:center;
-}
-
-.menuhead{
-float:left;
-background-color:#66CC00;
-color:#003300;
-margin:1px;
-border:1px solid;
-border-color:#66CC00;
-}
-
-.menuitem{
-float:left;
-background-color:#C7F09E;
-color:#003300;
-margin:1px;
-border:1px solid;
-border-color:#E2EBD8;
-}
-
-.menuitem:hover{
-background-color:#339900;
-color:#FFFFFF;
-}
-
-.content{
-float:left;
-padding-right:5px;
-}
-
-.item, .status1, .status2, .status3{
-position:relative;
-color:#003300;
-width:400px;
-height:50px;
-border:2px solid;
-border-color:#FFFFFF;
-font-size:12px;
-}
-
-.item{
-background-color:#E2EBD8;
-}
-.status1{
-background-color:#FFCCCC;
-}
-.status2{
-background-color:#FFFFCC;
-}
-.status3{
-background-color:#CCFFCC;
-}
-
-.name{
-float:left;
-left:1px;
-top:1px;
-padding-left:1px;
-z-index:50;
-}
-
-.center{
-float:left;
-height:inherit;
-padding-left:1px;
-}
-
-.chunks{
-float:right;
-padding-left:2px;
-padding-right:3px;
-}
-
-.size{
-float:right;
-padding-left:2px;
-padding-right:3px;
-}
-
-.added{
-float:left;
-padding-left:2px;
-padding-right:3px;
-}
-
-.updated{
-float:left;
-padding-left:2px;
-padding-right:3px;
-}
-
-.status{
-float:right;
-top:1px;
-padding-right:2px;
-text-align:right;
-z-index:10;
-}
-
-.stream{
-float:right;
-padding-left:1px;
-padding-right:2px;
-}
-
-.download{
-float:right;
-padding-left:1px;
-padding-right:2px;
-}
-
-.clear{
-clear:both;
-height:1px;
-font-size: 0;
-}
-
-.spacer{
-clear:both;
-height:10px;
-}
-
-.videoframe{
-float:left;
-width:500px;
-height:400px;
-padding-left:25px;
-}
-
-.banner{
-background-color:#66CC00;
-text-align:center;
-width:100%;
-height:45px;
-background:#66CC00 url(img/squash.gif) no-repeat 30px 50%;
-}
-
-.titel{
-background-color:#66CC00;
-text-align:center;
-}
-
-.footer{
-background-color:#66CC00;
-text-align:center;
-background:#66CC00 url(img/gplogobottomright.gif) no-repeat 100%;
-}
-
-.bottomimage{
-background: #FFFFFF url(img/gp1.gif) no-repeat 95% 95%;
-float:right;
-width:300px;
-height:146px;
-}
-
-a{
-color:#003300;
-}
-
-a:hover{
-color:#FF6600;
-}
-
-</style>
-</head>
-{/literal}
-<body style="min-width:1000px;">
-<div class="wrapper">
-<div class="container">
-
- <div class="banner"> <div class="control">{if $user_level > 99}<a href="?">home</a> | <a href="?tools=access">access</a> |{/if}{if $user_level > 99} <a href="?tools=users">users</a> |{/if} <a href="index.php?tools=logout">logout({$user_name})</a> </div></div>
-
- <div class="spacer"></div>
-
- <div class="menucontainer">
-
- <div class="menu">
-
- <div class="menuhead">current folder</div>
-
- {foreach item=crumb key=cookie from=$base}<div class="menuitem" onClick="location.href='?path={$cookie}'" style="cursor:pointer" >{$crumb}</div>{/foreach}
-
- </div>
-
- <div class="clear"></div>
-
- <div class="menu">
-
- <div class="menuhead">subfolders</div>
-
- {foreach item=folder key=folderpath from=$subfolders}<div class="menuitem" onClick="location.href='?path={$folderpath}'" style="cursor:pointer" >{$folder}</div>{/foreach}
-
- </div>
-
- <div class="clear"></div>
-{*
- <div class="menu">
-
- {foreach item=dir key=path from=$paths}{if $path!=$currentfolder}<div class="menuitem" onClick="location.href='squasher.php?path={$path}'" style="cursor:pointer" >{$dir}</div>{/if}{/foreach}
-
- </div>
-
-
-
- <div class="clear"></div>*}
-
- </div>
-
- <div class="spacer"></div>
-
-<div class="content">
-{foreach item=item key=id from=$squashed}
-
-{if $item.squashed}{*These items are in chunks / uploaded by the squasher tool*}
-
-{if $item.hidden eq false OR $user_level > 99 }
- <div class={if $item.finished==true}"status3"{elseif $item.finished!=true && $item.embedable==true}"status2"{elseif $item.finished!=true && $item.embedable!=true}"status1"{else}"item"{/if}>
-
- <div class="name">{$item.name} {if $user_level > 99}{if $item.hidden}<font color=red>|<a href='?tools=unhide&h={$id}'>publish</a>|</font>{else}<font color=green>|<a href='?tools=hide&h={$id}'>hide</a>|</font>{/if}{if $user_level > 199}<font color=red>|<a href='?tools=delete&h={$id}' onClick="javascript:return confirm('Are you sure you want to permanently delete {$item.name}?')">delete</a>|</font>{/if}{/if}</div>
-
- <div class="status">status: {$item.status}</div>
-
- <div class="clear"></div>
-
- <div class="added">added: {$item.date}</div>
-
- <!--div class="chunks"></div-->
- <div class="size">size: {if $item.size>(1024*1024)}{math equation="((x / 1024) / 1024) * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.2f"} / {math equation="(x / 1024) / 1024" x=$item.size format="%.2f"}mb{elseif $item.size>(1024)}{math equation="(x / 1024) * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.2f"} / {math equation="(x / 1024)" x=$item.size format="%.2f"}kb{else}{math equation="x * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.0f"} / {$item.size}b{/if}({math equation="(y / x) * 100" x=$item.chunks y=$item.chunks_finished format="%.0f"}%)</div>
-
- <div class="clear"></div>
-
- <div class="updated">last updated: {$item.lastchange}</div>
-
-
-{if $item.finished==true}
- <div class="download"><a href='?f={$id}'>download</a></div>
-{/if}
-{if $item.embedable==true}
- {if $item.finished==false}
- <div class="download"><a href='?f={$id}'>download</a></div>
- {/if}
- {if $item.mime=='video/mpeg'}
- <div class="stream"><a href='?d=x&f={$id}' target='videoframe'>embed</a></div>
- {/if}
- <div class="stream"><a href='?x=vlc&f={$id}'>vlc</a></div>
- <div class="stream">streaming: </div>
-{/if}
-
- </div>
-
- <div class="clear"></div>
-{/if}
-
-{else}{*These items plain files / uploaded manually by the user via ftp*}
-
-{if $item.hidden eq false OR $user_level > 99 }
- <div class={if $item.finished==true}"status3"{elseif $item.finished!=true && $item.embedable==true}"status2"{elseif $item.finished!=true && $item.embedable!=true}"status1"{else}"item"{/if}>
-
- <div class="name">{$item.name} {if $user_level > 99}{if $item.hidden}<font color=red>|<a href='?tools=unhide&h={$id}'>publish</a>|</font>{else}<font color=green>|<a href='?tools=hide&h={$id}'>hide</a>|</font>{/if}{if $user_level > 199}<font color=red>|<a href='?tools=delete&h={$id}' onClick="javascript:return confirm('Are you sure you want to permanently delete {$item.name}?')">delete</a>|</font>{/if}{/if}</div>
-
- <div class="status">status: {$item.status}</div>
-
- <div class="clear"></div>
-
- <div class="added">added: {$item.date}</div>
-
- <div class="size">size: {if $item.size>(1024*1024)}{math equation="(x / 1024) / 1024" x=$item.size format="%.2f"}mb{elseif $item.size>(1024)}{math equation="(x / 1024)" x=$item.size format="%.2f"}kb{else}{$item.size}b{/if}</div>
-
- <div class="clear"></div>
-
- <div class="updated">last updated: {$item.lastchange}</div>
-
-
-{if $item.finished==true}
- <div class="download"><a href='?f={$id}'>download</a></div>
-{/if}
-{if $item.embedable==true}
- {if $item.finished==false}
- <div class="download"><a href='?f={$id}'>download</a></div>
- {/if}
- {if $item.mime=='video/mpeg'}
- <div class="stream"><a href='?d=x&f={$id}' target='videoframe'>streaming(embedded)</a></div>
- {/if}
- <div class="stream"><a href='?x=vlc&f={$id}'>streaming(vlc)</a></div>
- <!--div class="stream">streaming: </div-->
-{/if}
-
- </div>
-
- <div class="clear"></div>
-{/if}
-{/if}
-{/foreach}
-
- </div>
-
- <iframe class="videoframe" NAME='videoframe' FRAMEBORDER=0 SCROLLING=0 ></iframe>
-
- <div class="bottomimage"></div>
-
- <div class="clear"></div>
-
- <div class="spacer"></div>
-
- <div class="footer"> </div>
-
-</div>
-</div>
-{if $debug}{debug}{/if}
-</body>
-</html>