ZenphotoCMS Forum
issues making new plugin working - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: Plugins (https://forum.zenphoto.org/forum-6.html)
+--- Thread: issues making new plugin working (/thread-10271.html)



issues making new plugin working - BigLouis87 - 05-08-2012

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!




issues making new plugin working - sbillard - 05-08-2012

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




issues making new plugin working - sbillard - 05-08-2012

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.




issues making new plugin working - BigLouis87 - 06-08-2012

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.




issues making new plugin working - acrylian - 06-08-2012

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.




issues making new plugin working - sbillard - 06-08-2012

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.




issues making new plugin working - BigLouis87 - 08-08-2012

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