Merry Christmas all
...Ok so here it is. I made a custom page for e107 cms. I have the player Stationary. When I click preview, the player wont start playing with firefox until I scroll up to where the player is in sight. There are no problems with IE. What I would like to do is make the player pop up in a new fancy window like rawr tpl when I hit the preview button. Anyone that has read any of my posts, knows I am not a coder lol. Any help with this would be great. Here is the music.php(index) and player.php if anyone can help me. Thanks in advance.
Music.php(index)require_once("config.php");
require_once("class2.php");
define("e_PAGETITLE", "Music");
require_once(HEADERF);
if (!USER) {
$ns->tablerender("Error!", "You must login to view this page");
require_once(FOOTERF);
exit;
}
?>
<?php
function mksize($bytes)
{
if ($bytes < 1000 * 1024)
return number_format($bytes / 1024, 2) . " kB";
elseif ($bytes < 1000 * 1048576)
return number_format($bytes / 1048576, 2) . " MB";
elseif ($bytes < 1000 * 1073741824)
return number_format($bytes / 1073741824, 2) . " GB";
else
return number_format($bytes / 1099511627776, 2) . " TB";
}
function getico($type) {
switch(strtolower($type)) {
case "mp3": return "mp3.gif"; break;
case "exe":
case "setup":
case "msi": return "exe.gif"; break;
case "zip": return "zip.gif"; break;
case "rar":
case "bin":
case "tar":
case "bz2":
case "gz":
case "z":
case "7z":
case "s7z": return "rar.gif"; break;
case "mpg":
case "mp4":
case "mpeg": return "mp4.gif"; break;
case "avi": return "avi.gif"; break;
case "iso":
case "img":
case "cue": return "iso.gif"; break;
case "vob": return "vob.gif"; break;
default: return "unknown.gif"; break;
}
}
$filedirxtra= (isset($_GET['dir']) ? htmlspecialchars($_GET['dir'])."/" : "");
?>
<!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" xml:lang="en" lang="en">
<head>
<title>Downloads</title>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8" />
<style type="text/css">
body {
font-family: Verdana, Tahoma, Helvetica, Arial;
font-size: 10pt;
background-color: #000000;
color: #FFFFFF;
margin: 50px;
}
table.list tr td {
border-bottom: 1px solid orange;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
#txtsrch {
background-image: url("icons/srchico.png");
background-position: left center;
background-repeat: no-repeat;
background-color: #cccccc;
font-weight: bold;
font-size: 11pt;
padding-left: 25px;
height: 20px;
}
#srchbtn {
background: transparent;
background-image: url("dl-icons/srchbtn.gif");
background-position: center center;
background-repeat: no-repeat;
height: 25px;
width: 70px;
border: none;
}
</style>
<script type="text/javascript">
function preview(file) {
var f = document.getElementById('fplayer');
f.src = "player.php?file="+file;
}
</script>
</head>
<body>
</div>
<!--Nav-->
<div style="padding: 5px; margin: 10px; width: auto; height: 30px; border: 1px solid orange;">
<!-- Table hack required for IE-->
<table cellpadding="0" cellspacing="0" border="0" width="auto" style="border: none;">
<tr>
<td valign="middle" align="left">
<form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<?php
if ($filedirxtra != "")
echo "<input type='hidden' name='dir' value='".$filedirxtra."' />";
?>
<input id="txtsrch" type="text" size="25" name="search" />
<input id="srchbtn" type="submit" value=" " />
</form>
</table>
</div>
<div style="width: auto; margin: 0px; border: none; text-align: center;">
<iframe id="fplayer" frameborder="0" marginwidth="0" marginheight="0" width="320" height="70" src="player.php"></iframe>
</div>
<table class="list" width="auto" cellpadding="3" cellspacing="0" border="0" style="margin: 10px; border: 1px solid orange;">
<?php
$kw = (isset($_GET['search']) ? trim($_GET['search']) : "");
$dir = opendir($filedir.$filedirxtra);
while(false !== ($file = readdir($dir)))
{
if($file != "." && $file != "..")
{
$fext = explode(".", $file);
if(!in_array(end($fext), $blockfiles) && is_file($filedir.$filedirxtra.$file)) {
if(($kw != "" & preg_match("/$kw/i", $file)) || $kw == "")
print("<tr><td><img src='".$icondir.getico(end($fext))."' title='".end($fext)."' alt='".end($fext)."' border='0'/></td><td width='99%'>".htmlspecialchars($file)."</td><td><span style='white-space: nowrap;'> ".mksize(filesize($filedir.$filedirxtra.$file))."</span></td><td><a href=\"".htmlspecialchars($filedir.$filedirxtra.$file)."\"><img src='".$icondir."download.gif' border='0' alt='DL' title='Download File: ".htmlspecialchars($file)."' /></a></td><td>".(in_array(end($fext), $prvfiles) ? "<a href=\"javascript:void(0);\" onclick=\"preview('".htmlspecialchars(addslashes($filedir.$filedirxtra.$file))."');\"><img src='".$icondir."preview.gif' border='0' alt='Preview' title='Preview File: ".htmlspecialchars($file)."' /></a>" : " ")."</td></tr>");
}
elseif(is_dir($filedir.$filedirxtra.$file))
echo "<tr><td><img src='".$icondir."directory.gif' alt='directory' border='0' /></td><td colspan='4'><a href='?dir=".$filedirxtra.$file."'>$file</a></td>";
}
}
closedir($dir);
?>
</table>
<?php
require_once(FOOTERF);
exit;
?>
Player.php<!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" xml:lang="en" lang="en">
<head>
<title>Player</title>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8"
/>
<style type="text/css">
body { background-color: ; }
</style>
</head>
<body>
<?php
$toplay = stripslashes($_GET['file']);
?>
<object type="application/x-shockwave-flash" data="rawr_player.swf" width="320" height="50">
<param name="movie" value="http://rawr-designs.com/rawr_data/players/rawr_player.swf"/>
<param name="bgcolor" value="#741e1f"/>
<param name="wmode" value="transparent"/>
<param id="flashvars" name="flashvars" value="autoplay=on&colorset=rawr_red&context=off<?php echo "&file=$toplay"; ?>" />
</object>
</body>
</html>