User Tools

Site Tools


Sidebar


Site Information


Interactive Maps

Sidebar

wiki:misc:zen

ZENphoto

Dicking around with ZEN**photo**, thinking of using it on another domain. I think I want to give people the ability to download Photoshop PDF's (I have nearly 900 images, about a third of which are PDF's).

Photo/File Download

In order to make it so people can download a PDF (or other non-image file) I upload, there's some hacking.

  • Enable class-AnyFile plugin.
  • Enable class-textobject

In each Theme directory (yes, you'll have to do this with any/all themes you plan to use) edit the image.php file.Make the following change:

if (isImagePhoto()) {
   $tburl = getFullImageURL();
} else {
   // LTB change!
   // $tburl = NULL;
   $tburl = getFullImageURL();
}

Source recommending the above change:
https://forum.zenphoto.org/discussion/527427/class-anyfile-doesnt-allow-downloading-the-file

To add a file for download, FTP the file to the album directory and a .png image (NOTE: seems to require a .png!) with the same name to act as the image representation of the file. For example:

  • my.blend
  • my.png
  • your.psd
  • your.png

File Size

There doesn't seem to be a setting to print image dimensions. I guess I'm the first person in 15 years that wants to display the dimensions? Anyway, on line 106 of image.php I made the following modification:

<div id="imagedesc"><?php $imgSz = getSizeFullImage(); echo $imgSz[0] . ' x ' . $imgSz[1] . ' px. <br />'; printImageDesc(); ?></div>

I haven't found a function that returns the files size, yet. I'll get back to ya.

PHP Version

NOTE: Zenphoto creates/modifies the .htaccess file. So if you upgrade, or maybe even make changes in you configuration, your version of PHP may change without warning!

Add the following two lines to the top of the .htaccess file that Zenphoto creates to force PHP version 7.2:

AddHandler fcgid-script .php 
FCGIWrapper "/dh/cgi-system/php72.cgi" .php

Source for above change:
https://help.dreamhost.com/hc/en-us/articles/214895317

You can change directory in bash to /dh/cgi-system/ and do an ls -l to see what PHP versions are available. At the time of this writing, you can only go to 7.2 using Dreamhost's fancy domain manager interface, but you can force your site go as high as 7.3 using the above method. I.E.:

AddHandler fcgid-script .php 
FCGIWrapper "/dh/cgi-system/php73.cgi" .php
wiki/misc/zen.txt · Last modified: 2019/04/03 04:24 by terrill