How to use textObject (for HTML5 panorama)

Hey

I spent a lot of time reading the docs and working on a custom ZenPhoto theme, and now I have everything working except the last part - HTML5 panoramas. I found shreds of advice that using textObject is the way to go, but I haven't found any more concrete advice or examples. Furthermore, the documentation is poor. For example this page http://www.zenphoto.org/documentation/plugins/TextObject.html is a badly formatted copy of this page http://www.zenphoto.org/documentation/plugins/media/_zp-extensions---class-textobject.php.html and both pages reference code that is not there: "the first three lines of code below". I learn best by example, and I have no examples to go by.

I understand that using textObject I should be able to upload foo.html which contains the actual panorama code (Pano2VR-generated for instance) and foo.jpg should be picked up by ZenPhoto and used as the thumbnail.

Please advise on the most simple way to have the above behaviour using textObject. Ideally if you could point to a theme that uses that without any exotic additions to serve as an example, that would be ideal.

Comments

  • acrylian Administrator, Developer
    Our documentation is generated from the code comments as we have no resources to maintain one manually.

    The two pages are not the same, one is for the class and the other for the actual file itself. That they are similar is because the file is the class :-)

    It is really simple. You use put your code into a .txt file and upload it like an image to an album. Then the content is displayed within an iFrame. Live example with Youtube and other services' videos (using the embed code provided in this case):
    http://www.zenphoto.org/screenshots/screencasts/installazione-zenphoto-by-pJ-hooker.txt.html

    If you need a thumb for the gallery follow the video thumb way.
  • I wanted to follow-up that the page I linked to above still references code that is not there and still is badly formatted which has a negative impact on comprehensibility.

    What code do I put in a text file? Show an example please. Document this somewhere. Maybe it is simple, once you know the way.
  • acrylian Administrator, Developer
    The documentation above is there and it is coding documentation (that's why it is called the function documenation if reached via the user guide). The first is about the class belonging to the plugin and the other one is the documentation of the plugin's functions itself. Similar because it is basically the same. That our function generator of course does not "understand".

    It is not the usage documentation anyway

    As I said about already, create a .txt file, put the html code you want to use within it and upload it like an image, video, audio file to an album. That's it.

    There is also a short doc for youtube videos here:
    http://www.zenphoto.org/news/using-external-sources#using-videos-from-youtube-or-other-portals
    It's the same for all kinds of usages anyway.

    That is the first part of the pages above basically:
    Text type files can be displayed in place of an image in themes supports files of the following types: .txt .htm .html The contents of these files are "dumpped" into a SPAN sized to a 24x36 ratioed box based on your theme "image size" option. This has a class of "textobject" so it can be styled.

  • It's easier to read when you look at the comment in the PHP file, but would be nice if you could get the online docs readable too. For example some formatting problems are caused by a single extra space at the beginning of the comment lines.
  • acrylian Administrator, Developer
    For the actual usage you don't need the doc above. It is that simple.

    Yes, looking at the files directly is the other way. We cannot much change what the tool that generates the doc from the PHP file comments generates how. The only wrong above I see is the somehow misaligned sidebar on the right and I notice it for the first time actually. So thanks for pointing that out as we cannot test all pages generated.

    Since that is the 1.4.5.x doc we will create a 1.4.6 one some time soon and try to change things there.
  • I created a text file, lets call it panorama1.txt, and put the text "foo" inside it. Then when I use <?php printBareImageTitle(); ?> in my image-pano.php I get it to return "foo", so I'm using that with success, though I don't know if that is the correct way of doing it :) Is there a more correct function to return the bare contents of the file without any extra markup?

    As for the docs, there are numerous issues, for example:
    * zp-core/zp-extensions/class-textobject/class-textobject_core.php Line 21 ends up not being part of point 2 of the list in the docs though it should be. Maybe if you add another space before "as it is the indicator" in the php file then your doc generation program will treat it like its part of the second point (that's what MediaWiki would do anyway, maybe your soft follows the same way).
    * /var/www/localhost/htdocs/zp/zp-core/zp-extensions/class-textobject.php Here lists are explicitly created using HTML so no issues with that, but there are visible closing tags </var> because two of the <var> tags were closed twice each in the php file. "addPlginType" typo, "dumpped" typo. etc
  • acrylian Administrator, Developer
    Here a direct link to one of the youtube screencasts files:
    http://www.zenphoto.org/albums/screenshots/screencasts/installazione-zenphoto-by-pJ-hooker.txt

    As you see you just put text or in this case embed html code you get from youtube in it. The plugin hooks into the normal image functions for the sized uncropped that is generally used on image.php. It cannot scale like an image since it is no so the size is the iFrame size basically.
  • Just ran into a new problem :(

    I updated zenphoto to 1.4.6 today.

    I have this (sub)album layout: zp/albums/Panoramas/House of Karin/
    Into that I would put panoramas of every room, and each panorama resides in a folder. I don't want to create further subalbums, just to have a text file for each room treated as an image, so image-pano.php gets called and handles it. Now if I put a text file into zp/albums/Panoramas/House of Karin/ then I see it show up, however if I create folders (which I have to, because each pano stores hundreds of small images in subfolders) then zenphoto completely ignores the <?php while (next_image()): ?> part of album-pano.php!
    I thought maybe I did something wrong, so I copied the exact code from themes/basic/album.php but it behaves the same way!

    How do I get ZP to ignore folders in "zp/albums/Panoramas/House of Karin/" and to show the text files? Is this a 1.4.6 bug?

    class-textobject and class-AnyFile are enabled.

    album-pano.php:
    `

    `
    Maybe related: I can see all folders in that path even though they are not published! I am logged in as the ZP admin but that shouldn't matter should it? I should see them in the ZP admin interface, but not when viewing the gallery.
  • zp/albums/Panoramas/House of Karin/ contains a bunch of folders, one per pano. They all show up in the ZP admin interface in the "Subalbums" tab and they are all NOT published. It also contains text.txt and text.jpg, they show up in the ZP admin inteface in the "Image order" and "Images" tabs and they (well, it, because text.jpg is used as a thumb for text.txt) IS published. However, as described above, I don't see them when viewing the album in Chromium where I am logged into ZP! In Chromium I only see the subalbums in that folder. http://i.imgur.com/oPZuWik.png
    In Konqueror where I am not logged in, I see only that text.txt file with the text.jpg thumbnail. http://i.imgur.com/FPAVcQZ.png

    Is this a bug?
  • acrylian Administrator, Developer
    First, any album within a folder within /albums is considered an album to Zenphoto. That is not avoidable any other way than what you did by unpublishing it. Another way would be to put the images for the panorama somewhere else like the /uploaded folder. But I think this way with unpublished albums might be the most convenient.

    To your problem. Zenphoto has two basic setting for combined album and image pages. Generally the albums (next_album loop) comes first, the images (next_image loop) second. Order can be changed but is against internals because there is a setting to have the first page combined with albums and images or albums first page and images on the others.

    Since loggedin you see the unpublished albums as well, you don't see the images. If you don't have any pagination on your theme page you of course cannot get to page 2 with the images.
  • Thank you for replying!

    Is there any way to have me logged in as master not see unpublished albums when viewing my gallery 'the usual way'? Of course I'd expect to see them in the admin interface (zp-core/admin), but not when just normally viewing.
  • acrylian Administrator, Developer
    Yes, there ia a plugin named "show_not_logged-in" ;-)
  • How awesome is that! :) Thank you!
  • Great! :)
Sign In or Register to comment.