You're most welcome Daxeno.
Can either of you explain a bit more in detail what I need to do to fix the mysql error that daxeno was getting
"Error: Table 'akclimber.images' doesn't exist"
I'm getting the same error but don't quite understand how to remedy it.
Also, should my table prefixes be zen? Currently they are zp
Thanks for your help and for creating this function!
climberusa-
first off, i can't take credit for the scripts. they were all obtained mostly from this thread.
daxeno rebuilt his db. by default the db uses a prefix of zen_ (i think). I usually set up a separate db, but some people don't have that luxury.
I believe you have to use the prefix function to place the prefix before every query in the sql statement. you could hardcode it to i suppose, but that might lead to problems if you ever share your scripts out to others.
anybody from the dev team want to comment? am i close, or way off?
climberusa, all you need to do is remove the prefix zp_. But doing this, you need to reset your database.
Go to config.php, and edit it, look for this $conf['mysqlprefix'] = "zp", then just delete the said prefix. it will then look like this $conf['mysql_prefix'] = "". Save it afterwards.
Now to reset you DB, delete your database from your phpmyadmin. place the setup.php back to the folder zen, then reinstall it.
Thanks! I got it working. Would it be easy to have three random, but different photo's? I tried the obviou copy/paste but it just gives me the same three images each time. This is very cool.
My wordpress and Zenphoto use the same database but different prefix, so I can easily make my plugin, and insert the following code into sidebar.php winthin folder of /wp-content/themes/default/.
there are 3 parameters you should pay attention to.
1.zen_
2.http://lidan.info/photo/
3._100_cw85_ch85.jpg
demo: http://lidan.info (see leftbar)
Good luck.
up1m, thanks for your code. I'm also trying to get a random image from my zenphoto albums to appear in my sidebar, but my wordpress and zenphoto installs DON'T use the same db.
Is this possible? Most of the posts above offer instructions of how to align wordpress to the zenphoto code, changing dbs en route, but not vice versa i.e. switching dbs from within the wordpress file structure.
I've tried to require_once(--hostdetails--/zen/functions.php) but this causes a fatal error message.
Hey - I gave up with going the hard way round, and installed my tables in the same db. Now it works great. Check out The Daily Pixel at http://www.strangerpixel.com. Thanks again up1m!
As an aside, you can also use Zenshow to integrate random image functionality into wordpress, and is available on the wiki at:
http://www.zenphoto.org/trac/wiki/ZenphotoPlugins
It works fine on my wordpress install, which is 2.1 currently.
I see this thread is quite old, but I managed to get the random.php script working.
The problem is, I can not call the script from within another page using either javascript or img src , but if you click on the box empty box that shows up. It will display the image. I think it is almost working, can someone please tell me what I am doing wrong.
I have tried calling the random.php like this:
img src=""http://www.foolishcat.com/gallery/zen/random.php"">
and like this:
I would really like to use the img src - I think the problem is the last part of the script with the url encode. - here is the random.php script I am using:
This does not seem to work. Can anyone post an update on this mod??... Pleeeaaaseee!
I am using version 1.0.8.2, and it works wonderfully (www.zucye.net) and I would love to display a random picture (or pictures) of ONLY one category in my main blog page (I am NOT using word press, but sNews)
I've installed the ZenShow plugin off the Wiki, but it's not working... anyone else have trouble getting it to display properly? I keep getting errors which say the ZenShow functions are not defined, and when I edit the ZenShow config, it seems buggy and my changes don't stick...
Might be a problem with using Wordpress 2.2...
Well, it looks like others are able to use ZenShow with WP 2.2, so I'm not sure where I went wrong. thinkdreams, how do you call the plugin in your Wordpress pages? I've tried simply issuing a call to randomPhotos(); but I get a "function undefined" fatal error.
The plugin seemed to install okay, but it's as if it isn't making it's methods available to my WP installation. Is there any additional manual config needed?
I'm calling the zenshow function with ``
You are correct in that it works on my Zenphoto and Wordpress installation just fine. Running SVN Zenphoto and WP 2.2.1. http://www.bushwoodworking.com
I'll be happy to help you work through it if you need help. Zenshow has always been fairly stable for me.
thanks thinkdreams for put how calling the zenshow function
You're welcome. That function hasn't had a lot of documentation, so I've tried to keep it alive as long as I can.
Using ZenShow's randomPhotos() function works great for displaying a random thumbnail on my WordPress (v2.3.1) blog... The problem, though, is that no image is showing, only the alt text. I suspect it has something to do with weirdness with the .htaccess file in either (both?) my WP or ZenPhoto (v1.1.2) installations.
Setup info: I'm doing this in a local dev environment (MAMP, Mac OS X 10.4.10), where the domain is localhost:8888 for both WP and ZenPhoto.
One thing I notice under the WP options for ZenShow is that Table Prefix is always "zen_", which I cannot seem to change. In my case, my zenphoto tables are in their own db, and don't have a prefix --afaik, as my SQL knowledge is rather limited. Not sure if this would prevent the image from displaying.
Thanks in advance!