Lightbox Gallery - Version 0.4

Version Description

Download this release

Release Info

Developer Hiroaki Miyashita
Plugin Icon wp plugin Lightbox Gallery
Version 0.4
Comparing to
See all releases

Code changes from version 0.3.1 to 0.4

js/jquery.tooltip.css CHANGED
@@ -1,11 +1,9 @@
1
  #tooltip {
2
  position: absolute;
3
  z-index: 3000;
4
- padding: 5px;
5
- opacity: 0.85;
6
- border: 1px solid #000;
7
- background-color: #444;
8
- color: #FFFFFF;
9
- line-height:120%;
10
  }
11
- #tooltip h3, #tooltip div { margin: 0;color: #FFFFFF; }
1
  #tooltip {
2
  position: absolute;
3
  z-index: 3000;
4
+ border: 1px solid #111;
5
+ background-color: #eee;
6
+ padding: 5px;
7
+ opacity: 0.85;
 
 
8
  }
9
+ #tooltip h3, #tooltip div { margin: 0; }
js/jquery.tooltip.js CHANGED
@@ -1,12 +1,12 @@
1
  /*
2
- * jQuery Tooltip plugin 1.2
3
  *
4
  * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
5
  * http://docs.jquery.com/Plugins/Tooltip
6
  *
7
  * Copyright (c) 2006 - 2008 Jörn Zaefferer
8
  *
9
- * jQueryId: jquery.tooltip.js 4569 2008-01-31 19:36:35Z joern.zaefferer jQuery
10
  *
11
  * Dual licensed under the MIT and GPL licenses:
12
  * http://www.opensource.org/licenses/mit-license.php
@@ -32,6 +32,7 @@
32
  blocked: false,
33
  defaults: {
34
  delay: 200,
 
35
  showURL: true,
36
  extraClass: "",
37
  top: 15,
@@ -48,17 +49,18 @@
48
  settings = jQuery.extend({}, jQuery.tooltip.defaults, settings);
49
  createHelper(settings);
50
  return this.each(function() {
51
- jQuery.data(this, "tooltip-settings", settings);
 
52
  // copy tooltip into its own expando and remove the title
53
  this.tooltipText = this.title;
54
  jQuery(this).removeAttr("title");
55
  // also remove alt attribute to prevent default tooltip in IE
56
- jQuery(this).children().removeAttr("alt");
57
- //this.alt = "";
58
  })
59
- .hover(save, hide)
 
60
  .click(hide);
61
- },
62
  fixPNG: IE ? function() {
63
  return this.each(function () {
64
  var image = jQuery(this).css('backgroundImage');
@@ -112,7 +114,7 @@
112
  }
113
 
114
  function settings(element) {
115
- return jQuery.data(element, "tooltip-settings");
116
  }
117
 
118
  // main event handler to start showing tooltips
@@ -154,7 +156,7 @@
154
  var parts = title.split(settings(this).showBody);
155
  helper.title.html(parts.shift()).show();
156
  helper.body.empty();
157
- for(var i = 0, part; part = parts[i]; i++) {
158
  if(i > 0)
159
  helper.body.append("<br/>");
160
  helper.body.append(part);
@@ -184,7 +186,14 @@
184
  // delete timeout and show helper
185
  function show() {
186
  tID = null;
187
- helper.parent.show();
 
 
 
 
 
 
 
188
  update();
189
  }
190
 
@@ -197,6 +206,10 @@
197
  if(jQuery.tooltip.blocked)
198
  return;
199
 
 
 
 
 
200
  // stop updating when tracking is disabled and the tooltip is visible
201
  if ( !track && helper.parent.is(":visible")) {
202
  jQuery(document.body).unbind('mousemove', update)
@@ -213,25 +226,31 @@
213
 
214
  var left = helper.parent[0].offsetLeft;
215
  var top = helper.parent[0].offsetTop;
216
- if(event) {
217
  // position the helper 15 pixel to bottom right, starting from mouse position
218
  left = event.pageX + settings(current).left;
219
  top = event.pageY + settings(current).top;
 
 
 
 
 
220
  helper.parent.css({
221
- left: left + 'px',
222
- top: top + 'px'
 
223
  });
224
  }
225
 
226
  var v = viewport(),
227
  h = helper.parent[0];
228
  // check horizontal position
229
- if(v.x + v.cx < h.offsetLeft + h.offsetWidth) {
230
  left -= h.offsetWidth + 20 + settings(current).left;
231
  helper.parent.css({left: left + 'px'}).addClass("viewport-right");
232
  }
233
  // check vertical position
234
- if(v.y + v.cy < h.offsetTop + h.offsetHeight) {
235
  top -= h.offsetHeight + 20 + settings(current).top;
236
  helper.parent.css({top: top + 'px'}).addClass("viewport-bottom");
237
  }
@@ -256,12 +275,20 @@
256
  // no more current element
257
  current = null;
258
 
259
- helper.parent.hide().removeClass( settings(this).extraClass );
 
 
 
 
 
 
 
 
 
 
260
 
261
  if( settings(this).fixPNG )
262
  helper.parent.unfixPNG();
263
  }
264
 
265
- jQuery.fn.Tooltip = jQuery.fn.tooltip;
266
-
267
  })(jQuery);
1
  /*
2
+ * jQuery Tooltip plugin 1.3
3
  *
4
  * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
5
  * http://docs.jquery.com/Plugins/Tooltip
6
  *
7
  * Copyright (c) 2006 - 2008 Jörn Zaefferer
8
  *
9
+ * jQueryId: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer jQuery
10
  *
11
  * Dual licensed under the MIT and GPL licenses:
12
  * http://www.opensource.org/licenses/mit-license.php
32
  blocked: false,
33
  defaults: {
34
  delay: 200,
35
+ fade: false,
36
  showURL: true,
37
  extraClass: "",
38
  top: 15,
49
  settings = jQuery.extend({}, jQuery.tooltip.defaults, settings);
50
  createHelper(settings);
51
  return this.each(function() {
52
+ jQuery.data(this, "tooltip", settings);
53
+ this.tOpacity = helper.parent.css("opacity");
54
  // copy tooltip into its own expando and remove the title
55
  this.tooltipText = this.title;
56
  jQuery(this).removeAttr("title");
57
  // also remove alt attribute to prevent default tooltip in IE
58
+ this.alt = "";
 
59
  })
60
+ .mouseover(save)
61
+ .mouseout(hide)
62
  .click(hide);
63
+ },
64
  fixPNG: IE ? function() {
65
  return this.each(function () {
66
  var image = jQuery(this).css('backgroundImage');
114
  }
115
 
116
  function settings(element) {
117
+ return jQuery.data(element, "tooltip");
118
  }
119
 
120
  // main event handler to start showing tooltips
156
  var parts = title.split(settings(this).showBody);
157
  helper.title.html(parts.shift()).show();
158
  helper.body.empty();
159
+ for(var i = 0, part; (part = parts[i]); i++) {
160
  if(i > 0)
161
  helper.body.append("<br/>");
162
  helper.body.append(part);
186
  // delete timeout and show helper
187
  function show() {
188
  tID = null;
189
+ if ((!IE || !jQuery.fn.bgiframe) && settings(current).fade) {
190
+ if (helper.parent.is(":animated"))
191
+ helper.parent.stop().show().fadeTo(settings(current).fade, current.tOpacity);
192
+ else
193
+ helper.parent.is(':visible') ? helper.parent.fadeTo(settings(current).fade, current.tOpacity) : helper.parent.fadeIn(settings(current).fade);
194
+ } else {
195
+ helper.parent.show();
196
+ }
197
  update();
198
  }
199
 
206
  if(jQuery.tooltip.blocked)
207
  return;
208
 
209
+ if (event && event.target.tagName == "OPTION") {
210
+ return;
211
+ }
212
+
213
  // stop updating when tracking is disabled and the tooltip is visible
214
  if ( !track && helper.parent.is(":visible")) {
215
  jQuery(document.body).unbind('mousemove', update)
226
 
227
  var left = helper.parent[0].offsetLeft;
228
  var top = helper.parent[0].offsetTop;
229
+ if (event) {
230
  // position the helper 15 pixel to bottom right, starting from mouse position
231
  left = event.pageX + settings(current).left;
232
  top = event.pageY + settings(current).top;
233
+ var right='auto';
234
+ if (settings(current).positionLeft) {
235
+ right = jQuery(window).width() - left;
236
+ left = 'auto';
237
+ }
238
  helper.parent.css({
239
+ left: left,
240
+ right: right,
241
+ top: top
242
  });
243
  }
244
 
245
  var v = viewport(),
246
  h = helper.parent[0];
247
  // check horizontal position
248
+ if (v.x + v.cx < h.offsetLeft + h.offsetWidth) {
249
  left -= h.offsetWidth + 20 + settings(current).left;
250
  helper.parent.css({left: left + 'px'}).addClass("viewport-right");
251
  }
252
  // check vertical position
253
+ if (v.y + v.cy < h.offsetTop + h.offsetHeight) {
254
  top -= h.offsetHeight + 20 + settings(current).top;
255
  helper.parent.css({top: top + 'px'}).addClass("viewport-bottom");
256
  }
275
  // no more current element
276
  current = null;
277
 
278
+ var tsettings = settings(this);
279
+ function complete() {
280
+ helper.parent.removeClass( tsettings.extraClass ).hide().css("opacity", "");
281
+ }
282
+ if ((!IE || !jQuery.fn.bgiframe) && tsettings.fade) {
283
+ if (helper.parent.is(':animated'))
284
+ helper.parent.stop().fadeTo(tsettings.fade, 0, complete);
285
+ else
286
+ helper.parent.stop().fadeOut(tsettings.fade, complete);
287
+ } else
288
+ complete();
289
 
290
  if( settings(this).fixPNG )
291
  helper.parent.unfixPNG();
292
  }
293
 
 
 
294
  })(jQuery);
lightbox-gallery-ja.mo CHANGED
Binary file
lightbox-gallery-ja.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Lightbox Gallery\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2008-07-15 17:15+0900\n"
6
- "PO-Revision-Date: 2008-07-15 17:15+0900\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -16,27 +16,134 @@ msgstr ""
16
  "X-Poedit-Basepath: ../\n"
17
  "X-Poedit-SearchPath-0: lightbox-gallery\n"
18
 
19
- #: lightbox-gallery/lightbox-gallery.php:101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  msgid "camera"
21
  msgstr "機種"
22
 
23
- #: lightbox-gallery/lightbox-gallery.php:103
24
  msgid "aperture"
25
  msgstr "絞り値"
26
 
27
- #: lightbox-gallery/lightbox-gallery.php:105
28
  msgid "focal_length"
29
  msgstr "焦点距離"
30
 
31
- #: lightbox-gallery/lightbox-gallery.php:107
32
  msgid "ISO"
33
  msgstr "ISO"
34
 
35
- #: lightbox-gallery/lightbox-gallery.php:111
36
  msgid "shutter_speed"
37
  msgstr "シャッタースピード"
38
 
39
- #: lightbox-gallery/lightbox-gallery.php:114
40
  msgid "created_timestamp"
41
  msgstr "撮影日時"
42
 
2
  msgstr ""
3
  "Project-Id-Version: Lightbox Gallery\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2009-04-27 20:36+0900\n"
6
+ "PO-Revision-Date: 2009-04-27 20:36+0900\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
16
  "X-Poedit-Basepath: ../\n"
17
  "X-Poedit-SearchPath-0: lightbox-gallery\n"
18
 
19
+ #: lightbox-gallery/lightbox-gallery.php:147
20
+ msgid "Settings"
21
+ msgstr "設定"
22
+
23
+ #: lightbox-gallery/lightbox-gallery.php:155
24
+ #: lightbox-gallery/lightbox-gallery.php:181
25
+ msgid "Lightbox Gallery"
26
+ msgstr "Lightbox Gallery"
27
+
28
+ #: lightbox-gallery/lightbox-gallery.php:169
29
+ msgid "Options updated."
30
+ msgstr "オプションは更新されました。"
31
+
32
+ #: lightbox-gallery/lightbox-gallery.php:173
33
+ msgid "Options deleted."
34
+ msgstr "オプションは削除されました。"
35
+
36
+ #: lightbox-gallery/lightbox-gallery.php:187
37
+ #: lightbox-gallery/lightbox-gallery.php:231
38
+ #: lightbox-gallery/lightbox-gallery.php:247
39
+ msgid "Click to toggle"
40
+ msgstr "クリックで切替"
41
+
42
+ #: lightbox-gallery/lightbox-gallery.php:188
43
+ msgid "Lightbox Gallery Options"
44
+ msgstr "Lightbox Gallery オプション"
45
+
46
+ #: lightbox-gallery/lightbox-gallery.php:194
47
+ msgid "In case that you would like to use the lightbox in certain categories (comma-deliminated)"
48
+ msgstr "特定のカテゴリーでLightboxを使用したい場合(カンマ区切り)"
49
+
50
+ #: lightbox-gallery/lightbox-gallery.php:198
51
+ msgid "In case that you would like to use the lightbox in certain pages (comma-deliminated)"
52
+ msgstr "特定のページでLightboxを使用したい場合(カンマ区切り)"
53
+
54
+ #: lightbox-gallery/lightbox-gallery.php:202
55
+ msgid "In case that you would like to disable to load the lightbox-gallery.css"
56
+ msgstr "lightbox-gallery.cssの読み込みを禁止する場合"
57
+
58
+ #: lightbox-gallery/lightbox-gallery.php:203
59
+ msgid "Do not use the lightbox-gallery.css"
60
+ msgstr "lightbox-gallery.cssを使用しない"
61
+
62
+ #: lightbox-gallery/lightbox-gallery.php:206
63
+ msgid "In case that you would like to disable to load the jquery.lightbox.css"
64
+ msgstr "jquery.lightbox.cssの読み込みを禁止する場合"
65
+
66
+ #: lightbox-gallery/lightbox-gallery.php:207
67
+ msgid "Do not use the jquery.lightbox.css"
68
+ msgstr "jquery.lightbox.cssを使用しない"
69
+
70
+ #: lightbox-gallery/lightbox-gallery.php:210
71
+ msgid "In case that you would like to disable to load the jquery.tooltip.css"
72
+ msgstr "jquery.tooltip.cssの読み込みを禁止する場合"
73
+
74
+ #: lightbox-gallery/lightbox-gallery.php:211
75
+ msgid "Do not use the jquery.tooltip.css"
76
+ msgstr "jquery.tooltip.cssを使用しない"
77
+
78
+ #: lightbox-gallery/lightbox-gallery.php:214
79
+ msgid "In case that you would like to disable to load the column inline css"
80
+ msgstr "コラムのインラインcssの読み込みを禁止する場合"
81
+
82
+ #: lightbox-gallery/lightbox-gallery.php:215
83
+ msgid "Do not use the column inline css"
84
+ msgstr "コラムのインラインcssを使用しない"
85
+
86
+ #: lightbox-gallery/lightbox-gallery.php:218
87
+ msgid "In case that you would like to set the default number of columns"
88
+ msgstr "デフォルトのコラム数をセットする場合"
89
+
90
+ #: lightbox-gallery/lightbox-gallery.php:222
91
+ msgid "Update Options &raquo;"
92
+ msgstr "オプションを更新する &raquo;"
93
+
94
+ #: lightbox-gallery/lightbox-gallery.php:232
95
+ msgid "Delete Options"
96
+ msgstr "オプションを削除する"
97
+
98
+ #: lightbox-gallery/lightbox-gallery.php:234
99
+ msgid "Are you sure to delete options? Options you set will be deleted."
100
+ msgstr "本当にオプションを削除しますか?設定したオプションは削除されます。"
101
+
102
+ #: lightbox-gallery/lightbox-gallery.php:238
103
+ msgid "Delete Options &raquo;"
104
+ msgstr "オプションを削除する &raquo;"
105
+
106
+ #: lightbox-gallery/lightbox-gallery.php:248
107
+ msgid "Donation"
108
+ msgstr "寄付"
109
+
110
+ #: lightbox-gallery/lightbox-gallery.php:250
111
+ msgid "If you liked this plugin, please make a donation via paypal! Any amount is welcome. Your support is much appreciated."
112
+ msgstr "このプラグインをお気に召しましたら、Paypalよりご寄付をよろしくお願いいたします。"
113
+
114
+ #: lightbox-gallery/lightbox-gallery.php:324
115
+ msgid "Pages:"
116
+ msgstr "ページ:"
117
+
118
+ #: lightbox-gallery/lightbox-gallery.php:326
119
+ msgid "Next page"
120
+ msgstr "次のページ"
121
+
122
+ #: lightbox-gallery/lightbox-gallery.php:327
123
+ msgid "Previous page"
124
+ msgstr "前のページ"
125
+
126
+ #: lightbox-gallery/lightbox-gallery.php:379
127
  msgid "camera"
128
  msgstr "機種"
129
 
130
+ #: lightbox-gallery/lightbox-gallery.php:381
131
  msgid "aperture"
132
  msgstr "絞り値"
133
 
134
+ #: lightbox-gallery/lightbox-gallery.php:383
135
  msgid "focal_length"
136
  msgstr "焦点距離"
137
 
138
+ #: lightbox-gallery/lightbox-gallery.php:385
139
  msgid "ISO"
140
  msgstr "ISO"
141
 
142
+ #: lightbox-gallery/lightbox-gallery.php:389
143
  msgid "shutter_speed"
144
  msgstr "シャッタースピード"
145
 
146
+ #: lightbox-gallery/lightbox-gallery.php:392
147
  msgid "created_timestamp"
148
  msgstr "撮影日時"
149
 
lightbox-gallery.js CHANGED
@@ -9,7 +9,7 @@ jQuery(document).ready(function () {
9
 
10
  jQuery('a[@rel*=lightbox]').lightBox();
11
  jQuery('.gallery1 a').lightBox({captionPosition:'gallery'});
12
- jQuery('.gallery1 a').Tooltip({track:true, delay:0, showURL: false});
13
 
14
  // Add these lines if you want to handle multiple galleries in one page.
15
  // You need to add into a [gallery] shorttag. ex) [gallery class="gallery2"]
9
 
10
  jQuery('a[@rel*=lightbox]').lightBox();
11
  jQuery('.gallery1 a').lightBox({captionPosition:'gallery'});
12
+ jQuery('.gallery1 a').tooltip({track:true, delay:0, showURL: false});
13
 
14
  // Add these lines if you want to handle multiple galleries in one page.
15
  // You need to add into a [gallery] shorttag. ex) [gallery class="gallery2"]
lightbox-gallery.php CHANGED
@@ -4,69 +4,287 @@ Plugin Name: Lightbox Gallery
4
  Plugin URI: http://wordpressgogo.com/development/lightbox-gallery.html
5
  Description: Changes to the lightbox view in galleries.
6
  Author: Hiroaki Miyashita
7
- Version: 0.3.1
8
  Author URI: http://wordpressgogo.com/
9
  */
