Просмотр файла script/showvideo.php

Размер файла: 8.33Kb
<?php
///////////////////////////////////////////////////////////////////////
// mcGalleryPRO                                                      //
// All code is © 2002-2003 Marc Cagninacci.                          //
// No files may be redistributed in whole or significant part.       //
// -------------- mcgalleryPRO IS NOT FREE SOFTWARE ---------------- //
// You should have receive a file called license.txt in this package //
///////////////////////////////////////////////////////////////////////

// Last modified 2003-02-08

session_start();
include './admin/conf.inc.php';
include './header.php';
include './shadow.php';
if (empty($lang)) $lang = $lang_def;
include './lang/'.$lang;

$connect= mysql_connect($host,$login,$pass);
mysql_select_db($base, $connect);
//
if (file_exists(substr('videos/'.$album.'/'.$file, 0, -3).'mpg')) $file= substr($album.'_'.$file, 0, -3).'mpg';
if (file_exists(substr('videos/'.$album.'/'.$file, 0, -3).'avi')) $file= substr($album.'_'.$file, 0, -3).'avi';
if (file_exists(substr('videos/'.$album.'/'.$file, 0, -3).'MPG')) $file= substr($album.'_'.$file, 0, -3).'MPG';
if (file_exists(substr('videos/'.$album.'/'.$file, 0, -3).'AVI')) $file= substr($album.'_'.$file, 0, -3).'AVI';
//
//$file= substr($album.'_'.$file, 0, -3).'mpg'; 
$query= "UPDATE mcgallery_video SET visite=visite+1 WHERE file ='$file'";
mysql_query ($query);
$query="SELECT * FROM mcgallery_video WHERE file='$file'";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
$album=$row['idalbum'];


if ($rowd['dartcolor'] == '#FFFFFF') { $dart_g = 'gauche.gif'; $dart_d = 'droit.gif'; }
elseif ($rowd['dartcolor'] == '#000000') { $dart_g = 'gaucheN.gif'; $dart_d = 'droitN.gif'; }

if ($searchit == '')
{
 if ($sel == 2)
 {  
 $query2="SELECT file FROM mcgallery_select WHERE login ='$private_login' AND type ='V' ORDER BY file";
 }
 else
 {
 $query2="SELECT file FROM mcgallery_video WHERE idalbum ='$album' ORDER BY file";
 }
 $result2=mysql_query($query2);
 $prevarray = array();
 while ($row2=mysql_fetch_array($result2))
 {
 $prevarray[]=$row2['file'];
 }
 $key = array_search($file, $prevarray);
 if ($key > 0)
 {
 list($path1,$path2) = split('_', $prevarray[$key-1],2);
 $small1 = substr($path2,0,-3).'jpg';
 if (!file_exists('videos/'.$path1.'/small/'.$small1)) { $small1 = substr($path2,0,-3).'JPG'; }
 $previd = '<a href="showvideo.php?sel='.$sel.'&start='.$start.'&album='.$path1.'&file='.$path2.'" onMouseOver="window.status=\'\';return true"><img src="images/'.$dart_g.'" border="0" align="middle"><img src ="videos/'.$path1.'/small/'.$small1.'" border="0" alt="&lt;" width="'.$thumb_title.'"></a>';
 }
 if (isset($prevarray[$key+1]))
 {
 list($path3,$path4) = split('_', $prevarray[$key+1],2);
 $small2 = substr($path4,0,-3).'jpg';
 if (!file_exists('videos/'.$path3.'/small/'.$small2)) { $small2 = substr($path4,0,-3).'JPG'; }
 $nextid = '<a href="showvideo.php?sel='.$sel.'&start='.$start.'&album='.$path3.'&file='.$path4.'" onMouseOver="window.status=\'\';return true"><img src ="videos/'.$path3.'/small/'.$small2.'" border="0" alt="&gt;" width="'.$thumb_title.'"><img src="images/'.$dart_d.'" border="0" align="middle"></a>';
 }
}
?>

<table border="0" cellspacing="1" cellpadding="5" align="center" class="td1">
<tr>
<td class="td1" align="center" colspan="2">
<table border="0" cellspacing="0" cellpadding="1" align="center" width="100%">
<tr>
<td class="td1"><font face="<?php echo $rowd['fontface']; ?>" size="1"><?php echo $previd; ?></font></td>
<td align="center" class="td1" width="100%">
<font face="<?php echo $rowd['fontface']; ?>" size="2" color="<?php echo $rowd['fontcolor1']; ?>">
<?php 
if ($row['title']!='') { echo stripslashes($row['title']); }
else { echo stripslashes($row['album']); }


  $len= strlen($album);
  $image= substr($row['file'], ($len + 1)); 

