Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 02:25 pm EDT

Geeklog Forums

Random Photo Install


Status: offline

congleal

Forum User
Full Member
Registered: 11/08/04
Posts: 179
1. Gallery2 is installed and functioning (C:geeklogpublic_htmlgallery2). Its data base was created in a separate directory, which was recommeded. (C:g2data)

2. GeeklogGalleryRandomPhoto_v1.2 - Seems pretty simple with only 3 files to install but I haven't been able to successfully install this plugin.

3. When I encounter errors I attempt to look at the path statements and make corrections accordingly. Ex:Fatal error: Call to undefined function: fs_file_exists() in C:geeklog-1.3.11rc1systemlib-custom.php on line 413.

4. My question at this point is am I suppose to create a file named "block-random.cache" in accordance with Step 3 of the instructions?
"Step 3

Modify your /system/lib-custom.php file

Insert the function from the provided file phpblock_GalleryRemotePhoto.php

IMPORTANT: Modify the settings in the function to setup your site paths

$GALLERY_BASEDIR = "/path/to/gallery/";
define(CACHE_FILE, "/path/to/gallery/block-random.cache");

NOTE: Its advised that your CACHE_FILE directory differ from your $GALLERY_BASEDIR to avoid the "Warning: Invalid argument supplied for foreach()" error."

Thanks
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Hmm, Gallery 2? I may be wrong, but isn't that block made for Gallery 1.4?

bye, Dirk
 Quote

congleal

Anonymous
Banging your head Thanks Embarassed
 Quote

Andr0id

Anonymous
I had major issues with the Random Photo block code. My solution was to redo it from scratch. I was able to solve the problem buy creating a function in the lib-custom.php as follows:

function phpblock_RandomPhoto() {

$buffer=file_get_contents("http://www.domain.name/gallery/block-random.php");
return $buffer;

}

and then adding the phpblock_RandomPhoto function in the new block, and that was all I had to do. No file uploads, nor path problems or anything. It might not be the best way but it lets block-random.php provided by the gallery install to do all the work.
Hope it helps...
www.andr0id.com
 Quote

jamgill

Anonymous

Wow! That's a sweet, sweet solution. Good call on letting the existing gallery code do the work. This could be considered a hack, no?

Thank you.
 Quote

Status: offline

zewt

Forum User
Junior
Registered: 04/02/05
Posts: 18
And if you are actually using Gallery2, then this will work.

function phpblock_RandomPhoto() {

$buffer=file_get_contents("http://www.domain.name/gallery/main.php?g2_view=imageblock:External&g2_blocks=randomImage&g2_show=title");
return $buffer;

}

The "main" and "g2" may change depending on your install.

Very Happy
 Quote

merknz

Anonymous
Quote by zewt: And if you are actually using Gallery2, then this will work.

function phpblock_RandomPhoto() {

$buffer=file_get_contents("http://www.domain.name/gallery/main.php?g2_view=imageblock:External&g2_blocks=randomImage&g2_show=title");
return $buffer;
}


That works a treat, much better then the @readfile suggested in the external block command.
 Quote

Status: offline

surgeon

Forum User
Newbie
Registered: 01/31/05
Posts: 8
Location:Poland
nevermind... (Can i delete this post? Smile )
--
Pozdrawiam (Regards)
surgeon
http://galeria.lubin.pl/
 Quote

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