WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: vyni on October 09, 2008, 09:41:41 PM

Title: New snippet Fancy-Box
Post by: vyni on October 09, 2008, 09:41:41 PM
Hi there!

For all non-german-speaking users:

I would like to inform You that Maruk made a new snippet, called Fancy-Box.
See the Website here. (http://fancy.klade.lv/)

Here is the original thread (https://forum.WebsiteBaker.org/index.php/topic,11159.msg67175.html#msg67175) in german.

With this package You are able to use this amazing script in any page You like. Just download and install as usual in WB. On the page wehre You want to use it, set a section code and call the function. That´s it.
For the design and saving space I modified the code-appearence. See the screenshot.
I included the modified file. Just copy the modify.html to the folder modules/code in Your server and You are done. This will change the code-section to a single-line-view, but not affect any code, if in use somewhere in Your site. - For further code sections with more lines You should use CODE2 - if You don´t have it already, download it here (http://WebsiteBaker.at/wb/module.html).

There are 5 classes already predifined:

fb - use fancy-box with standard-values
pic_fb - for pictures, closing on klick into the pic or cross
pic1_fb - for pictures, closing on klick into the pic or cross, darkens the background
page_fb - for urls, closing only with click on the cross, some pages braek out when surfing, some stay in
video_fb - set link to anchor, size predifined to 425 x 355 px

and further more, there is a sample-configuration for a <div id="use_fb">
all links innert this <div> will be displayed by Fancy-box, no matter if class is set or not. The default-configuration will be used (size, effect) - if You want specific effects, use classes. Or make Your own configuration in the include.php

For now I didnot make display-groups, for "surfing" the links, but this is also possible.

More configurations can be stored in the include.php

Example how to use to display a YouTube-video:

The first section of the page must be type CODE - in this section write

Code: [Select]
use_fancy_box();
and save. In a wysiwyg-section add a link.
Add the corresponding class to the link.
Code:

<a class="video_fb" href="#testube">See this video</a>

save. Add a further section - type CODE2, set it to html and insert the following code

Code: [Select]
<div style="display: none;" id="testube" />
<object height="355" width="425" />
<param name="movie" value="http://www.youtube.com/v/nnpv3FhIVXk" />
<param name="wmode" value="transparent" />
<embed height="355" width="425" src="http://www.youtube.com/v/nnpv3FhIVXk" type="application/x-shockwave-flash" wmode="transparent" />
</embed></object>
</div>

and save. Finished.


Example how to use fancy-box with an image-link:

The first section of the page must be type CODE - in this section write

Code: [Select]
use_fancy_box();
and save. In a wysiwyg-section add a link.
Add the corresponding class to the link.

Code: [Select]
<p><a href="http://localhost/wb/media/testfotos/kugelsunsetglow.jpg" class="pic_fb"><img height="171" border="0" width="200" src="http://localhost/wb/media/testfotos/Bar_kl.jpg" alt="" /></a></p>
save. Finished.


regards from Himberg, next to Vienna

[gelöscht durch Administrator]

[gelöscht durch Administrator]
Title: Re: New snippet Fancy-Box
Post by: Argos on October 10, 2008, 02:37:15 AM
Cool! Thanks  :-D

I wonder... this would be nice to use together with the News module as well. Click on a title link, and the complete news item pops up. Would this be possible to do somehow?
Title: Re: New snippet Fancy-Box
Post by: vyni on October 10, 2008, 08:25:15 AM
Hi Argos,

Yes, no problem.

Just try it out.

Create a usual link (<a href="http://DOMAIN/pages/news.php" class="seite" >News</a>), activate FB as explained, and the news are shown in a Box.

As long as You read the news, even You follow links, it stay´s inside this box. If You click annother menu-link, the box dissapears. (Because of the framebraking feature of WB I think)

regards from Himberg
Title: Re: New snippet Fancy-Box
Post by: chio on October 10, 2008, 08:32:06 AM
I am not very happy with the class names.

they should be something like "fb_mode1" or "fb_page"
Why not use the original names?

There might be classes like "bild" in templates allready and - of course - "bild" is quite german.
Title: Re: New snippet Fancy-Box
Post by: vyni on October 10, 2008, 08:55:19 AM
Jo, chio
however - You could change this to whatever You like in the include.php.

If german or not - "bild" will be in classes only, if someone uses german.


Annother example (http://edv.spoka.at/pages/fancy-box.php) for fancy-box combined with anynews

Just be creative and share Your results.


regards from Himberg
Title: Re: New snippet Fancy-Box
Post by: Argos on October 10, 2008, 10:53:36 AM
Annother example (http://edv.spoka.at/pages/fancy-box.php) for fancy-box combined with anynews
Hi vyni,

this shows the complete site in a popup, but I meant to show only the long content of the news item  :roll:
Do you know how to do that?
Title: Re: New snippet Fancy-Box
Post by: Ruud on October 10, 2008, 11:12:05 AM
this shows the complete site in a popup, but I meant to show only the long content of the news item  :roll:
Do you know how to do that?

Use a blank template for the newspage?

@vyni

I installed the snippet and like it :-)
I put it on a new customer website, and the site didn't show anymore :-(

I will try to explain what happened:

The snippet start with a blank line before the <?php
This causes WB to send data (a blank line) before a page is ever built.
My customers website starts with a menu-link page that executes a redirect to the /nl/ pages.
The redirect failed because PHP said that there was already data being sent.
The production site has PHP errors off, so all I got was an empty page.

Solution, always make sure that snippets have no data between outside <?php and ?>

Ruud
Title: Re: New snippet Fancy-Box
Post by: vyni on October 10, 2008, 08:49:14 PM
Thank You, Mr. Ruud

for making me a little bit more clever.  :-D

This only could happen, because Maruk isn´t that experienced in making snippets or modules. Me for myself, I don´t even understand the differnce between snippet and modul. I´m just a helping hand.

But now I am appeased, because You had a look on it.
I will clean up and renew the description, also using more FB-specific class-names as chio propound.

At least - this is really a very very nice thing.

@Argos
Ruud had the answer - for the news itself use a blank template and put them on a hidden page. Create a normal page type code and use the snippet anynews for displaying the overview and extend the include.php as described. The resullt will be what ever You want. See a Demo (http://edv.spoka.at/pages/news.php)

regards from Himberg
Title: Fancy-Box and Validation
Post by: albatros on October 11, 2008, 03:11:58 PM
Hi all,

and again, a blind man talking about colors.  :-D

I love the fancy-box, but I also whant to get valid pages. here is, how it works for me:

I took this
Code: [Select]
<link rel="stylesheet" href="<?php echo WB_URL?>/modules/fancy_box/box/fancy_css.php?wbp=<?php 

echo WB_URL?>
" type="text/css" media="screen" />
from the include.php of the modul to the index.php of my template.

And then I changed the syntax in the inlude.php here and there a little bit
Code: [Select]
<?php
$debug 
false;
if (
true == $debug ) {
    
ini_set(&#39;display_errors&#39;, 1);
    
error_reporting(E_ALL);
}
if (!
function_exists("use_fancy_box") ) {
    function 
use_fancy_box() {
    
?>

    <script language="JavaScript" type="text/javascript" src="<?php echo WB_URL; ?

>/
modules/fancy_box/box/jquery.js"></script>
    <script language="
JavaScript" type="text/javascript" src="<?php echo WB_URL; ?

>/
modules/fancy_box/box/jquery.fancybox.js"></script>
    <script language="
JavaScript" type="text/javascript" src="<?php echo WB_URL; ?

>/
modules/fancy_box/box/jquery.pngFix.js"></script>
     
    <script language="
JavaScript" type="text/javascript">
    $(document).ready(function() { $("
a.fb").fancybox();
    $("
a.page_fb").fancybox({ &#39;hideOnContentClick&#39;: false,
                            &#39;zoomSpeedIn&#39;:0,
                               &#39;zoomSpeedOut&#39;:300 });
    $("
a.pic_fb").fancybox({ &#39;hideOnContentClick&#39;: true });
    $("
a.pic1_fb").fancybox({ &#39;hideOnContentClick&#39;: true,
                            &#39;overlayShow&#39;: true });    
    $("
a.video_fb").fancybox({ &#39;overlayShow&#39;: true,
                               &#39;frameWidth&#39;: 425,
                               &#39;frameHeight&#39;: 355 });
    $("
div#use_fb a").fancybox();
    
});
    </
script>
    <?
php
    
}
}
?>

The result is "This document was successfully checked as XHTML 1.0 Transitional!"  :-D
Title: Re: New snippet Fancy-Box
Post by: vyni on October 11, 2008, 03:15:14 PM
Great,

have You tested it in google-chrome?

It isn´t working for me right now.
Do You have an url where to see ??

But remember: If You call it directly from the template - You will get troubles with one or annother modul! Maybe Lightbox, maybe Imageflow, maybe annother?

regards from Himberg
Title: Re: New snippet Fancy-Box
Post by: albatros on October 11, 2008, 03:23:30 PM
Hi vyni,

you got a pm.
Title: Re: New snippet Fancy-Box
Post by: vyni on October 11, 2008, 03:26:31 PM
Great - it works in chrome!
Title: Re: New snippet Fancy-Box
Post by: albatros on October 11, 2008, 03:27:58 PM
I use Lightbox2 on the second page of the site "aufteilung..." and there seem to be no problems.
Title: Re: New snippet Fancy-Box
Post by: albatros on October 11, 2008, 03:41:17 PM
But remember: If You call it directly from the template - You will get troubles with one or annother modul! Maybe Lightbox, maybe Imageflow, maybe annother?

Just forgotten,

the general solution for that is the use of a frontend.css, as matthias tould you in the german thread about fancy-box.

Regards

Uwe (going to eat now)

Title: Re: New snippet Fancy-Box
Post by: albatros on October 11, 2008, 04:41:51 PM
Hi Vyni,

one question. I tested fancybox successfully with "Code". You prefer "Code2". What is the reason?

Thanks in advance!

Uwe

Edit: and a second qustion. I had a closer look at fancybox in Opera and the effect was different from IE and FF3. The popups are opening in a different position, much closer to the bottom.  :?
My changes or the js or opera?

Edit01: I tried the examples at http://fancy.klade.lv/ (http://fancy.klade.lv/) in Opera and none of them is working in Opera.  :oops:
Title: Re: New snippet Fancy-Box
Post by: albatros on October 12, 2008, 11:35:59 AM
Hi Vyni,

one question. I tested fancybox successfully with "Code". You prefer "Code2". What is the reason?

Thanks in advance!

Uwe

Edit: and a second qustion. I had a closer look at fancybox in Opera and the effect was different from IE and FF3. The popups are opening in a different position, much closer to the bottom.  :?
My changes or the js or opera?

Edit01: I tried the examples at http://fancy.klade.lv/ (http://fancy.klade.lv/) in Opera and none of them is working in Opera.  :oops:
Edit2: WHAT is that? The are working, but they are opening much, much deeper, much closer to the bottom of the (long) page. So you only can see them, when you are scrolling down. Mysterios!
Title: Re: New snippet Fancy-Box
Post by: vyni on October 12, 2008, 12:42:34 PM
Hi Albatros,

For the issue in opera: I really don´t have a clue. But there are a lot more browsers out there....
And if there is something in the "owners-page", than I guess, it is something with the Javascript itself. Or just a failure from opera. Who know´s?

 :lol: I´m thinking of a script which identifies the browser and in case it isn´t FF or IE there must be a big red line saying:
It´s time to use a decent browser!

And the difference between code and code2:, or why I prefer to use code2 and use code rarely:

code2 has the option to set the mode, if html, javascript, php or just internal comment. So You have always clear which code You are using. Also it is a superb way to give some help and explanation to unexperienced users. If You want to comment a section or just write down the different parameters which could be set, this is perfect.
And this module I use very often - unchanged - full sized. But when You need a section code for only one line, for anynews or fancy_box or whatever, I was fed up of the space-wasting textarea. So I modified the output of this code-module. Now I´m happy with the look and feel of the backend, use it when I need only one line and prefer code2 for all other needings.

regards from Himberg
Title: Re: New snippet Fancy-Box
Post by: mr-fan on November 12, 2008, 06:49:58 PM
hi all,

i've a short question for the fancy box...

are there any minimum requires on the webserver to run it...

for my projekt it runs on XAMP... it runs on vynis server....with my template!

but it doesn't run under my webserver (different templates, anynews is correct configuered?)

are theire any serverside settings what can dissable the fb???

regards martin

edit here is the link to the example video from the threat : http://start.mr-vilsbiburg.de/pages/fb-test.php (http://start.mr-vilsbiburg.de/pages/fb-test.php)
Title: Re: New snippet Fancy-Box
Post by: Luckyluke on December 12, 2008, 01:05:30 PM
Great - it works in chrome!

I think there are some troubles in the new version of Chrome. I've got this
Code: [Select]
$(document).ready(function() { $("a.fb").fancybox(); $("a.page_fb").
fancybox({ 'hideOnContentClick': false, 'zoomSpeedIn':0, 'zoomSpeedOut':300 });
$("a.pic_fb").fancybox({ 'hideOnContentClick': true });
$("a.pic1_fb").fancybox({ 'hideOnContentClick': true, 'overlayShow': true });
$("a.video_fb").fancybox({ 'overlayShow': true, 'frameWidth': 425, 'frameHeight': 355 });
$("div#use_fb a").fancybox(); });

Strange...

Grtz,
Luc

Title: Re: New snippet Fancy-Box
Post by: doxynder on February 08, 2009, 12:41:05 PM
Hi Luckyluke!
I have the same problem! Maybe you have a solution ? I´ve tried to put the code into head-no chance but i have to say that i´m not sure if i have done it in the right way.
This site http://www.rvb.bplaced.net/pages/fancy.php (http://www.rvb.bplaced.net/pages/fancy.php) works fine in chrome altough there are error messages in the javascript console. Code is in body!

best regaard
peter
Title: Re: New snippet Fancy-Box
Post by: doxynder on February 10, 2009, 04:52:34 PM
hab die include so abgeändert (<script---/></script -> <script></script)
Code: [Select]
<?php
$debug 
false;
if (
true == $debug ) {
    
ini_set(&#39;display_errors&#39;, 1);
    
error_reporting(E_ALL);
}
if (!
function_exists("use_fancy_box") ) {
    function 
use_fancy_box() {
    
?>

    <script type="text/javascript" src="<?php echo WB_URL?>/modules/fancy_box/box/jquery.js"></script>
    <script type="text/javascript" src="<?php echo WB_URL?>/modules/fancy_box/box/jquery.fancybox.js"></script>
    <script type="text/javascript" src="<?php echo WB_URL?>/modules/fancy_box/box/jquery.pngFix.js"></script>
     <link rel="stylesheet" href="<?php echo WB_URL?>/modules/fancy_box/box/fancy_css.php?wbp=<?php echo WB_URL?>" type="text/css" media="screen">
    <SCRIPT type=text/javascript>
    $(document).ready(function() { $("a.fb").fancybox();
    $("a.page_fb").fancybox({ 'hideOnContentClick': false,
                            'zoomSpeedIn':0,
                               'zoomSpeedOut':300 });
    $("a.pic_fb").fancybox({ 'hideOnContentClick': true });
    $("a.pic1_fb").fancybox({ 'hideOnContentClick': true,
                            'overlayShow': true });    
    $("a.video_fb").fancybox({ 'overlayShow': true,
                               'frameWidth': 600,
                               'frameHeight': 400 });
    $("div#use_fb a").fancybox();
    });
    </script>
    <?php
    
}
}
?>
in chrome funkts jetzt auch
Title: Re: New snippet Fancy-Box
Post by: AgentLu on February 25, 2009, 06:07:35 PM
Hello, I have a question for the fancybox - I am new to javascripting and I am trying to figure out the fancybox. If I want to use more than one Custom defined image set, how do I do that? Can anybody help me please?

I am bugging like this >  :-o
Title: Re: New snippet Fancy-Box
Post by: sky writer on April 28, 2009, 09:41:01 PM
Does anyone have FancyBox working in a WebsiteBaker website?  I had it working a while back, but now when I tried it opens the video frame way down the page, without the lightbox effect.

I have tried un-installing and re-installing, but it won't work anymore.
Title: Re: New snippet Fancy-Box
Post by: albatros on April 28, 2009, 10:29:45 PM
Hi,

yes I have. E.g. here http://www.willingen-ferienhaus.de/topics/wintersport-in-willingen-3.php (http://www.willingen-ferienhaus.de/topics/wintersport-in-willingen-3.php) and here http://www.willingen-ferienhaus.com/ (http://www.willingen-ferienhaus.com/) you can see it in action, but only with images, not with a video.

Regards

Uwe
Title: Re: New snippet Fancy-Box
Post by: sky writer on April 29, 2009, 12:22:49 AM
Thank you.  Those examples look great, and work perfectly in my browsers.  So I am left to wonder, how you set your fancybox up?

I downloaded the fancybox module from AMASP http://www.websitebakers.com/pages/modules/various/fancy-box.php

Installed the module through WB Add-ons.

I then followed Vyni's (miss you Vyni!) instructions:
-----------------------------------------------
Example how to use to display a YouTube-video:

The first section of the page must be type CODE - in this section write

Code:
use_fancy_box();
and save.

In a wysiwyg-section add a link.
Add the corresponding class to the link.
Code:
<a class="video_fb" href="#testube">See this video</a>
save.

Add a further section - type CODE2, set it to html and insert the following code
Code:
<div style="display: none;" id="testube" />
<object height="355" width="425" />
<param name="movie" value="http://www.youtube.com/v/nnpv3FhIVXk" />
<param name="wmode" value="transparent" />
<embed height="355" width="425" src="http://www.youtube.com/v/nnpv3FhIVXk" type="application/x-shockwave-flash" wmode="transparent" />
</embed></object>
</div>
and save. Finished.
-----------------------

Like I said, I did have this module/snippet working a while ago.  But now it doesn't work.

Can you explain any differences in the way you implemented the module?  Did you make any other manual entries?

Many Thanks!
Title: Re: New snippet Fancy-Box
Post by: albatros on April 29, 2009, 12:55:58 AM
Hi sky writer,

I tried the quoted code here http://www.willingen-ferienhaus.de/pages/testseite.php (http://www.willingen-ferienhaus.de/pages/testseite.php) and it works in FF, Opera, IE8 and IE7. It's the same code, only another video (one of my favorites  :-D). I will let it stay here temporarily.

The changes I made, you can read in a former posting https://forum.WebsiteBaker.org/index.php/topic,11327.msg68099.html#msg68099 (https://forum.WebsiteBaker.org/index.php/topic,11327.msg68099.html#msg68099) of the same thread.

hth

albatros

Edit: the video doesn't work in IE6 (don't know why in this moment), but the images do.
Title: Re: New snippet Fancy-Box
Post by: sky writer on April 29, 2009, 01:40:38 AM
Hi albatros,

Your video page works for me.

But I tried the changes that you stated in the thread and I still get the video (or images) opening way down at the bottom of the page.  I notice in that same thread that you had this same issue.  Do you remember what was causing this for you?

This is driving me a little mad.
Title: Re: New snippet Fancy-Box
Post by: albatros on April 29, 2009, 02:10:49 AM
Hi,

sorry! I really forgot that.

At the End of line 145 in jquery.fancybox.js  I changed from "- 40;" to "/ 3;"  so it's now
Code: [Select]
var itemTop        = viewportPos[3] + Math.round((viewportPos[1] - itemSize[1]) / 2) / 3;
After that, it also worked in Opera.

hth

albatros
Title: Re: New snippet Fancy-Box
Post by: noname8 on July 07, 2009, 06:01:26 PM
Downloaded this fancy box and it's working nicely.

Minor bad thing is that with Opera it opens the image to under the screen if page is longer than screen.
(Seem's like it's always 30% of body height or similiar, so if body is 3000px long, picture goes too down..)
Title: Re: New snippet Fancy-Box
Post by: albatros on July 11, 2009, 01:42:36 PM
Hi,

did you try my suggestion of the posting before?

Best regards

Uwe
Title: Re: New snippet Fancy-Box
Post by: Olli on August 20, 2009, 11:00:14 PM
hey there,

is there an approach to get the fancy box snippet not to insert all css / javascript below the <body> tag since this seems not to be valid code anymore?

thanks
Title: Re: New snippet Fancy-Box
Post by: albatros on August 21, 2009, 08:57:31 PM
Hi,

I have no validation problems, as you can checkout e.g. here http://www.willingen-ferienhaus.de/pages/aufteilung-u.-ausstattung.php (http://www.willingen-ferienhaus.de/pages/aufteilung-u.-ausstattung.php) or here http://www.willingen-ferienhaus.com/ (http://www.willingen-ferienhaus.com/). This is the result of the changes, which I described here https://forum.WebsiteBaker.org/index.php/topic,11327.msg68099.html#msg68099 (https://forum.WebsiteBaker.org/index.php/topic,11327.msg68099.html#msg68099)

hth

Uwe
Title: Re: New snippet Fancy-Box
Post by: Olli on August 26, 2009, 05:15:28 AM
hi albatros,

sorry i did not read all topics completly. thanks for pointing me to your solution :-)

all the best
Title: Re: New snippet Fancy-Box
Post by: reddi on September 01, 2009, 08:11:56 PM
i changed the include.php of fancy_box_0.3b. the include is now valid to w3c. have fun. i named it to fancy_box_0.3c.

greets from germany

[gelöscht durch Administrator]
Title: Re: New snippet Fancy-Box
Post by: erpe0812 on October 12, 2009, 10:38:48 AM
Hi

I reworked the fancy_box to fit the needs of 2.8.
Box now uses the jquery from include_directory and I did some changes on the css file.
This release now needs wb 2.8 as a minimum requirement.

A small tutorial is posted here:
https://forum.WebsiteBaker.org/index.php/topic,11327.msg67934.html#msg67934

The new release and the last for 2.7 can be downloaded on AMASP (http://www.websitebakers.com/pages/modules/various/fancy-box.php).

Instead of a code page (for the box php call) you can use a droplet:
Code: [Select]
ob_start();
    use_fancy_box();
    $fancy_content = ob_get_contents();
ob_end_clean();

return $fancy_content;
and call it with
Quote
[[fancybox]]

It will not be available on the official library (http://www.websitebakers.com/pages/droplets/official-library.php) because it is a function call that needs the snippet fancybox.

rgds

erpe
Title: Re: New snippet Fancy-Box
Post by: Argos on October 12, 2009, 12:19:40 PM
Nice one, erpe!
Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 12, 2009, 04:04:38 PM
Hi,

in the nigthly build Changeset 1164 is a new Version of Fancybox, updated from 1.0 to 1.2.1

Dietmar
Title: Re: New snippet Fancy-Box
Post by: erpe0812 on October 12, 2009, 04:18:55 PM
On the first look the fancybox doesn't seem to work with the same style as the existing one.
And classes must be modified........... .....
http://www.rvb.bplaced.net/pages/fancy.php

I like the fancybox style as it was.

Why was this updated?

Is it possible to let the old one stay too?

rgds

erpe
Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 12, 2009, 04:26:28 PM
Then take the old one in the fancy module folder

Dietmar
Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 12, 2009, 04:30:48 PM
Hi Erpe,

what do you have for problems, looks good on your side

here is the expample side from the author

http://fancybox.net/example (http://fancybox.net/example)

Dietmar
Title: Re: New snippet Fancy-Box
Post by: erpe0812 on October 12, 2009, 04:37:38 PM
Quote
Then take the old one in the fancy module folder
That was why I reworked the module.
Don't want to have the same file twice on different places.

Who decides if a file will be updated or not?

Why is this new js-file needed?

erpe
Title: Re: New snippet Fancy-Box
Post by: dbs on October 12, 2009, 04:43:08 PM
@erpe: on your page only works youtube-link, but it dont play...
Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 12, 2009, 04:43:19 PM
It's normaly that old files will be going updated to the newst one, if there are extended and added options. If you have problems zip the fancybox folder, send it here and i will be going to help you.

Dietmar
Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 12, 2009, 04:47:17 PM
@dbs
Quote
on your page only works youtube-link, but it dont play...

i think there is a wrong usage and implatations

Dietmar
Title: Re: New snippet Fancy-Box
Post by: dbs on October 12, 2009, 04:57:11 PM
@dietmar:

wtf is a nighly build and where is it to find?
u make nightshifts for wb?  :-D

dbs
Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 12, 2009, 05:00:31 PM
This are the changes for the new fancybox

    *  Changed grouping, from now groups will be created using "rel" tag (as in first version)
    * Content now is also iframed when anchor has class "iframe"
    * New callback "callbackOnShow" - fired after content is shown
    * New option "padding" - sets nice padding around content
    * Added fix as reported on this post
    * Fixed bug - added missing unbind actions
    * + Some minor CSS and code changes

I think i will be going to develop a new fancaboxmodul, to use all possibilities that are in WB

Dietmar
Title: Re: New snippet Fancy-Box
Post by: erpe0812 on October 12, 2009, 05:45:49 PM
Quote
@erpe: on your page only works youtube-link, but it dont play...

I simply replaced the fancybox js with the new one.

That is not the way updates can be made, Dietmar (from my point of view).

We should talk about this.........

rgds

erpe

Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 12, 2009, 07:18:47 PM
If the snippet and modules are developed well, then there are no problems. For me it is not theme to discuss it.

I want the best for WebsiteBaker. There were bugfixes and so i replace it.

I started a new fancybox snippet, think tomorrow it will be finish. I look in the old functionname to set it equal, so that nobody has problems. But now the snippet will work with frontend.css for your own styles and frontend.js. If to set the JS before bodyend, then rename frontend.js to frontend_body.js

If there are problems i will be going to help. I know, for most people there are missunderstandings to work with jquery framework.

Dietmar
Title: Re: New snippet Fancy-Box
Post by: erpe0812 on October 12, 2009, 07:27:53 PM
But remember:
2.8. is the current version............ ..

rgds

erpe
Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 12, 2009, 07:54:53 PM
Oh yes i know, i only develope under 2.8 and will be tested too under 2.7

Dietmar
Title: Re: New snippet Fancy-Box
Post by: erpe0812 on October 12, 2009, 08:01:34 PM
But 2.7 has no include/jquery directory.......... ...............
Title: Re: New snippet Fancy-Box
Post by: albatros on October 16, 2009, 10:24:05 PM
Hi Dietmar, hi Erpe,

on a later version I made some small changes to get valid code using fancybox https://forum.WebsiteBaker.org/index.php/topic,11327.msg68099.html#msg68099 (https://forum.WebsiteBaker.org/index.php/topic,11327.msg68099.html#msg68099). Nobody reacted, except Vyni, so maybe i am totally wrong. I have to say, that I am no real coder.

Now I used Fancybox 0.4 and I also didn't get valid code this time. With these changes it is valid:

1. I put this into the the head of index.php of my template instead of the include.php of fancybox
Code: [Select]
<link href="<?php echo WB_URL?>/modules/fancy_box/screen.css" type="text/css" rel="stylesheet" media="screen" />
2. I changed include.php to
Code: [Select]
<?php
$debug 
false;
if (
true == $debug ) {
    
ini_set(&#39;display_errors&#39;, 1);
    
error_reporting(E_ALL);
}
if (!
function_exists("use_fancy_box") ) {
    function 
use_fancy_box() {
    
?>

    <script language="JavaScript" type="text/javascript" src="<?php echo WB_URL?>/include/jquery/jquery-min.js"></script>
    <script language="JavaScript" type="text/javascript" src="<?php echo WB_URL?>/include/jquery/plugins/jquery-fancybox.js"></script>
    <script language="JavaScript" type="text/javascript" src="<?php echo WB_URL?>/include/jquery/plugins/jquery-pngFix.js"></script>
     
   
    <script language="JavaScript" type="text/javascript">
    $(document).ready(function() { $("a.fb").fancybox();
    $("a.page_fb").fancybox({ 'hideOnContentClick': false,
                            'zoomSpeedIn':0,
                               'zoomSpeedOut':300 });
    $("a.pic_fb").fancybox({ 'hideOnContentClick': true });
    $("a.pic1_fb").fancybox({ 'hideOnContentClick': true,
                            'overlayShow': true,
                            'frameWidth': 800,
                               'frameHeight': 600 });    
    $("a.video_fb").fancybox({ 'overlayShow': true,
                               'frameWidth': 425,
                               'frameHeight': 355 });
    $("div#use_fb a").fancybox({ 'hideOnContentClick': true,
                            'overlayShow': true,
                            'frameWidth': 700,
                               'frameHeight': 600 });
    });
    </script>
    <?php
    
}
}
?>

What's your opinion about that?

Best regards

Uwe
Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 16, 2009, 10:28:57 PM
Hi Uwe,

I only have problems with embed code and valide xhtml, if i use object its not shown in each browser.

Dietmar
Title: Re: New snippet Fancy-Box
Post by: albatros on October 16, 2009, 10:47:58 PM
Hi Dietmar,

could you please explain it a little bit more detailled because I dont understand?
The site I am using the patched version of FB 0.4 is http://www.willingen-ferienhaus.com/ (http://www.willingen-ferienhaus.com/)

Thanks in advance!

Best Regards

Uwe
Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 16, 2009, 11:45:40 PM
Yes, i'm a fan for valide code, your side is valide. But if want to open a video, e.g. from youtube with fancybox, then most it is included with object and embed tags. And embed don't exists in xhtml

Dietmar
Title: Re: New snippet Fancy-Box
Post by: albatros on October 16, 2009, 11:50:19 PM
Ah ok, now I understand. But even then you would probably have less faults with my changes. Don`t you think so?

Best Regards

Uwe
Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 17, 2009, 12:08:05 AM
Yes is the better way to put the css in the head. i do it with the jquery insert plugin on the fly, only if needed.

Dietmar
Title: Re: New snippet Fancy-Box
Post by: albatros on October 17, 2009, 12:15:34 AM
Yes is the better way to put the css in the head.

Yes. Maybe a frontend.css like in news and form would easier for unexperienced users.

But I also changed the syntax of the calls for the js-files.

Best regards

Uwe
Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 17, 2009, 12:19:33 AM
Yes the include folder is ok, i see it. You only must be check, that jquery.js is not loaded twice.

Dietmar
Title: Re: New snippet Fancy-Box
Post by: erpe0812 on October 17, 2009, 10:24:37 AM
@albatros

if the 0.3c release gives valid code the only reason for this can be the implementing of the css file.
I personally don't like to load css files in the head if they are only needed for special modules.

Please check if the 0.3c release is valid.
If yes I will modify the fancybox 0.40 with this kind of implementing css.

Thanks for your information.

rgds

erpe
Title: Re: New snippet Fancy-Box
Post by: erpe0812 on October 17, 2009, 12:49:44 PM
Hi

I uploaded new (valid) release 0.41 to AMASP (http://www.websitebakers.com/pages/modules/various/fancy-box.php)

A small tutorial is posted here:
https://forum.WebsiteBaker.org/index.php/topic,11327.msg67934.html#msg67934

Validation can be seen here:
http://www.rvb.bplaced.net/pages/fancy-valid.php

Please keep in mind that you can use this droplet to call fancybox:

Code: [Select]
ob_start();
    use_fancy_box();
    $fancy_content = ob_get_contents();
ob_end_clean();

return $fancy_content;

and call it with

Quote
[[fancybox]]

It will not be available on the official library because it is a function call that needs the snippet fancybox.

rgds

erpe
Title: Re: New snippet Fancy-Box
Post by: maverik on October 17, 2009, 03:26:53 PM
my solution

fancybox v0.40 installed

header

Code: [Select]
<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATE_DIR?>/css/style.css" media="screen,projection" />
        <link rel="stylesheet" type="text/css" href="<?php echo WB_URL?>include/jquery/plugins/jquery-ui.css" media="screen,projection" />
        <script language="JavaScript" type="text/javascript">
         var URL = '<?php echo WB_URL ?>';
        </script>
        <script type="text/javascript" src="<?php echo WB_URL;?>/include/jquery/jquery-min.js"></script>
        <script type="text/javascript" src="<?php echo WB_URL;?>/include/jquery/jquery-ui-min.js"></script>
        <script type="text/javascript" src="<?php echo WB_URL;?>/include/jquery/jquery-insert.js"></script>
        <script type="text/javascript" src="<?php echo WB_URL;?>/include/jquery/plugins/jquery-corner.js"></script>
        <script type="text/javascript" src="<?php echo WB_URL;?>/include/jquery/plugins/jquery-fancybox.js"></script>
        <script type="text/javascript" src="<?php echo WB_URL;?>/include/jquery/plugins/jquery-pngFix.js"></script>
        <?php
    
// automatically include optional WB module files (frontend.css, frontend.js)
    
if (function_exists(&#39;register_frontend_modfiles&#39;)) {
        
register_frontend_modfiles(&#39;css&#39;);
        
register_frontend_modfiles(&#39;js&#39;);
    
?>

sreen.css renamed in frontend css and made a frontend js

Code: [Select]
   $(document).ready(function() { $("a.fb").fancybox();
    $("a.page_fb").fancybox({ 'hideOnContentClick': false,
                            'zoomSpeedIn':0,
                               'zoomSpeedOut':300 });
    $("a.pic_fb").fancybox({ 'hideOnContentClick': true });
    $("a.pic1_fb").fancybox({ 'hideOnContentClick': true,
                            'overlayShow': true,
                            'frameWidth': 800,
                               'frameHeight': 600 });
    $("a.video_fb").fancybox({ 'overlayShow': true,
                               'frameWidth': 425,
                               'frameHeight': 355 });
    $("div#use_fb a").fancybox({ 'hideOnContentClick': true,
                            'overlayShow': true,
                            'frameWidth': 700,
                               'frameHeight': 600 });
    });


thats valid and works wonderfull

http://template.developer-base.de/pages/start/fancybox-valide.php
Title: Re: New snippet Fancy-Box
Post by: erpe0812 on October 17, 2009, 04:13:57 PM
It is similar to what I did in the fancybox 0.41.

But you don't need to put code in the head of your template.

rgds


erpe
Title: Re: New snippet Fancy-Box
Post by: maverik on October 17, 2009, 04:21:12 PM
maybe someone can translate  :-D

da ich jquery ja eh global verwenden will, "war das nicht so gedacht mit 2.8?"  :-D, zb mit corner, ist es so doch einfacher mit einem eintrag in die head. kann jetzt  auf jeder seite jedes thumb mit der class belegen ohne das droplet einfügen zu müssen.
Title: Re: New snippet Fancy-Box
Post by: erpe0812 on October 17, 2009, 04:36:41 PM
But not everybody wants every script on every page............... .

rgds

erpe
Title: Re: New snippet Fancy-Box
Post by: Luisehahne on October 17, 2009, 04:59:53 PM
Quote
But not everybody wants every script on every page

Whats with fancybox as pagemodul, in meantime i write a german help file, later translate in english

@demo
http://WebsiteBaker.wdsnet.de/wb/pages/de/jquery/fancybox.php (http://WebsiteBaker.wdsnet.de/wb/pages/de/jquery/fancybox.php)

Dietmar
Title: Re: New snippet Fancy-Box
Post by: noname8 on December 08, 2009, 08:59:58 PM
There is some bug / not valid xhtml that seems to show in google chrome

Code: [Select]
<script type=javascript />
should read:
Code: [Select]
<script type="javascript" >
or perhaps this is enough:
Code: [Select]
<script type=javascript>
Title: Re: New snippet Fancy-Box
Post by: erpe0812 on December 08, 2009, 11:41:34 PM
Cannot confirm this.
Please see validation links on this page:
http://www.rvb.bplaced.net/pages/fancy-valid.php

rgds

erpe
Title: Re: New snippet Fancy-Box
Post by: masarin on December 15, 2009, 08:36:24 AM
How can I get the arrows to work like in the "Image Gallery" example
http://fancybox.net/example
so that I can move on to the next picture directly without having to close the current one first.


/masarin
Title: Re: New snippet Fancy-Box
Post by: dbs on December 15, 2009, 09:28:56 AM
hi, your pics have class?
they need rel="fancybox" too.

dbs
Title: Re: New snippet Fancy-Box
Post by: masarin on December 15, 2009, 11:15:50 AM
hi, your pics have class?
they need rel="fancybox" too.

dbs

When I add the rel="fancybox" to the link fancybox is not engaged and the picture opens without a fancybox window.

Code: [Select]
<div><a href="lift.jpg" class="pic_fb" rel="fancybox"> pic1 </a>   
<a href="berg.jpg" class="pic_fb" rel="fancybox"> pic2 </a></div>
Title: Re: New snippet Fancy-Box
Post by: maverik on December 15, 2009, 11:25:53 AM
Code: [Select]
<a href="image5.jpg" rel="fancybox" class="pic1_fb"><img border="0" src="thumb5.jpg" alt="" /></a>
thats the right way
Title: Re: New snippet Fancy-Box
Post by: masarin on December 15, 2009, 02:07:46 PM
Code: [Select]
<a href="image5.jpg" rel="fancybox" class="pic1_fb"><img border="0" src="thumb5.jpg" alt="" /></a>
thats the right way


when i add rel="fancybox" to a link FancyBox stops working.


/masarin

Code: [Select]
<a href="lift700.jpg" rel="fancybox" class="pic1_fb"> <img height="37" width="50" src="lift50.jpg" alt="" /></a> <a href="berg.jpg" rel="fancybox" class="pic1_fb"><img height="37" width="50" src="lift50.jpg" alt="" /></a>
Title: Re: New snippet Fancy-Box
Post by: erpe0812 on December 15, 2009, 03:41:46 PM
Is there a link to the site?

rgds

erpe
Title: Re: New snippet Fancy-Box
Post by: masarin on December 16, 2009, 04:42:11 PM
Is there a link to the site?

rgds

erpe

Heres a test page with two pictures.
http://hoppsaweb.se/enovx/pages/se/test.php
I want to be able to open one of them and then click on a link (arrow) in the open picture to get to the second one.
Just like in this page:
http://www.berann.at/cms/kunst/malerei.html

/masarin
Title: Re: New snippet Fancy-Box
Post by: maverik on December 16, 2009, 05:12:51 PM
Quote
Galleries are created from found anchors who have the same "rel" tags

http://fancybox.net/howto
Title: Smooth gallery in the Fancy-Box
Post by: hamburg-support on March 23, 2010, 10:19:57 PM
Hello,

i am trying to put the smooth gallery in the FancyBox, but the hole Fancybox is not working.

The website is http://www.fritz-bicker.de/wb/gallery/broschueren.php (http://www.fritz-bicker.de/wb/gallery/broschueren.php) and click on the first picture to see it.

I already put the <?php use_fancy_box(); ?> in the index.php and i use the blanc css template for the smmoth gallery.

I hope anyone got an idea to get it working.

Thank you in advance.

David

Title: Re: New snippet Fancy-Box
Post by: dbs on March 23, 2010, 11:00:34 PM
jquery-min.js + jquery-fancybox.js are 2x loaded...
Title: Re: New snippet Fancy-Box
Post by: hamburg-support on March 24, 2010, 08:46:36 AM
Thank you, but its still the same problem.  :?
Title: Re: New snippet Fancy-Box
Post by: dbs on March 24, 2010, 12:11:03 PM
da dein template anders aufgebaut ist als wb-templates sein sollten, such mal nach jquery einbinden und lies mal hier:
http://www.websitebakers.de/tutorials/topics/einbindung-der-fancybox.php (http://www.websitebakers.de/tutorials/topics/einbindung-der-fancybox.php)
Title: Re: New snippet Fancy-Box
Post by: hamburg-support on March 24, 2010, 12:43:47 PM
Vielen Dank für deine Antwort dbs,

ich habe jetzt das standard template "Round" genommen und die Facybox mit
Code: [Select]
<?php use_fancy_box(); ?> in der index.php eingebunden.

Die Faccybox wird so aufgerufen

Code: [Select]
<a href="[wblink40]" class="video_fb" rel="fancybox" ><img hspace="9" height="61" width="111" vspace="8" alt="" src="http://www.fritz-bicker.de/wb/media/Broschueren/intro/3.png" /></a>
und das wäre die Seite (Smmoth Gallery) die darin gezeigt werden soll. http://www.fritz-bicker.de/wb/gallery/broschueren/alfa.php (http://www.fritz-bicker.de/wb/gallery/broschueren/alfa.php)

Öffnet sich aber leider im neuen Fenster bzw. funktioniert dies nicht.

Ich hoffe Sie können mir helfen.

Schöne Grüße und vielen Dank schon mal.

David
Title: Re: New snippet Fancy-Box
Post by: dbs on March 24, 2010, 12:50:00 PM
das ist so eine sache, wenn wb seine templates nicht jquery-ready ausliefert.
im head(vor </head>) muss das stehen was du auf dieser seite unter einbindung jquery siehst.
im body brauchst du dann jquery nicht nochmal aufrufen.
http://www.WebsiteBaker.net/pages/topics/die-colorbox-als-modul-snippet.php (http://www.WebsiteBaker.net/pages/topics/die-colorbox-als-modul-snippet.php)
Title: Re: New snippet Fancy-Box
Post by: dbs on March 24, 2010, 12:58:05 PM
am besten du lässt fancybox weg und nimmst die colorbox aus dem link ;-)
und besser du kommst rüber in den deutschen teil des forums.

sorry for so much german here...

dbs