Bonjour

j'ai trouvé un code similaire a ce que je veux faire mais destiner a des ficheirs rm plutot qu'avi
jessaye de modifier le code pour quil me mette les avi en lancement
seulement voila impossible de faire marcher ce code.
le probleme est quil ne teste pas if (!=(isset($ontv)) et donc il ne veut pas passer au else...

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?
error_reporting( E_ALL ^ E_NOTICE );
 
$domaine ="http://127.0.0.1/conf/html/";
$chem_ram = "shoji/"; 
$chem_tv = "shoji.php?"; 
$var_tv = "ontv=";
$video_x = "320";
$video_y = "240";
 
/*********************************************/
 
///////////////////////////////////////////////////////
// Détecte les fichiers dans le rep   ///
///////////////////////////////////////////////////////
 
$myDirectory = opendir($chem_ram);
 
while($entryName = readdir($myDirectory))
{
    if ($entryName !="." && $entryName !="..")
	{
    $ma_liste .= "$entryName"."|" ;
 
    }
}
closedir($myDirectory);
$ma_liste = substr($ma_liste,0,(strlen($ma_liste)-1));
$entree = explode("|", $ma_liste);
 
///////////////////////////////////////////////////////
// Plasse les fichiers plus récents en premier           ///
///////////////////////////////////////////////////////
 
function inverser( &$tableau ) {
for($i = 0; $i < sizeof($tableau); $i++)
$nTab[$i] = $tableau[ sizeof($tableau) - $i - 1];
return $nTab; }
 
$entree = inverser($entree);
 
///////////////////////////////////////////////////////
?>
<script language="JavaScript">
 
function MM_jumpMenu(targ,selObj,restore){ 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
 
</script>
<body bgcolor="#FFFFFF">
<center>
  <h1>&nbsp;</h1>
</center>
<TABLE WIDTH=474 BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
<TR>
<TD WIDTH=474 HEIGHT=49 COLSPAN=4>&nbsp;</TD>
<TD WIDTH=1 HEIGHT=49>&nbsp;</TD>
</TR>
<TR>
<TD WIDTH=175 HEIGHT=125 COLSPAN=2> &nbsp;</TD>
<TD WIDTH=320 HEIGHT=240 ROWSPAN=2>
<?
/////////////////////////////////////////////////////////////////////////
//  Affiche la video correspondante au choix si $ontv actif           ///
/////////////////////////////////////////////////////////////////////////
 
			if (!isset($ontv))
			     { $source_ram = "shoji/presentation.avi";
			     	print ("merde");
				 print("<object TYPE='application/x-oleobject' height='$video_y' width='$video_x' align='middle' 
                          CLASSID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' STANDBY='Loading Windows Media Player components...' ID=4MediaPlayer'>
                          <PARAM name='ShowControls' VALUE='true'>
							<param name='ShowStatusBar' value='false'>
                          <PARAM name='ShowDisplay' VALUE='false'>
						<PARAM name='autostart' VALUE='false'>
                          <embed 
                          height='$video_y' width='$video_x' ShowControls='1' ShowStatusBar='0' ShowDisplay='0' autostart='0' TYPE='application/x-mplayer2' console='television'>
                          </embed></object>");}
			else { 
			         //$source_ram = $domaine.$chem_ram.$name.".avi";
			$source_ram = $domaine.$chem_ram.$name.".avi";
			        print("<object TYPE='application/x-oleobject' height='$video_y' width='$video_x' align='middle' 
                          CLASSID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' STANDBY='Loading Windows Media Player components...' ID=4MediaPlayer'>
                          <PARAM name='ShowControls' VALUE='true'>
							<param name='ShowStatusBar' value='false'>
                          <param name='CONTROLS' value='ImageWindow'>
                          <PARAM name='ShowDisplay' VALUE='false'>
						<PARAM name='autostart' VALUE='true'>
                          <embed src='$source_ram' 
                          height='$video_y' width='$video_x' ShowControls='1' ShowStatusBar='0' ShowDisplay='0' autostart='1' TYPE='application/x-mplayer2' console='television'>
                          </embed></object>"); }
 
////////////////////////////////////////////////////////////////////////
?>
 
</TR>
<TR>
<TD WIDTH=1 HEIGHT=109 ROWSPAN=2></TD>
<TD WIDTH=174 HEIGHT=109 ROWSPAN=2>&nbsp;</TD>
</TR>
<TR>
<TD >&nbsp;</TD>
<TD WIDTH=1 HEIGHT=21></TD>
</TR>
<TR>
<TD WIDTH=175 HEIGHT=71 COLSPAN=2>&nbsp;</TD>
<TD WIDTH=242 HEIGHT=71  valign="top">
 
<form method="post" action="">
<div align="center">
<select class=relief name="ontv" onChange="MM_jumpMenu('parent',this,0)">
<option value="<? echo"$domaine$chem_tv"; ?>">Aucune chaine sélectionnée</option>&nbsp; 
<option value="#" >--------------------------------</option>&nbsp; 
<?
////////////////////////////////////////////
// Crée  la liste des fichier           //
 
  for ($i=0; $i < count($entree); $i++)
  {
      if ($entree[$i] != "")
      { $Name = substr($entree[$i],0,(strlen($entree[$i])-4));
	    $Name_spaced=(ereg_replace("_"," ",$Name));
		echo "<option value='$domaine$chem_tv$var_tv$Name'";
 
		if ($Name == $ontv) {echo " selected";}
 
		echo">$Name_spaced</option>";
       }
    }
/////////////////////////////////////////////////////////////////////////////
?>
<option value="#">--------------------------------</option>
</select>
</div>
</form>
</TD>
<TD WIDTH=57 HEIGHT=71>&nbsp;
</TD>
<TD WIDTH=1 HEIGHT=71></TD>
</TR>
</TABLE>
<div align="center"><font color="#FF9933"><br>
  </font></div>
si qq un a une idée.
merci davance