I have tried installing the script and it gives me the following error
Fatal error: Failed opening required 'modules/gallery/init.php' (include_path='') in /home/agatka/public_html/gallery/pnblocks/gallery_random.php on line 63
That's when my gallery is in a gallery folder but when I have it installed on a subdomain then I don't get anything :sad: Page not found.
Line 63
require_once($GALLERY_BASEDIR . "init.php");
But I am most interested installing it on the subdomain galeria.agatka.net.
Any help?
Thanks
Posts: 77
Hi,
the block you use is the one for postnuke integration. It is not for use as on a stand alone gallery installation (seems that you're not using PN). <!-- BBCode Start --><A HREF="http://gallery.sourceforge.net/docs.php?artid=23" TARGET="_blank">Here</A><!-- BBCode End --> you can get a version for a stand alone gallery!
Joerg
Posts: 140
Guess I didn't read the entire thing, but now I got it to work but only the first time.
When I go to the block-random.php now I get the following error:
Warning: rand() expects parameter 2 to be long, string given in /home/agatka/public_html/galeria/block-random.php on line 138
ERROR: requested index [] out of bounds [5]
Fatal error: Call to a member function on a non-object in /home/agatka/public_html/galeria/classes/Album.php on line 570
Have no idea what it is. Can anyone help me?
Thanks
Posts: 140
Just as a reminder ... that I still can't figure this out and am looking for help.
Thanks :smile:
Posts: 3474
<!-- BBCode Start --><IMG SRC="http://www.beckettmw.com/images/rudolph.png"><!-- BBCode End -->
Hmm. That's strange.
First, make sure you've deleted albums/block-random.cache, then try reloading the page. Remember, you don't want to call the file itself. Make sure it's embedded in another PHP file.
I also found that I needed to set the $GALLERY_BASEDIR variable to the full path to my gallery immediately before calling block-random.php.
If you're still getting the problem, can you post the code you're using to include the file?
Thanks, and happy holidays,
-Beckett
Posts: 17
I've got the Random_Block installed in my PostNuke site and I'm getting a similar error:
When I delete albums/block-random.cache, the block works fine. One time. Then I get the above error again. :sad:
The site is at http://www.biav.org/index.php
At first, the block didn't work at all, because I created it with an HTML Block. This time I used a PHP Block and it worked... sort of.
Any ideas, anyone?
Posts: 17
Hello?
Anyone here?
Posts: 75
I was able to run Random Block -- though I was having some intermittent problems with the cache file.
Within postnuke you should be creating the block with the gallery-random photo block category. Not HTML or php. I'm not sure if I understood with what you said, but let us know if you did create it with the correct block type.
Other than that, I'm not sure what else is wrong with the rand() function.
Posts: 140
Hello everyone, I hope you had wonderfull time this holiday.
Beckett, I am getting the same error no matter how I include the file in my website. I've tried the php include and iframe and same thing.
When I changedthe base direcotry to the full path I am getting different error:
Fatal error: Call to undefined function: fs_file_exists() in /home/agatka/public_html/galeria/block-random.php on line 55
So really I don't know what to do with this.
Thanks
Posts: 6
I am getting a similar problem, here is my error message:
I'm using this line to call the script:
<?php include ("gallery/block-random.php"); ?>
and here's a link to the live page I am calling from:
http://www.flowbots.com/r-index.php
thx in advance!
Posts: 6
OK, from another thread joerg suggested using the newest init.php from the gallery cvs, so i did and both of the above errors went away. but now i've got a new one:
i get the same error in a postnuke block and in a stand alone instance.
Posts: 3
Hi,
I had the same problem and it's really easy to fix
levigator: just uncomment the line at 101 and do this
Open block-random.php and change:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>function choosePhoto($album) {
global $cache;
$count = $cache[$album->fields["name"]];
if ($count == 0) {
// Shouldn't happen
return null;
} else if ($count == 1) {
$choose = 1;
} else {
$choose = rand(1,$count);
$wrap = 0;
if ($album->isHidden($choose)) {
$choose++;
if ($choose > $album->numPhotos(1)) {
$choose = 1;
$wrap++;
if ($wrap = 2) {
return null;
}
}
}
}
return $choose;
}</TD></TR></TABLE><!-- BBCode End -->
to:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>function choosePhoto($album) {
global $cache;
$count = $cache[$album->fields["name"]];
if ($count == 0) {
// Shouldn't happen
return null;
} else if ($count == 1) {
$choose = 1;
} else {
settype($count,"integer");
$choose = rand(1,$count);
$wrap = 0;
if ($album->isHidden($choose)) {
$choose++;
if ($choose > $album->numPhotos(1)) {
$choose = 1;
$wrap++;
if ($wrap = 2) {
return null;
}
}
}
}
return $choose;
}</TD></TR></TABLE><!-- BBCode End -->
And it should be fixed :smile:
Posts: 6
Thanks for the tip. I tried what you said, but now I get the following error. I should say that line 101 wasn't not commented so I took it out of use by commenting it.
any ideas? i'm using 1.3.1, maybe I should upgrade to 1.3.3?
Posts: 3
you may try that, think it should work (or just upload your original init.php)
Posts: 15
I have been trying to use all the solutions posting on the forum to get my random and resizing work.
I use a standalone system.
I wanted to use full photos as my thumbnails size was 100 and at my random size was 500 by 300 , so resizng the same would blur the images.
I then changed
echo "<center>"
."<a href=" .makeAlbumUrl($album->fields["name"], $id) ." $targetAttr>"
.$album->getThumbnailTag($index,$size)
."</a>";
-------------------------------------------------------------
to
-------------------------------------------------------------
echo "<center>"
."<a href=" .makeAlbumUrl($album->fields["name"], $id) ." $targetAttr>"
.$album->getPhotoTag($index,$size)
."</a>";
although i do get the images but the sizes are way too big.
Is there a way i can resize the whole image and not just the thumbnail
Thanks
Zor
Oh and the website url is
http://jitu.net/index2.php
Posts: 15
I have been trying to use all the solutions posting on the forum to get my random and resizing work.
I use a standalone system.
I wanted to use full photos as my thumbnails size was 100 and at my random size was 500 by 300 , so resizng the same would blur the images.
I then changed
echo "<center>"
."<a href=" .makeAlbumUrl($album->fields["name"], $id) ." $targetAttr>"
.$album->getThumbnailTag($index,$size)
."</a>";
-------------------------------------------------------------
to
-------------------------------------------------------------
echo "<center>"
."<a href=" .makeAlbumUrl($album->fields["name"], $id) ." $targetAttr>"
.$album->getPhotoTag($index,$size)
."</a>";
although i do get the images but the sizes are way too big.
Is there a way i can resize the whole image and not just the thumbnail
Thanks
Zor
Oh and the website url is
http://jitu.net/index2.php
Posts: 15
Please ppl some can help me ..
i cannot figure this out
Thanks
Zor
Posts: 14
Would someone please post a good link to standalone Block-random?
Posts: 2
I found this site...it worked great for me.
http://www.barcahall.com/gallery-block-random.html