I did it! I will write instructions on russian forum.
Offline
Now I try create plugin for automatically create a button. But I can't get thumbnail link again. {$current.THUMB_SRC} not available from plugin. Can you advise something how to get current trumbnail link not from template? I think I need something from SMARTY, but I don't know where I must search it.
Offline
Hi
you should read the How To http://piwigo.org/doc/doku.php?id=dev:changes_in_2.4
and also take a look at core/plugin files
as I don't know more that's only what I can say
Offline
flop25 wrote:
Hi
you should read the How To http://piwigo.org/doc/doku.php?id=dev:changes_in_2.4
and also take a look at core/plugin files
as I don't know more that's only what I can say
That don't help. I know what thumbnail included in {$current.THUMB_SRC}, I can use it in my theme. But in template of plugin {$current.THUMB_SRC} is empty.
Offline
?
EvilKant wrote:
But in template of plugin {$current.THUMB_SRC} is empty.
so you need to assign youself...
I really don't understand because you don't understand the system, so let's start by explaining us what's your code etc
Offline
{combine_script id="vk_share" load='footer' path="http://vk.com/js/api/share.js" charset="windows-1251"} {footer_script} $('<div class="vkpBut"></div>').appendTo($('.imageInfoTable')); $('.vkpBut').html(VK.Share.button({ldelim} url: document.location.href, title: '{$vk_title}', description: '{$vk_desc}', image: '{$current.THUMB_SRC}', noparse: true })); {/footer_script}
If I write it somewhere in piwigo\themes\Temp1\template\picture.tpl all is working and {$current.THUMB_SRC} contain link to thumbnail of current picture. But if I write it in template of plugin, {$current.THUMB_SRC} is empty.
Offline
You don't get the way of working of Smarty : you write tpl code then you need to assign (declare how your tpl code will be replaced) and finally parse the tpl file (Smarty reads the tpl and replaces the var)
Here the {$current.THUMB_SRC} is defined ONLY for picture.tpl
So again what are you trying to do!?
Offline
flop25 wrote:
So again what are you trying to do!?
Do you mean what my plugin will do? It will create vk.com "like" button with title, description and thumbnail of current picture. Like facebook "like" button.
flop25 wrote:
Here the {$current.THUMB_SRC} is defined ONLY for picture.tpl
Understand. I was hoped this time I will do without request from the database :(
Offline
wait
you want to add code which would use the already predfined tpl var on picture.tpl? Well jsut make a prefilter and add your code See what's going on http://piwigo.org/dev/browser/extension … nc.php#L48
Offline