Welcome, Guest. Please login or register.
Did you miss your activation email?
February 13, 2012, 12:31:34 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
149699 Posts in 21103 Topics by 7538 Members
Latest Member: ionline
* Home Help Search Login Register
Poll
Question: Are you using Droplets?
Yes, I like the idea!
No, Why?
What are Droplets?

Pages: 1 ... 6 7 [8] 9 10 ... 18   Go Down
Print
Author Topic: New Admin-Tool: Droplets  (Read 45997 times)
instantflorian

Offline Offline

Posts: 685



WWW
« Reply #175 on: August 25, 2009, 08:39:39 AM »

Hi,

there seems to be a bug with droplets & WB 2.8 - if you use more than one droplet on a page (not in a template!), the second droplet displays the code of the first droplet.

It occured with the showsection-Droplet and a droplet which I had written to display a mp3 player

Code:
$returnvalue = '<div style="text-align:center;font-size:xx-small">'.$songtitel.'<br/>';
$returnvalue .= '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="160" height="20" id="Hörbeispiel" align="middle">';
$returnvalue .= '<param name="wmode" value="transparent" />';
$returnvalue .= '<param name="allowScriptAccess" value="sameDomain" />';
$returnvalue .= '<param name="movie" value="'.WB_URL.'/dewplayer-mini.swf?mp3='.WB_URL.'/media/'.$song.'&autostart='.$autostart.'" />';
$returnvalue .= '<param name="quality" value="high" />';
$returnvalue .= '<param name="bgcolor" value="FFFFFF" />';
$returnvalue .= '<embed src="'.WB_URL.'/dewplayer-mini.swf?mp3='.WB_URL.'/media/'.$song.'&autostart='.$autostart.'" quality="high" bgcolor="FFFFFF" width="160" height="20" name="Hörbeispiel" wmode="transparent" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
$returnvalue .= '</div>';
return $returnvalue;

Although I'm calling

Quote
[[dewplayer?song=klangschale-tabla-tanpura.mp3&autostart=0&songtitel=Klangschalen, Tabla und Tanpura - Lichtflug]]
[[dewplayer?song=klangschalen-solo1.mp3&autostart=0&songtitel=Klangschalen Energie Solo 2]]

there occurs only the first droplet twice.

This did not happen in WB 2.7... Is there any solution for this problem?

Regards
instantflorian
« Last Edit: August 25, 2009, 08:56:08 AM by instantflorian » Logged
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2094



WWW
« Reply #176 on: August 25, 2009, 11:13:18 AM »

Thanks for reporting this bug.

I have found the problem. It is caused by some code optimization done on the module.
The result was that any previously used variables on a page could not be used a second time.
In your situation, the declared parameters (song, autostart and songtitle) of the first call were used in the second call again.

The module is fixed.
An upgrade can be found on the AMASP pages: http://www.websitebakers.com/pages/droplets/module-wb2.8.php

Note that this is a WB2.8 version, do not install this in a WB2.7 website.

Ruud
Logged

Professional WebsiteBaker Developer
instantflorian

Offline Offline

Posts: 685



WWW
« Reply #177 on: August 25, 2009, 11:21:20 AM »

Thank you very much, Ruud.
It works  smiley

Regards
instantflorian
Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #178 on: August 25, 2009, 12:33:18 PM »

Hi Ruud,

It could be the same issue as happened to me.. I will test it too..

cheers
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
muecki

Offline Offline

Posts: 58


« Reply #179 on: August 25, 2009, 04:30:54 PM »

Hallo Ruud,

one question about the upgrade. Installing over the backend or overwriting the existing files with FTP?

Helmut
Logged

Viele Grüße aus dem Bergischen Land.
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #180 on: August 25, 2009, 04:43:09 PM »

I instaled module via backend and its working Smiley

cheers
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Pumpi

Offline Offline

Posts: 556


WWW
« Reply #181 on: August 25, 2009, 05:03:43 PM »

Hi Ruud

I have the same problem as instantflorian

I have update but dosent work

i use this Droplet call [[prettyPhoto?dir=Menschen/dark]]

when i have more droplets he always use the first Value from $dir

Edit

Sorry it was an instalation Error he tels me its update but he do nothing i have manual update Wink
« Last Edit: August 25, 2009, 05:11:25 PM by Pumpi » Logged

My Module for Websitebaker - Foldergallery 1.17
alexander1951

Offline Offline

Posts: 17



« Reply #182 on: August 30, 2009, 10:11:10 AM »

