Random-Block? Nuke? Standalone?

west4me

Joined: 2004-03-07
Posts: 75
Posted: Sun, 2004-03-07 17:20

Here's the deal: I have been playing around trying to add a random photo to my Gallery page. I have read all that I can here and I have looked elsewhere. The forums say there is a standalone, will this standalone work on the Gallery page? or will it be a seperate page? If it does does anyone know where it is? I can't seem to find it.

If the standalone will not work, what can I do? I'm not sure if I have Nuke, if I do I can't seem to figure out what to edit or implement. I would appreciate any suggestions. I'm new to Gallery and PHP. I have the latest release of Gallery and you can see what I have done at www.west4me.com.

Thanks

 
jeffbh

Joined: 2002-12-26
Posts: 38
Posted: Mon, 2004-03-15 00:48

You might find the link below helpful; I've got some examples and info about adding random photos to any HTML page:

http://www.barcahall.com/gallery-block-random.html

-Jeff

 
stonemonkey

Joined: 2003-09-28
Posts: 7
Posted: Fri, 2004-03-19 15:38
jeffbh wrote:
You might find the link below helpful; I've got some examples and info about adding random photos to any HTML page:

http://www.barcahall.com/gallery-block-random.html

-Jeff

Jeff, thanks for the info/script snippets on your site. I've installed your version of block-random.php and followed your steps but I'm picking up an error that I have isolated to be coming from block-random.php/util.php,

Warning: urlencode() expects parameter 1 to be string, object given in thenmc.org.uk/pages/gallery/util.php on line 1098

Any ideas where the problem is?

Cheers

PS I should say that error message displays when I visit http://thenmc.org.uk/pages/gallery/block-random.php as well as when I visit the page that I had embedded the call to the random image in

 
stonemonkey

Joined: 2003-09-28
Posts: 7
Posted: Fri, 2004-03-19 15:52
stonemonkey wrote:
Any ideas where the problem is?

Sounds a bit lame quoting your owm msg in reply :wink: but a friend of mine has spotted where I was having the problem, this is the fix he gave me:

in block-random.php, line 172

."<a href=" .makeAlbumUrl($album) ." $targetAttr>"

should be

."<a href=" .makeAlbumUrl($album->fields["name"]) ." $targetAttr>"

This works for me.

Hope that helps, and soz for butchering your code!

 
jeffbh

Joined: 2002-12-26
Posts: 38
Posted: Tue, 2004-03-23 03:59

Thank you, stonemonkey (and friend), for pointing out this bug and its fix.

I've updated the source on my site.

-Jeff

 
panter011

Joined: 2003-01-21
Posts: 39
Posted: Tue, 2004-03-30 11:02

The standalone version from jeff
http://www.barcahall.com/gallery-block-random.html
worked for me.

I am using gallery 1.4.1-pl1

Some additional notes:
First the script dont worked, I was looking everywhere without finding the error, really guys I was ready to abandon and find for another random-block on the internet.

