Avatar billede fragze Juniormester
11. maj 2005 - 12:21 Der er 2 kommentarer og
1 løsning

Sikkert simpel popup.

Hej Experter, nu har jeg sidder og rodet med mit script i længer tid og mangler kun at når jeg klikker på billedet for at få det i fuld størrelse smadre den mine tables... :) derfor vil jeg lave en popup som popper i dne størrelse mit billed har, i kan se test på http://fragze.dk/gallery og min kode er her :



<? ob_start(); ?>
<html>
<head>
    <title>www.dammoel.dk</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="STYLESHEET" type="text/css" href="style.css">
</head>
<body bgcolor="#C4C4C4" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td valign=top align=center>
<table width="800" height="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td>
            <img src="images/dammoel_01.gif" width="62" height="68" alt=""></td>
        <td>
            <img src="images/dammoel_02.gif" width="247" height="68" alt=""></td>
        <td colspan="8">
            <img src="images/dammoel_03.gif" width="429" height="68" alt=""></td>
        <td>
            <img src="images/dammoel_04.gif" width="62" height="68" alt=""></td>
    </tr>
    <tr>
        <td colspan="11">
            <img src="images/dammoel_05.gif" width="800" height="156" alt=""></td>
    </tr>
    <tr>
        <td colspan="2">
            <img src="images/dammoel_06.gif" width="309" height="21" alt=""></td>
        <td>
            <img src="images/omos1.gif" width="54" height="21" alt=""></td>
        <td>
            <img src="images/personer1.gif" width="64" height="21" alt=""></td>
        <td>
            <img src="images/portfolio1.gif" width="68" height="21" alt=""></td>
        <td>
            <img src="images/rejser1.gif" width="47" height="21" alt=""></td>
        <td><a href="index.php?cmd=book">
            <img src="images/guestbook1.gif" width="69" height="21" alt="" border="0"></a></td>
        <td>
            <img src="images/links1.gif" width="39" height="21" alt=""></td>
        <td><a href="index.php?cmd=kontakt">
            <img src="images/kontakt1.gif" alt="" width="59" height="21" border="0"></a></td>
        <td colspan="2">
            <img src="images/dammoel_14.gif" width="91" height="21" alt=""></td>
    </tr>
    <tr>
        <td colspan="11">
            <img src="images/dammoel_15.gif" width="800" height="21" alt=""></td>
    </tr>
    <tr>
        <td background="images/left.gif" width="62" height="100%">
        </td>
        <td colspan="9" background="images/content.gif" width="100%" valign=top><table width="95%" height="100%" border="0" align="center">
          <tr>
            <td width="100%" valign="top"><?php

require(dirname(__FILE__) . '/init.php');

// Hack check
if (!$gallery->user->canReadAlbum($gallery->album)) {
        header("Location: " . makeAlbumHeaderUrl());
    return;
}
if (isset($full) && !$gallery->user->canViewFullImages($gallery->album)) {
    header("Location: " . makeAlbumHeaderUrl($gallery->session->albumName, $id));
    return;
}
if (!isset($full)) {
    $full=NULL;
}

if (isset($id)) {
    $index = $gallery->album->getPhotoIndex($id);
    if ($index == -1) {
        // That photo no longer exists.
            header("Location: " . makeAlbumHeaderUrl($gallery->session->albumName));
        return;
    }
} else {
    $id = $gallery->album->getPhotoId($index);
}

if (!empty($votes))
{
      if (!isset($votes[$id]) && $gallery->album->getPollScale() == 1 && $gallery->album->getPollType() == "critique")
      {
              $votes[$id]=null;
      }
      saveResults($votes);
      if ($gallery->album->getPollShowResults())
      {
              list($buf, $rank)=showResultsGraph(0);
        print $buf;
      }
}

// is photo hidden?  should user see it anyway?
if (($gallery->album->isHidden($index))
    && (!$gallery->user->canWriteToAlbum($gallery->album))){
    header("Location: " . makeAlbumHeaderUrl($gallery->session->albumName));
    return;
}


$albumName = $gallery->session->albumName;
if (!isset($gallery->session->viewedItem[$gallery->session->albumName][$id])
    && !$gallery->session->offline) {
    $gallery->session->viewedItem[$albumName][$id] = 1;
    $gallery->album->incrementItemClicks($index);
}

