Lightbox Gallery - Version 0.2.3

Version Description

Download this release

Release Info

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

Code changes from version 0.2.1 to 0.2.3

js/jquery.dimensions.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
2
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
3
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
4
+ *
5
+ * $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $
6
+ * $Rev: 4257 $
7
+ *
8
+ * Version: 1.2
9
+ *
10
+ * Requires: jQuery 1.2+
11
+ */
12
+ (function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery);
lightbox-gallery-ja.mo CHANGED
Binary file
lightbox-gallery-ja.po CHANGED
@@ -15,9 +15,9 @@
15
  msgid ""
16
  msgstr ""
17
  "Project-Id-Version: Lightbox Gallery\n"
18
- "Report-Msgid-Bugs-To: wp-polyglots@lists.automattic.com\n"
19
- "POT-Creation-Date: 2008-03-26 13:02+0200\n"
20
- "PO-Revision-Date: 2008-04-21 20:41+0900\n"
21
  "Last-Translator: \n"
22
  "Language-Team: \n"
23
  "MIME-Version: 1.0\n"
@@ -30,23 +30,27 @@ msgstr ""
30
  "X-Poedit-Basepath: ../\n"
31
  "X-Poedit-SearchPath-0: lightbox-gallery\n"
32
 
33
- #: lightbox-gallery/lightbox-gallery.php:95
34
  msgid "camera"
35
  msgstr "機種"
36
 
37
- #: lightbox-gallery/lightbox-gallery.php:97
38
  msgid "aperture"
39
  msgstr "絞り値"
40
 
41
- #: lightbox-gallery/lightbox-gallery.php:99
42
  msgid "focal_length"
43
  msgstr "焦点距離"
44
 
45
- #: lightbox-gallery/lightbox-gallery.php:101
 
 
 
 
46
  msgid "shutter_speed"
47
  msgstr "シャッタースピード"
48
 
49
- #: lightbox-gallery/lightbox-gallery.php:103
50
  msgid "created_timestamp"
51
  msgstr "撮影日時"
52
 
15
  msgid ""
16
  msgstr ""
17
  "Project-Id-Version: Lightbox Gallery\n"
18
+ "Report-Msgid-Bugs-To: \n"
19
+ "POT-Creation-Date: 2008-07-15 17:15+0900\n"
20
+ "PO-Revision-Date: 2008-07-15 17:15+0900\n"
21
  "Last-Translator: \n"
22
  "Language-Team: \n"
23
  "MIME-Version: 1.0\n"
30
  "X-Poedit-Basepath: ../\n"
31
  "X-Poedit-SearchPath-0: lightbox-gallery\n"
32
 
33
+ #: lightbox-gallery/lightbox-gallery.php:101
34
  msgid "camera"
35
  msgstr "機種"
36
 
37
+ #: lightbox-gallery/lightbox-gallery.php:103
38
  msgid "aperture"
39
  msgstr "絞り値"
40
 
41
+ #: lightbox-gallery/lightbox-gallery.php:105
42
  msgid "focal_length"
43
  msgstr "焦点距離"
44
 
45
+ #: lightbox-gallery/lightbox-gallery.php:107
46
+ msgid "ISO"
47
+ msgstr "ISO"
48
+
49
+ #: lightbox-gallery/lightbox-gallery.php:111
50
  msgid "shutter_speed"
51
  msgstr "シャッタースピード"
52
 
53
+ #: lightbox-gallery/lightbox-gallery.php:114
54
  msgid "created_timestamp"
55
  msgstr "撮影日時"
56
 
lightbox-gallery.php CHANGED
@@ -4,7 +4,7 @@ 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.2.1
8
  Author URI: http://wordpressgogo.com/
9
  */
10
 
