What are "my php pages"

What are "my php pages"? as mentioned here: http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin

Do I add this code to the template-functions.php document? or am I looking for another php document to add it too?

zenphoto as a ‘plug-in’

USE ZENPHOTO TEMPLATE FUNCTIONS FROM OUTSIDE OF THE ZENPHOTO FOLDERS

You can use zenphoto features in your main web pages by including template-functions.php in your php pages. To do this successfully when the page is not in the zenphoto folders include the following PHP code in you page (this assumes zenphoto is installed in a folder named zenphoto):

define('ZENFOLDER', 'zp-core');
define('WEBPATH', 'zenphoto');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");

You will now be able to use zenphoto functions on your page to, for instance, place an random image from your album on your index page. Code for this is:

$randomImage = getRandomImages();
$randomImageURL = getURL($randomImage);
echo "
<img src='". $randomImage->getSizedImage(getOption('image_size')) . "'
alt=\"random image\"\n" . $randomImage->getTitle() . '" />
';

Comments

  • The `require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");` statement includes the zenphoto template functions in your page. As to your question on `What are "my php pages"` if you need to ask this question then this process is probably beyond your knowledge.
  • Re:if you need to ask this question then this process is probably beyond your knowledge.

    Sheeit, I know that. For me it's like getting advise from a doctor via text messages on how to amputate my leg. Thing is, I have one leg left and I was fixin on learning the hard way.
  • Its so you can integrate zenphoto into an existing site...i think lol
Sign In or Register to comment.