FancyBox for WordPress - Version 2.1

Version Description

Download this release

Release Info

Developer moskis
Plugin Icon wp plugin FancyBox for WordPress
Version 2.1
Comparing to
See all releases

Code changes from version 2.0 to 2.1

Files changed (4) hide show
  1. admin.php +61 -25
  2. fancybox.css +12 -0
  3. fancybox.php +28 -4
  4. readme.txt +7 -1
admin.php CHANGED
@@ -2,18 +2,6 @@
2
 
3
  function mfbfw_options() {
4
 
5
- // Set defaults
6
- add_option('mfbfw_autoApply', 'on');
7
- add_option('mfbfw_imageScale', 'on');
8
- add_option('mfbfw_zoomOpacity', 'on');
9
- add_option('mfbfw_zoomSpeedIn', '500');
10
- add_option('mfbfw_zoomSpeedOut', '500');
11
- add_option('mfbfw_overlayShow', 'on');
12
- add_option('mfbfw_overlayColor', '#666666');
13
- add_option('mfbfw_overlayOpacity', '0.3');
14
- add_option('mfbfw_hideOnContentClick', '');
15
- add_option('mfbfw_centerOnScroll', 'on');
16
-
17
  // Store plugin options in an array
18
  $options=array(
19
  'autoApply' => get_option('mfbfw_autoApply'),
@@ -25,14 +13,15 @@ function mfbfw_options() {
25
  'overlayColor' => get_option('mfbfw_overlayColor'),
26
  'overlayOpacity' => get_option('mfbfw_overlayOpacity'),
27
  'hideOnContentClick' => get_option('mfbfw_hideOnContentClick'),
28
- 'centerOnScroll' => get_option('mfbfw_centerOnScroll')
 
 
29
  );
30
 
31
  // Make selects data
32
  $overlayArray = array(0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1);
33
  $msArray = array(0,100,200,300,400,500,600,700,800,900,1000,1500);
34
 
35
-
36
  // Start the Options Page
37
  ?>
38
 
@@ -43,7 +32,7 @@ function mfbfw_options() {
43
 
44
  <div style="float:right;margin-left:10px;background:#FFFBCC;text-align:center;width:200px;" class="updated">
45
 
46
- <p style="line-height:1.5em;">If you use FancyBox and like it, buy the author a beer!</p>
47
 
48
  <form id="donate_form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
49
  <input name="cmd" value="_donations" type="hidden">
@@ -64,7 +53,7 @@ function mfbfw_options() {
64
 
65
  <div style="clear:right;float:right;margin-left:10px;background:#FFFBCC;text-align:center;width:200px;" class="updated">
66
 
67
- <p style="line-height:1.5em;">The author of this WordPress Plugin also likes beer :P</p>
68
 
69
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
70
  <input type="hidden" name="cmd" value="_s-xclick"/>
@@ -77,7 +66,7 @@ function mfbfw_options() {
77
 
78
  <div style="clear:right;float:right;margin-left:10px;background:#9DD1F2;border-color:#419ED9;text-align:center;width:200px;" class="updated">
79
 
80
- <p style="line-height:1.5em;"><a href="http://twitter.com/moskis/">Follow me on Twitter for more WordPress Plugins and Themes.</a></p>
81
 
82
  <img height="16" width="16" border="0" alt="" src="<?php echo WP_PLUGIN_URL ?>/fancybox-for-wordpress/img/extra_twitter.png" />
83
 
@@ -85,15 +74,19 @@ function mfbfw_options() {
85
 
86
  <h3><?php _e('About', 'mfbfw'); ?></h3>
87
 
88
- <p><?php _e('This plugin integrates FancyBox with WordPress without having to edit any file or code. Once activated the plugin will apply FancyBox automatically to all image links, including WordPress galleries. Future versions will include some more options like easier inline content integration and more advanced customization. Enjoy!'); ?></p>
 
 
 
 
89
 
90
- <p><?php _e('If you have problems or questions about FancyBox itself you should <a href="http://groups.google.com/group/fancybox">ask in the FancyBox Google Group</a>. If you want to make suggestions or ask just about this WordPress plugin you can <a href="http://blog.moskis.net/downloads/plugins/fancybox-for-wordpress/">leave a comment here</a>, <a href="http://blog.moskis.net/contactar/">send me an email</a>, or <a href="http://twitter.com/moskis">contact me on twitter</a>.'); ?></p>
91
 
92
- <p><?php _e('<a href="http://fancy.klade.lv/home">FancyBox</a> developed by <a href="http://kac.klade.lv/">Janis Skarnelis</a>, ported to WordPress by <a href="http://moskis.net/">Jos&eacute; Pardilla</a>. Licensed under the <a target="_blank" href="http://en.wikipedia.org/wiki/MIT_License">MIT License</a>.'); ?></p><br />
93
 
94
- <h3><?php _e('Settings', 'mfbfw'); ?></h3>
95
 
96
- <form method="post" action="options.php" id="options"><?php echo wp_nonce_field('update-options'); ?>
97
 
98
  <table class="form-table" style="clear:none;">
99
  <tbody>
@@ -220,7 +213,48 @@ function mfbfw_options() {
220
  <label for="mfbfw_centerOnScroll">
221
  <input type="checkbox" name="mfbfw_centerOnScroll" id="mfbfw_centerOnScroll"<?php if (get_option('mfbfw_centerOnScroll') == 'on') echo ' checked="yes"';?> />
222
  <?php _e('Keep image in the center of the browser window when scrolling (default: on)', 'mfbfw'); ?>
223
- </label><br /><br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
 
225
  </fieldset>
226
  </td>
@@ -231,9 +265,11 @@ function mfbfw_options() {
231
 
232
 
233
  <input type="hidden" name="action" value="update" />
234
- <input type="hidden" name="page_options" value="mfbfw_autoApply,mfbfw_imageScale,mfbfw_zoomOpacity,mfbfw_zoomSpeedIn,mfbfw_zoomSpeedOut,mfbfw_overlayShow,mfbfw_overlayColor,mfbfw_overlayOpacity,mfbfw_hideOnContentClick,mfbfw_centerOnScroll" />
235
 
236
- <p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options','mfbfw'); ?>" /></p>
 
 
237
 
238
  </form>
239
 
2
 
3
  function mfbfw_options() {
4
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  // Store plugin options in an array
6
  $options=array(
7
  'autoApply' => get_option('mfbfw_autoApply'),
13
  'overlayColor' => get_option('mfbfw_overlayColor'),
14
  'overlayOpacity' => get_option('mfbfw_overlayOpacity'),
15
  'hideOnContentClick' => get_option('mfbfw_hideOnContentClick'),
16
+ 'centerOnScroll' => get_option('mfbfw_centerOnScroll'),
17
+ 'nojQuery' => get_option('mfbfw_nojQuery'),
18
+ 'jQnoConflict' => get_option('mfbfw_jQnoConflict')
19
  );
20
 
21
  // Make selects data
22
  $overlayArray = array(0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1);
23
  $msArray = array(0,100,200,300,400,500,600,700,800,900,1000,1500);
24
 
 
25
  // Start the Options Page
26
  ?>
27
 
32
 
33
  <div style="float:right;margin-left:10px;background:#FFFBCC;text-align:center;width:200px;" class="updated">
34
 
35
+ <p style="line-height:1.5em;"><?php _e('If you use FancyBox and like it, buy the author a beer!', 'mfbfw'); ?></p>
36
 
37
  <form id="donate_form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
38
  <input name="cmd" value="_donations" type="hidden">
53
 
54
  <div style="clear:right;float:right;margin-left:10px;background:#FFFBCC;text-align:center;width:200px;" class="updated">
55
 
56
+ <p style="line-height:1.5em;"><?php _e('The author of this WordPress Plugin also likes beer :P', 'mfbfw'); ?></p>
57
 
58
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
59
  <input type="hidden" name="cmd" value="_s-xclick"/>
66
 
67
  <div style="clear:right;float:right;margin-left:10px;background:#9DD1F2;border-color:#419ED9;text-align:center;width:200px;" class="updated">
68
 
69
+ <p style="line-height:1.5em;"><a href="http://twitter.com/moskis/"><?php _e('Follow me on Twitter for more WordPress Plugins and Themes', 'mfbfw'); ?></a></p>
70
 
71
  <img height="16" width="16" border="0" alt="" src="<?php echo WP_PLUGIN_URL ?>/fancybox-for-wordpress/img/extra_twitter.png" />
72
 
74
 
75
  <h3><?php _e('About', 'mfbfw'); ?></h3>
76
 
77
+ <p><?php _e('This plugin integrates FancyBox with WordPress without having to edit any file or code. Once activated the plugin will apply FancyBox automatically to all image links, including WordPress galleries. Future versions will include some more options like easier inline content integration and more advanced customization. Enjoy!', 'mfbfw'); ?></p>
78
+
79
+ <p><?php _e('If you have problems or questions about FancyBox itself you should <a href="http://groups.google.com/group/fancybox">ask in the FancyBox Google Group</a>. If you want to make suggestions or ask just about this WordPress plugin you can <a href="http://blog.moskis.net/downloads/plugins/fancybox-for-wordpress/">leave a comment here</a>, <a href="http://blog.moskis.net/contactar/">send me an email</a>, or <a href="http://twitter.com/moskis">contact me on twitter</a>.', 'mfbfw'); ?></p>
80
+
81
+ <p><?php _e('<a href="http://fancy.klade.lv/home">FancyBox</a> developed by <a href="http://kac.klade.lv/">Janis Skarnelis</a>, ported to WordPress by <a href="http://moskis.net/">Jos&eacute; Pardilla</a>. Licensed under the <a target="_blank" href="http://en.wikipedia.org/wiki/MIT_License">MIT License</a>.', 'mfbfw'); ?></p><br />
82
 
83
+ <h3><?php _e('General Settings', 'mfbfw'); ?></h3>
84
 
85
+ <p><?php _e('Note: Having a cache plugin may prevent changes from taking effect inmidiately, so clear cache after saving changes here or deactivate cache until you finish editing these options.', 'mfbfw'); ?></p><br />
86
 
87
+ <form method="post" action="options.php" id="options">
88
 
89
+ <?php echo wp_nonce_field('update-options', 'mfbfw'); ?>
90
 
91
  <table class="form-table" style="clear:none;">
92
  <tbody>
213
  <label for="mfbfw_centerOnScroll">
214
  <input type="checkbox" name="mfbfw_centerOnScroll" id="mfbfw_centerOnScroll"<?php if (get_option('mfbfw_centerOnScroll') == 'on') echo ' checked="yes"';?> />
215
  <?php _e('Keep image in the center of the browser window when scrolling (default: on)', 'mfbfw'); ?>
216
+ </label><br /><br /><br />
217
+
218
+ </fieldset>
219
+ </td>
220
+ </tr>
221
+
222
+ </tbody>
223
+ </table>
224
+
225
+ <h3><?php _e('Troubleshooting Settings', 'mfbfw'); ?></h3>
226
+
227
+ <p><?php _e('The following settings should only be changed if you are having problems with the plugin!', 'mfbfw'); ?></p>
228
+
229
+ <p><?php _e('Change them one at a time and test to see if they help. Remember that having a cache plugin may prevent changes from taking effect immidiately, so clear cache after saving changes here or deactivate cache until you finish editing these options.', 'mfbfw'); ?></p><br />
230
+
231
+ <table class="form-table" style="clear:none;">
232
+ <tbody>
233
+
234
+ <tr valign="top">
235
+ <th scope="row"><?php _e('Do not call jQuery', 'mfbfw'); ?></th>
236
+ <td>
237
+ <fieldset>
238
+
239
+ <label for="mfbfw_nojQuery">
240
+ <input type="checkbox" name="mfbfw_nojQuery" id="mfbfw_nojQuery"<?php if (get_option('mfbfw_nojQuery') == 'on') echo ' checked="yes"';?> />
241
+ <?php _e('Skip jQuery call. Use this only if jQuery is being loaded twice (default: off)', 'mfbfw'); ?>
242
+ </label><br />
243
+
244
+ </fieldset>
245
+ </td>
246
+ </tr>
247
+
248
+ <tr valign="top">
249
+ <th scope="row"><?php _e('jQuery "noConflict" Mode', 'mfbfw'); ?></th>
250
+ <td>
251
+ <fieldset>
252
+
253
+ <label for="mfbfw_jQnoConflict">
254
+ <input type="checkbox" name="mfbfw_jQnoConflict" id="mfbfw_jQnoConflict"<?php if (get_option('mfbfw_jQnoConflict') == 'on') echo ' checked="yes"';?> />
255
+ <?php _e('Use jQuery noConflict mode (default: on)', 'mfbfw'); ?>
256
+ </label><br />
257
+ <small><em><?php _e('(Turning this off may cause problems if there are plugins activated that use other js framework like mootools, prototype, scriptaculous, etc.)', 'mfbfw'); ?></em></small><br /><br />
258
 
259
  </fieldset>
260
  </td>
265
 
266
 
267
  <input type="hidden" name="action" value="update" />
268
+ <input type="hidden" name="page_options" value="mfbfw_autoApply,mfbfw_imageScale,mfbfw_zoomOpacity,mfbfw_zoomSpeedIn,mfbfw_zoomSpeedOut,mfbfw_overlayShow,mfbfw_overlayColor,mfbfw_overlayOpacity,mfbfw_hideOnContentClick,mfbfw_centerOnScroll,mfbfw_nojQuery,mfbfw_jQnoConflict" />
269
 
270
+ <p class="submit">
271
+ <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes','mfbfw'); ?>" />
272
+ </p>
273
 
274
  </form>
275
 
fancybox.css CHANGED
@@ -294,6 +294,15 @@ div#fancy_title div {
294
 
295
  div#fancy_title table {
296
  margin: 0 auto;
 
 
 
 
 
 
 
 
 
297
  }
298
 
299
  div#fancy_title table td {
@@ -305,15 +314,18 @@ td#fancy_title_left {
305
  height: 32px;
306
  width: 15px;
307
  background: transparent url(img/fancy_title_left.png) repeat-x;
 
308
  }
309
 
310
  td#fancy_title_main {
311
  height: 32px;
312
  background: transparent url(img/fancy_title_main.png) repeat-x;
 
313
  }
314
 
315
  td#fancy_title_right {
316
  height: 32px;
317
  width: 15px;
318
  background: transparent url(img/fancy_title_right.png) repeat-x;
 
319
  }
294
 
295
  div#fancy_title table {
296
  margin: 0 auto;
297
+ background:transparent;
298
+ border-collapse:separate;
299
+ border: 0;
300
+ width:auto;
301
+ }
302
+
303
+ div#fancy_title tr {
304
+ background:transparent;
305
+ border: 0;
306
  }
307
 
308
  div#fancy_title table td {
314
  height: 32px;
315
  width: 15px;
316
  background: transparent url(img/fancy_title_left.png) repeat-x;
317
+ border: 0;
318
  }
319
 
320
  td#fancy_title_main {
321
  height: 32px;
322
  background: transparent url(img/fancy_title_main.png) repeat-x;
323
+ border: 0;
324
  }
325
 
326
  td#fancy_title_right {
327
  height: 32px;
328
  width: 15px;
329
  background: transparent url(img/fancy_title_right.png) repeat-x;
330
+ border: 0;
331
  }
