Plugin question

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

Comments

  • acrylian Administrator, Developer
    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
  • Laurent Member
    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
  • acrylian Administrator, Developer
    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.
  • Laurent Member
    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.
  • acrylian Administrator, Developer
    Ok, was just asking. You should be able to test for the theme page, there are also Zenpage funcitons to check that.
    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 ;-)
Sign In or Register to comment.