Welcome to Geeklog, Anonymous Tuesday, April 30 2024 @ 03:28 pm EDT

Geeklog Forums

Random Photo Block under https


Anonymous

Anonymous
I have installed and configured the Random Photo Block. It appears everything is working in that a random photo is sleceted and a link to the gallery wrapped in geeklog is generated. The problem is that the url to the thumbnail photo and the url for the link to open Gallery wrapped in Geeklog does not include the "s" in https, so the thumbnail will not display and the link to Gallery wrapped in Geeklog thats starts with http:// which is a dead link on my machine. I am using https becuase my ISP blocks port 80 inbound. I am using GL 1.3.7sr1, Gallery 1.3.3, and Gallery Random Photo Block for Geeklog Rev 1.0 Thanks to anyone who can provide some help. Scott
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
There are several versions of this block around so it's hard to know which one you have but ... Does the block reference $_CONF['gallery_url'] which you define in your config.php? Blaine
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
Scott, Take a look at the gallery config.php and the setting for $gallery->app->photoAlbumUR This variable is defined with the gallery install utility but you can edit the file manually as well. Blaine
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Anonymous

Anonymous
Blaine, From my config.php: $gallery->app->photoAlbumURL = "https://ginsblog.sytes.net/gallery" I know this works because Gallery / Geeklog integration works and wrapps in nicely under https. It seems that if this were wrong, that would be broken too? The script generates the correct link paths in the url, all thats missing is the http "s". I can click on the place where the thumb is supposed to be and it opens the page to a dead link, insert the "s", and all is well. I sent you an email with a paste of the block code and of the config.php, did not want to clutter things here. Thanks for helping, Scott
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
Right .. and I spent time looking at the block and going thru the gallery code. The block calls makeAlbumUrl - a function in the gallery util.php file. This function in turn calls makeGalleryUrl() function. It was here that I saw it was using $gallery->app->photoAlbumURL. You may want to add some debugging to see what is going on in these functions and see if these functions are being called. Blaine
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Anonymous

Anonymous
Blaine, I am not a coder, I can somewhat follow along... slowly. In Gallery/init.php line 88: /* * Detect if we're running under SSL and adjust the URL accordingly. */ if (stristr($HTTP_SERVER_VARS["HTTPS"], "on"Wink) { $gallery->app->photoAlbumURL = eregi_replace("^http:", "https:", $gallery->app->photoAlbumURL); $gallery->app->albumDirURL = eregi_replace("^http:", "https:", $gallery->app->albumDirURL); } else { $gallery->app->photoAlbumURL = eregi_replace("^https:", "http:", $gallery->app->photoAlbumURL); $gallery->app->albumDirURL = eregi_replace("^https:", "http:", $gallery->app->albumDirURL); } Is there a way to use / reuse this funtion. This seems to work, if it is in fact the reason Gallery stand alone and wrapped in GL works under https, which I can confirm. Seems this could perhaps be part of the block code? Scott
 Quote

Anonymous

Anonymous
I payed for some donation based support from Bharat of the Gallery Project. This is what he came up with and everything is working now. Bharat refers to line number 142 below, that is the number as he found in in MY lib.custom.php. This is really line number 20 in a pristine php_GalleryRandomPhoto.php file that is part of the package available from Blaine. It is also the second line of uncommented code in the php block code. Thanks to Blaine and Bharat for your help and I highly reccomend a donation based support mechanism. It is a geat way to support the development effort, get problems addressed and fixed and see them rolled back into the software for everyone. From Bharat: Ok, it's fixed. It turned out to be a pretty interesting problem. The "init.php" script was never intended to be included from inside another function so it was trying to use the $HTTP_SERVER_VARS variable to determine whether or not you were in SSL mode, but that variable was not declared to be in the global scope (since we never expected to be inside a function at that point). This probably works for 99% of Geeklog users as-is because by default when that variable isn't available in the global scope it assumes that you're not in SSL mode. In short, the script wasn't intended to be used the way that it's being used so it wasn't operating exactly right in all cases. I made the smallest possible fix to resolve the problem. Basically, I editted lib-custom.php and on line 142 I changed: global $_CONF, $GALLERY_BASEDIR; to: global $_CONF, $GALLERY_BASEDIR, $HTTP_SERVER_VARS; And voila, now it works. Enjoy. -Bharat
 Quote

All times are EDT. The time is now 03:28 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content