View file script/slide.php

File size: 3.96Kb
<?php
/*-----------------------------------------------------------------------------------------
mcGalleryPRO
All code is © 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
--------------------------------------------------------------------------------------------*/

session_start();
include './admin/conf.inc.php';
include './header.php';
include './lang/'.$_SESSION['lang'];

  $connect= mysql_connect($host,$login,$pass);
  mysql_select_db($base, $connect);

  $query="SELECT id, album FROM mcgallery_photo WHERE idalbum='$album'";
  $result=mysql_query($query);
  $nbre=mysql_num_rows($result);
   $row2=mysql_fetch_array($result);
  echo '<table border="0" cellspacing="0" cellpadding="1" align="center"><tr><td class="td1">';

  echo '<table border="0" cellspacing="0" cellpadding="5"><tr>';
  echo '<td align="center" class="td0" colspan="2">';
  echo '<font size="2">'.stripslashes($row2['album']).'</font></td>';
  echo '<td class="td0" align="right" width="30%">';

  $query="SELECT file, title FROM mcgallery_photo WHERE idalbum=$album ORDER BY file";
  $result=mysql_query($query);
  echo '<font size="1">('.$nbre.' '.$l_photos.')</font></td></tr>';
  echo '<tr><td bgcolor="white" align="center" colspan="3">';

  if (empty($speed)) $speed = 6;
?>

<img id="_Ath_Slide" onload="OnImgLoad()">

<script language="JavaScript1.2">
/*
Interactive Image slideshow with text description
By Christian Carlessi Salvadу ([email protected]).
Keep this notice intact.
Visit http://www.dynamicdrive.com for script
Customzation by Marc cagninacci
*/
g_fPlayMode = 0;
g_iimg = -1;
g_imax = 0;
g_ImageTable = new Array();

function ChangeImage(fFwd)
{
if (fFwd)
{
if (++g_iimg==g_imax)
g_iimg=0;
}
else
{
if (g_iimg==0)
g_iimg=g_imax;
g_iimg--;
}
Update();
}

function getobject(obj){
if (document.getElementById)
return document.getElementById(obj)
else if (document.all)
return document.all[obj]
}

function Update(){
getobject("_Ath_Slide").src = g_ImageTable[g_iimg][0];
}

function Play()
{
g_fPlayMode = !g_fPlayMode;
if (g_fPlayMode)
{
getobject("btnPrev").disabled = getobject("btnNext").disabled = true;
Next();
}
else
{
getobject("btnPrev").disabled = getobject("btnNext").disabled = false;

}
}
function OnImgLoad()
{
if (g_fPlayMode)
window.setTimeout("Tick()", g_dwTimeOutSec*1000);
}
function Tick()
{
if (g_fPlayMode)
Next();
}
function Prev()
{
ChangeImage(false);
}
function Next()
{
ChangeImage(true);
}

<?php

    while ($row2=mysql_fetch_array($result))
   {
   $len= strlen($album);
   $image= substr($row2['file'], ($len + 1));
   $photo = $album.'/'.$image;
   ?>
g_ImageTable[g_imax++] = new Array ("markee.php?im=photos/<?php echo $photo; ?>");
<?php
   }
?>
g_dwTimeOutSec=<?php echo $speed; ?>

if (document.getElementById||document.all)
window.onload=Play
</script>

<?php
echo '</td></tr>';
echo '<tr><td align="center" class="td1" colspan="2">';
echo '<input type="button" id="btnPrev" value="&lt;&lt;" onclick="Prev();">&nbsp;<input type="button" id="bntPlay" value="&nbsp;| |&nbsp;&nbsp;/&nbsp;&nbsp;>&nbsp;" onclick="Play()">&nbsp;<input type="button" id="btnNext" value="&gt;&gt;" onclick="Next();"></td>';
echo '<td align="right" class="td1">';
echo '<font size ="1">'.$l_speed.': <a href="slide.php?album='.$album.'&speed=3" class="lien2">3</a> - ';
echo '<a href="slide.php?album='.$album.'&speed=6" class="lien2">6</a> - ';
echo '<a href="slide.php?album='.$album.'&speed=9" class="lien2">9</a>';
echo '</font>';
echo '</td></tr>';
echo '<tr><td align="center" class="td1" colspan="3">';
echo '<font size="1"><a href="index.php?album='.$album.'" class="lien2">'.$l_Retour.'</a></font></td></tr>';
echo '<tr><td class="td0" colspan="3">&nbsp;';
echo '</td></tr></table>';
echo '</td></tr></table>';
?>