newbie in zenphoto

Hello. I just installed a ZenPhoto, and I have a couple of questions:
1. Galleries do not display video files. What can I check?
2. How to make a code block displayed only to specific users in a template?
3. Is there an api allowing:
  3.1 verify tag existence
  3.2 Add 1 new tag to the database
  3.3 Assign a tag to a specific image

Tags:

Comments

  • acrylian Administrator, Developer
    edited December 2019
    1. Your error logs. THe Zenphoto debuglog and the PHP server error log.
    2. You will have to check the current user. The current user object is available in the global $_zp_current_admin_obj. See the user guide on http://www.zenphoto.org/news/category/user-guide/ and also review the functions documentation on https://docs.zenphoto.org/. Also review the theming tutorial if you haven't already.
    3. See https://docs.zenphoto.org/ as well and search for "tags". Otherwise you can add them via the backend.
  • Hm...On the first question:
    I do not see anything in the logs, except for the "error reading the setup folder" (it is blocked by me).
    Video files are also missing in the "zp.images" table. Maybe somewhere there are settings with a filter for file extension?

  • acrylian Administrator, Developer
    edited December 2019

    The setup folder needs occasionally to be used and Zenphoto does protect the files after it ran successfully. You can manually protect them or renable them. So it should not really be blocked. Please see the user guide for recommended permissions.

    Yes, videos require the class video plugin to be enabled to have basic HTML5 support in capabale browsers.. Only mp4 and mp3 files will work as they are the base. Additionally you can enable player plugin like the included jPlayer.

    Please take some time to look through everything and which plugins are available. A lot is explained on the options and the backend itself. Note that some plugins do not work out of the box with every theme as they require theme modification.

  • require the class video plugin

    Thank you! I thought it was the functionality of the base system.

  • acrylian Administrator, Developer
    edited December 2019

    You can see the included plugins within /zp-core/zp-extensions as sort of optional functionality of the base system. Some are even tied into the actual core like the Zenpage CMS plugin.

  • I'm sorry to bother you again.
    I wanted to understand how the zp_loggedin() function works.
    According to the description, it should return 0 or 1, but I write code:

    <?php echo zp_loggedin();?> 
    <?php echo zp_loggedin(ADMIN_RIGHTS);?> 
    <?php echo $_zp_loggedin;?>
    

    into zenphoto\themes\basic\image.php and get:

    1996419053 
    1073741824
    1996419053
    

    What do these numbers mean?

  • acrylian Administrator, Developer
    edited December 2019

    zp_loggedin() is to be used boolean and not to be echoed. You use if like if(zp_loggedin()) { … }. It does return a "true value" which perhaps a little unclear means if it returns a valid value resulting in true in an if/else check. It returns false otherwise. In PHP null or an empty value also means false in that context and any proper value results in true.

    This would be the general check if the current visitor is a loggedin user. The rights constants are optional if you want to check for somenthing specific.

    If you need to check if an actual object (image) is visible for a specific user there are also various class methods like isMyItem() or isProtected(). There is a basic introduction to the object model on the user guide.

Sign In or Register to comment.