$photo = $gallery->album->getPhoto($index);
if ($photo->isMovie()) {
    $image = $photo->thumbnail;
} else {
    $image = $photo->image;
}
$photoURL = $gallery->album->getAlbumDirURL("full") . "/" . $image->name . "." . $image->type;
list($imageWidth, $imageHeight) = $image->getRawDimensions();

$do_fullOnly = isset($gallery->session->fullOnly) &&
        !strcmp($gallery->session->fullOnly,"on") &&
              !strcmp($gallery->album->fields["use_fullOnly"],"yes");
if ($do_fullOnly) {
    $full = $gallery->user->canViewFullImages($gallery->album);
}
   
$fitToWindow = !strcmp($gallery->album->fields["fit_to_window"], "yes")
        && !$gallery->album->isResized($index)
        && !$full
        && (!$GALLERY_EMBEDDED_INSIDE || $GALLERY_EMBEDDED_INSIDE =='phpBB2');

$numPhotos = $gallery->album->numPhotos($gallery->user->canWriteToAlbum($gallery->album));
$next = $index+1;
if ($next > $numPhotos) {
    //$next = 1;
        $last = 1;
}
$prev = $index-1;
if ($prev <= 0) {
    //$prev = $numPhotos;
        $first = 1;
}


$top = $gallery->app->photoAlbumURL;

$bordercolor = $gallery->album->fields["bordercolor"];
$borderwidth = $gallery->album->fields["border"];
if ($borderwidth == 0) {
    $borderwidth = 1;
}


#-- breadcrumb text ---
$upArrowURL = '<img src="' . getImagePath('nav_home.gif') . '" width="13" height="11" alt="' . _("navigate UP") .'" title="' . _("navigate UP") .'" border="0">';
$breadCount = 0;
$breadtext[$breadCount] = _("Album") .": <a class=\"bread\" href=\"" . makeAlbumUrl($gallery->session->albumName) .
      "\">" . $gallery->album->fields['title'] . "&nbsp;" . $upArrowURL . "</a>";
$breadCount++;
$pAlbum = $gallery->album;
$depth = 0;
do {
  if (!strcmp($pAlbum->fields["returnto"], "no")) {
    break;
  }
  $depth++;
  $pAlbumName = $pAlbum->fields['parentAlbumName'];
  if ($pAlbumName && (!$gallery->session->offline
          || $gallery->session->offlineAlbums[$pAlbumName])) {

    $pAlbum = new Album();
    $pAlbum->load($pAlbumName);
    $breadtext[$breadCount] = _("Album") .": <a class=\"bread\" href=\"" . makeAlbumUrl($pAlbumName) .
      "\">" . $pAlbum->fields['title'] . "&nbsp;" . $upArrowURL . "</a>";
  } elseif (!$gallery->session->offline || isset($gallery->session->offlineAlbums["albums.php"])) {
    //-- we're at the top! ---
    $breadtext[$breadCount] = _("Gallery") .": <a class=\"bread\" href=\"" . makeGalleryUrl("albums.php") .
      "\">" . $gallery->app->galleryTitle . "&nbsp;" . $upArrowURL . "</a>";
    $pAlbumName = '';
  }
  $breadCount++;
} while ($pAlbumName && $depth < $gallery->app->maximumAlbumDepth);

//-- we built the array backwards, so reverse it now ---
for ($i = count($breadtext) - 1; $i >= 0; $i--) {
    $breadcrumb["text"][] = $breadtext[$i];
}
$extra_fields=$gallery->album->getExtraFields(false);
$title=NULL;
if (in_array("Title", $extra_fields)) {
    $title=$gallery->album->getExtraField($index, "Title");
}
if (!$title) {
    $title=$photo->image->name;
}

if (isset($gallery->app->comments_length)) {
    $maxlength=$gallery->app->comments_length;
} else {
    $maxlength=0;
}

if (isset($save)) {
    if ( empty($commenter_name) || empty($comment_text)) {
        $error_text = _("Name and comment are both required to save a new comment!");
    } elseif ($maxlength >0 && strlen($comment_text) >$maxlength) {
        $error_text = sprintf(_("Your comment is too long, the admin set maximum length to %d chars"), $maxlength);
    } else {
        $comment_text = removeTags($comment_text);
        $commenter_name = removeTags($commenter_name);
        $IPNumber = $HTTP_SERVER_VARS['REMOTE_ADDR'];
        $gallery->album->addComment($id, stripslashes($comment_text), $IPNumber, $commenter_name);
        $gallery->album->save();
        emailComments($id, $comment_text, $commenter_name);
    }
}

if (!$GALLERY_EMBEDDED_INSIDE) {
    doctype(); ?>
                <link rel="next" href="<?php echo makeAlbumUrl($gallery->session->albumName, $navigator['allIds'][$navpage+1]) ?>" >
                <link rel="last" href="<?php echo makeAlbumUrl($gallery->session->albumName, $navigator['allIds'][$navcount - 1]) ?>" >
                <?php         }
      ?>
                <!-- Top Nav Bar -->
                <?php

$href="";
if (!$gallery->album->isMovie($id)) {
    if (!$do_fullOnly && ($full || $fitToWindow || $gallery->album->isResized($index))) {
        if ($fitToWindow) {
            $href="";
        }
        else if ($full) {
            $href= makeAlbumUrl($gallery->session->albumName98, $id);
        } else if ($gallery->user->canViewFullImages($gallery->album)) {
            $href= makeAlbumUrl($gallery->session->albumName, $id, array("full" => 1));
        }
    }
} else {
    $href= $gallery->album->getPhotoPath($index) ;
}

$photoTag="";
$frame= $gallery->album->fields['image_frame'];
if ($fitToWindow && (preg_match('/safari|opera/i', $HTTP_SERVER_VARS['HTTP_USER_AGENT']) || $gallery->session->offline)) {
    //Safari/Opera can't render dynamically sized image frame
    $frame = 'none';
}
$photoTag .= $gallery->album->getPhotoTag($index, $full);

list($width, $height) = $photo->getDimensions($full);
$gallery->html_wrap['borderColor'] = $gallery->album->fields["bordercolor"];
$gallery->html_wrap['borderWidth'] = $gallery->album->fields["border"];
$gallery->html_wrap['frame'] = $frame;
$gallery->html_wrap['imageWidth'] = $width;
$gallery->html_wrap['imageHeight'] = $height;
$gallery->html_wrap['imageHref'] = $href;
$gallery->html_wrap['imageTag'] = $photoTag;
if ($fitToWindow && $gallery->user->canViewFullImages($gallery->album)) {
    $gallery->html_wrap['attr'] = 'onclick="sizeChange.toggle()"';
}
$gallery->html_wrap['pixelImage'] = getImagePath('pixel_trans.gif');

includeHtmlWrap("inline_photo.frame");
?></td>
          </tr>
        </table></td>
        <td background="images/right.gif" width="62" height="100%">
        </td>
    </tr>
    <tr>
        <td colspan="11">
            <img src="images/dammoel_19.gif" width="800" height="93" alt=""></td>
    </tr>
    <tr>
        <td>
            <img src="images/spacer.gif" width="62" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="247" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="54" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="64" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="68" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="47" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="69" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="39" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="59" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="29" height="1" alt=""></td>
        <td>
            <img src="images/spacer.gif" width="62" height="1" alt=""></td>
    </tr>
</table>
        </td>
    </tr>
</table>
</body>
</html>
<? ob_end_flush(); ?>

Mvh
Jesper
Avatar billede fennec Nybegynder
11. maj 2005 - 13:56 #1
Roenving har lavet et script. Det kan findes her:
http://roenving.users.whitehat.dk/WD1ResizeTilBillede.html
Avatar billede olebole Juniormester
11. maj 2005 - 16:10 #2
<ole>

Du skulle nok prøve at lave en bedre kodestruktur, så du undgår at bruge output-buffering - ob_start() og ob_end_flush(). Det er helt unødvendigt, hvis man i øvrigt skriver en god kode - og det slider enormt på serveren, da hele dokumentet gemmes i dennes hukommelse.

/mvh
</bole>
Avatar billede fragze Juniormester
15. juni 2005 - 16:04 #3
...
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