Pages (2): 1 2   
Member
Member
oceanagency   26-02-2008, 16:35
#1

Hi,

I have ZenPhoto and WordPress installed. They work a dream

However, I'm running into problems displaying a random thumbnail on my sidebar in WordPress?

I've looked at and tried Hacks and Extensions found in this forum and site, but am none the wiser. Up til 2am on a work-night was not good

Can someone please hold my hand and help me along this treacherous path?

Many thanks.

Member
Member
invision   28-02-2008, 10:46
#2

Hate to bump, but any takers?

I'm really racking my brain on this one.

ZenPhoto is fully installed and working a dream, but I've had no such luck with the Random Thumbnail.

Thank you.

P.S Lost my password for 'invision', then found it again :d

Administrator
Administrator
acrylian   28-02-2008, 10:59
#3

Please take a look here: http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin

Member
Member
invision   28-02-2008, 11:09
#4

Thanks for the reply.

I've looked there and seen these two parts

`define('ZENFOLDER', 'zp-core');

define('WEBPATH', 'zenphoto');

require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php"); and $randomImage = getRandomImages();

$randomImageURL = getURL($randomImage);

echo "';`

Have already tried the above code before, but maybe I'm not using it right. Can you give me an example?

So I have my sidebar my WP theme, which is used for my ZP also.

How should I place the random thumbnail generator code into 'sidebar.php'?

Thankyou.

Member
Member
BertSimons   28-02-2008, 12:09
#5

hi the way I integrated my latest, and most popular images in my wp-sidebar (see: http://www.bertsimons.nl/zenphoto/) in this way;

I make a php file called latest.php or in your case randomimage.php with content:

`

Member
Member
sbillard   28-02-2008, 18:56
#6

Zenphoto needs a bit more than your theme file to function, so just doing an include on it will not work. You need the
`define('ZENFOLDER', 'zp-core');

define('WEBPATH', 'zenphoto');

require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");`
code in your sidebar to setup zenphotos environment.

Ov course zenphoto needs to be the folder where zenphoto was installed.

Member
Member
BertSimons   29-02-2008, 13:03
#7

sbillard, those calls I already included.

Other zenphoto functions , like most popular, latest images and taglist get embedded in the wp-sidebar without a problem as you can see on my site. except for when using the printRandomImages(); I get the mysql error

Member
Member
sbillard   29-02-2008, 16:06
#8

I really don't know what could be causing this. The following code is working as we speak on my test site testalbum-2.sbillard.org
`

Test Index

Member
Member
invision   29-02-2008, 16:19
#9

I get the following error when I plug that into my site

`Warning: main(zenphoto/zp-core/template-functions.php) [function.main]: failed to open stream: No such file or directory in /home/michaelsiteuk/public_html/michaels/zenphoto/test.php on line 4

Fatal error: main() [function.require]: Failed opening required 'zenphoto/zp-core/template-functions.php' (include_path='.:/usr/share/pear') in /home/michaelsiteuk/public_html/michaels/zenphoto/test.php on line 4`

But there definitely is a 'template-functions.php' file in the zp-core folder

I placed that code, on its own, into a file :
www.mysite.com/myfolder/zenphoto/test.php

and my WP is at :
www.mysite.com/myfolder/wordpress/

And still it won't work.

Any ideas?

Thank you for your time.

Administrator
Administrator
acrylian   29-02-2008, 17:56
#10

Ok, then the path to your zenphoto folder seen from WP would not be "zenphoto" but "../zenphoto".

Member
Member
sbillard   29-02-2008, 18:18
#11

The folder structure of my site was:

Root folder (..testalbum-2/htdocs): contains the above index.php file
zenphoto folders (..testalbum-2/htdocs/zenphoto) contains all the zenphoto files.

Your test.php should probably be in the michaels folder.

Member
Member
BertSimons   01-03-2008, 00:08
#12

sbillard, with your code the same..the first part to generate the latest images works, the randomimages functions returns the mysql error off which i've placed a screenshot here

http://www.bertsimons.nl/zenphoto/albums/various/publicity-photos/Screenshot.png

Member
Member
sbillard   01-03-2008, 03:20
#13

I am at a loss, there is some kind of conflict in your setup. http://testalbum-2.sbillard.org/ does not get any errors, but then Wordpress is not involved at all.

Member
Member
BertSimons   01-03-2008, 13:08
#14

just did a fresh install of zenphoto 1.1.5 together with a new database and using the default theme.
so no wordpress involved and inserted the latest and random image code in the default theme.

but..same error output from the printRandomImages()....

as seen at http://www.bertsimons.nl/zenphototest/

Administrator
Administrator
acrylian   01-03-2008, 14:20
#15

Strange thing, I can't reproduce that with a clean 1.1.5 install, too. Maybe this is a PHP/MySQL-version problem? Which versions do you run? I have PHP 5.2.3/MySQL 5.0,41.

Member
Member
gregb34   01-03-2008, 14:46
#16

i just try and it works fine.

But testing printRandomImages() i have seen thaht we can specify 'album' in $option.

function printRandomImages($number=5, $class=null, $option='all')

but after i see :

case "album":
$randomImage = getRandomImagesAlbum(); break;

Where we can specify the album name ?

Thanks.

Administrator
Administrator
acrylian   01-03-2008, 15:01
#17

You can't, it simply built to return random images of the whole gallery or the current album (and/or its subalbusm) you are within...

EDIT: Strange thing is that we have a line in the documentation of getRandomImgesAlbum that speaks of an option to get an album folder, but the option itself is not there. Maybe something got lost on the way or was forgotten...

Member
Member
BertSimons   01-03-2008, 15:12
#18

acrylian, I use PHP version 4.3.10/MySQL version 3.23.58

Member
Member
sbillard   01-03-2008, 20:19
#19

GetRandomImagesAlbum() does provide for the option to specify the album from which the images are obtained. If empty it uses $_zp_current_album. However, printRandomImages() does not have such a parameter, so it only uses the current album. It will be relatively easy to extend printRandomImages() to add this parameter and pass it throught to getRandomImagesAlbum().

Member
Member
sbillard   01-03-2008, 20:33
#20

BertSimons:

Does getRandomImages() work fopr you within Zenphoto? You can setup stopdesign to use it through the options.

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.