@@ -25,7 +25,7 @@ function add_lightbox_gallery_head() {
25
  function add_lightbox_gallery_jquery() {
26
  if (strpos($_SERVER['REQUEST_URI'], 'admin.php') === false ) {
27
  wp_enqueue_script( 'jquery');
28
- wp_enqueue_script('dimensions', '/wp-includes/js/jquery/jquery.dimensions.js', array('jquery'));
29
  wp_enqueue_script('bgtiframe', '/wp-content/plugins/lightbox-gallery/js/jquery.bgiframe.js', array('jquery'));
30
  wp_enqueue_script('lightbox', '/wp-content/plugins/lightbox-gallery/js/jquery.lightbox.js', array('jquery'));
31
  wp_enqueue_script('tooltip', '/wp-content/plugins/lightbox-gallery/js/jquery.tooltip.js', array('jquery'));
@@ -42,9 +42,21 @@ function lightbox_gallery($attr) {
42
  $output = apply_filters('post_gallery', '', $attr);
43
  if ( $output != '' )
44
  return $output;
45
-
 
 
 
 
 
 
 
 
 
 
 
46
  extract(shortcode_atts(array(
47
- 'orderby' => 'ID ASC',
 
48
  'id' => $post->ID,
49
  'itemtag' => 'dl',
50
  'icontag' => 'dt',
@@ -57,8 +69,7 @@ function lightbox_gallery($attr) {
57
  ), $attr));
58
 
59
  $id = intval($id);
60
- $orderby = addslashes($orderby);
61
- $attachments = get_children("post_parent=$id&post_type=attachment&post_mime_type=image&orderby=\"{$orderby}\"");
62
 
63
  if ( empty($attachments) )
64
  return '';
@@ -97,6 +108,8 @@ function lightbox_gallery($attr) {
97
  $metadata .= __('aperture', 'lightbox-gallery') . ": F". $imagedata['image_meta']['aperture'] . " ";
98
  if($imagedata['image_meta']['focal_length'])
99
  $metadata .= __('focal_length', 'lightbox-gallery') . ": ". $imagedata['image_meta']['focal_length'] . "mm ";
 
 
100
  if($imagedata['image_meta']['shutter_speed']) {
101
  if($imagedata['image_meta']['shutter_speed']<1) $speed = "1/". round(1/$imagedata['image_meta']['shutter_speed']);
102
  else $speed = $imagedata['image_meta']['shutter_speed'];
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.2.3
8
  Author URI: http://wordpressgogo.com/
9
  */
10
 
25
  function add_lightbox_gallery_jquery() {
26
  if (strpos($_SERVER['REQUEST_URI'], 'admin.php') === false ) {
27
  wp_enqueue_script( 'jquery');
28
+ wp_enqueue_script('dimensions', '/wp-content/plugins/lightbox-gallery/js/jquery.dimensions.js', array('jquery'));
29
  wp_enqueue_script('bgtiframe', '/wp-content/plugins/lightbox-gallery/js/jquery.bgiframe.js', array('jquery'));
30
  wp_enqueue_script('lightbox', '/wp-content/plugins/lightbox-gallery/js/jquery.lightbox.js', array('jquery'));
31
  wp_enqueue_script('tooltip', '/wp-content/plugins/lightbox-gallery/js/jquery.tooltip.js', array('jquery'));
42
  $output = apply_filters('post_gallery', '', $attr);
43
  if ( $output != '' )
44
  return $output;
45
+
46
+ // We're trusting author input, so let's at least make sure it looks like a valid orderby statement
47
+ if ( isset( $attr['orderby'] ) ) {
48
+ $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
49
+ if ( !$attr['orderby'] )
50
+ unset( $attr['orderby'] );
51
+ }
52
+
53
+ if ( !isset( $attr['orderby'] ) && get_bloginfo('version')<2.6 ) {
54
+ $attr['orderby'] = 'menu_order ASC, ID ASC';
55
+ }
56
+
57
  extract(shortcode_atts(array(
58
+ 'order' => 'ASC',
59
+ 'orderby' => 'menu_order ID',
60
  'id' => $post->ID,
61
  'itemtag' => 'dl',
62
  'icontag' => 'dt',
69
  ), $attr));
70
 
71
  $id = intval($id);
72
+ $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
 
73
 
74
  if ( empty($attachments) )
75
  return '';
108
  $metadata .= __('aperture', 'lightbox-gallery') . ": F". $imagedata['image_meta']['aperture'] . " ";
109
  if($imagedata['image_meta']['focal_length'])
110
  $metadata .= __('focal_length', 'lightbox-gallery') . ": ". $imagedata['image_meta']['focal_length'] . "mm ";
111
+ if($imagedata['image_meta']['iso'])
112
+ $metadata .= __('ISO', 'lightbox-gallery') . ": ". $imagedata['image_meta']['iso'] . " ";
113
  if($imagedata['image_meta']['shutter_speed']) {
114
  if($imagedata['image_meta']['shutter_speed']<1) $speed = "1/". round(1/$imagedata['image_meta']['shutter_speed']);
115
  else $speed = $imagedata['image_meta']['shutter_speed'];
lightbox-gallery.pot CHANGED
@@ -15,35 +15,39 @@
15
  msgid ""
16
  msgstr ""
17
  "Project-Id-Version: Lightbox Gallery\n"
18
- "Report-Msgid-Bugs-To: wp-polyglots@lists.automattic.com\n"
19
- "POT-Creation-Date: 2008-03-26 13:02+0200\n"
20
- "PO-Revision-Date: 2008-05-08 11:48+0900\n"
21
  "Last-Translator: \n"
22
  "Language-Team: \n"
23
  "MIME-Version: 1.0\n"
24
- "Content-Type: text/plain; charset=utf-8\n"
25
  "Content-Transfer-Encoding: 8bit\n"
26
  "X-Poedit-KeywordsList: __;_e;_c\n"
27
  "X-Poedit-Basepath: ../\n"
28
  "X-Poedit-SearchPath-0: lightbox-gallery\n"
29
 
30
- #: lightbox-gallery/lightbox-gallery.php:95
31
  msgid "camera"
32
  msgstr ""
33
 
34
- #: lightbox-gallery/lightbox-gallery.php:97
35
  msgid "aperture"
36
  msgstr ""
37
 
38
- #: lightbox-gallery/lightbox-gallery.php:99
39
  msgid "focal_length"
40
  msgstr ""
41
 
42
- #: lightbox-gallery/lightbox-gallery.php:101
 
 
 
 
43
  msgid "shutter_speed"
44
  msgstr ""
45
 
46
- #: lightbox-gallery/lightbox-gallery.php:103
47
  msgid "created_timestamp"
48
  msgstr ""
49
 
15
  msgid ""
16
  msgstr ""
17
  "Project-Id-Version: Lightbox Gallery\n"
18
+ "Report-Msgid-Bugs-To: \n"
19
+ "POT-Creation-Date: 2008-07-15 17:15+0900\n"
20
+ "PO-Revision-Date: 2008-07-15 17:15+0900\n"
21
  "Last-Translator: \n"
22
  "Language-Team: \n"
23
  "MIME-Version: 1.0\n"
24
+ "Content-Type: text/plain; charset=UTF-8\n"
25
  "Content-Transfer-Encoding: 8bit\n"
26
  "X-Poedit-KeywordsList: __;_e;_c\n"
27
  "X-Poedit-Basepath: ../\n"
28
  "X-Poedit-SearchPath-0: lightbox-gallery\n"
29
 
30
+ #: lightbox-gallery/lightbox-gallery.php:101
31
  msgid "camera"
32
  msgstr ""
33
 
34
+ #: lightbox-gallery/lightbox-gallery.php:103
35
  msgid "aperture"
36
  msgstr ""
37
 
38
+ #: lightbox-gallery/lightbox-gallery.php:105
39
  msgid "focal_length"
40
  msgstr ""
41
 
42
+ #: lightbox-gallery/lightbox-gallery.php:107
43
+ msgid "ISO"
44
+ msgstr ""
45
+
46
+ #: lightbox-gallery/lightbox-gallery.php:111
47
  msgid "shutter_speed"
48
  msgstr ""
49
 
50
+ #: lightbox-gallery/lightbox-gallery.php:114
51
  msgid "created_timestamp"
52
  msgstr ""
53
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ 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.5.1
7
- Stable tag: 0.2.1
8
 
9
  This plugin changes the view of galleries to the lightbox.
10
 
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
7
+ Stable tag: 0.2.3
8
 
9
  This plugin changes the view of galleries to the lightbox.
10