It would be nice to get information about the following questions:
+ Update from 1.0.1 to 1.0.2: replace the serverfiles via ftp or deinstall/reinstall via the backend?
+ How can I restore backuped droplets? No function found in the module interface respectively no info found in the droplets help page or here.

Thx 4 help! Alexander
Logged
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2094



WWW
« Reply #183 on: August 30, 2009, 08:53:46 PM »

+ Update from 1.0.1 to 1.0.2: replace the serverfiles via ftp or deinstall/reinstall via the backend?
You can just upgrade your current version. No need for FTP and no need for uninstall first.

+ How can I restore backuped droplets? No function found in the module interface respectively no info found in the droplets help page or here.
There is no automated restore.
Just open the seperate files from the backup-zip with your favorite text editor, and copy/past the code in the Droplet admin screens.

Ruud
Logged

Professional WebsiteBaker Developer
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #184 on: August 31, 2009, 02:26:28 PM »

Hi Ruud,

How can I load language file of the module I am using in droplet ?

I tried to add this code:

Code:
// check if module language file exists for the language set by the user (e.g. DE, EN)
if(!file_exists(WB_PATH .'/modules/MODULENAME/languages/'.LANGUAGE .'.php')) {
    // no module language file exists for the language set by the user, include default module language file EN.php
    require_once(WB_PATH .'/modules/MODULENAME/languages/EN.php');
} else {
    // a module language file exists for the language defined by the user, load it
    require_once(WB_PATH .'/modules/MODULENAME/languages/'.LANGUAGE .'.php');
}

But it doesnt work..in frontend I get blank space..if I put variable from language file..

cheers
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Luisehahne
Board Member
Development Team
*****
Offline Offline

Posts: 2952



WWW
« Reply #185 on: August 31, 2009, 08:58:27 PM »

I did it with a own language folder and files in my template dir. So if a switch to another language i have my own translated text.

Dietmar
Logged

We are human beings - and nobody is perfect at all.
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2094



WWW
« Reply #186 on: August 31, 2009, 09:59:34 PM »

But it doesnt work..in frontend I get blank space..if I put variable from language file..
Just did a small test like this:

