zenphoto forums » Plugins

issues making new plugin working

(7 posts)
  • Started 9 months ago by BigLouis87
  • Latest reply from BigLouis87
  1. BigLouis87

    Member
    Joined: May '12
    Posts: 31

    Hi Stephen, I made a new thread to avoid going OT in the other thread ("db update function").
    I turned my idea into a plugin to upload anonymously images in an album. In 1.4.2 it worked perfectly, in 1.4.3 and latest trunk it gives issues in including functions files (require_once). The error is:

    Page not found
    The Zenphoto object you are requesting cannot be found.
    Album: plugins/gigiuploader/zp-core
    Image: setup

    This is the plugin, it is very simple and only an alpha, the options are to be implemented yet and you must create an album in the folder albums/fan, but it should work at least.
    http://www.mediafire.com/?e5g2kaxxddae0hr
    I use it in search.php, calling the function printgigiuploader($searchwords); in order to take the right image tag to assign (I actually use search functions only for tags in my project).

    Can you help me understand what's wrong?
    Thank you!

    Posted 9 months ago #
  2. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    Sure, I will take a look and see if I can get it running.

    Don't forget to read the Forum rules and usage resources
    Posted 9 months ago #
  3. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    Pretty close to working. Just two changes needed in upload.php

    Add a 'define('OFFSET_PATH', 3);` as the first line of code
    This basically declares the code to reside in a sub-folder of the plugins folder.

    change $path = WEBPATH . '/albums/fan/'; to $path = SERVERPATH. '/albums/fan/'; (of course eventually to whatever album is in the options.) move_uploaded_file() and chmod() operate on filesystem paths, not web paths.

    Did work for me when I tested with those two changes.

    [edit] note that the original post had an error on the second line replacement.

    Don't forget to read the Forum rules and usage resources
    Posted 9 months ago #
  4. BigLouis87

    Member
    Joined: May '12
    Posts: 31

    Thank you Stephan now it works! The offset_path was the main key.
    Now I will work on it to make it generally usable and I'll give it to you to publish if you think it will be useful for other people.

    Posted 9 months ago #
  5. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,341

    New plugins are always welcome but you should not give it "to us". Please read here regarding publishing the plugin for the community:
    http://www.zenphoto.org/news/general-contributor-guidelines#themes-and-plugins

    You will understand that we cannot take over maintaining everything (even if we did help a bit in this case). Unless sbillard wants to do that naturally which I don't know right now.

    Don't forget to read the Forum rules and usage resources
    Posted 9 months ago #
  6. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    We are glad to help making things work, but as acrylian indicates we prefer if people can host their contributions. Otherwise if we do it they gust get out of date and cause people problems who try to use them.

    Don't forget to read the Forum rules and usage resources
    Posted 9 months ago #
  7. BigLouis87

    Member
    Joined: May '12
    Posts: 31

    Seems legit! When I will finish my site I will build a page for the plugin to host it, thanks for the guidelines.

    Posted 9 months ago #

RSS feed for this topic

Reply

You must log in to post.