Welcome to Geeklog Tuesday, October 22 2019 @ 06:22 pm EDT

Geeklog Forums

GalleryRandomPhoto error


Status: offline

ofey

Forum User
Full Member
Registered: 18/03/05
Posts: 213
Location:Dublin, Ireland
thoughtful
Hi,

I have installed GeeklogGalleryRandomPhoto_v1.2 with GL (1.3.11) and I already use Gallery v1.5-RC2.

The random Photo block is working, but there is an error. Images in the 'Random Photo Block' sometimes have no caption. Such images when clicked on produce the error:
Fatal error: Call to a member function on a non-object in /hsphere/local/home/fjryanio/trojanswimclub.ie/gallery/classes/AlbumItem.php on line 453

People have posted similar issues but I can't find any solutions.

Any help would be greatly appreciated.

Regards,

Shane

My GL site here
Those who say it can't be done, are usually interrupted by others doing it.

Status: offline

ofey

Forum User
Full Member
Registered: 18/03/05
Posts: 213
Location:Dublin, Ireland
stupid
Anyone got any ideas, or am I just annoying people?
Those who say it can't be done, are usually interrupted by others doing it.

Status: offline

ppmnt

Forum User
Chatty
Registered: 09/06/04
Posts: 53
That happens when the random photo that it picked is actually the highlight of an album, so there is no corresponding large photo for it. I don't remember the fix for this right now, but you can search for this on the gallery forums too.

I'll see if I can find it in my email later on.

Status: offline

ppmnt

Forum User
Chatty
Registered: 09/06/04
Posts: 53
Hi -

With my new web site I made it easie on me: In lib-custom add the following function:

PHP Formatted Code
/* -----------------------
   BEGIN RANDOM PHOTO
   ----------------------- */


function phpblock_randomphoto () {

    @include '/path/to/gallery/block-random.php' ;
    return $retval;

}
 


And inside block-random.php (now comes with gallery):

Change
require(dirname(__FILE__) . "/init.php");

to:
require_once(dirname(__FILE__) . "/init.php");

Then change all occurances of "echo" and "print" with "$retval .=", then return $retval at the end.

OK, that may look complicated, but it's not. Just make a backup copy of block-random.php. This way your using gallery's latest update, and the bug is fixed.

Status: offline

ofey

Forum User
Full Member
Registered: 18/03/05
Posts: 213
Location:Dublin, Ireland
hopeful
Thanks for your help ppmnt,

I have one problem. I find five occurences of block-random.php in my directory.

geeklog/plugins/GeeklogGalleryRandomPhoto_v1.2/block-random.php
geeklog/plugins/gallery/block-random.php
trojanswimclub.ie/admin/plugins/gallery/block-random.php
trojanswimclub.ie/block-random.php
trojanswimclub.ie/gallery/block-random.php

Which one should I be working with?

Regards,

Shane
Those who say it can't be done, are usually interrupted by others doing it.

Status: offline

ppmnt

Forum User
Chatty
Registered: 09/06/04
Posts: 53
Did you use some kind of special gallery/geeklog integration? Unfortunately I'm not familiar with that. I simply install gallery into my /public_html/gallery directory and tell it it's integrated into Geeklog. This means you don't have the admin functionality under Geeklogs Admin page, but I've never missed that.

Try comparing all the block-random.php files. Are they all the same? What are the time stamps? You must have some of those from previous installations. Which is your document_root?

If your document root is trojanswimclub.ie then the file would be trojanswimclub.ie/gallery/block-random.php. But in general, just make sure you have the latest version of block-random.php, then make your changes to that and include that one in the function. It really doesn't matter where it is.

Status: offline

ofey

Forum User
Full Member
Registered: 18/03/05
Posts: 213
Location:Dublin, Ireland
confused
The files,

trojanswimclub.ie/admin/plugins/gallery/block-random.php

and

trojanswimclub.ie/gallery/block-random.php

are the same. When I made the changes you suggested to

trojanswimclub.ie/gallery/block-random.php

I saw no change to the site. The same error which as you said only occurs with highlighted photos.

I don't think Dirk would be too happy with me using up GL space with code so I put the five files here.

Did you use some kind of special gallery/geeklog integration?


Not as far as I know. My specifications above are as much as I know.
I have installed GeeklogGalleryRandomPhoto_v1.2 with GL (1.3.11) and I already use Gallery v1.5-RC2.


I had a few problems with the gallery installation I probably copied the file around a few times. So that might explain why the file is repeated.

Thanks for your help so far.

Shane
Those who say it can't be done, are usually interrupted by others doing it.

All times are EDT. The time is now 06:22 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