10
 
11
- add_action('init', 'lightbox_gallery_textdomain');
 
 
 
 
 
 
12
  function lightbox_gallery_textdomain() {
13
- load_plugin_textdomain('lightbox-gallery', 'wp-content/plugins/lightbox-gallery');
 
 
 
 
 
 
14
  }
15
 
16
- add_action('wp_head', 'add_lightbox_gallery_head',1);
17
- add_action('wp_print_scripts', 'add_lightbox_gallery_jquery',1);
18
-
19
  function add_lightbox_gallery_head() {
20
  global $wp_query;
 
21
 
 
 
 
 
 
22
  $flag = false;
23
- if($wp_query->posts) {
24
- for($i=0;$i<count($wp_query->posts);$i++) {
25
- if ( preg_match('/\[gallery([^\]]+)?\]/', $wp_query->posts[$i]->post_content) || preg_match('/<a\s.*?rel\s*=\s*(?:"|\')?lightbox(?:"|\')?[^>]*>/',$wp_query->posts[$i]->post_content) ) {
 
 
 
 
 
 
 
26
  $flag = true;
27
  break;
28
- }
29
- }
30
- }
31
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  if ( !is_admin() && $flag ) {
33
- if (@file_exists(TEMPLATEPATH.'/lightbox-gallery.css')) {
34
- echo '<link rel="stylesheet" href="'.get_stylesheet_directory_uri().'/lightbox-gallery.css" type="text/css" />'."\n";
35
- } else {
36
- echo '<link rel="stylesheet" type="text/css" href="' . get_settings('siteurl') . '/wp-content/plugins/lightbox-gallery/lightbox-gallery.css" />'."\n";
37
- }
38
- echo '<link rel="stylesheet" type="text/css" href="' . get_settings('siteurl') . '/wp-content/plugins/lightbox-gallery/js/jquery.lightbox.css" />'."\n";
39
- echo '<link rel="stylesheet" type="text/css" href="' . get_settings('siteurl') . '/wp-content/plugins/lightbox-gallery/js/jquery.tooltip.css" />'."\n";
 
 
 
 
 
 
40
  }
41
  }
