Hello..
First off i'm new here and hoping i could get some help..
it has been thrust upon me in my office to learn and update the site web page which was writen by someone else who has knowledge of php and swf. I having know php knowledge am cutting my way through as best as possible. but i have come across this road block i can't seem to cross.
There is and embedded swf video player that plays site videos on a random loop.. I have been requested to have this player stop playing the loop upon a click of any of the tabs on the page..
here is the scripting as i know it so far that is on the page currently.
This loads the video player
<iframe src="./video/video.php" height=285 width=320 frameborder=0 border=0 name="fvp"></iframe>
This is the video player it loads
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "<html>
<head>
<title>videoplayerclassic</title>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta name="author" content="">
<meta name="generator" content="SWiSHmax <meta name="description" content="videoplayerclassic">
<meta name="keywords" content="ashley, ingram, music, player, school, video">
<script src="./mpl.js" type="text/javascript"></script>
</head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" bottommargin="0" rightmargin="0">
<left>
<?php
function counter($v_path){
$v_path = str_replace("./vdo/", "./cnt/", $v_path);
$v_path = str_replace(".swf", ".dat", $v_path);
if (file_exists($v_path)) {
$yomiko=file($v_path);
$fp = @fopen($v_path, "r+");
flock($fp, 2);
$yomiko[0]++;
fputs($fp, $yomiko[0]);
flock($fp, 3);
fclose($fp);
} else {
$ret = touch($v_path);
$datap = file($v_path);
$fp = @fopen($v_path, "r+");
flock($fp, 2);
fputs($fp, "1");
flock($fp, 3);
fclose($fp);
};
};
$va = $_REQUEST["va"];
if ($va != ""){
$va = str_replace("video/" , "" , $va);
echo" <script type=\"text/javascript\">
<!--
mpw(\"$va\");
// -->
</script>
";
counter($va);
} else {
$data = file("data.txt");
$newdata = Array();
for($i=0;$i<sizeof($data);$i++){
list($videoa,$pica,$videon,$videod) = explode("<>",$data[$i]);
$newdata[$i] = "$videoa";
};
shuffle($newdata);
$address = $newdata[0];
$address = str_replace("video/" , "" , $address);
echo" <script type=\"text/javascript\">
<!--
mpw(\"$address\");
// -->
</script>
";
};
?>
</left>
</body>
</html>
and within the video player it loads the background swf
function mpw(ura){
document.write('<object classid=\"clsid
27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\" id=\"videoplayerclassic\" width=\"320\" height=\"284\">\n');
document.write('<param name=\"movie\" value=\"videoplayerclassic.swf\">\n');
document.write('<param name=\"bgcolor\" value=\"#EEEEEE\">\n');
document.write('<param name=\"quality\" value=\"high\">\n');
document.write('<param name=\"allowscriptaccess\" value=\"samedomain\">\n');
document.write('<PARAM NAME=FlashVars VALUE=\"vaddress=' + ura + '\">\n');
document.write('<embed type=\"application/x-shockwave-flash\" pluginspage=\" name=\"videoplayerclassic\" width=\"320\" height=\"284\" src=\"videoplayerclassic.swf\" FlashVars=\"vaddress=' + ura + '\" bgcolor=\"#EEEEEE\" quality=\"high\" swliveconnect=\"true\" allowscriptaccess=\"samedomain\">\n');
document.write('<noembed>\n');
document.write('</noembed>\n');
document.write('</embed>\n');
document.write('</object>\n');
}
within the video player it requests information on the videos from a data.txt as follows
./video/vdo/20061208120543.swf<>./video/pic/20070118114131.jpg<>Manami - Natural Woman<>3?07?<>0
./video/vdo/20061208122433.swf<>./video/pic/20061208122433.jpg<>Rina<>7?31?<>0
./video/vdo/20061208123216.swf<>./video/pic/20061208123216.jpg<>Hanako<>7?26?<>0
./video/vdo/20061208123703.swf<>./video/pic/20061208015334.jpg<>Nobuko - Safe<>3?14?<>0
./video/vdo/20061208124616.swf<>./video/pic/20061208124616.jpg<>Yumi<>8?13?<>0
./video/vdo/20061208125004.swf<>./video/pic/20061208015311.jpg<>Taeko<>3?36?<>0
./video/vdo/20061208125430.swf<>./video/pic/20061208125430.jpg<>Akiko<>4?13?<>0
./video/vdo/20061216075503.swf<>./video/pic/20061221094308.jpg<>Ashley Ingram - You’re The One<>4?56?<>0
./video/vdo/20061221113135.swf<>./video/pic/20061221113135.jpg<>Kaori - Unbreak My Heart<>4?39?<>0
./video/vdo/20070108063112.swf<>./video/pic/20070108063112.jpg<>Tomoko Koizumi - 8 Month Journey<>4?19?<>0
The tabs are defined by
<?php
require("nakami/waku.txt");
?>
which gets it's informations from the waku.txt as follows
<?php
function henkan($url){
$text = file_get_contents($url);
$ttxt = nl2br($text);
$ttxt = str_replace("\r\n", "\r", $ttxt);
$ttxt = str_replace("\r", "\n", $ttxt);
$ttxt = str_replace("\n", "", $ttxt);
$ttxt = str_replace("<br />", "", $ttxt);
echo($ttxt);
};
?>
<script type="text/javascript">
<!--
if (document.images) {
btn0 = new Image();
btn0.src = "nakami/img/0.gif";
btn1 = new Image();
btn1.src = "nakami/img/a1.gif";
btn2 = new Image();
btn2.src = "nakami/img/a2.gif";
btn3 = new Image();
btn3.src = "nakami/img/a3.gif";
btn4 = new Image();
btn4.src = "nakami/img/a4.gif";
}
function setImage(name, src) {
if (document.images) {
document.images['btn0'].src = 'nakami/img/0.gif';
document.images['btn1'].src = 'nakami/img/1.gif';
document.images['btn2'].src = 'nakami/img/2.gif';
document.images['btn3'].src = 'nakami/img/3.gif';
document.images['btn4'].src = 'nakami/img/4.gif';
document.images[name].src = src;
}
}
// -->
</script>
<script language="JavaScript">
<!--
var ns4=document.layers?1:0
var ie=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0
var IsInit = 0
var tabcont=new Array()
tabcont[0]='<?php require("nakami/project.php");?>'
tabcont[1]='<?php henkan("nakami/intro.txt") ?>'
tabcont[2]='<?php henkan("nakami/course.txt") ?>'
tabcont[3]='<?php henkan("nakami/koe.txt") ?>'
tabcont[4]='<?php henkan("nakami/gaiyo.txt") ?>'
var subobj=""
function showit(tabnum) {
currentCont=(tabnum==-1)?"":tabcont[tabnum]
if (ns4) {
subobj=document.contArea1.document.contArea2
subobj.document.write(currentCont)
subobj.document.close()
} else if (ie||ns6) {
subobj=ns6?document.getElementById("contArea3"):document.all.contArea3
subobj.innerHTML=currentCont
}
if (IsInit==0) {
IsInit=1
}
}
//-->
</script>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><a href="" onclick="setImage('btn0', 'nakami/img/a0.gif');showit(0);return false;"><img name="btn0" src="nakami/img/a0.gif" border="0"></a></td>
<td><a href="" onclick="setImage('btn1', 'nakami/img/a1.gif');showit(1);return false;"><img name="btn1" src="nakami/img/1.gif" border="0"></a></td>
<td><a href="" onclick="setImage('btn2', 'nakami/img/a2.gif');showit(2);return false;"><img name="btn2" src="nakami/img/2.gif" border="0"></a></td>
<td><a href="" onclick="setImage('btn3', 'nakami/img/a3.gif');showit(3);return false;"><img name="btn3" src="nakami/img/3.gif" border="0"></a></td>
<td><a href="" onclick="setImage('btn4', 'nakami/img/a4.gif');showit(4);return false;"><img name="btn4" src="nakami/img/4.gif" border="0"></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#f7efe7">
<tr height="16"><td></td><td></td><td></td></tr>
<tr>
<td>
<div class="frm" onload="showit(0)">
<!--------------------------------- ?{?¶?\?¦?p???C???[?Ì?T?C?Y?ð?w?è?iNN4?p?j -------------------------->
<ilayer name="contArea1" width="500" height="800">
<layer name="contArea2" width="500" height="800"></layer>
</ilayer>
<div id="contArea3"></div>
</div></td></tr></table>
</td>
</tr>
</table>
I need the player to stop playing video when any one of the tabs (btn0 through btn4) are clicked.
Is this possible? If so I am requesting any help and requesting what chages to the scripting need to be made.
I will thank ahead of time to anyone who can provide me with some insite..
Thanks
First off i'm new here and hoping i could get some help..
it has been thrust upon me in my office to learn and update the site web page which was writen by someone else who has knowledge of php and swf. I having know php knowledge am cutting my way through as best as possible. but i have come across this road block i can't seem to cross.
There is and embedded swf video player that plays site videos on a random loop.. I have been requested to have this player stop playing the loop upon a click of any of the tabs on the page..
here is the scripting as i know it so far that is on the page currently.
This loads the video player
<iframe src="./video/video.php" height=285 width=320 frameborder=0 border=0 name="fvp"></iframe>
This is the video player it loads
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "<html>
<head>
<title>videoplayerclassic</title>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta name="author" content="">
<meta name="generator" content="SWiSHmax <meta name="description" content="videoplayerclassic">
<meta name="keywords" content="ashley, ingram, music, player, school, video">
<script src="./mpl.js" type="text/javascript"></script>
</head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" bottommargin="0" rightmargin="0">
<left>
<?php
function counter($v_path){
$v_path = str_replace("./vdo/", "./cnt/", $v_path);
$v_path = str_replace(".swf", ".dat", $v_path);
if (file_exists($v_path)) {
$yomiko=file($v_path);
$fp = @fopen($v_path, "r+");
flock($fp, 2);
$yomiko[0]++;
fputs($fp, $yomiko[0]);
flock($fp, 3);
fclose($fp);
} else {
$ret = touch($v_path);
$datap = file($v_path);
$fp = @fopen($v_path, "r+");
flock($fp, 2);
fputs($fp, "1");
flock($fp, 3);
fclose($fp);
};
};
$va = $_REQUEST["va"];
if ($va != ""){
$va = str_replace("video/" , "" , $va);
echo" <script type=\"text/javascript\">
<!--
mpw(\"$va\");
// -->
</script>
";
counter($va);
} else {
$data = file("data.txt");
$newdata = Array();
for($i=0;$i<sizeof($data);$i++){
list($videoa,$pica,$videon,$videod) = explode("<>",$data[$i]);
$newdata[$i] = "$videoa";
};
shuffle($newdata);
$address = $newdata[0];
$address = str_replace("video/" , "" , $address);
echo" <script type=\"text/javascript\">
<!--
mpw(\"$address\");
// -->
</script>
";
};
?>
</left>
</body>
</html>
and within the video player it loads the background swf
function mpw(ura){
document.write('<object classid=\"clsid
document.write('<param name=\"movie\" value=\"videoplayerclassic.swf\">\n');
document.write('<param name=\"bgcolor\" value=\"#EEEEEE\">\n');
document.write('<param name=\"quality\" value=\"high\">\n');
document.write('<param name=\"allowscriptaccess\" value=\"samedomain\">\n');
document.write('<PARAM NAME=FlashVars VALUE=\"vaddress=' + ura + '\">\n');
document.write('<embed type=\"application/x-shockwave-flash\" pluginspage=\" name=\"videoplayerclassic\" width=\"320\" height=\"284\" src=\"videoplayerclassic.swf\" FlashVars=\"vaddress=' + ura + '\" bgcolor=\"#EEEEEE\" quality=\"high\" swliveconnect=\"true\" allowscriptaccess=\"samedomain\">\n');
document.write('<noembed>\n');
document.write('</noembed>\n');
document.write('</embed>\n');
document.write('</object>\n');
}
within the video player it requests information on the videos from a data.txt as follows
./video/vdo/20061208120543.swf<>./video/pic/20070118114131.jpg<>Manami - Natural Woman<>3?07?<>0
./video/vdo/20061208122433.swf<>./video/pic/20061208122433.jpg<>Rina<>7?31?<>0
./video/vdo/20061208123216.swf<>./video/pic/20061208123216.jpg<>Hanako<>7?26?<>0
./video/vdo/20061208123703.swf<>./video/pic/20061208015334.jpg<>Nobuko - Safe<>3?14?<>0
./video/vdo/20061208124616.swf<>./video/pic/20061208124616.jpg<>Yumi<>8?13?<>0
./video/vdo/20061208125004.swf<>./video/pic/20061208015311.jpg<>Taeko<>3?36?<>0
./video/vdo/20061208125430.swf<>./video/pic/20061208125430.jpg<>Akiko<>4?13?<>0
./video/vdo/20061216075503.swf<>./video/pic/20061221094308.jpg<>Ashley Ingram - You’re The One<>4?56?<>0
./video/vdo/20061221113135.swf<>./video/pic/20061221113135.jpg<>Kaori - Unbreak My Heart<>4?39?<>0
./video/vdo/20070108063112.swf<>./video/pic/20070108063112.jpg<>Tomoko Koizumi - 8 Month Journey<>4?19?<>0
The tabs are defined by
<?php
require("nakami/waku.txt");
?>
which gets it's informations from the waku.txt as follows
<?php
function henkan($url){
$text = file_get_contents($url);
$ttxt = nl2br($text);
$ttxt = str_replace("\r\n", "\r", $ttxt);
$ttxt = str_replace("\r", "\n", $ttxt);
$ttxt = str_replace("\n", "", $ttxt);
$ttxt = str_replace("<br />", "", $ttxt);
echo($ttxt);
};
?>
<script type="text/javascript">
<!--
if (document.images) {
btn0 = new Image();
btn0.src = "nakami/img/0.gif";
btn1 = new Image();
btn1.src = "nakami/img/a1.gif";
btn2 = new Image();
btn2.src = "nakami/img/a2.gif";
btn3 = new Image();
btn3.src = "nakami/img/a3.gif";
btn4 = new Image();
btn4.src = "nakami/img/a4.gif";
}
function setImage(name, src) {
if (document.images) {
document.images['btn0'].src = 'nakami/img/0.gif';
document.images['btn1'].src = 'nakami/img/1.gif';
document.images['btn2'].src = 'nakami/img/2.gif';
document.images['btn3'].src = 'nakami/img/3.gif';
document.images['btn4'].src = 'nakami/img/4.gif';
document.images[name].src = src;
}
}
// -->
</script>
<script language="JavaScript">
<!--
var ns4=document.layers?1:0
var ie=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0
var IsInit = 0
var tabcont=new Array()
tabcont[0]='<?php require("nakami/project.php");?>'
tabcont[1]='<?php henkan("nakami/intro.txt") ?>'
tabcont[2]='<?php henkan("nakami/course.txt") ?>'
tabcont[3]='<?php henkan("nakami/koe.txt") ?>'
tabcont[4]='<?php henkan("nakami/gaiyo.txt") ?>'
var subobj=""
function showit(tabnum) {
currentCont=(tabnum==-1)?"":tabcont[tabnum]
if (ns4) {
subobj=document.contArea1.document.contArea2
subobj.document.write(currentCont)
subobj.document.close()
} else if (ie||ns6) {
subobj=ns6?document.getElementById("contArea3"):document.all.contArea3
subobj.innerHTML=currentCont
}
if (IsInit==0) {
IsInit=1
}
}
//-->
</script>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><a href="" onclick="setImage('btn0', 'nakami/img/a0.gif');showit(0);return false;"><img name="btn0" src="nakami/img/a0.gif" border="0"></a></td>
<td><a href="" onclick="setImage('btn1', 'nakami/img/a1.gif');showit(1);return false;"><img name="btn1" src="nakami/img/1.gif" border="0"></a></td>
<td><a href="" onclick="setImage('btn2', 'nakami/img/a2.gif');showit(2);return false;"><img name="btn2" src="nakami/img/2.gif" border="0"></a></td>
<td><a href="" onclick="setImage('btn3', 'nakami/img/a3.gif');showit(3);return false;"><img name="btn3" src="nakami/img/3.gif" border="0"></a></td>
<td><a href="" onclick="setImage('btn4', 'nakami/img/a4.gif');showit(4);return false;"><img name="btn4" src="nakami/img/4.gif" border="0"></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#f7efe7">
<tr height="16"><td></td><td></td><td></td></tr>
<tr>
<td>
<div class="frm" onload="showit(0)">
<!--------------------------------- ?{?¶?\?¦?p???C???[?Ì?T?C?Y?ð?w?è?iNN4?p?j -------------------------->
<ilayer name="contArea1" width="500" height="800">
<layer name="contArea2" width="500" height="800"></layer>
</ilayer>
<div id="contArea3"></div>
</div></td></tr></table>
</td>
</tr>
</table>
I need the player to stop playing video when any one of the tabs (btn0 through btn4) are clicked.
Is this possible? If so I am requesting any help and requesting what chages to the scripting need to be made.
I will thank ahead of time to anyone who can provide me with some insite..
Thanks