But suddenly I realised that I was miscopied the block-random.php file (the format was modified by my note-pad !

See it in action here: http://www.namaste-creativity.com

 
Doctor_WHO
Doctor_WHO's picture

Joined: 2003-02-23
Posts: 26
Posted: Wed, 2004-03-31 04:17

Im going crazy, maybe I am wrapped around the axel here... but I am trying to get the random block to work in php nuke 6.9 with gallery 1.4.2. I have seen this block on other sites using 1.4.2 and have emailed them to no avail. I have been searching these forums for 3 days to no avail.

I followed the instructions on http://www.barcahall.com/gallery-block-random.html and deleted the cache left and right. The first iteration shows a random picture from the gallery, but upon refresh I continue to get this error:

Quote:
Warning: rand() expects parameter 2 to be long, string given in /home/dakrats/public_html/modules/gallery/block-random.php on line 138
ERROR: requested index [] out of bounds [14]
Fatal error: Call to a member function on a non-object in /home/dakrats/public_html/modules/gallery/classes/Album.php on line 963

Also, I noticced the hyperlink on the first attempts points to the base gallery directory, opposed to its location within nuke. I'm sure I can scour the code and hack this, but if you know the line its on.. ill take it.

I have been trying to have a random block for over a year on and off now. I even tried going to coppermine, which had awesome blocks... but was crap for functionality compared to gallery.

ANY help in sorting this would be greatly appreciated. Hope I have not overlooked something really simple in my frustration.

TIA Guys

 
panter011

Joined: 2003-01-21
Posts: 39
Posted: Wed, 2004-03-31 04:34

But the instruction here http://www.barcahall.com/gallery-block-random.html
are for the STANDALONE version, you need to read for the phpnuke version dont'u?

 
ryno267
ryno267's picture

Joined: 2004-02-21
Posts: 10
Posted: Sun, 2004-04-04 20:32

thanks... finally a good code to use for the blog.... good job.

 
gregchet
gregchet's picture

Joined: 2003-01-10
Posts: 105
Posted: Sun, 2004-05-16 20:33

Has anyone ever had a problem where they've setup multiple random images to display, but it doesn't display all of them?

For example:

I have 5 random images down the left-hand side of my page. I've copied the IFRAME code 5 times, and the javascript is in between the head tags. However, sometimes when I refresh the page only 4 will show, or sometimes 2 will show, but there's a bit of extra whitespace where the missing images -should- have displayed.

To see what I mean, please see: http://www.greg.ca/_news/

Keep refresthing the page and eventually less than 5 random images will display on the left-hand side of the screen.

Does anybody know if there's a way to fix this?

PS - Yes, all of the IFRAME ids are different (blockrandom1-blockrandom5)

 
gregchet
gregchet's picture

Joined: 2003-01-10
Posts: 105
Posted: Mon, 2004-05-17 23:09

Has anyone else had a problem with hidden pictures showing up when they're not supposed to?

Example:

Album Name: ALBUM1

ALBUM1 has *everything* set to "NOBODY", except for who can view the album, who can view comments, and who can post comments, which are all associated with a specific user name (we'll say USER1). But, "EVERYBODY" doesn't appear anywhere on the permissions page.

However, some of these images are being grabbed for inclusing with my random block.

I've already tried deleting the cache file, resetting these permissions, and then trying again, but that didn't seem to make a difference at all.

Does anyone know why this might be happening or how I could go about fixing it?

While browsing my site I just had a random image popup that made me think, "Oh my, I hope my parents don't see this!" :P

If someone could help me out on this, it would be greatly appreciated. I want to keep using this random block (in fact, implementing the random images just sparked a totally new site design for me), but if it's going to include images that are supposed to be hidden to the general public, I just won't be able to use it :(

 
gregchet
gregchet's picture

Joined: 2003-01-10
Posts: 105
Posted: Wed, 2004-05-19 19:12

I'm guessing that nobody's ever found a fix for this problem?

 
FellatedOne

Joined: 2003-12-15
Posts: 13
Posted: Mon, 2004-05-31 05:58

Is there any way to eliminate the album info under the picture and leave it with just an image?

 
jeffbh

Joined: 2002-12-26
Posts: 38
Posted: Sat, 2004-07-17 05:55
gregchet wrote:
I'm guessing that nobody's ever found a fix for this problem?

If you were using the version from my site, I made a fix in June to respect sub-album security (sounds as if that might be the problem you were seeing).

If so, get the latest from http://www.barcahall.com/gallery-block-random.html .

-Jeff

 
gregchet
gregchet's picture

Joined: 2003-01-10
Posts: 105
Posted: Mon, 2004-07-19 05:06

That's so weird, I could swear that I posted a followup here a long time ago.

Yes, I had an older version of the random block. Once I downloaded and installed the most current one from your site, everything worked fine. It's a great little site add-on.

Thanks for the help!