Problem with using random image and featured photo together

rudyb

Joined: 2004-12-11
Posts: 36
Posted: Sat, 2004-12-11 01:01

Hope I'm not repeating a thread, here. Did a few searches and didn't see anything *quite* like this.

I know almost nothing about PHP, and am kind of learning as I go, so please bear with me.

Here's the setup:

Using mambo 4.5.1a

I can use Random Image, or Featured-photo, but not both on the same page.

If I put them both on the same page, whichever module I put first, works, then the other gives an error.

Specifics:

If I put random image first, random image works, then where featured-photo should be, I get the following error:

Quote:
Warning: file(/featured-photo.cache): failed to open stream: No such file or directory in /home/ownedg00/domains/ownedgear.com/public_html/gallery/featured-photo.php on line 49

Warning: Invalid argument supplied for foreach() in /home/ownedg00/domains/ownedgear.com/public_html/gallery/featured-photo.php on line 50
No featured photo.

There *is* a featured photo selected, however.

Now, if I put Featured-photo first, it works, but random image gives this error:

Quote:
Fatal error: Cannot redeclare editfield() (previously declared in /home/ownedg00/domains/ownedgear.com/public_html/gallery/util.php:27) in /home/ownedg00/domains/ownedgear.com/public_html/gallery/util.php on line 27

Now, I saw in a couple of threads that these modules wouldn't work on the same page as the gallery itself, so I set them for every page *but* the gallery page. This error is happening on the main page, tho.

At the moment, you can look at http://www.ownedgear.com to see an example, but I can't guarantee I'm going to leave it up like that. It's really ugly, and confuses my grandmother. lol

Any ideas?

If it's a case of the two just not being useable on the same page, that's cool, I can pick one, but it'd be nice to have both.

Thanks!

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Sat, 2004-12-11 02:28

Two issues - the first is that Gallery doesn't provide a Featured Photo page, but it looks like the page is missing a variable - I highly doubt that "featured-photo.cache" is in your server's root directory.

The second is that you're not including the random block correctly (or the featured photo, which from all appearances is probably based on the random block). The block must be included via include('http:/...'), not via include('/dir/dir2/...')

 
rudyb

Joined: 2004-12-11
Posts: 36
Posted: Sat, 2004-12-11 03:10

Yeah, featured-photo.cache is in my albums folder.

Now, as for including it incorrectly, since I'm just a Mambo-kiddie, and really don't know what I'm doing, do you know if there's a way to change the way that Mambo includes the random block (and, I'm assuming, the featured photo module)?

Also, would the incorrectly-included files be the reason that the first one on the page always works, then manages to break the second one?

Thanks for the response, btw. ;)

 
rudyb

Joined: 2004-12-11
Posts: 36
Posted: Sat, 2004-12-11 05:36

I guess a better question would be this:

This seems like it would be related to the fact that you can't have the random block on the same page as the rest of the gallery, so, since Featured Photo is just a hack of the random block;

Can you have two instances of the random block running on a page at once?

If so, do you have to change anything?

thanks

 
signe
signe's picture

Joined: 2003-07-27
Posts: 2322
Posted: Sat, 2004-12-11 06:20

You can have two of them, if they're included correctly.

You can even have the random block on the same page as Gallery... if it's included correcty.

 
rudyb

Joined: 2004-12-11
Posts: 36
Posted: Sun, 2004-12-12 01:41

Yup. Got it sorted. ;)

Thanks much! :)

 
rudyb

Joined: 2004-12-11
Posts: 36
Posted: Sun, 2004-12-12 02:33

Ah ha! Now a new issue.

When I hardcoded the gallery url in, I used http://www.ownedgear.com/gallery (which is where my gallery is loaded). This lets both of the modules work, but when clicking them, it takes the user to the standalone gallery page.

I've tried using
define ('GALLERY_URL',"http://www.ownedgear.com/index.php?option=com_gallery&Itemid=41");, but it doesn't work. Gives this error:

Parse error: parse error, unexpected T_STRING in http://www.ownedgear.com/index.php?option=com_gallery&Itemid=41/block-random.php on line 1