View file script/selectflash.php

File size: 3.9Kb
<?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 2002-10-20

function fill($j, $k, $thumb_cols, $thumb_rows, $thumb_width)
{
 while ($j % $thumb_cols != 0)
 {
 echo '<td bgcolor="white"><img src="images/blank.gif" width="'.$thumb_width.'" border="0" alt=""></td>';
 $j++;
 $tr = 1;
 }
 if ($tr == 1) { echo '</tr><tr>'; }
 while ($k < $thumb_rows)
 {
 echo '<td bgcolor="white" colspan='.$thumb_cols.'><img src="images/blank.gif" border="0" alt="" width="'.$thumb_width.'" height="'.($thumb_width / 4*3).'"></td></tr><tr>';
 $k++;
 }
}

$thumb_aff = $thumb_cols * $thumb_rows;

session_start();
if (session_is_registered('private_pass'))
{
  if ($level == 'admin' && $l != '') { $where = $l; $l_your_select = $l_sel_add.': '.$l; }
  else { $where = $private_login; }

  $query="SELECT file FROM mcgallery_select WHERE login='$where' AND type='F'";
  $result=mysql_query($query);
  $nbre=mysql_num_rows($result);


  echo '<table border="0" cellspacing="0" cellpadding="1"><tr><td class="td1">';

  echo '<table border="0" cellspacing="0" cellpadding="5"><tr>';
  echo '<td align="center" class="td1" colspan="'.($thumb_cols -1).'">';
  echo '<font face="'.$rowd['fontface'].'" size="2" color="'.$rowd['fontcolor1'].'">'.$l_your_select.'</font></td>';
  echo '<td class="td1" align="right">';

  if ($start=='') { $start=0; }
  $query="SELECT file FROM mcgallery_select WHERE login='$where' AND type='F' ORDER BY file LIMIT $start, $thumb_aff";
  $result=mysql_query($query);
  echo '<font face="'.$rowd['fontface'].'" size="1" color="'.$rowd['fontcolor1'].'">('.$nbre.' '.$l_flash_anims.')</font></td></tr><tr>';
  $j=0;
  $k=0;
    while ($row2=mysql_fetch_array($result))
   {
    $image = substr(strstr($row2['file'], '_'), 1, -3).'jpg';
    $flash = substr(strstr($row2['file'], '_'), 1);
    $album = substr(str_replace($flash, '', $row2['file']), 0, -1);
     if ($l == '')
     {
     echo '<td bgcolor="white" align="center">'.shadow12($album, $image, $start);
     echo '<font face="'.$rowd['fontface'].'" size="1">';
     echo '<a href="index.php?del='.$row2['file'].'&t=F&sel=3" class="lien1"><b>'.$l_Suppr.'</b></a></font></td>';
     }
     else
     {
     echo '<td bgcolor="white" align="center">'.shadow15($album, $image, $start);
     echo '<font face="'.$rowd['fontface'].'" size="1" color="black">';
     echo $row2['file'].'</font></td>';
     }

   $j++;
    if ($j % $thumb_cols == 0)
    {
    echo '</tr><tr>';
    $k++;
    }
   }
  fill($j, $k, $thumb_cols, $thumb_rows, $thumb_width);

  echo '<td class="td1" colspan="'.$thumb_cols.'" align="right">';
  echo '<font face="'.$rowd['fontface'].'" color="'.$rowd['fontcolor1'].'" size="1">'.$l_page.':&nbsp;&nbsp;</font>';

  // start navigation
  $nbre_pages= ceil($nbre / $thumb_aff);

 $i=1;
 while ($i<(($start + $thumb_aff)/$thumb_aff))
  {
   echo '<font face="'.$rowd['fontface'].'" size="1"><a href="index.php?l='.$l.'&start='.($thumb_aff *($i-1)).'&sel=3" class="lien2">'.$i.'</a></font>&nbsp;';
   $i++;
  }
  echo '<font face="'.$rowd['fontface'].'" color="'.$rowd['fontcolor1'].'" size="1"><b> '.$i.' </b></font>&nbsp;';
  $i++;
  while ($i<=ceil($nbre/ $thumb_aff))
  {
   echo '<font face="'.$rowd['fontface'].'" size="1"><a href="index.php?l='.$l.'&start='.($thumb_aff *($i-1)).'&sel=3" class="lien2">'.$i.'</a></font>&nbsp;';
   $i++;
 }
 //  end navigation
 echo '</td></tr></table>';
  echo '</td></tr></table>';
}
?>