fancybox.php CHANGED
@@ -3,15 +3,39 @@
3
  Plugin Name: FancyBox for WordPress
4
  Plugin URI: http://blog.moskis.net/downloads/plugins/fancybox-for-wordpress/
5
  Description: Integrates <a href="http://fancy.klade.lv/">FancyBox</a> by <a href="http://klade.lv/">Janis Skarnelis</a> into WordPress. All images on a page are treated as a gallery allowing visitors to use Next and Previous buttons on the FancyBox frontend.
6
- Version: 2.0
7
- Author: Jose Pardilla (Th3 ProphetMan)
8
  Author URI: http://moskis.net/
9
  */
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
  function mfbfw_init() {
13
 
14
- wp_enqueue_script('fancybox', WP_PLUGIN_URL . '/fancybox-for-wordpress/jquery.fancybox-1.2.0.pack.js', array('jquery'), '1.3.2' ); // Load fancybox with jQuery
 
 
 
 
 
 
 
 
15
 
16
  }
17
 
@@ -28,7 +52,7 @@ function mfbfw_do() { ?>
28
 
29
  <script type="text/javascript">
30
 
31
- jQuery.noConflict();
32
 
33
  jQuery(function(){
34
 
3
  Plugin Name: FancyBox for WordPress
4
  Plugin URI: http://blog.moskis.net/downloads/plugins/fancybox-for-wordpress/
5
  Description: Integrates <a href="http://fancy.klade.lv/">FancyBox</a> by <a href="http://klade.lv/">Janis Skarnelis</a> into WordPress. All images on a page are treated as a gallery allowing visitors to use Next and Previous buttons on the FancyBox frontend.
6
+ Version: 2.1
7
+ Author: Jose Pardilla
8
  Author URI: http://moskis.net/
9
  */
10
 
11
+ // If no options set, load defaults
12
+ if (get_option('mfbfw_active_version') !== '2.1') {
13
+ add_option('mfbfw_active_version', '2.1');
14
+ add_option('mfbfw_autoApply', 'on');
15
+ add_option('mfbfw_imageScale', 'on');
16
+ add_option('mfbfw_zoomOpacity', 'on');
17
+ add_option('mfbfw_zoomSpeedIn', '500');
18
+ add_option('mfbfw_zoomSpeedOut', '500');
19
+ add_option('mfbfw_overlayShow', 'on');
20
+ add_option('mfbfw_overlayColor', '#666666');
21
+ add_option('mfbfw_overlayOpacity', '0.3');
22
+ add_option('mfbfw_hideOnContentClick', '');
23
+ add_option('mfbfw_centerOnScroll', 'on');
24
+ add_option('mfbfw_jQnoConflict', 'on');
25
+ }
26
+
27
 
28
  function mfbfw_init() {
29
 
30
+ if (get_option('mfbfw_nojQuery') == 'on') {
31
+
32
+ wp_enqueue_script('fancybox', WP_PLUGIN_URL . '/fancybox-for-wordpress/jquery.fancybox-1.2.0.pack.js'); // Load fancybox without jQuery (for troubleshooting)
33
+
34
+ } else {
35
+
36
+ wp_enqueue_script('fancybox', WP_PLUGIN_URL . '/fancybox-for-wordpress/jquery.fancybox-1.2.0.pack.js', array('jquery'), '1.3.2'); // Load fancybox with jQuery
37
+
38
+ }
39
 
40
  }
41
 
52
 
53
  <script type="text/javascript">
54
 
55
+ <?php if (get_option('mfbfw_jQnoConflict') == 'on') { ?> jQuery.noConflict(); <?php } ?>
56
 
57
  jQuery(function(){
58
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.asmallorange.com/extras/donate/?id=10218
4
  Tags: fancybox, lightbox, jquery, image, gallery
5
  Requires at least: 2.7
6
  Tested up to: 2.7.1
7
- Stable tag: 2.0
8
 
9
  Seamlessly integrates FancyBox into your blog: Upload, activate, and you're done. No further configuration needed. However, you can customize it from the Options Page if you like... :)
10
 
@@ -26,6 +26,12 @@ Finally, i have only tested the plugin in WordPress 2.7, so it's very recomended
26
 
27
  = Changelog =
28
 
 
 
 
 
 
 
29
  2.0 Updates:
30
 
31
  * Brand new Options Page in Admin Panel lets you easely customize many options: fancybox auto apply, image resize to fit, opacity fade while zooming, zoom speed, overlay on/off, overlay color, overlay opacity, close fancybox on image click, keep fancybox centered while scrolling.
4
  Tags: fancybox, lightbox, jquery, image, gallery
5
  Requires at least: 2.7
6
  Tested up to: 2.7.1
7
+ Stable tag: 2.1
8
 
9
  Seamlessly integrates FancyBox into your blog: Upload, activate, and you're done. No further configuration needed. However, you can customize it from the Options Page if you like... :)
10
 
26
 
27
  = Changelog =
28
 
29
+ 2.1 Updtades:
30
+
31
+ * Fixed a major bug in 2.0 that prevented it from working until plugin's options page was visited.
32
+ * Added two options for troubleshooting that might help in some cases if the plugin doesn't work: disable jQuery noConflict and skip jQuery call.
33
+ * Additional fixes to caption CSS: Captions should look better now in Hybrid theme, child themes, and other situations where general table elements are improperly styled.
34
+
35
  2.0 Updates:
36
 
37
  * Brand new Options Page in Admin Panel lets you easely customize many options: fancybox auto apply, image resize to fit, opacity fade while zooming, zoom speed, overlay on/off, overlay color, overlay opacity, close fancybox on image click, keep fancybox centered while scrolling.