echo '</font></td><td class="td1" align="right"><font face="'.$rowd['fontface'].'" size="1">'.$nextid.'</font></td>';
echo '</tr></table>';
echo '</td></tr><tr>';
echo '<td bgcolor="white" align="center" colspan="2"><embed src="videos/'.$album.'/'.$image.'" width="'.$video_width.'" height="'.$video_height.'" autostart="true" align="middle"></embed></td></tr>';


if ($row['title']!='')
{
echo '<tr><td class="td1" align="left" width="20%"><font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'"><b>'.$l_Album.': </b></font></td>';
echo '<td class="td1" align="left"><font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'">'.stripslashes($row['album']).'</font></td></tr>';
echo '<tr><td class="td1" align="left" width="20%"><font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'"><b>'.$l_Titre.': </b></font></td>';
echo '<td class="td1" align="left"><font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'">'.stripslashes($row['title']).'</font></td></tr>';
}

if ($row['author']!='' || $row['email']!='' || $row['url']!='')
{
echo '<tr><td class="td1" align="left" width="20%"><font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'"><b>'.$l_Auteur.': </b></font></td>';
echo '<td class="td1" align="left"><font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'">'.stripslashes($row['author']).'</font>';
 if ($row['email']!='') { echo '&nbsp;&nbsp;<a href="mailto:'.$row['email'].'"><img src="images/ecrire.gif" border="0" alt=""></a>'; }
 if ($row['url']!='') { echo '&nbsp;&nbsp;<a href="'.$row['url'].'" target="_blank" onMouseOver="window.status=\'\';return true"><img src="images/home.gif" border="0" alt=""></a>'; }
echo '</td></tr>';
}

if ($row['descr']!='')
{
echo '<tr><td class="td1" align="left" width="20%" valign="top"><font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'"><b>'. $l_Description.': </b></font></td>';
echo '<td class="td1" align="left" width="'.($video_width + 10).'"><font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'">'.nl2br(stripslashes($row['descr'])).'</font></td></tr>';
}
if ($row['ref']!='')
{
echo '<tr><td class="td1" align="left" width="20%" valign="top"><font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'"><b>'. $l_ref.': </b></font></td>';
echo '<td class="td1" align="left"><font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'">'.$row['ref'].'</font></td></tr>';
}
/*
else
{
echo '<tr><td class="td1" align="left" width="20%" valign="top"><font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'"><b>'. $l_ref.': </b></font></td>';
echo '<td class="td1" align="left" width="'.($taille[0]/1.3).'"><font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'">'.substr($row['file'], 0, -4).'</font></td></tr>';
}
*/
echo '<tr><td class="td1" align="center" colspan="2"><font face="'.$rowd['fontface'].'" size="1">';

if ($comment_allowed > 0) {
echo '<a href="#" onclick="javascript:window.open(\'./add.php?t=V&id='.$row['id'].'\',\'\',\'width=300,height=300\');" class="lien2" onMouseOver="window.status=\'\';return true">'.$l_add_comment.'</a>';
}

if ($select_allowed == 1 && $sel != 2)
{
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:window.open(\'./select.php?t=V&file='.urlencode($row['file']).'\',\'\',\'width=250,height=250\');" class="lien2" onMouseOver="window.status=\'\';return true">'.$l_sel_add.'</a>';
}

if ($ecard_allowed == 2 || ($ecard_allowed == 1 && $album < 100))
{
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:window.open(\'./card.php?im=videos/'.$album.'/'.$image.'\',\'\',\'width=300,height=350\');" class="lien2" onMouseOver="window.status=\'\';return true">'.$l_ecard_video.'</a>';
}

echo '</font></td></tr>';

if ($comment_allowed > 0)
{
include './comment.php';
}

if ($t == 'V') { $go = '&t='.$t.'&searchit='.$searchit; }
echo '<tr><td class="td1" align="center" colspan="2">';
if ($sel == 2)
{
echo '<font face="'.$rowd['fontface'].'" size="1"><a href="index.php?start='.$start.'&sel=2" class="lien2" onMouseOver="window.status=\'\';return true">'.$l_Retour.'</a></font>';
}
else
{
echo '<font face="'.$rowd['fontface'].'" size="1"><a href="index.php?searchwhere='.$searchwhere.'&video=1&start='.$start.'&album='.$row['idalbum'].$go.'" class="lien2" onMouseOver="window.status=\'\';return true">'.$l_Retour.'</a></font>';
}
echo '</td></tr></table>';

include './footer.php';
?>