Code:
if(!file_exists(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php')) {
    require_once(WB_PATH .'/modules/news/languages/EN.php');
} else {
    require_once(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php');
}
return $MOD_NEWS['TEXT_READ_MORE'];
and it is working fine..

Note that you need the directory of the module, not the module name.

Ruud
Logged

Professional WebsiteBaker Developer
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #187 on: August 31, 2009, 10:30:24 PM »

I did it that way, but it didnt worked...I ll test again, I probably missed something in syntax, like always Smiley

cheers

---Update:

silly me, it works Smiley
« Last Edit: August 31, 2009, 10:39:31 PM by crnogorac081 » Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #188 on: August 31, 2009, 11:26:45 PM »

Well not for so long Smiley It seems that it works only if you dont use module and droplet on same page..

My droplet is in template file, and it works if I am on any other page except one which use that module (from language file), and when I am on that page which use same language file as droplet, the text from language file in droplet dissapears..

Could you please test..

cheers
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2094



WWW
« Reply #189 on: September 01, 2009, 09:07:10 AM »

Since it is a "require_once", the language file is not loaded a second time.

You might need to do a "global $LANG" in the beginning of the droplet code. (replace $LANG with the message array that is used)

R
Logged

Professional WebsiteBaker Developer
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #190 on: September 01, 2009, 11:23:56 AM »

ok, thanks Ruud
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
tbtabo

Offline Offline

Posts: 8


« Reply #191 on: September 02, 2009, 06:40:41 PM »

Thanks for reporting this bug.

I have found the problem. It is caused by some code optimization done on the module.
The result was that any previously used variables on a page could not be used a second time.
In your situation, the declared parameters (song, autostart and songtitle) of the first call were used in the second call again.

The module is fixed.
An upgrade can be found on the AMASP pages: http://www.websitebakers.com/pages/droplets/module-wb2.8.php

Note that this is a WB2.8 version, do not install this in a WB2.7 website.

Ruud
I tested today the calendar droplet for WB2.8
http://www.websitebakers.com/pages/droplets/official-library/date-time/calendar.php
with the last droplet module update via module install. Version 1.0.2

I put on a wysiwyg page:
[[calendar?gyear=2009&gmonth=9]]
[[calendar?gyear=2009&gmonth=10]]
[[calendar?gyear=2009&gmonth=11]]
if you need september , october and november you get 3 times the first : september !!!
Any idea , how to solve ?
Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #192 on: September 02, 2009, 07:07:30 PM »

do you use wb 2.7 or wb 2.8 platform ?
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
tbtabo

Offline Offline

Posts: 8


« Reply #193 on: September 02, 2009, 07:19:48 PM »

It is 2.8 platform- SVN: 1132. Thanks
Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #194 on: September 02, 2009, 07:46:24 PM »

Am not sure, Ruud will be able to help you, but can you try to make another WYSIWYG editor below that one and add [[calendar?gyear=2009&gmonth=10]]

Maybe you cant use more that one "same" droplet in one section..if that is the case, you can do a workaround Smiley to brake that text to 3 wysiwyg Smiley...but as I sad, I am just guessing, Ruud will be able to help you..

cheers
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
tbtabo

Offline Offline

Posts: 8


« Reply #195 on: September 02, 2009, 07:58:55 PM »

Hello,
I tried: on the same page 3 wysiwyg sections.
one for september, the other for october and the last for december 2009
It is not the solution.
http://www.tbtec.ch/wb/pages/eng/test2.php
with one section in one page it gives : http://www.tbtec.ch/wb/pages/eng/test.php
Thank you for your reply.
Logged
pcwacht
AddOn Development
*
Offline Offline

Posts: 2814



WWW
« Reply #196 on: September 02, 2009, 08:16:13 PM »

@Ruud,

I think I found the solution for this (haven't tested though), in file droplets.php at end

Try replace this:
Code:
function evalDroplet($droplet, $params, &$wb_page_data) {
    if(is_array($params)) extract($params, EXTR_SKIP);
    return eval($droplet);
}
to
Code:
function evalDroplet($droplet, $params, &$wb_page_data) {
    if(is_array($params)) extract($params, EXTR_OVERWRITE);
    return eval($droplet);
}
or
Code:
function evalDroplet($droplet, $params, &$wb_page_data) {
    if(is_array($params)) extract($params);
    return eval($droplet);
}
Wich is the default (EXTR_OVERWRITE)
See http://nl2.php.net/manual/en/function.extract.php for more info on extract

The EXTR_SKIP means Do NOT overwrite existing , the EXTR_OVERWRITE means DO overwrite existing

Other solution would be to clear the params array before and use a dummy with extract instead wich gives more code wich isn't for the better Wink

Have fun,
John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
Ruud
Board member
WebsiteBaker Org e.V.

Offline Offline

Posts: 2094



WWW
« Reply #197 on: September 04, 2009, 03:52:35 PM »

@Ruud,
Wich is the default (EXTR_OVERWRITE)

NO, This is not the way.
It will replace any varialbles in PHP when you use that.
A parameter like ?section_id=123 will probably break the website completely.

The evalDroplet() p[arameters are now within the functions scope, so variable that are created there will only live during that function call. A second call will not see old variables (unless declared global somewhere)

@tbtabo
Just tried it on a WB28 and the latest droplets update and for me all is working fine.
I get the correct calendars after copying your 3 droplet calls in a WYSIWYG page.
Can you check if you upgraded the droplets module correctly?

Ruud

Logged

Professional WebsiteBaker Developer
ghost06

Offline Offline

Posts: 53


« Reply #198 on: September 05, 2009, 05:21:58 PM »

hello to all,
 I would want to make a Droplet that show scroller news  rolleyes

the code in HTML is this:
Code:
<div id="pscroller1">
<script type="text/javascript">
new pausescroller(pausecontent, "pscroller1", "someclass", 3000)
</script>
</div>
someone can help me to write it in pcp tails correct?  smiley
Logged
tbtabo

Offline Offline

Posts: 8


« Reply #199 on: September 06, 2009, 11:42:34 AM »

@Ruud
There is a strange installation process.
step 1: When I installed verion 1.02 of module Droplet. I had the message : 'upgraded succesfully'.
step 2: after your answer, I checked  the version with filezilla ftp. It was written version 1.01. in info.php
step 3 : I had to give file attributes 777 ( recurse in subdirectories ) to  the modules directory.
            Reinstalled the 1.02 version. The calendar droplet has been deleted. I had to copy paste again.
            Now it works ! but in the admin / add-ons / module / droplet details : it is always version 1.01
step4 : When I open the file info.php (local  copy via ftp )  it is ok  in info.php it is version 1.02

I think i did not understand the file- directories attributes .
Tbtabo
Logged
Pages: 1 ... 6 7 [8] 9 10 ... 18   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!