New Droplet - P-Gallery


crnogorac081

The demo is available and I turned error report to All and saw no errors.. Could someone create me a page in droplets menu in AMASP page ?
Web developer

WebBird

If it's fixed (throws no errors) und works nicely, why not? :-D

crnogorac081

Hi,

Shall I post this droplet to AMASP ?
Web developer

WebBird

There are some more undefined vars causing that errors ($link, for example). You should always develop with PHP error option set to E_ALL. (I think saiborg has.)

WebBird

Quote from: crnogorac081 on October 23, 2009, 12:23:04 PM
BTW, I just copied that part of code from another droplet..  :-D

Maybe you missed the $num-define-part of that droplet. :-D

crnogorac081

hm, wierd.. I am not a coder so I cant help you much..:(

Maybe there is a problem because you have so many java scripts..

maybe some coder can help ?
Web developer

saiborg

Thak you, i fixed it. But the error still exists.

Dirk
schaut doch mal vorbei

[url="http://www.microott.de"]http://www.microott.de[/url]

maverik

@saiborg

Quote<script src="http://www.microott.de/modules/jquery/jquery-min.js" type="text/javascript"></script>
<script src="http://www.microott.de/modules/jquery/jquery-ui-min.js" type="text/javascript"></script>
<script src="http://www.microott.de/modules/jquery/jquery-insert.js" type="text/javascript"></script>
<script src="http://www.microott.de/modules/jquery/jquery_api.js" type="text/javascript"></script>
<script src="http://www.microott.de/templates/microott_random/jquery_frontend.js" type="text/javascript"></script>
<script src="http://www.microott.de/modules/wysiwyg_query/frontend.js" type="text/javascript"></script><script src="http://www.microott.de/modules/droplets/js/mdcr.js" type="text/javascript"></script>
<script type="text/javascript" src="http://www.microott.de/include/jquery/jquery-min.js"></script>

you load min.js two times

saiborg

jep i did the upload, and put full permission to the folder and the files.
And i updated the droplets module for WB2.8

Dirk
schaut doch mal vorbei

[url="http://www.microott.de"]http://www.microott.de[/url]

crnogorac081

@maverik

Cool, I didnt clean the unneccessary code :)

@saiborg

Did you update droplet module to the one for WB, maybe you have multiple droplets or something..

Did you upload the files attached in first post ??

cheers
Web developer

maverik

problem english language  :-D

your settings file

$(document).ready(
               function (){
                   $("#pikame").PikaChoose({auto_play:true, slide_enabled:false, show_prev_next:false});
               });
               
           $(document).ready(
               function (){
                   $("#pikame_user").PikaChoose({user_thumbs:true, show_prev_next:false});
           });
           
           $(document).ready(
               function (){
                   $("#pikame_compact").PikaChoose({user_thumbs:true, show_prev_next:false});
           });


i only want to say thats enough for me and works with the short code  :-)

saiborg

schaut doch mal vorbei

[url="http://www.microott.de"]http://www.microott.de[/url]

crnogorac081

That is the settings code, and I copied that code into one SETtings file :)
Web developer

maverik

options

http://pikachoose.com/versions/

i have only this in my pikachoose-set.js

   $(document).ready(
               function (){
                   $("#pikame").PikaChoose({   auto_play:false,
                                                                    slide_enabled:true,
                                                                    show_prev_next:false,
                                                                    show_captions:false,
                                                                    delay_caption:false,
                                                                    user_thumbs:false

                                                            });
               });
               

crnogorac081

there is a pikachoose-set.js -- settings file where you can adjust settings

cheers

BTW, I just copied that part of code from another droplet..  :-D
Web developer

maverik

works out of the box only with some changes in css file, nice droplet  :-D

http://template.developer-base.de/pages/start/pikachoose.php

WebBird

#6
$num is not defined before first usage.

