I am new to Zenphoto, so plz forgive me if I ask the wrong question.
I have installed Zenphoto (versionZenphoto Setup v1.4.1.6[8326]), and using the Default theme.
I created albums and put pics in.
Now on the page for 1 specific photo I want to add some code that will start playing an MP3.
As I understood I should be able to use codeblocks (codeblock1) for that.
But I am not grasping how it works.
Do I have to put HTML code, or PHP code?
Do I have turn using code blocks on somewhere?
Is there maybe somewhere a step by step instruction on how to this?
Regards,
Jan
Comments
Regardless of that, you can enter basically enter any kind of code within a code block, so html or PHP or even javascript.
If code blocks work and where they are output depends on how the theme you are using is setup. If your theme does not support code blocks at all or does use them in not fitting places you need to modify the theme used.
Some of the standard themes do have at least partly support (you can see that in the source of the theme),
Info on theming on the tutorial of the same name, code blocks are documented on the functions documentation:
http://www.zenphoto.org/news/category/theming-templating
Will upgrade and then check and try your suggestions,
As follow up I have done the following:
- downloaded the latest version (1.4.2.1)
- checked if I knew my admin user and password
- installed locally on my computer (index.php, themes and core-zp)
- executed the setup
- choose a theme that supports the execution of codeblocks (in my case the garland theme)
- went to zenphoto/themes/garland
- found image.php
- searched for codeblock and found "<?php printCodeblock(2); ?>"
- then went to the admin panels, and went to the image I wanted extra code to be executed
- added the code I wanted to be executed under the tab codeblock 2 (under show more fields)
- tried it, and it worked. So now I understand how it works.
- now I choose in the admin panels again the theme that I want for the site (in my case the theme default)
- went to zenphoto/themes/default
- copied image.php to image.org
- copied the code I found (<?php printCodeblock(2); ?>) into image.php
- tried it, and it worked. The exact place in the image.php where you put the code has to be somewhere where the image is being displayed.
- checked if I knew my admin user and password on the server of my provider
- then copied the index.php, themes and core-zp folder to server of my provider
- ran the setup
- then copied the zenphoto/themes/default/image.php and image.org from my local computer to the server of my provider
- tried it and it worked…..
This all, because on my photo site there is picture of my father (who died some years ago) and I wanted to play an MP3 file when showing this image.
Thanks for the software and the support-forum.
Regard
Jan Wessel
Instead make a new folder with the files with a different name. Then when you update Zenphoto your changes will not be touched. You can also at that point compare your theme with the current version of the default theme to see what changes have happened that you might want to apply to your version.
Couple of hours after I finished, I realized this.
So I made a copy of the themes/default folder, renamed it and uploaded it.
Hmmm, didn't show the new name I gave in the list of themes to choose.
Then I noticed the "duplicate" button.
Used that, and now activated the duplicated theme.
Restored the original image.php in the theme/default folder.
I am blushing, cause as a configuration manager I should have realized from the beginning... :-)
Thanks for pointing this out.
Regards,
Jan
Wete
That was indeed my next task, search where this information is kept.
Thanks for pointing it out.
@acrylian
I installed Komodo Edit, but I'll keep your suggestion in mind.
Further, I like to do my playing around with the code and settings locally.
Then when I am satisfied I upload to the server.
But indeed I must check ownership and such very cautiously.
http://www.activestate.com/komodo-edit
It' big brother is the Komodo IDE 7.
I will see how I like it, and then maybe switch to something else.