ZenphotoCMS Forum
Plugin question - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Plugin question (/thread-8658.html)



Plugin question - Laurent - 2011-05-26

Hi
Is there a way to activate a plugin only for news.php and pages.php.

I saw a $plugin_is_filter = 5; What the 5 mean ?
I don't find documentation about that.

Thanks
Laurent




Plugin question - acrylian - 2011-05-26

  1. No, no option or such for this as generally all plugin functions are available everywhere. So general Zenpage functions are also usable outside news.php and pages.php in case your theme uses a different structure for example. Why do you need that specifially?

  2. This number determines the filter load priority:
    http://www.zenphoto.org/news/zenphoto-plugin-architecture#template-plugins




Plugin question - Laurent - 2011-05-26

Thanks you answer.

I have a made a little script for my news and pages files.
It's a Back to top link. It's usefull in a long thread in a blog.

My script works and i'll to give this script for the Zenphoto community. But at this time it's not a plugin, it's a hack.
So i made the plugin, but the Back To Top Link it's printed on all the site.

I will think on another solution.

edit : i try this approach :

if ($_zp_gallery_page == 'pages.php') {
my script
}
but it's doesn't seem to work




Plugin question - acrylian - 2011-05-26

Would be adding an anchor and a link to it manually be much easier? A plugin for this is nearly little "overload" for this.

If you check for $_zp_gallery_page make sure it is set to global within a function.




Plugin question - Laurent - 2011-05-26

Of course it's a little "overload" but i know some photographer who don't know HTML or PHP (and they don't want to know because it's no their job) but they want more functionality like this one.
So i think it's a good idea to simplify the integration of new function by making a plugin. In this way, they have just to activate or not, the plugin they want without editing the code.

The plugin will be ready this evening but i'll drop the zp_register_filter function. In this way they only have a line to cut and paste in the file.




Plugin question - acrylian - 2011-05-26

Ok, was just asking. You should be able to test for the theme page, there are also Zenpage funcitons to check that.

Quote:i know some photographer who don't know HTML or PHP (and they don't want to know because it's no their job) but they want more functionality like this one.
Well, sometimes people should get a specialist if they need something special ;-)