Recent Topics

1 Mar 02, 2005 07:37    

I've been looking for something like this forever! Finally found a version I liked, and that worked!
I've been hearing about block-random.php forever, but I always hear about it as tied in with phpnuke. I got lucky on a google search and found this page:

It works great! and is so freaking simple!

One thing though, if anyone can get this "exclude X folder" add in to work, I would be very greatful!

Search for
$name = $tmpAlbum->fields["name"];

in block-random... and replace it as below.

$name = $tmpAlbum->fields["name"]; 
if ($name != "wrench1") {
if ($numPhotos > 0) {
$cache[$name] = $numPhotos;

It works fine for one folder, but what about for two or more? Could someone reverese it to include only X folders?
I tried string the ANDs together, and no luck.. maybe its because the folders have hyphens in the name?


2 Mar 07, 2005 17:03

You could use block-random-enhanced.php. Get it [url=]here[/url]. You tell it which album to pull from like this:


It also has a slightly nicer layout. Your caption and album name will all be closer together.

But I don't think it will let you exclude albums. You just have to move the sub-albums you want to pull from into an album. If you find a way to just exclude two albums, I'd be interested in it, too.

3 Apr 01, 2005 19:25

I'm trying to use this code to get a random image in my blog side block.
I don't write code so I'm probably missing something... sorry

Can you help?

I'm using b2evolution and the wpc_outback skin

I put this code in my _main.php file but the block doesn't show up.

Here is the code I use
I tried this
<!--#include virtual="/gallery/block-random-enhanced.php?album=The-Greenes" -->

and this

virtual="../../../gallery/block-random-enhanced.php?album=The-Greenes" -->
and this

here is my directory structure

htdocs/gallery/albums -> htdocs/albums

Any Ideas?

4 Apr 01, 2005 21:20

I used a php include and used the absolute web path.

<? include("") ?>

5 Apr 01, 2005 21:33

Awesome... thanks... one more question...

Take a look...

how do I get that font size to be smaller under the photos?

Thanks again

6 Apr 01, 2005 21:44

Add this code to your style.css file:

.caption { font-size: 8pt }

7 Apr 01, 2005 22:13

Kewl... thanks man... that did the trick

Form is loading...

Build your own site! – This forum is powered by b2evolution CMS, a complete engine for your website.