Member
Member
Laurent   2011-05-26, 13:03
#1

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

Administrator
Administrator
acrylian   2011-05-26, 13:36
#2
  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

Member
Member
Laurent   2011-05-26, 14:07
#3

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

Administrator
Administrator
acrylian   2011-05-26, 14:35
#4

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.

Member
Member
Laurent   2011-05-26, 16:18
#5

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.

Administrator
Administrator
acrylian   2011-05-26, 16:52
#6

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 ;-)

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.