42
 
43
  function add_lightbox_gallery_jquery() {
44
  global $wp_query;
 
 
 
 
 
 
45
 
46
  $flag = false;
47
- if($wp_query->posts) {
48
- for($i=0;$i<count($wp_query->posts);$i++) {
49
- if ( preg_match('/\[gallery([^\]]+)?\]/', $wp_query->posts[$i]->post_content) || preg_match('/<a\s.*?rel\s*=\s*(?:"|\')?lightbox(?:"|\')?[^>]*>/',$wp_query->posts[$i]->post_content) ) {
 
 
 
 
 
 
 
50
  $flag = true;
51
  break;
52
- }
53
- }
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  if ( !is_admin() && $flag ) {
57
  wp_enqueue_script( 'jquery');
58
- wp_enqueue_script('dimensions', '/wp-content/plugins/lightbox-gallery/js/jquery.dimensions.js', array('jquery'));
59
- wp_enqueue_script('bgtiframe', '/wp-content/plugins/lightbox-gallery/js/jquery.bgiframe.js', array('jquery'));
60
- wp_enqueue_script('lightbox', '/wp-content/plugins/lightbox-gallery/js/jquery.lightbox.js', array('jquery'));
61
- wp_enqueue_script('tooltip', '/wp-content/plugins/lightbox-gallery/js/jquery.tooltip.js', array('jquery'));
62
- wp_enqueue_script('lightbox-gallery', '/wp-content/plugins/lightbox-gallery/lightbox-gallery.js', array('jquery'));
 
 
 
 
 
 
 
 
 
 
 
63
  }
 
 
 
 
 
 
64
  }
65
 
66
- add_shortcode('gallery', 'lightbox_gallery');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
  function lightbox_gallery($attr) {
69
- global $post;
 
70
 
71
  // Allow plugins/themes to override the default gallery template.
72
  $output = apply_filters('post_gallery', '', $attr);
@@ -83,6 +301,9 @@ function lightbox_gallery($attr) {
83
  if ( !isset( $attr['orderby'] ) && get_bloginfo('version')<2.6 ) {
84
  $attr['orderby'] = 'menu_order ASC, ID ASC';
85
  }
 
 
 
86
 
87
  extract(shortcode_atts(array(
88
  'order' => 'ASC',
@@ -91,12 +312,19 @@ function lightbox_gallery($attr) {
91
  'itemtag' => 'dl',
92
  'icontag' => 'dt',
93
  'captiontag' => 'dd',
94
- 'columns' => 3,
95
  'size' => 'thumbnail',
96
  'lightboxsize' => 'medium',
97
  'meta' => 'false',
98
  'class' => 'gallery1',
99
- 'nofollow' => false
 
 
 
 
 
 
 
100
  ), $attr));
101
 
102
  $id = intval($id);
@@ -104,7 +332,18 @@ function lightbox_gallery($attr) {
104
 
105
  if ( empty($attachments) )
106
  return '';
107
-
 
 
 
 
 
 
 
 
 
 
 
108
  if ( is_feed() ) {
109
  $output = "\n";
110
  foreach ( $attachments as $id => $attachment )
@@ -118,11 +357,13 @@ function lightbox_gallery($attr) {
118
  $columns = intval($columns);
119
  $itemwidth = $columns > 0 ? floor(100/$columns) : 100;
120
 
121
- $output = apply_filters('gallery_style', "
122
- <style type='text/css'>
123
  .gallery-item {width: {$itemwidth}%;}
124
- </style>
125
- <div class='gallery {$class}'>");
 
 
126
 
127
  foreach ( $attachments as $id => $attachment ) {
128
  if ( $attachment->post_type == 'attachment' ) {
@@ -170,13 +411,92 @@ function lightbox_gallery($attr) {
170
  $output .= '<div style="clear: both"></div>';
171
  }
172
  }
173
-
174
- $output .= '
175
- <div style="clear: both"></div>
176
- </div>';
177
 
178
  return $output;
179
  }
180
 
 
 
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  ?>
4
  Plugin URI: http://wordpressgogo.com/development/lightbox-gallery.html
5
  Description: Changes to the lightbox view in galleries.
6
  Author: Hiroaki Miyashita
7
+ Version: 0.4
8
  Author URI: http://wordpressgogo.com/
9
  */
10
 
11
+ add_action( 'init', 'lightbox_gallery_textdomain' );
12
+ add_action( 'wp_head', 'add_lightbox_gallery_head' );
13
+ add_action( 'wp_print_scripts', 'add_lightbox_gallery_jquery' );
14
+ add_filter( 'plugin_action_links', 'lightbox_gallery_plugin_action_links', 10, 2 );
15
+ add_action( 'admin_menu', 'lightbox_gallery_admin_menu' );
16
+ add_shortcode( 'gallery', 'lightbox_gallery' );
17
+
18
  function lightbox_gallery_textdomain() {
19
+ if ( function_exists('load_plugin_textdomain') ) {
20
+ if ( !defined('WP_PLUGIN_DIR') ) {
21
+ load_plugin_textdomain('lightbox-gallery', str_replace( ABSPATH, '', dirname(__FILE__) ) );
22
+ } else {
23
+ load_plugin_textdomain('lightbox-gallery', false, dirname( plugin_basename(__FILE__) ) );
24
+ }
25
+ }
26
  }
27
 
 
 
 
28
  function add_lightbox_gallery_head() {
29
  global $wp_query;
30
+ $options = get_option('lightbox_gallery_data');
31
 
32
+ if ( !defined('WP_PLUGIN_DIR') )
33
+ $plugin_dir = str_replace( ABSPATH, '', dirname(__FILE__) );
34
+ else
35
+ $plugin_dir = dirname( plugin_basename(__FILE__) );
36
+
37
  $flag = false;
38
+
39
+ if ( $options['global_settings']['lightbox_gallery_categories'] && (is_category() || is_single() ) ) :
40
+ $categories = get_the_category();
41
+ $cats = array();
42
+ foreach( $categories as $val ) :
43
+ $cats[] = $val->cat_ID;
44
+ endforeach;
45
+ $needle = explode(',', $options['global_settings']['lightbox_gallery_categories']);
46
+ foreach ( $needle as $val ) :
47
+ if ( in_array($val, $cats ) ) :
48
  $flag = true;
49
  break;
50
+ endif;
51
+ endforeach;
52
+ elseif ( $options['global_settings']['lightbox_gallery_pages'] && is_page() ) :
53
+ $needle = explode(',', $options['global_settings']['lightbox_gallery_pages']);
54
+ foreach ( $needle as $val ) :
55
+ if ( trim($val) == $wp_query->queried_object_id ) :
56
+ $flag = true;
57
+ break;
58
+ endif;
59
+ endforeach;
60
+ else :
61
+ if ( $wp_query->posts ) :
62
+ for($i=0;$i<count($wp_query->posts);$i++) :
63
+ if ( preg_match('/\[gallery([^\]]+)?\]/', $wp_query->posts[$i]->post_content) || preg_match('/<a\s.*?rel\s*=\s*(?:"|\')?lightbox(?:"|\')?[^>]*>/',$wp_query->posts[$i]->post_content) ) :
64
+ $flag = true;
65
+ break;
66
+ endif;
67
+ endfor;
68
+ endif;
69
+ endif;
70
+
71
  if ( !is_admin() && $flag ) {
72
+ if ( !$options['global_settings']['lightbox_gallery_disable_lightbox_gallery_css'] ) :
73
+ if (@file_exists(TEMPLATEPATH.'/lightbox-gallery.css')) {
74
+ echo '<link rel="stylesheet" href="'.get_stylesheet_directory_uri().'/lightbox-gallery.css" type="text/css" />'."\n";
75
+ } else {
76
+ echo '<link rel="stylesheet" type="text/css" href="' . get_settings('siteurl') . '/' . PLUGINDIR . '/' . $plugin_dir . '/lightbox-gallery.css" />'."\n";
77
+ }
78
+ endif;
79
+ if ( !$options['global_settings']['lightbox_gallery_disable_lightbox_css'] ) :
80
+ echo '<link rel="stylesheet" type="text/css" href="' . get_settings('siteurl') . '/' . PLUGINDIR . '/' . $plugin_dir . '/js/jquery.lightbox.css" />'."\n";
81
+ endif;
82
+ if ( !$options['global_settings']['lightbox_gallery_disable_tooltip_css'] ) :
83
+ echo '<link rel="stylesheet" type="text/css" href="' . get_settings('siteurl') . '/' . PLUGINDIR . '/' . $plugin_dir . '/js/jquery.tooltip.css" />'."\n";
84
+ endif;
85
  }
86
  }
87
 
88
  function add_lightbox_gallery_jquery() {
89
  global $wp_query;
90
+ $options = get_option('lightbox_gallery_data');
91
+
92
+ if ( !defined('WP_PLUGIN_DIR') )
93
+ $plugin_dir = str_replace( ABSPATH, '', dirname(__FILE__) );
94
+ else
95
+ $plugin_dir = dirname( plugin_basename(__FILE__) );
96
 
97
  $flag = false;
98
+
99
+ if ( $options['global_settings']['lightbox_gallery_categories'] && (is_category() || is_single() ) ) :
100
+ $categories = get_the_category();
101
+ $cats = array();
102
+ foreach( $categories as $val ) :
103
+ $cats[] = $val->cat_ID;
104
+ endforeach;
105
+ $needle = explode(',', $options['global_settings']['lightbox_gallery_categories']);
106
+ foreach ( $needle as $val ) :
107
+ if ( in_array($val, $cats ) ) :
108
  $flag = true;
109
  break;
110
+ endif;
111
+ endforeach;
112
+ elseif ( $options['global_settings']['lightbox_gallery_pages'] && (is_page() ) ) :
113
+ $needle = explode(',', $options['global_settings']['lightbox_gallery_pages']);
114
+ foreach ( $needle as $val ) :
115
+ if ( trim($val) == $wp_query->queried_object_id ) :
116
+ $flag = true;
117
+ break;
118
+ endif;
119
+ endforeach;
120
+ else :
121
+ if ( $wp_query->posts ) :
122
+ for($i=0;$i<count($wp_query->posts);$i++) :
123
+ if ( preg_match('/\[gallery([^\]]+)?\]/', $wp_query->posts[$i]->post_content) || preg_match('/<a\s.*?rel\s*=\s*(?:"|\')?lightbox(?:"|\')?[^>]*>/',$wp_query->posts[$i]->post_content) ) :
124
+ $flag = true;
125
+ break;
126
+ endif;
127
+ endfor;
128
+ endif;
129
+ endif;
130
 
131
  if ( !is_admin() && $flag ) {
132
  wp_enqueue_script( 'jquery');
133
+ wp_enqueue_script( 'dimensions', '/' . PLUGINDIR . '/' . $plugin_dir . '/js/jquery.dimensions.js', array('jquery') );
134
+ wp_enqueue_script( 'bgtiframe', '/' . PLUGINDIR . '/' . $plugin_dir . '/js/jquery.bgiframe.js', array('jquery') ) ;
135
+ wp_enqueue_script( 'lightbox', '/' . PLUGINDIR . '/' . $plugin_dir . '/js/jquery.lightbox.js', array('jquery') );
136
+ wp_enqueue_script( 'tooltip', '/' . PLUGINDIR . '/' . $plugin_dir . '/js/jquery.tooltip.js', array('jquery') );
137
+ wp_enqueue_script( 'lightbox-gallery', '/' . PLUGINDIR . '/' . $plugin_dir . '/lightbox-gallery.js', array('jquery') );
138
+ }
139
+ }
140
+
141
+ function lightbox_gallery_plugin_action_links($links, $file){
142
+ static $this_plugin;
143
+
144
+ if( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);
145
+
146
+ if( $file == $this_plugin ){
147
+ $settings_link = '<a href="options-general.php?page=lightbox-gallery.php">' . __('Settings') . '</a>';
148
+ $links = array_merge( array($settings_link), $links);
149
  }
150
+ return $links;
151
+ }
152
+
153
+
154
+ function lightbox_gallery_admin_menu() {
155
+ add_options_page(__('Lightbox Gallery', 'lightbox-gallery'), __('Lightbox Gallery', 'lightbox-gallery'), 8, basename(__FILE__), 'lightbox_gallery_admin');
156
  }
157
 
158
+ function lightbox_gallery_admin() {
159
+ $options = get_option('lightbox_gallery_data');
160
+ if($_POST["lightbox_gallery_global_settings_submit"]) :
161
+ unset($options['global_settings']);
162
+ foreach($_POST as $key => $val) :
163
+ if($key != "lightbox_gallery_global_settings_submit") :
164
+ if ( is_array($val) ) $options['global_settings'][$key] = $val;
165
+ else $options['global_settings'][$key] = stripslashes($val);
166
+ endif;
167
+ endforeach;
168
+ update_option('lightbox_gallery_data', $options);
169
+ $message = __('Options updated.', 'lightbox_gallery');
170
+ elseif ($_POST['lightbox_gallery_delete_options_submit']) :
171
+ delete_option('lightbox_gallery_data');
172
+ $options = get_option('lightbox_gallery_data');
173
+ $message = __('Options deleted.', 'lightbox_gallery');
174
+ endif;
175
+ ?>
176
+ <?php if ($message) : ?>
177
+ <div id="message" class="updated"><p><?php echo $message; ?></p></div>
178
+ <?php endif; ?>
179
+ <div class="wrap">
180
+ <div id="icon-plugins" class="icon32"><br/></div>
181
+ <h2><?php _e('Lightbox Gallery', 'lightbox-gallery'); ?></h2>
182
+
183
+ <br class="clear"/>
184
+
185
+ <div id="poststuff" class="meta-box-sortables" style="position: relative; margin-top:10px;">
186
+ <div class="postbox">
187
+ <div class="handlediv" title="<?php _e('Click to toggle', 'lightbox-gallery'); ?>"><br /></div>
188
+ <h3><?php _e('Lightbox Gallery Options', 'lightbox-gallery'); ?></h3>
189
+ <div class="inside">
190
+ <form method="post">
191
+ <table class="form-table" style="margin-bottom:5px;">
192
+ <tbody>
193
+ <tr><td>
194
+ <p><label for="lightbox_gallery_categories"><?php _e('In case that you would like to use the lightbox in certain categories (comma-deliminated)', 'lightbox-gallery'); ?></label>:<br />
195
+ <input type="text" name="lightbox_gallery_categories" id="lightbox_gallery_categories" value="<?php echo $options['global_settings']['lightbox_gallery_categories']; ?>" /></p>
196
+ </td></tr>
197
+ <tr><td>
198
+ <p><label for="lightbox_gallery_pages"><?php _e('In case that you would like to use the lightbox in certain pages (comma-deliminated)', 'lightbox-gallery'); ?></label>:<br />
199
+ <input type="text" name="lightbox_gallery_pages" id="lightbox_gallery_pages" value="<?php echo $options['global_settings']['lightbox_gallery_pages']; ?>" /></p>
200
+ </td></tr>
201
+ <tr><td>
202
+ <p><label for="lightbox_gallery_disable_lightbox_gallery_css"><?php _e('In case that you would like to disable to load the lightbox-gallery.css', 'lightbox-gallery'); ?></label>:<br />
203
+ <input type="checkbox" name="lightbox_gallery_disable_lightbox_gallery_css" id="lightbox_gallery_disable_lightbox_gallery_css" value="1" <?php if ($options['global_settings']['lightbox_gallery_disable_lightbox_gallery_css']) { echo 'checked="checked"'; } ?> /> <?php _e('Do not use the lightbox-gallery.css', 'lightbox-gallery'); ?></p>
204
+ </td></tr>
205
+ <tr><td>
206
+ <p><label for="lightbox_gallery_disable_lightbox_css"><?php _e('In case that you would like to disable to load the jquery.lightbox.css', 'lightbox-gallery'); ?></label>:<br />
207
+ <input type="checkbox" name="lightbox_gallery_disable_lightbox_css" id="lightbox_gallery_disable_lightbox_css" value="1" <?php if ($options['global_settings']['lightbox_gallery_disable_lightbox_css']) { echo 'checked="checked"'; } ?> /> <?php _e('Do not use the jquery.lightbox.css', 'lightbox-gallery'); ?></p>
208
+ </td></tr>
209
+ <tr><td>
210
+ <p><label for="lightbox_gallery_disable_tooltip_css"><?php _e('In case that you would like to disable to load the jquery.tooltip.css', 'lightbox-gallery'); ?></label>:<br />
211
+ <input type="checkbox" name="lightbox_gallery_disable_tooltip_css" id="lightbox_gallery_disable_tooltip_css" value="1" <?php if ($options['global_settings']['lightbox_gallery_disable_tooltip_css']) { echo 'checked="checked"'; } ?> /> <?php _e('Do not use the jquery.tooltip.css', 'lightbox-gallery'); ?></p>
212
+ </td></tr>
213
+ <tr><td>
214
+ <p><label for="lightbox_gallery_disable_column_css"><?php _e('In case that you would like to disable to load the column inline css', 'lightbox-gallery'); ?></label>:<br />
215
+ <input type="checkbox" name="lightbox_gallery_disable_column_css" id="lightbox_gallery_disable_column_css" value="1" <?php if ($options['global_settings']['lightbox_gallery_disable_column_css']) { echo 'checked="checked"'; } ?> /> <?php _e('Do not use the column inline css', 'lightbox-gallery'); ?></p>
216
+ </td></tr>
217
+ <tr><td>
218
+ <p><label for="lightbox_gallery_columns"><?php _e('In case that you would like to set the default number of columns', 'lightbox-gallery'); ?></label>:<br />
219
+ <input type="text" name="lightbox_gallery_columns" id="lightbox_gallery_columns" value="<?php echo $options['global_settings']['lightbox_gallery_columns']; ?>" size="3" /></p>
220
+ </td></tr>
221
+ <tr><td>
222
+ <p><input type="submit" name="lightbox_gallery_global_settings_submit" value="<?php _e('Update Options &raquo;', 'lightbox-gallery'); ?>" class="button-primary" /></p>
223
+ </td></tr>
224
+ </tbody>
225
+ </table>
226
+ </form>
227
+ </div>
228
+ </div>
229
+
230
+ <div class="postbox closed">
231
+ <div class="handlediv" title="<?php _e('Click to toggle', 'lightbox-gallery'); ?>"><br /></div>
232
+ <h3><?php _e('Delete Options', 'lightbox-gallery'); ?></h3>
233
+ <div class="inside">
234
+ <form method="post" onsubmit="return confirm('<?php _e('Are you sure to delete options? Options you set will be deleted.', 'lightbox-gallery'); ?>');">
235
+ <table class="form-table" style="margin-bottom:5px;">
236
+ <tbody>
237
+ <tr><td>
238
+ <p><input type="submit" name="lightbox_gallery_delete_options_submit" value="<?php _e('Delete Options &raquo;', 'lightbox-gallery'); ?>" class="button-primary" /></p>
239
+ </td></tr>
240
+ </tbody>
241
+ </table>
242
+ </form>
243
+ </div>
244
+ </div>
245
+
246
+ <div class="postbox closed">
247
+ <div class="handlediv" title="<?php _e('Click to toggle', 'lightbox-gallery'); ?>"><br /></div>
248
+ <h3><?php _e('Donation', 'lightbox-gallery'); ?></h3>
249
+ <div class="inside">
250
+ <p><?php _e('If you liked this plugin, please make a donation via paypal! Any amount is welcome. Your support is much appreciated.', 'lightbox-gallery'); ?></p>
251
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
252
+ <table class="form-table" style="margin-bottom:5px;">
253
+ <tbody>
254
+ <tr><td>
255
+ <input type="hidden" name="cmd" value="_s-xclick" />
256
+ <input type="hidden" name="hosted_button_id" value="100156" />
257
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG_global.gif" border="0" name="submit" alt="" style="border:0;" />
258
+ <img alt="" border="0" src="https://www.paypal.com/ja_JP/i/scr/pixel.gif" width="1" height="1" />
259
+ </td></tr>
260
+ </tbody>
261
+ </table>
262
+ </form>
263
+ </div>
264
+ </div>
265
+ </div>
266
+
267
+
268
+ <script type="text/javascript">
269
+ // <![CDATA[
270
+ <?php if ( version_compare( substr($wp_version, 0, 3), '2.7', '<' ) ) { ?>
271
+ jQuery('.postbox h3').prepend('<a class="togbox">+</a> ');
272
+ <?php } ?>
273
+ jQuery('.postbox div.handlediv').click( function() { jQuery(jQuery(this).parent().get(0)).toggleClass('closed'); } );
274
+ jQuery('.postbox h3').click( function() { jQuery(jQuery(this).parent().get(0)).toggleClass('closed'); } );
275
+ jQuery('.postbox.close-me').each(function(){
276
+ jQuery(this).addClass("closed");
277
+ });
278
+ //-->
279
+ </script>
280
+
281
+ </div>
282
+ <?php
283
+ }
284
 
285
  function lightbox_gallery($attr) {
286
+ global $post, $wp_query;
287
+ $options = get_option('lightbox_gallery_data');
288
 
289
  // Allow plugins/themes to override the default gallery template.
290
  $output = apply_filters('post_gallery', '', $attr);
301
  if ( !isset( $attr['orderby'] ) && get_bloginfo('version')<2.6 ) {
302
  $attr['orderby'] = 'menu_order ASC, ID ASC';
303
  }
304
+
305
+ if ( is_numeric($options['global_settings']['lightbox_gallery_columns']) ) $columns = $options['global_settings']['lightbox_gallery_columns'];
306
+ else $columns = 3;
307
 
308
  extract(shortcode_atts(array(
309
  'order' => 'ASC',
312
  'itemtag' => 'dl',
313
  'icontag' => 'dt',
314
  'captiontag' => 'dd',
315
+ 'columns' => $columns,
316
  'size' => 'thumbnail',
317
  'lightboxsize' => 'medium',
318
  'meta' => 'false',
319
  'class' => 'gallery1',
320
+ 'nofollow' => false,
321
+ 'from' => '',
322
+ 'num' => '',
323
+ 'page' => $wp_query->query_vars['page'],
324
+ 'before' => '<div class="gallery_pagenavi">' . __('Pages:'), 'after' => '</div>',
325
+ 'link_before' => '', 'link_after' => '',
326
+ 'next_or_number' => 'number', 'nextpagelink' => __('Next page'),
327
+ 'previouspagelink' => __('Previous page'), 'pagelink' => '%', 'pagenavi' => 1
328
  ), $attr));
329
 
330
  $id = intval($id);
332
 
333
  if ( empty($attachments) )
334
  return '';
335
+
336
+ $total = count($attachments)-$from;
337
+
338
+ if ( !$page ) $page = 1;
339
+
340
+ if ( is_numeric($from) && !$num ) :
341
+ $attachments = array_splice($attachments, $from);
342
+ elseif ( is_numeric($page) && is_numeric($num) ) :
343
+ $numpages = (int)($total/$num)+1;
344
+ $attachments = array_splice($attachments, ($page-1)*$num+$from, $num);
345
+ endif;
346
+
347
  if ( is_feed() ) {
348
  $output = "\n";
349
  foreach ( $attachments as $id => $attachment )
357
  $columns = intval($columns);
358
  $itemwidth = $columns > 0 ? floor(100/$columns) : 100;
359
 
360
+ if ( !$options['global_settings']['lightbox_gallery_disable_column_css'] ) :
361
+ $column_css = "<style type='text/css'>
362
  .gallery-item {width: {$itemwidth}%;}
363
+ </style>";
364
+ endif;
365
+
366
+ $output = apply_filters('gallery_style', $column_css."<div class='gallery {$class}'>");
367
 
368
  foreach ( $attachments as $id => $attachment ) {
369
  if ( $attachment->post_type == 'attachment' ) {
411
  $output .= '<div style="clear: both"></div>';
412
  }
413
  }
414
+
415
+ $output .= '<div style="clear: both"></div></div>';
416
+ $output .= wp_link_pages_for_lightbox_gallery(array('before' => $before, 'after' => $after, 'link_before' => $link_before, 'link_after' => $link_after, 'next_or_number' => $next_or_number, 'nextpagelink' => $nextpagelink, 'previouspagelink' => $previouspagelink, 'pagelink' => $pagelink, 'page' => $page, 'numpages' => $numpages, 'pagenavi' => $pagenavi));
 
417
 
418
  return $output;
419
  }
420
 
421
+ function wp_link_pages_for_lightbox_gallery($args = '') {
422
+ global $post;
423
 
424
+ $defaults = array(
425
+ 'echo' => 0, 'page' => 1, 'numpages' => 1
426
+ );
427
+
428
+ $r = wp_parse_args( $args, $defaults );
429
+ extract( $r, EXTR_SKIP );
430
+
431
+ if ( !$pagenavi ) return;
432
+
433
+ if ( $numpages > $page ) $more = 1;
434
+
435
+ $output = '';
436
+ if ( $numpages > 1 ) {
437
+ if ( 'number' == $next_or_number ) {
438
+ $output .= $before;
439
+ for ( $i = 1; $i < ($numpages+1); $i = $i + 1 ) {
440
+ $j = str_replace('%',"$i",$pagelink);
441
+ $output .= ' ';
442
+ if ( ($i != $page) || ((!$more) && ($page==1)) ) {
443
+ if ( 1 == $i ) {
444
+ $output .= '<a href="' . get_permalink() . '">';
445
+ } else {
446
+ if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
447
+ $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">';
448
+ else
449
+ $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">';
450
+ }
451
+ } else {
452
+ $output .= '<span class="current">';
453
+ }
454
+ $output .= $link_before;
455
+ $output .= $j;
456
+ $output .= $link_after;
457
+ if ( ($i != $page) || ((!$more) && ($page==1)) )
458
+ $output .= '</a>';
459
+ else
460
+ $output .= '</span>';
461
+ }
462
+ $output .= $after;
463
+ } else {
464
+ if ( $more ) {
465
+ $output .= $before;
466
+ $i = $page - 1;
467
+ if ( $i && $more ) {
468
+ $output .= '<span id="gallery_prev">';
469
+ if ( 1 == $i ) {
470
+ $output .= '<a href="' . get_permalink() . '">' . $link_before. $previouspagelink . $link_after . '</a>';
471
+ } else {
472
+ if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
473
+ $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $link_before. $previouspagelink . $link_after . '</a>';
474
+ else
475
+ $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $link_before. $previouspagelink . $link_after . '</a>';
476
+ }
477
+ $output .= '</span>';
478
+ }
479
+ $i = $page + 1;
480
+ if ( $i <= $numpages && $more ) {
481
+ $output .= '<span id="gallery_next">';
482
+ if ( 1 == $i ) {
483
+ $output .= '<a href="' . get_permalink() . '">' . $link_before. $nextpagelink . $link_after . '</a>';
484
+ } else {
485
+ if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
486
+ $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $link_before. $nextpagelink . $link_after . '</a>';
487
+ else
488
+ $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $link_before. $nextpagelink . $link_after . '</a>';
489
+ }
490
+ $output .= '</span>';
491
+ }
492
+ $output .= $after;
493
+ }
494
+ }
495
+ }
496
+
497
+ if ( $echo )
498
+ echo $output;
499
+
500
+ return $output;
501
+ }
502
  ?>
lightbox-gallery.pot CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Lightbox Gallery\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2008-07-15 17:15+0900\n"
6
- "PO-Revision-Date: 2008-07-15 17:15+0900\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -13,27 +13,134 @@ msgstr ""
13
  "X-Poedit-Basepath: ../\n"
14
  "X-Poedit-SearchPath-0: lightbox-gallery\n"
15
 
16
- #: lightbox-gallery/lightbox-gallery.php:101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  msgid "camera"
18
  msgstr ""
19
 
20
- #: lightbox-gallery/lightbox-gallery.php:103
21
  msgid "aperture"
22
  msgstr ""
23
 
24
- #: lightbox-gallery/lightbox-gallery.php:105
25
  msgid "focal_length"
26
  msgstr ""
27
 
28
- #: lightbox-gallery/lightbox-gallery.php:107
29
  msgid "ISO"
30
  msgstr ""
31
 
32
- #: lightbox-gallery/lightbox-gallery.php:111
33
  msgid "shutter_speed"
34
  msgstr ""
35
 
36
- #: lightbox-gallery/lightbox-gallery.php:114
37
  msgid "created_timestamp"
38
  msgstr ""
39
 
2
  msgstr ""
3
  "Project-Id-Version: Lightbox Gallery\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2009-04-27 20:36+0900\n"
6
+ "PO-Revision-Date: 2009-04-27 20:36+0900\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
13
  "X-Poedit-Basepath: ../\n"
14
  "X-Poedit-SearchPath-0: lightbox-gallery\n"
15
 
16
+ #: lightbox-gallery/lightbox-gallery.php:147
17
+ msgid "Settings"
18
+ msgstr ""
19
+
20
+ #: lightbox-gallery/lightbox-gallery.php:155
21
+ #: lightbox-gallery/lightbox-gallery.php:181
22
+ msgid "Lightbox Gallery"
23
+ msgstr ""
24
+
25
+ #: lightbox-gallery/lightbox-gallery.php:169
26
+ msgid "Options updated."
27
+ msgstr ""
28
+
29
+ #: lightbox-gallery/lightbox-gallery.php:173
30
+ msgid "Options deleted."
31
+ msgstr ""
32
+
33
+ #: lightbox-gallery/lightbox-gallery.php:187
34
+ #: lightbox-gallery/lightbox-gallery.php:231
35
+ #: lightbox-gallery/lightbox-gallery.php:247
36
+ msgid "Click to toggle"
37
+ msgstr ""
38
+
39
+ #: lightbox-gallery/lightbox-gallery.php:188
40
+ msgid "Lightbox Gallery Options"
41
+ msgstr ""
42
+
43
+ #: lightbox-gallery/lightbox-gallery.php:194
44
+ msgid "In case that you would like to use the lightbox in certain categories (comma-deliminated)"
45
+ msgstr ""
46
+
47
+ #: lightbox-gallery/lightbox-gallery.php:198
48
+ msgid "In case that you would like to use the lightbox in certain pages (comma-deliminated)"
49
+ msgstr ""
50
+
51
+ #: lightbox-gallery/lightbox-gallery.php:202
52
+ msgid "In case that you would like to disable to load the lightbox-gallery.css"
53
+ msgstr ""
54
+
55
+ #: lightbox-gallery/lightbox-gallery.php:203
56
+ msgid "Do not use the lightbox-gallery.css"
57
+ msgstr ""
58
+
59
+ #: lightbox-gallery/lightbox-gallery.php:206
60
+ msgid "In case that you would like to disable to load the jquery.lightbox.css"
61
+ msgstr ""
62
+
63
+ #: lightbox-gallery/lightbox-gallery.php:207
64
+ msgid "Do not use the jquery.lightbox.css"
65
+ msgstr ""
66
+
67
+ #: lightbox-gallery/lightbox-gallery.php:210
68
+ msgid "In case that you would like to disable to load the jquery.tooltip.css"
69
+ msgstr ""
70
+
71
+ #: lightbox-gallery/lightbox-gallery.php:211
72
+ msgid "Do not use the jquery.tooltip.css"
73
+ msgstr ""
74
+
75
+ #: lightbox-gallery/lightbox-gallery.php:214
76
+ msgid "In case that you would like to disable to load the column inline css"
77
+ msgstr ""
78
+
79
+ #: lightbox-gallery/lightbox-gallery.php:215
80
+ msgid "Do not use the column inline css"
81
+ msgstr ""
82
+
83
+ #: lightbox-gallery/lightbox-gallery.php:218
84
+ msgid "In case that you would like to set the default number of columns"
85
+ msgstr ""
86
+
87
+ #: lightbox-gallery/lightbox-gallery.php:222
88
+ msgid "Update Options &raquo;"
89
+ msgstr ""
90
+
91
+ #: lightbox-gallery/lightbox-gallery.php:232
92
+ msgid "Delete Options"
93
+ msgstr ""
94
+
95
+ #: lightbox-gallery/lightbox-gallery.php:234
96
+ msgid "Are you sure to delete options? Options you set will be deleted."
97
+ msgstr ""
98
+
99
+ #: lightbox-gallery/lightbox-gallery.php:238
100
+ msgid "Delete Options &raquo;"
101
+ msgstr ""
102
+
103
+ #: lightbox-gallery/lightbox-gallery.php:248
104
+ msgid "Donation"
105
+ msgstr ""
106
+
107
+ #: lightbox-gallery/lightbox-gallery.php:250
108
+ msgid "If you liked this plugin, please make a donation via paypal! Any amount is welcome. Your support is much appreciated."
109
+ msgstr ""
110
+
111
+ #: lightbox-gallery/lightbox-gallery.php:324
112
+ msgid "Pages:"
113
+ msgstr ""
114
+
115
+ #: lightbox-gallery/lightbox-gallery.php:326
116
+ msgid "Next page"
117
+ msgstr ""
118
+
119
+ #: lightbox-gallery/lightbox-gallery.php:327
120
+ msgid "Previous page"
121
+ msgstr ""
122
+
123
+ #: lightbox-gallery/lightbox-gallery.php:379
124
  msgid "camera"
125
  msgstr ""
126
 
127
+ #: lightbox-gallery/lightbox-gallery.php:381
128
  msgid "aperture"
129
  msgstr ""
130
 
131
+ #: lightbox-gallery/lightbox-gallery.php:383
132
  msgid "focal_length"
133
  msgstr ""
134
 
135
+ #: lightbox-gallery/lightbox-gallery.php:385
136
  msgid "ISO"
137
  msgstr ""
138
 
139
+ #: lightbox-gallery/lightbox-gallery.php:389
140
  msgid "shutter_speed"
141
  msgstr ""
142
 
143
+ #: lightbox-gallery/lightbox-gallery.php:392
144
  msgid "created_timestamp"
145
  msgstr ""
146
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Lightbox Gallery ===
2
  Contributors: Hiroaki Miyashita
3
  Donate link: http://wordpressgogo.com/development/lightbox-gallery.html
4
- Tags: lightbox, gallery, image, images, album, photo
5
  Requires at least: 2.5
6
- Tested up to: 2.6.2
7
- Stable tag: 0.3.1
8
 
9
  This plugin changes the view of galleries to the lightbox.
10
 
@@ -15,9 +15,18 @@ The Lightbox Gallery plugin changes the view of galleries to the lightbox.
15
  * Lightbox display of Gallery
16
  * Tooltip view of caption of images
17
  * Displays the associated metadata with images
 
 
 
18
 
19
  You can also make regular images appear in a lightbox. See Faq.
20
 
 
 
 
 
 
 
21
  == Installation ==
22
 
23
  1. Edit the `lightbox-gallery.js` and check the path of line 2 according to your settings.
@@ -27,7 +36,7 @@ You can also make regular images appear in a lightbox. See Faq.
27
 
28
  Lightbox Gallery will load 'lightbox-gallery.css' from your theme's directory if it exists.
29
  If it doesn't exists, it will just load the default 'lightbox-gallery.css' that comes with Lightbox Gallery.
30
- This will allow you to upgrade Lightbox Gallery without worrying about overwriting your lightbox gallery styles that you have created.
31
 
32
  == Known Issues / Bugs ==
33
 
@@ -79,7 +88,7 @@ aperture, focal length, shutter speed, and created timestamp.
79
 
80
  * class
81
 
82
- Adds a class attribute of the gallery. The default is 'gallery1'.
83
 
84
  [gallery class="gallery2"]
85
 
@@ -89,6 +98,20 @@ Adds the attribute, rel="nofollow". The default is false.
89
 
90
  [gallery nofollow="true"]
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  == Uninstall ==
93
 
94
  1. Deactivate the plugin
1
  === Lightbox Gallery ===
2
  Contributors: Hiroaki Miyashita
3
  Donate link: http://wordpressgogo.com/development/lightbox-gallery.html
4
+ Tags: lightbox, gallery, image, images, album, photo, photos, picture, pictures
5
  Requires at least: 2.5
6
+ Tested up to: 2.7.1
7
+ Stable tag: 0.4
8
 
9
  This plugin changes the view of galleries to the lightbox.
10
 
15
  * Lightbox display of Gallery
16
  * Tooltip view of caption of images
17
  * Displays the associated metadata with images
18
+ * Divides Gallery into several pages
19
+ * Extends the default Gallery options
20
+ * Additional settings are set in the option page
21
 
22
  You can also make regular images appear in a lightbox. See Faq.
23
 
24
+ Localization
25
+
26
+ * Japanese (ja) - [Hiroaki Miyashita](http://wordpressgogo.com/)
27
+
28
+ If you have translated into your language, please let me know.
29
+
30
  == Installation ==
31
 
32
  1. Edit the `lightbox-gallery.js` and check the path of line 2 according to your settings.
36
 
37
  Lightbox Gallery will load 'lightbox-gallery.css' from your theme's directory if it exists.
38
  If it doesn't exists, it will just load the default 'lightbox-gallery.css' that comes with Lightbox Gallery.
39
+ This will allow you to upgrade Lightbox Gallery without worrying about overwriting your lightbox gallery styles that you have created.
40
 
41
  == Known Issues / Bugs ==
42
 
88
 
89
  * class
90
 
91
+ Adds a class attribute of the gallery. The default is `gallery1`.
92
 
93
  [gallery class="gallery2"]
94
 
98
 
99
  [gallery nofollow="true"]
100
 
101
+ * from, num
102
+
103
+ Defines from which and how many photos are displayed.
104
+ If the number of photos is over that of `num`, the navigation will be shown.
105
+ You can use the navigation option almost same as the `wp_link_pages` function.
106
+
107
+ [gallery from="5" num="10"]
108
+
109
+ * pagenavi
110
+
111
+ If you would like not to show the navigation, set `0`. The default is `1`.
112
+
113
+ [gallery num="10" pagenavi="0"]
114
+
115
  == Uninstall ==
116
 
117
  1. Deactivate the plugin