Zenshow

I've modified Zenshow 1.4 to work with the new changes in 1.1.2. If anyone is interested, I'll be putting it up on Trac in the plugins section. This is the plugin that displays random images from Zenphoto in Wordpress.

Comments

  • Is there any documentation available for this plugin? I can't find any instructions after I've activated the plugin.
  • I've set the thumbnail size to 100x100 pixels at both my ZenPhoto site and in the ZenShow plugin at my WP site, but for some odd reason they're appearing as 372x149 on the WP site.

    WP running 2.3.1 at http://sairuh.org using Thinkdreams modified ZenShow plugin
    ZP running 1.1.2 at http://zenphoto.iwaruna.com

    Any tips on how to resolve this?
  • So libelle has fixed several bugs in ZenShow, namely:

    1. Proper UI refreshing when updating plugin choices.
    2. Replacing the db password in plain text (ack!) with asterisks.
    3. Thumbnail size values adhering to what the user enters (my complaint above).

    Questions: Is there a way to attach the revised plugin here for others to test and use? How would one submit this plugin to be included on the ZP plugin wiki page?
  • You can just edit the page with a description and upload the file.
  • Yeah, some documentation would be useful. I downloaded thinkdreams' modification and installed it. But I can't figure out how to use it. Any tips? Thanks!
  • I use ZenShow to display a single, random thumbnail image. To do this, just pop in the following code into the desired WordPress theme template file, such as sidebar.php:

    `<?php RMCZS::randomPhotos(1); ?>`

    If there are further uses/customization for ZenShow, I'd also be curious to hear 'em. :-)
  • Hi,
    I just installed ZenShow (well, tried to). However, I am not seeing anything, options or sidebar block, after activating the plugin. Is there supposed to be some options page? Or am I supposed to add something to the template code?

    I downloaded the zenshow.php from the ZP wiki plugin page. Is that the latest one with the changes sairuh mentioned?

    ~Alltruist
  • alltruist, no, the updated version that libelle worked on has not yet been uploaded. Maybe in the next week or so (busy holidays here!).

    To use it, you need to modify template code as noted above. The options for the plugin are under Options > RMS:Zen Show in the WordPress web admin UI.
  • Thanks! I look forward to the release.
    A sidebar widget is the final impediment keeping me from doing away with Gallery2 once and for all. :]
  • I've posted v1.4.1 with libelle's changes to the ZenphotoPlugins wiki page. It's called zenshow.2.php, so you'll need to rename it zenshow.php.
  • Okay, after skimming through the plugin code, it looks like there are three functions that ZenShow provide, which you can add to your WordPress template file, such as sidebar.php.

    `<?php RMCZS::randomPhotos(N); ?>` inserts N random thumbnail(s). By default N is 4.

    `<?php RMCZS::showPhoto() ?>` inserts a thumbnail of the last photo added to ZenPhoto.

    `<?php RMCZS::showAlbum(num_album, N) ?>` inserts N random thumbnails from the ZenPhoto album whose ID is specified by num_album. Again, N is 4 by default.

    Please let me know if I've misinterpreted this usage.
  • It works! Thanks! Great work!
  • Uh..sorry...I did not scroll down far enough on my page.

    The thumbnails from ZP are displaying. However, the database configuration for ZenShow is somehow messing up the queries for the sidebar widget for Wordpress. I have my ZP and my WP in two different databases. So for my other widgets, I am getting database errors like this:

    WordPress database error: [Table 'powervo_gallery.wp_posts' doesn't exist]
    SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year FROM wp_posts WHERE post_date < '2007-11-01' AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1

    Somehow, with <?php RMCZS::randomPhotos(N); ?> in my sidebar messes up the mySQL queries for the rest of the widgets.

    Please help.
  • Sorry about the triple-post but I think I may see why the database connection to the ZP database is conflicting with the subsequent WP connections.

    in RMCZS::connect(), the connection is made with

    `

    $ZenDB = new wpdb($this->zen_user, $this->zen_pw, $this->zen_db, $this->zen_host);

    `

    and RMCZS::disconnect() tries to close the connection with

    `

    $ZenDB = NULL;

    `

    May it be possible that even though $ZenDB is now NULL, the connection made with wpdb() is actually still open?

    If this is the case, how can it be fixed? I am not too familiar with the Wordpress methods.
  • Hm. I didn't touch that part of the code, but it doesn't look like that's the right thing to be doing.

    I'll try to take a look at the WP API, and see if I can fix that.
  • There needs to be a call somewhere on `mysql_close($link);` to close a database connection. I doubt that setting the `$ZenDB` variable to `NULL` does that.
  • hey I'm just wondering.....

    If this can put photos into a wordpress sidebar, could it put the Album Titles there also?

    Its just that I'm looking for a way of getting a menu of the ZenPhoto Album Titles into a wordpress sidebar.... can it be done? if so some pointers might keep me busy for a while :)

    cheers

    or have i misread something?
  • I have been wondering...Will it be possible to utilize the RSS feed to display the sidebar thumbs rather than take them out using MySQL? I know that this is less flexible but at least we'll be able to retrieve a certain number of the latest additions to the gallery.
  • acrylian Administrator, Developer
    Probably, you can use something like this script: http://www.feedforall.com/free-php-script.htm
    But the newsfeed fetches the info from MySQL, too (from where else?)
  • Thanks for the script.

    The reason why I am thinking about using the feed is because it's already there. You wouldnt have to make another MySQL connection. The second connection is what is causing problems w/ ZenShow as discussed above ^
  • Alltruist, have you tried ZenPressed? (v0.8 available at http://n00bism.net/dokuwiki/wordpress/zenpressed/) It also can add a random image into a WP blog. I just downloaded it, so haven't played much with it. Although I noticed that it seems to suffer from the first two issues I had mentioned in my 2007-11-19 comment.

    Just curious if ZenPressed also exhibits the db error you had seen with ZenShow...
  • Yes, in zenpressed we can see code ( for case different databases for ZP a WP ):

    $db = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );

    if I test this line in zenhshow.php ( just before $ZenDB = NULL; )
    ... it works fine :-) www.biglnet.com
Sign In or Register to comment.