Hello,
I'm new to piwigo development (and PHP as well...) .
I've started mysite & month ago and needed possibility to geotagg my categories (not my pictures).
After trying rvgmaps plugin (awesome) I thought of creating one with bing maps (sorry I'am a Microsoft fanboy) for my specific use.
The work done, it became plugin "Psli-BingMaps" that I release few days ago.
Now, some users who tried my plugin find an annoying bug ...
I coded access to the file in the plugin with relative path starting from PHPWG_PLUGINS_PATH but it seems that in some case when URL is modified like this one :
"http://www.toto.net/galerie/index/category/album"
PHPWG_PLUGINS_PATH could not find file in my plugin (more specifically JS file in a JS subdirectory of my plugin).
I'm sorry for this long post.
Could anyone help me to understand how i can access to files in my plugin from any Piwigo configuration ?
Thank you very much in advance.
psli
Offline
here is what I use (for Crypto Captcha here)
in the php file :
define('CRYPTO_PATH', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
$template->assign('CRYPTO_PATH', CRYPTO_PATH);in the tpl file :
{combine_css path=$CRYPTO_PATH|@cat:"template/colorpicker/colorpicker.css"}
{combine_script id="jquery.colorpicker" require="jquery" path=$CRYPTO_PATH|@cat:"template/colorpicker/colorpicker.js"}the constant CRYPTO_PATH contains a relative url to my plugin folder, which works even if the folder is renamed
Last edited by mistic100 (2012-05-10 17:02:49)
Offline
Thank you for your (quick) answer.
If I understand your code, when you want to add js file to your page, you don't insert it with HTML tag (<script></script>) but with this smarty tag combine_script.
And from within PHP (for including file) ? is there any standard solution to access file or does "PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'" will work in any case (even with right management on the server) ?
psli
Offline
As I read again your answer, i'm not sure if my problem will be solved ?
I add "<script>" in a prefilter, so it seems at the time where my code is processed all smarty tags have already been translate ... If i add "{combine_script " will it be translated ?
Offline
yes, you can use smarty tags in prefilters
for php includes in use with my previous code
include(CRYPTO_PATH.'my_file_to_include.php');
Offline
Offline