Quote
while(($image=next($names))and(($count<=$num)or(!isset($num)))){

You can predefine it like this before the line above:

Quote$num = NULL;

Or you may put it the other way around:

Quote
while((!isset($num)or($image=next($names))and(($count<=$num)))){

Edit: Anyway, using a var for while that's not set should be treated as a bug. ;)

crnogorac081

wierd,

which version of WB do you use ?

Could you post a link (or PM me) to see whats wrong.. ?

cheers
Web developer

saiborg

Thanks for your fast answer.....but the errormessage still exists

I Put the Code in the Index.php....like this
<script type="text/javascript" src="<?php echo WB_URL?>/include/jquery/jquery-min.js"></script>
</head>
<body>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

Thanks Dirk
schaut doch mal vorbei

[url="http://www.microott.de"]http://www.microott.de[/url]

crnogorac081

#3
Upss,

sorry, I forgot to write that you need to insert JQuery script to your header:

Insert this line into your templates index.php header:

<script type="text/javascript" src="<?php echo WB_URL; ?>/include/jquery/jquery-min.js"></script>

JQuery is allways part of my header now :)

cheers
Web developer

saiborg

Hi, nice droplet....

but... i got an errormessage, can you help me please?!

Errormessage:

Warning: reset(): Passed variable is not an array or object in /srv/www/vhosts/microott.de/httpdocs/modules/droplets/droplets.php(41) : eval()'d code on line 11 Notice: Undefined variable: num in /srv/www/vhosts/microott.de/httpdocs/modules/droplets/droplets.php(41) : eval()'d code on line 16


Thank you Dirk
schaut doch mal vorbei

[url="http://www.microott.de"]http://www.microott.de[/url]

crnogorac081

#1
Hi,

I modified Pikachoose JQuery Gallery to be a droplet for WB.

You must download the attachemnt and upload files to ROOT/include/jquery/plugins/pikachoose  folder.

Then create New droplet:

Code (P-Gallery) Select

$wb_page_data = str_replace('</head>','<!-- P-Gallery -->'."\n".'<link href="'.WB_URL.'/include/jquery/plugins/pikachoose/pikachoose.css" rel="stylesheet" type="text/css"/>'."\n".'<script src="'.WB_URL.'/include/jquery/plugins/pikachoose/pikachoose-min.js" type="text/javascript"></script>'."\n".'<script src="'.WB_URL.'/include/jquery/plugins/pikachoose/pikachoose-set.js" type="text/javascript"></script>'."\n".'</head>', $wb_page_data );

$folder=opendir(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/.');
$names = array();
while ($file = readdir($folder))  {
   $ext=strtolower(substr($file,-4));
   if ($ext==".jpg"||$ext==".gif"||$ext==".png"){
       $names[count($names)] = $file;
   }
}
closedir($folder);
reset(shuffle($names));
array_unshift($names," ");
if(isset($width)){$width=' width="'.$width.'"';}else{$width="";}
if(isset($height)){$height=' height="'.$height.'"';}else{$height="";}
$count=1;

while(($image=next($names))and(($count<=$num)or(!isset($num)))){

if( $count ==1){$class=' class="active"';}else{$class='';}

$name=substr($image,0,-4);
if($link=="y"){$images=$images.'<a href="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" target=_blank>';}
if(file_exists(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/thumbs/'.$image.'.thumb.jpg')){
$images=$images.'<img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/thumbs/'.$image.'.thumb.jpg" alt="'.$name.'" '.$width.$height.'/>';
}else{
$images=$images.' <li><img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" alt="'.$name.'" '.$width.$height.$class.' /></li>';
}
if($link=="y"){$images=$images.'</a>';}
$count++;
}

return '<div class="pikachoose"><ul id="pikame">'.$images.'</ul></div>';



Droplet example:
[[P-Gallery?dir=folder_in_media/or_subfolder]]

You can restyle dimesions with csse.

You must include JQuery script into your header (included in WB 2.8), just copy this line into your header:

<script type="text/javascript" src="<?php echo WB_URL; ?>/include/jquery/jquery-min.js"></script>


Temporary demo link can be found here.

Original source files for this Gallery can be found here.

All best,
I

[gelöscht durch Administrator]
Web developer