Hi Folks,
I finally upgraded to 1.44 so I could get the random block working again, works great btw! I do have a howto question though.
My site has a numerous galleries, and several of them I am hosting for friends. I do not want the random block displaying images from those galleries. Is there a way to do this? I'm using this with a crusty old version of phpnuke (Unsure of the version).
Cheers, Mark.
Posts: 13
I to would be interested in knowing how to restrict Random Block from choosing a particular album.
If I'm reading things correctly - It looks like the function scanAlbums() could be modified to exclude an album.
Has anyone tried this before?
Posts: 13
Looks like a google search answered my own question:
http://www.squatty.com/article.php?story=20021007061243579
I cleaned this up slightly to add an additional condition to the existing if clause.
Presumeably this could be altered by someone to only include specific albums as well.
So far it looks like it is working as expected.
Posts: 4
Great googling, I missed that.
Thanks, Mark.
Posts: 4
For those who do not know how to edit code well I put it in this file and commented it for you all.
Enjoy.
Posts: 8
I tried the code listed above but was still having problems for some reason, but I figured out a way to weed out photos being displayed from 'restricted' albums.
I just included a while loop in the doPhoto() function:
Original doPhoto() function (beginning):
Edited doPhoto() function:
This forces the script to continue to re-run the chooseAlbum() function until the album chosen is 'not' one of the restricted albums you have specified... to add extra albums, just use the || (logical 'or') symbol and include $album->fields['name'] == "albumname", of course switching the name of the album you don't want shown.
This works for me... I figured I'd add it since I was just searching around for a way to exclude albums from my random block, but after a bit of code digging I came up with this solution myself.
I hope someone else finds it useful.
Posts: 44
Hello!
I'm working with this on my gallery, and so far, so good. I have the code:
However, I am running into an issue with Sub-Albums - I have my main albums, and a series of Sub-albums called "Aawards-YYYY-MM" (with YYYY and MM being the Year and Month - a new one is added monthly). All of those Awards-YYYY-MM albums are grouped under a main album called "Awards".
Now, here's the catch - I excluded the main "Awards" album, but it does not seem to be excluding the various sub-albums, which makes sense. Is there a way to exclude all Awards albums, using a wildcard or such, to weed them out?
I could exclude them individually, but that would mean editing my block-random.php every month when I added a new album. O.O
Thank you!
--
Geoffrey J. Schaller
http://gallery.knightrealms.com
Posts: 2
hi there, i'm kind of a gallery newbie and am not so experienced with all the codings.
i tried to manage the random-block, which worked quite fine.
but now i don't quite understand how i can only pic pictures from a specific album with its subalbums.
i found an older post, which is about two years old, showing a very simple example how to do that. unfortunately the newer gallery versions do not support this method anymore.
is ther an official and simple way to do so (for the latest gallery 1)? i tried some of the methods above, but didn't get a working script and to admit, i'm not so familiar with the coding showed above.
for example where do i have to enter the code piece from gjschaller?
would really appreaciate your help.
thx so far
dave