Avatar billede freakazoid18 Nybegynder
25. august 2003 - 12:21 Der er 5 kommentarer og
1 løsning

Popup view.

Hej eksperter :)
Jeg har et enkelt spørgsmål jeg skal have mit galleri som viser thumbnails til at åbne de store som popups... sådan at adressen bar osv ikk er med clear window...

:::KODE:::

<?
##############################################################################
# Easy Gallery                  Version 1.2                                  #
# Copyright 2001 DotDragNet    burt@dotdragnet.co.uk                        #
# PHP, Flash, ASP and Perl from http://www.dotdragnet.co.uk/                #
##############################################################################
# This script is copyright 2001, burt@dotdragnet.co.uk www.dotdragnet.co.uk  #
#                                                                            #
# COPYRIGHT NOTICE                                                          #
# Copyright 2001 DotDragNet.co.uk  All Rights Reserved.                      #
#                                                                            #
# This script may be used and modified free of charge by anyone so long as  #
# this copyright notice and the comments above remain intact.  By using this #
# script and its associated files, you agree to indemnify DotDragNet and all #
# other interested parties from any liability that might arise from it's use.#
#                                                                            #
# Selling the code for this program without prior written consent is        #
# expressly forbidden.  Obtain permission before redistributing this        #
# script over the Internet or in any other medium. In all cases copyright    #
# and header must remain intact.                                            #
#                                                                            #
# Please don't remove the link to www.dotdragnet.co.uk from the pages        #
# that this script creates.  All ya gotta do is let us know where it is in  #
# use, and you may then remove the link!                                    #
#                                                                            #
# DotDragNet also requests that should you make any improvements to this    #
# script, please be kind enough to let us know so that we may improve ours  #
# for the rest of the people who use it.                                    #
##############################################################################

// PLEASE READ THE ACCOMPANYING README.TXT

// DEFINE VARIABLES:

// NUMBER OF <TD> PER <TR> ( IN ENGLISH: COLUMNS IN THE PAGE :-) )
$td='4';
// BACKGROUND COLOR OF THE PAGE
$bg='white';
// SHOW THE NAME OF THE FILE?
$name='0'; // 1 = yes, 0 = no
// TITLE OF YOUR PAGE
$pagetitle='A selection of my images. Click each one to see a larger image.';

### --- CHANGE NOTHING BELOW THIS LINE UNLESS YOU ARE OK WITH PHP --- ###

// DIRECTORY NAME
$handle=opendir('.');

// GO
$piccy=array();
$count=0;
// SCAN THE DIR
while (($filename = readdir($handle))!==false) {
  // ADD IN EXTRA FILE TYPES HERE
  if (substr($filename,-4) == ".jpg" || substr($filename,-4) == ".gif" || substr($filename,-4) == ".png" || substr($filename,-4) == ".JPG" || substr($filename,-4) == ".GIF" || substr($filename,-4) == ".PNG"  || substr($filename,-4) == ".BMP" || substr($filename,-4) == ".bmp"){
  if (substr($filename,0,6) == "thumb_"){
    $piccy[$count] = $filename;
    $count++;
  }}}
// CLOSE DIR
closedir($handle); 
// SORT THE FILES
sort($piccy);
reset($piccy);

// DISPLAY LARGE IMAGE
if ($large){
        echo "<html><head><title>Easy Gallery :: " .$large. "</title></head><body bgcolor=" . $bg . ">";
  echo '<div align="center">';
// IS NAME SELECTED TO SHOW?
  if ($name=="1") {
      if (!(file_exists($large))){
          echo "No file of that name is uploaded.";
          exit;
      }
      echo '<br><font face="verdana" size="1">Selected image: ' . $large . '</font>';}
// SHOW THE PICTURE
  echo '<table width="100%" border=0 cellpadding=0 cellspacing=0>';
  echo '<tr>';
  echo '<td valign="middle" align="center"><a href=java script:history.back(-1)><img src="'.$large.'" alt="'.$large.'" border=0></a></td>';
  echo '<br>';
  echo '</tr></table>';
  echo '<br><br>';
  echo '<a href=java script:history.back(-1)>';
  echo '<font face="verdana" size="1">Back to the Thumbnail Gallery</font></a>';
        }
// NO LARGE PICCY, CREATE TABLE FOR THUMBNAILS:
else{
// start table, if you want cellpadding, cellspacing, colors, set them here
echo '<html><head><title> ::// Easy Gallery //::</title>';
echo '<head>';
echo "<body bgcolor=" . $bg . ">";
echo '<div align="center"><font face="verdana" size="1">' . $pagetitle . '</font><br>';
echo '<br><table width="100%" border=0 cellpadding=0 cellspacing=0>';
echo '<tr>';
// BECAUSE THE <TD> IS SET BY USER, WORK OUT THE PERCENTAGES:
$divider=ceil(100/$td);
if (($divider*$td)>100) $divider--;
// GRAB THE IMAGES
for ($l=0;$l<=sizeof($piccy)-1;$l++){
  $isend = strpos((($l)/$td),".");
  if (!$isend && ($l!=0)){echo "</tr>\n<tr><td colspan=$td><br></td></tr>\n<tr>\n";}
  if ($l==0){echo "\n";}
  // START THE <TD>
  echo '<td width="'.$divider.'%" valign="middle" align="center">';
  // GET THE LARGER PICTURE (IF SELECTED)
  echo "<a href=\"$PHP_SELF?large=".substr($piccy[$l],6)."\">";
  // DISPLAY THE THUMBNAILS
  echo '<img src="'.$piccy[$l].'" alt="'.$piccy[$l].'" border=0></a><br><br>';
  // IS NAME SELECTED TO SHOW?
  if ($name=="1") {
  echo '<font face="verdana" size="1">' . substr($piccy[$l],6) . '</font>';}
  echo '</td>';
  echo"\n";}
  echo '</tr></table></div>';}
  ?>

:::KODE SLUT:::

Håber i kan fixe :)
Avatar billede avminarm Juniormester
25. august 2003 - 12:39 #1
prøv at indsætte dette:

// GET THE LARGER PICTURE (IF SELECTED)
  echo "<a href=\"#\" onClick="MyWindow=window.open('$PHP_SELF?large=".substr($piccy[$l],6)."','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=300,left=100,top=100'); return false;\">";
  // DISPLAY THE THUMBNAILS
Avatar billede freakazoid18 Nybegynder
25. august 2003 - 14:22 #2
det virker sq ikk ritti :D

www.eterno.dk/galleri/
test selv :P
Avatar billede freakazoid18 Nybegynder
25. august 2003 - 14:25 #3
vil så også godt have sådan den åbner i fuld size af billedet bagefter :)
Avatar billede avminarm Juniormester
25. august 2003 - 15:09 #4
manglede en \ - prøv med dette:

// GET THE LARGER PICTURE (IF SELECTED)
  echo "<a href=\"#\" onClick=\"MyWindow=window.open('$PHP_SELF?large=".substr($piccy[$l],6)."','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=300,left=100,top=100'); return false;\">";
  // DISPLAY THE THUMBNAILS
Avatar billede avminarm Juniormester
25. august 2003 - 15:15 #5
ved fullscreen - vist nok:

// GET THE LARGER PICTURE (IF SELECTED)
  echo "<a href=\"#\" onClick=\"MyWindow=window.open('$PHP_SELF?large=".substr($piccy[$l],6)."','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=300,left=100,top=100,fullscreen=yes'); return false;\">";
  // DISPLAY THE THUMBNAILS
Avatar billede freakazoid18 Nybegynder
25. august 2003 - 16:13 #6
Wee najz :D
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester