Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorjack
    • CommentTimeSep 24th 2005 edited
     
    I'm still messing around to get this to work: opening a popup window for either the intermediate or the largest image. According to Mike this could be done fairly easy :), but I'm trying for two weeks now without succes :(.

    I created a custom popup.php file. First I placed this in the /admin folder with these includes at the top of the page:

    require_once("plog-globals.php");
    require_once("../plog-load_config.php");
    require_once("../plog-functions.php");

    Within gallery.php I replaced this code on line 418:

    $output .= '<li class="thumbnail"><div class="tag"><a href="' . generate_url("picture",$row["id"]) . '">' . $imgtag . "</a><br />";

    with this:

    $output .= '<li class="thumbnail"><div class="tag"><a href="' . generate_url("picture",$row["id"]) . '" onclick="window.open('admin/popup.php?src=' .$row["id"]. '','','resizeable=1,width=400,height=400,top=100,left=100'); return false")>' . $imgtag . "</a><br />";

    This works, but ONLY when the visitor or myself is logged in. Otherwise within the popupwindow the login screen will appear. As you can see I'm pointing at /admin/popup.php.

    Then I tried to open the popup.php from within the root folder of Plogger, and placing the popup.php at that same location, changing the top lines to:

    require_once("plog-globals.php");
    require_once("plog-load_config.php");
    require_once("plog-functions.php");

    and changing the code into ... window.open('popup.php?src='....

    but this gives me a database connection error:

    Fatal error: Call to undefined function: connect_db() in /srv/...../plogger/plog-globals.php on line 16

    Any help on this would be very much appreciated! I really tried all kinds of tweaks, but I'm no php expert :(.
    •  
      CommentAuthorBen
    • CommentTimeSep 24th 2005 edited
     
    Hi Jack,

    I was looking at the other post made by you where Mike talked about using the plog-thumbpopup.php. I have modified this and added the js script for the popup and rewrote the gallery.php with the plog-manage.php (admin) link. This is the test gallery where I have made the changes. *link removed sry*

    In this gallery when clicking on the image you will get the lrg image just like when in the manage mode in the admin which is what I think Mike was talking about. If this is what you are trying to do I will be more then willing to explain further what changes I have made.
    • CommentAuthorjack
    • CommentTimeSep 25th 2005
     
    Hi Ben,

    Thanks for your comment. I visited your testsite, and this is kind of what I was thinking about. What Mike proposed would, if I'm correct, give you the same preset size popup image, but what I would like is a customizable popup with the final image. Now the images are in three formats. Largest (the actual image you're uploading), intermediate and thumbnail. Now I'm looking for a way to either open the largest image right after clicking the thumbnail (like you did), or still use the intermediate image and then open the popup.

    Personally I would prefer a few extra options in the options page of Plogger:
    1. use intermediate image? (yes/no)
    2. open large image in same page or popup (page/popup)

    But currently Plogger doesn't provide that option (hope it will someday: easier to use/switch and easier when upgrading), so we have to improvise :)

    Take a look at my testsite. When the popup opens you first have to login. That's where my changes went wrong :), but just login (test / test) and then the popups work.

    http://www.spoenk.nl/plogger

    Can you think of a way to make this work ok?
    •  
      CommentAuthorBen
    • CommentTimeSep 25th 2005 edited
     
    Hi Jack,

    Yeah I was only doing the intermediate image since I didn't change what image was being selected for the original thumbpop. Anyway try this out.

    Go and move your pop up file to your base directory and change your code to point to that file instead of the admin popup file. Then go into the popup file itself and change the:

    require_once("plog-globals.php");
    require_once("../plog-load_config.php");
    require_once("../plog-functions.php");

    to:

    include("plog-functions.php");
    include("plog-globals.php");

    This is what I had to change in order for the file to work when moved. See if it works for you too, if not back to the drawing bored for me I guess, hehe.
    • CommentAuthorjack
    • CommentTimeSep 25th 2005
     
    Ben,

    Thanks! It works! I guess the problem came from 'requiring' the globals twice?
    Anyway, it works great now. I 'only' have to move the code in the gallery.php to get this to work with intermediate images if that would be my choice. I'm still not sure about that.

    Thanks again! :)

    Jack
    •  
      CommentAuthorBen
    • CommentTimeSep 26th 2005
     
    Hi Jack,

    Good to see you got it to work, not a problem at all :)
    • CommentAuthorthebign
    • CommentTimeSep 26th 2005
     
    Hi

    I have tried to follow your discussions in how to create a popup window. But cant get to work.

    Would you please share youre popup file? and show step by step what to do.

    My needs is to have a popup window from medium picture to see original picture.

    Thanks for sharing
    • CommentAuthorjack
    • CommentTimeSep 26th 2005
     
    Hi thebign,

    Change the code on line 234 of the gallery.php (something like that, between the <div id="picture-holder">):

    <a accesskey="v" href="'.$config["baseurl"].'images/'.$row["path"].'">'.$imgtag.'</a>

    into:

    <a accesskey="v" href="' . generate_url("picture",$row["id"]) . '" onclick="window.open('popup.php?src=' .$row["id"]. '','','resizeable=1,width=400,height=400,top=100,left=100'); return false")>' . $imgtag . '</a>

    In this case I added my own popup.php that takes care of the positioning and resizing, but you can also use a copy of the plog-thumbpopup.php in the admin folder. Then put these lines on top of that file:

    <?php
    include("plog-functions.php");
    include("plog-globals.php");
    ?>

    This file should be placed in the same location as gallery.php, so in the rootdirectory of Plogger. But if you send me an email I can also send you my own popup.php page (post@spoenk.nl)
    • CommentAuthorthebign
    • CommentTimeSep 26th 2005
     
    Hi Jack

    Thanks for sharing, but i get parse error.

    I have send an email to you.
    • CommentAuthorjack
    • CommentTimeSep 27th 2005
     
    I'll answer it when I'm back home. I'm working now :( ...