Thanks for your answer. I think i have been unclear again I didn't want zenphoto to integrate with everything but rather let everything fetch data from a zenphoto site. However you answered the question. I think a plugin can be the way to go. I quickly look at zp plugin architecture and came up with the skeleton of an json plugin (with potentially more target formats) - php source: http://gdodinet.free.fr/dl/zen/plugins/json.txt.
It's obviously far from finished but it allowed me to have a pretty clear idea of what must be done. However what troubles me is that so far it must be used in conjunction with a theme page, and this page is not themable per se. It only contains this line: <?= EncoderService::encode() ?>
I have no use of such a plugin for now (although i had a while back), but i just thought i'd let you know what i had done so far.
Your skeleton code is no longer there, so I am not exactly sure what you are doing. But so far as the themeing is concerned, I would think that all you need is a script page to link to that provides the feed. That script could reside anywhere, for instance in the global plugins folder. No need to theme it if all it is doing is providing a feed. It would then be analogous to an RSS feed.
However, the sentence dot had been included in the generated link.
Concerning the feed, you're right. I should have thought about that. I just quickly tested it, and moving the page up the root folder works like a charm after modifying it like below:
Also please note that your code to load the plugins is from the 1.2.6 release. We have extended the plugin architecture to include a folder for Third party plugins which is different from the distributed zenphoto extensions.
Third party plugins reside in a root folder named `PLUGINS`. Zenphoto ones in the `zp-core/zp-extensions` folder. The new way is:
` if (DEBUG_PLUGINS) debugLog('Loading the "theme" plugins.'); foreach (getEnabledPlugins() as $extension=>$loadtype) { if ($loadtype <= 1) { if (DEBUG_PLUGINS) debugLog(' '.$extension.' ('.$loadtype.')'); require_once(getPlugin($extension.'.php')); } $_zp_loaded_plugins[] = $extension; } ` Of course, the debug statements are not required, just a good way debut plugin loading issues.
gdodinet, for "rambling" around this forum is meant..;-) We always appreciate that as we try to make Zenphoto the best gallery CMS to our best possibilities. And sorry for not completely understanding again...;-)
In case you ever want to finish this, it might be an idea to use this plugin to create .txt files within an specified album so you can actually use them as normal albums within a theme maybe.
acrylian, I'm not sure i get the idea. What would be the content of that txt file and how would it be used?
sbillard, indeed i use a 1.2.6 release. I tried 1.2.8 and a trunk version also, but those didn't play nice with my host (free.fr -- this has something to do with not being allowed to change folder permissions, i think), so i got a version tailored for free.fr from zenbien.com.
Well, the content of the text file is directly displayed and executed so that you can use html/js to use Youtube or whatever video embeed code within albums as if they were locally stored. This might work with other external service apis, too, if you find a way to dynamically create text files with that code.
Just a rought thought as I/we have not tested that of course (that youtube etc videos works is actually a nice side effect).
I'm still not sure i understand. Let me try to summarize what i understand. Let's say we have an album A, in A's folder you want to *the plugin create* a text file that will reference external sources. Then this text file will be processed by another plugin at rendering time to create appropriate (themable) markup.
If that's correct i see a way to do that, by using feeds and some kind FeedDecoder (f.i. YoutubeFeedDecoder, DailymotionFeedDecoder, etc. - granted that youtube and dailymotion provide feeds, which i assume they do). However if i understood correctly the text file may not be necessary - unless we want some type of cache (and in this case the txt file should probably not be stored in the album folder).
That said, the goal of the plugin skeleton i provided earlier is the other round : it intends to provide zp feeds to 3d party, and allows to not decide upfront on the target output.
There is no "plugin" in the album folders. All plugins go into the appropriate zenphoto folder. What we have provided is a "text object" plugin. This was really intended as an example to show people how to extend the "image" handling of Zenphoto. However, as it turns out, several people have found it a convenient way to directly place "foreign" HTML into their galleries.
The way things work is that if this plugin is enabled any file with the extension `.txt` will be recognized by zenphoto and processed by this "text object" plugin. In as far as "displaying" this "image" the content of the text file is placed on the image page without modification.
So what people have done is place the appropriate HTML into a text file to, for instance, host the Youtube Feed.
This solution is relatively static. But as I mentioned initially, the "text object" plugin was really intended as an example. Certainly much more could be done.
Indeed, what i meant to write was : "in A's folder you want to [em]let[/em] the plugin create a text file".
Anyway, i get from what you say that i did not misinterpret acrylian's message. I guess i could look into it. Cannot promise anything though, especially since i have those times a "painting bulimia".
Just as an direct example: http://www.zenphoto.org/zp/screenshots/screencasts/zenphoto122admin1.txt.php This is a text object with youtube video embeed code. My rough idea was to have a special plugin create text objects like this to use external images/movies/whatever as if they were locally stored so that you don't have to manually upload .txt files. Of course the problem what to do if these external sources outdate persists.
I see what you mean and i wonder if TextObject is the right tool for this. As sbillard said it may be too static. I have uploaded a quick sketch-y diagram (i hope it is readable enough) here: http://gdodinet.free.fr/dl/zp-thirdparty.png depainting a component plugin that could do the task.
Actually this should rather be a set of plugins: 1. third-party-integration (namely renderer, fetcher and cache), 2. third-party-decoder (that provides ThirdPartyObject and ThirdPartyDecoder interface) and 3. third-party-extensions (concrete decoder implementations that know how to create a ThirdPartyObject from a byte stream fetched somewhere).
However this might need an additional album option page (next to the Images page/tab) to allow the user to specify the third party sources and what decoder to use.
I just looked quickly. The main problem you will have with (streaming) services like youtube etc. is that there are (normally) no real files that Zenphoto can administer (I know you can download youtube videos but it is grey shady of course). The text object plugin as it is now might not be the right solution. Since it "creates a file" for a service without if containing the embeed code my idea was this would be a good start to solve that. So you would not need dozens of fetchers for these streams.
Of course it might vary for specific services depending on what the offer via what api.
EDIT: Btw, if you would like to work on this you may want to consider to take over this ticket: http://www.zenphoto.org/trac/ticket/59 The original owner has gone inactive some time ago.
I put a few things without giving too much thought (see, for instance, the properties of the Resource class). It works with picasa (MediaRssDecoder) and doesn't download any media file. A fetcher just fetches a list of external objects, so a default CurlFetcher is implemented, however it should also be possible to replace the default fetcher if needed (thus the interface).
The plugin backbone should be the ResourceRenderer, which may require to alter the Album class to support the persistence of the external resources descriptions. I hope this clarified what i had in mind.
Ok, so you basically want to make the "streams" from the services to be "albums", instead of having separate entries as "images". Sounds like a way. You can probably make that a child class of the album class (as the textobject class is one of the image class). I would say just do as you think and maybe indeed take over the ticket mentioned. We really don't expect that original owner to return actively.
Actually they could treated as albums, sure, however that's not what i had in mind. What i rather thought is this: associate Album with a list of ExternalResource definitions (mainly url, decoder, and so on), and provide a way to print out ExternalResources as Album components. So in the album page, one would call printAlbumResources() and external resources would automagically appear as album's own resources (images, videos, whatever).
Concerning the ticket i'd rather not take it over. Long ago I used to do open source (mostly worked on mevenide) and i know the level of commitment this requires. As i said before i have no use for such a plugin for now, so i may be working intermittently on it because this is fun, but i also know that the fun passes. So i don't want to give the wrong idea and say i will work on it while i could easily lose interest. Thanks for your understanding.
The idea sounds good, but instead of creating a new `printAlbumResources` function to print those "false albums", you might better consider to hook on the image object model somehow then you could also use the normal image loops.
However, I can understand why you don't take over the ticket. This is all voluntary. I appreciate the note not wanting to give a wrong idea of committment. (Of course you can always sign off on a ticket later, too...:-))
I try to use this aplication, but it doesn't work. I downloaded the file, extracted it in Zenphoto. When I edit the gallery info in General tab in Facebook application (ZenBook), the paramameters are not saved. What is wrong or what I forget?
I have installed Zenphoto in my site recently.Installation information are- * Zenphoto version 1.3.1.2 [5831] (Official Build) * Current gallery theme: Stopdesign Theme * PHP version: 5.2.11 * Graphics support: PHP GD library bundled (2.0.34 compatible) * PHP memory limit: 64M (Note: Your server might allocate less!) * MySQL version: 5.0.91 * Database name: amlansar_photoshar * Table prefix: zp_ * Spam filter: simple * CAPTCHA generator: zenphoto
I tried to Integrate it with facebook as per instructions given. But sorry to say I did not succeed. So what should I do now. Is this extension does not work with new versions of Zenphoto.Please help me out.
I also wanted to integrate Facebook on a page about<link removed by admin>, but it didn't work out for me. Wo can help me out... to implement this in my zenphoto installation..
@Amanda Seth: One post for the same topic is enough. So I deleted the other one and also your link. The site linked did not show any sign of Zenphoto so it was suspicion of SEO spam. (one one Dutch team member can follow the link of your profile if needed). Please proof us wrong though.
All facebook related things are to be found on the extensions section.
Comments
Thanks for your answer. I think i have been unclear again I didn't want zenphoto to integrate with everything but rather let everything fetch data from a zenphoto site. However you answered the question. I think a plugin can be the way to go. I quickly look at zp plugin architecture and came up with the skeleton of an json plugin (with potentially more target formats) - php source: http://gdodinet.free.fr/dl/zen/plugins/json.txt.
Example 1 - album as json: http://gdodinet.free.fr/zen/index.php?album=dessins_2009&p=json
Example 2 - image as json: http://gdodinet.free.fr/zen/index.php?album=dessins_2009&image=lonely_1600.jpg&p=json
It's obviously far from finished but it allowed me to have a pretty clear idea of what must be done. However what troubles me is that so far it must be used in conjunction with a theme page, and this page is not themable per se. It only contains this line: <?= EncoderService::encode() ?>
I have no use of such a plugin for now (although i had a while back), but i just thought i'd let you know what i had done so far.
Anyway thanks for letting me ramble..
Regards
The script is still there: http://gdodinet.free.fr/dl/zen/plugins/json.txt
However, the sentence dot had been included in the generated link.
Concerning the feed, you're right. I should have thought about that. I just quickly tested it, and moving the page up the root folder works like a charm after modifying it like below:
<?php
require_once(dirname(__FILE__).'/zp-core/folder-definitions.php');
require_once(ZENFOLDER . "/template-functions.php");
foreach (getEnabledPlugins() as $extension=>$loadtype) {
$_zp_loaded_plugins[] = $extension;
require_once(SERVERPATH . "/" . ZENFOLDER . '/'.PLUGIN_FOLDER.'/' . $extension);
}
echo EncoderService::encode();
?>
Thanks!
ps- i don't seem to understand how to post code i tried "backticks', [code] and `
` with no apparent success
e.g.
`
<?php
your code......
?>
`
Third party plugins reside in a root folder named `PLUGINS`. Zenphoto ones in the `zp-core/zp-extensions` folder. The new way is:
`
if (DEBUG_PLUGINS) debugLog('Loading the "theme" plugins.');
foreach (getEnabledPlugins() as $extension=>$loadtype) {
if ($loadtype <= 1) {
if (DEBUG_PLUGINS) debugLog(' '.$extension.' ('.$loadtype.')');
require_once(getPlugin($extension.'.php'));
}
$_zp_loaded_plugins[] = $extension;
}
`
Of course, the debug statements are not required, just a good way debut plugin loading issues.
In case you ever want to finish this, it might be an idea to use this plugin to create .txt files within an specified album so you can actually use them as normal albums within a theme maybe.
sbillard, indeed i use a 1.2.6 release. I tried 1.2.8 and a trunk version also, but those didn't play nice with my host (free.fr -- this has something to do with not being allowed to change folder permissions, i think), so i got a version tailored for free.fr from zenbien.com.
Just a rought thought as I/we have not tested that of course (that youtube etc videos works is actually a nice side effect).
I'm still not sure i understand. Let me try to summarize what i understand. Let's say we have an album A, in A's folder you want to *the plugin create* a text file that will reference external sources. Then this text file will be processed by another plugin at rendering time to create appropriate (themable) markup.
If that's correct i see a way to do that, by using feeds and some kind FeedDecoder (f.i. YoutubeFeedDecoder, DailymotionFeedDecoder, etc. - granted that youtube and dailymotion provide feeds, which i assume they do). However if i understood correctly the text file may not be necessary - unless we want some type of cache (and in this case the txt file should probably not be stored in the album folder).
That said, the goal of the plugin skeleton i provided earlier is the other round : it intends to provide zp feeds to 3d party, and allows to not decide upfront on the target output.
I feel like i'm missing something here
Regards
The way things work is that if this plugin is enabled any file with the extension `.txt` will be recognized by zenphoto and processed by this "text object" plugin. In as far as "displaying" this "image" the content of the text file is placed on the image page without modification.
So what people have done is place the appropriate HTML into a text file to, for instance, host the Youtube Feed.
This solution is relatively static. But as I mentioned initially, the "text object" plugin was really intended as an example. Certainly much more could be done.
Indeed, what i meant to write was : "in A's folder you want to [em]let[/em] the plugin create a text file".
Anyway, i get from what you say that i did not misinterpret acrylian's message. I guess i could look into it. Cannot promise anything though, especially since i have those times a "painting bulimia".
This is a text object with youtube video embeed code. My rough idea was to have a special plugin create text objects like this to use external images/movies/whatever as if they were locally stored so that you don't have to manually upload .txt files. Of course the problem what to do if these external sources outdate persists.
I see what you mean and i wonder if TextObject is the right tool for this. As sbillard said it may be too static. I have uploaded a quick sketch-y diagram (i hope it is readable enough) here: http://gdodinet.free.fr/dl/zp-thirdparty.png depainting a component plugin that could do the task.
Actually this should rather be a set of plugins: 1. third-party-integration (namely renderer, fetcher and cache), 2. third-party-decoder (that provides ThirdPartyObject and ThirdPartyDecoder interface) and 3. third-party-extensions (concrete decoder implementations that know how to create a ThirdPartyObject from a byte stream fetched somewhere).
However this might need an additional album option page (next to the Images page/tab) to allow the user to specify the third party sources and what decoder to use.
Does that make sense?
Of course it might vary for specific services depending on what the offer via what api.
EDIT: Btw, if you would like to work on this you may want to consider to take over this ticket: http://www.zenphoto.org/trac/ticket/59
The original owner has gone inactive some time ago.
I just put a quick implementation of the previous diagram (no cache, no pretty formatting, no youtube yet) : http://gdodinet.free.fr/dl/integration.txt
I put a few things without giving too much thought (see, for instance, the properties of the Resource class). It works with picasa (MediaRssDecoder) and doesn't download any media file. A fetcher just fetches a list of external objects, so a default CurlFetcher is implemented, however it should also be possible to replace the default fetcher if needed (thus the interface).
The plugin backbone should be the ResourceRenderer, which may require to alter the Album class to support the persistence of the external resources descriptions. I hope this clarified what i had in mind.
Regards
I would say just do as you think and maybe indeed take over the ticket mentioned. We really don't expect that original owner to return actively.
Actually they could treated as albums, sure, however that's not what i had in mind. What i rather thought is this: associate Album with a list of ExternalResource definitions (mainly url, decoder, and so on), and provide a way to print out ExternalResources as Album components. So in the album page, one would call printAlbumResources() and external resources would automagically appear as album's own resources (images, videos, whatever).
Concerning the ticket i'd rather not take it over. Long ago I used to do open source (mostly worked on mevenide) and i know the level of commitment this requires. As i said before i have no use for such a plugin for now, so i may be working intermittently on it because this is fun, but i also know that the fun passes. So i don't want to give the wrong idea and say i will work on it while i could easily lose interest. Thanks for your understanding.
Regards
However, I can understand why you don't take over the ticket. This is all voluntary. I appreciate the note not wanting to give a wrong idea of committment. (Of course you can always sign off on a ticket later, too...:-))
Thanks in advance.
* Zenphoto version 1.3.1.2 [5831] (Official Build)
* Current gallery theme: Stopdesign Theme
* PHP version: 5.2.11
* Graphics support: PHP GD library bundled (2.0.34 compatible)
* PHP memory limit: 64M (Note: Your server might allocate less!)
* MySQL version: 5.0.91
* Database name: amlansar_photoshar
* Table prefix: zp_
* Spam filter: simple
* CAPTCHA generator: zenphoto
I tried to Integrate it with facebook as per instructions given. But sorry to say I did not succeed. So what should I do now. Is this extension does not work with new versions of Zenphoto.Please help me out.
All facebook related things are to be found on the extensions section.