Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 10:56 am EST
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
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
13
16
Quote
congleal
Anonymous
Thanks
14
12
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
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
14
11
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.
14
12
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.
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.
11
12
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;
}
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.
12
12
Quote
All times are EST. The time is now 10:56 am.
- 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