Slideshow Gallery - Version 1.2

Version Description

  • ADD: 'About Us' box in the Configuration section
  • IMPROVE: Better, more usable hardcoding procedure
  • FIX: Slideshow goes left
  • IMPROVE: auto width property
  • ADD: Banner image for WordPress.org directory
  • IMPROVE: Use load_plugin_textdomain instead for language file
  • ADD: Order slides by random?
  • FIX: Enqueue scripts/styles at the right time
  • ADD: Link target (current/new window) setting on each slide for link
  • IMPROVE: Hide next/previous navigation when there is only one slide
  • ADD: TimThumb integration for cropping images
  • CHANGE: Colorbox for popup images
  • ADD: 'Open' link to test slide links
  • ADD: Icon in each section of the plugin
  • CHANGE: Author name on WordPress.org to link appropriately
  • ADD: Dimensions for thumbnail images
  • CHANGE: New icon image for the admin menu
  • IMPROVE: Change 1=1 for the CSS
  • FIX: Code showing in the RSS feed.
  • ADD: Shortcode parameters
  • ADD: Multiple slideshows per post/page
  • ADD: Setting to turn off the next/previous navigation
  • IMPROVE: "Previous Image" and "Next Image" in language file
  • FIX: Not all thumbnails load the first time
  • IMPROVE: Remove black borders left and right of the image
  • IMPROVE: Removed link overlay which displayed white in IE6
Download this release

Release Info

Developer contrid
Plugin Icon 128x128 Slideshow Gallery
Version 1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.2

Files changed (66) hide show
  1. css/_notes/dwsync.xml +0 -4
  2. css/admin.css +14 -0
  3. css/colorbox.css +86 -0
  4. css/gallery-css.php +29 -27
  5. helpers/_notes/dwsync.xml +0 -6
  6. helpers/db.php +40 -11
  7. helpers/html.php +26 -1
  8. helpers/metabox.php +4 -0
  9. images/_notes/dwsync.xml +0 -4
  10. images/colorbox/border.png +0 -0
  11. images/colorbox/controls.png +0 -0
  12. images/colorbox/ie6/borderBottomCenter.png +0 -0
  13. images/colorbox/ie6/borderBottomLeft.png +0 -0
  14. images/colorbox/ie6/borderBottomRight.png +0 -0
  15. images/colorbox/ie6/borderMiddleLeft.png +0 -0
  16. images/colorbox/ie6/borderMiddleRight.png +0 -0
  17. images/colorbox/ie6/borderTopCenter.png +0 -0
  18. images/colorbox/ie6/borderTopLeft.png +0 -0
  19. images/colorbox/ie6/borderTopRight.png +0 -0
  20. images/colorbox/loading.gif +0 -0
  21. images/colorbox/loading_background.png +0 -0
  22. images/colorbox/overlay.png +0 -0
  23. images/icon-32.png +0 -0
  24. images/icon-galleries-32.png +0 -0
  25. images/icon-settings-32.png +0 -0
  26. images/icon.png +0 -0
  27. js/_notes/dwsync.xml +0 -4
  28. js/admin.js +7 -1
  29. js/colorbox.js +926 -0
  30. js/gallery.js +11 -24
  31. js/settings-editor.js +1 -1
  32. js/tinymce/_notes/dwsync.xml +0 -4
  33. js/tinymce/dialog.php +48 -52
  34. js/tinymce/editor_plugin.js +3 -10
  35. js/tinymce/error_log +0 -4
  36. js/tinymce/gallery.png +0 -0
  37. js/tinymce/langs/en.js +2 -2
  38. languages/slideshow-gallery-en_US.mo +0 -0
  39. languages/slideshow-gallery-en_US.po +464 -269
  40. models/_notes/dwsync.xml +0 -4
  41. models/gallery.php +84 -0
  42. models/galleryslides.php +79 -0
  43. models/slide.php +22 -30
  44. readme.txt +84 -32
  45. screenshot-1.png +0 -0
  46. screenshot-2.png +0 -0
  47. screenshot-6.png +0 -0
  48. slideshow-gallery-plugin.php +67 -48
  49. slideshow-gallery.php +361 -190
  50. vendors/timthumb.php +1257 -0
  51. views/admin/galleries/index.php +73 -0
  52. views/admin/galleries/save.php +28 -0
  53. views/admin/galleries/view.php +18 -0
  54. views/admin/head.php +4 -0
  55. views/admin/metaboxes/_notes/dwsync.xml +0 -4
  56. views/admin/metaboxes/settings-about.php +15 -0
  57. views/admin/metaboxes/settings-general.php +49 -21
  58. views/admin/metaboxes/settings-styles.php +14 -3
  59. views/admin/settings.php +6 -2
  60. views/admin/slides/_notes/dwsync.xml +0 -5
  61. views/admin/slides/index.php +6 -74
  62. views/admin/slides/loop.php +91 -0
  63. views/admin/slides/order.php +6 -2
  64. views/admin/slides/save.php +30 -7
  65. views/default/_notes/dwsync.xml +0 -4
  66. views/default/gallery.php +97 -62
css/_notes/dwsync.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <dwsync>
3
- <file name="gallery-css.php" server="wpplugins.biz/public_html/" local="129345028851752995" remote="129345028800000000" />
4
- </dwsync>
 
 
 
 
css/admin.css ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ div.Gallery .error {
2
+ color: red;
3
+ }
4
+
5
+ a.thickbox img.slideshow, a.colorbox img.slideshow {
6
+ border: 1px #CCCCCC solid;
7
+ -moz-border-radius: 4px;
8
+ -webkit-border-radius: 4px;
9
+ padding: 2px;
10
+ }
11
+
12
+ a.thickbox:hover img.slideshow, a.colorbox:hover img.slideshow {
13
+ border: 1px #515151 solid;
14
+ }
css/colorbox.css ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ColorBox Core Style:
3
+ The following CSS is consistent between example themes and should not be altered.
4
+ */
5
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
6
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
7
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
8
+ #cboxContent{position:relative;}
9
+ #cboxLoadedContent{overflow:auto;}
10
+ #cboxTitle{margin:0;}
11
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
12
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
13
+ .cboxPhoto{float:left; margin:auto; border:0; display:block;}
14
+ .cboxIframe{width:100%; height:100%; display:block; border:0;}
15
+ #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box;}
16
+
17
+ /*
18
+ User Style:
19
+ Change the following styles to modify the appearance of ColorBox. They are
20
+ ordered & tabbed in a way that represents the nesting of the generated HTML.
21
+ */
22
+ #cboxOverlay{background:url(../images/colorbox/overlay.png) repeat 0 0;}
23
+ #colorbox{}
24
+ #cboxTopLeft{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -101px 0;}
25
+ #cboxTopRight{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -130px 0;}
26
+ #cboxBottomLeft{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -101px -29px;}
27
+ #cboxBottomRight{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -130px -29px;}
28
+ #cboxMiddleLeft{width:21px; background:url(../images/colorbox/controls.png) left top repeat-y;}
29
+ #cboxMiddleRight{width:21px; background:url(../images/colorbox/controls.png) right top repeat-y;}
30
+ #cboxTopCenter{height:21px; background:url(../images/colorbox/border.png) 0 0 repeat-x;}
31
+ #cboxBottomCenter{height:21px; background:url(../images/colorbox/border.png) 0 -29px repeat-x;}
32
+ #cboxContent{background:#fff; overflow:hidden;}
33
+ .cboxIframe{background:#fff;}
34
+ #cboxError{padding:50px; border:1px solid #ccc;}
35
+ #cboxLoadedContent{margin-bottom:28px;}
36
+ #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
37
+ #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
38
+ #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
39
+ #cboxPrevious{position:absolute; bottom:0; left:0; background:url(../images/colorbox/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
40
+ #cboxPrevious:hover{background-position:-75px -25px;}
41
+ #cboxNext{position:absolute; bottom:0; left:27px; background:url(../images/colorbox/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
42
+ #cboxNext:hover{background-position:-50px -25px;}
43
+ #cboxLoadingOverlay{background:url(../images/colorbox/loading_background.png) no-repeat center center;}
44
+ #cboxLoadingGraphic{background:url(../images/colorbox/loading.gif) no-repeat center center;}
45
+ #cboxClose{position:absolute; bottom:0; right:0; background:url(../images/colorbox/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
46
+ #cboxClose:hover{background-position:-25px -25px;}
47
+
48
+ /*
49
+ The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
50
+ when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
51
+ See: http://jacklmoore.com/notes/ie-transparency-problems/
52
+ */
53
+ .cboxIE #cboxTopLeft,
54
+ .cboxIE #cboxTopCenter,
55
+ .cboxIE #cboxTopRight,
56
+ .cboxIE #cboxBottomLeft,
57
+ .cboxIE #cboxBottomCenter,
58
+ .cboxIE #cboxBottomRight,
59
+ .cboxIE #cboxMiddleLeft,
60
+ .cboxIE #cboxMiddleRight {
61
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
62
+ }
63
+
64
+ /*
65
+ The following provides PNG transparency support for IE6
66
+ Feel free to remove this and the /ie6/ directory if you have dropped IE6 support.
67
+ */
68
+ .cboxIE6 #cboxTopLeft{background:url(../images/colorbox/ie6/borderTopLeft.png);}
69
+ .cboxIE6 #cboxTopCenter{background:url(../images/colorbox/ie6/borderTopCenter.png);}
70
+ .cboxIE6 #cboxTopRight{background:url(../images/colorbox/ie6/borderTopRight.png);}
71
+ .cboxIE6 #cboxBottomLeft{background:url(../images/colorbox/ie6/borderBottomLeft.png);}
72
+ .cboxIE6 #cboxBottomCenter{background:url(../images/colorbox/ie6/borderBottomCenter.png);}
73
+ .cboxIE6 #cboxBottomRight{background:url(../images/colorbox/ie6/borderBottomRight.png);}
74
+ .cboxIE6 #cboxMiddleLeft{background:url(../images/colorbox/ie6/borderMiddleLeft.png);}
75
+ .cboxIE6 #cboxMiddleRight{background:url(../images/colorbox/ie6/borderMiddleRight.png);}
76
+
77
+ .cboxIE6 #cboxTopLeft,
78
+ .cboxIE6 #cboxTopCenter,
79
+ .cboxIE6 #cboxTopRight,
80
+ .cboxIE6 #cboxBottomLeft,
81
+ .cboxIE6 #cboxBottomCenter,
82
+ .cboxIE6 #cboxBottomRight,
83
+ .cboxIE6 #cboxMiddleLeft,
84
+ .cboxIE6 #cboxMiddleRight {
85
+ _behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')");
86
+ }
css/gallery-css.php CHANGED
@@ -5,30 +5,32 @@
5
  <?php $styles[$skey] = urldecode($sval); ?>
6
  <?php endforeach; ?>
7
 
8
- #slideshow { list-style:none !important; color:#fff; }
9
- #slideshow span { display:none; }
10
- #slideshow-wrapper { position:relative; width:<?php echo ((int) $styles['width'] - 6); ?>px; background:<?php echo $styles['background']; ?>; padding:2px; border:<?php echo $styles['border']; ?>; margin:0; display:none; }
11
- #slideshow-wrapper * { margin:0; padding:0; }
12
- #fullsize { position:relative; z-index:1; overflow:hidden; width:<?php echo ((int) $styles['width'] - 8); ?>px; height:<?php echo ((int) $styles['height'] - 6); ?>px; border:1px #CCC solid; }
13
- #information { font-family:Verdana, Arial, Helvetica, sans-serif !important; position:absolute; bottom:0; width:<?php echo ((int) $styles['width'] - 6); ?>px; height:0; background:<?php echo $styles['infobackground']; ?>; color:<?php echo $styles['infocolor']; ?>; overflow:hidden; z-index:200; opacity:.7; filter:alpha(opacity=70); }
14
- #information h3 { color:<?php echo $styles['infocolor']; ?>; padding:4px 8px 3px; margin:0 !important; font-size:16px; font-weight:bold; }
15
- #information p { color:<?php echo $styles['infocolor']; ?>; padding:0 8px 8px; margin:0 !important; font-size: 14px; font-weight:normal; }
16
- #image { width:<?php echo ((int) $styles['width'] - 6); ?>px; no-repeat; }
17
- <?php if (empty($styles['resizeimages']) || $styles['resizeimages'] == "Y") : ?>#image img { position:absolute; border:none; width:<?php echo ((int) $styles['width'] - 8); ?>px; height:auto; }<?php else : ?>#image img { position:absolute; border:none; width:auto; }<?php endif; ?>
18
- .imgnav { position:absolute; width:25%; height:<?php echo ((int) $styles['height'] + 8); ?>px; cursor:pointer; z-index:150; }
19
- #imgprev { left:0; background:url('../images/left.gif') left center no-repeat; }
20
- #imgnext { right:0; background:url('../images/right.gif') right center no-repeat; }
21
- #imglink { position:absolute; zoom:1; background-color:#ffffff; height:<?php echo ((int) $styles['height'] + 8); ?>px; width:50%; left:25%; right:20%; z-index:999; opacity:0; filter:alpha(opacity=0); }
22
- .linkhover { background:transparent url('../images/link.gif') center center no-repeat !important; text-indent:-9999px; opacity:.4 !important; filter:alpha(opacity=40) !important; }
23
- #thumbnails { background:<?php echo $styles['background']; ?>; }
24
- .thumbstop { margin-bottom:8px !important; }
25
- .thumbsbot { margin-top:8px !important; }
26
- #slideleft { float:left; width:20px; height:81px; background:url('../images/scroll-left.gif') center center no-repeat; background-color:#222; }
27
- #slideleft:hover { background-color:#333; }
28
- #slideright { float:right; width:20px; height:81px; background:#222 url('../images/scroll-right.gif') center center no-repeat; }
29
- #slideright:hover { background-color:#333; }
30
- #slidearea { float:left; background:<?php echo $styles['background']; ?>; position:relative; width:<?php echo ((int) $styles['width'] - 57); ?>px; margin-left:5px; height:81px; overflow:hidden; }
31
- #slider { position:absolute; left:0; height:81px; }
32
- #slider img { cursor:pointer; border:1px solid #666; padding:2px; -moz-border-radius:4px; -webkit-border-radius:4px; float:left !important; }
33
- #spinner { position:relative; top:50%; left:45%; }
34
- #spinner img {border:none;}
 
 
5
  <?php $styles[$skey] = urldecode($sval); ?>
6
  <?php endforeach; ?>
7
 
8
+ <?php if (!empty($styles['wrapperid'])) : ?>
9
+ ul.slideshow { list-style:none !important; color:#fff; }
10
+ ul.slideshow span { display:none; }
11
+ #<?php echo $styles['wrapperid']; ?> { position:relative; width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width'] - 6) . 'px' : 'auto'; ?>; background:<?php echo $styles['background']; ?>; padding:0 0 0 0; border:<?php echo $styles['border']; ?>; margin:0; display:none; }
12
+ #<?php echo $styles['wrapperid']; ?> * { margin:0; padding:0; }
13
+ #<?php echo $styles['wrapperid']; ?> #fullsize<?php echo $styles['wrapperrand']; ?> { position:relative; z-index:1; overflow:hidden; width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width'] - 6) . 'px' : 'auto'; ?>; height:<?php echo ((int) $styles['height'] - 6); ?>px; border: none; }
14
+ #<?php echo $styles['wrapperid']; ?> #information<?php echo $styles['wrapperrand']; ?> { text-align:left; font-family:Verdana, Arial, Helvetica, sans-serif !important; position:absolute; bottom:0; width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width'] - 6) . 'px' : '100%'; ?>; height:0; background:<?php echo $styles['infobackground']; ?>; color:<?php echo $styles['infocolor']; ?>; overflow:hidden; z-index:200; opacity:.7; filter:alpha(opacity=70); }
15
+ #<?php echo $styles['wrapperid']; ?> #information<?php echo $styles['wrapperrand']; ?> h3 { color:<?php echo $styles['infocolor']; ?>; padding:4px 8px 3px; margin:0 !important; font-size:16px; font-weight:bold; }
16
+ #<?php echo $styles['wrapperid']; ?> #information<?php echo $styles['wrapperrand']; ?> p { color:<?php echo $styles['infocolor']; ?>; padding:0 8px 8px; margin:0 !important; font-size: 14px; font-weight:normal; }
17
+ #<?php echo $styles['wrapperid']; ?> #image<?php echo $styles['wrapperrand']; ?> { width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width'] - 4) . 'px' : 'auto'; ?>; no-repeat; }
18
+ #<?php echo $styles['wrapperid']; ?> #image<?php echo $styles['wrapperrand']; ?> img { position:absolute; left:0; border:none; width:100%; height:auto; }
19
+ #<?php echo $styles['wrapperid']; ?> .imgnav { position:absolute; width:25%; height:<?php echo ((int) $styles['height'] + 8); ?>px; cursor:pointer; z-index:150; }
20
+ #<?php echo $styles['wrapperid']; ?> #imgprev<?php echo $styles['wrapperrand']; ?> { left:0; background:url('../images/left.gif') left center no-repeat; }
21
+ #<?php echo $styles['wrapperid']; ?> #imgnext<?php echo $styles['wrapperrand']; ?> { right:0; background:url('../images/right.gif') right center no-repeat; }
22
+ #<?php echo $styles['wrapperid']; ?> #imglink<?php echo $styles['wrapperrand']; ?> { position:absolute; zoom:1; background-color:#ffffff; height:<?php echo ((int) $styles['height'] + 8); ?>px; width:50%; left:25%; right:20%; z-index:999; opacity:0; filter:alpha(opacity=0); }
23
+ #<?php echo $styles['wrapperid']; ?> .linkhover { background:transparent url('../images/link.gif') center center no-repeat !important; text-indent:-9999px; opacity:.4 !important; filter:alpha(opacity=40) !important; }
24
+ #<?php echo $styles['wrapperid']; ?> #thumbnails<?php echo $styles['wrapperrand']; ?> { background:<?php echo $styles['background']; ?>; }
25
+ #<?php echo $styles['wrapperid']; ?> .thumbstop { margin-bottom:8px !important; }
26
+ #<?php echo $styles['wrapperid']; ?> .thumbsbot { margin-top:8px !important; }
27
+ #<?php echo $styles['wrapperid']; ?> #slideleft<?php echo $styles['wrapperrand']; ?> { float:left; width:20px; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; background:url('../images/scroll-left.gif') center center no-repeat; background-color:#222; }
28
+ #<?php echo $styles['wrapperid']; ?> #slideleft<?php echo $styles['wrapperrand']; ?>:hover { background-color:#333; }
29
+ #<?php echo $styles['wrapperid']; ?> #slideright<?php echo $styles['wrapperrand']; ?> { float:right; width:20px; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; background:#222 url('../images/scroll-right.gif') center center no-repeat; }
30
+ #<?php echo $styles['wrapperid']; ?> #slideright<?php echo $styles['wrapperrand']; ?>:hover { background-color:#333; }
31
+ #<?php echo $styles['wrapperid']; ?> #slidearea<?php echo $styles['wrapperrand']; ?> { float:left; position:relative; background:<?php echo $styles['background']; ?>; width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width'] - 57) . 'px' : '92%'; ?>; margin-left:5px; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; overflow:hidden; }
32
+ #<?php echo $styles['wrapperid']; ?> #slider<?php echo $styles['wrapperrand']; ?> { position:absolute; left:0; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; }
33
+ #<?php echo $styles['wrapperid']; ?> #slider<?php echo $styles['wrapperrand']; ?> img { cursor:pointer; border:1px solid #666; padding:2px; -moz-border-radius:4px; -webkit-border-radius:4px; float:left !important; }
34
+ #<?php echo $styles['wrapperid']; ?> #spinner<?php echo $styles['wrapperrand']; ?> { position:relative; top:50%; left:45%; text-align:left; }
35
+ #<?php echo $styles['wrapperid']; ?> #spinner<?php echo $styles['wrapperrand']; ?> img { border:none; }
36
+ <?php endif; ?>
helpers/_notes/dwsync.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <dwsync>
3
- <file name="html.php" server="wpplugins.biz/public_html/" local="129344234527551377" remote="129344234400000000" />
4
- <file name="db.php" server="wpplugins.biz/public_html/" local="129344369857197115" remote="129344369400000000" />
5
- <file name="metabox.php" server="wpplugins.biz/public_html/" local="129345034151236108" remote="129345034200000000" />
6
- </dwsync>
 
 
 
 
 
 
helpers/db.php CHANGED
@@ -90,8 +90,15 @@ class GalleryDbHelper extends GalleryPlugin {
90
  }
91
 
92
  $order = (empty($order)) ? array('id', "DESC") : $order;
93
- list($ofield, $odir) = $order;
94
- $query .= " ORDER BY `" . $ofield . "` " . $odir . "";
 
 
 
 
 
 
 
95
  $query .= (empty($limit)) ? '' : " LIMIT " . $limit . "";
96
 
97
  if ($records = $wpdb -> get_results($query)) {
@@ -115,12 +122,13 @@ class GalleryDbHelper extends GalleryPlugin {
115
 
116
  function save($data = null, $validate = true) {
117
  global $wpdb;
 
118
 
119
  $defaults = (method_exists($this, 'defaults')) ? $this -> defaults() : false;
120
  $data = (empty($data[$this -> model])) ? $data : $data[$this -> model];
121
 
122
  $r = wp_parse_args($data, $defaults);
123
- $this -> data = GalleryHtmlHelper::array_to_object($r);
124
 
125
  if ($validate == true) {
126
  if (method_exists($this, 'validate')) {
@@ -143,13 +151,28 @@ class GalleryDbHelper extends GalleryPlugin {
143
  break;
144
  }
145
 
146
- //the MySQL query
147
  $query = (empty($this -> data -> id)) ? $this -> insert_query($this -> model) : $this -> update_query($this -> model);
148
- //echo $query;
149
- //return false;
150
 
151
  if ($wpdb -> query($query)) {
152
- $this -> insertid = $insertid = (empty($this -> data -> id)) ? $wpdb -> insert_id : $this -> data -> id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  return true;
154
  }
155
  }
@@ -188,14 +211,20 @@ class GalleryDbHelper extends GalleryPlugin {
188
  return false;
189
  }
190
 
191
- function delete($record_id = '') {
192
  global $wpdb;
193
 
194
  if (!empty($record_id) && $record = $this -> find(array('id' => $record_id))) {
195
  $query = "DELETE FROM `" . $this -> table . "` WHERE `id` = '" . $record_id . "' LIMIT 1";
196
 
197
  if ($wpdb -> query($query)) {
198
- //do nothing...
 
 
 
 
 
 
199
  return true;
200
  }
201
  }
@@ -203,7 +232,7 @@ class GalleryDbHelper extends GalleryPlugin {
203
  return false;
204
  }
205
 
206
- function insert_query($model = '') {
207
  if (!empty($model)) {
208
  global $wpdb;
209
 
@@ -249,7 +278,7 @@ class GalleryDbHelper extends GalleryPlugin {
249
  return false;
250
  }
251
 
252
- function update_query($model = '') {
253
  if (!empty($model)) {
254
  global $wpdb;
255
 
90
  }
91
 
92
  $order = (empty($order)) ? array('id', "DESC") : $order;
93
+
94
+ if ($order == "random") {
95
+ $query .= " ORDER BY RAND()";
96
+ } else {
97
+ if (!is_array($order)) { $order = array('id', "DESC"); }
98
+ list($ofield, $odir) = $order;
99
+ $query .= " ORDER BY `" . $ofield . "` " . $odir . "";
100
+ }
101
+
102
  $query .= (empty($limit)) ? '' : " LIMIT " . $limit . "";
103
 
104
  if ($records = $wpdb -> get_results($query)) {
122
 
123
  function save($data = null, $validate = true) {
124
  global $wpdb;
125
+ $this -> errors = false;
126
 
127
  $defaults = (method_exists($this, 'defaults')) ? $this -> defaults() : false;
128
  $data = (empty($data[$this -> model])) ? $data : $data[$this -> model];
129
 
130
  $r = wp_parse_args($data, $defaults);
131
+ $this -> data = (object) $r;
132
 
133
  if ($validate == true) {
134
  if (method_exists($this, 'validate')) {
151
  break;
152
  }
153
 
 
154
  $query = (empty($this -> data -> id)) ? $this -> insert_query($this -> model) : $this -> update_query($this -> model);
 
 
155
 
156
  if ($wpdb -> query($query)) {
157
+ $this -> insertid = $insertid = (empty($this -> data -> id)) ? $wpdb -> insert_id : $this -> data -> id;
158
+
159
+ switch ($this -> model) {
160
+ case 'Slide' :
161
+
162
+ $slide_id = $this -> insertid;
163
+ $deletequery = "DELETE FROM `" . $wpdb -> prefix . strtolower($this -> pre) . "_galleriesslides` WHERE `slide_id` = '" . $slide_id . "'";
164
+ $wpdb -> query($deletequery);
165
+
166
+ if (!empty($this -> data -> galleries)) {
167
+ foreach ($this -> data -> galleries as $gallery_id) {
168
+ $date = date("Y-m-d H:i:s", time());
169
+ $galleryslidequery = "INSERT INTO `" . $wpdb -> prefix . strtolower($this -> pre) . "_galleriesslides` (`id`, `slide_id`, `gallery_id`, `created`, `modified`) VALUES ('', '" . $slide_id . "', '" . $gallery_id . "', '" . $date . "', '" . $date . "');";
170
+ $wpdb -> query($galleryslidequery);
171
+ }
172
+ }
173
+ break;
174
+ }
175
+
176
  return true;
177
  }
178
  }
211
  return false;
212
  }
213
 
214
+ function delete($record_id = null) {
215
  global $wpdb;
216
 
217
  if (!empty($record_id) && $record = $this -> find(array('id' => $record_id))) {
218
  $query = "DELETE FROM `" . $this -> table . "` WHERE `id` = '" . $record_id . "' LIMIT 1";
219
 
220
  if ($wpdb -> query($query)) {
221
+ switch ($this -> model) {
222
+ case 'Gallery' :
223
+ $query = "DELETE FROM `" . $wpdb -> prefix . strtolower($this -> pre) . "_galleriesslides` WHERE `gallery_id` = '" . $record_id . "'";
224
+ $wpdb -> query($query);
225
+ break;
226
+ }
227
+
228
  return true;
229
  }
230
  }
232
  return false;
233
  }
234
 
235
+ function insert_query($model = null) {
236
  if (!empty($model)) {
237
  global $wpdb;
238
 
278
  return false;
279
  }
280
 
281
+ function update_query($model = null) {
282
  if (!empty($model)) {
283
  global $wpdb;
284
 
helpers/html.php CHANGED
@@ -41,9 +41,34 @@ class GalleryHtmlHelper extends GalleryPlugin {
41
  return false;
42
  }
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  function image_url($filename = null) {
45
  if (!empty($filename)) {
46
- return get_option('siteurl') . '/wp-content/uploads/slideshow-gallery/' . $filename;
47
  }
48
 
49
  return false;
41
  return false;
42
  }
43
 
44
+ function timthumb_image($image = null, $width = null, $height = null, $quality = 100, $class = "slideshow", $rel = "") {
45
+ $tt_image = '<img src="' . $this -> timthumb_url() . '?src=' . $image;
46
+ if (!empty($width)) { $tt_image .= '&w=' . $width; };
47
+ if (!empty($height)) { $tt_image .= '&h=' . $height; };
48
+ $tt_image .= '&q=' . $quality . '"';
49
+ $tt_image .= '&a=t';
50
+ if (!empty($class)) { $tt_image .= ' class="' . $class . '"'; };
51
+ if (!empty($rel)) { $tt_image .= ' rel="' . $rel . '"'; }
52
+ $tt_image .= ' />';
53
+ return $tt_image;
54
+ }
55
+
56
+ function timthumb_image_src($image = null, $width = null, $height = null, $quality = 100) {
57
+ $tt_image = $this -> timthumb_url() . '?src=' . $image;
58
+ if (!empty($width)) { $tt_image .= '&w=' . $width; };
59
+ if (!empty($height)) { $tt_image .= '&h=' . $height; };
60
+ $tt_image .= '&q=' . $quality;
61
+ $tt_image .= '&a=t';
62
+ return $tt_image;
63
+ }
64
+
65
+ function timthumb_url() {
66
+ return rtrim(get_bloginfo('wpurl'), '/') . '/wp-content/plugins/slideshow-gallery/vendors/timthumb.php';
67
+ }
68
+
69
  function image_url($filename = null) {
70
  if (!empty($filename)) {
71
+ return rtrim(get_option('siteurl'), '/') . '/wp-content/uploads/slideshow-gallery/' . $filename;
72
  }
73
 
74
  return false;
helpers/metabox.php CHANGED
@@ -13,6 +13,10 @@ class GalleryMetaboxHelper extends GalleryPlugin {
13
  $this -> render('metaboxes' . DS . 'settings-submit', false, true, 'admin');
14
  }
15
 
 
 
 
 
16
  function settings_general() {
17
  $this -> render('metaboxes' . DS . 'settings-general', false, true, 'admin');
18
  }
13
  $this -> render('metaboxes' . DS . 'settings-submit', false, true, 'admin');
14
  }
15
 
16
+ function settings_about() {
17
+ $this -> render('metaboxes' . DS . 'settings-about', false, true, 'admin');
18
+ }
19
+
20
  function settings_general() {
21
  $this -> render('metaboxes' . DS . 'settings-general', false, true, 'admin');
22
  }
images/_notes/dwsync.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <dwsync>
3
- <file name="spinner.gif" server="wpplugins.biz/public_html/" local="129121255340000000" remote="129344375400000000" />
4
- </dwsync>
 
 
 
 
images/colorbox/border.png ADDED
Binary file
images/colorbox/controls.png ADDED
Binary file
images/colorbox/ie6/borderBottomCenter.png ADDED
Binary file
images/colorbox/ie6/borderBottomLeft.png ADDED
Binary file
images/colorbox/ie6/borderBottomRight.png ADDED
Binary file
images/colorbox/ie6/borderMiddleLeft.png ADDED
Binary file
images/colorbox/ie6/borderMiddleRight.png ADDED
Binary file
images/colorbox/ie6/borderTopCenter.png ADDED
Binary file
images/colorbox/ie6/borderTopLeft.png ADDED
Binary file
images/colorbox/ie6/borderTopRight.png ADDED
Binary file
images/colorbox/loading.gif ADDED
Binary file
images/colorbox/loading_background.png ADDED
Binary file
images/colorbox/overlay.png ADDED
Binary file
images/icon-32.png ADDED
Binary file
images/icon-galleries-32.png ADDED
Binary file
images/icon-settings-32.png ADDED
Binary file
images/icon.png CHANGED
Binary file
js/_notes/dwsync.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <dwsync>
3
- <file name="gallery.js" server="wpplugins.biz/public_html/" local="129345028956508987" remote="129345028800000000" />
4
- </dwsync>
 
 
 
 
js/admin.js CHANGED
@@ -19,4 +19,10 @@ jQuery(document).ready(function(){
19
  }
20
  });
21
  });
22
- });
 
 
 
 
 
 
19
  }
20
  });
21
  });
22
+ });
23
+
24
+ function jqCheckAll(checker, formid, name) {
25
+ jQuery('input:checkbox[name="' + name + '[]"]').each(function() {
26
+ jQuery(this).attr("checked", checker.checked);
27
+ });
28
+ }
js/colorbox.js ADDED
@@ -0,0 +1,926 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // ColorBox v1.3.19.3 - jQuery lightbox plugin
2
+ // (c) 2011 Jack Moore - jacklmoore.com
3
+ // License: http://www.opensource.org/licenses/mit-license.php
4
+ (function ($, document, window) {
5
+ var
6
+ // Default settings object.
7
+ // See http://jacklmoore.com/colorbox for details.
8
+ defaults = {
9
+ transition: "elastic",
10
+ speed: 300,
11
+ width: false,
12
+ initialWidth: "600",
13
+ innerWidth: false,
14
+ maxWidth: false,
15
+ height: false,
16
+ initialHeight: "450",
17
+ innerHeight: false,
18
+ maxHeight: false,
19
+ scalePhotos: true,
20
+ scrolling: true,
21
+ inline: false,
22
+ html: false,
23
+ iframe: false,
24
+ fastIframe: true,
25
+ photo: false,
26
+ href: false,
27
+ title: false,
28
+ rel: false,
29
+ opacity: 0.9,
30
+ preloading: true,
31
+
32
+ current: "image {current} of {total}",
33
+ previous: "previous",
34
+ next: "next",
35
+ close: "close",
36
+ xhrError: "This content failed to load.",
37
+ imgError: "This image failed to load.",
38
+
39
+ open: false,
40
+ returnFocus: true,
41
+ reposition: true,
42
+ loop: true,
43
+ slideshow: false,
44
+ slideshowAuto: true,
45
+ slideshowSpeed: 2500,
46
+ slideshowStart: "start slideshow",
47
+ slideshowStop: "stop slideshow",
48
+ onOpen: false,
49
+ onLoad: false,
50
+ onComplete: false,
51
+ onCleanup: false,
52
+ onClosed: false,
53
+ overlayClose: true,
54
+ escKey: true,
55
+ arrowKey: true,
56
+ top: false,
57
+ bottom: false,
58
+ left: false,
59
+ right: false,
60
+ fixed: false,
61
+ data: undefined
62
+ },
63
+
64
+ // Abstracting the HTML and event identifiers for easy rebranding
65
+ colorbox = 'colorbox',
66
+ prefix = 'cbox',
67
+ boxElement = prefix + 'Element',
68
+
69
+ // Events
70
+ event_open = prefix + '_open',
71
+ event_load = prefix + '_load',
72
+ event_complete = prefix + '_complete',
73
+ event_cleanup = prefix + '_cleanup',
74
+ event_closed = prefix + '_closed',
75
+ event_purge = prefix + '_purge',
76
+
77
+ // Special Handling for IE
78
+ isIE = !$.support.opacity && !$.support.style, // IE7 & IE8
79
+ isIE6 = isIE && !window.XMLHttpRequest, // IE6
80
+ event_ie6 = prefix + '_IE6',
81
+
82
+ // Cached jQuery Object Variables
83
+ $overlay,
84
+ $box,
85
+ $wrap,
86
+ $content,
87
+ $topBorder,
88
+ $leftBorder,
89
+ $rightBorder,
90
+ $bottomBorder,
91
+ $related,
92
+ $window,
93
+ $loaded,
94
+ $loadingBay,
95
+ $loadingOverlay,
96
+ $title,
97
+ $current,
98
+ $slideshow,
99
+ $next,
100
+ $prev,
101
+ $close,
102
+ $groupControls,
103
+
104
+ // Variables for cached values or use across multiple functions
105
+ settings,
106
+ interfaceHeight,
107
+ interfaceWidth,
108
+ loadedHeight,
109
+ loadedWidth,
110
+ element,
111
+ index,
112
+ photo,
113
+ open,
114
+ active,
115
+ closing,
116
+ loadingTimer,
117
+ publicMethod,
118
+ div = "div",
119
+ init;
120
+
121
+ // ****************
122
+ // HELPER FUNCTIONS
123
+ // ****************
124
+
125
+ // Convience function for creating new jQuery objects
126
+ function $tag(tag, id, css) {
127
+ var element = document.createElement(tag);
128
+
129
+ if (id) {
130
+ element.id = prefix + id;
131
+ }
132
+
133
+ if (css) {
134
+ element.style.cssText = css;
135
+ }
136
+
137
+ return $(element);
138
+ }
139
+
140
+ // Determine the next and previous members in a group.
141
+ function getIndex(increment) {
142
+ var
143
+ max = $related.length,
144
+ newIndex = (index + increment) % max;
145
+
146
+ return (newIndex < 0) ? max + newIndex : newIndex;
147
+ }
148
+
149
+ // Convert '%' and 'px' values to integers
150
+ function setSize(size, dimension) {
151
+ return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : $window.height()) / 100) : 1) * parseInt(size, 10));
152
+ }
153
+
154
+ // Checks an href to see if it is a photo.
155
+ // There is a force photo option (photo: true) for hrefs that cannot be matched by this regex.
156
+ function isImage(url) {
157
+ return settings.photo || /\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(url);
158
+ }
159
+
160
+ // Assigns function results to their respective properties
161
+ function makeSettings() {
162
+ var i,
163
+ data = $.data(element, colorbox);
164
+
165
+ if (data == null) {
166
+ settings = $.extend({}, defaults);
167
+ if (console && console.log) {
168
+ console.log('Error: cboxElement missing settings object')
169
+ }
170
+ } else {
171
+ settings = $.extend({}, data);
172
+ }
173
+
174
+ for (i in settings) {
175
+ if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
176
+ settings[i] = settings[i].call(element);
177
+ }
178
+ }
179
+
180
+ settings.rel = settings.rel || element.rel || 'nofollow';
181
+ settings.href = settings.href || $(element).attr('href');
182
+ settings.title = settings.title || element.title;
183
+
184
+ if (typeof settings.href === "string") {
185
+ settings.href = $.trim(settings.href);
186
+ }
187
+ }
188
+
189
+ function trigger(event, callback) {
190
+ $.event.trigger(event);
191
+ if (callback) {
192
+ callback.call(element);
193
+ }
194
+ }
195
+
196
+ // Slideshow functionality
197
+ function slideshow() {
198
+ var
199
+ timeOut,
200
+ className = prefix + "Slideshow_",
201
+ click = "click." + prefix,
202
+ start,
203
+ stop,
204
+ clear;
205
+
206
+ if (settings.slideshow && $related[1]) {
207
+ start = function () {
208
+ $slideshow
209
+ .text(settings.slideshowStop)
210
+ .unbind(click)
211
+ .bind(event_complete, function () {
212
+ if (settings.loop || $related[index + 1]) {
213
+ timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
214
+ }
215
+ })
216
+ .bind(event_load, function () {
217
+ clearTimeout(timeOut);
218
+ })
219
+ .one(click + ' ' + event_cleanup, stop);
220
+ $box.removeClass(className + "off").addClass(className + "on");
221
+ timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
222
+ };
223
+
224
+ stop = function () {
225
+ clearTimeout(timeOut);
226
+ $slideshow
227
+ .text(settings.slideshowStart)
228
+ .unbind([event_complete, event_load, event_cleanup, click].join(' '))
229
+ .one(click, function () {
230
+ publicMethod.next();
231
+ start();
232
+ });
233
+ $box.removeClass(className + "on").addClass(className + "off");
234
+ };
235
+
236
+ if (settings.slideshowAuto) {
237
+ start();
238
+ } else {
239
+ stop();
240
+ }
241
+ } else {
242
+ $box.removeClass(className + "off " + className + "on");
243
+ }
244
+ }
245
+
246
+ function launch(target) {
247
+ if (!closing) {
248
+
249
+ element = target;
250
+
251
+ makeSettings();
252
+
253
+ $related = $(element);
254
+
255
+ index = 0;
256
+
257
+ if (settings.rel !== 'nofollow') {
258
+ $related = $('.' + boxElement).filter(function () {
259
+ var data = $.data(this, colorbox),
260
+ relRelated;
261
+
262
+ if (data) {
263
+ relRelated = data.rel || this.rel;
264
+ }
265
+
266
+ return (relRelated === settings.rel);
267
+ });
268
+ index = $related.index(element);
269
+
270
+ // Check direct calls to ColorBox.
271
+ if (index === -1) {
272
+ $related = $related.add(element);
273
+ index = $related.length - 1;
274
+ }
275
+ }
276
+
277
+ if (!open) {
278
+ open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
279
+
280
+ $box.show();
281
+
282
+ if (settings.returnFocus) {
283
+ $(element).blur().one(event_closed, function () {
284
+ $(this).focus();
285
+ });
286
+ }
287
+
288
+ // +settings.opacity avoids a problem in IE when using non-zero-prefixed-string-values, like '.5'
289
+ $overlay.css({"opacity": +settings.opacity, "cursor": settings.overlayClose ? "pointer" : "auto"}).show();
290
+
291
+ // Opens inital empty ColorBox prior to content being loaded.
292
+ settings.w = setSize(settings.initialWidth, 'x');
293
+ settings.h = setSize(settings.initialHeight, 'y');
294
+ publicMethod.position();
295
+
296
+ if (isIE6) {
297
+ $window.bind('resize.' + event_ie6 + ' scroll.' + event_ie6, function () {
298
+ $overlay.css({width: $window.width(), height: $window.height(), top: $window.scrollTop(), left: $window.scrollLeft()});
299
+ }).trigger('resize.' + event_ie6);
300
+ }
301
+
302
+ trigger(event_open, settings.onOpen);
303
+
304
+ $groupControls.add($title).hide();
305
+
306
+ $close.html(settings.close).show();
307
+ }
308
+
309
+ publicMethod.load(true);
310
+ }
311
+ }
312
+
313
+ // ColorBox's markup needs to be added to the DOM prior to being called
314
+ // so that the browser will go ahead and load the CSS background images.
315
+ function appendHTML() {
316
+ if (!$box && document.body) {
317
+ init = false;
318
+
319
+ $window = $(window);
320
+ $box = $tag(div).attr({id: colorbox, 'class': isIE ? prefix + (isIE6 ? 'IE6' : 'IE') : ''}).hide();
321
+ $overlay = $tag(div, "Overlay", isIE6 ? 'position:absolute' : '').hide();
322
+ $wrap = $tag(div, "Wrapper");
323
+ $content = $tag(div, "Content").append(
324
+ $loaded = $tag(div, "LoadedContent", 'width:0; height:0; overflow:hidden'),
325
+ $loadingOverlay = $tag(div, "LoadingOverlay").add($tag(div, "LoadingGraphic")),
326
+ $title = $tag(div, "Title"),
327
+ $current = $tag(div, "Current"),
328
+ $next = $tag(div, "Next"),
329
+ $prev = $tag(div, "Previous"),
330
+ $slideshow = $tag(div, "Slideshow").bind(event_open, slideshow),
331
+ $close = $tag(div, "Close")
332
+ );
333
+
334
+ $wrap.append( // The 3x3 Grid that makes up ColorBox
335
+ $tag(div).append(
336
+ $tag(div, "TopLeft"),
337
+ $topBorder = $tag(div, "TopCenter"),
338
+ $tag(div, "TopRight")
339
+ ),
340
+ $tag(div, false, 'clear:left').append(
341
+ $leftBorder = $tag(div, "MiddleLeft"),
342
+ $content,
343
+ $rightBorder = $tag(div, "MiddleRight")
344
+ ),
345
+ $tag(div, false, 'clear:left').append(
346
+ $tag(div, "BottomLeft"),
347
+ $bottomBorder = $tag(div, "BottomCenter"),
348
+ $tag(div, "BottomRight")
349
+ )
350
+ ).find('div div').css({'float': 'left'});
351
+
352
+ $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none');
353
+
354
+ $groupControls = $next.add($prev).add($current).add($slideshow);
355
+
356
+ $(document.body).append($overlay, $box.append($wrap, $loadingBay));
357
+ }
358
+ }
359
+
360
+ // Add ColorBox's event bindings
361
+ function addBindings() {
362
+ if ($box) {
363
+ if (!init) {
364
+ init = true;
365
+
366
+ // Cache values needed for size calculations
367
+ interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
368
+ interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
369
+ loadedHeight = $loaded.outerHeight(true);
370
+ loadedWidth = $loaded.outerWidth(true);
371
+
372
+ // Setting padding to remove the need to do size conversions during the animation step.
373
+ $box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth});
374
+
375
+ // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
376
+ $next.click(function () {
377
+ publicMethod.next();
378
+ });
379
+ $prev.click(function () {
380
+ publicMethod.prev();
381
+ });
382
+ $close.click(function () {
383
+ publicMethod.close();
384
+ });
385
+ $overlay.click(function () {
386
+ if (settings.overlayClose) {
387
+ publicMethod.close();
388
+ }
389
+ });
390
+
391
+ // Key Bindings
392
+ $(document).bind('keydown.' + prefix, function (e) {
393
+ var key = e.keyCode;
394
+ if (open && settings.escKey && key === 27) {
395
+ e.preventDefault();
396
+ publicMethod.close();
397
+ }
398
+ if (open && settings.arrowKey && $related[1]) {
399
+ if (key === 37) {
400
+ e.preventDefault();
401
+ $prev.click();
402
+ } else if (key === 39) {
403
+ e.preventDefault();
404
+ $next.click();
405
+ }
406
+ }
407
+ });
408
+
409
+ $('.' + boxElement, document).live('click', function (e) {
410
+ // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
411
+ // See: http://jacklmoore.com/notes/click-events/
412
+ if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) {
413
+ e.preventDefault();
414
+ launch(this);
415
+ }
416
+ });
417
+ }
418
+ return true;
419
+ }
420
+ return false;
421
+ }
422
+
423
+ // Don't do anything if ColorBox already exists.
424
+ if ($.colorbox) {
425
+ return;
426
+ }
427
+
428
+ // Append the HTML when the DOM loads
429
+ $(appendHTML);
430
+
431
+
432
+ // ****************
433
+ // PUBLIC FUNCTIONS
434
+ // Usage format: $.fn.colorbox.close();
435
+ // Usage from within an iframe: parent.$.fn.colorbox.close();
436
+ // ****************
437
+
438
+ publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
439
+ var $this = this;
440
+
441
+ options = options || {};
442
+
443
+ appendHTML();
444
+
445
+ if (addBindings()) {
446
+ if (!$this[0]) {
447
+ if ($this.selector) { // if a selector was given and it didn't match any elements, go ahead and exit.
448
+ return $this;
449
+ }
450
+ // if no selector was given (ie. $.colorbox()), create a temporary element to work with
451
+ $this = $('<a/>');
452
+ options.open = true; // assume an immediate open
453
+ }
454
+
455
+ if (callback) {
456
+ options.onComplete = callback;
457
+ }
458
+
459
+ $this.each(function () {
460
+ $.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options));
461
+ }).addClass(boxElement);
462
+
463
+ if (($.isFunction(options.open) && options.open.call($this)) || options.open) {
464
+ launch($this[0]);
465
+ }
466
+ }
467
+
468
+ return $this;
469
+ };
470
+
471
+ publicMethod.position = function (speed, loadedCallback) {
472
+ var
473
+ top = 0,
474
+ left = 0,
475
+ offset = $box.offset(),
476
+ scrollTop,
477
+ scrollLeft;
478
+
479
+ $window.unbind('resize.' + prefix);
480
+
481
+ // remove the modal so that it doesn't influence the document width/height
482
+ $box.css({top: -9e4, left: -9e4});
483
+
484
+ scrollTop = $window.scrollTop();
485
+ scrollLeft = $window.scrollLeft();
486
+
487
+ if (settings.fixed && !isIE6) {
488
+ offset.top -= scrollTop;
489
+ offset.left -= scrollLeft;
490
+ $box.css({position: 'fixed'});
491
+ } else {
492
+ top = scrollTop;
493
+ left = scrollLeft;
494
+ $box.css({position: 'absolute'});
495
+ }
496
+
497
+ // keeps the top and left positions within the browser's viewport.
498
+ if (settings.right !== false) {
499
+ left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0);
500
+ } else if (settings.left !== false) {
501
+ left += setSize(settings.left, 'x');
502
+ } else {
503
+ left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
504
+ }
505
+
506
+ if (settings.bottom !== false) {
507
+ top += Math.max($window.height() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);
508
+ } else if (settings.top !== false) {
509
+ top += setSize(settings.top, 'y');
510
+ } else {
511
+ top += Math.round(Math.max($window.height() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
512
+ }
513
+
514
+ $box.css({top: offset.top, left: offset.left});
515
+
516
+ // setting the speed to 0 to reduce the delay between same-sized content.
517
+ speed = ($box.width() === settings.w + loadedWidth && $box.height() === settings.h + loadedHeight) ? 0 : speed || 0;
518
+
519
+ // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
520
+ // but it has to be shrank down around the size of div#colorbox when it's done. If not,
521
+ // it can invoke an obscure IE bug when using iframes.
522
+ $wrap[0].style.width = $wrap[0].style.height = "9999px";
523
+
524
+ function modalDimensions(that) {
525
+ $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = that.style.width;
526
+ $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = that.style.height;
527
+ }
528
+
529
+ $box.dequeue().animate({width: settings.w + loadedWidth, height: settings.h + loadedHeight, top: top, left: left}, {
530
+ duration: speed,
531
+ complete: function () {
532
+ modalDimensions(this);
533
+
534
+ active = false;
535
+
536
+ // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
537
+ $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
538
+ $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
539
+
540
+ if (settings.reposition) {
541
+ setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
542
+ $window.bind('resize.' + prefix, publicMethod.position);
543
+ }, 1);
544
+ }
545
+
546
+ if (loadedCallback) {
547
+ loadedCallback();
548
+ }
549
+ },
550
+ step: function () {
551
+ modalDimensions(this);
552
+ }
553
+ });
554
+ };
555
+
556
+ publicMethod.resize = function (options) {
557
+ if (open) {
558
+ options = options || {};
559
+
560
+ if (options.width) {
561
+ settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
562
+ }
563
+ if (options.innerWidth) {
564
+ settings.w = setSize(options.innerWidth, 'x');
565
+ }
566
+ $loaded.css({width: settings.w});
567
+
568
+ if (options.height) {
569
+ settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
570
+ }
571
+ if (options.innerHeight) {
572
+ settings.h = setSize(options.innerHeight, 'y');
573
+ }
574
+ if (!options.innerHeight && !options.height) {
575
+ $loaded.css({height: "auto"});
576
+ settings.h = $loaded.height();
577
+ }
578
+ $loaded.css({height: settings.h});
579
+
580
+ publicMethod.position(settings.transition === "none" ? 0 : settings.speed);
581
+ }
582
+ };
583
+
584
+ publicMethod.prep = function (object) {
585
+ if (!open) {
586
+ return;
587
+ }
588
+
589
+ var callback, speed = settings.transition === "none" ? 0 : settings.speed;
590
+
591
+ $loaded.remove();
592
+ $loaded = $tag(div, 'LoadedContent').append(object);
593
+
594
+ function getWidth() {
595
+ settings.w = settings.w || $loaded.width();
596
+ settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
597
+ return settings.w;
598
+ }
599
+ function getHeight() {
600
+ settings.h = settings.h || $loaded.height();
601
+ settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
602
+ return settings.h;
603
+ }
604
+
605
+ $loaded.hide()
606
+ .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
607
+ .css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'})
608
+ .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
609
+ .prependTo($content);
610
+
611
+ $loadingBay.hide();
612
+
613
+ // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
614
+ //$(photo).css({'float': 'none', marginLeft: 'auto', marginRight: 'auto'});
615
+
616
+ $(photo).css({'float': 'none'});
617
+
618
+ // Hides SELECT elements in IE6 because they would otherwise sit on top of the overlay.
619
+ if (isIE6) {
620
+ $('select').not($box.find('select')).filter(function () {
621
+ return this.style.visibility !== 'hidden';
622
+ }).css({'visibility': 'hidden'}).one(event_cleanup, function () {
623
+ this.style.visibility = 'inherit';
624
+ });
625
+ }
626
+
627
+ callback = function () {
628
+ var preload,
629
+ i,
630
+ total = $related.length,
631
+ iframe,
632
+ frameBorder = 'frameBorder',
633
+ allowTransparency = 'allowTransparency',
634
+ complete,
635
+ src,
636
+ img,
637
+ data;
638
+
639
+ if (!open) {
640
+ return;
641
+ }
642
+
643
+ function removeFilter() {
644
+ if (isIE) {
645
+ $box[0].style.removeAttribute('filter');
646
+ }
647
+ }
648
+
649
+ complete = function () {
650
+ clearTimeout(loadingTimer);
651
+ $loadingOverlay.hide();
652
+ trigger(event_complete, settings.onComplete);
653
+ };
654
+
655
+ if (isIE) {
656
+ //This fadeIn helps the bicubic resampling to kick-in.
657
+ if (photo) {
658
+ $loaded.fadeIn(100);
659
+ }
660
+ }
661
+
662
+ $title.html(settings.title).add($loaded).show();
663
+
664
+ if (total > 1) { // handle grouping
665
+ if (typeof settings.current === "string") {
666
+ $current.html(settings.current.replace('{current}', index + 1).replace('{total}', total)).show();
667
+ }
668
+
669
+ $next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next);
670
+ $prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous);
671
+
672
+ if (settings.slideshow) {
673
+ $slideshow.show();
674
+ }
675
+
676
+ // Preloads images within a rel group
677
+ if (settings.preloading) {
678
+ preload = [
679
+ getIndex(-1),
680
+ getIndex(1)
681
+ ];
682
+ while (i = $related[preload.pop()]) {
683
+ data = $.data(i, colorbox);
684
+
685
+ if (data && data.href) {
686
+ src = data.href;
687
+ if ($.isFunction(src)) {
688
+ src = src.call(i);
689
+ }
690
+ } else {
691
+ src = i.href;
692
+ }
693
+
694
+ if (isImage(src)) {
695
+ img = new Image();
696
+ img.src = src;
697
+ }
698
+ }
699
+ }
700
+ } else {
701
+ $groupControls.hide();
702
+ }
703
+
704
+ if (settings.iframe) {
705
+ iframe = $tag('iframe')[0];
706
+
707
+ if (frameBorder in iframe) {
708
+ iframe[frameBorder] = 0;
709
+ }
710
+ if (allowTransparency in iframe) {
711
+ iframe[allowTransparency] = "true";
712
+ }
713
+ // give the iframe a unique name to prevent caching
714
+ iframe.name = prefix + (+new Date());
715
+ if (settings.fastIframe) {
716
+ complete();
717
+ } else {
718
+ $(iframe).one('load', complete);
719
+ }
720
+ iframe.src = settings.href;
721
+ if (!settings.scrolling) {
722
+ iframe.scrolling = "no";
723
+ }
724
+ $(iframe).addClass(prefix + 'Iframe').appendTo($loaded).one(event_purge, function () {
725
+ iframe.src = "//about:blank";
726
+ });
727
+ } else {
728
+ complete();
729
+ }
730
+
731
+ if (settings.transition === 'fade') {
732
+ $box.fadeTo(speed, 1, removeFilter);
733
+ } else {
734
+ removeFilter();
735
+ }
736
+ };
737
+
738
+ if (settings.transition === 'fade') {
739
+ $box.fadeTo(speed, 0, function () {
740
+ publicMethod.position(0, callback);
741
+ });
742
+ } else {
743
+ publicMethod.position(speed, callback);
744
+ }
745
+ };
746
+
747
+ publicMethod.load = function (launched) {
748
+ var href, setResize, prep = publicMethod.prep;
749
+
750
+ active = true;
751
+
752
+ photo = false;
753
+
754
+ element = $related[index];
755
+
756
+ if (!launched) {
757
+ makeSettings();
758
+ }
759
+
760
+ trigger(event_purge);
761
+
762
+ trigger(event_load, settings.onLoad);
763
+
764
+ settings.h = settings.height ?
765
+ setSize(settings.height, 'y') - loadedHeight - interfaceHeight :
766
+ settings.innerHeight && setSize(settings.innerHeight, 'y');
767
+
768
+ settings.w = settings.width ?
769
+ setSize(settings.width, 'x') - loadedWidth - interfaceWidth :
770
+ settings.innerWidth && setSize(settings.innerWidth, 'x');
771
+
772
+ // Sets the minimum dimensions for use in image scaling
773
+ settings.mw = settings.w;
774
+ settings.mh = settings.h;
775
+
776
+ // Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
777
+ // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
778
+ if (settings.maxWidth) {
779
+ settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;
780
+ settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
781
+ }
782
+ if (settings.maxHeight) {
783
+ settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;
784
+ settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
785
+ }
786
+
787
+ href = settings.href;
788
+
789
+ loadingTimer = setTimeout(function () {
790
+ $loadingOverlay.show();
791
+ }, 100);
792
+
793
+ if (settings.inline) {
794
+ // Inserts an empty placeholder where inline content is being pulled from.
795
+ // An event is bound to put inline content back when ColorBox closes or loads new content.
796
+ $tag(div).hide().insertBefore($(href)[0]).one(event_purge, function () {
797
+ $(this).replaceWith($loaded.children());
798
+ });
799
+ prep($(href));
800
+ } else if (settings.iframe) {
801
+ // IFrame element won't be added to the DOM until it is ready to be displayed,
802
+ // to avoid problems with DOM-ready JS that might be trying to run in that iframe.
803
+ prep(" ");
804
+ } else if (settings.html) {
805
+ prep(settings.html);
806
+ } else if (isImage(href)) {
807
+ $(photo = new Image())
808
+ .addClass(prefix + 'Photo')
809
+ .error(function () {
810
+ settings.title = false;
811
+ prep($tag(div, 'Error').html(settings.imgError));
812
+ })
813
+ .load(function () {
814
+ var percent;
815
+ photo.onload = null; //stops animated gifs from firing the onload repeatedly.
816
+
817
+ if (settings.scalePhotos) {
818
+ setResize = function () {
819
+ photo.height -= photo.height * percent;
820
+ photo.width -= photo.width * percent;
821
+ };
822
+ if (settings.mw && photo.width > settings.mw) {
823
+ percent = (photo.width - settings.mw) / photo.width;
824
+ setResize();
825
+ }
826
+ if (settings.mh && photo.height > settings.mh) {
827
+ percent = (photo.height - settings.mh) / photo.height;
828
+ setResize();
829
+ }
830
+ }
831
+
832
+ if (settings.h) {
833
+ photo.style.marginTop = Math.max(settings.h - photo.height, 0) / 2 + 'px';
834
+ }
835
+
836
+ if ($related[1] && (settings.loop || $related[index + 1])) {
837
+ photo.style.cursor = 'pointer';
838
+ photo.onclick = function () {
839
+ publicMethod.next();
840
+ };
841
+ }
842
+
843
+ if (isIE) {
844
+ photo.style.msInterpolationMode = 'bicubic';
845
+ }
846
+
847
+ setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise.
848
+ prep(photo);
849
+ }, 1);
850
+ });
851
+
852
+ setTimeout(function () { // A pause because Opera 10.6+ will sometimes not run the onload function otherwise.
853
+ photo.src = href;
854
+ }, 1);
855
+ } else if (href) {
856
+ $loadingBay.load(href, settings.data, function (data, status, xhr) {
857
+ prep(status === 'error' ? $tag(div, 'Error').html(settings.xhrError) : $(this).contents());
858
+ });
859
+ }
860
+ };
861
+
862
+ // Navigates to the next page/image in a set.
863
+ publicMethod.next = function () {
864
+ if (!active && $related[1] && (settings.loop || $related[index + 1])) {
865
+ index = getIndex(1);
866
+ publicMethod.load();
867
+ }
868
+ };
869
+
870
+ publicMethod.prev = function () {
871
+ if (!active && $related[1] && (settings.loop || index)) {
872
+ index = getIndex(-1);
873
+ publicMethod.load();
874
+ }
875
+ };
876
+
877
+ // Note: to use this within an iframe use the following format: parent.$.fn.colorbox.close();
878
+ publicMethod.close = function () {
879
+ if (open && !closing) {
880
+
881
+ closing = true;
882
+
883
+ open = false;
884
+
885
+ trigger(event_cleanup, settings.onCleanup);
886
+
887
+ $window.unbind('.' + prefix + ' .' + event_ie6);
888
+
889
+ $overlay.fadeTo(200, 0);
890
+
891
+ $box.stop().fadeTo(300, 0, function () {
892
+
893
+ $box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
894
+
895
+ trigger(event_purge);
896
+
897
+ $loaded.remove();
898
+
899
+ setTimeout(function () {
900
+ closing = false;
901
+ trigger(event_closed, settings.onClosed);
902
+ }, 1);
903
+ });
904
+ }
905
+ };
906
+
907
+ // Removes changes ColorBox made to the document, but does not remove the plugin
908
+ // from jQuery.
909
+ publicMethod.remove = function () {
910
+ $([]).add($box).add($overlay).remove();
911
+ $box = null;
912
+ $('.' + boxElement)
913
+ .removeData(colorbox)
914
+ .removeClass(boxElement)
915
+ .die();
916
+ };
917
+
918
+ // A method for fetching the current element ColorBox is referencing.
919
+ // returns a jQuery object.
920
+ publicMethod.element = function () {
921
+ return $(element);
922
+ };
923
+
924
+ publicMethod.settings = defaults;
925
+
926
+ }(jQuery, document, this));
js/gallery.js CHANGED
@@ -1,7 +1,7 @@
1
  var TINY={};
2
 
3
- function tid(i){return document.getElementById(i)}
4
- function tag(e,p){p=p||document; return p.getElementsByTagName(e)}
5
 
6
  TINY.slideshow=function(n){
7
  this.infoSpeed=this.imgSpeed=this.speed=10;
@@ -38,6 +38,7 @@ TINY.slideshow.prototype={
38
  a.t= tag('h3',h)[0].innerHTML;
39
  a.d= tag('p',h)[0].innerHTML;
40
  a.l= tag('a',h)[0]? tag('a',h)[0].href:'';
 
41
  a.p= tag('span',h)[0].innerHTML;
42
  if(this.thumbs){
43
  var g = tag('img',h)[0];
@@ -89,7 +90,9 @@ TINY.slideshow.prototype={
89
  i.style.filter='alpha(opacity=0)';
90
  this.i=i;
91
  i.onload=new Function(this.n+'.le('+s+','+c+')');
92
- i.src=this.a[s].p;
 
 
93
  if(this.thumbs){
94
  var a= tag('img',this.p), l=a.length, x=0;
95
  for(x;x<l;x++){
@@ -102,8 +105,6 @@ TINY.slideshow.prototype={
102
  var w=this.o-parseInt(this.i.offsetWidth);
103
  if(w>0){
104
  var l=Math.floor(w/2);
105
- this.i.style.borderLeft=l+'px solid ' + this.letterbox;
106
- this.i.style.borderRight=(w-l)+'px solid ' + this.letterbox
107
  }
108
  TINY.alpha.set(this.i,100,this.imgSpeed);
109
  var n=new Function(this.n+'.nf('+s+')');
@@ -111,18 +112,15 @@ TINY.slideshow.prototype={
111
  if(!c){
112
  this.at=setTimeout(new Function(this.n+'.mv(1,0)'),this.speed*1000)
113
  }
114
- if(this.a[s].l != ""){
115
- //this.q.onclick = new Function('window.location="' + this.a[s].l + '"');
116
- //this.q.onclick = new Function('tb_show("test", "' + this.a[s].l + '", "' + this.a[s].l + '")');
117
-
118
  var baseURL = this.a[s].l;
119
  var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
120
  var urlType = baseURL.toLowerCase().match(urlString);
121
 
122
- if (this.imagesthickbox == "true" && (urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp')) {
123
- this.q.onclick = new Function('tb_show("' + this.a[s].t + '", "' + this.a[s].l + '", "slideshow")');
124
  } else {
125
- this.q.onclick = new Function('window.location="' + this.a[s].l + '"');
126
  }
127
 
128
  this.q.onmouseover = new Function('this.className="' + this.linkclass + '"');
@@ -153,20 +151,9 @@ TINY.slideshow.prototype={
153
  TINY.scroll=function(){
154
  return{
155
  init:function(e,d,s){
156
- e=typeof e=='object'?e: tid(e); var p=e.style.left||TINY.style.val(e,'left'); e.style.left=p;
157
-
158
- /**
159
- * Issue #1: Bugfix for newer versions of firefox and possibly other browsers.
160
- * The issue here was, that the thumbnail bar didn't stop scrolling to the left if the
161
- * summed up width of thumbs was smaller than the width of the bar. Fixed this by calculating the
162
- * absolute sum of the offsets. Secondly I've added the constraint that there is no scrolling at
163
- * all if there are not enough thumbnails in the bar. Might be nice to hide the arrows at the sides
164
- * then, but I couldn't figure out how to achive this in a finite amount of time ;)
165
- */
166
-
167
  var l = (d==1) ? Math.abs(parseInt(e.offsetWidth)-parseInt(e.parentNode.offsetWidth)) : 0;
168
 
169
- // constraint for scrolling
170
  if ((e.childNodes.length+1)*e.firstChild.width > e.parentNode.offsetWidth) {
171
  e.si=setInterval(function(){
172
  TINY.scroll.mv(e,l,d,s)},20);
1
  var TINY={};
2
 
3
+ function tid(i){ return document.getElementById(i); }
4
+ function tag(e,p){ p=p||document; return p.getElementsByTagName(e); }
5
 
6
  TINY.slideshow=function(n){
7
  this.infoSpeed=this.imgSpeed=this.speed=10;
38
  a.t= tag('h3',h)[0].innerHTML;
39
  a.d= tag('p',h)[0].innerHTML;
40
  a.l= tag('a',h)[0]? tag('a',h)[0].href:'';
41
+ a.tg = tag('a',h)[0]? tag('a',h)[0].target:'_self';
42
  a.p= tag('span',h)[0].innerHTML;
43
  if(this.thumbs){
44
  var g = tag('img',h)[0];
90
  i.style.filter='alpha(opacity=0)';
91
  this.i=i;
92
  i.onload=new Function(this.n+'.le('+s+','+c+')');
93
+ string = this.a[s].p;
94
+ string = string.replace(/&amp;/g, '&');
95
+ i.src = string;
96
  if(this.thumbs){
97
  var a= tag('img',this.p), l=a.length, x=0;
98
  for(x;x<l;x++){
105
  var w=this.o-parseInt(this.i.offsetWidth);
106
  if(w>0){
107
  var l=Math.floor(w/2);
 
 
108
  }
109
  TINY.alpha.set(this.i,100,this.imgSpeed);
110
  var n=new Function(this.n+'.nf('+s+')');
112
  if(!c){
113
  this.at=setTimeout(new Function(this.n+'.mv(1,0)'),this.speed*1000)
114
  }
115
+ if(this.a[s].l != ""){
 
 
 
116
  var baseURL = this.a[s].l;
117
  var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
118
  var urlType = baseURL.toLowerCase().match(urlString);
119
 
120
+ if (this.imagesthickbox == "true" && (urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp')) {
121
+ this.q.onclick = new Function('jQuery.colorbox({href:"' + this.a[s].l + '",title:"' + this.a[s].t + '"})');
122
  } else {
123
+ this.q.onclick = new Function('window.open("' + this.a[s].l + '","' + this.a[s].tg + '")');
124
  }
125
 
126
  this.q.onmouseover = new Function('this.className="' + this.linkclass + '"');
151
  TINY.scroll=function(){
152
  return{
153
  init:function(e,d,s){
154
+ e=typeof e=='object'?e: tid(e); var p=e.style.left||TINY.style.val(e,'left'); e.style.left=p;
 
 
 
 
 
 
 
 
 
 
155
  var l = (d==1) ? Math.abs(parseInt(e.offsetWidth)-parseInt(e.parentNode.offsetWidth)) : 0;
156
 
 
157
  if ((e.childNodes.length+1)*e.firstChild.width > e.parentNode.offsetWidth) {
158
  e.si=setInterval(function(){
159
  TINY.scroll.mv(e,l,d,s)},20);
js/settings-editor.js CHANGED
@@ -1,4 +1,4 @@
1
  jQuery(document).ready(function() {
2
  jQuery(".if-js-closed").removeClass("if-js-closed").addClass("closed");
3
- postboxes.add_postbox_toggles("slideshow_page_gallery-settings");
4
  });
1
  jQuery(document).ready(function() {
2
  jQuery(".if-js-closed").removeClass("if-js-closed").addClass("closed");
3
+ postboxes.add_postbox_toggles("slideshow_page_slideshow-settings");
4
  });
js/tinymce/_notes/dwsync.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <dwsync>
3
- <file name="dialog.php" server="wpplugins.biz/public_html/" local="129345063849544754" remote="129345063600000000" />
4
- </dwsync>
 
 
 
 
js/tinymce/dialog.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  error_reporting(0);
4
  @ini_set('display_errors', 0);
5
 
@@ -15,13 +17,16 @@ require_once(ABSPATH . 'wp-admin' . DS . 'admin-functions.php');
15
  if(!current_user_can('edit_posts')) die;
16
  do_action('admin_init');
17
 
 
 
 
18
  ?>
19
 
20
 
21
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
22
  <html xmlns="http://www.w3.org/1999/xhtml">
23
  <head>
24
- <title><?php _e('Insert a slideshow', "slideshow-gallery"); ?></title>
25
  <script language="javascript" type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
26
  <script language="javascript" type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
27
  <script language="javascript" type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
@@ -33,21 +38,28 @@ do_action('admin_init');
33
 
34
  function insertTag () {
35
  var slideshow_type = jQuery('input[name="slideshow_type"]:checked').val();
 
36
 
37
  if (slideshow_type == "post") {
38
  var post_id = jQuery('#post_id').val();
39
- var exclude = jQuery('#exclude').val();
40
-
41
- if (post_id == "th") { var tag = '[slideshow'; }
42
- else { var tag = '[slideshow post_id="' + post_id + '"'; }
43
 
44
- if (exclude == "") {
45
- tag += ']';
46
- } else {
47
- tag += ' exclude="' + exclude + '"]';
48
  }
 
 
49
  } else if (slideshow_type == "custom") {
50
- var tag = '[slideshow custom=true]';
 
 
 
 
 
 
 
 
51
  }
52
 
53
  if(window.tinyMCE) {
@@ -55,10 +67,9 @@ do_action('admin_init');
55
  tinyMCEPopup.editor.execCommand('mceRepaint');
56
  tinyMCEPopup.close();
57
  }
58
-
59
  }
60
 
61
- function closePopup () {
62
  tinyMCEPopup.close();
63
  }
64
  </script>
@@ -77,53 +88,38 @@ do_action('admin_init');
77
 
78
  <form onsubmit="insertTag(); return false;" action="#">
79
  <div class="panel_wrapper">
80
- <label style="font-weight:bold; cursor:pointer;"><input onclick="jQuery('#post_div').show();" type="radio" name="slideshow_type" value="post" id="type_post" /> <?php _e('Images From a Post', "slideshow-gallery"); ?></label><br/>
81
- <label style="font-weight:bold; cursor:pointer;"><input onclick="jQuery('#post_div').hide();" type="radio" name="slideshow_type" value="custom" id="type_custom" /> <?php _e('Custom Added Slides', "slideshow-gallery"); ?></label>
 
82
 
83
  <div id="post_div" style="display:none;">
84
  <p>
85
- <label for="post_id" style="font-weight:bold;"><?php _e('Post', "slideshow-gallery"); ?>:</label><br/>
86
- <?php if ($posts = get_posts(array('orderby' => "post_title", 'order' => "ASC", 'post_type' => "post", 'post_status' => ""))) : ?>
87
- <select name="post_id" id="post_id">
88
- <option value="">- <?php _e('Select a Post', "slideshow-gallery"); ?></option>
89
- <option value="th"><?php _e('THIS POST', "slideshow-gallery"); ?></option>
90
- <?php foreach ($posts as $post) : ?>
91
- <option value="<?php echo $post -> ID; ?>"><?php echo $post -> post_title; ?></option>
92
- <?php endforeach; ?>
93
- </select>
94
- <?php endif; ?>
95
  </p>
96
-
 
 
97
  <p>
98
- <label style="font-weight:bold;"><?php _e('Exclude', "slideshow-gallery"); ?>:</label><br/>
99
- <input type="text" name="exclude" value="" id="exclude" /><br/>
100
- <small><?php _e('comma separated IDs of attachments to exclude', "slideshow-gallery"); ?></small>
 
 
 
 
 
 
 
101
  </p>
102
  </div>
103
-
104
- <?php /*
105
- <table border="0" cellpadding="4" cellspacing="0">
106
- <tbody>
107
- <tr>
108
- <th nowrap="nowrap"><label for="category-menu"><?php _e("Category", 'wp-checkout'); ?></label></th>
109
- <td>
110
- <select id="category-menu" name="category" onchange="changeCategory();">
111
- <option value="">- <?php _e('Select Category', 'wp-checkout'); ?></option>
112
- <?php if ($categories = $Category -> select()) : ?>
113
- <?php foreach ($categories as $cat_id => $cat_title) : ?>
114
- <option value="<?php echo $cat_id; ?>"><?php echo $cat_title; ?></option>
115
- <?php endforeach; ?>
116
- <?php endif; ?>
117
- </select>
118
- </td>
119
- </tr>
120
- <tr id="product-selector">
121
- <th nowrap="nowrap"><label for="product-menu"><?php _e("Product", 'wp-checkout'); ?></label></th>
122
- <td><select id="product-menu" name="product" size="7"></select></td>
123
- </tr>
124
- </tbody>
125
- </table>
126
- */ ?>
127
  </div>
128
 
129
  <div class="mceActionPanel">
1
  <?php
2
 
3
+ global $wpdb;
4
+
5
  error_reporting(0);
6
  @ini_set('display_errors', 0);
7
 
17
  if(!current_user_can('edit_posts')) die;
18
  do_action('admin_init');
19
 
20
+ $galleriesquery = "SELECT * FROM `" . $wpdb -> prefix . "gallery_galleries` ORDER BY `title` ASC";
21
+ $galleries = $wpdb -> get_results($galleriesquery);
22
+
23
  ?>
24
 
25
 
26
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
27
  <html xmlns="http://www.w3.org/1999/xhtml">
28
  <head>
29
+ <title><?php _e('Insert a Slideshow Gallery', "slideshow-gallery"); ?></title>
30
  <script language="javascript" type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
31
  <script language="javascript" type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
32
  <script language="javascript" type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
38
 
39
  function insertTag () {
40
  var slideshow_type = jQuery('input[name="slideshow_type"]:checked').val();
41
+ var exclude = jQuery('#exclude').val();
42
 
43
  if (slideshow_type == "post") {
44
  var post_id = jQuery('#post_id').val();
45
+ if (post_id == "") { alert('<?php _e('Please fill in a post ID.', "slideshow-gallery"); ?>'); return false; }
46
+ var tag = '[slideshow post_id="' + post_id + '"';
 
 
47
 
48
+ if (exclude != "" && exclude != "undefined" && exclude != undefined) {
49
+ tag += ' exclude="' + exclude + '"';
 
 
50
  }
51
+
52
+ tag += ']';
53
  } else if (slideshow_type == "custom") {
54
+ var tag = '[slideshow';
55
+ if (exclude != "" && exclude != "undefined" && exclude != undefined) { tag += ' exclude="' + exclude + '"'; }
56
+ tag += ']';
57
+ } else if (slideshow_type == "gallery") {
58
+ var gallery_id = jQuery('#gallery_id').val();
59
+ if (gallery_id == "") { alert('<?php _e('Please select a gallery.', "slideshow-gallery"); ?>'); return false; }
60
+ var tag = '[slideshow gallery_id="' + gallery_id + '"';
61
+ if (exclude != "" && exclude != "undefined" && exclude != undefined) { tag += ' exclude="' + exclude + '"'; }
62
+ tag += ']';
63
  }
64
 
65
  if(window.tinyMCE) {
67
  tinyMCEPopup.editor.execCommand('mceRepaint');
68
  tinyMCEPopup.close();
69
  }
 
70
  }
71
 
72
+ function closePopup() {
73
  tinyMCEPopup.close();
74
  }
75
  </script>
88
 
89
  <form onsubmit="insertTag(); return false;" action="#">
90
  <div class="panel_wrapper">
91
+ <label style="font-weight:bold; cursor:pointer;"><input onclick="jQuery('#post_div').show(); jQuery('#gallery_div').hide();" type="radio" name="slideshow_type" value="post" id="type_post" /> <?php _e('Images From a Post', "slideshow-gallery"); ?></label><br/>
92
+ <label style="font-weight:bold; cursor:pointer;"><input onclick="jQuery('#post_div').hide(); jQuery('#gallery_div').show();" type="radio" name="slideshow_type" value="gallery" id="type_gallery" /> <?php _e('Slides From a Gallery', "slideshow-gallery"); ?></label><br/>
93
+ <label style="font-weight:bold; cursor:pointer;"><input onclick="jQuery('#post_div').hide(); jQuery('#gallery_div').hide();" type="radio" name="slideshow_type" value="custom" id="type_custom" /> <?php _e('All Available Slides', "slideshow-gallery"); ?></label>
94
 
95
  <div id="post_div" style="display:none;">
96
  <p>
97
+ <label for="post_id" style="font-weight:bold;"><?php _e('Post ID:', "slideshow-gallery"); ?></label><br/>
98
+ <input type="text" class="" name="post_id" value="" id="post_id" /><br/>
99
+ <small><?php _e('ID of the post to take images from.', "slideshow-gallery"); ?></small>
 
 
 
 
 
 
 
100
  </p>
101
+ </div>
102
+
103
+ <div id="gallery_div" style="display:none;">
104
  <p>
105
+ <label for="gallery_id" style="font-weight:bold;"><?php _e('Gallery:', "slideshow-gallery"); ?></label>
106
+ <select name="gallery_id" id="gallery_id">
107
+ <option value=""><?php _e('- Select Gallery -', "slideshow-gallery"); ?></option>
108
+ <?php if (!empty($galleries)) : ?>
109
+ <?php foreach ($galleries as $gallery) : ?>
110
+ <?php $slidescount = $wpdb -> get_var("SELECT COUNT(`id`) FROM `" . $wpdb -> prefix . "gallery_galleriesslides` WHERE `gallery_id` = '" . $gallery -> id . "'"); ?>
111
+ <option value="<?php echo $gallery -> id; ?>"><?php echo $gallery -> title; ?> (<?php echo $slidescount; ?>)</option>
112
+ <?php endforeach; ?>
113
+ <?php endif; ?>
114
+ </select>
115
  </p>
116
  </div>
117
+
118
+ <p>
119
+ <label style="font-weight:bold;"><?php _e('Exclude', "slideshow-gallery"); ?>:</label><br/>
120
+ <input type="text" name="exclude" value="" id="exclude" /><br/>
121
+ <small><?php _e('Comma separated IDs of attachments/slides to exclude', "slideshow-gallery"); ?></small>
122
+ </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  </div>
124
 
125
  <div class="mceActionPanel">
js/tinymce/editor_plugin.js CHANGED
@@ -12,8 +12,8 @@
12
  ed.addCommand('mcegallery', function() {
13
  ed.windowManager.open({
14
  file : url + '/dialog.php',
15
- width : 320,
16
- height : 230,
17
  inline : 1
18
  }, {
19
  plugin_url : url // Plugin absolute URL
@@ -25,14 +25,7 @@
25
  title : 'gallery.desc',
26
  cmd : 'mcegallery',
27
  image : url + '/gallery.png'
28
- });
29
-
30
- // Add a node change handler, selects the button in the UI when a image is selected
31
- /*ed.onNodeChange.add(function(ed, cm, n) {
32
- cm.setActive('Checkout', n.nodeName == 'IMG');
33
- });*/
34
-
35
-
36
  },
37
  createControl : function(n, cm) {
38
  return null;
12
  ed.addCommand('mcegallery', function() {
13
  ed.windowManager.open({
14
  file : url + '/dialog.php',
15
+ width : 400,
16
+ height : 250,
17
  inline : 1
18
  }, {
19
  plugin_url : url // Plugin absolute URL
25
  title : 'gallery.desc',
26
  cmd : 'mcegallery',
27
  image : url + '/gallery.png'
28
+ });
 
 
 
 
 
 
 
29
  },
30
  createControl : function(n, cm) {
31
  return null;
js/tinymce/error_log DELETED
@@ -1,4 +0,0 @@
1
- [31-May-2010 10:49:16] PHP Notice: Undefined variable: swDefaultTld in /home/tribunet/subdomains/dev/httpdocs/wp-content/plugins/wp-whois/vendors/samswhois/samswhois.inc.php on line 138
2
- [31-May-2010 10:49:16] PHP Notice: Undefined variable: number in /home/tribunet/subdomains/dev/httpdocs/wp-content/plugins/wp-whois/vendors/samswhois/samswhois.inc.php on line 241
3
- [31-May-2010 10:49:16] PHP Notice: Undefined variable: swForm in /home/tribunet/subdomains/dev/httpdocs/wp-content/plugins/wp-whois/vendors/samswhois/samswhois.inc.php on line 246
4
- [31-May-2010 10:49:16] PHP Notice: Undefined index: page in /home/tribunet/subdomains/dev/httpdocs/wp-content/themes/Simplism/functions.php on line 112
 
 
 
 
js/tinymce/gallery.png CHANGED
Binary file
js/tinymce/langs/en.js CHANGED
@@ -1,4 +1,4 @@
1
  tinyMCE.addI18n("en.gallery",{
2
- title : "Insert a slideshow",
3
- desc : "Insert a slideshow"
4
  });
1
  tinyMCE.addI18n("en.gallery",{
2
+ title : "Insert a Slideshow Gallery",
3
+ desc : "Insert a Slideshow Gallery"
4
  });
languages/slideshow-gallery-en_US.mo CHANGED
Binary file
languages/slideshow-gallery-en_US.po CHANGED
@@ -1,10 +1,10 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: WordPress Slideshow Gallery\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2010-11-19 09:33+0200\n"
6
  "PO-Revision-Date: \n"
7
- "Last-Translator: Antonie Potgieter <antonie@tribulant.com>\n"
8
  "Language-Team: Tribulant Software <support@tribulant.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -17,597 +17,792 @@ msgstr ""
17
  "X-Poedit-SearchPath-0: ..\n"
18
 
19
  #: ../slideshow-gallery-ajax.php:32
20
- #: ../tags/1.0/slideshow-gallery-ajax.php:28
21
  msgid "Slides have been ordered"
22
  msgstr ""
23
 
24
- #: ../slideshow-gallery-plugin.php:234
25
- #: ../tags/1.0/slideshow-gallery-plugin.php:203
26
  msgid "Uploads folder named \""
27
  msgstr ""
28
 
29
- #: ../slideshow-gallery.php:49
30
- #: ../tags/1.0/slideshow-gallery.php:32
31
  msgid "Slideshow"
32
  msgstr ""
33
 
34
- #: ../slideshow-gallery.php:50
35
  msgid "Manage Slides"
36
  msgstr ""
37
 
38
- #: ../slideshow-gallery.php:51
39
- #: ../tags/1.0/slideshow-gallery.php:33
 
 
 
40
  msgid "Configuration"
41
  msgstr ""
42
 
43
- #: ../slideshow-gallery.php:61
44
  msgid "Save Settings"
45
  msgstr ""
46
 
47
- #: ../slideshow-gallery.php:62
 
 
 
 
48
  msgid "General Settings"
49
  msgstr ""
50
 
51
- #: ../slideshow-gallery.php:63
52
  msgid "Links &amp; Images Overlay"
53
  msgstr ""
54
 
55
- #: ../slideshow-gallery.php:64
56
  msgid "Appearance &amp; Styles"
57
  msgstr ""
58
 
59
- #: ../slideshow-gallery.php:160
60
  msgid "Slide has been removed"
61
  msgstr ""
62
 
63
- #: ../slideshow-gallery.php:163
64
  msgid "Slide cannot be removed"
65
  msgstr ""
66
 
67
- #: ../slideshow-gallery.php:167
 
68
  msgid "No slide was specified"
69
  msgstr ""
70
 
71
- #: ../slideshow-gallery.php:175
72
- #: ../tags/1.0/slideshow-gallery.php:78
73
  msgid "Slide has been saved"
74
  msgstr ""
75
 
76
- #: ../slideshow-gallery.php:195
77
- #: ../tags/1.0/slideshow-gallery.php:100
78
  msgid "Selected slides have been removed"
79
  msgstr ""
80
 
81
- #: ../slideshow-gallery.php:200
82
- #: ../tags/1.0/slideshow-gallery.php:105
83
  msgid "No slides were selected"
84
  msgstr ""
85
 
86
- #: ../slideshow-gallery.php:204
87
- #: ../tags/1.0/slideshow-gallery.php:109
88
  msgid "No action was specified"
89
  msgstr ""
90
 
91
- #: ../slideshow-gallery.php:226
92
- #: ../tags/1.0/slideshow-gallery.php:131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  msgid "All configuration settings have been reset to their defaults"
94
  msgstr ""
95
 
96
- #: ../slideshow-gallery.php:230
97
- #: ../tags/1.0/slideshow-gallery.php:135
98
  msgid "Configuration settings could not be reset"
99
  msgstr ""
100
 
101
- #: ../slideshow-gallery.php:243
102
- #: ../tags/1.0/slideshow-gallery.php:148
103
  msgid "Configuration has been saved"
104
  msgstr ""
105
 
106
- #: ../js/tinymce/dialog.php:24
107
- msgid "Insert a slideshow"
 
 
 
 
108
  msgstr ""
109
 
110
- #: ../js/tinymce/dialog.php:80
 
 
 
 
111
  msgid "Images From a Post"
112
  msgstr ""
113
 
114
- #: ../js/tinymce/dialog.php:81
115
- msgid "Custom Added Slides"
 
 
 
 
 
 
 
 
116
  msgstr ""
117
 
118
- #: ../js/tinymce/dialog.php:85
119
- msgid "Post"
120
  msgstr ""
121
 
122
- #: ../js/tinymce/dialog.php:88
123
- msgid "Select a Post"
124
  msgstr ""
125
 
126
- #: ../js/tinymce/dialog.php:89
127
- msgid "THIS POST"
128
  msgstr ""
129
 
130
- #: ../js/tinymce/dialog.php:98
131
  msgid "Exclude"
132
  msgstr ""
133
 
134
- #: ../js/tinymce/dialog.php:100
135
- msgid "comma separated IDs of attachments to exclude"
136
  msgstr ""
137
 
138
- #: ../models/slide.php:64
 
139
  msgid "Please fill in a title"
140
  msgstr ""
141
 
142
- #: ../models/slide.php:65
 
 
 
 
 
 
143
  msgid "Please fill in a description"
144
  msgstr ""
145
 
146
- #: ../models/slide.php:66
147
  msgid "Please select an image type"
148
  msgstr ""
149
 
150
- #: ../models/slide.php:80
151
  msgid "The image did not upload, please try again"
152
  msgstr ""
153
 
154
- #: ../models/slide.php:81
155
  msgid "Image could not be moved from TMP to \"wp-content/uploads/\", please check permissions"
156
  msgstr ""
157
 
158
- #: ../models/slide.php:101
159
  msgid "The image file is too large"
160
  msgstr ""
161
 
162
- #: ../models/slide.php:104
163
  msgid "The image was partially uploaded, please try again"
164
  msgstr ""
165
 
166
- #: ../models/slide.php:107
167
  msgid "No image was chosen for uploading, please choose an image"
168
  msgstr ""
169
 
170
- #: ../models/slide.php:110
171
  msgid "No TMP directory has been specified for PHP to use, please ask your hosting provider"
172
  msgstr ""
173
 
174
- #: ../models/slide.php:113
175
  msgid "Image cannot be written to disc, please ask your hosting provider"
176
  msgstr ""
177
 
178
- #: ../models/slide.php:119
179
  msgid "Please specify an image"
180
  msgstr ""
181
 
182
- #: ../models/slide.php:147
183
- msgid "No data was posted"
184
- msgstr ""
185
-
186
- #: ../tags/1.0/trunk/vendors/class.paginate.php:176
187
  msgid "Displaying"
188
  msgstr ""
189
 
190
- #: ../tags/1.0/trunk/vendors/class.paginate.php:176
191
  msgid "of"
192
  msgstr ""
193
 
194
- #: ../tags/1.0/trunk/vendors/class.paginate.php:179
195
  msgid "Previous Page"
196
  msgstr ""
197
 
198
- #: ../tags/1.0/trunk/vendors/class.paginate.php:187
199
  msgid "Page"
200
  msgstr ""
201
 
202
- #: ../tags/1.0/trunk/vendors/class.paginate.php:198
203
  msgid "Next Page"
204
  msgstr ""
205
 
206
- #: ../tags/1.0/trunk/views/admin/settings.php:5
207
- #: ../tags/1.0/views/admin/settings.php:5
208
- msgid "Styles"
209
  msgstr ""
210
 
211
- #: ../tags/1.0/trunk/views/admin/settings.php:14
212
- #: ../tags/1.0/views/admin/settings.php:14
213
- msgid "Configuration Settings"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  msgstr ""
215
 
216
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:4
217
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  msgid "Auto Slide"
219
  msgstr ""
220
 
221
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:6
222
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:53
223
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:79
224
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:6
225
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:53
226
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:79
 
 
227
  msgid "Yes"
228
  msgstr ""
229
 
230
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:7
231
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:54
232
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:80
233
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:7
234
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:54
235
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:80
 
 
236
  msgid "No"
237
  msgstr ""
238
 
239
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:17
240
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:17
 
 
 
241
  msgid "Auto Speed"
242
  msgstr ""
243
 
244
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:19
245
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:113
246
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:19
247
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:113
248
  msgid "speed"
249
  msgstr ""
250
 
251
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:20
252
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:20
253
- msgid "default:10"
254
  msgstr ""
255
 
256
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:20
257
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:20
258
- msgid "lower number for shorter interval between images"
259
  msgstr ""
260
 
261
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:30
262
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:30
263
  msgid "Image Fading Speed"
264
  msgstr ""
265
 
266
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:33
267
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:33
268
- msgid "default:10 recommended:1-20"
 
 
 
 
 
 
 
269
  msgstr ""
270
 
271
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:33
272
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:33
273
- msgid "lower number for quicker fading of images"
274
  msgstr ""
275
 
276
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:37
277
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:37
278
  msgid "Navigation Default Opacity"
279
  msgstr ""
280
 
281
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:39
282
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:46
283
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:99
284
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:39
285
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:46
286
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:99
287
  msgid "&#37; <!-- percentage -->"
288
  msgstr ""
289
 
290
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:40
291
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:40
292
- msgid "opacity of the prev/next buttons by default"
293
  msgstr ""
294
 
295
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:44
296
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:44
297
  msgid "Navigation Hover Opacity"
298
  msgstr ""
299
 
300
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:47
301
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:47
302
- msgid "opacity of the prev/next buttons when they are hovered"
303
  msgstr ""
304
 
305
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:51
306
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:51
307
  msgid "Show Information"
308
  msgstr ""
309
 
310
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:64
311
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:64
 
 
 
312
  msgid "Information Speed"
313
  msgstr ""
314
 
315
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:67
316
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:67
317
- msgid "speed at which the information will slide in"
318
  msgstr ""
319
 
320
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:77
321
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:77
322
  msgid "Show Thumbnails"
323
  msgstr ""
324
 
325
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:90
326
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:90
 
 
 
327
  msgid "Thumbnails Position"
328
  msgstr ""
329
 
330
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:92
331
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:92
332
  msgid "Top"
333
  msgstr ""
334
 
335
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:93
336
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:93
337
  msgid "Bottom"
338
  msgstr ""
339
 
340
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:97
341
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:97
342
- msgid "Thumbnail Opacity"
343
  msgstr ""
344
 
345
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:100
346
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:100
347
- msgid "default opacity of thumbnails when they are not hovered"
348
  msgstr ""
349
 
350
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:104
351
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:104
352
- msgid "Thumbnail Active Border"
 
 
 
353
  msgstr ""
354
 
355
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:107
356
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:107
357
- msgid "border color (hexidecimal) for the active image thumbnail. default:#FFFFFF"
358
  msgstr ""
359
 
360
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:111
361
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:111
 
 
 
 
 
 
 
 
 
 
 
362
  msgid "Thumbnails Scroll Speed"
363
  msgstr ""
364
 
365
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:114
366
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:114
367
- msgid "default:5 recommended:1-20"
368
  msgstr ""
369
 
370
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:118
371
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:118
 
 
 
372
  msgid "Thumbnail Spacing"
373
  msgstr ""
374
 
375
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:120
376
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-styles.php:8
377
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-styles.php:15
378
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:120
379
  msgid "px"
380
  msgstr ""
381
 
382
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-general.php:121
383
- #: ../tags/1.0/views/admin/metaboxes/settings-general.php:121
384
- msgid "horizontal margin/spacing between thumbnails"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  msgstr ""
386
 
387
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-styles.php:6
388
  msgid "Gallery Width"
389
  msgstr ""
390
 
391
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-styles.php:9
392
- msgid "width of the slideshow gallery"
393
  msgstr ""
394
 
395
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-styles.php:13
396
  msgid "Gallery Height"
397
  msgstr ""
398
 
399
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-styles.php:16
400
- msgid "height of the slideshow gallery"
401
  msgstr ""
402
 
403
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-styles.php:20
404
  msgid "Slideshow Border"
405
  msgstr ""
406
 
407
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-styles.php:26
 
 
 
 
 
408
  msgid "Slideshow Background"
409
  msgstr ""
410
 
411
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-styles.php:32
 
 
 
 
 
412
  msgid "Information Background"
413
  msgstr ""
414
 
415
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-styles.php:38
 
 
 
 
 
416
  msgid "Information Text Color"
417
  msgstr ""
418
 
419
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-submit.php:6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  msgid "Reset all configuration settings to their default values"
421
  msgstr ""
422
 
423
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-submit.php:6
424
  msgid "Are you sure you wish to reset all configuration settings?"
425
  msgstr ""
426
 
427
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-submit.php:6
428
  msgid "Reset to Defaults"
429
  msgstr ""
430
 
431
- #: ../tags/1.0/trunk/views/admin/metaboxes/settings-submit.php:13
432
  msgid "Save Configuration"
433
  msgstr ""
434
 
435
- #: ../tags/1.0/trunk/views/admin/slides/index.php:2
436
- msgid "add new"
437
- msgstr ""
438
-
439
- #: ../tags/1.0/trunk/views/admin/slides/index.php:7
440
  msgid "slides"
441
  msgstr ""
442
 
443
- #: ../tags/1.0/trunk/views/admin/slides/index.php:14
444
  msgid "Are you sure you wish to execute this action on the selected slides?"
445
  msgstr ""
446
 
447
- #: ../tags/1.0/trunk/views/admin/slides/index.php:17
448
  msgid "Order all your slides"
449
  msgstr ""
450
 
451
- #: ../tags/1.0/trunk/views/admin/slides/index.php:17
452
- #: ../tags/1.0/trunk/views/admin/slides/order.php:2
453
  msgid "Order Slides"
454
  msgstr ""
455
 
456
- #: ../tags/1.0/trunk/views/admin/slides/index.php:20
457
- msgid "Bulk Actions"
 
458
  msgstr ""
459
 
460
- #: ../tags/1.0/trunk/views/admin/slides/index.php:21
461
- msgid "Delete"
 
462
  msgstr ""
463
 
464
- #: ../tags/1.0/trunk/views/admin/slides/index.php:23
465
- msgid "Apply"
 
 
466
  msgstr ""
467
 
468
- #: ../tags/1.0/trunk/views/admin/slides/index.php:32
469
- #: ../tags/1.0/trunk/views/admin/slides/index.php:41
470
- msgid "Image"
471
  msgstr ""
472
 
473
- #: ../tags/1.0/trunk/views/admin/slides/index.php:33
474
- #: ../tags/1.0/trunk/views/admin/slides/index.php:42
475
- #: ../tags/1.0/trunk/views/admin/slides/save.php:11
476
- msgid "Title"
477
  msgstr ""
478
 
479
- #: ../tags/1.0/trunk/views/admin/slides/index.php:34
480
- #: ../tags/1.0/trunk/views/admin/slides/index.php:43
481
- msgid "Date"
482
  msgstr ""
483
 
484
- #: ../tags/1.0/trunk/views/admin/slides/index.php:35
485
- #: ../tags/1.0/trunk/views/admin/slides/index.php:44
486
- msgid "Order"
487
  msgstr ""
488
 
489
- #: ../tags/1.0/trunk/views/admin/slides/order.php:5
490
- msgid "&larr; Manage All Slides"
 
491
  msgstr ""
492
 
493
- #: ../tags/1.0/trunk/views/admin/slides/order.php:47
494
- msgid "No slides found"
495
  msgstr ""
496
 
497
- #: ../tags/1.0/trunk/views/admin/slides/save.php:2
498
  msgid "Save a Slide"
499
  msgstr ""
500
 
501
- #: ../tags/1.0/trunk/views/admin/slides/save.php:18
502
- msgid "Description"
503
  msgstr ""
504
 
505
- #: ../tags/1.0/trunk/views/admin/slides/save.php:25
506
- msgid "Image URL"
507
  msgstr ""
508
 
509
- #: ../tags/1.0/trunk/views/admin/slides/save.php:32
510
- msgid "Link To"
511
  msgstr ""
512
 
513
- #: ../tags/1.0/trunk/views/admin/slides/save.php:39
514
- msgid "Save Slide"
515
  msgstr ""
516
 
517
- #: ../tags/1.0/trunk/views/default/gallery.php:24
518
- #: ../tags/1.0/trunk/views/default/gallery.php:48
519
- msgid "Slide Left"
520
  msgstr ""
521
 
522
- #: ../tags/1.0/trunk/views/default/gallery.php:28
523
- #: ../tags/1.0/trunk/views/default/gallery.php:52
524
- msgid "Slide Right"
525
  msgstr ""
526
 
527
- #: ../tags/1.0.3/views/admin/metaboxes/settings-styles.php:6
528
- msgid "Resize Images"
529
  msgstr ""
530
 
531
- #: ../tags/1.0.3/views/admin/metaboxes/settings-styles.php:10
532
- msgid "should images be resized proportionally to fit the width of the slideshow area"
533
  msgstr ""
534
 
535
- #: ../tags/1.0.4/views/admin/slides/index.php:2
536
- msgid "Add New"
537
  msgstr ""
538
 
539
- #: ../tags/1.0.4/views/admin/slides/save.php:32
540
- msgid "Use Link"
541
  msgstr ""
542
 
543
- #: ../tags/1.1/views/admin/slides/index.php:33
544
- #: ../tags/1.1/views/admin/slides/index.php:43
545
- msgid "Link"
546
  msgstr ""
547
 
548
- #: ../tags/1.1/views/admin/slides/index.php:59
549
- msgid "Edit"
550
  msgstr ""
551
 
552
- #: ../tags/1.1/views/admin/slides/index.php:60
553
- msgid "Are you sure you want to permanently remove this slide?"
554
  msgstr ""
555
 
556
- #: ../tags/1.1/views/admin/slides/save.php:14
557
- msgid "title/name of your slide as it will be displayed to your users."
558
  msgstr ""
559
 
560
- #: ../tags/1.1/views/admin/slides/save.php:22
561
- msgid "description of your slide as it will be displayed to your users below the title."
562
  msgstr ""
563
 
564
- #: ../tags/1.1/views/admin/slides/save.php:27
565
- msgid "Image Type"
566
  msgstr ""
567
 
568
- #: ../tags/1.1/views/admin/slides/save.php:29
569
- msgid "Upload File (recommended)"
570
  msgstr ""
571
 
572
- #: ../tags/1.1/views/admin/slides/save.php:30
573
- msgid "Specify URL"
574
  msgstr ""
575
 
576
- #: ../tags/1.1/views/admin/slides/save.php:32
577
- msgid "do you want to upload an image or specify a local/remote image URL?"
578
  msgstr ""
579
 
580
- #: ../tags/1.1/views/admin/slides/save.php:42
581
- msgid "Choose Image"
582
  msgstr ""
583
 
584
- #: ../tags/1.1/views/admin/slides/save.php:45
585
- msgid "choose your image file from your computer. JPG, PNG, GIF are supported."
586
  msgstr ""
587
 
588
- #: ../tags/1.1/views/admin/slides/save.php:58
589
- msgid "Current image. Leave the field above blank to keep this image."
590
  msgstr ""
591
 
592
- #: ../tags/1.1/views/admin/slides/save.php:79
593
- msgid "Local or remote image location eg. http://domain.com/path/to/image.jpg"
594
  msgstr ""
595
 
596
- #: ../tags/1.1/views/admin/slides/save.php:94
597
- msgid "set this to Yes to link this slide to a link/URL of your choice."
 
598
  msgstr ""
599
 
600
- #: ../tags/1.1/views/admin/slides/save.php:107
601
- msgid "link/URL to go to when a user clicks the slide eg. http://www.domain.com/mypage/"
 
602
  msgstr ""
603
 
604
- #: ../trunk/views/admin/metaboxes/settings-linksimages.php:4
605
- #: ../views/admin/metaboxes/settings-linksimages.php:4
606
- msgid "Open Images in Thickbox Overlay"
607
  msgstr ""
608
 
609
- #: ../trunk/views/admin/metaboxes/settings-linksimages.php:8
610
- #: ../views/admin/metaboxes/settings-linksimages.php:8
611
- msgid "turning this on (Yes) will open image URLs (.jpg, .png, .gif, .bmp) in a Thickbox image overlay"
612
  msgstr ""
613
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: WordPress Slideshow Gallery plugin\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-06-08 00:14+0200\n"
6
  "PO-Revision-Date: \n"
7
+ "Last-Translator: Tribulant Software <support@tribulant.com>\n"
8
  "Language-Team: Tribulant Software <support@tribulant.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
17
  "X-Poedit-SearchPath-0: ..\n"
18
 
19
  #: ../slideshow-gallery-ajax.php:32
 
20
  msgid "Slides have been ordered"
21
  msgstr ""
22
 
23
+ #: ../slideshow-gallery-plugin.php:230
 
24
  msgid "Uploads folder named \""
25
  msgstr ""
26
 
27
+ #: ../slideshow-gallery.php:62
 
28
  msgid "Slideshow"
29
  msgstr ""
30
 
31
+ #: ../slideshow-gallery.php:63
32
  msgid "Manage Slides"
33
  msgstr ""
34
 
35
+ #: ../slideshow-gallery.php:64
36
+ msgid "Manage Galleries"
37
+ msgstr ""
38
+
39
+ #: ../slideshow-gallery.php:65
40
  msgid "Configuration"
41
  msgstr ""
42
 
43
+ #: ../slideshow-gallery.php:75
44
  msgid "Save Settings"
45
  msgstr ""
46
 
47
+ #: ../slideshow-gallery.php:76
48
+ msgid "About Us"
49
+ msgstr ""
50
+
51
+ #: ../slideshow-gallery.php:77
52
  msgid "General Settings"
53
  msgstr ""
54
 
55
+ #: ../slideshow-gallery.php:78
56
  msgid "Links &amp; Images Overlay"
57
  msgstr ""
58
 
59
+ #: ../slideshow-gallery.php:79
60
  msgid "Appearance &amp; Styles"
61
  msgstr ""
62
 
63
+ #: ../slideshow-gallery.php:234
64
  msgid "Slide has been removed"
65
  msgstr ""
66
 
67
+ #: ../slideshow-gallery.php:237
68
  msgid "Slide cannot be removed"
69
  msgstr ""
70
 
71
+ #: ../slideshow-gallery.php:241
72
+ #: ../models/galleryslides.php:63
73
  msgid "No slide was specified"
74
  msgstr ""
75
 
76
+ #: ../slideshow-gallery.php:249
 
77
  msgid "Slide has been saved"
78
  msgstr ""
79
 
80
+ #: ../slideshow-gallery.php:269
 
81
  msgid "Selected slides have been removed"
82
  msgstr ""
83
 
84
+ #: ../slideshow-gallery.php:274
85
+ #: ../slideshow-gallery.php:355
86
  msgid "No slides were selected"
87
  msgstr ""
88
 
89
+ #: ../slideshow-gallery.php:278
90
+ #: ../slideshow-gallery.php:359
91
  msgid "No action was specified"
92
  msgstr ""
93
 
94
+ #: ../slideshow-gallery.php:299
95
+ msgid "Gallery has been saved"
96
+ msgstr ""
97
+
98
+ #: ../slideshow-gallery.php:329
99
+ msgid "Gallery has been removed"
100
+ msgstr ""
101
+
102
+ #: ../slideshow-gallery.php:332
103
+ msgid "Gallery cannot be removed"
104
+ msgstr ""
105
+
106
+ #: ../slideshow-gallery.php:336
107
+ #: ../models/galleryslides.php:62
108
+ msgid "No gallery was specified"
109
+ msgstr ""
110
+
111
+ #: ../slideshow-gallery.php:350
112
+ msgid "Selected galleries have been removed"
113
+ msgstr ""
114
+
115
+ #: ../slideshow-gallery.php:377
116
  msgid "All configuration settings have been reset to their defaults"
117
  msgstr ""
118
 
119
+ #: ../slideshow-gallery.php:381
 
120
  msgid "Configuration settings could not be reset"
121
  msgstr ""
122
 
123
+ #: ../slideshow-gallery.php:394
 
124
  msgid "Configuration has been saved"
125
  msgstr ""
126
 
127
+ #: ../js/tinymce/dialog.php:29
128
+ msgid "Insert a Slideshow Gallery"
129
+ msgstr ""
130
+
131
+ #: ../js/tinymce/dialog.php:45
132
+ msgid "Please fill in a post ID."
133
  msgstr ""
134
 
135
+ #: ../js/tinymce/dialog.php:59
136
+ msgid "Please select a gallery."
137
+ msgstr ""
138
+
139
+ #: ../js/tinymce/dialog.php:91
140
  msgid "Images From a Post"
141
  msgstr ""
142
 
143
+ #: ../js/tinymce/dialog.php:92
144
+ msgid "Slides From a Gallery"
145
+ msgstr ""
146
+
147
+ #: ../js/tinymce/dialog.php:93
148
+ msgid "All Available Slides"
149
+ msgstr ""
150
+
151
+ #: ../js/tinymce/dialog.php:97
152
+ msgid "Post ID:"
153
  msgstr ""
154
 
155
+ #: ../js/tinymce/dialog.php:99
156
+ msgid "ID of the post to take images from."
157
  msgstr ""
158
 
159
+ #: ../js/tinymce/dialog.php:105
160
+ msgid "Gallery:"
161
  msgstr ""
162
 
163
+ #: ../js/tinymce/dialog.php:107
164
+ msgid "- Select Gallery -"
165
  msgstr ""
166
 
167
+ #: ../js/tinymce/dialog.php:119
168
  msgid "Exclude"
169
  msgstr ""
170
 
171
+ #: ../js/tinymce/dialog.php:121
172
+ msgid "Comma separated IDs of attachments/slides to exclude"
173
  msgstr ""
174
 
175
+ #: ../models/gallery.php:75
176
+ #: ../models/slide.php:80
177
  msgid "Please fill in a title"
178
  msgstr ""
179
 
180
+ #: ../models/gallery.php:77
181
+ #: ../models/galleryslides.php:72
182
+ #: ../models/slide.php:139
183
+ msgid "No data was posted"
184
+ msgstr ""
185
+
186
+ #: ../models/slide.php:81
187
  msgid "Please fill in a description"
188
  msgstr ""
189
 
190
+ #: ../models/slide.php:82
191
  msgid "Please select an image type"
192
  msgstr ""
193
 
194
+ #: ../models/slide.php:96
195
  msgid "The image did not upload, please try again"
196
  msgstr ""
197
 
198
+ #: ../models/slide.php:97
199
  msgid "Image could not be moved from TMP to \"wp-content/uploads/\", please check permissions"
200
  msgstr ""
201
 
202
+ #: ../models/slide.php:105
203
  msgid "The image file is too large"
204
  msgstr ""
205
 
206
+ #: ../models/slide.php:108
207
  msgid "The image was partially uploaded, please try again"
208
  msgstr ""
209
 
210
+ #: ../models/slide.php:111
211
  msgid "No image was chosen for uploading, please choose an image"
212
  msgstr ""
213
 
214
+ #: ../models/slide.php:114
215
  msgid "No TMP directory has been specified for PHP to use, please ask your hosting provider"
216
  msgstr ""
217
 
218
+ #: ../models/slide.php:117
219
  msgid "Image cannot be written to disc, please ask your hosting provider"
220
  msgstr ""
221
 
222
+ #: ../models/slide.php:123
223
  msgid "Please specify an image"
224
  msgstr ""
225
 
226
+ #: ../vendors/class.paginate.php:176
 
 
 
 
227
  msgid "Displaying"
228
  msgstr ""
229
 
230
+ #: ../vendors/class.paginate.php:176
231
  msgid "of"
232
  msgstr ""
233
 
234
+ #: ../vendors/class.paginate.php:179
235
  msgid "Previous Page"
236
  msgstr ""
237
 
238
+ #: ../vendors/class.paginate.php:187
239
  msgid "Page"
240
  msgstr ""
241
 
242
+ #: ../vendors/class.paginate.php:198
243
  msgid "Next Page"
244
  msgstr ""
245
 
246
+ #: ../views/admin/settings.php:16
247
+ msgid "Configuration Settings"
 
248
  msgstr ""
249
 
250
+ #: ../views/admin/galleries/index.php:6
251
+ #: ../views/admin/slides/index.php:6
252
+ msgid "Add New"
253
+ msgstr ""
254
+
255
+ #: ../views/admin/galleries/index.php:11
256
+ msgid "galleries"
257
+ msgstr ""
258
+
259
+ #: ../views/admin/galleries/index.php:15
260
+ msgid "Are you sure you wish to execute this action on the selected galleries?"
261
+ msgstr ""
262
+
263
+ #: ../views/admin/galleries/index.php:19
264
+ #: ../views/admin/slides/loop.php:8
265
+ msgid "- Bulk Actions -"
266
+ msgstr ""
267
+
268
+ #: ../views/admin/galleries/index.php:20
269
+ #: ../views/admin/galleries/index.php:53
270
+ #: ../views/admin/galleries/view.php:13
271
+ #: ../views/admin/slides/loop.php:9
272
+ #: ../views/admin/slides/loop.php:54
273
+ msgid "Delete"
274
  msgstr ""
275
 
276
+ #: ../views/admin/galleries/index.php:22
277
+ #: ../views/admin/slides/loop.php:11
278
+ msgid "Apply"
279
+ msgstr ""
280
+
281
+ #: ../views/admin/galleries/index.php:31
282
+ #: ../views/admin/galleries/index.php:39
283
+ #: ../views/admin/galleries/save.php:14
284
+ #: ../views/admin/slides/loop.php:22
285
+ #: ../views/admin/slides/loop.php:34
286
+ #: ../views/admin/slides/save.php:15
287
+ msgid "Title"
288
+ msgstr ""
289
+
290
+ #: ../views/admin/galleries/index.php:32
291
+ #: ../views/admin/galleries/index.php:40
292
+ msgid "Slides"
293
+ msgstr ""
294
+
295
+ #: ../views/admin/galleries/index.php:33
296
+ #: ../views/admin/galleries/index.php:41
297
+ #: ../views/admin/slides/loop.php:25
298
+ #: ../views/admin/slides/loop.php:37
299
+ msgid "Date"
300
+ msgstr ""
301
+
302
+ #: ../views/admin/galleries/index.php:51
303
+ msgid "View"
304
+ msgstr ""
305
+
306
+ #: ../views/admin/galleries/index.php:52
307
+ #: ../views/admin/galleries/view.php:12
308
+ #: ../views/admin/slides/loop.php:53
309
+ msgid "Edit"
310
+ msgstr ""
311
+
312
+ #: ../views/admin/galleries/index.php:53
313
+ #: ../views/admin/slides/loop.php:54
314
+ msgid "Are you sure you want to permanently remove this slide?"
315
+ msgstr ""
316
+
317
+ #: ../views/admin/galleries/index.php:71
318
+ #: ../views/admin/slides/save.php:39
319
+ msgid "No galleries are available."
320
+ msgstr ""
321
+
322
+ #: ../views/admin/galleries/save.php:6
323
+ msgid "Save a Gallery"
324
+ msgstr ""
325
+
326
+ #: ../views/admin/galleries/save.php:17
327
+ msgid "Title of this gallery for identification purposes."
328
+ msgstr ""
329
+
330
+ #: ../views/admin/galleries/save.php:25
331
+ msgid "Save Gallery"
332
+ msgstr ""
333
+
334
+ #: ../views/admin/galleries/view.php:6
335
+ #, php-format
336
+ msgid "View Gallery: %s"
337
+ msgstr ""
338
+
339
+ #: ../views/admin/galleries/view.php:8
340
+ msgid "&larr; All Galleries"
341
+ msgstr ""
342
+
343
+ #: ../views/admin/galleries/view.php:8
344
+ msgid "All Galleries"
345
+ msgstr ""
346
+
347
+ #: ../views/admin/galleries/view.php:12
348
+ msgid "Edit Gallery"
349
+ msgstr ""
350
+
351
+ #: ../views/admin/galleries/view.php:13
352
+ msgid "Are you sure you want to delete this gallery?"
353
+ msgstr ""
354
+
355
+ #: ../views/admin/galleries/view.php:13
356
+ msgid "Delete Gallery"
357
+ msgstr ""
358
+
359
+ #: ../views/admin/metaboxes/settings-general.php:4
360
  msgid "Auto Slide"
361
  msgstr ""
362
 
363
+ #: ../views/admin/metaboxes/settings-general.php:6
364
+ #: ../views/admin/metaboxes/settings-general.php:40
365
+ #: ../views/admin/metaboxes/settings-general.php:74
366
+ #: ../views/admin/metaboxes/settings-general.php:101
367
+ #: ../views/admin/metaboxes/settings-linksimages.php:6
368
+ #: ../views/admin/metaboxes/settings-styles.php:8
369
+ #: ../views/admin/slides/loop.php:71
370
+ #: ../views/admin/slides/save.php:107
371
  msgid "Yes"
372
  msgstr ""
373
 
374
+ #: ../views/admin/metaboxes/settings-general.php:7
375
+ #: ../views/admin/metaboxes/settings-general.php:41
376
+ #: ../views/admin/metaboxes/settings-general.php:75
377
+ #: ../views/admin/metaboxes/settings-general.php:102
378
+ #: ../views/admin/metaboxes/settings-linksimages.php:7
379
+ #: ../views/admin/metaboxes/settings-styles.php:9
380
+ #: ../views/admin/slides/loop.php:74
381
+ #: ../views/admin/slides/save.php:108
382
  msgid "No"
383
  msgstr ""
384
 
385
+ #: ../views/admin/metaboxes/settings-general.php:8
386
+ msgid "Should image slides automatically slide?"
387
+ msgstr ""
388
+
389
+ #: ../views/admin/metaboxes/settings-general.php:18
390
  msgid "Auto Speed"
391
  msgstr ""
392
 
393
+ #: ../views/admin/metaboxes/settings-general.php:20
394
+ #: ../views/admin/metaboxes/settings-general.php:141
 
 
395
  msgid "speed"
396
  msgstr ""
397
 
398
+ #: ../views/admin/metaboxes/settings-general.php:21
399
+ msgid "Speed for auto sliding. Lower number for shorter interval between images."
 
400
  msgstr ""
401
 
402
+ #: ../views/admin/metaboxes/settings-general.php:21
403
+ msgid "(Default/Recommended: 10)"
 
404
  msgstr ""
405
 
406
+ #: ../views/admin/metaboxes/settings-general.php:31
 
407
  msgid "Image Fading Speed"
408
  msgstr ""
409
 
410
+ #: ../views/admin/metaboxes/settings-general.php:34
411
+ msgid "Speed for fading of images. Lower number for quicker fading of images."
412
+ msgstr ""
413
+
414
+ #: ../views/admin/metaboxes/settings-general.php:34
415
+ msgid "(Default: 10, Recommended: 1-20)"
416
+ msgstr ""
417
+
418
+ #: ../views/admin/metaboxes/settings-general.php:38
419
+ msgid "Show Image Navigation"
420
  msgstr ""
421
 
422
+ #: ../views/admin/metaboxes/settings-general.php:42
423
+ msgid "Show next/previous buttons on the image for navigation purposes?"
 
424
  msgstr ""
425
 
426
+ #: ../views/admin/metaboxes/settings-general.php:52
 
427
  msgid "Navigation Default Opacity"
428
  msgstr ""
429
 
430
+ #: ../views/admin/metaboxes/settings-general.php:54
431
+ #: ../views/admin/metaboxes/settings-general.php:61
432
+ #: ../views/admin/metaboxes/settings-general.php:134
 
 
 
433
  msgid "&#37; <!-- percentage -->"
434
  msgstr ""
435
 
436
+ #: ../views/admin/metaboxes/settings-general.php:55
437
+ msgid "Opacity of the next/previous buttons by default."
 
438
  msgstr ""
439
 
440
+ #: ../views/admin/metaboxes/settings-general.php:59
 
441
  msgid "Navigation Hover Opacity"
442
  msgstr ""
443
 
444
+ #: ../views/admin/metaboxes/settings-general.php:62
445
+ msgid "Opacity of the next/previous buttons when they are hovered."
 
446
  msgstr ""
447
 
448
+ #: ../views/admin/metaboxes/settings-general.php:72
 
449
  msgid "Show Information"
450
  msgstr ""
451
 
452
+ #: ../views/admin/metaboxes/settings-general.php:76
453
+ msgid "Should the information bar be shown on slides?"
454
+ msgstr ""
455
+
456
+ #: ../views/admin/metaboxes/settings-general.php:86
457
  msgid "Information Speed"
458
  msgstr ""
459
 
460
+ #: ../views/admin/metaboxes/settings-general.php:89
461
+ msgid "Speed at which the information bar will slide in and out."
 
462
  msgstr ""
463
 
464
+ #: ../views/admin/metaboxes/settings-general.php:99
 
465
  msgid "Show Thumbnails"
466
  msgstr ""
467
 
468
+ #: ../views/admin/metaboxes/settings-general.php:103
469
+ msgid "Should the thumbnails bar be shown for slides?"
470
+ msgstr ""
471
+
472
+ #: ../views/admin/metaboxes/settings-general.php:113
473
  msgid "Thumbnails Position"
474
  msgstr ""
475
 
476
+ #: ../views/admin/metaboxes/settings-general.php:115
 
477
  msgid "Top"
478
  msgstr ""
479
 
480
+ #: ../views/admin/metaboxes/settings-general.php:116
 
481
  msgid "Bottom"
482
  msgstr ""
483
 
484
+ #: ../views/admin/metaboxes/settings-general.php:117
485
+ msgid "Choose your preferred position of the thumbnails bar relative to the slideshow images."
 
486
  msgstr ""
487
 
488
+ #: ../views/admin/metaboxes/settings-general.php:121
489
+ msgid "Thumbnail Dimensions"
 
490
  msgstr ""
491
 
492
+ #: ../views/admin/metaboxes/settings-general.php:124
493
+ msgid "x <!-- by -->"
494
+ msgstr ""
495
+
496
+ #: ../views/admin/metaboxes/settings-general.php:126
497
+ msgid "px <!-- pixels -->"
498
  msgstr ""
499
 
500
+ #: ../views/admin/metaboxes/settings-general.php:127
501
+ msgid "Width and height of the thumbnails for the slides."
 
502
  msgstr ""
503
 
504
+ #: ../views/admin/metaboxes/settings-general.php:128
505
+ msgid "You may leave the width empty (not the height) to crop proportionally."
506
+ msgstr ""
507
+
508
+ #: ../views/admin/metaboxes/settings-general.php:132
509
+ msgid "Thumbnail Opacity"
510
+ msgstr ""
511
+
512
+ #: ../views/admin/metaboxes/settings-general.php:135
513
+ msgid "Default opacity of thumbnails when they are not hovered."
514
+ msgstr ""
515
+
516
+ #: ../views/admin/metaboxes/settings-general.php:139
517
  msgid "Thumbnails Scroll Speed"
518
  msgstr ""
519
 
520
+ #: ../views/admin/metaboxes/settings-general.php:142
521
+ msgid "Speed at which the thumbnails will scroll."
 
522
  msgstr ""
523
 
524
+ #: ../views/admin/metaboxes/settings-general.php:142
525
+ msgid "(Default:5, Recommended: 1-20)"
526
+ msgstr ""
527
+
528
+ #: ../views/admin/metaboxes/settings-general.php:146
529
  msgid "Thumbnail Spacing"
530
  msgstr ""
531
 
532
+ #: ../views/admin/metaboxes/settings-general.php:148
533
+ #: ../views/admin/metaboxes/settings-styles.php:16
534
+ #: ../views/admin/metaboxes/settings-styles.php:23
 
535
  msgid "px"
536
  msgstr ""
537
 
538
+ #: ../views/admin/metaboxes/settings-general.php:149
539
+ msgid "Horizontal margin/spacing in pixels between thumbnail images."
540
+ msgstr ""
541
+
542
+ #: ../views/admin/metaboxes/settings-linksimages.php:4
543
+ msgid "Open Images in Thickbox Overlay"
544
+ msgstr ""
545
+
546
+ #: ../views/admin/metaboxes/settings-linksimages.php:8
547
+ msgid "turning this on (Yes) will open image URLs (.jpg, .png, .gif, .bmp) in a Thickbox image overlay"
548
+ msgstr ""
549
+
550
+ #: ../views/admin/metaboxes/settings-styles.php:6
551
+ msgid "Resize Images"
552
+ msgstr ""
553
+
554
+ #: ../views/admin/metaboxes/settings-styles.php:10
555
+ msgid "Should images be resized proportionally to fit the width of the slideshow area?"
556
  msgstr ""
557
 
558
+ #: ../views/admin/metaboxes/settings-styles.php:14
559
  msgid "Gallery Width"
560
  msgstr ""
561
 
562
+ #: ../views/admin/metaboxes/settings-styles.php:17
563
+ msgid "Width of the slideshow gallery"
564
  msgstr ""
565
 
566
+ #: ../views/admin/metaboxes/settings-styles.php:21
567
  msgid "Gallery Height"
568
  msgstr ""
569
 
570
+ #: ../views/admin/metaboxes/settings-styles.php:24
571
+ msgid "Height of the slideshow gallery"
572
  msgstr ""
573
 
574
+ #: ../views/admin/metaboxes/settings-styles.php:28
575
  msgid "Slideshow Border"
576
  msgstr ""
577
 
578
+ #: ../views/admin/metaboxes/settings-styles.php:31
579
+ #, php-format
580
+ msgid "Border style/color for the entire slideshow wrapper eg. %s"
581
+ msgstr ""
582
+
583
+ #: ../views/admin/metaboxes/settings-styles.php:35
584
  msgid "Slideshow Background"
585
  msgstr ""
586
 
587
+ #: ../views/admin/metaboxes/settings-styles.php:38
588
+ #, php-format
589
+ msgid "Background color (hexidecimal) of the entire slideshow wrapper eg. %s"
590
+ msgstr ""
591
+
592
+ #: ../views/admin/metaboxes/settings-styles.php:42
593
  msgid "Information Background"
594
  msgstr ""
595
 
596
+ #: ../views/admin/metaboxes/settings-styles.php:45
597
+ #, php-format
598
+ msgid "Background color (hexidecimal) of the information bar eg. %s"
599
+ msgstr ""
600
+
601
+ #: ../views/admin/metaboxes/settings-styles.php:49
602
  msgid "Information Text Color"
603
  msgstr ""
604
 
605
+ #: ../views/admin/metaboxes/settings-styles.php:52
606
+ #, php-format
607
+ msgid "Text color (hexidecimal) of the information bar content eg. %s"
608
+ msgstr ""
609
+
610
+ #: ../views/admin/metaboxes/settings-styles.php:56
611
+ msgid "Thumbnail Active Border"
612
+ msgstr ""
613
+
614
+ #: ../views/admin/metaboxes/settings-styles.php:59
615
+ #, php-format
616
+ msgid "Border color (hexidecimal) for the active image thumbnail eg. %s"
617
+ msgstr ""
618
+
619
+ #: ../views/admin/metaboxes/settings-submit.php:5
620
  msgid "Reset all configuration settings to their default values"
621
  msgstr ""
622
 
623
+ #: ../views/admin/metaboxes/settings-submit.php:5
624
  msgid "Are you sure you wish to reset all configuration settings?"
625
  msgstr ""
626
 
627
+ #: ../views/admin/metaboxes/settings-submit.php:5
628
  msgid "Reset to Defaults"
629
  msgstr ""
630
 
631
+ #: ../views/admin/metaboxes/settings-submit.php:11
632
  msgid "Save Configuration"
633
  msgstr ""
634
 
635
+ #: ../views/admin/slides/index.php:11
 
 
 
 
636
  msgid "slides"
637
  msgstr ""
638
 
639
+ #: ../views/admin/slides/loop.php:2
640
  msgid "Are you sure you wish to execute this action on the selected slides?"
641
  msgstr ""
642
 
643
+ #: ../views/admin/slides/loop.php:5
644
  msgid "Order all your slides"
645
  msgstr ""
646
 
647
+ #: ../views/admin/slides/loop.php:5
648
+ #: ../views/admin/slides/order.php:6
649
  msgid "Order Slides"
650
  msgstr ""
651
 
652
+ #: ../views/admin/slides/loop.php:20
653
+ #: ../views/admin/slides/loop.php:32
654
+ msgid "ID"
655
  msgstr ""
656
 
657
+ #: ../views/admin/slides/loop.php:21
658
+ #: ../views/admin/slides/loop.php:33
659
+ msgid "Image"
660
  msgstr ""
661
 
662
+ #: ../views/admin/slides/loop.php:23
663
+ #: ../views/admin/slides/loop.php:35
664
+ #: ../views/admin/slides/save.php:31
665
+ msgid "Galleries"
666
  msgstr ""
667
 
668
+ #: ../views/admin/slides/loop.php:24
669
+ #: ../views/admin/slides/loop.php:36
670
+ msgid "Link"
671
  msgstr ""
672
 
673
+ #: ../views/admin/slides/loop.php:26
674
+ #: ../views/admin/slides/loop.php:38
675
+ msgid "Order"
 
676
  msgstr ""
677
 
678
+ #: ../views/admin/slides/loop.php:66
679
+ msgid "None"
 
680
  msgstr ""
681
 
682
+ #: ../views/admin/slides/loop.php:72
683
+ msgid "Open"
 
684
  msgstr ""
685
 
686
+ #: ../views/admin/slides/loop.php:90
687
+ #: ../views/admin/slides/order.php:55
688
+ msgid "No slides found"
689
  msgstr ""
690
 
691
+ #: ../views/admin/slides/order.php:9
692
+ msgid "&larr; Manage All Slides"
693
  msgstr ""
694
 
695
+ #: ../views/admin/slides/save.php:6
696
  msgid "Save a Slide"
697
  msgstr ""
698
 
699
+ #: ../views/admin/slides/save.php:18
700
+ msgid "title/name of your slide as it will be displayed to your users."
701
  msgstr ""
702
 
703
+ #: ../views/admin/slides/save.php:23
704
+ msgid "Description"
705
  msgstr ""
706
 
707
+ #: ../views/admin/slides/save.php:26
708
+ msgid "description of your slide as it will be displayed to your users below the title."
709
  msgstr ""
710
 
711
+ #: ../views/admin/slides/save.php:34
712
+ msgid "Select All"
713
  msgstr ""
714
 
715
+ #: ../views/admin/slides/save.php:41
716
+ msgid "Assign this slide to one or more galleries."
 
717
  msgstr ""
718
 
719
+ #: ../views/admin/slides/save.php:45
720
+ msgid "Image Type"
 
721
  msgstr ""
722
 
723
+ #: ../views/admin/slides/save.php:47
724
+ msgid "Upload File (recommended)"
725
  msgstr ""
726
 
727
+ #: ../views/admin/slides/save.php:48
728
+ msgid "Specify URL"
729
  msgstr ""
730
 
731
+ #: ../views/admin/slides/save.php:50
732
+ msgid "do you want to upload an image or specify a local/remote image URL?"
733
  msgstr ""
734
 
735
+ #: ../views/admin/slides/save.php:60
736
+ msgid "Choose Image"
737
  msgstr ""
738
 
739
+ #: ../views/admin/slides/save.php:63
740
+ msgid "choose your image file from your computer. JPG, PNG, GIF are supported."
 
741
  msgstr ""
742
 
743
+ #: ../views/admin/slides/save.php:73
744
+ msgid "Current image. Leave the field above blank to keep this image."
745
  msgstr ""
746
 
747
+ #: ../views/admin/slides/save.php:91
748
+ msgid "Image URL"
749
  msgstr ""
750
 
751
+ #: ../views/admin/slides/save.php:94
752
+ msgid "Local or remote image location eg. http://domain.com/path/to/image.jpg"
753
  msgstr ""
754
 
755
+ #: ../views/admin/slides/save.php:105
756
+ msgid "Use Link"
757
  msgstr ""
758
 
759
+ #: ../views/admin/slides/save.php:109
760
+ msgid "set this to Yes to link this slide to a link/URL of your choice."
761
  msgstr ""
762
 
763
+ #: ../views/admin/slides/save.php:119
764
+ msgid "Link To"
765
  msgstr ""
766
 
767
+ #: ../views/admin/slides/save.php:122
768
+ msgid "link/URL to go to when a user clicks the slide eg. http://www.domain.com/mypage/"
769
  msgstr ""
770
 
771
+ #: ../views/admin/slides/save.php:126
772
+ msgid "Link Target"
773
  msgstr ""
774
 
775
+ #: ../views/admin/slides/save.php:128
776
+ msgid "Current Window"
777
  msgstr ""
778
 
779
+ #: ../views/admin/slides/save.php:129
780
+ msgid "New/Blank Window"
781
  msgstr ""
782
 
783
+ #: ../views/admin/slides/save.php:130
784
+ msgid "Should this link open in the current window or a new window?"
785
  msgstr ""
786
 
787
+ #: ../views/admin/slides/save.php:138
788
+ msgid "Save Slide"
789
  msgstr ""
790
 
791
+ #: ../views/default/gallery.php:61
792
+ #: ../views/default/gallery.php:92
793
+ msgid "Slide Left"
794
  msgstr ""
795
 
796
+ #: ../views/default/gallery.php:65
797
+ #: ../views/default/gallery.php:96
798
+ msgid "Slide Right"
799
  msgstr ""
800
 
801
+ #: ../views/default/gallery.php:74
802
+ msgid "Previous Image"
 
803
  msgstr ""
804
 
805
+ #: ../views/default/gallery.php:79
806
+ msgid "Next Image"
 
807
  msgstr ""
808
 
models/_notes/dwsync.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <dwsync>
3
- <file name="slide.php" server="wpplugins.biz/public_html/" local="129344368134298570" remote="129344367600000000" />
4
- </dwsync>
 
 
 
 
models/gallery.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class GalleryGallery extends GalleryDbHelper {
4
+
5
+ var $table;
6
+ var $model = 'Gallery';
7
+ var $controller = "galleries";
8
+ var $plugin_name = 'slideshow-gallery';
9
+
10
+ var $data = array();
11
+ var $errors = array();
12
+
13
+ var $fields = array(
14
+ 'id' => "INT(11) NOT NULL AUTO_INCREMENT",
15
+ 'title' => "VARCHAR(150) NOT NULL DEFAULT ''",
16
+ 'created' => "DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'",
17
+ 'modified' => "DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'",
18
+ 'key' => "PRIMARY KEY (`id`)",
19
+ );
20
+
21
+ function GalleryGallery($data = array()) {
22
+ global $wpdb;
23
+ $this -> table = $wpdb -> prefix . strtolower($this -> pre) . "_" . $this -> controller;
24
+ if (is_admin()) { $this -> check_table($this -> model); }
25
+
26
+ if (!empty($data)) {
27
+ foreach ($data as $dkey => $dval) {
28
+ $this -> {$dkey} = $dval;
29
+
30
+ switch ($dkey) {
31
+ case 'id' :
32
+ $slidescountquery = "SELECT COUNT(`id`) FROM `" . $wpdb -> prefix . strtolower($this -> pre) . "_galleriesslides` WHERE `gallery_id` = '" . $dval . "'";
33
+ $this -> slidescount = $wpdb -> get_var($slidescountquery);
34
+ break;
35
+ }
36
+ }
37
+ }
38
+
39
+ return true;
40
+ }
41
+
42
+ function select() {
43
+ $select = array();
44
+
45
+ if ($galleries = $this -> find_all()) {
46
+ foreach ($galleries as $gallery) {
47
+ $select[$gallery -> id] = $gallery -> title;
48
+ }
49
+ }
50
+
51
+ return $select;
52
+ }
53
+
54
+ function defaults() {
55
+ $defaults = array(
56
+ 'created' => GalleryHtmlHelper::gen_date(),
57
+ 'modified' => GalleryHtmlHelper::gen_date(),
58
+ );
59
+
60
+ return $defaults;
61
+ }
62
+
63
+ function validate($data = null) {
64
+ $this -> errors = array();
65
+
66
+ if (!empty($data)) {
67
+ $data = (empty($data[$this -> model])) ? $data : $data[$this -> model];
68
+
69
+ foreach ($data as $dkey => $dval) {
70
+ $this -> data -> {$dkey} = stripslashes($dval);
71
+ }
72
+
73
+ extract($data, EXTR_SKIP);
74
+
75
+ if (empty($title)) { $this -> errors['title'] = __('Please fill in a title', $this -> plugin_name); }
76
+ } else {
77
+ $this -> errors[] = __('No data was posted', $this -> plugin_name);
78
+ }
79
+
80
+ return $this -> errors;
81
+ }
82
+ }
83
+
84
+ ?>
models/galleryslides.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class GalleryGallerySlides extends GalleryDbHelper {
4
+
5
+ var $table;
6
+ var $model = 'GallerySlides';
7
+ var $controller = "galleriesslides";
8
+ var $plugin_name = 'slideshow-gallery';
9
+
10
+ var $data = array();
11
+ var $errors = array();
12
+
13
+ var $fields = array(
14
+ 'id' => "INT(11) NOT NULL AUTO_INCREMENT",
15
+ 'gallery_id' => "INT(11) NOT NULL DEFAULT '0'",
16
+ 'slide_id' => "INT(11) NOT NULL DEFAULT '0'",
17
+ 'created' => "DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'",
18
+ 'modified' => "DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'",
19
+ 'key' => "PRIMARY KEY (`id`)",
20
+ );
21
+
22
+ function GalleryGallerySlides($data = array()) {
23
+ global $wpdb;
24
+ $this -> table = $wpdb -> prefix . strtolower($this -> pre) . "_" . $this -> controller;
25
+ if (is_admin()) { $this -> check_table($this -> model); }
26
+
27
+ if (!empty($data)) {
28
+ foreach ($data as $dkey => $dval) {
29
+ $this -> {$dkey} = $dval;
30
+ }
31
+ }
32
+
33
+ return true;
34
+ }
35
+
36
+ function table() {
37
+ $this -> table = $wpdb -> prefix . strtolower($this -> pre) . "_" . $this -> controller;
38
+ return $this -> table;
39
+ }
40
+
41
+ function defaults() {
42
+ $defaults = array(
43
+ 'created' => GalleryHtmlHelper::gen_date(),
44
+ 'modified' => GalleryHtmlHelper::gen_date(),
45
+ );
46
+
47
+ return $defaults;
48
+ }
49
+
50
+ function validate($data = null) {
51
+ $this -> errors = array();
52
+
53
+ if (!empty($data)) {
54
+ $data = (empty($data[$this -> model])) ? $data : $data[$this -> model];
55
+
56
+ foreach ($data as $dkey => $dval) {
57
+ $this -> data -> {$dkey} = stripslashes($dval);
58
+ }
59
+
60
+ extract($data, EXTR_SKIP);
61
+
62
+ if (empty($gallery_id)) { $this -> errors['title'] = __('No gallery was specified', $this -> plugin_name); }
63
+ if (empty($slide_id)) { $this -> errors['title'] = __('No slide was specified', $this -> plugin_name); }
64
+
65
+ if (empty($this -> errors)) {
66
+ if ($galleryslide = $this -> find(array('gallery_id' => $gallery_id, 'slide_id' => $slide_id))) {
67
+ $this -> debug($galleryslide);
68
+ exit();
69
+ }
70
+ }
71
+ } else {
72
+ $this -> errors[] = __('No data was posted', $this -> plugin_name);
73
+ }
74
+
75
+ return $this -> errors;
76
+ }
77
+ }
78
+
79
+ ?>
models/slide.php CHANGED
@@ -18,6 +18,7 @@ class GallerySlide extends GalleryDbHelper {
18
  'type' => "ENUM('file','url') NOT NULL DEFAULT 'file'",
19
  'image_url' => "VARCHAR(200) NOT NULL DEFAULT ''",
20
  'uselink' => "ENUM('Y','N') NOT NULL DEFAULT 'N'",
 
21
  'link' => "VARCHAR(200) NOT NULL DEFAULT ''",
22
  'order' => "INT(11) NOT NULL DEFAULT '0'",
23
  'created' => "DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'",
@@ -28,11 +29,29 @@ class GallerySlide extends GalleryDbHelper {
28
  function GallerySlide($data = array()) {
29
  global $wpdb;
30
  $this -> table = $wpdb -> prefix . strtolower($this -> pre) . "_" . $this -> controller;
31
- $this -> check_table($this -> model);
32
 
33
  if (!empty($data)) {
34
  foreach ($data as $dkey => $dval) {
35
  $this -> {$dkey} = $dval;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
  }
38
 
@@ -41,6 +60,7 @@ class GallerySlide extends GalleryDbHelper {
41
 
42
  function defaults() {
43
  $defaults = array(
 
44
  'order' => 0,
45
  'created' => GalleryHtmlHelper::gen_date(),
46
  'modified' => GalleryHtmlHelper::gen_date(),
@@ -54,11 +74,7 @@ class GallerySlide extends GalleryDbHelper {
54
 
55
  if (!empty($data)) {
56
  $data = (empty($data[$this -> model])) ? $data : $data[$this -> model];
57
-
58
- foreach ($data as $dkey => $dval) {
59
- $this -> data -> {$dkey} = stripslashes($dval);
60
- }
61
-
62
  extract($data, EXTR_SKIP);
63
 
64
  if (empty($title)) { $this -> errors['title'] = __('Please fill in a title', $this -> plugin_name); }
@@ -81,18 +97,6 @@ class GallerySlide extends GalleryDbHelper {
81
  elseif (!move_uploaded_file($_FILES['image_file']['tmp_name'], $imagefull)) { $this -> errors['image_file'] = __('Image could not be moved from TMP to "wp-content/uploads/", please check permissions', $this -> plugin_name); }
82
  else {
83
  $this -> data -> image = $imagename;
84
-
85
- $name = GalleryHtmlHelper::strip_ext($imagename, 'filename');
86
- $ext = GalleryHtmlHelper::strip_ext($imagename, 'ext');
87
- $thumbfull = $imagepath . $name . '-thumb.' . $ext;
88
- $smallfull = $imagepath . $name . '-small.' . $ext;
89
-
90
- image_resize($imagefull, $width = null, $height = 75, $crop = false, $append = 'thumb', $dest = null, $quality = 100);
91
- image_resize($imagefull, $width = 50, $height = 50, $crop = true, $append = 'small', $dest = null, $quality = 100);
92
-
93
- @chmod($imagefull, 0777);
94
- @chmod($thumbfull, 0777);
95
- @chmod($smallfull, 0777);
96
  }
97
  } else {
98
  switch ($_FILES['image_file']['error']) {
@@ -127,18 +131,6 @@ class GallerySlide extends GalleryDbHelper {
127
  $fh = @fopen($filefull, "w");
128
  @fwrite($fh, $image);
129
  @fclose($fh);
130
-
131
- $name = GalleryHtmlHelper::strip_ext($filename, 'filename');
132
- $ext = GalleryHtmlHelper::strip_ext($filename, 'ext');
133
- $thumbfull = $filepath . $name . '-thumb.' . $ext;
134
- $smallfull = $filepath . $name . '-small.' . $ext;
135
-
136
- image_resize($filefull, $width = null, $height = 75, $crop = false, $append = 'thumb', $dest = null, $quality = 100);
137
- image_resize($filefull, $width = 50, $height = 50, $crop = true, $append = 'small', $dest = null, $quality = 100);
138
-
139
- @chmod($filefull, 0777);
140
- @chmod($thumbfull, 0777);
141
- @chmod($smallfull, 0777);
142
  }
143
  }
144
  }
18
  'type' => "ENUM('file','url') NOT NULL DEFAULT 'file'",
19
  'image_url' => "VARCHAR(200) NOT NULL DEFAULT ''",
20
  'uselink' => "ENUM('Y','N') NOT NULL DEFAULT 'N'",
21
+ 'linktarget' => "ENUM('self','blank') NOT NULL DEFAULT 'self'",
22
  'link' => "VARCHAR(200) NOT NULL DEFAULT ''",
23
  'order' => "INT(11) NOT NULL DEFAULT '0'",
24
  'created' => "DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'",
29
  function GallerySlide($data = array()) {
30
  global $wpdb;
31
  $this -> table = $wpdb -> prefix . strtolower($this -> pre) . "_" . $this -> controller;
32
+ if (is_admin()) { $this -> check_table($this -> model); }
33
 
34
  if (!empty($data)) {
35
  foreach ($data as $dkey => $dval) {
36
  $this -> {$dkey} = $dval;
37
+
38
+ switch ($dkey) {
39
+ case 'id' :
40
+ $this -> galleries = array();
41
+ $this -> gallery = array();
42
+
43
+ $galleryslidesquery = "SELECT * FROM `" . $wpdb -> prefix . strtolower($this -> pre) . "_galleriesslides` WHERE `slide_id` = '" . $dval . "'";
44
+ if ($galleryslides = $wpdb -> get_results($galleryslidesquery)) {
45
+ foreach ($galleryslides as $galleryslide) {
46
+ $this -> galleries[] = $galleryslide -> gallery_id;
47
+ $this -> gallery[$galleryslide -> gallery_id] = $wpdb -> get_row("SELECT * FROM `" . $wpdb -> prefix . strtolower($this -> pre) . "_galleries` WHERE `id` = '" . $galleryslide -> gallery_id . "'");
48
+ }
49
+ }
50
+ break;
51
+ case 'image' :
52
+ $this -> image_path = 'wp-content/uploads/slideshow-gallery/' . $dval;
53
+ break;
54
+ }
55
  }
56
  }
57
 
60
 
61
  function defaults() {
62
  $defaults = array(
63
+ 'galleries' => false,
64
  'order' => 0,
65
  'created' => GalleryHtmlHelper::gen_date(),
66
  'modified' => GalleryHtmlHelper::gen_date(),
74
 
75
  if (!empty($data)) {
76
  $data = (empty($data[$this -> model])) ? $data : $data[$this -> model];
77
+ $data = stripslashes_deep($data);
 
 
 
 
78
  extract($data, EXTR_SKIP);
79
 
80
  if (empty($title)) { $this -> errors['title'] = __('Please fill in a title', $this -> plugin_name); }
97
  elseif (!move_uploaded_file($_FILES['image_file']['tmp_name'], $imagefull)) { $this -> errors['image_file'] = __('Image could not be moved from TMP to "wp-content/uploads/", please check permissions', $this -> plugin_name); }
98
  else {
99
  $this -> data -> image = $imagename;
 
 
 
 
 
 
 
 
 
 
 
 
100
  }
101
  } else {
102
  switch ($_FILES['image_file']['error']) {
131
  $fh = @fopen($filefull, "w");
132
  @fwrite($fh, $image);
133
  @fclose($fh);
 
 
 
 
 
 
 
 
 
 
 
 
134
  }
135
  }
136
  }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Slideshow Gallery ===
2
- Contributors: Antonie Potgieter, Tribulant Software
3
  Donate link: http://tribulant.com/
4
  Tags: wordpress plugins, wordpress slideshow gallery, slides, slideshow, image gallery, images, gallery, featured content, content gallery, javascript, javascript slideshow, slideshow gallery
5
  Requires at least: 2.9
6
- Tested up to: 3.0.1
7
- Stable tag: 1.1.1
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
@@ -12,13 +12,33 @@ Feature content in a JavaScript powered slideshow gallery showcase on your WordP
12
 
13
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website.
14
 
15
- You can easily display multiple galleries throughout your WordPress website displaying your custom added slides or showing slides from WordPress posts.
16
 
17
  The slideshow is flexible and all aspects can easily be configured.
18
 
19
- Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert `[slideshow]` into its content with an optional `post_id` parameter to display the gallery images uploaded to that post/page `[slideshow post_id=123]`. You can also use an `exclude` parameter to exclude certain images by their order in the gallery (comma separated) from the slideshow like this `[slideshow post_id=123 exclude="3,7,9"]`.
20
-
21
- To hardcode into any PHP file of your WordPress theme, simply use `<?php if (class_exists('Gallery')) { $Gallery = new Gallery(); $Gallery -> slideshow($output = true, $post_id = null); }; ?>`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  == Installation ==
24
 
@@ -29,7 +49,7 @@ Installing the WordPress slideshow gallery plugin is very easy. Simply follow th
29
  1. Activate the plugin through the 'Plugins' menu in WordPress
30
  1. Configure the settings according to your needs through the 'Slideshow' > 'Configuration' menu
31
  1. Add and manage your slides in the 'Slideshow' section
32
- 1. Put `[slideshow post_id="X" exclude=""]` to embed a slideshow with the images of a post into your posts/pages or use `[slideshow custom=1]` to embed a slideshow with your custom added slides or `<?php if (class_exists('Gallery')) { $Gallery = new Gallery(); $Gallery -> slideshow($output = true, $post_id = null); }; ?>` into your WordPress theme
33
 
34
  == Frequently Asked Questions ==
35
 
@@ -37,13 +57,17 @@ Installing the WordPress slideshow gallery plugin is very easy. Simply follow th
37
 
38
  Yes, you can, but only one slideshow per page.
39
 
 
 
 
 
40
  = How do I display the images uploaded to a post? =
41
 
42
  You can embed a slideshow and show the images uploaded to a post with the `post_id` parameter. Like this `[slideshow post_id="123"]`.
43
 
44
  = Can I exclude certain images from a post in the slideshow? =
45
 
46
- Yes, you can use the `exclude` parameter to exclude post images by their order in the gallery (comma separated) like this `[slideshow post_id=123 exclude="2,4,8"]`.
47
 
48
  == Screenshots ==
49
 
@@ -56,28 +80,33 @@ Yes, you can use the `exclude` parameter to exclude post images by their order i
56
 
57
  == Changelog ==
58
 
59
- = 1.0 =
60
- * Initial release of the WordPress Slideshow Gallery plugin
61
-
62
- = 1.0.3 =
63
- * ADDED: Default, English language file in the `languages` folder.
64
- * ADDED: Configuration setting to turn On/Off resizing of images via CSS.
65
- * ADDED: Webkit border radius in CSS for thumbnail images.
66
- * ADDED: `post_id` parameter for the `[slideshow]` shortcode to display images from a post/page.
67
- * IMPROVED: Plugin doesn't utilize PHP short open tags anymore.
68
- * COMPATIBILITY: Removed `autoLoad` (introduced in PHP 5) parameter from `class_exists` function for PHP 4 compatibility.
69
- * IMPROVED: Directory separator constant DS from DIRECTORY_SEPARATOR.
70
-
71
- = 1.0.4 =
72
- * COMPATIBILITY: WordPress 2.9
73
- * FIXED: #fullsize z-index to keep below other elements such as drop down menus.
74
-
75
- = 1.0.4 =
76
- * IMPROVED: WordPress 2.9 sortable meta boxes.
77
- * FIXED: `wp_redirect()` fatal error in dashboard.
78
- * ADDED: TinyMCE editor button to quickly insert slideshows into posts/pages.
79
- * ADDED: `exclude` parameter to use in conjunction with the `post_id` parameter to exclude attachments by order.
80
- * CHANGED: Changed `#wrapper` in the HTML markup to `#slideshow-wrapper` due to some theme conflicts.
 
 
 
 
 
81
 
82
  = 1.1 =
83
  * ADDED: "THIS POST" added to the TinyMCE dialog to insert a shortcode for a slideshow of the current post
@@ -89,4 +118,27 @@ Yes, you can use the `exclude` parameter to exclude post images by their order i
89
  * ADDED: "Link" column in the "Manage Slides" section
90
  * FIXED: Load Thickbox on the 'Manage Slides' page for the enlargements
91
  * ADDED: Ability to upload an image when saving a slide rather than specifying a URL
92
- * ADDED: Row actions in the 'Manage Slides' section
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  === Slideshow Gallery ===
2
+ Contributors: contrid
3
  Donate link: http://tribulant.com/
4
  Tags: wordpress plugins, wordpress slideshow gallery, slides, slideshow, image gallery, images, gallery, featured content, content gallery, javascript, javascript slideshow, slideshow gallery
5
  Requires at least: 2.9
6
+ Tested up to: 3.3.2
7
+ Stable tag: 1.2
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
12
 
13
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website.
14
 
15
+ You can easily display multiple galleries throughout your WordPress website displaying your custom added slides, slide galleries or showing slides from WordPress posts.
16
 
17
  The slideshow is flexible and all aspects can easily be configured.
18
 
19
+ Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert `[slideshow]` into its content with an optional `gallery_id` parameter to show slides from a specific gallery `[slideshow gallery_id="7"]` or an optional `post_id` parameter to display the gallery images uploaded to that post/page `[slideshow post_id="123"]`. You can also use an `exclude` parameter to exclude certain images (attachments/slides) by their IDs in the gallery (comma separated) from the slideshow like this `[slideshow post_id="123" exclude="3,7,9"]`.
20
+
21
+ To hardcode into any PHP file of your WordPress theme, simply use `<?php if (function_exists('slideshow')) { slideshow($output = true, $gallery_id = false, $post_id = false, $params = array()); } ?>`.
22
+
23
+ You can use any of the following parameters with both the hardcoding and shortcode to customize each slideshow gallery:
24
+
25
+ * `resizeimages` [ true | false ] = Set to 'true' to resize images to fit the slideshow dimensions.
26
+ * `orderby` [ random ] = Set to 'random' to randomly order the slides. Leave this shortcode parameter to order by the order set on the slides.
27
+ * `width` [ width | auto ] = Width of the slideshow in pixels. Don't specify 'px' part, just the numeric value for the height.
28
+ * `height` [ height ] (default: setting) = Height of the slideshow in pixels. Don't specify the 'px' part, just the numeric value for the height.
29
+ * `auto` [ true | false ] (default: setting) = Set this to 'true' to automatically slide the slides in the slideshow.
30
+ * `autospeed` [ speed ] (default: setting) = Speed of the auto sliding. 10 is normal. Lower number is faster. Between 5 and 15 is recommended.
31
+ * `fadespeed` [ speed ] (default: setting) = Speed of the fading of images. 10 is normal. Lower number is faster. Between 1 and 20 is recommended.
32
+ * `shownav` [ true | false ] (default: setting) = Set to 'true' to show the next/previous image navigation buttons.
33
+ * `navopacity` [ opacity ] (default: setting) = The opacity of the next/previous buttons. Between 0 and 100 with 0 being transparent and 100 being fully opaque.
34
+ * `navhoveropacity` [ opacity ] (default: setting) = The opacity of the next/previous buttons on hovering. Between 0 and 100 with 0 being transparent and 100 being fully opaque.
35
+ * `showinfo` [ true | false ] (default: setting) = Set to 'true' to show the information bar for each slide.
36
+ * `infospeed` [ speed ] (default: setting) = Speed at which the information bar will slide up. Between 5 and 15 is recommended.
37
+ * `showthumbs` [ true | false ] (default: setting) = Set to 'true' to show the thumbnails for the slides.
38
+ * `thumbsposition` [ top | bottom ] (default: setting) = Set to "top" to show above the slideshow.
39
+ * `thumbsborder` [ hexidecimal color ] (default: setting) = Hex color of the active thumb border. For example #333333.
40
+ * `thumbsspeed` [ speed> ] (default: setting) = Speed of the thumbnail bar scrolling. Lower is slower. Between 1 and 20 is recommended.
41
+ * `thumbsspacing` [ spacing ] (default: setting) = An integer value in pixels to space the thumbnails apart. Don’t include the 'px' part, just the number. Between 0 and 10 is recommended.
42
 
43
  == Installation ==
44
 
49
  1. Activate the plugin through the 'Plugins' menu in WordPress
50
  1. Configure the settings according to your needs through the 'Slideshow' > 'Configuration' menu
51
  1. Add and manage your slides in the 'Slideshow' section
52
+ 1. Put `[slideshow post_id="X" exclude=""]` to embed a slideshow with the images of a post into your posts/pages or use `[slideshow gallery_id="X"]` to display the slides of a specific gallery by ID or use `[slideshow]` to embed a slideshow with your custom added slides or `<?php if (function_exists('slideshow')) { slideshow($output = true, $gallery_id = false, $post_id = false, $params = array()); } ?>` into your WordPress theme using PHP code.
53
 
54
  == Frequently Asked Questions ==
55
 
57
 
58
  Yes, you can, but only one slideshow per page.
59
 
60
+ = How can I display specific slides in a slideshow gallery instance? =
61
+
62
+ You can organize slides either into multiple galleries according to your needs or you can upload images to WordPress posts and display the images uploaded to a post.
63
+
64
  = How do I display the images uploaded to a post? =
65
 
66
  You can embed a slideshow and show the images uploaded to a post with the `post_id` parameter. Like this `[slideshow post_id="123"]`.
67
 
68
  = Can I exclude certain images from a post in the slideshow? =
69
 
70
+ Yes, you can use the `exclude` parameter to exclude post images by their order in the gallery (comma separated) like this `[slideshow post_id="123" exclude="2,4,8"]`.
71
 
72
  == Screenshots ==
73
 
80
 
81
  == Changelog ==
82
 
83
+ = 1.2 =
84
+ * ADD: 'About Us' box in the Configuration section
85
+ * IMPROVE: Better, more usable hardcoding procedure
86
+ * FIX: Slideshow goes left
87
+ * IMPROVE: auto width property
88
+ * ADD: Banner image for WordPress.org directory
89
+ * IMPROVE: Use load_plugin_textdomain instead for language file
90
+ * ADD: Order slides by random?
91
+ * FIX: Enqueue scripts/styles at the right time
92
+ * ADD: Link target (current/new window) setting on each slide for link
93
+ * IMPROVE: Hide next/previous navigation when there is only one slide
94
+ * ADD: TimThumb integration for cropping images
95
+ * CHANGE: Colorbox for popup images
96
+ * ADD: 'Open' link to test slide links
97
+ * ADD: Icon in each section of the plugin
98
+ * CHANGE: Author name on WordPress.org to link appropriately
99
+ * ADD: Dimensions for thumbnail images
100
+ * CHANGE: New icon image for the admin menu
101
+ * IMPROVE: Change 1=1 for the CSS
102
+ * FIX: Code showing in the RSS feed.
103
+ * ADD: Shortcode parameters
104
+ * ADD: Multiple slideshows per post/page
105
+ * ADD: Setting to turn off the next/previous navigation
106
+ * IMPROVE: "Previous Image" and "Next Image" in language file
107
+ * FIX: Not all thumbnails load the first time
108
+ * IMPROVE: Remove black borders left and right of the image
109
+ * IMPROVE: Removed link overlay which displayed white in IE6
110
 
111
  = 1.1 =
112
  * ADDED: "THIS POST" added to the TinyMCE dialog to insert a shortcode for a slideshow of the current post
118
  * ADDED: "Link" column in the "Manage Slides" section
119
  * FIXED: Load Thickbox on the 'Manage Slides' page for the enlargements
120
  * ADDED: Ability to upload an image when saving a slide rather than specifying a URL
121
+ * ADDED: Row actions in the 'Manage Slides' section
122
+
123
+ = 1.0.4 =
124
+ * IMPROVED: WordPress 2.9 sortable meta boxes.
125
+ * FIXED: `wp_redirect()` fatal error in dashboard.
126
+ * ADDED: TinyMCE editor button to quickly insert slideshows into posts/pages.
127
+ * ADDED: `exclude` parameter to use in conjunction with the `post_id` parameter to exclude attachments by order.
128
+ * CHANGED: Changed `#wrapper` in the HTML markup to `#slideshow-wrapper` due to some theme conflicts.
129
+
130
+ = 1.0.4 =
131
+ * COMPATIBILITY: WordPress 2.9
132
+ * FIXED: #fullsize z-index to keep below other elements such as drop down menus.
133
+
134
+ = 1.0.3 =
135
+ * ADDED: Default, English language file in the `languages` folder.
136
+ * ADDED: Configuration setting to turn On/Off resizing of images via CSS.
137
+ * ADDED: Webkit border radius in CSS for thumbnail images.
138
+ * ADDED: `post_id` parameter for the `[slideshow]` shortcode to display images from a post/page.
139
+ * IMPROVED: Plugin doesn't utilize PHP short open tags anymore.
140
+ * COMPATIBILITY: Removed `autoLoad` (introduced in PHP 5) parameter from `class_exists` function for PHP 4 compatibility.
141
+ * IMPROVED: Directory separator constant DS from DIRECTORY_SEPARATOR.
142
+
143
+ = 1.0 =
144
+ * Initial release of the WordPress Slideshow Gallery plugin
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-6.png CHANGED
Binary file
slideshow-gallery-plugin.php CHANGED
@@ -2,49 +2,40 @@
2
 
3
  class GalleryPlugin {
4
 
5
- var $version = '1.1.1';
6
  var $plugin_name;
7
  var $plugin_base;
8
  var $pre = 'Gallery';
9
 
10
  var $menus = array();
11
  var $sections = array(
12
- 'gallery' => 'gallery',
13
- 'settings' => 'gallery-settings',
 
14
  );
15
 
16
  var $helpers = array('Db', 'Html', 'Form', 'Metabox');
17
- var $models = array('Slide');
18
 
19
  var $debugging = false; //set to "true" to turn on debugging
20
- var $debug_level = 1; //set to 2 for PHP and DB errors or 1 for just DB errors
21
 
22
  function register_plugin($name, $base) {
23
  $this -> plugin_name = $name;
24
  $this -> plugin_base = rtrim(dirname($base), DS);
25
  $this -> sections = (object) $this -> sections;
26
 
27
- $this -> enqueue_scripts();
28
- $this -> enqueue_styles();
29
-
30
  $this -> initialize_classes();
31
  $this -> initialize_options();
32
 
33
- if (function_exists('load_plugin_textdomain')) {
34
- $currentlocale = get_locale();
35
- if(!empty($currentlocale)) {
36
- $moFile = dirname(__FILE__) . DS . "languages" . DS . $this -> plugin_name . "-" . $currentlocale . ".mo";
37
- if(@file_exists($moFile) && is_readable($moFile)) {
38
- load_textdomain($this -> plugin_name, $moFile);
39
- }
40
- }
41
- }
42
-
43
  global $wpdb;
44
  if ($this -> debugging == true) {
45
  $wpdb -> show_errors();
46
- error_reporting(E_ALL ^ E_NOTICE);
47
- @ini_set('display_errors', 1);
 
 
 
48
  } else {
49
  $wpdb -> hide_errors();
50
  error_reporting(0);
@@ -70,7 +61,7 @@ class GalleryPlugin {
70
  return false;
71
  }
72
 
73
- function initialize_classes() {
74
  if (!empty($this -> helpers)) {
75
  foreach ($this -> helpers as $helper) {
76
  $hfile = dirname(__FILE__) . DS . 'helpers' . DS . strtolower($helper) . '.php';
@@ -109,6 +100,8 @@ class GalleryPlugin {
109
  }
110
 
111
  function initialize_options() {
 
 
112
  $styles = array(
113
  'width' => "450",
114
  'height' => "250",
@@ -123,11 +116,14 @@ class GalleryPlugin {
123
 
124
  //General Settings
125
  $this -> add_option('fadespeed', 10);
 
126
  $this -> add_option('navopacity', 25);
127
  $this -> add_option('navhover', 70);
128
  $this -> add_option('information', "Y");
129
  $this -> add_option('infospeed', 10);
130
  $this -> add_option('thumbnails', "N");
 
 
131
  $this -> add_option('thumbposition', "bottom");
132
  $this -> add_option('thumbopacity', 70);
133
  $this -> add_option('thumbscrollspeed', 5);
@@ -138,15 +134,15 @@ class GalleryPlugin {
138
  $this -> add_option('imagesthickbox', "N");
139
  }
140
 
141
- function render_msg($message = '') {
142
  $this -> render('msg-top', array('message' => $message), true, 'admin');
143
  }
144
 
145
- function render_err($message = '') {
146
  $this -> render('err-top', array('message' => $message), true, 'admin');
147
  }
148
 
149
- function redirect($location = '', $msgtype = '', $message = '') {
150
  $url = $location;
151
 
152
  if ($msgtype == "message") {
@@ -204,7 +200,7 @@ class GalleryPlugin {
204
  return false;
205
  }
206
 
207
- function vendor($name = '', $folder = '') {
208
  if (!empty($name)) {
209
  $filename = 'class.' . strtolower($name) . '.php';
210
  $filepath = rtrim(dirname(__FILE__), DS) . DS . 'vendors' . DS . $folder . '';
@@ -255,14 +251,16 @@ class GalleryPlugin {
255
  return false;
256
  }
257
 
 
 
 
 
258
  function enqueue_scripts() {
259
  wp_enqueue_script('jquery');
260
 
261
  if (is_admin()) {
262
- if (!empty($_GET['page']) && in_array($_GET['page'], (array) $this -> sections)) {
263
- wp_enqueue_script('autosave');
264
-
265
- if ($_GET['page'] == 'gallery-settings') {
266
  wp_enqueue_script('common');
267
  wp_enqueue_script('wp-lists');
268
  wp_enqueue_script('postbox');
@@ -270,37 +268,55 @@ class GalleryPlugin {
270
  wp_enqueue_script('settings-editor', '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/settings-editor.js', array('jquery'), '1.0');
271
  }
272
 
273
- if ($_GET['page'] == "gallery" && $_GET['method'] == "order") {
274
  wp_enqueue_script('jquery-ui-sortable');
275
  }
276
-
277
- add_thickbox();
278
  }
279
 
 
280
  wp_enqueue_script($this -> plugin_name . 'admin', '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/admin.js', null, '1.0');
281
  } else {
282
  wp_enqueue_script($this -> plugin_name, '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/gallery.js', null, '1.0');
283
 
284
  if ($this -> get_option('imagesthickbox') == "Y") {
285
- add_thickbox();
286
  }
287
  }
288
 
289
  return true;
290
  }
291
 
292
- function enqueue_styles() {
293
- if (!is_admin()) {
294
- $src = '/' . PLUGINDIR . '/' . $this -> plugin_name . '/css/gallery-css.php?1=1';
 
 
 
 
 
295
 
296
- if ($styles = $this -> get_option('styles')) {
297
- foreach ($styles as $skey => $sval) {
298
- $src .= "&amp;" . $skey . "=" . urlencode($sval);
299
- }
300
  }
301
-
302
- wp_enqueue_style($this -> plugin_name, $src, null, '1.0', 'screen');
303
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
 
305
  return true;
306
  }
@@ -321,7 +337,7 @@ class GalleryPlugin {
321
  return false;
322
  }
323
 
324
- function update_option($name = '', $value = '') {
325
  if (update_option($this -> pre . $name, $value)) {
326
  return true;
327
  }
@@ -329,7 +345,7 @@ class GalleryPlugin {
329
  return false;
330
  }
331
 
332
- function get_option($name = '', $stripslashes = true) {
333
  if ($option = get_option($this -> pre . $name)) {
334
  if (@unserialize($option) !== false) {
335
  return unserialize($option);
@@ -424,7 +440,7 @@ class GalleryPlugin {
424
  return false;
425
  }
426
 
427
- function delete_field($table = '', $field = '') {
428
  global $wpdb;
429
 
430
  if (!empty($table)) {
@@ -440,7 +456,7 @@ class GalleryPlugin {
440
  return false;
441
  }
442
 
443
- function change_field($table = '', $field = '', $newfield = '', $attributes = "TEXT NOT NULL") {
444
  global $wpdb;
445
 
446
  if (!empty($table)) {
@@ -466,7 +482,7 @@ class GalleryPlugin {
466
  return false;
467
  }
468
 
469
- function add_field($table = '', $field = '', $attributes = "TEXT NOT NULL") {
470
  global $wpdb;
471
 
472
  if (!empty($table)) {
@@ -488,8 +504,11 @@ class GalleryPlugin {
488
  return false;
489
  }
490
 
491
- function render($file = '', $params = array(), $output = true, $folder = 'admin') {
492
  if (!empty($file)) {
 
 
 
493
  $filename = $file . '.php';
494
  $filepath = $this -> plugin_base() . DS . 'views' . DS . $folder . DS;
495
  $filefull = $filepath . $filename;
2
 
3
  class GalleryPlugin {
4
 
5
+ var $version = '1.2';
6
  var $plugin_name;
7
  var $plugin_base;
8
  var $pre = 'Gallery';
9
 
10
  var $menus = array();
11
  var $sections = array(
12
+ 'slides' => 'slideshow-slides',
13
+ 'galleries' => 'slideshow-galleries',
14
+ 'settings' => 'slideshow-settings',
15
  );
16
 
17
  var $helpers = array('Db', 'Html', 'Form', 'Metabox');
18
+ var $models = array('Slide', 'Gallery', 'GallerySlides');
19
 
20
  var $debugging = false; //set to "true" to turn on debugging
21
+ var $debug_level = 2; //set to 2 for PHP and DB errors or 1 for just DB errors
22
 
23
  function register_plugin($name, $base) {
24
  $this -> plugin_name = $name;
25
  $this -> plugin_base = rtrim(dirname($base), DS);
26
  $this -> sections = (object) $this -> sections;
27
 
 
 
 
28
  $this -> initialize_classes();
29
  $this -> initialize_options();
30
 
 
 
 
 
 
 
 
 
 
 
31
  global $wpdb;
32
  if ($this -> debugging == true) {
33
  $wpdb -> show_errors();
34
+
35
+ if ($this -> debug_level == 2) {
36
+ error_reporting(E_ALL ^ E_NOTICE);
37
+ @ini_set('display_errors', 1);
38
+ }
39
  } else {
40
  $wpdb -> hide_errors();
41
  error_reporting(0);
61
  return false;
62
  }
63
 
64
+ function initialize_classes() {
65
  if (!empty($this -> helpers)) {
66
  foreach ($this -> helpers as $helper) {
67
  $hfile = dirname(__FILE__) . DS . 'helpers' . DS . strtolower($helper) . '.php';
100
  }
101
 
102
  function initialize_options() {
103
+ if (!is_admin()) { return; }
104
+
105
  $styles = array(
106
  'width' => "450",
107
  'height' => "250",
116
 
117
  //General Settings
118
  $this -> add_option('fadespeed', 10);
119
+ $this -> add_option('shownav', "Y");
120
  $this -> add_option('navopacity', 25);
121
  $this -> add_option('navhover', 70);
122
  $this -> add_option('information', "Y");
123
  $this -> add_option('infospeed', 10);
124
  $this -> add_option('thumbnails', "N");
125
+ $this -> add_option('thumbwidth', "100");
126
+ $this -> add_option('thumbheight', "75");
127
  $this -> add_option('thumbposition', "bottom");
128
  $this -> add_option('thumbopacity', 70);
129
  $this -> add_option('thumbscrollspeed', 5);
134
  $this -> add_option('imagesthickbox', "N");
135
  }
136
 
137
+ function render_msg($message = null) {
138
  $this -> render('msg-top', array('message' => $message), true, 'admin');
139
  }
140
 
141
+ function render_err($message = null) {
142
  $this -> render('err-top', array('message' => $message), true, 'admin');
143
  }
144
 
145
+ function redirect($location = null, $msgtype = null, $message = null) {
146
  $url = $location;
147
 
148
  if ($msgtype == "message") {
200
  return false;
201
  }
202
 
203
+ function vendor($name = null, $folder = null) {
204
  if (!empty($name)) {
205
  $filename = 'class.' . strtolower($name) . '.php';
206
  $filepath = rtrim(dirname(__FILE__), DS) . DS . 'vendors' . DS . $folder . '';
251
  return false;
252
  }
253
 
254
+ function print_scripts() {
255
+ $this -> enqueue_scripts();
256
+ }
257
+
258
  function enqueue_scripts() {
259
  wp_enqueue_script('jquery');
260
 
261
  if (is_admin()) {
262
+ if (!empty($_GET['page']) && in_array($_GET['page'], (array) $this -> sections)) {
263
+ if ($_GET['page'] == 'slideshow-settings') {
 
 
264
  wp_enqueue_script('common');
265
  wp_enqueue_script('wp-lists');
266
  wp_enqueue_script('postbox');
268
  wp_enqueue_script('settings-editor', '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/settings-editor.js', array('jquery'), '1.0');
269
  }
270
 
271
+ if ($_GET['page'] == "slideshow-slides" && $_GET['method'] == "order") {
272
  wp_enqueue_script('jquery-ui-sortable');
273
  }
 
 
274
  }
275
 
276
+ wp_enqueue_script('colorbox', WP_PLUGIN_URL . '/' . $this -> plugin_name . '/js/colorbox.js', array('jquery'), '1.3.19');
277
  wp_enqueue_script($this -> plugin_name . 'admin', '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/admin.js', null, '1.0');
278
  } else {
279
  wp_enqueue_script($this -> plugin_name, '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/gallery.js', null, '1.0');
280
 
281
  if ($this -> get_option('imagesthickbox') == "Y") {
282
+ wp_enqueue_script('colorbox', WP_PLUGIN_URL . '/' . $this -> plugin_name . '/js/colorbox.js', array('jquery'), '1.3.19');
283
  }
284
  }
285
 
286
  return true;
287
  }
288
 
289
+ function get_css_url($attr = null) {
290
+ $css_url = WP_PLUGIN_URL . '/' . $this -> plugin_name . '/css/gallery-css.php?';
291
+
292
+ $default_attr = $this -> get_option('styles');
293
+ $styles = wp_parse_args($attr, $default_attr);
294
+
295
+ if (!empty($styles)) {
296
+ $s = 1;
297
 
298
+ foreach ($styles as $skey => $sval) {
299
+ $css_url .= $skey . '=' . urlencode($sval);
300
+ if ($s < count($styles)) { $css_url .= '&'; }
301
+ $s++;
302
  }
 
 
303
  }
304
+
305
+ return $css_url;
306
+ }
307
+
308
+ function print_styles() {
309
+ $this -> enqueue_styles();
310
+ }
311
+
312
+ function enqueue_styles() {
313
+ if (is_admin()) {
314
+ $src = WP_PLUGIN_URL . '/' . $this -> plugin_name . '/css/admin.css';
315
+ wp_enqueue_style($this -> plugin_name, $src, null, "1.0", "all");
316
+ }
317
+
318
+ $colorbox_src = WP_PLUGIN_URL . '/' . $this -> plugin_name . '/css/colorbox.css';
319
+ wp_enqueue_style('colorbox', $colorbox_src, null, "1.3.19", "all");
320
 
321
  return true;
322
  }
337
  return false;
338
  }
339
 
340
+ function update_option($name = null, $value = null) {
341
  if (update_option($this -> pre . $name, $value)) {
342
  return true;
343
  }
345
  return false;
346
  }
347
 
348
+ function get_option($name = null, $stripslashes = true) {
349
  if ($option = get_option($this -> pre . $name)) {
350
  if (@unserialize($option) !== false) {
351
  return unserialize($option);
440
  return false;
441
  }
442
 
443
+ function delete_field($table = null, $field = null) {
444
  global $wpdb;
445
 
446
  if (!empty($table)) {
456
  return false;
457
  }
458
 
459
+ function change_field($table = null, $field = null, $newfield = null, $attributes = "TEXT NOT NULL") {
460
  global $wpdb;
461
 
462
  if (!empty($table)) {
482
  return false;
483
  }
484
 
485
+ function add_field($table = null, $field = null, $attributes = "TEXT NOT NULL") {
486
  global $wpdb;
487
 
488
  if (!empty($table)) {
504
  return false;
505
  }
506
 
507
+ function render($file = null, $params = array(), $output = true, $folder = 'admin') {
508
  if (!empty($file)) {
509
+ $this -> plugin_name = 'slideshow-gallery';
510
+ $this -> plugin_base = rtrim(dirname(__FILE__), DS);
511
+
512
  $filename = $file . '.php';
513
  $filepath = $this -> plugin_base() . DS . 'views' . DS . $folder . DS;
514
  $filefull = $filepath . $filename;
slideshow-gallery.php CHANGED
@@ -3,132 +3,111 @@
3
  /*
4
  Plugin Name: Slideshow Gallery
5
  Plugin URI: http://wpgallery.tribulant.net
6
- Author: Antonie Potgieter
7
  Author URI: http://tribulant.com
8
  Description: Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website. The slideshow is flexible and all aspects can easily be configured. Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert <code>[slideshow]</code> into its content with an optional <code>post_id</code> parameter. To hardcode into any PHP file of your WordPress theme, simply use <code>&lt;?php if (class_exists('Gallery')) { $Gallery = new Gallery(); $Gallery -> slideshow($output = true, $post_id = null); } ?&gt;</code> and specify the required <code>$post_id</code> parameter accordingly.
9
- Version: 1.1.1
10
  */
11
 
12
  define('DS', DIRECTORY_SEPARATOR);
13
  require_once(dirname(__FILE__) . DS . 'slideshow-gallery-plugin.php');
14
 
15
- class Gallery extends GalleryPlugin {
16
-
17
- function Gallery() {
18
- $url = explode("&", $_SERVER['REQUEST_URI']);
19
- $this -> url = $url[0];
20
- $this -> referer = (empty($_SERVER['HTTP_REFERER'])) ? $this -> url : $_SERVER['HTTP_REFERER'];
21
 
22
- $this -> register_plugin('slideshow-gallery', __FILE__);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
- //WordPress action hooks
25
- $this -> add_action('wp_head');
26
- $this -> add_action('admin_menu');
27
- $this -> add_action('admin_head');
28
- $this -> add_action('admin_notices');
29
 
30
- //WordPress filter hooks
31
- $this -> add_filter('mce_buttons');
32
- $this -> add_filter('mce_external_plugins');
33
 
34
- add_shortcode('slideshow', array($this, 'embed'));
35
- }
36
-
37
- function wp_head() {
38
- ?>
39
-
40
- <script type="text/javascript">
41
- var tb_pathToImage = "<?php echo rtrim(get_bloginfo('wpurl'), '/'); ?>/wp-includes/js/thickbox/loadingAnimation.gif";
42
- var tb_closeImage = "<?php echo rtrim(get_bloginfo('wpurl'), '/'); ?>/wp-includes/js/thickbox/tb-close.png";
43
- </script>
44
-
45
- <?php
46
- }
47
-
48
- function admin_menu() {
49
- add_menu_page(__('Slideshow', $this -> plugin_name), __('Slideshow', $this -> plugin_name), 10, "gallery", array($this, 'admin_slides'), $this -> url() . '/images/icon.png');
50
- $this -> menus['gallery'] = add_submenu_page("gallery", __('Manage Slides', $this -> plugin_name), __('Manage Slides', $this -> plugin_name), 10, "gallery", array($this, 'admin_slides'));
51
- $this -> menus['gallery-settings'] = add_submenu_page("gallery", __('Configuration', $this -> plugin_name), __('Configuration', $this -> plugin_name), 10, "gallery-settings", array($this, 'admin_settings'));
52
 
53
- add_action('admin_head-' . $this -> menus['gallery-settings'], array($this, 'admin_head_gallery_settings'));
54
- }
55
-
56
- function admin_head() {
57
- $this -> render('head', false, true, 'admin');
58
- }
59
-
60
- function admin_head_gallery_settings() {
61
- add_meta_box('submitdiv', __('Save Settings', $this -> plugin_name), array($this -> Metabox, "settings_submit"), $this -> menus['gallery-settings'], 'side', 'core');
62
- add_meta_box('generaldiv', __('General Settings', $this -> plugin_name), array($this -> Metabox, "settings_general"), $this -> menus['gallery-settings'], 'normal', 'core');
63
- add_meta_box('linksimagesdiv', __('Links &amp; Images Overlay', $this -> plugin_name), array($this -> Metabox, "settings_linksimages"), $this -> menus['gallery-settings'], 'normal', 'core');
64
- add_meta_box('stylesdiv', __('Appearance &amp; Styles', $this -> plugin_name), array($this -> Metabox, "settings_styles"), $this -> menus['gallery-settings'], 'normal', 'core');
65
 
66
- do_action('do_meta_boxes', $this -> menus['gallery-settings'], 'normal');
67
- do_action('do_meta_boxes', $this -> menus['gallery-settings'], 'side');
68
- }
69
-
70
- function admin_notices() {
71
- $this -> check_uploaddir();
72
-
73
- if (!empty($_GET[$this -> pre . 'message'])) {
74
- $msg_type = (!empty($_GET[$this -> pre . 'updated'])) ? 'msg' : 'err';
75
- call_user_method('render_' . $msg_type, $this, $_GET[$this -> pre . 'message']);
76
  }
77
- }
78
-
79
- function mce_buttons($buttons) {
80
- array_push($buttons, "separator", "gallery");
81
- return $buttons;
82
- }
83
-
84
- function mce_external_plugins($plugins) {
85
- $plugins['gallery'] = $this -> url() . '/js/tinymce/editor_plugin.js';
86
- return $plugins;
87
- }
88
-
89
- function slideshow($output = true, $post_id = null, $exclude = null) {
90
- global $wpdb;
91
 
92
- if (!empty($post_id) && $post = get_post($post_id)) {
93
- if ($attachments = get_children("post_parent=" . $post -> ID . "&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC")) {
94
- if (!empty($exclude)) {
95
- $exclude = array_map('trim', explode(',', $exclude));
96
-
97
- $a = 0;
98
- foreach ($attachments as $id => $attachment) {
99
-
100
- $a++;
101
- if (in_array($a, $exclude)) {
102
- unset($attachments[$id]);
103
- }
104
- }
105
- }
106
 
107
- $content = $this -> render('gallery', array('slides' => $attachments, 'frompost' => true), false, 'default');
 
 
 
 
 
 
 
 
 
108
  }
109
- } else {
110
- $slides = $this -> Slide -> find_all(null, null, array('order', "ASC"));
111
- $content = $this -> render('gallery', array('slides' => $slides, 'frompost' => false), false, 'default');
112
  }
113
 
114
- if ($output) { echo $content; } else { return $content; }
115
- }
116
-
117
- function embed($atts = array(), $content = null) {
118
- //global variables
119
- global $wpdb;
120
-
121
- $defaults = array('post_id' => null, 'exclude' => null, 'custom' => null);
122
- extract(shortcode_atts($defaults, $atts));
123
 
124
- if (!empty($custom)) {
125
- $slides = $this -> Slide -> find_all(null, null, array('order', "ASC"));
126
- $content = $this -> render('gallery', array('slides' => $slides, 'frompost' => false), false, 'default');
127
- } else {
128
- global $post;
129
- $pid = (empty($post_id)) ? $post -> ID : $post_id;
130
 
131
- if (!empty($pid) && $post = get_post($pid)) {
 
 
 
132
  if ($attachments = get_children("post_parent=" . $post -> ID . "&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC")) {
133
  if (!empty($exclude)) {
134
  $exclude = array_map('trim', explode(',', $exclude));
@@ -145,112 +124,304 @@ class Gallery extends GalleryPlugin {
145
 
146
  $content = $this -> render('gallery', array('slides' => $attachments, 'frompost' => true), false, 'default');
147
  }
 
 
 
148
  }
 
 
149
  }
150
 
151
- return $content;
152
- }
153
-
154
- function admin_slides() {
155
- switch ($_GET['method']) {
156
- case 'delete' :
157
- if (!empty($_GET['id'])) {
158
- if ($this -> Slide -> delete($_GET['id'])) {
159
- $msg_type = 'message';
160
- $message = __('Slide has been removed', $this -> plugin_name);
161
- } else {
162
- $msg_type = 'error';
163
- $message = __('Slide cannot be removed', $this -> plugin_name);
164
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  } else {
166
- $msg_type = 'error';
167
- $message = __('No slide was specified', $this -> plugin_name);
168
  }
 
 
 
 
169
 
170
- $this -> redirect($this -> referer, $msg_type, $message);
171
- break;
172
- case 'save' :
173
- if (!empty($_POST)) {
174
- if ($this -> Slide -> save($_POST, true)) {
175
- $message = __('Slide has been saved', $this -> plugin_name);
176
- $this -> redirect($this -> url, "message", $message);
177
- } else {
178
- $this -> render('slides' . DS . 'save', false, true, 'admin');
179
  }
180
- } else {
181
- $this -> Db -> model = $this -> Slide -> model;
182
- $this -> Slide -> find(array('id' => $_GET['id']));
183
- $this -> render('slides' . DS . 'save', false, true, 'admin');
184
  }
185
- break;
186
- case 'mass' :
187
- if (!empty($_POST['action'])) {
188
- if (!empty($_POST['Slide']['checklist'])) {
189
- switch ($_POST['action']) {
190
- case 'delete' :
191
- foreach ($_POST['Slide']['checklist'] as $slide_id) {
192
- $this -> Slide -> delete($slide_id);
193
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
 
195
- $message = __('Selected slides have been removed', $this -> plugin_name);
196
- $this -> redirect($this -> url, 'message', $message);
197
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  }
199
  } else {
200
- $message = __('No slides were selected', $this -> plugin_name);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  $this -> redirect($this -> url, "error", $message);
202
  }
203
- } else {
204
- $message = __('No action was specified', $this -> plugin_name);
205
- $this -> redirect($this -> url, "error", $message);
206
- }
207
- break;
208
- case 'order' :
209
- $slides = $this -> Slide -> find_all(null, null, array('order', "ASC"));
210
- $this -> render('slides' . DS . 'order', array('slides' => $slides), true, 'admin');
211
- break;
212
- default :
213
- $data = $this -> paginate('Slide');
214
- $this -> render('slides' . DS . 'index', array('slides' => $data[$this -> Slide -> model], 'paginate' => $data['Paginate']), true, 'admin');
215
- break;
216
  }
217
- }
218
-
219
- function admin_settings() {
220
- switch ($_GET['method']) {
221
- case 'reset' :
222
- global $wpdb;
223
- $query = "DELETE FROM `" . $wpdb -> prefix . "options` WHERE `option_name` LIKE '" . $this -> pre . "%';";
224
-
225
- if ($wpdb -> query($query)) {
226
- $message = __('All configuration settings have been reset to their defaults', $this -> plugin_name);
227
- $msg_type = 'message';
228
- $this -> render_msg($message);
229
- } else {
230
- $message = __('Configuration settings could not be reset', $this -> plugin_name);
231
- $msg_type = 'error';
232
- $this -> render_err($message);
233
- }
234
-
235
- $this -> redirect($this -> url, $msg_type, $message);
236
- break;
237
- default :
238
- if (!empty($_POST)) {
239
- foreach ($_POST as $pkey => $pval) {
240
- $this -> update_option($pkey, $pval);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  }
242
 
243
- $message = __('Configuration has been saved', $this -> plugin_name);
244
- $this -> render_msg($message);
245
- }
246
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  }
248
-
249
- $this -> render('settings', false, true, 'admin');
250
  }
251
  }
252
 
253
  //initialize a Gallery object
254
  $Gallery = new Gallery();
255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  ?>
3
  /*
4
  Plugin Name: Slideshow Gallery
5
  Plugin URI: http://wpgallery.tribulant.net
6
+ Author: Tribulant Software
7
  Author URI: http://tribulant.com
8
  Description: Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website. The slideshow is flexible and all aspects can easily be configured. Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert <code>[slideshow]</code> into its content with an optional <code>post_id</code> parameter. To hardcode into any PHP file of your WordPress theme, simply use <code>&lt;?php if (class_exists('Gallery')) { $Gallery = new Gallery(); $Gallery -> slideshow($output = true, $post_id = null); } ?&gt;</code> and specify the required <code>$post_id</code> parameter accordingly.
9
+ Version: 1.2
10
  */
11
 
12
  define('DS', DIRECTORY_SEPARATOR);
13
  require_once(dirname(__FILE__) . DS . 'slideshow-gallery-plugin.php');
14
 
15
+ if (!class_exists('Gallery')) {
16
+ class Gallery extends GalleryPlugin {
 
 
 
 
17
 
18
+ function Gallery() {
19
+ $url = explode("&", $_SERVER['REQUEST_URI']);
20
+ $this -> url = $url[0];
21
+ $this -> referer = (empty($_SERVER['HTTP_REFERER'])) ? $this -> url : $_SERVER['HTTP_REFERER'];
22
+
23
+ $this -> register_plugin('slideshow-gallery', __FILE__);
24
+
25
+ //WordPress action hooks
26
+ $this -> add_action('wp_head');
27
+ $this -> add_action('admin_menu');
28
+ $this -> add_action('admin_head');
29
+ $this -> add_action('admin_notices');
30
+ $this -> add_action('wp_print_styles', 'print_styles');
31
+ $this -> add_action('admin_print_styles', 'print_styles');
32
+ $this -> add_action('wp_print_scripts', 'print_scripts');
33
+ $this -> add_action('admin_print_scripts', 'print_scripts');
34
+ $this -> add_action('init', 'init_textdomain', 10, 1);
35
+
36
+ //WordPress filter hooks
37
+ $this -> add_filter('mce_buttons');
38
+ $this -> add_filter('mce_external_plugins');
39
+
40
+ add_shortcode('slideshow', array($this, 'embed'));
41
+ }
42
 
43
+ function init_textdomain() {
44
+ if (function_exists('load_plugin_textdomain')) {
45
+ load_plugin_textdomain($this -> plugin_name, $this -> plugin_name . DS . 'languages', dirname(plugin_basename(__FILE__)) . DS . 'languages');
46
+ }
47
+ }
48
 
49
+ function wp_head() {
50
+ if ($this -> get_option('imagesthickbox') == "Y") {
 
51
 
52
+ ?>
53
+
54
+ <script type="text/javascript">
55
+ jQuery(document).ready(function() {
56
+ jQuery('.colorbox').colorbox({maxWidth:'100%', maxHeight:'100%'});
57
+ });
58
+ </script>
59
+
60
+ <?php
61
+ }
62
+ }
 
 
 
 
 
 
 
63
 
64
+ function admin_menu() {
65
+ add_menu_page(__('Slideshow', $this -> plugin_name), __('Slideshow', $this -> plugin_name), 10, $this -> sections -> slides, array($this, 'admin_slides'), $this -> url() . '/images/icon.png');
66
+ $this -> menus['slideshow-slides'] = add_submenu_page($this -> sections -> slides, __('Manage Slides', $this -> plugin_name), __('Manage Slides', $this -> plugin_name), 10, $this -> sections -> slides, array($this, 'admin_slides'));
67
+ $this -> menus['slideshow-galleries'] = add_submenu_page($this -> sections -> slides, __('Manage Galleries', $this -> plugin_name), __('Manage Galleries', $this -> plugin_name), 10, $this -> sections -> galleries, array($this, 'admin_galleries'));
68
+ $this -> menus['slideshow-settings'] = add_submenu_page($this -> sections -> slides, __('Configuration', $this -> plugin_name), __('Configuration', $this -> plugin_name), 10, $this -> sections -> settings, array($this, 'admin_settings'));
69
+
70
+ add_action('admin_head-' . $this -> menus['slideshow-settings'], array($this, 'admin_head_gallery_settings'));
71
+ }
 
 
 
 
72
 
73
+ function admin_head() {
74
+ $this -> render('head', false, true, 'admin');
 
 
 
 
 
 
 
 
75
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
+ function admin_head_gallery_settings() {
78
+ add_meta_box('submitdiv', __('Save Settings', $this -> plugin_name), array($this -> Metabox, "settings_submit"), $this -> menus['slideshow-settings'], 'side', 'core');
79
+ add_meta_box('aboutdiv', __('About Us', $this -> plugin_name), array($this -> Metabox, "settings_about"), $this -> menus['slideshow-settings'], 'side', 'core');
80
+ add_meta_box('generaldiv', __('General Settings', $this -> plugin_name), array($this -> Metabox, "settings_general"), $this -> menus['slideshow-settings'], 'normal', 'core');
81
+ add_meta_box('linksimagesdiv', __('Links &amp; Images Overlay', $this -> plugin_name), array($this -> Metabox, "settings_linksimages"), $this -> menus['slideshow-settings'], 'normal', 'core');
82
+ add_meta_box('stylesdiv', __('Appearance &amp; Styles', $this -> plugin_name), array($this -> Metabox, "settings_styles"), $this -> menus['slideshow-settings'], 'normal', 'core');
 
 
 
 
 
 
 
 
83
 
84
+ do_action('do_meta_boxes', $this -> menus['slideshow-settings'], 'normal');
85
+ do_action('do_meta_boxes', $this -> menus['slideshow-settings'], 'side');
86
+ }
87
+
88
+ function admin_notices() {
89
+ $this -> check_uploaddir();
90
+
91
+ if (!empty($_GET[$this -> pre . 'message'])) {
92
+ $msg_type = (!empty($_GET[$this -> pre . 'updated'])) ? 'msg' : 'err';
93
+ call_user_method('render_' . $msg_type, $this, $_GET[$this -> pre . 'message']);
94
  }
 
 
 
95
  }
96
 
97
+ function mce_buttons($buttons) {
98
+ array_push($buttons, "separator", "gallery");
99
+ return $buttons;
100
+ }
 
 
 
 
 
101
 
102
+ function mce_external_plugins($plugins) {
103
+ $plugins['gallery'] = $this -> url() . '/js/tinymce/editor_plugin.js';
104
+ return $plugins;
105
+ }
 
 
106
 
107
+ function slideshow($output = true, $post_id = null, $exclude = null) {
108
+ global $wpdb;
109
+
110
+ if (!empty($post_id) && $post = get_post($post_id)) {
111
  if ($attachments = get_children("post_parent=" . $post -> ID . "&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC")) {
112
  if (!empty($exclude)) {
113
  $exclude = array_map('trim', explode(',', $exclude));
124
 
125
  $content = $this -> render('gallery', array('slides' => $attachments, 'frompost' => true), false, 'default');
126
  }
127
+ } else {
128
+ $slides = $this -> Slide -> find_all(null, null, array('order', "ASC"));
129
+ $content = $this -> render('gallery', array('slides' => $slides, 'frompost' => false), false, 'default');
130
  }
131
+
132
+ if ($output) { echo $content; } else { return $content; }
133
  }
134
 
135
+ function embed($atts = array(), $content = null) {
136
+ //global variables
137
+ global $wpdb;
138
+ $styles = $this -> get_option('styles');
139
+
140
+ // default shortcode parameters
141
+ $defaults = array(
142
+ 'gallery_id' => false,
143
+ 'orderby' => array('order', "ASC"),
144
+ 'resizeimages' => (($styles['resizeimages'] == "Y") ? "true" : "false"),
145
+ 'width' => ($styles['width']),
146
+ 'height' => ($styles['height']),
147
+ 'auto' => (($this -> get_option('autoslide') == "Y") ? "true" : "false"),
148
+ 'autospeed' => ($this -> get_option('autospeed')),
149
+ 'fadespeed' => ($this -> get_option('fadespeed')),
150
+ 'shownav' => (($this -> get_option('shownav') == "Y") ? "true" : "false"),
151
+ 'navopacity' => ($this -> get_option('navopacity')),
152
+ 'navhoveropacity' => ($this -> get_option('navhover')),
153
+ 'showinfo' => (($this -> get_option('information') == "Y") ? "true" : "false"),
154
+ 'infospeed' => ($this -> get_option('infospeed')),
155
+ 'showthumbs' => (($this -> get_option('thumbnails')) ? "true" : "false"),
156
+ 'thumbsposition' => ($this -> get_option('thumbposition')),
157
+ 'thumbsborder' => ($this -> get_option('thumbactive')),
158
+ 'thumbsspeed' => ($this -> get_option('thumbscrollspeed')),
159
+ 'thumbsspacing' => ($this -> get_option('thumbspacing')),
160
+ 'post_id' => null,
161
+ 'exclude' => null,
162
+ 'custom' => null,
163
+ );
164
+
165
+ $s = shortcode_atts($defaults, $atts);
166
+ extract($s);
167
+
168
+ // if this is an RSS/Atom feed, it should not continue...
169
+ if (is_feed()) { return false; }
170
+
171
+ if (!empty($gallery_id)) {
172
+ if (!is_array($orderby) || $orderby == "random") {
173
+ $orderbystring = "ORDER BY RAND()";
174
  } else {
175
+ list($orderf, $orderd) = $orderby;
176
+ $orderbystring = "ORDER BY " . $this -> Slide -> table . "." . $orderf . " " . $orderd . "";
177
  }
178
+
179
+ $slidesquery = "SELECT * FROM " . $this -> Slide -> table . " LEFT JOIN " . $this -> GallerySlides -> table .
180
+ " ON " . $this -> Slide -> table . ".id = " . $this -> GallerySlides -> table . ".slide_id WHERE " .
181
+ $this -> GallerySlides -> table . ".gallery_id = '" . $gallery_id . "' " . $orderbystring;
182
 
183
+ if ($slides = $wpdb -> get_results($slidesquery)) {
184
+ foreach ($slides as $skey => $slide) {
185
+ $slides[$skey] -> image_path = 'wp-content/uploads/slideshow-gallery/' . $slide -> image;
 
 
 
 
 
 
186
  }
187
+
188
+ $content = $this -> render('gallery', array('slides' => $slides, 'options' => $s, 'frompost' => false), false, 'default');
 
 
189
  }
190
+ } elseif (!empty($custom) || empty($post_id)) {
191
+ $slides = $this -> Slide -> find_all(null, null, $orderby);
192
+
193
+ if (!empty($exclude)) {
194
+ $exclude = array_map('trim', explode(',', $exclude));
195
+
196
+ foreach ($slides as $slide_key => $slide) {
197
+ if (in_array($slide -> id, $exclude)) {
198
+ unset($slides[$slide_key]);
199
+ }
200
+ }
201
+ }
202
+
203
+ $content = $this -> render('gallery', array('slides' => $slides, 'options' => $s, 'frompost' => false), false, 'default');
204
+ } else {
205
+ global $post;
206
+ $pid = (empty($post_id)) ? $post -> ID : $post_id;
207
+
208
+ if (!empty($pid) && $post = get_post($pid)) {
209
+ if ($attachments = get_children("post_parent=" . $post -> ID . "&post_type=attachment&post_mime_type=image&orderby=" . ((!empty($orderby) && $orderby == "random") ? "rand" : "menu_order ASC, ID ASC"))) {
210
+ if (!empty($exclude)) {
211
+ $exclude = array_map('trim', explode(',', $exclude));
212
+
213
+ $a = 0;
214
+ foreach ($attachments as $id => $attachment) {
215
 
216
+ $a++;
217
+ if (in_array($a, $exclude)) {
218
+ unset($attachments[$id]);
219
+ }
220
+ }
221
+ }
222
+
223
+ $content = $this -> render('gallery', array('slides' => $attachments, 'options' => $s, 'frompost' => true), false, 'default');
224
+ }
225
+ }
226
+ }
227
+
228
+ return $content;
229
+ }
230
+
231
+ function admin_slides() {
232
+ switch ($_GET['method']) {
233
+ case 'delete' :
234
+ if (!empty($_GET['id'])) {
235
+ if ($this -> Slide -> delete($_GET['id'])) {
236
+ $msg_type = 'message';
237
+ $message = __('Slide has been removed', $this -> plugin_name);
238
+ } else {
239
+ $msg_type = 'error';
240
+ $message = __('Slide cannot be removed', $this -> plugin_name);
241
  }
242
  } else {
243
+ $msg_type = 'error';
244
+ $message = __('No slide was specified', $this -> plugin_name);
245
+ }
246
+
247
+ $this -> redirect($this -> referer, $msg_type, $message);
248
+ break;
249
+ case 'save' :
250
+ if (!empty($_POST)) {
251
+ if ($this -> Slide -> save($_POST, true)) {
252
+ $message = __('Slide has been saved', $this -> plugin_name);
253
+ $this -> redirect($this -> url, "message", $message);
254
+ } else {
255
+ $this -> render('slides' . DS . 'save', false, true, 'admin');
256
+ }
257
+ } else {
258
+ $this -> Db -> model = $this -> Slide -> model;
259
+ $this -> Slide -> find(array('id' => $_GET['id']));
260
+ $this -> render('slides' . DS . 'save', false, true, 'admin');
261
+ }
262
+ break;
263
+ case 'mass' :
264
+ if (!empty($_POST['action'])) {
265
+ if (!empty($_POST['Slide']['checklist'])) {
266
+ switch ($_POST['action']) {
267
+ case 'delete' :
268
+ foreach ($_POST['Slide']['checklist'] as $slide_id) {
269
+ $this -> Slide -> delete($slide_id);
270
+ }
271
+
272
+ $message = __('Selected slides have been removed', $this -> plugin_name);
273
+ $this -> redirect($this -> url, 'message', $message);
274
+ break;
275
+ }
276
+ } else {
277
+ $message = __('No slides were selected', $this -> plugin_name);
278
+ $this -> redirect($this -> url, "error", $message);
279
+ }
280
+ } else {
281
+ $message = __('No action was specified', $this -> plugin_name);
282
  $this -> redirect($this -> url, "error", $message);
283
  }
284
+ break;
285
+ case 'order' :
286
+ $slides = $this -> Slide -> find_all(null, null, array('order', "ASC"));
287
+ $this -> render('slides' . DS . 'order', array('slides' => $slides), true, 'admin');
288
+ break;
289
+ default :
290
+ $data = $this -> paginate('Slide');
291
+ $this -> render('slides' . DS . 'index', array('slides' => $data[$this -> Slide -> model], 'paginate' => $data['Paginate']), true, 'admin');
292
+ break;
293
+ }
 
 
 
294
  }
295
+
296
+ function admin_galleries() {
297
+
298
+ switch ($_GET['method']) {
299
+ case 'save' :
300
+ if (!empty($_POST)) {
301
+ if ($this -> Gallery -> save($_POST, true)) {
302
+ $message = __('Gallery has been saved', $this -> plugin_name);
303
+ $this -> redirect($this -> url, "message", $message);
304
+ } else {
305
+ $this -> render('galleries' . DS . 'save', false, true, 'admin');
306
+ }
307
+ } else {
308
+ $this -> Db -> model = $this -> Gallery -> model;
309
+ $this -> Gallery -> find(array('id' => $_GET['id']));
310
+ $this -> render('galleries' . DS . 'save', false, true, 'admin');
311
+ }
312
+ break;
313
+ case 'view' :
314
+ $this -> Db -> model = $this -> Gallery -> model;
315
+ $gallery = $this -> Gallery -> find(array('id' => $_GET['id']));
316
+ $data = $this -> paginate('GallerySlides', "*", false, array('gallery_id' => $gallery -> id));
317
+
318
+ $data['Slide'] = array();
319
+ if (!empty($data[$this -> GallerySlides -> model])) {
320
+ foreach ($data[$this -> GallerySlides -> model] as $galleryslide) {
321
+ $this -> Db -> model = $this -> Slide -> model;
322
+ $data['Slide'][] = $this -> Slide -> find(array('id' => $galleryslide -> slide_id));
323
+ }
324
+ }
325
+
326
+ $this -> render('galleries' . DS . 'view', array('gallery' => $gallery, 'slides' => $data[$this -> Slide -> model], 'paginate' => $data['Paginate']), true, 'admin');
327
+ break;
328
+ case 'delete' :
329
+ if (!empty($_GET['id'])) {
330
+ if ($this -> Gallery -> delete($_GET['id'])) {
331
+ $msg_type = 'message';
332
+ $message = __('Gallery has been removed', $this -> plugin_name);
333
+ } else {
334
+ $msg_type = 'error';
335
+ $message = __('Gallery cannot be removed', $this -> plugin_name);
336
+ }
337
+ } else {
338
+ $msg_type = 'error';
339
+ $message = __('No gallery was specified', $this -> plugin_name);
340
  }
341
 
342
+ $this -> redirect($this -> referer, $msg_type, $message);
343
+ break;
344
+ case 'mass' :
345
+ if (!empty($_POST['action'])) {
346
+ if (!empty($_POST['Gallery']['checklist'])) {
347
+ switch ($_POST['action']) {
348
+ case 'delete' :
349
+ foreach ($_POST['Gallery']['checklist'] as $gallery_id) {
350
+ $this -> Gallery -> delete($gallery_id);
351
+ }
352
+
353
+ $message = __('Selected galleries have been removed', $this -> plugin_name);
354
+ $this -> redirect($this -> url, 'message', $message);
355
+ break;
356
+ }
357
+ } else {
358
+ $message = __('No slides were selected', $this -> plugin_name);
359
+ $this -> redirect($this -> url, "error", $message);
360
+ }
361
+ } else {
362
+ $message = __('No action was specified', $this -> plugin_name);
363
+ $this -> redirect($this -> url, "error", $message);
364
+ }
365
+ break;
366
+ default :
367
+ $data = $this -> paginate('Gallery');
368
+ $this -> render('galleries' . DS . 'index', array('galleries' => $data[$this -> Gallery -> model], 'paginate' => $data['Paginate']), true, 'admin');
369
+ break;
370
+ }
371
+ }
372
+
373
+ function admin_settings() {
374
+ switch ($_GET['method']) {
375
+ case 'reset' :
376
+ global $wpdb;
377
+ $query = "DELETE FROM `" . $wpdb -> prefix . "options` WHERE `option_name` LIKE '" . $this -> pre . "%';";
378
+
379
+ if ($wpdb -> query($query)) {
380
+ $message = __('All configuration settings have been reset to their defaults', $this -> plugin_name);
381
+ $msg_type = 'message';
382
+ $this -> render_msg($message);
383
+ } else {
384
+ $message = __('Configuration settings could not be reset', $this -> plugin_name);
385
+ $msg_type = 'error';
386
+ $this -> render_err($message);
387
+ }
388
+
389
+ $this -> redirect($this -> url, $msg_type, $message);
390
+ break;
391
+ default :
392
+ if (!empty($_POST)) {
393
+ foreach ($_POST as $pkey => $pval) {
394
+ $this -> update_option($pkey, $pval);
395
+ }
396
+
397
+ $message = __('Configuration has been saved', $this -> plugin_name);
398
+ $this -> render_msg($message);
399
+ }
400
+ break;
401
+ }
402
+
403
+ $this -> render('settings', false, true, 'admin');
404
  }
 
 
405
  }
406
  }
407
 
408
  //initialize a Gallery object
409
  $Gallery = new Gallery();
410
 
411
+ if (!function_exists('slideshow')) {
412
+ function slideshow($output = true, $gallery_id = null, $post_id = null, $params = array()) {
413
+ $params['gallery_id'] = $gallery_id;
414
+ $params['post_id'] = $post_id;
415
+
416
+ $Gallery = new Gallery();
417
+ $content = $Gallery -> embed($params, false);
418
+
419
+ if ($output == true) {
420
+ echo $content;
421
+ } else {
422
+ return $content;
423
+ }
424
+ }
425
+ }
426
+
427
  ?>
vendors/timthumb.php ADDED
@@ -0,0 +1,1257 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * TimThumb by Ben Gillbanks and Mark Maunder
4
+ * Based on work done by Tim McDaniels and Darren Hoyt
5
+ * http://code.google.com/p/timthumb/
6
+ *
7
+ * GNU General Public License, version 2
8
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
9
+ *
10
+ * Examples and documentation available on the project homepage
11
+ * http://www.binarymoon.co.uk/projects/timthumb/
12
+ *
13
+ * $Rev$
14
+ */
15
+
16
+
17
+ error_reporting(0);
18
+ @ini_set('display_errors', 0);
19
+
20
+ /*
21
+ * --- TimThumb CONFIGURATION ---
22
+ * To edit the configs it is best to create a file called timthumb-config.php
23
+ * and define variables you want to customize in there. It will automatically be
24
+ * loaded by timthumb. This will save you having to re-edit these variables
25
+ * everytime you download a new version
26
+ */
27
+ define ('VERSION', '2.8.9'); // Version of this script
28
+ //Load a config file if it exists. Otherwise, use the values below
29
+ if( file_exists(dirname(__FILE__) . '/timthumb-config.php')) require_once('timthumb-config.php');
30
+ if(! defined('DEBUG_ON') ) define ('DEBUG_ON', false); // Enable debug logging to web server error log (STDERR)
31
+ if(! defined('DEBUG_LEVEL') ) define ('DEBUG_LEVEL', 1); // Debug level 1 is less noisy and 3 is the most noisy
32
+ if(! defined('MEMORY_LIMIT') ) define ('MEMORY_LIMIT', '128M'); // Set PHP memory limit
33
+ if(! defined('BLOCK_EXTERNAL_LEECHERS') ) define ('BLOCK_EXTERNAL_LEECHERS', false); // If the image or webshot is being loaded on an external site, display a red "No Hotlinking" gif.
34
+
35
+ //Image fetching and caching
36
+ if(! defined('ALLOW_EXTERNAL') ) define ('ALLOW_EXTERNAL', TRUE); // Allow image fetching from external websites. Will check against ALLOWED_SITES if ALLOW_ALL_EXTERNAL_SITES is false
37
+ if(! defined('ALLOW_ALL_EXTERNAL_SITES') ) define ('ALLOW_ALL_EXTERNAL_SITES', false); // Less secure.
38
+ if(! defined('FETCH_LOCAL_URLS') ) define ('FETCH_LOCAL_URLS', true); // If true, URL sources will always be fetched over HTTP, even if they have the same hostname as this script
39
+ if(! defined('FILE_CACHE_ENABLED') ) define ('FILE_CACHE_ENABLED', TRUE); // Should we store resized/modified images on disk to speed things up?
40
+ if(! defined('FILE_CACHE_TIME_BETWEEN_CLEANS')) define ('FILE_CACHE_TIME_BETWEEN_CLEANS', 86400); // How often the cache is cleaned
41
+
42
+ if(! defined('FILE_CACHE_MAX_FILE_AGE') ) define ('FILE_CACHE_MAX_FILE_AGE', 86400); // How old does a file have to be to be deleted from the cache
43
+ if(! defined('FILE_CACHE_SUFFIX') ) define ('FILE_CACHE_SUFFIX', '.timthumb.txt'); // What to put at the end of all files in the cache directory so we can identify them
44
+ if(! defined('FILE_CACHE_PREFIX') ) define ('FILE_CACHE_PREFIX', 'timthumb'); // What to put at the beg of all files in the cache directory so we can identify them
45
+ if(! defined('FILE_CACHE_DIRECTORY') ) define ('FILE_CACHE_DIRECTORY', ''); // Directory where images are cached. Left blank it will use the system temporary directory (which is better for security)
46
+ if(! defined('MAX_FILE_SIZE') ) define ('MAX_FILE_SIZE', 10485760); // 10 Megs is 10485760. This is the max internal or external file size that we'll process.
47
+ if(! defined('CURL_TIMEOUT') ) define ('CURL_TIMEOUT', 20); // Timeout duration for Curl. This only applies if you have Curl installed and aren't using PHP's default URL fetching mechanism.
48
+ if(! defined('WAIT_BETWEEN_FETCH_ERRORS') ) define ('WAIT_BETWEEN_FETCH_ERRORS', 3600); //Time to wait between errors fetching remote file
49
+
50
+ //Browser caching
51
+ if(! defined('BROWSER_CACHE_MAX_AGE') ) define ('BROWSER_CACHE_MAX_AGE', 864000); // Time to cache in the browser
52
+ if(! defined('BROWSER_CACHE_DISABLE') ) define ('BROWSER_CACHE_DISABLE', false); // Use for testing if you want to disable all browser caching
53
+
54
+ //Image size and defaults
55
+ if(! defined('MAX_WIDTH') ) define ('MAX_WIDTH', 1500); // Maximum image width
56
+ if(! defined('MAX_HEIGHT') ) define ('MAX_HEIGHT', 1500); // Maximum image height
57
+ if(! defined('NOT_FOUND_IMAGE') ) define ('NOT_FOUND_IMAGE', ''); // Image to serve if any 404 occurs
58
+ if(! defined('ERROR_IMAGE') ) define ('ERROR_IMAGE', ''); // Image to serve if an error occurs instead of showing error message
59
+ if(! defined('PNG_IS_TRANSPARENT') ) define ('PNG_IS_TRANSPARENT', FALSE); //42 Define if a png image should have a transparent background color. Use False value if you want to display a custom coloured canvas_colour
60
+ if(! defined('DEFAULT_Q') ) define ('DEFAULT_Q', 90); // Default image quality. Allows overrid in timthumb-config.php
61
+ if(! defined('DEFAULT_ZC') ) define ('DEFAULT_ZC', 1); // Default zoom/crop setting. Allows overrid in timthumb-config.php
62
+ if(! defined('DEFAULT_F') ) define ('DEFAULT_F', ''); // Default image filters. Allows overrid in timthumb-config.php
63
+ if(! defined('DEFAULT_S') ) define ('DEFAULT_S', 0); // Default sharpen value. Allows overrid in timthumb-config.php
64
+ if(! defined('DEFAULT_CC') ) define ('DEFAULT_CC', 'ffffff'); // Default canvas colour. Allows overrid in timthumb-config.php
65
+
66
+
67
+ //Image compression is enabled if either of these point to valid paths
68
+
69
+ //These are now disabled by default because the file sizes of PNGs (and GIFs) are much smaller than we used to generate.
70
+ //They only work for PNGs. GIFs and JPEGs are not affected.
71
+ if(! defined('OPTIPNG_ENABLED') ) define ('OPTIPNG_ENABLED', false);
72
+ if(! defined('OPTIPNG_PATH') ) define ('OPTIPNG_PATH', '/usr/bin/optipng'); //This will run first because it gives better compression than pngcrush.
73
+ if(! defined('PNGCRUSH_ENABLED') ) define ('PNGCRUSH_ENABLED', false);
74
+ if(! defined('PNGCRUSH_PATH') ) define ('PNGCRUSH_PATH', '/usr/bin/pngcrush'); //This will only run if OPTIPNG_PATH is not set or is not valid
75
+
76
+ /*
77
+ -------====Website Screenshots configuration - BETA====-------
78
+
79
+ If you just want image thumbnails and don't want website screenshots, you can safely leave this as is.
80
+
81
+ If you would like to get website screenshots set up, you will need root access to your own server.
82
+
83
+ Enable ALLOW_ALL_EXTERNAL_SITES so you can fetch any external web page. This is more secure now that we're using a non-web folder for cache.
84
+ Enable BLOCK_EXTERNAL_LEECHERS so that your site doesn't generate thumbnails for the whole Internet.
85
+
86
+ Instructions to get website screenshots enabled on Ubuntu Linux:
87
+
88
+ 1. Install Xvfb with the following command: sudo apt-get install subversion libqt4-webkit libqt4-dev g++ xvfb
89
+ 2. Go to a directory where you can download some code
90
+ 3. Check-out the latest version of CutyCapt with the following command: svn co https://cutycapt.svn.sourceforge.net/svnroot/cutycapt
91
+ 4. Compile CutyCapt by doing: cd cutycapt/CutyCapt
92
+ 5. qmake
93
+ 6. make
94
+ 7. cp CutyCapt /usr/local/bin/
95
+ 8. Test it by running: xvfb-run --server-args="-screen 0, 1024x768x24" CutyCapt --url="http://markmaunder.com/" --out=test.png
96
+ 9. If you get a file called test.png with something in it, it probably worked. Now test the script by accessing it as follows:
97
+ 10. http://yoursite.com/path/to/timthumb.php?src=http://markmaunder.com/&webshot=1
98
+
99
+ Notes on performance:
100
+ The first time a webshot loads, it will take a few seconds.
101
+ From then on it uses the regular timthumb caching mechanism with the configurable options above
102
+ and loading will be very fast.
103
+
104
+ --ADVANCED USERS ONLY--
105
+ If you'd like a slight speedup (about 25%) and you know Linux, you can run the following command which will keep Xvfb running in the background.
106
+ nohup Xvfb :100 -ac -nolisten tcp -screen 0, 1024x768x24 > /dev/null 2>&1 &
107
+ Then set WEBSHOT_XVFB_RUNNING = true below. This will save your server having to fire off a new Xvfb server and shut it down every time a new shot is generated.
108
+ You will need to take responsibility for keeping Xvfb running in case it crashes. (It seems pretty stable)
109
+ You will also need to take responsibility for server security if you're running Xvfb as root.
110
+
111
+
112
+ */
113
+ if(! defined('WEBSHOT_ENABLED') ) define ('WEBSHOT_ENABLED', false); //Beta feature. Adding webshot=1 to your query string will cause the script to return a browser screenshot rather than try to fetch an image.
114
+ if(! defined('WEBSHOT_CUTYCAPT') ) define ('WEBSHOT_CUTYCAPT', '/usr/local/bin/CutyCapt'); //The path to CutyCapt.
115
+ if(! defined('WEBSHOT_XVFB') ) define ('WEBSHOT_XVFB', '/usr/bin/xvfb-run'); //The path to the Xvfb server
116
+ if(! defined('WEBSHOT_SCREEN_X') ) define ('WEBSHOT_SCREEN_X', '1024'); //1024 works ok
117
+ if(! defined('WEBSHOT_SCREEN_Y') ) define ('WEBSHOT_SCREEN_Y', '768'); //768 works ok
118
+ if(! defined('WEBSHOT_COLOR_DEPTH') ) define ('WEBSHOT_COLOR_DEPTH', '24'); //I haven't tested anything besides 24
119
+ if(! defined('WEBSHOT_IMAGE_FORMAT') ) define ('WEBSHOT_IMAGE_FORMAT', 'png'); //png is about 2.5 times the size of jpg but is a LOT better quality
120
+ if(! defined('WEBSHOT_TIMEOUT') ) define ('WEBSHOT_TIMEOUT', '20'); //Seconds to wait for a webshot
121
+ if(! defined('WEBSHOT_USER_AGENT') ) define ('WEBSHOT_USER_AGENT', "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.18) Gecko/20110614 Firefox/3.6.18"); //I hate to do this, but a non-browser robot user agent might not show what humans see. So we pretend to be Firefox
122
+ if(! defined('WEBSHOT_JAVASCRIPT_ON') ) define ('WEBSHOT_JAVASCRIPT_ON', true); //Setting to false might give you a slight speedup and block ads. But it could cause other issues.
123
+ if(! defined('WEBSHOT_JAVA_ON') ) define ('WEBSHOT_JAVA_ON', false); //Have only tested this as fase
124
+ if(! defined('WEBSHOT_PLUGINS_ON') ) define ('WEBSHOT_PLUGINS_ON', true); //Enable flash and other plugins
125
+ if(! defined('WEBSHOT_PROXY') ) define ('WEBSHOT_PROXY', ''); //In case you're behind a proxy server.
126
+ if(! defined('WEBSHOT_XVFB_RUNNING') ) define ('WEBSHOT_XVFB_RUNNING', false); //ADVANCED: Enable this if you've got Xvfb running in the background.
127
+
128
+
129
+ // If ALLOW_EXTERNAL is true and ALLOW_ALL_EXTERNAL_SITES is false, then external images will only be fetched from these domains and their subdomains.
130
+ if(! isset($ALLOWED_SITES)){
131
+ $ALLOWED_SITES = array (
132
+ 'flickr.com',
133
+ 'staticflickr.com',
134
+ 'picasa.com',
135
+ 'img.youtube.com',
136
+ 'upload.wikimedia.org',
137
+ 'photobucket.com',
138
+ 'imgur.com',
139
+ 'imageshack.us',
140
+ 'tinypic.com',
141
+ );
142
+ }
143
+ // -------------------------------------------------------------
144
+ // -------------- STOP EDITING CONFIGURATION HERE --------------
145
+ // -------------------------------------------------------------
146
+
147
+ timthumb::start();
148
+
149
+ class timthumb {
150
+ protected $src = "";
151
+ protected $is404 = false;
152
+ protected $docRoot = "";
153
+ protected $lastURLError = false;
154
+ protected $localImage = "";
155
+ protected $localImageMTime = 0;
156
+ protected $url = false;
157
+ protected $myHost = "";
158
+ protected $isURL = false;
159
+ protected $cachefile = '';
160
+ protected $errors = array();
161
+ protected $toDeletes = array();
162
+ protected $cacheDirectory = '';
163
+ protected $startTime = 0;
164
+ protected $lastBenchTime = 0;
165
+ protected $cropTop = false;
166
+ protected $salt = "";
167
+ protected $fileCacheVersion = 1; //Generally if timthumb.php is modifed (upgraded) then the salt changes and all cache files are recreated. This is a backup mechanism to force regen.
168
+ protected $filePrependSecurityBlock = "<?php die('Execution denied!'); //"; //Designed to have three letter mime type, space, question mark and greater than symbol appended. 6 bytes total.
169
+ protected static $curlDataWritten = 0;
170
+ protected static $curlFH = false;
171
+ public static function start(){
172
+ $tim = new timthumb();
173
+ $tim -> handleErrors();
174
+ $tim -> securityChecks();
175
+ if($tim -> tryBrowserCache()){
176
+ exit(0);
177
+ }
178
+ $tim->handleErrors();
179
+ if(FILE_CACHE_ENABLED && $tim->tryServerCache()){
180
+ exit(0);
181
+ }
182
+ $tim->handleErrors();
183
+ $tim->run();
184
+ $tim->handleErrors();
185
+ exit(0);
186
+ }
187
+ public function __construct(){
188
+ global $ALLOWED_SITES;
189
+ $this->startTime = microtime(true);
190
+ date_default_timezone_set('UTC');
191
+ $this -> debug(1, "Starting new request from " . $this->getIP() . " to " . $_SERVER['REQUEST_URI']);
192
+ $this -> calcDocRoot($this -> param('src'));
193
+ //On windows systems I'm assuming fileinode returns an empty string or a number that doesn't change. Check this.
194
+ $this->salt = @filemtime(__FILE__) . '-' . @fileinode(__FILE__);
195
+ $this->debug(3, "Salt is: " . $this->salt);
196
+ if(FILE_CACHE_DIRECTORY){
197
+ if(! is_dir(FILE_CACHE_DIRECTORY)){
198
+ @mkdir(FILE_CACHE_DIRECTORY);
199
+ if(! is_dir(FILE_CACHE_DIRECTORY)){
200
+ $this->error("Could not create the file cache directory.");
201
+ return false;
202
+ }
203
+ }
204
+ $this->cacheDirectory = FILE_CACHE_DIRECTORY;
205
+ if (!touch($this->cacheDirectory . '/index.html')) {
206
+ $this->error("Could not create the index.html file - to fix this create an empty file named index.html file in the cache directory.");
207
+ }
208
+ } else {
209
+ $this->cacheDirectory = sys_get_temp_dir();
210
+ }
211
+ //Clean the cache before we do anything because we don't want the first visitor after FILE_CACHE_TIME_BETWEEN_CLEANS expires to get a stale image.
212
+ $this->cleanCache();
213
+
214
+ $this -> myHost = preg_replace('/^www\./i', '', $_SERVER['HTTP_HOST']);
215
+ $this -> src = $this -> param('src');
216
+ $this -> url = parse_url($this -> src);
217
+
218
+ if(strlen($this -> src) <= 3){
219
+ $this -> error("No image specified");
220
+ return false;
221
+ }
222
+ if(BLOCK_EXTERNAL_LEECHERS && array_key_exists('HTTP_REFERER', $_SERVER) && (! preg_match('/^https?:\/\/(?:www\.)?' . $this->myHost . '(?:$|\/)/i', $_SERVER['HTTP_REFERER']))){
223
+ // base64 encoded red image that says 'no hotlinkers'
224
+ // nothing to worry about! :)
225
+ $imgData = base64_decode("R0lGODlhUAAMAIAAAP8AAP///yH5BAAHAP8ALAAAAABQAAwAAAJpjI+py+0Po5y0OgAMjjv01YUZ\nOGplhWXfNa6JCLnWkXplrcBmW+spbwvaVr/cDyg7IoFC2KbYVC2NQ5MQ4ZNao9Ynzjl9ScNYpneb\nDULB3RP6JuPuaGfuuV4fumf8PuvqFyhYtjdoeFgAADs=");
226
+ header('Content-Type: image/gif');
227
+ header('Content-Length: ' . sizeof($imgData));
228
+ header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
229
+ header("Pragma: no-cache");
230
+ header('Expires: ' . gmdate ('D, d M Y H:i:s', time()));
231
+ echo $imgData;
232
+ return false;
233
+ exit(0);
234
+ }
235
+ if(!FETCH_LOCAL_URLS && preg_match('/https?:\/\/(?:www\.)?' . $this->myHost . '(?:$|\/)/i', $this->src)){
236
+ $this->src = preg_replace('/https?:\/\/(?:www\.)?' . $this->myHost . '/i', '', $this->src);
237
+ }
238
+ if(preg_match('/^https?:\/\/[^\/]+/i', $this->src)){
239
+ $this->debug(2, "Is a request for an external URL: " . $this->src);
240
+ $this->isURL = true;
241
+ } else {
242
+ $this->debug(2, "Is a request for an internal file: " . $this->src);
243
+ }
244
+ if($this->isURL && (! ALLOW_EXTERNAL)){
245
+ $this->error("You are not allowed to fetch images from an external website.");
246
+ return false;
247
+ }
248
+ if($this->isURL){
249
+ if(ALLOW_ALL_EXTERNAL_SITES){
250
+ $this->debug(2, "Fetching from all external sites is enabled.");
251
+ } else {
252
+ $this->debug(2, "Fetching only from selected external sites is enabled.");
253
+ $allowed = false;
254
+ foreach($ALLOWED_SITES as $site){
255
+ if ((strtolower(substr($this->url['host'],-strlen($site)-1)) === strtolower(".$site")) || (strtolower($this->url['host'])===strtolower($site))) {
256
+ $this->debug(3, "URL hostname {$this->url['host']} matches $site so allowing.");
257
+ $allowed = true;
258
+ }
259
+ }
260
+ if(! $allowed){
261
+ return $this->error("You may not fetch images from that site. To enable this site in timthumb, you can either add it to \$ALLOWED_SITES and set ALLOW_EXTERNAL=true. Or you can set ALLOW_ALL_EXTERNAL_SITES=true, depending on your security needs.");
262
+ }
263
+ }
264
+ }
265
+
266
+ $cachePrefix = ($this->isURL ? '_ext_' : '_int_');
267
+ if($this -> isURL){
268
+ $arr = explode('&', $_SERVER ['QUERY_STRING']);
269
+ asort($arr);
270
+ $this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . implode('', $arr) . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
271
+ } else {
272
+ $this -> localImage = $this -> getLocalImagePath($this -> src);
273
+
274
+ if(! $this -> localImage){
275
+ $this -> debug(1, "Could not find the local image: {$this->localImage}");
276
+ $this -> error("Could not find the internal image you specified.");
277
+ $this -> set404();
278
+ return false;
279
+ }
280
+
281
+ $this -> debug(1, "Local image path is {$this->localImage}");
282
+ $this -> localImageMTime = @filemtime($this->localImage);
283
+ //We include the mtime of the local file in case in changes on disk.
284
+ $this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . $this->localImageMTime . $_SERVER ['QUERY_STRING'] . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
285
+ }
286
+ $this->debug(2, "Cache file is: " . $this->cachefile);
287
+
288
+ return true;
289
+ }
290
+ public function __destruct(){
291
+ foreach($this->toDeletes as $del){
292
+ $this->debug(2, "Deleting temp file $del");
293
+ @unlink($del);
294
+ }
295
+ }
296
+ public function run(){
297
+ if($this->isURL){
298
+ if(! ALLOW_EXTERNAL){
299
+ $this->debug(1, "Got a request for an external image but ALLOW_EXTERNAL is disabled so returning error msg.");
300
+ $this->error("You are not allowed to fetch images from an external website.");
301
+ return false;
302
+ }
303
+ $this->debug(3, "Got request for external image. Starting serveExternalImage.");
304
+ if($this->param('webshot')){
305
+ if(WEBSHOT_ENABLED){
306
+ $this->debug(3, "webshot param is set, so we're going to take a webshot.");
307
+ $this->serveWebshot();
308
+ } else {
309
+ $this->error("You added the webshot parameter but webshots are disabled on this server. You need to set WEBSHOT_ENABLED == true to enable webshots.");
310
+ }
311
+ } else {
312
+ $this->debug(3, "webshot is NOT set so we're going to try to fetch a regular image.");
313
+ $this->serveExternalImage();
314
+
315
+ }
316
+ } else {
317
+ $this->debug(3, "Got request for internal image. Starting serveInternalImage()");
318
+ $this->serveInternalImage();
319
+ }
320
+ return true;
321
+ }
322
+ protected function handleErrors(){
323
+ if($this->haveErrors()){
324
+ if(NOT_FOUND_IMAGE && $this->is404()){
325
+ if($this->serveImg(NOT_FOUND_IMAGE)){
326
+ exit(0);
327
+ } else {
328
+ $this->error("Additionally, the 404 image that is configured could not be found or there was an error serving it.");
329
+ }
330
+ }
331
+ if(ERROR_IMAGE){
332
+ if($this->serveImg(ERROR_IMAGE)){
333
+ exit(0);
334
+ } else {
335
+ $this->error("Additionally, the error image that is configured could not be found or there was an error serving it.");
336
+ }
337
+ }
338
+ $this->serveErrors();
339
+ exit(0);
340
+ }
341
+ return false;
342
+ }
343
+ protected function tryBrowserCache(){
344
+ if(BROWSER_CACHE_DISABLE){ $this->debug(3, "Browser caching is disabled"); return false; }
345
+ if(!empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ){
346
+ $this->debug(3, "Got a conditional get");
347
+ $mtime = false;
348
+ //We've already checked if the real file exists in the constructor
349
+ if(! is_file($this->cachefile)){
350
+ //If we don't have something cached, regenerate the cached image.
351
+ return false;
352
+ }
353
+ if($this->localImageMTime){
354
+ $mtime = $this->localImageMTime;
355
+ $this->debug(3, "Local real file's modification time is $mtime");
356
+ } else if(is_file($this->cachefile)){ //If it's not a local request then use the mtime of the cached file to determine the 304
357
+ $mtime = @filemtime($this->cachefile);
358
+ $this->debug(3, "Cached file's modification time is $mtime");
359
+ }
360
+ if(! $mtime){ return false; }
361
+
362
+ $iftime = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']);
363
+ $this->debug(3, "The conditional get's if-modified-since unixtime is $iftime");
364
+ if($iftime < 1){
365
+ $this->debug(3, "Got an invalid conditional get modified since time. Returning false.");
366
+ return false;
367
+ }
368
+ if($iftime < $mtime){ //Real file or cache file has been modified since last request, so force refetch.
369
+ $this->debug(3, "File has been modified since last fetch.");
370
+ return false;
371
+ } else { //Otherwise serve a 304
372
+ $this->debug(3, "File has not been modified since last get, so serving a 304.");
373
+ header ($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
374
+ $this->debug(1, "Returning 304 not modified");
375
+ return true;
376
+ }
377
+ }
378
+ return false;
379
+ }
380
+ protected function tryServerCache(){
381
+ $this->debug(3, "Trying server cache");
382
+ if(file_exists($this->cachefile)){
383
+ $this->debug(3, "Cachefile {$this->cachefile} exists");
384
+ if($this->isURL){
385
+ $this->debug(3, "This is an external request, so checking if the cachefile is empty which means the request failed previously.");
386
+ if(filesize($this->cachefile) < 1){
387
+ $this->debug(3, "Found an empty cachefile indicating a failed earlier request. Checking how old it is.");
388
+ //Fetching error occured previously
389
+ if(time() - @filemtime($this->cachefile) > WAIT_BETWEEN_FETCH_ERRORS){
390
+ $this->debug(3, "File is older than " . WAIT_BETWEEN_FETCH_ERRORS . " seconds. Deleting and returning false so app can try and load file.");
391
+ @unlink($this->cachefile);
392
+ return false; //to indicate we didn't serve from cache and app should try and load
393
+ } else {
394
+ $this->debug(3, "Empty cachefile is still fresh so returning message saying we had an error fetching this image from remote host.");
395
+ $this->set404();
396
+ $this->error("An error occured fetching image.");
397
+ return false;
398
+ }
399
+ }
400
+ } else {
401
+ $this->debug(3, "Trying to serve cachefile {$this->cachefile}");
402
+ }
403
+ if($this->serveCacheFile()){
404
+ $this->debug(3, "Succesfully served cachefile {$this->cachefile}");
405
+ return true;
406
+ } else {
407
+ $this->debug(3, "Failed to serve cachefile {$this->cachefile} - Deleting it from cache.");
408
+ //Image serving failed. We can't retry at this point, but lets remove it from cache so the next request recreates it
409
+ @unlink($this->cachefile);
410
+ return true;
411
+ }
412
+ }
413
+ }
414
+ protected function error($err){
415
+ $this->debug(3, "Adding error message: $err");
416
+ $this->errors[] = $err;
417
+ return false;
418
+
419
+ }
420
+ protected function haveErrors(){
421
+ if(sizeof($this->errors) > 0){
422
+ return true;
423
+ }
424
+ return false;
425
+ }
426
+ protected function serveErrors(){
427
+ header ($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
428
+ $html = '<ul>';
429
+ foreach($this->errors as $err){
430
+ $html .= '<li>' . htmlentities($err) . '</li>';
431
+ }
432
+ $html .= '</ul>';
433
+ echo '<h1>A TimThumb error has occured</h1>The following error(s) occured:<br />' . $html . '<br />';
434
+ echo '<br />Query String : ' . htmlentities ($_SERVER['QUERY_STRING']);
435
+ echo '<br />TimThumb version : ' . VERSION . '</pre>';
436
+ }
437
+ protected function serveInternalImage(){
438
+ $this->debug(3, "Local image path is $this->localImage");
439
+ if(! $this->localImage){
440
+ $this->sanityFail("localImage not set after verifying it earlier in the code.");
441
+ return false;
442
+ }
443
+ $fileSize = filesize($this->localImage);
444
+ if($fileSize > MAX_FILE_SIZE){
445
+ $this->error("The file you specified is greater than the maximum allowed file size.");
446
+ return false;
447
+ }
448
+ if($fileSize <= 0){
449
+ $this->error("The file you specified is <= 0 bytes.");
450
+ return false;
451
+ }
452
+ $this->debug(3, "Calling processImageAndWriteToCache() for local image.");
453
+ if($this->processImageAndWriteToCache($this->localImage)){
454
+ $this->serveCacheFile();
455
+ return true;
456
+ } else {
457
+ return false;
458
+ }
459
+ }
460
+ protected function cleanCache(){
461
+ if (FILE_CACHE_TIME_BETWEEN_CLEANS < 0) {
462
+ return;
463
+ }
464
+ $this->debug(3, "cleanCache() called");
465
+ $lastCleanFile = $this->cacheDirectory . '/timthumb_cacheLastCleanTime.touch';
466
+
467
+ //If this is a new timthumb installation we need to create the file
468
+ if(! is_file($lastCleanFile)){
469
+ $this->debug(1, "File tracking last clean doesn't exist. Creating $lastCleanFile");
470
+ if (!touch($lastCleanFile)) {
471
+ $this->error("Could not create cache clean timestamp file.");
472
+ }
473
+ return;
474
+ }
475
+ if(@filemtime($lastCleanFile) < (time() - FILE_CACHE_TIME_BETWEEN_CLEANS) ){ //Cache was last cleaned more than 1 day ago
476
+ $this->debug(1, "Cache was last cleaned more than " . FILE_CACHE_TIME_BETWEEN_CLEANS . " seconds ago. Cleaning now.");
477
+ // Very slight race condition here, but worst case we'll have 2 or 3 servers cleaning the cache simultaneously once a day.
478
+ if (!touch($lastCleanFile)) {
479
+ $this->error("Could not create cache clean timestamp file.");
480
+ }
481
+ $files = glob($this->cacheDirectory . '/*' . FILE_CACHE_SUFFIX);
482
+ if ($files) {
483
+ $timeAgo = time() - FILE_CACHE_MAX_FILE_AGE;
484
+ foreach($files as $file){
485
+ if(@filemtime($file) < $timeAgo){
486
+ $this->debug(3, "Deleting cache file $file older than max age: " . FILE_CACHE_MAX_FILE_AGE . " seconds");
487
+ @unlink($file);
488
+ }
489
+ }
490
+ }
491
+ return true;
492
+ } else {
493
+ $this->debug(3, "Cache was cleaned less than " . FILE_CACHE_TIME_BETWEEN_CLEANS . " seconds ago so no cleaning needed.");
494
+ }
495
+ return false;
496
+ }
497
+ protected function processImageAndWriteToCache($localImage){
498
+ $sData = getimagesize($localImage);
499
+ $origType = $sData[2];
500
+ $mimeType = $sData['mime'];
501
+
502
+ $this->debug(3, "Mime type of image is $mimeType");
503
+ if(! preg_match('/^image\/(?:gif|jpg|jpeg|png)$/i', $mimeType)){
504
+ return $this->error("The image being resized is not a valid gif, jpg or png.");
505
+ }
506
+
507
+ if (!function_exists ('imagecreatetruecolor')) {
508
+ return $this->error('GD Library Error: imagecreatetruecolor does not exist - please contact your webhost and ask them to install the GD library');
509
+ }
510
+
511
+ if (function_exists ('imagefilter') && defined ('IMG_FILTER_NEGATE')) {
512
+ $imageFilters = array (
513
+ 1 => array (IMG_FILTER_NEGATE, 0),
514
+ 2 => array (IMG_FILTER_GRAYSCALE, 0),
515
+ 3 => array (IMG_FILTER_BRIGHTNESS, 1),
516
+ 4 => array (IMG_FILTER_CONTRAST, 1),
517
+ 5 => array (IMG_FILTER_COLORIZE, 4),
518
+ 6 => array (IMG_FILTER_EDGEDETECT, 0),
519
+ 7 => array (IMG_FILTER_EMBOSS, 0),
520
+ 8 => array (IMG_FILTER_GAUSSIAN_BLUR, 0),
521
+ 9 => array (IMG_FILTER_SELECTIVE_BLUR, 0),
522
+ 10 => array (IMG_FILTER_MEAN_REMOVAL, 0),
523
+ 11 => array (IMG_FILTER_SMOOTH, 0),
524
+ );
525
+ }
526
+
527
+ // get standard input properties
528
+ $new_width = (int) abs ($this->param('w', 0));
529
+ $new_height = (int) abs ($this->param('h', 0));
530
+ $zoom_crop = (int) $this->param('zc', DEFAULT_ZC);
531
+ $quality = (int) abs ($this->param('q', DEFAULT_Q));
532
+ $align = $this->cropTop ? 't' : $this->param('a', 'c');
533
+ $filters = $this->param('f', DEFAULT_F);
534
+ $sharpen = (bool) $this->param('s', DEFAULT_S);
535
+ $canvas_color = $this->param('cc', DEFAULT_CC);
536
+ $canvas_trans = (bool) $this->param('ct', '1');
537
+
538
+ // set default width and height if neither are set already
539
+ if ($new_width == 0 && $new_height == 0) {
540
+ //$new_width = 100;
541
+ //$new_height = 100;
542
+ }
543
+
544
+ // ensure size limits can not be abused
545
+ $new_width = min ($new_width, MAX_WIDTH);
546
+ $new_height = min ($new_height, MAX_HEIGHT);
547
+
548
+ // set memory limit to be able to have enough space to resize larger images
549
+ $this->setMemoryLimit();
550
+
551
+ // open the existing image
552
+ $image = $this->openImage ($mimeType, $localImage);
553
+ if ($image === false) {
554
+ return $this->error('Unable to open image.');
555
+ }
556
+
557
+ // Get original width and height
558
+ $width = imagesx ($image);
559
+ $height = imagesy ($image);
560
+ $origin_x = 0;
561
+ $origin_y = 0;
562
+
563
+ // generate new w/h if not provided
564
+ if ($new_width && !$new_height) {
565
+ $new_height = floor ($height * ($new_width / $width));
566
+ } else if ($new_height && !$new_width) {
567
+ $new_width = floor ($width * ($new_height / $height));
568
+ }
569
+
570
+ // scale down and add borders
571
+ if ($zoom_crop == 3) {
572
+
573
+ $final_height = $height * ($new_width / $width);
574
+
575
+ if ($final_height > $new_height) {
576
+ $new_width = $width * ($new_height / $height);
577
+ } else {
578
+ $new_height = $final_height;
579
+ }
580
+
581
+ }
582
+
583
+ // create a new true color image
584
+ $canvas = imagecreatetruecolor ($new_width, $new_height);
585
+ imagealphablending ($canvas, false);
586
+
587
+ if (strlen($canvas_color) == 3) { //if is 3-char notation, edit string into 6-char notation
588
+ $canvas_color = str_repeat(substr($canvas_color, 0, 1), 2) . str_repeat(substr($canvas_color, 1, 1), 2) . str_repeat(substr($canvas_color, 2, 1), 2);
589
+ } else if (strlen($canvas_color) != 6) {
590
+ $canvas_color = DEFAULT_CC; // on error return default canvas color
591
+ }
592
+
593
+ $canvas_color_R = hexdec (substr ($canvas_color, 0, 2));
594
+ $canvas_color_G = hexdec (substr ($canvas_color, 2, 2));
595
+ $canvas_color_B = hexdec (substr ($canvas_color, 4, 2));
596
+
597
+ // Create a new transparent color for image
598
+ // If is a png and PNG_IS_TRANSPARENT is false then remove the alpha transparency
599
+ // (and if is set a canvas color show it in the background)
600
+ if(preg_match('/^image\/png$/i', $mimeType) && !PNG_IS_TRANSPARENT && $canvas_trans){
601
+ $color = imagecolorallocatealpha ($canvas, $canvas_color_R, $canvas_color_G, $canvas_color_B, 127);
602
+ }else{
603
+ $color = imagecolorallocatealpha ($canvas, $canvas_color_R, $canvas_color_G, $canvas_color_B, 0);
604
+ }
605
+
606
+
607
+ // Completely fill the background of the new image with allocated color.
608
+ imagefill ($canvas, 0, 0, $color);
609
+
610
+ // scale down and add borders
611
+ if ($zoom_crop == 2) {
612
+
613
+ $final_height = $height * ($new_width / $width);
614
+
615
+ if ($final_height > $new_height) {
616
+
617
+ $origin_x = $new_width / 2;
618
+ $new_width = $width * ($new_height / $height);
619
+ $origin_x = round ($origin_x - ($new_width / 2));
620
+
621
+ } else {
622
+
623
+ $origin_y = $new_height / 2;
624
+ $new_height = $final_height;
625
+ $origin_y = round ($origin_y - ($new_height / 2));
626
+
627
+ }
628
+
629
+ }
630
+
631
+ // Restore transparency blending
632
+ imagesavealpha ($canvas, true);
633
+
634
+ if ($zoom_crop > 0) {
635
+
636
+ $src_x = $src_y = 0;
637
+ $src_w = $width;
638
+ $src_h = $height;
639
+
640
+ $cmp_x = $width / $new_width;
641
+ $cmp_y = $height / $new_height;
642
+
643
+ // calculate x or y coordinate and width or height of source
644
+ if ($cmp_x > $cmp_y) {
645
+
646
+ $src_w = round ($width / $cmp_x * $cmp_y);
647
+ $src_x = round (($width - ($width / $cmp_x * $cmp_y)) / 2);
648
+
649
+ } else if ($cmp_y > $cmp_x) {
650
+
651
+ $src_h = round ($height / $cmp_y * $cmp_x);
652
+ $src_y = round (($height - ($height / $cmp_y * $cmp_x)) / 2);
653
+
654
+ }
655
+
656
+ // positional cropping!
657
+ if ($align) {
658
+ if (strpos ($align, 't') !== false) {
659
+ $src_y = 0;
660
+ }
661
+ if (strpos ($align, 'b') !== false) {
662
+ $src_y = $height - $src_h;
663
+ }
664
+ if (strpos ($align, 'l') !== false) {
665
+ $src_x = 0;
666
+ }
667
+ if (strpos ($align, 'r') !== false) {
668
+ $src_x = $width - $src_w;
669
+ }
670
+ }
671
+
672
+ imagecopyresampled ($canvas, $image, $origin_x, $origin_y, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h);
673
+
674
+ } else {
675
+
676
+ // copy and resize part of an image with resampling
677
+ imagecopyresampled ($canvas, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
678
+
679
+ }
680
+
681
+ if ($filters != '' && function_exists ('imagefilter') && defined ('IMG_FILTER_NEGATE')) {
682
+ // apply filters to image
683
+ $filterList = explode ('|', $filters);
684
+ foreach ($filterList as $fl) {
685
+
686
+ $filterSettings = explode (',', $fl);
687
+ if (isset ($imageFilters[$filterSettings[0]])) {
688
+
689
+ for ($i = 0; $i < 4; $i ++) {
690
+ if (!isset ($filterSettings[$i])) {
691
+ $filterSettings[$i] = null;
692
+ } else {
693
+ $filterSettings[$i] = (int) $filterSettings[$i];
694
+ }
695
+ }
696
+
697
+ switch ($imageFilters[$filterSettings[0]][1]) {
698
+
699
+ case 1:
700
+
701
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1]);
702
+ break;
703
+
704
+ case 2:
705
+
706
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2]);
707
+ break;
708
+
709
+ case 3:
710
+
711
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3]);
712
+ break;
713
+
714
+ case 4:
715
+
716
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3], $filterSettings[4]);
717
+ break;
718
+
719
+ default:
720
+
721
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0]);
722
+ break;
723
+
724
+ }
725
+ }
726
+ }
727
+ }
728
+
729
+ // sharpen image
730
+ if ($sharpen && function_exists ('imageconvolution')) {
731
+
732
+ $sharpenMatrix = array (
733
+ array (-1,-1,-1),
734
+ array (-1,16,-1),
735
+ array (-1,-1,-1),
736
+ );
737
+
738
+ $divisor = 8;
739
+ $offset = 0;
740
+
741
+ imageconvolution ($canvas, $sharpenMatrix, $divisor, $offset);
742
+
743
+ }
744
+ //Straight from Wordpress core code. Reduces filesize by up to 70% for PNG's
745
+ if ( (IMAGETYPE_PNG == $origType || IMAGETYPE_GIF == $origType) && function_exists('imageistruecolor') && !imageistruecolor( $image ) && imagecolortransparent( $image ) > 0 ){
746
+ imagetruecolortopalette( $canvas, false, imagecolorstotal( $image ) );
747
+ }
748
+
749
+ $imgType = "";
750
+ $tempfile = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
751
+ if(preg_match('/^image\/(?:jpg|jpeg)$/i', $mimeType)){
752
+ $imgType = 'jpg';
753
+ imagejpeg($canvas, $tempfile, $quality);
754
+ } else if(preg_match('/^image\/png$/i', $mimeType)){
755
+ $imgType = 'png';
756
+ imagepng($canvas, $tempfile, floor($quality * 0.09));
757
+ } else if(preg_match('/^image\/gif$/i', $mimeType)){
758
+ $imgType = 'gif';
759
+ imagegif($canvas, $tempfile);
760
+ } else {
761
+ return $this->sanityFail("Could not match mime type after verifying it previously.");
762
+ }
763
+
764
+ if($imgType == 'png' && OPTIPNG_ENABLED && OPTIPNG_PATH && @is_file(OPTIPNG_PATH)){
765
+ $exec = OPTIPNG_PATH;
766
+ $this->debug(3, "optipng'ing $tempfile");
767
+ $presize = filesize($tempfile);
768
+ $out = `$exec -o1 $tempfile`; //you can use up to -o7 but it really slows things down
769
+ clearstatcache();
770
+ $aftersize = filesize($tempfile);
771
+ $sizeDrop = $presize - $aftersize;
772
+ if($sizeDrop > 0){
773
+ $this->debug(1, "optipng reduced size by $sizeDrop");
774
+ } else if($sizeDrop < 0){
775
+ $this->debug(1, "optipng increased size! Difference was: $sizeDrop");
776
+ } else {
777
+ $this->debug(1, "optipng did not change image size.");
778
+ }
779
+ } else if($imgType == 'png' && PNGCRUSH_ENABLED && PNGCRUSH_PATH && @is_file(PNGCRUSH_PATH)){
780
+ $exec = PNGCRUSH_PATH;
781
+ $tempfile2 = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
782
+ $this->debug(3, "pngcrush'ing $tempfile to $tempfile2");
783
+ $out = `$exec $tempfile $tempfile2`;
784
+ $todel = "";
785
+ if(is_file($tempfile2)){
786
+ $sizeDrop = filesize($tempfile) - filesize($tempfile2);
787
+ if($sizeDrop > 0){
788
+ $this->debug(1, "pngcrush was succesful and gave a $sizeDrop byte size reduction");
789
+ $todel = $tempfile;
790
+ $tempfile = $tempfile2;
791
+ } else {
792
+ $this->debug(1, "pngcrush did not reduce file size. Difference was $sizeDrop bytes.");
793
+ $todel = $tempfile2;
794
+ }
795
+ } else {
796
+ $this->debug(3, "pngcrush failed with output: $out");
797
+ $todel = $tempfile2;
798
+ }
799
+ @unlink($todel);
800
+ }
801
+
802
+ $this->debug(3, "Rewriting image with security header.");
803
+ $tempfile4 = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
804
+ $context = stream_context_create ();
805
+ $fp = fopen($tempfile,'r',0,$context);
806
+ file_put_contents($tempfile4, $this->filePrependSecurityBlock . $imgType . ' ?' . '>'); //6 extra bytes, first 3 being image type
807
+ file_put_contents($tempfile4, $fp, FILE_APPEND);
808
+ fclose($fp);
809
+ @unlink($tempfile);
810
+ $this->debug(3, "Locking and replacing cache file.");
811
+ $lockFile = $this->cachefile . '.lock';
812
+ $fh = fopen($lockFile, 'w');
813
+ if(! $fh){
814
+ return $this->error("Could not open the lockfile for writing an image.");
815
+ }
816
+ if(flock($fh, LOCK_EX)){
817
+ @unlink($this->cachefile); //rename generally overwrites, but doing this in case of platform specific quirks. File might not exist yet.
818
+ rename($tempfile4, $this->cachefile);
819
+ flock($fh, LOCK_UN);
820
+ fclose($fh);
821
+ @unlink($lockFile);
822
+ } else {
823
+ fclose($fh);
824
+ @unlink($lockFile);
825
+ @unlink($tempfile4);
826
+ return $this->error("Could not get a lock for writing.");
827
+ }
828
+ $this->debug(3, "Done image replace with security header. Cleaning up and running cleanCache()");
829
+ imagedestroy($canvas);
830
+ imagedestroy($image);
831
+ return true;
832
+ }
833
+
834
+ protected function calcDocRoot(){
835
+ $docRoot = @$_SERVER['DOCUMENT_ROOT'];
836
+ if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
837
+ $docRoot = LOCAL_FILE_BASE_DIRECTORY;
838
+ }
839
+ if(!isset($docRoot)){
840
+ $this->debug(3, "DOCUMENT_ROOT is not set. This is probably windows. Starting search 1.");
841
+ if(isset($_SERVER['SCRIPT_FILENAME'])){
842
+ $docRoot = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
843
+ $this->debug(3, "Generated docRoot using SCRIPT_FILENAME and PHP_SELF as: $docRoot");
844
+ }
845
+ }
846
+ if(!isset($docRoot)){
847
+ $this->debug(3, "DOCUMENT_ROOT still is not set. Starting search 2.");
848
+ if(isset($_SERVER['PATH_TRANSLATED'])){
849
+ $docRoot = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
850
+ $this->debug(3, "Generated docRoot using PATH_TRANSLATED and PHP_SELF as: $docRoot");
851
+ }
852
+ }
853
+ if($docRoot && $_SERVER['DOCUMENT_ROOT'] != '/'){ $docRoot = preg_replace('/\/$/', '', $docRoot); }
854
+ $this->debug(3, "Doc root is: " . $docRoot);
855
+ $docRoot = rtrim($docRoot, '/') . '/';
856
+ $this->docRoot = $docRoot;
857
+ }
858
+
859
+ protected function getLocalImagePath($src){
860
+ $src = ltrim($src, '/'); //strip off the leading '/'
861
+
862
+ if(! $this -> docRoot){
863
+ $this->debug(3, "We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.");
864
+ //We don't support serving images outside the current dir if we don't have a doc root for security reasons.
865
+ $file = preg_replace('/^.*?([^\/\\\\]+)$/', '$1', $src); //strip off any path info and just leave the filename.
866
+ if(is_file($file)){
867
+ return $this -> realpath($file);
868
+ }
869
+ return $this->error("Could not find your website document root and the file specified doesn't exist in timthumbs directory. We don't support serving files outside timthumb's directory without a document root for security reasons.");
870
+ } //Do not go past this point without docRoot set
871
+
872
+ //Try src under docRoot
873
+ if(file_exists ($this -> docRoot . '/' . $src)) {
874
+ $this->debug(3, "Found file as " . $this -> docRoot . '/' . $src);
875
+ $real = $this -> realpath($this->docRoot . '/' . $src);
876
+ if(stripos($real, $this->docRoot) === 0){
877
+ return $real;
878
+ } else {
879
+ $this -> debug(1, "Security block: The file specified occurs outside the document root.");
880
+ //allow search to continue
881
+ }
882
+ }
883
+ //Check absolute paths and then verify the real path is under doc root
884
+ $absolute = $this -> realpath('/' . $src);
885
+ if($absolute && file_exists($absolute)){ //realpath does file_exists check, so can probably skip the exists check here
886
+ $this->debug(3, "Found absolute path: $absolute");
887
+ if(! $this->docRoot){ $this->sanityFail("docRoot not set when checking absolute path."); }
888
+ if(stripos($absolute, $this->docRoot) === 0){
889
+ return $absolute;
890
+ } else {
891
+ $this -> debug(1, "Security block: The file specified occurs outside the document root.");
892
+ //and continue search
893
+ }
894
+ }
895
+
896
+ $base = $this->docRoot;
897
+
898
+ // account for Windows directory structure
899
+ if (strstr($_SERVER['SCRIPT_FILENAME'],':')) {
900
+ $sub_directories = explode('\\', str_replace($this -> docRoot, '', $_SERVER['SCRIPT_FILENAME']));
901
+ } else {
902
+ $sub_directories = explode('/', str_replace($this -> docRoot, '', $_SERVER['SCRIPT_FILENAME']));
903
+ }
904
+
905
+ foreach ($sub_directories as $sub){
906
+ $base .= $sub . '/';
907
+ $this -> debug(3, "Trying file as: " . $base . $src);
908
+ if(file_exists($base . $src)){
909
+ $this->debug(3, "Found file as: " . $base . $src);
910
+ $real = $this->realpath($base . $src);
911
+ if(stripos($real, $this -> realpath($this->docRoot)) === 0){
912
+ return $real;
913
+ } else {
914
+ $this->debug(1, "Security block: The file specified occurs outside the document root.");
915
+ //And continue search
916
+ }
917
+ }
918
+ }
919
+
920
+ return false;
921
+ }
922
+ protected function realpath($path){
923
+ //try to remove any relative paths
924
+ $remove_relatives = '/\w+\/\.\.\//';
925
+ while(preg_match($remove_relatives,$path)){
926
+ $path = preg_replace($remove_relatives, '', $path);
927
+ }
928
+ //if any remain use PHP realpath to strip them out, otherwise return $path
929
+ //if using realpath, any symlinks will also be resolved
930
+ return preg_match('#^\.\./|/\.\./#', $path) ? realpath($path) : $path;
931
+ }
932
+ protected function toDelete($name){
933
+ $this->debug(3, "Scheduling file $name to delete on destruct.");
934
+ $this->toDeletes[] = $name;
935
+ }
936
+ protected function serveWebshot(){
937
+ $this->debug(3, "Starting serveWebshot");
938
+ $instr = "Please follow the instructions at http://code.google.com/p/timthumb/ to set your server up for taking website screenshots.";
939
+ if(! is_file(WEBSHOT_CUTYCAPT)){
940
+ return $this->error("CutyCapt is not installed. $instr");
941
+ }
942
+ if(! is_file(WEBSHOT_XVFB)){
943
+ return $this->Error("Xvfb is not installed. $instr");
944
+ }
945
+ $cuty = WEBSHOT_CUTYCAPT;
946
+ $xv = WEBSHOT_XVFB;
947
+ $screenX = WEBSHOT_SCREEN_X;
948
+ $screenY = WEBSHOT_SCREEN_Y;
949
+ $colDepth = WEBSHOT_COLOR_DEPTH;
950
+ $format = WEBSHOT_IMAGE_FORMAT;
951
+ $timeout = WEBSHOT_TIMEOUT * 1000;
952
+ $ua = WEBSHOT_USER_AGENT;
953
+ $jsOn = WEBSHOT_JAVASCRIPT_ON ? 'on' : 'off';
954
+ $javaOn = WEBSHOT_JAVA_ON ? 'on' : 'off';
955
+ $pluginsOn = WEBSHOT_PLUGINS_ON ? 'on' : 'off';
956
+ $proxy = WEBSHOT_PROXY ? ' --http-proxy=' . WEBSHOT_PROXY : '';
957
+ $tempfile = tempnam($this->cacheDirectory, 'timthumb_webshot');
958
+ $url = $this->src;
959
+ if(! preg_match('/^https?:\/\/[a-zA-Z0-9\.\-]+/i', $url)){
960
+ return $this->error("Invalid URL supplied.");
961
+ }
962
+ $url = preg_replace('/[^A-Za-z0-9\-\.\_\~:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=]+/', '', $url); //RFC 3986
963
+ //Very important we don't allow injection of shell commands here. URL is between quotes and we are only allowing through chars allowed by a the RFC
964
+ // which AFAIKT can't be used for shell injection.
965
+ if(WEBSHOT_XVFB_RUNNING){
966
+ putenv('DISPLAY=:100.0');
967
+ $command = "$cuty $proxy --max-wait=$timeout --user-agent=\"$ua\" --javascript=$jsOn --java=$javaOn --plugins=$pluginsOn --js-can-open-windows=off --url=\"$url\" --out-format=$format --out=$tempfile";
968
+ } else {
969
+ $command = "$xv --server-args=\"-screen 0, {$screenX}x{$screenY}x{$colDepth}\" $cuty $proxy --max-wait=$timeout --user-agent=\"$ua\" --javascript=$jsOn --java=$javaOn --plugins=$pluginsOn --js-can-open-windows=off --url=\"$url\" --out-format=$format --out=$tempfile";
970
+ }
971
+ $this->debug(3, "Executing command: $command");
972
+ $out = `$command`;
973
+ $this->debug(3, "Received output: $out");
974
+ if(! is_file($tempfile)){
975
+ $this->set404();
976
+ return $this->error("The command to create a thumbnail failed.");
977
+ }
978
+ $this->cropTop = true;
979
+ if($this->processImageAndWriteToCache($tempfile)){
980
+ $this->debug(3, "Image processed succesfully. Serving from cache");
981
+ return $this->serveCacheFile();
982
+ } else {
983
+ return false;
984
+ }
985
+ }
986
+ protected function serveExternalImage(){
987
+ if(! preg_match('/^https?:\/\/[a-zA-Z0-9\-\.]+/i', $this->src)){
988
+ $this->error("Invalid URL supplied.");
989
+ return false;
990
+ }
991
+ $tempfile = tempnam($this->cacheDirectory, 'timthumb');
992
+ $this->debug(3, "Fetching external image into temporary file $tempfile");
993
+ $this->toDelete($tempfile);
994
+ #fetch file here
995
+ if(! $this->getURL($this->src, $tempfile)){
996
+ @unlink($this->cachefile);
997
+ touch($this->cachefile);
998
+ $this->debug(3, "Error fetching URL: " . $this->lastURLError);
999
+ $this->error("Error reading the URL you specified from remote host." . $this->lastURLError);
1000
+ return false;
1001
+ }
1002
+
1003
+ $mimeType = $this->getMimeType($tempfile);
1004
+ if(! preg_match("/^image\/(?:jpg|jpeg|gif|png)$/i", $mimeType)){
1005
+ $this->debug(3, "Remote file has invalid mime type: $mimeType");
1006
+ @unlink($this->cachefile);
1007
+ touch($this->cachefile);
1008
+ $this->error("The remote file is not a valid image.");
1009
+ return false;
1010
+ }
1011
+ if($this->processImageAndWriteToCache($tempfile)){
1012
+ $this->debug(3, "Image processed succesfully. Serving from cache");
1013
+ return $this->serveCacheFile();
1014
+ } else {
1015
+ return false;
1016
+ }
1017
+ }
1018
+ public static function curlWrite($h, $d){
1019
+ fwrite(self::$curlFH, $d);
1020
+ self::$curlDataWritten += strlen($d);
1021
+ if(self::$curlDataWritten > MAX_FILE_SIZE){
1022
+ return 0;
1023
+ } else {
1024
+ return strlen($d);
1025
+ }
1026
+ }
1027
+ protected function serveCacheFile(){
1028
+ $this->debug(3, "Serving {$this->cachefile}");
1029
+ if(! is_file($this->cachefile)){
1030
+ $this->error("serveCacheFile called in timthumb but we couldn't find the cached file.");
1031
+ return false;
1032
+ }
1033
+ $fp = fopen($this->cachefile, 'rb');
1034
+ if(! $fp){ return $this->error("Could not open cachefile."); }
1035
+ fseek($fp, strlen($this->filePrependSecurityBlock), SEEK_SET);
1036
+ $imgType = fread($fp, 3);
1037
+ fseek($fp, 3, SEEK_CUR);
1038
+ if(ftell($fp) != strlen($this->filePrependSecurityBlock) + 6){
1039
+ @unlink($this->cachefile);
1040
+ return $this->error("The cached image file seems to be corrupt.");
1041
+ }
1042
+ $imageDataSize = filesize($this->cachefile) - (strlen($this->filePrependSecurityBlock) + 6);
1043
+ $this->sendImageHeaders($imgType, $imageDataSize);
1044
+ $bytesSent = @fpassthru($fp);
1045
+ fclose($fp);
1046
+ if($bytesSent > 0){
1047
+ return true;
1048
+ }
1049
+ $content = file_get_contents ($this->cachefile);
1050
+ if ($content != FALSE) {
1051
+ $content = substr($content, strlen($this->filePrependSecurityBlock) + 6);
1052
+ echo $content;
1053
+ $this->debug(3, "Served using file_get_contents and echo");
1054
+ return true;
1055
+ } else {
1056
+ $this->error("Cache file could not be loaded.");
1057
+ return false;
1058
+ }
1059
+ }
1060
+ protected function sendImageHeaders($mimeType, $dataSize){
1061
+ if(! preg_match('/^image\//i', $mimeType)){
1062
+ $mimeType = 'image/' . $mimeType;
1063
+ }
1064
+ if(strtolower($mimeType) == 'image/jpg'){
1065
+ $mimeType = 'image/jpeg';
1066
+ }
1067
+ $gmdate_expires = gmdate ('D, d M Y H:i:s', strtotime ('now +10 days')) . ' GMT';
1068
+ $gmdate_modified = gmdate ('D, d M Y H:i:s') . ' GMT';
1069
+ // send content headers then display image
1070
+ header ('Content-Type: ' . $mimeType);
1071
+ header ('Accept-Ranges: none'); //Changed this because we don't accept range requests
1072
+ header ('Last-Modified: ' . $gmdate_modified);
1073
+ header ('Content-Length: ' . $dataSize);
1074
+ if(BROWSER_CACHE_DISABLE){
1075
+ $this->debug(3, "Browser cache is disabled so setting non-caching headers.");
1076
+ header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
1077
+ header("Pragma: no-cache");
1078
+ header('Expires: ' . gmdate ('D, d M Y H:i:s', time()));
1079
+ } else {
1080
+ $this->debug(3, "Browser caching is enabled");
1081
+ header('Cache-Control: max-age=' . BROWSER_CACHE_MAX_AGE . ', must-revalidate');
1082
+ header('Expires: ' . $gmdate_expires);
1083
+ }
1084
+ return true;
1085
+ }
1086
+ protected function securityChecks(){
1087
+ }
1088
+ protected function param($property, $default = '') {
1089
+ if (isset($_GET[$property])) {
1090
+ return $_GET[$property];
1091
+ } else {
1092
+ return $default;
1093
+ }
1094
+ }
1095
+ protected function openImage($mimeType, $src){
1096
+ switch ($mimeType) {
1097
+ case 'image/jpeg':
1098
+ $image = imagecreatefromjpeg ($src);
1099
+ break;
1100
+
1101
+ case 'image/png':
1102
+ $image = imagecreatefrompng ($src);
1103
+ break;
1104
+
1105
+ case 'image/gif':
1106
+ $image = imagecreatefromgif ($src);
1107
+ break;
1108
+
1109
+ default:
1110
+ $this->error("Unrecognised mimeType");
1111
+ }
1112
+
1113
+ return $image;
1114
+ }
1115
+ protected function getIP(){
1116
+ $rem = @$_SERVER["REMOTE_ADDR"];
1117
+ $ff = @$_SERVER["HTTP_X_FORWARDED_FOR"];
1118
+ $ci = @$_SERVER["HTTP_CLIENT_IP"];
1119
+ if(preg_match('/^(?:192\.168|172\.16|10\.|127\.)/', $rem)){
1120
+ if($ff){ return $ff; }
1121
+ if($ci){ return $ci; }
1122
+ return $rem;
1123
+ } else {
1124
+ if($rem){ return $rem; }
1125
+ if($ff){ return $ff; }
1126
+ if($ci){ return $ci; }
1127
+ return "UNKNOWN";
1128
+ }
1129
+ }
1130
+ protected function debug($level, $msg){
1131
+ if(DEBUG_ON && $level <= DEBUG_LEVEL){
1132
+ $execTime = sprintf('%.6f', microtime(true) - $this->startTime);
1133
+ $tick = sprintf('%.6f', 0);
1134
+ if($this->lastBenchTime > 0){
1135
+ $tick = sprintf('%.6f', microtime(true) - $this->lastBenchTime);
1136
+ }
1137
+ $this->lastBenchTime = microtime(true);
1138
+ error_log("TimThumb Debug line " . __LINE__ . " [$execTime : $tick]: $msg");
1139
+ }
1140
+ }
1141
+ protected function sanityFail($msg){
1142
+ return $this->error("There is a problem in the timthumb code. Message: Please report this error at <a href='http://code.google.com/p/timthumb/issues/list'>timthumb's bug tracking page</a>: $msg");
1143
+ }
1144
+ protected function getMimeType($file){
1145
+ $info = getimagesize($file);
1146
+ if(is_array($info) && $info['mime']){
1147
+ return $info['mime'];
1148
+ }
1149
+ return '';
1150
+ }
1151
+ protected function setMemoryLimit(){
1152
+ $inimem = ini_get('memory_limit');
1153
+ $inibytes = timthumb::returnBytes($inimem);
1154
+ $ourbytes = timthumb::returnBytes(MEMORY_LIMIT);
1155
+ if($inibytes < $ourbytes){
1156
+ ini_set ('memory_limit', MEMORY_LIMIT);
1157
+ $this->debug(3, "Increased memory from $inimem to " . MEMORY_LIMIT);
1158
+ } else {
1159
+ $this->debug(3, "Not adjusting memory size because the current setting is " . $inimem . " and our size of " . MEMORY_LIMIT . " is smaller.");
1160
+ }
1161
+ }
1162
+ protected static function returnBytes($size_str){
1163
+ switch (substr ($size_str, -1))
1164
+ {
1165
+ case 'M': case 'm': return (int)$size_str * 1048576;
1166
+ case 'K': case 'k': return (int)$size_str * 1024;
1167
+ case 'G': case 'g': return (int)$size_str * 1073741824;
1168
+ default: return $size_str;
1169
+ }
1170
+ }
1171
+ protected function getURL($url, $tempfile){
1172
+ $this->lastURLError = false;
1173
+ $url = preg_replace('/ /', '%20', $url);
1174
+ if(function_exists('curl_init')){
1175
+ $this->debug(3, "Curl is installed so using it to fetch URL.");
1176
+ self::$curlFH = fopen($tempfile, 'w');
1177
+ if(! self::$curlFH){
1178
+ $this->error("Could not open $tempfile for writing.");
1179
+ return false;
1180
+ }
1181
+ self::$curlDataWritten = 0;
1182
+ $this->debug(3, "Fetching url with curl: $url");
1183
+ $curl = curl_init($url);
1184
+ curl_setopt ($curl, CURLOPT_TIMEOUT, CURL_TIMEOUT);
1185
+ curl_setopt ($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30");
1186
+ curl_setopt ($curl, CURLOPT_RETURNTRANSFER, TRUE);
1187
+ curl_setopt ($curl, CURLOPT_HEADER, 0);
1188
+ curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
1189
+ curl_setopt ($curl, CURLOPT_WRITEFUNCTION, 'timthumb::curlWrite');
1190
+ @curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, true);
1191
+ @curl_setopt ($curl, CURLOPT_MAXREDIRS, 10);
1192
+
1193
+ $curlResult = curl_exec($curl);
1194
+ fclose(self::$curlFH);
1195
+ $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
1196
+ if($httpStatus == 404){
1197
+ $this->set404();
1198
+ }
1199
+ if($curlResult){
1200
+ curl_close($curl);
1201
+ return true;
1202
+ } else {
1203
+ $this->lastURLError = curl_error($curl);
1204
+ curl_close($curl);
1205
+ return false;
1206
+ }
1207
+ } else {
1208
+ $img = @file_get_contents ($url);
1209
+ if($img === false){
1210
+ $err = error_get_last();
1211
+ if(is_array($err) && $err['message']){
1212
+ $this->lastURLError = $err['message'];
1213
+ } else {
1214
+ $this->lastURLError = $err;
1215
+ }
1216
+ if(preg_match('/404/', $this->lastURLError)){
1217
+ $this->set404();
1218
+ }
1219
+
1220
+ return false;
1221
+ }
1222
+ if(! file_put_contents($tempfile, $img)){
1223
+ $this->error("Could not write to $tempfile.");
1224
+ return false;
1225
+ }
1226
+ return true;
1227
+ }
1228
+
1229
+ }
1230
+ protected function serveImg($file){
1231
+ $s = getimagesize($file);
1232
+ if(! ($s && $s['mime'])){
1233
+ return false;
1234
+ }
1235
+ header ('Content-Type: ' . $s['mime']);
1236
+ header ('Content-Length: ' . filesize($file) );
1237
+ header ('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
1238
+ header ("Pragma: no-cache");
1239
+ $bytes = @readfile($file);
1240
+ if($bytes > 0){
1241
+ return true;
1242
+ }
1243
+ $content = @file_get_contents ($file);
1244
+ if ($content != FALSE){
1245
+ echo $content;
1246
+ return true;
1247
+ }
1248
+ return false;
1249
+
1250
+ }
1251
+ protected function set404(){
1252
+ $this -> is404 = true;
1253
+ }
1254
+ protected function is404(){
1255
+ return $this->is404;
1256
+ }
1257
+ }
views/admin/galleries/index.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap <?php echo $this -> pre; ?>">
2
+ <div class="icon32">
3
+ <img src="<?php echo $this -> url(); ?>/images/icon-galleries-32.png" />
4
+ </div>
5
+
6
+ <h2><?php _e('Manage Galleries', $this -> plugin_name); ?> <?php echo $this -> Html -> link(__('Add New'), $this -> url . '&amp;method=save', array('class' => "button add-new-h2")); ?></h2>
7
+
8
+ <?php if (!empty($galleries)) : ?>
9
+ <form id="posts-filter" action="<?php echo $this -> url; ?>" method="post">
10
+ <ul class="subsubsub">
11
+ <li><?php echo $paginate -> allcount; ?> <?php _e('galleries', $this -> plugin_name); ?></li>
12
+ </ul>
13
+ </form>
14
+
15
+ <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected galleries?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
16
+ <div class="tablenav">
17
+ <div class="alignleft actions">
18
+ <select name="action" class="action">
19
+ <option value=""><?php _e('- Bulk Actions -', $this -> plugin_name); ?></option>
20
+ <option value="delete"><?php _e('Delete', $this -> plugin_name); ?></option>
21
+ </select>
22
+ <input type="submit" class="button" value="<?php _e('Apply', $this -> plugin_name); ?>" name="execute" />
23
+ </div>
24
+ <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
25
+ </div>
26
+
27
+ <table class="widefat">
28
+ <thead>
29
+ <tr>
30
+ <th class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></th>
31
+ <th><?php _e('Title', $this -> plugin_name); ?></th>
32
+ <th><?php _e('Slides', $this -> plugin_name); ?></th>
33
+ <th><?php _e('Date', $this -> plugin_name); ?></th>
34
+ </tr>
35
+ </thead>
36
+ <tfoot>
37
+ <tr>
38
+ <th class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></th>
39
+ <th><?php _e('Title', $this -> plugin_name); ?></th>
40
+ <th><?php _e('Slides', $this -> plugin_name); ?></th>
41
+ <th><?php _e('Date', $this -> plugin_name); ?></th>
42
+ </tr>
43
+ </tfoot>
44
+ <tbody>
45
+ <?php foreach ($galleries as $gallery) : ?>
46
+ <tr class="<?php echo $class = (empty($class)) ? 'alternate' : ''; ?>">
47
+ <th class="check-column"><input type="checkbox" name="Gallery[checklist][]" value="<?php echo $gallery -> id; ?>" id="checklist<?php echo $gallery -> id; ?>" /></th>
48
+ <td>
49
+ <a class="row-title" href="<?php echo $this -> url; ?>&amp;method=save&amp;id=<?php echo $gallery -> id; ?>" title=""><?php echo $gallery -> title; ?></a>
50
+ <div class="row-actions">
51
+ <span class="view"><?php echo $this -> Html -> link(__('View', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=view&amp;id=" . $gallery -> id); ?> |</span>
52
+ <span class="edit"><?php echo $this -> Html -> link(__('Edit', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=save&amp;id=" . $gallery -> id); ?> |</span>
53
+ <span class="delete"><?php echo $this -> Html -> link(__('Delete', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=delete&amp;id=" . $gallery -> id, array('class' => "submitdelete", 'onclick' => "if (!confirm('" . __('Are you sure you want to permanently remove this slide?', $this -> plugin_name) . "')) { return false; }")); ?></span>
54
+ </div>
55
+ </td>
56
+ <td>
57
+ <a href="?page=<?php echo $this -> sections -> galleries; ?>&amp;method=view&amp;id=<?php echo $gallery -> id; ?>"><?php echo $gallery -> slidescount; ?></a>
58
+ </td>
59
+ <td><abbr title="<?php echo $gallery -> modified; ?>"><?php echo date("Y-m-d", strtotime($gallery -> modified)); ?></abbr></td>
60
+ </tr>
61
+ <?php endforeach; ?>
62
+ </tbody>
63
+ </table>
64
+
65
+ <div class="tablenav">
66
+
67
+ <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
68
+ </div>
69
+ </form>
70
+ <?php else : ?>
71
+ <p class="error"><?php _e('No galleries are available.', $this -> plugin_name); ?></p>
72
+ <?php endif; ?>
73
+ </div>
views/admin/galleries/save.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap <?php echo $this -> pre; ?>">
2
+ <div class="icon32">
3
+ <img src="<?php echo $this -> url(); ?>/images/icon-galleries-32.png" />
4
+ </div>
5
+
6
+ <h2><?php _e('Save a Gallery', $this -> plugin_name); ?></h2>
7
+
8
+ <form action="<?php echo $this -> url; ?>&amp;method=save" method="post">
9
+ <input type="hidden" name="Gallery[id]" value="<?php echo $this -> Gallery -> data -> id; ?>" />
10
+
11
+ <table class="form-table">
12
+ <tbody>
13
+ <tr>
14
+ <th><label for="Gallery_title"><?php _e('Title', $this -> plugin_name); ?></label></th>
15
+ <td>
16
+ <input type="text" class="widefat" name="Gallery[title]" value="<?php echo esc_attr(stripslashes($this -> Gallery -> data -> title)); ?>" id="Gallery_title" />
17
+ <span class="howto"><?php _e('Title of this gallery for identification purposes.', $this -> plugin_name); ?></span>
18
+ <?php echo (!empty($this -> Gallery -> errors['title'])) ? '<span class="error">' . $this -> Gallery -> errors['title'] . '</span>' : ''; ?>
19
+ </td>
20
+ </tr>
21
+ </tbody>
22
+ </table>
23
+
24
+ <p class="submit">
25
+ <input type="submit" class="button-primary" value="<?php _e('Save Gallery', $this -> plugin_name); ?>" name="submit" />
26
+ </p>
27
+ </form>
28
+ </div>
views/admin/galleries/view.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap <?php echo $this -> pre; ?>">
2
+ <div class="icon32">
3
+ <img src="<?php echo $this -> url(); ?>/images/icon-galleries-32.png" />
4
+ </div>
5
+
6
+ <h2><?php echo sprintf(__('View Gallery: %s', $this -> plugin_name), $gallery -> title); ?></h2>
7
+
8
+ <div style="float:none;" class="subsubsub"><?php echo $this -> Html -> link(__('&larr; All Galleries', $this -> plugin_name), $this -> url, array('title' => __('All Galleries', $this -> plugin_name))); ?></div>
9
+
10
+ <div class="tablenav">
11
+ <div class="alignleft actions">
12
+ <a href="?page=<?php echo $this -> sections -> galleries; ?>&amp;method=save&amp;id=<?php echo $gallery -> id; ?>" class="button" title="<?php _e('Edit', $this -> plugin_name); ?>"><?php _e('Edit Gallery', $this -> plugin_name); ?></a>
13
+ <a onclick="if (!confirm('<?php _e('Are you sure you want to delete this gallery?', $this -> plugin_name); ?>')) { return false; }" href="?page=<?php echo $this -> sections -> galleries; ?>&amp;method=delete&amp;id=<?php echo $gallery -> id; ?>" class="button button-highlighted" title="<?php _e('Delete', $this -> plugin_name); ?>"><?php _e('Delete Gallery', $this -> plugin_name); ?></a>
14
+ </div>
15
+ </div>
16
+
17
+ <?php $this -> render('slides' . DS . 'loop', array('slides' => $slides), true, 'admin'); ?>
18
+ </div>
views/admin/head.php CHANGED
@@ -1,3 +1,7 @@
1
  <script type="text/javascript">
2
  var GalleryAjax = "<?php echo $this -> url(); ?>/<?php echo $this -> plugin_name; ?>-ajax.php";
 
 
 
 
3
  </script>
1
  <script type="text/javascript">
2
  var GalleryAjax = "<?php echo $this -> url(); ?>/<?php echo $this -> plugin_name; ?>-ajax.php";
3
+
4
+ jQuery(document).ready(function() {
5
+ jQuery('.colorbox').colorbox({maxWidth:'100%', maxHeight:'100%'});
6
+ });
7
  </script>
views/admin/metaboxes/_notes/dwsync.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <dwsync>
3
- <file name="settings-linksimages.php" server="wpplugins.biz/public_html/" local="129345034052780477" remote="129345033600000000" />
4
- </dwsync>
 
 
 
 
views/admin/metaboxes/settings-about.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="submitbox">
2
+ <div id="minor-publishing">
3
+ <div id="misc-publishing-actions">
4
+ <div class="misc-pub-section">
5
+ <a href="http://docs.tribulant.com/wordpress-slideshow-gallery/1758" target="_blank">Online Documentation</a>
6
+ </div>
7
+ <div class="misc-pub-section">
8
+ <a href="https://www.facebook.com/tribulantsoftware" target="_blank">Find Us on Facebook</a>
9
+ </div>
10
+ <div class="misc-pub-section misc-pub-section-last">
11
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YGCRFTX84K9AS" target="_blank">Make a Donation!</a>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ </div>
views/admin/metaboxes/settings-general.php CHANGED
@@ -5,6 +5,7 @@
5
  <td>
6
  <label><input onclick="jQuery('#autoslide_div').show();" <?php echo ($this -> get_option('autoslide') == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="autoslide" value="Y" id="autoslideY" /> <?php _e('Yes', $this -> plugin_name); ?></label>
7
  <label><input onclick="jQuery('#autoslide_div').hide();" <?php echo ($this -> get_option('autoslide') == "N") ? 'checked="checked"' : ''; ?> type="radio" name="autoslide" value="N" id="autoslideN" /> <?php _e('No', $this -> plugin_name); ?></label>
 
8
  </td>
9
  </tr>
10
  </tbody>
@@ -17,7 +18,7 @@
17
  <th><label for="autospeed"><?php _e('Auto Speed', $this -> plugin_name); ?></label></th>
18
  <td>
19
  <input type="text" style="width:45px;" name="autospeed" value="<?php echo $this -> get_option('autospeed'); ?>" id="autospeed" /> <?php _e('speed', $this -> plugin_name); ?>
20
- <span class="howto"><?php _e('default:10', $this -> plugin_name); ?><br/><?php _e('lower number for shorter interval between images', $this -> plugin_name); ?></span>
21
  </td>
22
  </tr>
23
  </tbody>
@@ -30,28 +31,49 @@
30
  <th><label for="fadespeed"><?php _e('Image Fading Speed', $this -> plugin_name); ?></label></th>
31
  <td>
32
  <input style="width:45px;" type="text" name="fadespeed" value="<?php echo $this -> get_option('fadespeed'); ?>" id="fadespeed" />
33
- <span class="howto"><?php _e('default:10 recommended:1-20', $this -> plugin_name); ?><br/><?php _e('lower number for quicker fading of images', $this -> plugin_name); ?></span>
34
  </td>
35
  </tr>
36
  <tr>
37
- <th><label for="navopacity"><?php _e('Navigation Default Opacity', $this -> plugin_name); ?></label></th>
38
  <td>
39
- <input type="text" name="navopacity" value="<?php echo $this -> get_option('navopacity'); ?>" id="navopacity" style="width:45px;" /> <?php _e('&#37; <!-- percentage -->', $this -> plugin_name); ?>
40
- <span class="howto"><?php _e('opacity of the prev/next buttons by default', $this -> plugin_name); ?></span>
41
- </td>
42
- </tr>
43
- <tr>
44
- <th><label for="navhover"><?php _e('Navigation Hover Opacity', $this -> plugin_name); ?></label></th>
45
- <td>
46
- <input type="text" name="navhover" value="<?php echo $this -> get_option('navhover'); ?>" id="navhover" style="width:45px;" /> <?php _e('&#37; <!-- percentage -->', $this -> plugin_name); ?>
47
- <span class="howto"><?php _e('opacity of the prev/next buttons when they are hovered', $this -> plugin_name); ?></span>
48
  </td>
49
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  <tr>
51
  <th><label for="informationY"><?php _e('Show Information', $this -> plugin_name); ?></label></th>
52
  <td>
53
  <label><input onclick="jQuery('#information_div').show();" <?php echo ($this -> get_option('information') == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="information" value="Y" id="informationY" /> <?php _e('Yes', $this -> plugin_name); ?></label>
54
  <label><input onclick="jQuery('#information_div').hide();" <?php echo ($this -> get_option('information') == "N") ? 'checked="checked"' : ''; ?> type="radio" name="information" value="N" id="informationN" /> <?php _e('No', $this -> plugin_name); ?></label>
 
55
  </td>
56
  </tr>
57
  </tbody>
@@ -64,7 +86,7 @@
64
  <th><label for="infospeed"><?php _e('Information Speed', $this -> plugin_name); ?></label></th>
65
  <td>
66
  <input type="text" style="width:45px;" name="infospeed" value="<?php echo $this -> get_option('infospeed'); ?>" id="infospeed" />
67
- <span class="howto"><?php _e('speed at which the information will slide in', $this -> plugin_name); ?></span>
68
  </td>
69
  </tr>
70
  </tbody>
@@ -78,6 +100,7 @@
78
  <td>
79
  <label><input onclick="jQuery('#thumbnails_div').show();" <?php echo ($this -> get_option('thumbnails') == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="thumbnails" value="Y" id="thumbnailsY" /> <?php _e('Yes', $this -> plugin_name); ?></label>
80
  <label><input onclick="jQuery('#thumbnails_div').hide();" <?php echo ($this -> get_option('thumbnails') == "N") ? 'checked="checked"' : ''; ?> type="radio" name="thumbnails" value="N" id="thumbnailsN" /> <?php _e('No', $this -> plugin_name); ?></label>
 
81
  </td>
82
  </tr>
83
  </tbody>
@@ -91,34 +114,39 @@
91
  <td>
92
  <label><input <?php echo ($this -> get_option('thumbposition') == "top") ? 'checked="checked"' : ''; ?> type="radio" name="thumbposition" value="top" id="thumbpositiontop" /> <?php _e('Top', $this -> plugin_name); ?></label>
93
  <label><input <?php echo ($this -> get_option('thumbposition') == "bottom") ? 'checked="checked"' : ''; ?> type="radio" name="thumbposition" value="bottom" id="thumbpositionbottom" /> <?php _e('Bottom', $this -> plugin_name); ?></label>
 
94
  </td>
95
  </tr>
96
  <tr>
97
- <th><label for="thumbopacity"><?php _e('Thumbnail Opacity', $this -> plugin_name); ?></label></th>
98
  <td>
99
- <input style="width:45px;" type="text" name="thumbopacity" value="<?php echo $this -> get_option('thumbopacity'); ?>" id="thumbopacity" /> <?php _e('&#37; <!-- percentage -->', $this -> plugin_name); ?>
100
- <span class="howto"><?php _e('default opacity of thumbnails when they are not hovered', $this -> plugin_name); ?></span>
 
 
 
 
101
  </td>
102
  </tr>
103
  <tr>
104
- <th><label for="thumbactive"><?php _e('Thumbnail Active Border', $this -> plugin_name); ?></label></th>
105
  <td>
106
- <input style="width:65px;" type="text" name="thumbactive" value="<?php echo $this -> get_option('thumbactive'); ?>" id="thumbactive" />
107
- <span class="howto"><?php _e('border color (hexidecimal) for the active image thumbnail. default:#FFFFFF', $this -> plugin_name); ?></span>
108
  </td>
109
  </tr>
110
  <tr>
111
  <th><label for="thumbscrollspeed"><?php _e('Thumbnails Scroll Speed', $this -> plugin_name); ?></label></th>
112
  <td>
113
  <input class="widefat" style="width:45px;" name="thumbscrollspeed" value="<?php echo $this -> get_option('thumbscrollspeed'); ?>" id="thumbscrollspeed" /> <?php _e('speed', $this -> plugin_name); ?>
114
- <span class="howto"><?php _e('default:5 recommended:1-20', $this -> plugin_name); ?></span>
115
  </td>
116
  </tr>
117
  <tr>
118
  <th><label for=""><?php _e('Thumbnail Spacing', $this -> plugin_name); ?></label></th>
119
  <td>
120
  <input type="text" style="width:45px;" name="thumbspacing" value="<?php echo $this -> get_option('thumbspacing'); ?>" id="thumbspacing" /> <?php _e('px', $this -> plugin_name); ?>
121
- <span class="howto"><?php _e('horizontal margin/spacing between thumbnails', $this -> plugin_name); ?></span>
122
  </td>
123
  </tr>
124
  </tbody>
5
  <td>
6
  <label><input onclick="jQuery('#autoslide_div').show();" <?php echo ($this -> get_option('autoslide') == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="autoslide" value="Y" id="autoslideY" /> <?php _e('Yes', $this -> plugin_name); ?></label>
7
  <label><input onclick="jQuery('#autoslide_div').hide();" <?php echo ($this -> get_option('autoslide') == "N") ? 'checked="checked"' : ''; ?> type="radio" name="autoslide" value="N" id="autoslideN" /> <?php _e('No', $this -> plugin_name); ?></label>
8
+ <span class="howto"><?php _e('Should image slides automatically slide?', $this -> plugin_name); ?></span>
9
  </td>
10
  </tr>
11
  </tbody>
18
  <th><label for="autospeed"><?php _e('Auto Speed', $this -> plugin_name); ?></label></th>
19
  <td>
20
  <input type="text" style="width:45px;" name="autospeed" value="<?php echo $this -> get_option('autospeed'); ?>" id="autospeed" /> <?php _e('speed', $this -> plugin_name); ?>
21
+ <span class="howto"><?php _e('Speed for auto sliding. Lower number for shorter interval between images.', $this -> plugin_name); ?> <small><?php _e('(Default/Recommended: 10)', $this -> plugin_name); ?></small></span>
22
  </td>
23
  </tr>
24
  </tbody>
31
  <th><label for="fadespeed"><?php _e('Image Fading Speed', $this -> plugin_name); ?></label></th>
32
  <td>
33
  <input style="width:45px;" type="text" name="fadespeed" value="<?php echo $this -> get_option('fadespeed'); ?>" id="fadespeed" />
34
+ <span class="howto"><?php _e('Speed for fading of images. Lower number for quicker fading of images.', $this -> plugin_name); ?> <small><?php _e('(Default: 10, Recommended: 1-20)', $this -> plugin_name); ?><br/></small></span>
35
  </td>
36
  </tr>
37
  <tr>
38
+ <th><label for="shownav_Y"><?php _e('Show Image Navigation', $this -> plugin_name); ?></label></th>
39
  <td>
40
+ <label><input <?php echo ($this -> get_option('shownav') == "Y") ? 'checked="checked"' : ''; ?> onclick="jQuery('#shownavdiv').show();" type="radio" name="shownav" value="Y" id="shownav_Y" /> <?php _e('Yes', $this -> plugin_name); ?></label>
41
+ <label><input <?php echo ($this -> get_option('shownav') == "N") ? 'checked="checked"' : ''; ?> onclick="jQuery('#shownavdiv').hide();" type="radio" name="shownav" value="N" id="shownav_N" /> <?php _e('No', $this -> plugin_name); ?></label>
42
+ <span class="howto"><?php _e('Show next/previous buttons on the image for navigation purposes?', $this -> plugin_name); ?></span>
 
 
 
 
 
 
43
  </td>
44
  </tr>
45
+ </tbody>
46
+ </table>
47
+
48
+ <div id="shownavdiv" style="display:<?php echo ($this -> get_option('shownav') == "Y") ? 'block' : 'none'; ?>;">
49
+ <table class="form-table">
50
+ <tbody>
51
+ <tr>
52
+ <th><label for="navopacity"><?php _e('Navigation Default Opacity', $this -> plugin_name); ?></label></th>
53
+ <td>
54
+ <input type="text" name="navopacity" value="<?php echo $this -> get_option('navopacity'); ?>" id="navopacity" style="width:45px;" /> <?php _e('&#37; <!-- percentage -->', $this -> plugin_name); ?>
55
+ <span class="howto"><?php _e('Opacity of the next/previous buttons by default.', $this -> plugin_name); ?></span>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <th><label for="navhover"><?php _e('Navigation Hover Opacity', $this -> plugin_name); ?></label></th>
60
+ <td>
61
+ <input type="text" name="navhover" value="<?php echo $this -> get_option('navhover'); ?>" id="navhover" style="width:45px;" /> <?php _e('&#37; <!-- percentage -->', $this -> plugin_name); ?>
62
+ <span class="howto"><?php _e('Opacity of the next/previous buttons when they are hovered.', $this -> plugin_name); ?></span>
63
+ </td>
64
+ </tr>
65
+ </tbody>
66
+ </table>
67
+ </div>
68
+
69
+ <table class="form-table">
70
+ <tbody>
71
  <tr>
72
  <th><label for="informationY"><?php _e('Show Information', $this -> plugin_name); ?></label></th>
73
  <td>
74
  <label><input onclick="jQuery('#information_div').show();" <?php echo ($this -> get_option('information') == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="information" value="Y" id="informationY" /> <?php _e('Yes', $this -> plugin_name); ?></label>
75
  <label><input onclick="jQuery('#information_div').hide();" <?php echo ($this -> get_option('information') == "N") ? 'checked="checked"' : ''; ?> type="radio" name="information" value="N" id="informationN" /> <?php _e('No', $this -> plugin_name); ?></label>
76
+ <span class="howto"><?php _e('Should the information bar be shown on slides?', $this -> plugin_name); ?></span>
77
  </td>
78
  </tr>
79
  </tbody>
86
  <th><label for="infospeed"><?php _e('Information Speed', $this -> plugin_name); ?></label></th>
87
  <td>
88
  <input type="text" style="width:45px;" name="infospeed" value="<?php echo $this -> get_option('infospeed'); ?>" id="infospeed" />
89
+ <span class="howto"><?php _e('Speed at which the information bar will slide in and out.', $this -> plugin_name); ?></span>
90
  </td>
91
  </tr>
92
  </tbody>
100
  <td>
101
  <label><input onclick="jQuery('#thumbnails_div').show();" <?php echo ($this -> get_option('thumbnails') == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="thumbnails" value="Y" id="thumbnailsY" /> <?php _e('Yes', $this -> plugin_name); ?></label>
102
  <label><input onclick="jQuery('#thumbnails_div').hide();" <?php echo ($this -> get_option('thumbnails') == "N") ? 'checked="checked"' : ''; ?> type="radio" name="thumbnails" value="N" id="thumbnailsN" /> <?php _e('No', $this -> plugin_name); ?></label>
103
+ <span class="howto"><?php _e('Should the thumbnails bar be shown for slides?', $this -> plugin_name); ?></span>
104
  </td>
105
  </tr>
106
  </tbody>
114
  <td>
115
  <label><input <?php echo ($this -> get_option('thumbposition') == "top") ? 'checked="checked"' : ''; ?> type="radio" name="thumbposition" value="top" id="thumbpositiontop" /> <?php _e('Top', $this -> plugin_name); ?></label>
116
  <label><input <?php echo ($this -> get_option('thumbposition') == "bottom") ? 'checked="checked"' : ''; ?> type="radio" name="thumbposition" value="bottom" id="thumbpositionbottom" /> <?php _e('Bottom', $this -> plugin_name); ?></label>
117
+ <span class="howto"><?php _e('Choose your preferred position of the thumbnails bar relative to the slideshow images.', $this -> plugin_name); ?></span>
118
  </td>
119
  </tr>
120
  <tr>
121
+ <th><label for="thumbheight"><?php _e('Thumbnail Dimensions', $this -> plugin_name); ?></label></th>
122
  <td>
123
+ <input class="widefat" style="width:45px;" type="text" name="thumbwidth" value="<?php echo esc_attr(stripslashes($this -> get_option('thumbwidth'))); ?>" id="thumbwidth" />
124
+ <?php _e('x <!-- by -->', $this -> plugin_name); ?>
125
+ <input class="widefat" style="width:45px;" type="text" name="thumbheight" value="<?php echo esc_attr(stripslashes($this -> get_option('thumbheight'))); ?>" id="thumbheight" />
126
+ <?php _e('px <!-- pixels -->', $this -> plugin_name); ?>
127
+ <span class="howto"><?php _e('Width and height of the thumbnails for the slides.', $this -> plugin_name); ?><br/>
128
+ <?php _e('You may leave the width empty (not the height) to crop proportionally.', $this -> plugin_name); ?></span>
129
  </td>
130
  </tr>
131
  <tr>
132
+ <th><label for="thumbopacity"><?php _e('Thumbnail Opacity', $this -> plugin_name); ?></label></th>
133
  <td>
134
+ <input style="width:45px;" type="text" name="thumbopacity" value="<?php echo $this -> get_option('thumbopacity'); ?>" id="thumbopacity" /> <?php _e('&#37; <!-- percentage -->', $this -> plugin_name); ?>
135
+ <span class="howto"><?php _e('Default opacity of thumbnails when they are not hovered.', $this -> plugin_name); ?></span>
136
  </td>
137
  </tr>
138
  <tr>
139
  <th><label for="thumbscrollspeed"><?php _e('Thumbnails Scroll Speed', $this -> plugin_name); ?></label></th>
140
  <td>
141
  <input class="widefat" style="width:45px;" name="thumbscrollspeed" value="<?php echo $this -> get_option('thumbscrollspeed'); ?>" id="thumbscrollspeed" /> <?php _e('speed', $this -> plugin_name); ?>
142
+ <span class="howto"><?php _e('Speed at which the thumbnails will scroll.', $this -> plugin_name); ?> <small><?php _e('(Default:5, Recommended: 1-20)', $this -> plugin_name); ?></small></span>
143
  </td>
144
  </tr>
145
  <tr>
146
  <th><label for=""><?php _e('Thumbnail Spacing', $this -> plugin_name); ?></label></th>
147
  <td>
148
  <input type="text" style="width:45px;" name="thumbspacing" value="<?php echo $this -> get_option('thumbspacing'); ?>" id="thumbspacing" /> <?php _e('px', $this -> plugin_name); ?>
149
+ <span class="howto"><?php _e('Horizontal margin/spacing in pixels between thumbnail images.', $this -> plugin_name); ?></span>
150
  </td>
151
  </tr>
152
  </tbody>
views/admin/metaboxes/settings-styles.php CHANGED
@@ -7,45 +7,56 @@
7
  <td>
8
  <label><input <?php echo (empty($styles['resizeimages']) || $styles['resizeimages'] == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="styles[resizeimages]" value="Y" id="styles.resizeimages_Y" /> <?php _e('Yes', $this -> plugin_name); ?></label>
9
  <label><input <?php echo ($styles['resizeimages'] == "N") ? 'checked="checked"' : ''; ?> type="radio" name="styles[resizeimages]" value="N" id="styles.resizeimages_N" /> <?php _e('No', $this -> plugin_name); ?></label>
10
- <span class="howto"><?php _e('should images be resized proportionally to fit the width of the slideshow area', $this -> plugin_name); ?></span>
11
  </td>
12
  </tr>
13
  <tr>
14
  <th><label for="styles.width"><?php _e('Gallery Width', $this -> plugin_name); ?></label></th>
15
  <td>
16
  <input style="width:45px;" id="styles.width" type="text" name="styles[width]" value="<?php echo $styles['width']; ?>" /> <?php _e('px', $this -> plugin_name); ?>
17
- <span class="howto"><?php _e('width of the slideshow gallery', $this -> plugin_name); ?></span>
18
  </td>
19
  </tr>
20
  <tr>
21
  <th><label for="styles.height"><?php _e('Gallery Height', $this -> plugin_name); ?></label></th>
22
  <td>
23
  <input style="width:45px;" id="styles.height" type="text" name="styles[height]" value="<?php echo $styles['height']; ?>" /> <?php _e('px', $this -> plugin_name); ?>
24
- <span class="howto"><?php _e('height of the slideshow gallery', $this -> plugin_name); ?></span>
25
  </td>
26
  </tr>
27
  <tr>
28
  <th><label for="styles.border"><?php _e('Slideshow Border', $this -> plugin_name); ?></label></th>
29
  <td>
30
  <input type="text" name="styles[border]" value="<?php echo $styles['border']; ?>" id="styles.border" style="width:145px;" />
 
31
  </td>
32
  </tr>
33
  <tr>
34
  <th><label for="styles.background"><?php _e('Slideshow Background', $this -> plugin_name); ?></label></th>
35
  <td>
36
  <input type="text" name="styles[background]" value="<?php echo $styles['background']; ?>" id="styles.background" style="width:65px;" />
 
37
  </td>
38
  </tr>
39
  <tr>
40
  <th><label for="styles.infobackground"><?php _e('Information Background', $this -> plugin_name); ?></label></th>
41
  <td>
42
  <input type="text" name="styles[infobackground]" value="<?php echo $styles['infobackground']; ?>" id="styles.infobackground" style="width:65px;" />
 
43
  </td>
44
  </tr>
45
  <tr>
46
  <th><label for="styles.infocolor"><?php _e('Information Text Color', $this -> plugin_name); ?></label></th>
47
  <td>
48
  <input type="text" name="styles[infocolor]" value="<?php echo $styles['infocolor']; ?>" id="styles.infocolor" style="width:65px;" />
 
 
 
 
 
 
 
 
49
  </td>
50
  </tr>
51
  </tbody>
7
  <td>
8
  <label><input <?php echo (empty($styles['resizeimages']) || $styles['resizeimages'] == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="styles[resizeimages]" value="Y" id="styles.resizeimages_Y" /> <?php _e('Yes', $this -> plugin_name); ?></label>
9
  <label><input <?php echo ($styles['resizeimages'] == "N") ? 'checked="checked"' : ''; ?> type="radio" name="styles[resizeimages]" value="N" id="styles.resizeimages_N" /> <?php _e('No', $this -> plugin_name); ?></label>
10
+ <span class="howto"><?php _e('Should images be resized proportionally to fit the width of the slideshow area?', $this -> plugin_name); ?></span>
11
  </td>
12
  </tr>
13
  <tr>
14
  <th><label for="styles.width"><?php _e('Gallery Width', $this -> plugin_name); ?></label></th>
15
  <td>
16
  <input style="width:45px;" id="styles.width" type="text" name="styles[width]" value="<?php echo $styles['width']; ?>" /> <?php _e('px', $this -> plugin_name); ?>
17
+ <span class="howto"><?php _e('Width of the slideshow gallery', $this -> plugin_name); ?></span>
18
  </td>
19
  </tr>
20
  <tr>
21
  <th><label for="styles.height"><?php _e('Gallery Height', $this -> plugin_name); ?></label></th>
22
  <td>
23
  <input style="width:45px;" id="styles.height" type="text" name="styles[height]" value="<?php echo $styles['height']; ?>" /> <?php _e('px', $this -> plugin_name); ?>
24
+ <span class="howto"><?php _e('Height of the slideshow gallery', $this -> plugin_name); ?></span>
25
  </td>
26
  </tr>
27
  <tr>
28
  <th><label for="styles.border"><?php _e('Slideshow Border', $this -> plugin_name); ?></label></th>
29
  <td>
30
  <input type="text" name="styles[border]" value="<?php echo $styles['border']; ?>" id="styles.border" style="width:145px;" />
31
+ <span class="howto"><?php echo sprintf(__('Border style/color for the entire slideshow wrapper eg. %s', $this -> plugin_name), "1px #000000 solid"); ?>
32
  </td>
33
  </tr>
34
  <tr>
35
  <th><label for="styles.background"><?php _e('Slideshow Background', $this -> plugin_name); ?></label></th>
36
  <td>
37
  <input type="text" name="styles[background]" value="<?php echo $styles['background']; ?>" id="styles.background" style="width:65px;" />
38
+ <span class="howto"><?php echo sprintf(__('Background color (hexidecimal) of the entire slideshow wrapper eg. %s', $this -> plugin_name), "#FFFFFF"); ?></span>
39
  </td>
40
  </tr>
41
  <tr>
42
  <th><label for="styles.infobackground"><?php _e('Information Background', $this -> plugin_name); ?></label></th>
43
  <td>
44
  <input type="text" name="styles[infobackground]" value="<?php echo $styles['infobackground']; ?>" id="styles.infobackground" style="width:65px;" />
45
+ <span class="howto"><?php echo sprintf(__('Background color (hexidecimal) of the information bar eg. %s', $this -> plugin_name), "#000000"); ?></span>
46
  </td>
47
  </tr>
48
  <tr>
49
  <th><label for="styles.infocolor"><?php _e('Information Text Color', $this -> plugin_name); ?></label></th>
50
  <td>
51
  <input type="text" name="styles[infocolor]" value="<?php echo $styles['infocolor']; ?>" id="styles.infocolor" style="width:65px;" />
52
+ <span class="howto"><?php echo sprintf(__('Text color (hexidecimal) of the information bar content eg. %s', $this -> plugin_name), "#FFFFFF"); ?></span>
53
+ </td>
54
+ </tr>
55
+ <tr>
56
+ <th><label for="thumbactive"><?php _e('Thumbnail Active Border', $this -> plugin_name); ?></label></th>
57
+ <td>
58
+ <input style="width:65px;" type="text" name="thumbactive" value="<?php echo $this -> get_option('thumbactive'); ?>" id="thumbactive" />
59
+ <span class="howto"><?php echo sprintf(__('Border color (hexidecimal) for the active image thumbnail eg. %s', $this -> plugin_name), "#FFFFFF"); ?></span>
60
  </td>
61
  </tr>
62
  </tbody>
views/admin/settings.php CHANGED
@@ -9,17 +9,21 @@ wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
9
  ?>
10
 
11
  <div class="wrap">
 
 
 
 
12
  <h2><?php _e('Configuration Settings', $this -> plugin_name); ?></h2>
13
 
14
  <form action="<?php echo $this -> url; ?>" name="post" id="post" method="post">
15
  <div id="poststuff" class="metabox-holder has-right-sidebar">
16
  <div id="side-info-column" class="inner-sidebar">
17
  <?php do_action('submitpage_box'); ?>
18
- <?php do_meta_boxes($this -> menus['gallery-settings'], 'side', $post); ?>
19
  </div>
20
  <div id="post-body">
21
  <div id="post-body-content">
22
- <?php do_meta_boxes($this -> menus['gallery-settings'], 'normal', $post); ?>
23
  </div>
24
  </div>
25
  <br class="clear" />
9
  ?>
10
 
11
  <div class="wrap">
12
+ <div class="icon32">
13
+ <img src="<?php echo $this -> url(); ?>/images/icon-settings-32.png" />
14
+ </div>
15
+
16
  <h2><?php _e('Configuration Settings', $this -> plugin_name); ?></h2>
17
 
18
  <form action="<?php echo $this -> url; ?>" name="post" id="post" method="post">
19
  <div id="poststuff" class="metabox-holder has-right-sidebar">
20
  <div id="side-info-column" class="inner-sidebar">
21
  <?php do_action('submitpage_box'); ?>
22
+ <?php do_meta_boxes($this -> menus['slideshow-settings'], 'side', $post); ?>
23
  </div>
24
  <div id="post-body">
25
  <div id="post-body-content">
26
+ <?php do_meta_boxes($this -> menus['slideshow-settings'], 'normal', $post); ?>
27
  </div>
28
  </div>
29
  <br class="clear" />
views/admin/slides/_notes/dwsync.xml DELETED
@@ -1,5 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <dwsync>
3
- <file name="index.php" server="wpplugins.biz/public_html/" local="129344373824614038" remote="129344373600000000" />
4
- <file name="save.php" server="wpplugins.biz/public_html/" local="129344368235714371" remote="129344368200000000" />
5
- </dwsync>
 
 
 
 
 
views/admin/slides/index.php CHANGED
@@ -1,4 +1,8 @@
1
- <div class="wrap">
 
 
 
 
2
  <h2><?php _e('Manage Slides', $this -> plugin_name); ?> <?php echo $this -> Html -> link(__('Add New'), $this -> url . '&amp;method=save', array('class' => "button add-new-h2")); ?></h2>
3
 
4
  <?php if (!empty($slides)) : ?>
@@ -9,77 +13,5 @@
9
  </form>
10
  <?php endif; ?>
11
 
12
- <?php if (!empty($slides)) : ?>
13
- <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected slides?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
14
- <div class="tablenav">
15
- <div class="alignleft actions">
16
- <a href="<?php echo $this -> url; ?>&amp;method=order" title="<?php _e('Order all your slides', $this -> plugin_name); ?>" class="button"><?php _e('Order Slides', $this -> plugin_name); ?></a>
17
-
18
- <select name="action" class="action">
19
- <option value="">- <?php _e('Bulk Actions', $this -> plugin_name); ?> -</option>
20
- <option value="delete"><?php _e('Delete', $this -> plugin_name); ?></option>
21
- </select>
22
- <input type="submit" class="button" value="<?php _e('Apply', $this -> plugin_name); ?>" name="execute" />
23
- </div>
24
- <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
25
- </div>
26
-
27
- <table class="widefat">
28
- <thead>
29
- <tr>
30
- <th class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></th>
31
- <th><?php _e('Image', $this -> plugin_name); ?></th>
32
- <th><?php _e('Title', $this -> plugin_name); ?></th>
33
- <th><?php _e('Link', $this -> plugin_name); ?></th>
34
- <th><?php _e('Date', $this -> plugin_name); ?></th>
35
- <th><?php _e('Order', $this -> plugin_name); ?></th>
36
- </tr>
37
- </thead>
38
- <tfoot>
39
- <tr>
40
- <th class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></th>
41
- <th><?php _e('Image', $this -> plugin_name); ?></th>
42
- <th><?php _e('Title', $this -> plugin_name); ?></th>
43
- <th><?php _e('Link', $this -> plugin_name); ?></th>
44
- <th><?php _e('Date', $this -> plugin_name); ?></th>
45
- <th><?php _e('Order', $this -> plugin_name); ?></th>
46
- </tr>
47
- </tfoot>
48
- <tbody>
49
- <?php foreach ($slides as $slide) : ?>
50
- <tr class="<?php echo $class = (empty($class)) ? 'alternate' : ''; ?>">
51
- <th class="check-column"><input type="checkbox" name="Slide[checklist][]" value="<?php echo $slide -> id; ?>" id="checklist<?php echo $slide -> id; ?>" /></th>
52
- <td style="width:75px;">
53
- <?php $image = $slide -> image; ?>
54
- <a href="<?php echo $this -> Html -> image_url($image); ?>" title="<?php echo $slide -> title; ?>" class="thickbox"><img src="<?php echo $this -> Html -> image_url($this -> Html -> thumbname($image, "small")); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" /></a>
55
- </td>
56
- <td>
57
- <a class="row-title" href="<?php echo $this -> url; ?>&amp;method=save&amp;id=<?php echo $slide -> id; ?>" title=""><?php echo $slide -> title; ?></a>
58
- <div class="row-actions">
59
- <span class="edit"><?php echo $this -> Html -> link(__('Edit', $this -> plugin_name), "?page=" . $this -> sections -> gallery . "&amp;method=save&amp;id=" . $slide -> id); ?> |</span>
60
- <span class="delete"><?php echo $this -> Html -> link(__('Delete', $this -> plugin_name), "?page=" . $this -> sections -> gallery . "&amp;method=delete&amp;id=" . $slide -> id, array('class' => "submitdelete", 'onclick' => "if (!confirm('" . __('Are you sure you want to permanently remove this slide?', $this -> plugin_name) . "')) { return false; }")); ?></span>
61
- </div>
62
- </td>
63
- <td>
64
- <?php if (!empty($slide -> uselink) && $slide -> uselink == "Y") : ?>
65
- <span style="color:green;"><?php _e('Yes', $this -> plugin_name); ?></span>
66
- <?php else : ?>
67
- <span style="color:red;"><?php _e('No', $this -> plugin_name); ?></span>
68
- <?php endif; ?>
69
- </td>
70
- <td><abbr title="<?php echo $slide -> modified; ?>"><?php echo date("Y-m-d", strtotime($slide -> modified)); ?></abbr></td>
71
- <td><?php echo ((int) $slide -> order + 1); ?></td>
72
- </tr>
73
- <?php endforeach; ?>
74
- </tbody>
75
- </table>
76
-
77
- <div class="tablenav">
78
-
79
- <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
80
- </div>
81
- </form>
82
- <?php else : ?>
83
- <p style="color:red;"><?php _e('No slides found', $this -> plugin_name); ?></p>
84
- <?php endif; ?>
85
  </div>
1
+ <div class="wrap <?php echo $this -> pre; ?>">
2
+ <div class="icon32">
3
+ <img src="<?php echo $this -> url(); ?>/images/icon-32.png" />
4
+ </div>
5
+
6
  <h2><?php _e('Manage Slides', $this -> plugin_name); ?> <?php echo $this -> Html -> link(__('Add New'), $this -> url . '&amp;method=save', array('class' => "button add-new-h2")); ?></h2>
7
 
8
  <?php if (!empty($slides)) : ?>
13
  </form>
14
  <?php endif; ?>
15
 
16
+ <?php $this -> render('slides' . DS . 'loop', array('slides' => $slides), true, 'admin'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  </div>
views/admin/slides/loop.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (!empty($slides)) : ?>
2
+ <form onsubmit="if (!confirm('<?php _e('Are you sure you wish to execute this action on the selected slides?', $this -> plugin_name); ?>')) { return false; }" action="<?php echo $this -> url; ?>&amp;method=mass" method="post">
3
+ <div class="tablenav">
4
+ <div class="alignleft actions">
5
+ <a href="<?php echo $this -> url; ?>&amp;method=order" title="<?php _e('Order all your slides', $this -> plugin_name); ?>" class="button"><?php _e('Order Slides', $this -> plugin_name); ?></a>
6
+
7
+ <select name="action" class="action">
8
+ <option value=""><?php _e('- Bulk Actions -', $this -> plugin_name); ?></option>
9
+ <option value="delete"><?php _e('Delete', $this -> plugin_name); ?></option>
10
+ </select>
11
+ <input type="submit" class="button" value="<?php _e('Apply', $this -> plugin_name); ?>" name="execute" />
12
+ </div>
13
+ <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
14
+ </div>
15
+
16
+ <table class="widefat">
17
+ <thead>
18
+ <tr>
19
+ <th class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></th>
20
+ <th><?php _e('ID', $this -> plugin_name); ?></th>
21
+ <th><?php _e('Image', $this -> plugin_name); ?></th>
22
+ <th><?php _e('Title', $this -> plugin_name); ?></th>
23
+ <th><?php _e('Galleries', $this -> plugin_name); ?></th>
24
+ <th><?php _e('Link', $this -> plugin_name); ?></th>
25
+ <th><?php _e('Date', $this -> plugin_name); ?></th>
26
+ <th><?php _e('Order', $this -> plugin_name); ?></th>
27
+ </tr>
28
+ </thead>
29
+ <tfoot>
30
+ <tr>
31
+ <th class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></th>
32
+ <th><?php _e('ID', $this -> plugin_name); ?></th>
33
+ <th><?php _e('Image', $this -> plugin_name); ?></th>
34
+ <th><?php _e('Title', $this -> plugin_name); ?></th>
35
+ <th><?php _e('Galleries', $this -> plugin_name); ?></th>
36
+ <th><?php _e('Link', $this -> plugin_name); ?></th>
37
+ <th><?php _e('Date', $this -> plugin_name); ?></th>
38
+ <th><?php _e('Order', $this -> plugin_name); ?></th>
39
+ </tr>
40
+ </tfoot>
41
+ <tbody>
42
+ <?php foreach ($slides as $slide) : ?>
43
+ <tr class="<?php echo $class = (empty($class)) ? 'alternate' : ''; ?>">
44
+ <th class="check-column"><input type="checkbox" name="Slide[checklist][]" value="<?php echo $slide -> id; ?>" id="checklist<?php echo $slide -> id; ?>" /></th>
45
+ <td><?php echo $slide -> id; ?></td>
46
+ <td style="width:75px;">
47
+ <?php $image = $slide -> image; ?>
48
+ <a href="<?php echo $this -> Html -> image_url($image); ?>" title="<?php echo $slide -> title; ?>" class="colorbox" rel="slides"><img class="slideshow" src="<?php echo $this -> Html -> timthumb_image_src($slide -> image_path, 60, 60, 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" /></a>
49
+ </td>
50
+ <td>
51
+ <a class="row-title" href="<?php echo $this -> url; ?>&amp;method=save&amp;id=<?php echo $slide -> id; ?>" title=""><?php echo $slide -> title; ?></a>
52
+ <div class="row-actions">
53
+ <span class="edit"><?php echo $this -> Html -> link(__('Edit', $this -> plugin_name), "?page=" . $this -> sections -> slides . "&amp;method=save&amp;id=" . $slide -> id); ?> |</span>
54
+ <span class="delete"><?php echo $this -> Html -> link(__('Delete', $this -> plugin_name), "?page=" . $this -> sections -> slides . "&amp;method=delete&amp;id=" . $slide -> id, array('class' => "submitdelete", 'onclick' => "if (!confirm('" . __('Are you sure you want to permanently remove this slide?', $this -> plugin_name) . "')) { return false; }")); ?></span>
55
+ </div>
56
+ </td>
57
+ <td>
58
+ <?php if (!empty($slide -> gallery)) : ?>
59
+ <?php $g = 1; ?>
60
+ <?php foreach ($slide -> gallery as $gallery) : ?>
61
+ <a href="?page=<?php echo $this -> sections -> galleries; ?>&amp;method=view&amp;id=<?php echo $gallery -> id; ?>" title="<?php echo esc_attr($gallery -> title); ?>"><?php echo $gallery -> title; ?></a>
62
+ <?php if ($g < count($slide -> gallery)) : ?>, <?php endif; ?>
63
+ <?php $g++; ?>
64
+ <?php endforeach; ?>
65
+ <?php else : ?>
66
+ <?php _e('None', $this -> plugin_name); ?>
67
+ <?php endif; ?>
68
+ </td>
69
+ <td>
70
+ <?php if (!empty($slide -> uselink) && $slide -> uselink == "Y") : ?>
71
+ <span style="color:green;"><?php _e('Yes', $this -> plugin_name); ?></span>
72
+ <small>(<a href="<?php echo $slide -> link; ?>" title="" target="_blank"><?php _e('Open', $this -> plugin_name); ?></a>)</small>
73
+ <?php else : ?>
74
+ <span style="color:red;"><?php _e('No', $this -> plugin_name); ?></span>
75
+ <?php endif; ?>
76
+ </td>
77
+ <td><abbr title="<?php echo $slide -> modified; ?>"><?php echo date("Y-m-d", strtotime($slide -> modified)); ?></abbr></td>
78
+ <td><?php echo ((int) $slide -> order + 1); ?></td>
79
+ </tr>
80
+ <?php endforeach; ?>
81
+ </tbody>
82
+ </table>
83
+
84
+ <div class="tablenav">
85
+
86
+ <?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
87
+ </div>
88
+ </form>
89
+ <?php else : ?>
90
+ <p style="color:red;"><?php _e('No slides found', $this -> plugin_name); ?></p>
91
+ <?php endif; ?>
views/admin/slides/order.php CHANGED
@@ -1,4 +1,8 @@
1
  <div class="wrap">
 
 
 
 
2
  <h2><?php _e('Order Slides', $this -> plugin_name); ?></h2>
3
 
4
  <div style="float:none;" class="subsubsub">
@@ -9,14 +13,14 @@
9
  <ul id="slidelist">
10
  <?php foreach ($slides as $slide) : ?>
11
  <li class="lineitem" id="item_<?php echo $slide -> id; ?>">
12
- <span style="float:left; margin:5px 10px 0 5px;"><img src="<?php echo $this -> Html -> image_url($this -> Html -> thumbname($slide -> image, "small")); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" /></span>
13
  <h4><?php echo $slide -> title; ?></h4>
14
  <hr class="clear" style="clear:both; visibility:hidden; height:1px; display:block;" />
15
  </li>
16
  <?php endforeach; ?>
17
  </ul>
18
 
19
- <div id="slidemessage"></div>
20
 
21
  <script type="text/javascript">
22
  jQuery(document).ready(function() {
1
  <div class="wrap">
2
+ <div class="icon32">
3
+ <img src="<?php echo $this -> url(); ?>/images/icon-32.png" />
4
+ </div>
5
+
6
  <h2><?php _e('Order Slides', $this -> plugin_name); ?></h2>
7
 
8
  <div style="float:none;" class="subsubsub">
13
  <ul id="slidelist">
14
  <?php foreach ($slides as $slide) : ?>
15
  <li class="lineitem" id="item_<?php echo $slide -> id; ?>">
16
+ <span style="float:left; margin:5px 10px 0 5px;"><img src="<?php echo $this -> Html -> timthumb_image_src($slide -> image_path, 60, 60, 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" /></span>
17
  <h4><?php echo $slide -> title; ?></h4>
18
  <hr class="clear" style="clear:both; visibility:hidden; height:1px; display:block;" />
19
  </li>
20
  <?php endforeach; ?>
21
  </ul>
22
 
23
+ <div id="slidemessage"><!-- message will go here --></div>
24
 
25
  <script type="text/javascript">
26
  jQuery(document).ready(function() {
views/admin/slides/save.php CHANGED
@@ -1,4 +1,8 @@
1
- <div class="wrap">
 
 
 
 
2
  <h2><?php _e('Save a Slide', $this -> plugin_name); ?></h2>
3
 
4
  <form action="<?php echo $this -> url; ?>&amp;method=save" method="post" enctype="multipart/form-data">
@@ -23,6 +27,20 @@
23
  <?php echo (!empty($this -> Slide -> errors['description'])) ? '<div style="color:red;">' . $this -> Slide -> errors['description'] . '</div>' : ''; ?>
24
  </td>
25
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  <tr>
27
  <th><label for="Slide.type.file"><?php _e('Image Type', $this -> plugin_name); ?></label></th>
28
  <td>
@@ -48,15 +66,12 @@
48
  <?php
49
 
50
  if (!empty($this -> Slide -> data -> type) && $this -> Slide -> data -> type == "file") {
51
- if (!empty($this -> Slide -> data -> image)) {
52
- $name = $this -> Html -> strip_ext($this -> Slide -> data -> image, 'filename');
53
- $ext = $this -> Html -> strip_ext($this -> Slide -> data -> image, 'ext');
54
-
55
  ?>
56
 
57
  <input type="hidden" name="Slide[image_oldfile]" value="<?php echo esc_attr(stripslashes($this -> Slide -> data -> image)); ?>" />
58
  <p><small><?php _e('Current image. Leave the field above blank to keep this image.', $this -> plugin_name); ?></small></p>
59
- <img src="<?php echo rtrim(get_bloginfo('wpurl'), '/'); ?>/wp-content/uploads/<?php echo $this -> plugin_name; ?>/<?php echo $name; ?>-thumb.<?php echo $ext; ?>" alt="" />
60
 
61
  <?php
62
  }
@@ -87,7 +102,7 @@
87
  <table class="form-table">
88
  <tbody>
89
  <tr>
90
- <th><label for="Slide_userlink_N"><?php _e('Use Link', $this -> plugin_name); ?></label></th>
91
  <td>
92
  <label><input onclick="jQuery('#Slide_uselink_div').show();" <?php echo ($this -> Slide -> data -> uselink == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="Slide[uselink]" value="Y" id="Slide_uselink_Y" /> <?php _e('Yes', $this -> plugin_name); ?></label>
93
  <label><input onclick="jQuery('#Slide_uselink_div').hide();" <?php echo (empty($this -> Slide -> data -> uselink) || $this -> Slide -> data -> uselink == "N") ? 'checked="checked"' : ''; ?> type="radio" name="Slide[uselink]" value="N" id="Slide_uselink_N" /> <?php _e('No', $this -> plugin_name); ?></label>
@@ -107,6 +122,14 @@
107
  <span class="howto"><?php _e('link/URL to go to when a user clicks the slide eg. http://www.domain.com/mypage/', $this -> plugin_name); ?></span>
108
  </td>
109
  </tr>
 
 
 
 
 
 
 
 
110
  </tbody>
111
  </table>
112
  </div>
1
+ <div class="wrap <?php echo $this -> pre; ?>">
2
+ <div class="icon32">
3
+ <img src="<?php echo $this -> url(); ?>/images/icon-32.png" />
4
+ </div>
5
+
6
  <h2><?php _e('Save a Slide', $this -> plugin_name); ?></h2>
7
 
8
  <form action="<?php echo $this -> url; ?>&amp;method=save" method="post" enctype="multipart/form-data">
27
  <?php echo (!empty($this -> Slide -> errors['description'])) ? '<div style="color:red;">' . $this -> Slide -> errors['description'] . '</div>' : ''; ?>
28
  </td>
29
  </tr>
30
+ <tr>
31
+ <th><label for=""><?php _e('Galleries', $this -> plugin_name); ?></label></th>
32
+ <td>
33
+ <?php if ($galleries = $this -> Gallery -> select()) : ?>
34
+ <label style="font-weight:bold"><input onclick="jqCheckAll(this,'','Slide[galleries]');" type="checkbox" name="checkboxall" value="checkboxall" id="checkboxall" /> <?php _e('Select All', $this -> plugin_name); ?></label><br/>
35
+ <?php foreach ($galleries as $gallery_id => $gallery_title) : ?>
36
+ <label><input <?php echo (!empty($this -> Slide -> data -> galleries) && in_array($gallery_id, $this -> Slide -> data -> galleries)) ? 'checked="checked"' : ''; ?> type="checkbox" name="Slide[galleries][]" value="<?php echo $gallery_id; ?>" id="Slide_galleries_<?php echo $gallery_id; ?>" /> <?php echo $gallery_title; ?></label><br/>
37
+ <?php endforeach; ?>
38
+ <?php else : ?>
39
+ <span class="error"><?php _e('No galleries are available.', $this -> plugin_name); ?></span>
40
+ <?php endif; ?>
41
+ <span class="howto"><?php _e('Assign this slide to one or more galleries.', $this -> plugin_name); ?></span>
42
+ </td>
43
+ </tr>
44
  <tr>
45
  <th><label for="Slide.type.file"><?php _e('Image Type', $this -> plugin_name); ?></label></th>
46
  <td>
66
  <?php
67
 
68
  if (!empty($this -> Slide -> data -> type) && $this -> Slide -> data -> type == "file") {
69
+ if (!empty($this -> Slide -> data -> image)) {
 
 
 
70
  ?>
71
 
72
  <input type="hidden" name="Slide[image_oldfile]" value="<?php echo esc_attr(stripslashes($this -> Slide -> data -> image)); ?>" />
73
  <p><small><?php _e('Current image. Leave the field above blank to keep this image.', $this -> plugin_name); ?></small></p>
74
+ <a title="<?php echo esc_attr($this -> Slide -> data -> title); ?>" class="colorbox" href="<?php echo $this -> Html -> image_url($this -> Slide -> data -> image); ?>"><img src="<?php echo $this -> Html -> timthumb_image_src($this -> Slide -> data -> image_path, 100, 100, 100); ?>" alt="" class="slideshow" /></a>
75
 
76
  <?php
77
  }
102
  <table class="form-table">
103
  <tbody>
104
  <tr>
105
+ <th><label for="Slide_uselink_N"><?php _e('Use Link', $this -> plugin_name); ?></label></th>
106
  <td>
107
  <label><input onclick="jQuery('#Slide_uselink_div').show();" <?php echo ($this -> Slide -> data -> uselink == "Y") ? 'checked="checked"' : ''; ?> type="radio" name="Slide[uselink]" value="Y" id="Slide_uselink_Y" /> <?php _e('Yes', $this -> plugin_name); ?></label>
108
  <label><input onclick="jQuery('#Slide_uselink_div').hide();" <?php echo (empty($this -> Slide -> data -> uselink) || $this -> Slide -> data -> uselink == "N") ? 'checked="checked"' : ''; ?> type="radio" name="Slide[uselink]" value="N" id="Slide_uselink_N" /> <?php _e('No', $this -> plugin_name); ?></label>
122
  <span class="howto"><?php _e('link/URL to go to when a user clicks the slide eg. http://www.domain.com/mypage/', $this -> plugin_name); ?></span>
123
  </td>
124
  </tr>
125
+ <tr>
126
+ <th><label for="Slide_linktarget_self"><?php _e('Link Target', $this -> plugin_name); ?></label></th>
127
+ <td>
128
+ <label><input <?php echo (empty($this -> Slide -> data -> linktarget) || (!empty($this -> Slide -> data -> linktarget) && $this -> Slide -> data -> linktarget == "self")) ? 'checked="checked"' : ''; ?> type="radio" name="Slide[linktarget]" value="self" id="Slide_linktarget_self" /> <?php _e('Current Window', $this -> plugin_name); ?></label>
129
+ <label><input <?php echo (!empty($this -> Slide -> data -> linktarget) && $this -> Slide -> data -> linktarget == "blank") ? 'checked="checked"' : ''; ?> type="radio" name="Slide[linktarget]" value="blank" id="Slide_linktarget_blank" /> <?php _e('New/Blank Window', $this -> plugin_name); ?></label>
130
+ <span class="howto"><?php _e('Should this link open in the current window or a new window?', $this -> plugin_name); ?></span>
131
+ </td>
132
+ </tr>
133
  </tbody>
134
  </table>
135
  </div>
views/default/_notes/dwsync.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <dwsync>
3
- <file name="gallery.php" server="wpplugins.biz/public_html/" local="129345027855145992" remote="129345027600000000" />
4
- </dwsync>
 
 
 
 
views/default/gallery.php CHANGED
@@ -1,18 +1,30 @@
 
 
 
 
 
 
 
1
  <?php if (!empty($slides)) : ?>
2
- <ul id="slideshow" style="display:none;">
3
  <?php if ($frompost) : ?>
4
  <?php foreach ($slides as $slide) : ?>
5
  <li>
6
  <h3><?php echo $slide -> post_title; ?></h3>
7
  <?php $full_image_href = wp_get_attachment_image_src($slide -> ID, 'full', false); ?>
8
- <span><?php echo $full_image_href[0]; ?></span>
 
 
 
 
 
9
  <p><?php echo $slide -> post_content; ?></p>
10
  <?php $thumbnail_link = wp_get_attachment_image_src($slide -> ID, 'thumbnail', false); ?>
11
- <?php if ($this -> get_option('thumbnails') == "Y") : ?>
12
  <?php if (!empty($slide -> guid)) : ?>
13
- <a href="<?php echo $slide -> guid; ?>" title="<?php echo $slide -> post_title; ?>"><img style="height:75px;" src="<?php echo $thumbnail_link[0]; ?>" alt="<?php echo $this -> Html -> sanitize($slide -> post_title); ?>" /></a>
14
  <?php else : ?>
15
- <img style="height:75px;" src="<?php echo $thumbnail_link[0]; ?>" alt="<?php echo $this -> Html -> sanitize($slide -> post_title); ?>" />
16
  <?php endif; ?>
17
  <?php else : ?>
18
  <a href="<?php echo $slide -> guid; ?>" title="<?php echo $slide -> post_title; ?>"></a>
@@ -23,13 +35,17 @@
23
  <?php foreach ($slides as $slide) : ?>
24
  <li>
25
  <h3><?php echo $slide -> title; ?></h3>
26
- <span><?php echo rtrim(get_bloginfo('wpurl'), '/'); ?>/wp-content/uploads/<?php echo $this -> plugin_name; ?>/<?php echo $slide -> image; ?></span>
 
 
 
 
27
  <p><?php echo $slide -> description; ?></p>
28
- <?php if ($this -> get_option('thumbnails') == "Y") : ?>
29
  <?php if ($slide -> uselink == "Y" && !empty($slide -> link)) : ?>
30
- <a href="<?php echo $slide -> link; ?>" title="<?php echo $slide -> title; ?>"><img style="height:75px;" src="<?php echo $this -> Html -> image_url($this -> Html -> thumbname($slide -> image)); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" /></a>
31
  <?php else : ?>
32
- <img style="height:75px;" src="<?php echo $this -> Html -> image_url($this -> Html -> thumbname($slide -> image)); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" />
33
  <?php endif; ?>
34
  <?php else : ?>
35
  <a href="<?php echo $slide -> link; ?>" title="<?php echo $slide -> title; ?>"></a>
@@ -39,38 +55,45 @@
39
  <?php endif; ?>
40
  </ul>
41
 
42
- <div id="slideshow-wrapper">
43
- <?php if ($this -> get_option('thumbnails') == "Y" && $this -> get_option('thumbposition') == "top") : ?>
44
- <div id="thumbnails" class="thumbstop">
45
- <div id="slideleft" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
46
- <div id="slidearea">
47
- <div id="slider"></div>
48
  </div>
49
- <div id="slideright" title="<?php _e('Slide Right', $this -> plugin_name); ?>"></div>
50
  <br style="clear:both; visibility:hidden; height:1px;" />
51
  </div>
52
  <?php endif; ?>
53
 
54
- <div id="fullsize">
55
- <div id="imgprev" class="imgnav" title="Previous Image"></div>
56
- <div id="imglink"><!-- link --></div>
57
- <div id="imgnext" class="imgnav" title="Next Image"></div>
58
- <div id="image"></div>
59
- <?php if ($this -> get_option('information') == "Y") : ?>
60
- <div id="information">
 
 
 
 
 
 
 
61
  <h3></h3>
62
  <p></p>
63
  </div>
64
  <?php endif; ?>
65
  </div>
66
 
67
- <?php if ($this -> get_option('thumbnails') == "Y" && $this -> get_option('thumbposition') == "bottom") : ?>
68
- <div id="thumbnails" class="thumbsbot">
69
- <div id="slideleft" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
70
- <div id="slidearea">
71
- <div id="slider"></div>
72
  </div>
73
- <div id="slideright" title="<?php _e('Slide Right', $this -> plugin_name); ?>"></div>
74
  <br style="clear:both; visibility:hidden; height:1px;" />
75
  </div>
76
  <?php endif; ?>
@@ -79,47 +102,59 @@
79
  <script type="text/javascript">
80
  jQuery.noConflict();
81
  tid('slideshow').style.display = "none";
82
- tid('slideshow-wrapper').style.display = 'block';
83
- tid('slideshow-wrapper').style.visibility = 'hidden';
84
-
85
-
86
- /**
87
- * issue #2: Bugfix for WebKit. Safari and similar browsers aren't capable to handle jQuery.ready() right. The problem
88
- * here was, that sometimes the event was fired (if js is not available in browsers cache) too early, so that not all
89
- * pictures were displayed in the thumbnail bar. I added a timeout to give the browser time to load the pictures.
90
- * During that time I found it nice to display a spinner icon to give the visitor a hint that "somethings going on there".
91
- * For this to display correctly I've added some lines to the css file too.
92
- */
93
-
94
  // append the spinner
95
- jQuery("#fullsize").append('<div id="spinner"><img src="<?php echo $this -> url(); ?>/images/spinner.gif"></div>');
96
- tid('spinner').style.visibility = 'visible';
97
 
98
  var slideshow = new TINY.slideshow("slideshow");
99
  jQuery(document).ready(function() {
100
- // set a timeout before launching the slideshow
101
- window.setTimeout(function() {
102
- <?php if ($this -> get_option('autoslide')) : ?>slideshow.auto = true;<?php else : ?>slideshow.auto = false;<?php endif; ?>
103
- slideshow.speed = <?php echo $this -> get_option('autospeed'); ?>;
104
- slideshow.imgSpeed = <?php echo $this -> get_option('fadespeed'); ?>;
105
- slideshow.navOpacity = <?php echo $this -> get_option('navopacity'); ?>;
106
- slideshow.navHover = <?php echo $this -> get_option('navhover'); ?>;
107
  slideshow.letterbox = "#000000";
108
  slideshow.linkclass = "linkhover";
109
- slideshow.info = "<?php echo ($this -> get_option('information') == "Y") ? 'information' : ''; ?>";
110
- slideshow.infoSpeed = <?php echo $this -> get_option('infospeed'); ?>;
111
- slideshow.thumbs = "<?php echo ($this -> get_option('thumbnails') == "Y") ? 'slider' : ''; ?>";
112
  slideshow.thumbOpacity = <?php echo $this -> get_option('thumbopacity'); ?>;
113
- slideshow.left = "slideleft";
114
- slideshow.right = "slideright";
115
- slideshow.scrollSpeed = <?php echo $this -> get_option('thumbscrollspeed'); ?>;
116
- slideshow.spacing = <?php echo $this -> get_option('thumbspacing'); ?>;
117
- slideshow.active = "<?php echo $this -> get_option('thumbactive'); ?>";
118
  slideshow.imagesthickbox = "<?php echo ($this -> get_option('imagesthickbox') == "Y") ? 'true' : 'false'; ?>";
119
- jQuery("#spinner").remove();
120
- slideshow.init("slideshow","image","imgprev","imgnext","imglink");
121
- tid('slideshow-wrapper').style.visibility = 'visible';
122
- }, 1000);
123
  });
124
  </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  <?php endif; ?>
1
+ <?php
2
+
3
+ $rand = 's' . rand(1,99) . 'w';
4
+ $wrapperid = "slideshow-wrapper-" . $rand;
5
+
6
+ ?>
7
+
8
  <?php if (!empty($slides)) : ?>
9
+ <ul id="slideshow" class="slideshow" style="display:none;">
10
  <?php if ($frompost) : ?>
11
  <?php foreach ($slides as $slide) : ?>
12
  <li>
13
  <h3><?php echo $slide -> post_title; ?></h3>
14
  <?php $full_image_href = wp_get_attachment_image_src($slide -> ID, 'full', false); ?>
15
+ <?php $full_image_path = get_attached_file($slide -> ID); ?>
16
+ <?php if ($options['resizeimages'] == "true" && $options['width'] != "auto") : ?>
17
+ <span><?php echo $this -> Html -> timthumb_image_src($full_image_path, $options['width'], $options['height'], 100); ?></span>
18
+ <?php else : ?>
19
+ <span><?php echo $full_image_href[0]; ?></span>
20
+ <?php endif; ?>
21
  <p><?php echo $slide -> post_content; ?></p>
22
  <?php $thumbnail_link = wp_get_attachment_image_src($slide -> ID, 'thumbnail', false); ?>
23
+ <?php if ($options['showthumbs'] == "true") : ?>
24
  <?php if (!empty($slide -> guid)) : ?>
25
+ <a href="<?php echo $slide -> guid; ?>" target="_self" title="<?php echo esc_attr($slide -> post_title); ?>"><img src="<?php echo $this -> Html -> timthumb_image_src($full_image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> post_title); ?>" /></a>
26
  <?php else : ?>
27
+ <img src="<?php echo $this -> Html -> timthumb_image_src($full_image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> post_title); ?>" />
28
  <?php endif; ?>
29
  <?php else : ?>
30
  <a href="<?php echo $slide -> guid; ?>" title="<?php echo $slide -> post_title; ?>"></a>
35
  <?php foreach ($slides as $slide) : ?>
36
  <li>
37
  <h3><?php echo $slide -> title; ?></h3>
38
+ <?php if ($options['resizeimages'] == "true" && $options['width'] != "auto") : ?>
39
+ <span><?php echo $this -> Html -> timthumb_image_src($slide -> image_path, $options['width'], $options['height'], 100); ?></span>
40
+ <?php else : ?>
41
+ <span><?php echo $this -> Html -> image_url($slide -> image); ?></span>
42
+ <?php endif; ?>
43
  <p><?php echo $slide -> description; ?></p>
44
+ <?php if ($options['showthumbs'] == "true") : ?>
45
  <?php if ($slide -> uselink == "Y" && !empty($slide -> link)) : ?>
46
+ <a href="<?php echo $slide -> link; ?>" title="<?php echo esc_attr($slide -> title); ?>" target="_<?php echo $slide -> linktarget; ?>"><img src="<?php echo $this -> Html -> timthumb_image_src($slide -> image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" /></a>
47
  <?php else : ?>
48
+ <img src="<?php echo $this -> Html -> timthumb_image_src($slide -> image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" />
49
  <?php endif; ?>
50
  <?php else : ?>
51
  <a href="<?php echo $slide -> link; ?>" title="<?php echo $slide -> title; ?>"></a>
55
  <?php endif; ?>
56
  </ul>
57
 
58
+ <div id="<?php echo $wrapperid; ?>">
59
+ <?php if ($options['showthumbs'] == "true" && $options['thumbsposition'] == "top") : ?>
60
+ <div id="thumbnails<?php echo $rand; ?>" class="thumbstop">
61
+ <div id="slideleft<?php echo $rand; ?>" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
62
+ <div id="slidearea<?php echo $rand; ?>">
63
+ <div id="slider<?php echo $rand; ?>"></div>
64
  </div>
65
+ <div id="slideright<?php echo $rand; ?>" title="<?php _e('Slide Right', $this -> plugin_name); ?>"></div>
66
  <br style="clear:both; visibility:hidden; height:1px;" />
67
  </div>
68
  <?php endif; ?>
69
 
70
+ <div id="fullsize<?php echo $rand; ?>">
71
+ <?php $navb = false; $navf = false; ?>
72
+ <?php if ($options['shownav'] == "true" && count($slides) > 1) : ?>
73
+ <?php $navb = "imgprev" . $rand; ?>
74
+ <div id="imgprev<?php echo $rand; ?>" class="imgnav" title="<?php _e('Previous Image', $this -> plugin_name); ?>"></div>
75
+ <?php endif; ?>
76
+ <div id="imglink<?php echo $rand; ?>" class="imglink"><!-- link --></div>
77
+ <?php if ($options['shownav'] == "true" && count($slides) > 1) : ?>
78
+ <?php $navf = "imgnext" . $rand; ?>
79
+ <div id="imgnext<?php echo $rand; ?>" class="imgnav" title="<?php _e('Next Image', $this -> plugin_name); ?>"></div>
80
+ <?php endif; ?>
81
+ <div id="image<?php echo $rand; ?>"></div>
82
+ <?php if ($options['showinfo'] == "true") : ?>
83
+ <div id="information<?php echo $rand; ?>">
84
  <h3></h3>
85
  <p></p>
86
  </div>
87
  <?php endif; ?>
88
  </div>
89
 
90
+ <?php if ($options['showthumbs'] == "true" && $options['thumbsposition'] == "bottom") : ?>
91
+ <div id="thumbnails<?php echo $rand; ?>" class="thumbsbot">
92
+ <div id="slideleft<?php echo $rand; ?>" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
93
+ <div id="slidearea<?php echo $rand; ?>">
94
+ <div id="slider<?php echo $rand; ?>"></div>
95
  </div>
96
+ <div id="slideright<?php echo $rand; ?>" title="<?php _e('Slide Right', $this -> plugin_name); ?>"></div>
97
  <br style="clear:both; visibility:hidden; height:1px;" />
98
  </div>
99
  <?php endif; ?>
102
  <script type="text/javascript">
103
  jQuery.noConflict();
104
  tid('slideshow').style.display = "none";
105
+ tid('<?php echo $wrapperid; ?>').style.display = 'block';
106
+ tid('<?php echo $wrapperid; ?>').style.visibility = 'hidden';
 
 
 
 
 
 
 
 
 
 
107
  // append the spinner
108
+ jQuery("#fullsize<?php echo $rand; ?>").append('<div id="spinner<?php echo $rand; ?>"><img src="<?php echo $this -> url(); ?>/images/spinner.gif"></div>');
109
+ tid('spinner<?php echo $rand; ?>').style.visibility = 'visible';
110
 
111
  var slideshow = new TINY.slideshow("slideshow");
112
  jQuery(document).ready(function() {
113
+ window.onload = function() {
114
+ <?php if (empty($options['auto']) || (!empty($options['auto']) && $options['auto'] == "true")) : ?>slideshow.auto = true;<?php else : ?>slideshow.auto = false;<?php endif; ?>
115
+ slideshow.speed = <?php echo $options['autospeed']; ?>;
116
+ slideshow.imgSpeed = <?php echo $options['fadespeed']; ?>;
117
+ slideshow.navOpacity = <?php echo $options['navopacity']; ?>;
118
+ slideshow.navHover = <?php echo $options['navhoveropacity']; ?>;
 
119
  slideshow.letterbox = "#000000";
120
  slideshow.linkclass = "linkhover";
121
+ slideshow.info = "<?php echo ($options['showinfo'] == "true") ? 'information' . $rand : ''; ?>";
122
+ slideshow.infoSpeed = <?php echo $options['infospeed']; ?>;
123
+ slideshow.thumbs = "<?php echo ($options['showthumbs'] == "true") ? 'slider' . $rand : ''; ?>";
124
  slideshow.thumbOpacity = <?php echo $this -> get_option('thumbopacity'); ?>;
125
+ slideshow.left = "slideleft<?php echo $rand; ?>";
126
+ slideshow.right = "slideright<?php echo $rand; ?>";
127
+ slideshow.scrollSpeed = <?php echo $options['thumbsspeed']; ?>;
128
+ slideshow.spacing = <?php echo $options['thumbsspacing']; ?>;
129
+ slideshow.active = "<?php echo $options['thumbsborder']; ?>";
130
  slideshow.imagesthickbox = "<?php echo ($this -> get_option('imagesthickbox') == "Y") ? 'true' : 'false'; ?>";
131
+ jQuery("#spinner<?php echo $rand; ?>").remove();
132
+ slideshow.init("slideshow","image<?php echo $rand; ?>","<?php echo $navb; ?>","<?php echo $navf; ?>","imglink<?php echo $rand; ?>");
133
+ tid('<?php echo $wrapperid; ?>').style.visibility = 'visible';
134
+ }
135
  });
136
  </script>
137
+
138
+ <?php
139
+
140
+ $cssattr['wrapperrand'] = $rand;
141
+ $cssattr['wrapperid'] = $wrapperid;
142
+ $cssattr['resizeimages'] = (($options['resizeimages'] == "true") ? "Y" : "N");
143
+ $cssattr['width'] = $options['width'];
144
+ $cssattr['height'] = $options['height'];
145
+ $cssattr['thumbwidth'] = $this -> get_option('thumbwidth');
146
+ $cssattr['thumbheight'] = $this -> get_option('thumbheight');
147
+
148
+ ?>
149
+
150
+ <style type="text/css">
151
+ @import url('<?php echo $this -> get_css_url($cssattr); ?>');
152
+ </style>
153
+
154
+ <!--[if IE 6]>
155
+ <style type="text/css">
156
+ .imglink, #imglink<?php echo $rand; ?> { display: none !important; }
157
+ .linkhover { display: none !important; }
158
+ </style>
159
+ <![endif]-->
160
  <?php endif; ?>