Hi!
I have a site, e.g. www.michaelsite.com/michaelspages/wordpress which displays a random thumbnail and does so rather well
However, I also want to display it in my zenphoto directory, so if I type in:
www.michaelsite.com/michaelspages/zenphoto/gallery1 the random photo will appear, however, this does not work. When I right-click the image to see the src, it has an extra 'zenphoto' in the address
How do I get around this issue?
Is it to do with my 'template-functions.php' file?
Or is there a bit of PHP I can do to eliminate any 'extra' zenphotos from the image src address.
Basically my use of the printRandomImages function is in a small php file held in www.michaelsite.com/michaelspages which then does the function and displays the pic - is this causing the issue?
Many thanks for any help.
Am happy to supply a link, if it could be removed at a later stage.
Comments
Did you use the "zenphoto as a plugin" solution from our extenstions page?
I guess it would be easier if you post a link, we of course can remove it later if you wish.
OK.
As you can see bottom left:
<link removed> it works great
However as you can see bottom left:
<link removed> it doesn't work
The file I'm using(that stores the printRandomImages() function) is at: <link removed>
The code for 'test.php' is:
`<?php <br />
define('ZENFOLDER', 'zp-core');
if (stristr($_SERVER['REQUEST_URI'], 'zenphoto') == true ) {
define('WEBPATH', '../flannigan');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
} else {
define('WEBPATH', '../zenphoto');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
}
?>
<?php<br />
echo '
echo '
';
printRandomImages(1);
echo '
?>`
Any help at all, you can give, would be brilliant.
Thank you.
Did you try exactly the solution "zenphoto as a plugin" on our extensions page: http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin
I have to admit I never tried that personally...(I just built two themes....;-))
I'm now using:
`
<?php <br />
define('ZENFOLDER', 'zp-core');
define('WEBPATH', '../zenphoto');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
?>
<?php<br />
echo '
echo '
';
printRandomImages(1);
echo '
?>`
But still the same error
Any ideas?
I used that but still got the same error.
Well, I fear I am not gaining any glory from this today...I guess we better wait until one of my fellow devs who actually used it himself appears...
`Fatal error: Call to undefined function: printrandomimages() in on line 10`
With the code
`<?php <br />
define('ZENFOLDER', 'zp-core');
define('WEBPATH', '');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
?>
<?php<br />
echo '
echo '
';
printRandomImages(1);
echo '
?>`
Hmm, I'm tearing my hair out here.
I see the Stopdesign code(it also doesn't work when I take it down to to the zenphoto directory). I just don't know why it can display a random image on one part, but not the other
Is it because my 'test.php' is in the WordPress folder?
Would it make more sense to have ZenPhoto in the 'wordpress' directory, so it'd be wordpress/zenphoto/
`define('WEBPATH', '/flannigan/zenphoto');`
Tried that, but got a very ugly error:
`Warning: main(/flannigan/zenphoto/zp-core/template-functions.php) [function.main]: failed to open stream: Operation not permitted in /home/mysiteuk/public_html/flannigan/wordpress/test.php on line 4`
You have all been very patient, and hopefully this resolves the issue.
I've now got it so 'zenphoto' is below my 'wordpress', but it's still adding the 'zenphoto/eric-flannigan' part TWICE to my URL, when in zenphoto
E.g visit: <link removed> - look at the random pic, bottom left and look at the img src for it.
I'm losing the will to live. Someone please help me out
`<?php <br />
define('ZENFOLDER', 'zp-core');
define('WEBPATH', 'zenphoto');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
?>
<?php<br />
echo '
echo '
';
printRandomImages(1);
echo '
?>`
I use the same 'header.php' for my WP as I do for ZP.
Would this cause a problem?
Runs off to play Boston - More than a Feeling so loud, it'll become popular again
Moderator:
Please remove the links to my temp site. Thanks!
Thank you once again for all your input.
In the end, I made two 'test.php' files and tweaked one of them.
Thanks, you're a star!