Newer
Older
<?
// include_once "admin/file_browser.php";
function dispAdminVideos () {
if ($_SESSION["user_right"] < $GLOBALS["EPTV"] )
{
return("T'es ouf");
}
get_time();
$result_prod = getVideosByType("eptvprod");
$result_bonus = getVideosByType("eptvbonus");
$result_adm = getVideosByType("eptv.adm");
$str = '
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#000000">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
<td>
<b>
<font color="#ffffff">
  a l l   v i d e o s
</font>
<FORM name="new_video" method="post" action="index.php?html=AdminHome§ion_admin=AdminAddVideos&vid_id='.$vid_id.'">
<INPUT class="button" TYPE="submit" NAME="action" VALUE=" NOUVELLE VIDEO "><BR> </TD>
</FORM>
</td>
<td>
<FORM name="new_video" method="post" action="index.php?html=AdminHome§ion_admin=AdminVideosSolos&vid_id='.$vid_id.'">
<INPUT class="button" TYPE="submit" NAME="action" VALUE="LISTE VIDEOS SOLOS"><BR> </TD>
</FORM>
</td>
</tr>
</table>
</td>
</tr>
</table>
<BR>';
if (mysql_num_rows($result_prod)) {
$str .= dispAdminVideosByType($result_prod, " e p t v p r o d u c t i o n");
if (mysql_num_rows($result_bonus)) {
$str .= dispAdminVideosByType($result_bonus, " e p t v   b o n u s");
}
if (mysql_num_rows($result_adm)) {
$str .= dispAdminVideosByType($result_adm, " e p t v . a d m");
}
return $str;
}
function dispAdminVideosByType($result, $video_type) {
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#000000">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
<td>
<b>
<font color="#ffffff">
'.$video_type.'
</font>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="4">
';
while ($video = mysql_fetch_array($result)) {
$vid_id = $video["video_id"];
$str .= dispWhenTendu($video["video_tendu"]);
$str .= '
<a href="
'.$video["video_path"].'
" class="texte_link">
'.$video["video_name"].'
</TD><TD>';
if ($video["video_path_daily"]) {
$str .= '<a href=\'http://www.eptv.fr/dailymotion.php?q='.$video["video_path_daily"].'\' onclick="return popitup(this, \'EPTV\')" ><img src=\'http://www.dailymotion.com/favicon.ico\' height=15></a>';
$str .= '</TD>
<TD>
'.$video["video_date"].'
</TD>
<TD align=center>
'.$video["video_size"].' Mo
</TD>
';
if ($video["video_user_id"] == $_SESSION["user_id"] || $_SESSION["user_right"] == $GLOBALS["ROOT"]){
$str .= '
<TD width=10% align=right>
<FORM name="update_video" method="post" action="index.php?html=AdminHome§ion_admin=AdminModifVideos&vid_id='.$vid_id.'">
<INPUT class="small_button" TYPE="submit" NAME="action" VALUE=" MODIF ">
<FORM name="supp_video" method="post" action="index.php?html=AdminHome§ion_admin=AdminDelVideos&vid_id='.$vid_id.'">
<INPUT class="small_button" TYPE="submit" NAME="action" VALUE=" SUPP ">
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
</TD>
';
}
$str .= '</TR>';
}
$str .= '
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
';
return ($str);
}
function find_reccur_file($rep_def)
{
$rep = opendir($rep_def);
while( $file = readdir($rep))
{
if($file !='..' && $file !='.' && $file !='')
{
if (is_dir($rep_def.$file))
{
$tab_temp = find_reccur_file($rep_def.$file.'/');
$tab = array_merge($tab, $tab_temp);
}
else if (is_file($rep_def.$file))
{
$tab[] = $rep_def.$file;
}
}
}
closedir($rep);
return $tab;
}
function dispAdminVideosSolos () {
$rep_def = "videos/";
if ($_SESSION["user_right"] < $GLOBALS["REPORTER"] )
{
return("T'es ouf");
}
// Files on BDD
$result = getAllVideos();
while ($video = mysql_fetch_array($result)) {
$tab_path_bdd[] = $video["video_path"];
}
// Files on Serveur
$tab_path_local = find_reccur_file($rep_def);
for ($cpt_local = 0; $tab_path_local[$cpt_local]; $cpt_local++)
{
for ($cpt_bdd = 0; $tab_path_bdd[$cpt_bdd] && $tab_path_bdd[$cpt_bdd] != $tab_path_local[$cpt_local]; $cpt_bdd++)
{
;
}
if (!$tab_path_bdd[$cpt_bdd])
{
$tab_solo[] = $tab_path_local[$cpt_local];
}
}
$str = '
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#000000">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
<td>
<b>
<font color="#ffffff">
  v i d e o s s o l o s
</font>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="4">
';
for ($i = 0; $tab_solo[$i]; $i++)
{
$str .= '
<TR>
<TD width = 380>
'.$tab_solo[$i].'
</TD>
<TD align=left>
<FORM name="update_video" method="post" action="index.php?html=AdminHome§ion_admin=AdminAddVideos&vid_path='.$tab_solo[$i].'">
<INPUT class="small_button" TYPE="submit" NAME="action" VALUE=" Ajouter ">
</FORM>
</TD>
</TR>
';
}
$str .= '
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
';
return $str;
}
function dispAdminAddVideos () {
$date = get_date();
$vid_path = "";
if (isset($_GET['vid_path']))
{
$vid_path = $_GET['vid_path'];
}
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#000000">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
<td>
<b>
<font color="#ffffff">
  a d d   v i d e o   t o   d a t a b a s e
</font>
<form name="saisie" method="post" action="index.php?html=AdminHome§ion_admin=AddVideo&vid_id='.$vid_id.'">
<TABLE CELLSPACING="0" CELLPADDING="10" BORDER="0">
<TR>
<TD> Path de la Vidéo: </TD>
<TD>
';
if (isset($_REQUEST['file']))
{
$str .= '<INPUT TYPE="text" NAME="video_get_path" VALUE="'.$_REQUEST['file'].'" SIZE="50" MAXLENGTH="150">';
}
else
{
$str .= '<INPUT TYPE="text" NAME="video_get_path" VALUE="'.$vid_path.'" SIZE="50" MAXLENGTH="150">';
}
$str .= "
<a href=\"#\" onClick=\"window.open('admin/file_browser.php','_blank','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=600,height=300');\"> Browser... </a>";
$str .= '
<TR><TD> Path Dailymotion: </TD>
<TD> <INPUT TYPE="text" NAME="video_path_daily" VALUE="'.$video_path_daily.'" SIZE="50"> </TD>
</TR>
<TR>
<TD> Nom de la Vidéo: </TD>
<TD> <INPUT TYPE="text" NAME="video_get_name" VALUE="" SIZE="50" MAXLENGTH="52"> </TD>
</TR>
<TR><TD> Date de dépot: </TD>
<TD> <INPUT TYPE="text" NAME="video_get_date" VALUE="'.$date.'" SIZE="8" MAXLENGTH="10"> </TD>
</TR>
<TR><TD>Catégorie</TD>
<TD>
<TABLE CELLSPACING"0" CELLPADDING="1" BORDER="0">
<TR> <TD>
<select name="video_type">
<option value="eptvprod">EPTv Production</option>
<option value="eptv.adm">EPTv.Adm</option>
<option value="eptvbonus">EPTv Bonus</option>
</TD></TR>
</TABLE>
</TD>
</TR>
<TR><TD>Commentaire: </TD>
<TD>
<TEXTAREA rows="3" cols="38" name="video_comment" ONFOCUS=""></textarea>
</TD>
</TR>
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
<TR><TD>Groupe Vidéo</TD>
<TD>
<TABLE CELLSPACING"0" CELLPADDING="1" BORDER="0">
<TR> <TD>
<select name="video_tendu">
<option value=0>Public</option>
<option value=1>Tendu</option>
<option value=2>Privée</option>
</TD></TR>
</TABLE>
</TD>
</TR>
<TR>
<TD>News</TD>
<TD>
<INPUT TYPE="checkbox" NAME="auto_www_news" VALUE = 1 checked> Poster une news automatique sur le site. (nom de la vidéo + date + commentaire + groupe)
</TD>
</TR>
<TR>
<TD> </TD>
<TD> <INPUT class="button" TYPE="submit" NAME="action" VALUE=" UPLOADER "> </TD>
</TR>
<TR>
<TD> </TD>
<TD> <INPUT class="button" TYPE="reset" NAME="action" VALUE=" RESET "> </TD>
</TR>
</TABLE>
</FORM>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
';
return $str;
}
function dispAdminModifVideos () {
$vid_id =$_GET['vid_id'];
$result = getOneVideo($vid_id);
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#000000">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
<td>
<b>
<font color="#ffffff">
  m o d i f y   v i d e o
</font>
<form name="saisie" method="post" action="index.php?html=AdminHome§ion_admin=ModifVideo&vid_id='.$vid_id.'">
<TR>
<TD> Path de la Vidéo: </TD>
<TD>
';
if (isset($_REQUEST['file']))
{
$str .= '<INPUT TYPE="text" NAME="video_get_path" VALUE="'.$_REQUEST['file'].'" SIZE="50" MAXLENGTH="150">';
}
else
{
$str .= '<INPUT TYPE="text" NAME="video_get_path" VALUE="'.$video["video_path"].'" SIZE="50" MAXLENGTH="150">';
}
$str .= "
<a href=\"#\" onClick=\"window.open('admin/file_browser.php','_blank','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=600,height=300');\"> Browser... </a>";
$str .= '
<TR><TD> Path Dailymotion: </TD>
<TD> <INPUT TYPE="text" NAME="video_path_daily" VALUE="'.$video["video_path_daily"].'" SIZE="50"> </TD>
</TR>
<TR><TD> Nom de la Vidéo: </TD>
<TD> <INPUT TYPE="text" NAME="video_get_upname" VALUE="'.$video["video_name"].'" SIZE="50" MAXLENGTH="52"> </TD>
</TR>
<TR><TD> Date de dépot: </TD>
<TD> <INPUT TYPE="text" NAME="video_get_date" VALUE="'.$video["video_date"].'" SIZE="8" MAXLENGTH="10"> </TD>
</TR>
<TR><TD>Catégorie</TD>
<TD>
<TABLE CELLSPACING"0" CELLPADDING="1" BORDER="0">
<TR> <TD>
<select name="video_get_type">
<option value="eptvprod" '.get_selected_option("eptvprod",$video["video_type"]).' >EPTv Production</option>
<option value="eptv.adm" '.get_selected_option("eptv.adm",$video["video_type"]).' >EPTv.Adm</option>
<option value="eptvbonus" '.get_selected_option("eptvbonus",$video["video_type"]).' >EPTv Bonus</option>
</TD></TR>
</TABLE>
</TD>
</TR>
<TR><TD>Commentaire: </TD>
<TD>
<TEXTAREA rows="3" cols="38" name="video_get_comment" ONFOCUS="">'.$video["video_comment"].'</textarea>
</TD>
</TR>
<TR><TD>Groupe Vidéo</TD>
<TD>
<TABLE CELLSPACING"0" CELLPADDING="1" BORDER="0">
<TR> <TD>
<select name="video_get_tendu">
<option value="0" '.get_selected_option(0, $video["video_tendu"]).' >Public</option>
<option value="1" '.get_selected_option(1, $video["video_tendu"]).' >Tendu</option>
<option value="2" '.get_selected_option(2, $video["video_tendu"]).' >Privée</option>
</TD></TR>
</TABLE>
</TD>
</TR>
';
<TR><TD>Postée par: </TD>
<TD>
';
$id_user = getOneUserById($video["video_user_id"]);
if (mysql_num_rows($id_user)){
}
$str .= $id_user["user_pseudo"].'</TD></TR>
<TR>
<TD> </TD>
<TD> <INPUT class="button" TYPE="submit" NAME="action" VALUE=" UPDATE "> </TD>
</TR>
<TR>
<TD> </TD>
<TD> <INPUT class="button" TYPE="reset" NAME="action" VALUE=" RESET "> </TD>
</TR>
</TABLE>
</FORM>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
';
return $str;
}
function dispAdminDelVideos () {
$vid_id =$_GET['vid_id'];
$result = getOneVideo($vid_id);
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#000000">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
<td>
<b>
<font color="#ffffff">
  d e l e t e   v i d e o
</font>
<form name="saisie" method="post" action="index.php?html=AdminHome§ion_admin=DelVideo&vid_id='.$vid_id.'">
<TR><TD> Nom de la Vidéo: </TD>
<TD>'.$video["video_name"].'</TD>
</TR>
<TR><TD> Date de dépot: </TD>
<TD> '.$video["video_date"].' '.$video["video_time"] .' </TD>
</TR>
<TR><TD>Catégorie: </TD>
<TD>
</TD>
</TR>
<TR><TD>Commentaire: </TD>
<TD>
'.$video["video_comment"].'
</TD>
</TR>
<TR><TD>Groupe Vidéo: </TD>
<TD>';
if ($video["video_tendu"] == 0){
$str .= 'Public</TD></TR>';
}
else if ($video["video_tendu"] == 1){
$str .= 'Tendu</TD></TR>';
}
else if ($video["video_tendu"] == 2){
$str .= 'Privée</TD></TR>';
}
<TR><TD>Postée par: </TD>
<TD>
';
$id_user = getOneUserById($video["video_user_id"]);
if (mysql_num_rows($id_user)){
}
$str .= $id_user["user_pseudo"].'</TD></TR>';
$str .= '
<TR>
<TD> </TD>
<TD> <INPUT class="button" TYPE="submit" NAME="action" VALUE=" SUPPRIMER "> </TD>
</TABLE>
</FORM>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
';
return $str;
}