svfh35 | bonjour,
je suis en train de créer un site intranet concernant une photothèque.
des thumbs s'affichent et lorsque l'on clique dessus l'image en moyenne def s'ouvre dans un popup. les personnes peuvent télécharger l'image une par une si elles sont intéressées en haute def. Mais j'aurais voulu qu'elles les sélectionnent et qu'elles puissent les télécharger tout d'un coup. comment faire? voici mon script :
Code :
- <?php
- $titre = "titre de la page";
- $col_simple = "Non";
- $nbr_colonne =4;
- $nbr_ligne ="";
- $Rep = "telechargement/";
- $Bas_de_page = "";
- $image_de_fond = "";
- $thumb = "Oui";
- $pourcentage_reduce = 80;
- $RepGrosseImages = "images/";
- $faire_miniature = "Non";
- function GetFileList( $dirname="." ) {
- $files = array();
- $dir = opendir( $dirname );
- while( $file = readdir( $dir ) ) {
- if (ereg("jpg$",$file) || ereg("JPG$",$file) ||
- ereg("jpeg$",$file) || ereg("JPEG$",$file) ||
- ereg("png$",$file) || ereg("PNG$",$file) ||
- ereg("gif$",$file) || ereg("GIF$",$file)
- ) {
- $files[] = $file;
- }
- }
- sort($files);
- return $files;
- }
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <script language="JavaScript" type="text/JavaScript">
- <!--
- function MM_reloadPage(init) { //reloads the window if Nav4 resized
- if (init==true) with (navigator) {if ((appName=="Netscape" )&&(parseInt(appVersion)==4)) {
- document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
- else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
- }
- MM_reloadPage(true);
- //-->
- </script>
- <title>Document sans titre</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" alink="#FFFFFF" vlink="#999999" background=
- <div align="left"><img src="http://srvintranet/phototheque/bienvenue.jpg" width="1005" height="123" > </div>
- <p align="center">
- <SCRIPT Language="JavaScript">
- <!--
- var popWin = null
- var winCount = 0
- var winName = "popWin"
- function openPopWin(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
- var d_winLeft = 0
- var d_winTop = 0
- winName = "popWin" + winCount++
- closePopWin()
- if (openPopWin.arguments.length >= 4)
- winFeatures = "," + winFeatures
- else
- winFeatures = ""
- if (openPopWin.arguments.length == 6)
- winFeatures += getLocation(winWidth, winHeight, winLeft, winTop)
- else
- winFeatures += getLocation(winWidth, winHeight, d_winLeft, d_winTop)
- popWin = window.open(winURL, winName, "width=" + winWidth
- + ",height=" + winHeight + winFeatures)
- }
- function closePopWin(){
- if (navigator.appName != "Microsoft Internet Explorer"
- || parseInt(navigator.appVersion) >=4)
- if(popWin != null) if(!popWin.closed) popWin.close()
- }
- function getLocation(winWidth, winHeight, winLeft, winTop){
- return ""
- }
- //-->
- </SCRIPT>
- <SCRIPT Language="JavaScript1.2">
- <!--
- function getLocation(winWidth, winHeight, winLeft, winTop){
- var winLocation = ""
- if (winLeft < 0)
- winLeft = screen.width - winWidth + winLeft
- if (winTop < 0)
- winTop = screen.height - winHeight + winTop
- if (winTop == "cen" )
- winTop = (screen.height - winHeight)/2 - 20
- if (winLeft == "cen" )
- winLeft = (screen.width - winWidth)/2
- if (winLeft>0 & winTop>0)
- winLocation = ",screenX=" + winLeft + ",left=" + winLeft
- + ",screenY=" + winTop + ",top=" + winTop
- else
- winLocation = ""
- return winLocation
- }
- //-->
- </SCRIPT>
- <b><font face="Arial,Helvetica"><font size="+2"><?php echo $titre ?> </font></font></b> 
- </p>
- <?
- echo "<table border=\"0\" align=\"center\" cellspacing=\"0\" cellpadding=\"6\"> \n";
- $imagelist = GetFileList("$RepGrosseImages" );
- $nbr_par_page =$nbr_colonne * $nbr_ligne;
- $nbr_tot =count($imagelist);
- $debut = 1;
- $j = 1;
- $fin = $nbr_par_page;
- if (!isset($ppage))
- {
- $ppage=1;
- }
- for($i=$debut; $i < $nbr_tot +1 ; $i++) {
- $image = $imagelist[$i-1];
- if (file_exists("$RepGrosseImages$image" ))
- {
- $size = getimagesize("$RepGrosseImages$image" );
- $width = $size[0];
- $height = $size[1];
- $rwidth = $size[0]/1;
- $rheight = $size[1]/1;
- }
- {
- if ($j == ( $nbr_colonne ) )
- {
- echo " <td> \n";
- echo " <center> \n";
- echo " <a href='javascript:openPopWin(\"$RepGrosseImages$image\",$rwidth,$rheight,\"\",\"cen\",\"cen\" )'> \n";
- if ($thumb == "Oui" )
- {
- echo " <img src='thumb/$image' border=0 alt='$image*$width*$height' \n";
- }
- else
- {
- echo " <img src='$RepGrosseImages$image' border=0 alt='$image*$width*$height' </a>\n";
- }
- echo " <td> \n";
- echo "<a href=$Rep$image.zip> \n";
- echo " <br><font face=\"Arial,Helvetica\"><font size=-2>Télécharger $image</font></font></a> </td>\n";
- echo "</center> \n";
- echo " </tr> \n";
- $j = 1;
- }
- else
- {
- echo " <td> \n";
- echo " <center> \n";
- echo " <a href='javascript:openPopWin(\"$RepGrosseImages$image\",$rwidth,$rheight,\"\",\"cen\",\"cen\" )'> \n";
- if ($thumb == "Oui" )
- {
- echo " <img src='thumb/$image' border=0 alt='$image*$width*$height' \n";
- }
- else
- {
- echo " <img src='$RepGrosseImages$image' border=0 alt='$image*$width*$height' </a>\n";
- }
- echo " <td> \n";
- echo "<a href=$Rep$image.zip> \n";
- echo " <br><font face=\"Arial,Helvetica\"><font size=-2>Télécharger $image</font></font></a> </td></center>\n";
- $j = $j + 1;
- }
- }
-
- } //if
- echo "</table> \n";
- echo "<BR> \n";
- echo "<CENTER> \n";
- $sval = -1;
- echo "</CENTER> \n";
- ?>
- </body>
- </html>
|
|