Plogger Support Forum - (selfcreated) popup window asks for login of visitor / database error Fri, 29 Mar 2024 10:16:50 +0000 http://www.plogger.org/forum/ Lussumo Vanilla 1.1.10 (selfcreated) popup window asks for login of visitor / database error http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=94#Comment_94 http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=94#Comment_94 Sat, 24 Sep 2005 02:39:01 +0000 jack
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 :(.]]>
(selfcreated) popup window asks for login of visitor / database error http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=98#Comment_98 http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=98#Comment_98 Sat, 24 Sep 2005 05:21:23 +0000 Ben
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.]]>
(selfcreated) popup window asks for login of visitor / database error http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=103#Comment_103 http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=103#Comment_103 Sun, 25 Sep 2005 03:53:07 +0000 jack
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?]]>
(selfcreated) popup window asks for login of visitor / database error http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=105#Comment_105 http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=105#Comment_105 Sun, 25 Sep 2005 04:08:34 +0000 Ben
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.]]>
(selfcreated) popup window asks for login of visitor / database error http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=107#Comment_107 http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=107#Comment_107 Sun, 25 Sep 2005 04:47:07 +0000 jack
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]]>
(selfcreated) popup window asks for login of visitor / database error http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=114#Comment_114 http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=114#Comment_114 Mon, 26 Sep 2005 03:55:12 +0000 Ben
Good to see you got it to work, not a problem at all :)]]>
(selfcreated) popup window asks for login of visitor / database error http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=116#Comment_116 http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=116#Comment_116 Mon, 26 Sep 2005 06:32:35 +0000 thebign
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]]>
(selfcreated) popup window asks for login of visitor / database error http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=117#Comment_117 http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=117#Comment_117 Mon, 26 Sep 2005 15:01:57 +0000 jack
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)]]>
(selfcreated) popup window asks for login of visitor / database error http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=118#Comment_118 http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=118#Comment_118 Mon, 26 Sep 2005 15:39:08 +0000 thebign
Thanks for sharing, but i get parse error.

I have send an email to you.]]>
(selfcreated) popup window asks for login of visitor / database error http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=128#Comment_128 http://www.plogger.org/forum/comments.php?DiscussionID=23&Focus=128#Comment_128 Tue, 27 Sep 2005 04:09:06 +0000 jack