Slideshow Gallery - Version 1.2.3

Version Description

  • ADD: List/grid switching for ordering of slides
  • ADD: Permission/role settings for sections
  • ADD: 'imagesoverlay' parameter to turn On/Off the Colorbox overlay per slideshow
  • ADD: "Resize Images" setting TimThumb test case for debugging
  • ADD: Order slides per gallery
  • ADD: Order slides randomly
  • IMPROVE: Change WP_PLUGIN_DIR to plugins_url() for styles/scripts
  • IMPROVE: Change mysql_list_fields() to a compatible function
  • IMPROVE: Remove previous image to prevent overlapping
  • IMPROVE: Max width/height for Colorbox overlay for images
  • FIX: Null ID value on insert of slide
  • FIX: Validation errors
  • FIX: Slide current/new window problem
Download this release

Release Info

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

Code changes from version 1.2.2.1 to 1.2.3

css/admin.css CHANGED
@@ -6,9 +6,226 @@ 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
  }
6
  border: 1px #CCCCCC solid;
7
  -moz-border-radius: 4px;
8
  -webkit-border-radius: 4px;
9
+ border-radius: 4px;
10
  padding: 2px;
11
  }
12
 
13
  a.thickbox:hover img.slideshow, a.colorbox:hover img.slideshow {
14
  border: 1px #515151 solid;
15
+ }
16
+
17
+ /* Sortable */
18
+
19
+ ul.connectedSortable {
20
+ float: left;
21
+ width: 100%;
22
+ }
23
+
24
+ span.gallery_slides_convert_list a {
25
+ background: url('../images/listgrid.png') left top;
26
+ text-align: left;
27
+ text-indent: -999px;
28
+ display: block;
29
+ width: 20px;
30
+ height: 20px;
31
+ float: left;
32
+ margin: 0 5px 0 0;
33
+ }
34
+
35
+ span.gallery_slides_convert_list a:hover,
36
+ .gallery_slides_list span.gallery_slides_convert_list a {
37
+ background:url('../images/listgrid.png') 40px top;
38
+ text-align: left;
39
+ text-indent: -999px;
40
+ display: block;
41
+ width: 20px;
42
+ height: 20px;
43
+ float: left;
44
+ margin: 0 5px 0 0;
45
+ }
46
+
47
+ span.gallery_slides_convert_grid a {
48
+ background:url('../images/listgrid.png') 60px top;
49
+ text-align: left;
50
+ text-indent: -999px;
51
+ display: block;
52
+ width: 20px;
53
+ height: 20px;
54
+ float: left;
55
+ margin: 0 5px 0 0;
56
+ }
57
+
58
+ span.gallery_slides_convert_grid a:hover,
59
+ .gallery_slides_grid span.gallery_slides_convert_grid a {
60
+ background:url('../images/listgrid.png') right top;
61
+ text-align: left;
62
+ text-indent: -999px;
63
+ display: block;
64
+ width: 20px;
65
+ height: 20px;
66
+ float: left;
67
+ margin: 0 5px 0 0;
68
+ }
69
+
70
+ .sortable-elements {
71
+ display:inline-block;
72
+ }
73
+
74
+ .sortable-form-table-element, .sortable-form-table-headings, .ui-sortable li.gallerylineitem {
75
+ float:left;
76
+ margin-bottom:12px;
77
+ width:100%;
78
+ padding:8px 0;
79
+ }
80
+
81
+ .ui-sortable li.gallerylineitem {
82
+ float:left;
83
+ width:30%;
84
+ min-width:30%;
85
+ clear:both;
86
+ white-space: nowrap;
87
+ overflow: hidden;
88
+ position: relative;
89
+ }
90
+
91
+ .relatedslides .ui-sortable li.gallerylineitem {
92
+ width: 80%;
93
+ }
94
+
95
+ .ui-sortable li.ui-sortable-helper {
96
+ width: 30%;
97
+ }
98
+
99
+ .ui-sortable li.gallerylineitem span.link {
100
+ right: 10px;
101
+ position: absolute;
102
+ }
103
+
104
+ .ui-sortable li.gallerylineitem span.link a {
105
+ font-size: 90%;
106
+ }
107
+
108
+ .ui-sortable li.gallerylineitem span.link a:hover {
109
+ text-decoration: none;
110
+ }
111
+
112
+ .sortable-form-table-element, .ui-sortable li.gallerylineitem {
113
+ cursor: url(https://mail.google.com/mail/images/2/openhand.cur), default !important;
114
+ background-color: #F1F1F1;
115
+ background-image: -ms-linear-gradient(top,#F9F9F9,#ECECEC);
116
+ background-image: -moz-linear-gradient(top,#F9F9F9,#ECECEC);
117
+ background-image: -o-linear-gradient(top,#F9F9F9,#ECECEC);
118
+ background-image: -webkit-gradient(linear,left top,left bottom,from(#F9F9F9),to(#ECECEC));
119
+ background-image: -webkit-linear-gradient(top,#F9F9F9,#ECECEC);
120
+ background-image: linear-gradient(top,#F9F9F9,#ECECEC);
121
+ -moz-border-radius:3px;
122
+ -webkit-border-radius:3px;
123
+ border-radius:3px;
124
+ border:1px solid #DFDFDF;
125
+ }
126
+
127
+ #slidelist .sortable-form-table-element table, #slidelist .sortable-form-table-headings table, #slidelist.ui-sortable {
128
+ /*float:left;*/
129
+ width:100%;
130
+ border-spacing:0;
131
+ }
132
+
133
+ .gallery_slides_grid #slidelist li.gallerylineitem {
134
+ width:90px !important;
135
+ min-width:90px !important;
136
+ height:112px;
137
+ display:block;
138
+ float:left;
139
+ clear:none !important;
140
+ margin-right:10px;
141
+ white-space:normal
142
+ }
143
+
144
+ .gallery_slides_grid #slidelist li.gallerylineitem .gallery_slide_image {
145
+ display:block !important;
146
+ border:1px solid #DDD;
147
+ float:left;
148
+ width:89px;
149
+ height:89px;
150
+ margin-bottom:5px;
151
+ }
152
+
153
+ .gallery_slides_grid .gallery_slide_title {
154
+ float:left;
155
+ height:20px;
156
+ line-height:20px;
157
+ display:block;
158
+ width:90px;
159
+ overflow:hidden;
160
+ }
161
+
162
+ .gallery_slides_grid .wpml-placeholder, .gallery_slides_grid .gallery-placeholder {
163
+ float:left;
164
+ width:88px !important;
165
+ min-width:88px !important;
166
+ height:135px;
167
+ border:1px dashed #c9c9c9;
168
+ background:#f9f9f9;
169
+ -moz-border-radius:3px;
170
+ -webkit-border-radius:3px;
171
+ border-radius:3px;
172
+ margin-bottom:10px;
173
+ margin-right:10px;
174
+ clear:none !important;
175
+ }
176
+
177
+ .sortable-form-table-element table td, .sortable-form-table-headings table td{
178
+ padding:0 8px;
179
+ width:43%;
180
+ color:#333;
181
+ font-weight:bold;
182
+ text-shadow:1px 1px 0 #FFF;
183
+ }
184
+
185
+ .ui-sortable li.gallerylineitem {
186
+ color:#333;
187
+ font-weight:bold;
188
+ text-shadow:1px 1px 0 #FFF;
189
+ padding:12px;
190
+ }
191
+
192
+ .sortable-form-table-element table td input[type=text] {
193
+ font-weight:normal;
194
+ /*width:40%;*/
195
+ padding:5px;
196
+ }
197
+
198
+ .sortable-form-table-element table td.gallery-checkbox-required, .sortable-form-table-element table td.gallery-checkbox-show,
199
+ .sortable-form-table-headings table td.gallery-checkbox-required, .sortable-form-table-headings table td.gallery-checkbox-show {
200
+ width:5%;
201
+ text-align:center;
202
+ }
203
+
204
+ .wpml-placeholder, .gallery-placeholder {
205
+ float:left;
206
+ width:100%;
207
+ height:43px;
208
+ border:1px dashed #c9c9c9;
209
+ background:#f9f9f9;
210
+ -moz-border-radius:3px;
211
+ -webkit-border-radius:3px;
212
+ border-radius:3px;
213
+ margin-bottom:10px;
214
+ }
215
+
216
+ #slidelist .gallery-placeholder {
217
+ float:left;
218
+ clear:both;
219
+ width:30%;
220
+ padding:0 12px;
221
+ }
222
+
223
+ .relatedslides li.gallery-placeholder {
224
+ width: 80% !important;
225
+ }
226
+
227
+ .ui-sortable-helper, .ui-sortable li.ui-sortable-helper {
228
+ cursor: url(https://mail.google.com/mail/images/2/closedhand.cur), default !important;
229
+ cursor: -moz-grabbing;
230
+ cursor: -webkit-grabbing;
231
  }
css/gallery-css.php CHANGED
@@ -10,27 +10,27 @@ 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; 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; ?>
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 { 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 { 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 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 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 { width:<?php echo ($styles['width'] != "auto") ? ((int) $styles['width'] - 4) . 'px' : 'auto'; ?>; no-repeat; }
18
+ #<?php echo $styles['wrapperid']; ?> #image img { position:absolute; left:0; border:none; height:auto; max-width:100%; }
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 { left:0; background:url('../images/left.gif') left center no-repeat; }
21
+ #<?php echo $styles['wrapperid']; ?> #imgnext { right:0; background:url('../images/right.gif') right center no-repeat; }
22
+ #<?php echo $styles['wrapperid']; ?> #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); }
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 { 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 { 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:hover { background-color:#333; }
29
+ #<?php echo $styles['wrapperid']; ?> #slideright { 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:hover { background-color:#333; }
31
+ #<?php echo $styles['wrapperid']; ?> #slidearea { 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 { position:absolute; left:0; height:<?php echo ((int) $styles['thumbheight'] + 14); ?>px; }
33
+ #<?php echo $styles['wrapperid']; ?> #slider 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 { position:relative; top:50%; left:45%; text-align:left; }
35
+ #<?php echo $styles['wrapperid']; ?> #spinner img { border:none; }
36
  <?php endif; ?>
helpers/db.php CHANGED
@@ -166,7 +166,7 @@ class GalleryDbHelper extends GalleryPlugin {
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
  }
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` (`slide_id`, `gallery_id`, `created`, `modified`) VALUES ('" . $slide_id . "', '" . $gallery_id . "', '" . $date . "', '" . $date . "');";
170
  $wpdb -> query($galleryslidequery);
171
  }
172
  }
helpers/form.php CHANGED
@@ -32,8 +32,6 @@ class GalleryFormHelper extends GalleryPlugin {
32
 
33
  $r = wp_parse_args($args, $defaults);
34
  extract($r, EXTR_SKIP);
35
-
36
- $this -> debug($this);
37
  echo $this -> Html -> field_value($name);
38
 
39
  ob_start();
32
 
33
  $r = wp_parse_args($args, $defaults);
34
  extract($r, EXTR_SKIP);
 
 
35
  echo $this -> Html -> field_value($name);
36
 
37
  ob_start();
helpers/html.php CHANGED
@@ -2,6 +2,26 @@
2
 
3
  class GalleryHtmlHelper extends GalleryPlugin {
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  function link($name = '', $href = '/', $args = array()) {
6
  $defaults = array(
7
  'title' => (empty($args['title'])) ? $title : $args['title'],
@@ -63,12 +83,12 @@ class GalleryHtmlHelper extends GalleryPlugin {
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;
2
 
3
  class GalleryHtmlHelper extends GalleryPlugin {
4
 
5
+ function section_name($section = null) {
6
+ if (!empty($section)) {
7
+ switch ($section) {
8
+ case 'slides' :
9
+ $name = __('Manage Slides', $this -> plugin_name);
10
+ break;
11
+ case 'galleries' :
12
+ $name = __('Manage Galleries', $this -> plugin_name);
13
+ break;
14
+ case 'settings' :
15
+ $name = __('Configuration', $this -> plugin_name);
16
+ break;
17
+ }
18
+
19
+ return $name;
20
+ }
21
+
22
+ return false;
23
+ }
24
+
25
  function link($name = '', $href = '/', $args = array()) {
26
  $defaults = array(
27
  'title' => (empty($args['title'])) ? $title : $args['title'],
83
  }
84
 
85
  function timthumb_url() {
86
+ return site_url() . '/wp-content/plugins/slideshow-gallery/vendors/timthumb.php';
87
  }
88
 
89
  function image_url($filename = null) {
90
  if (!empty($filename)) {
91
+ return site_url() . '/wp-content/uploads/slideshow-gallery/' . $filename;
92
  }
93
 
94
  return false;
helpers/metabox.php CHANGED
@@ -21,6 +21,10 @@ class GalleryMetaboxHelper extends GalleryPlugin {
21
  $this -> render('metaboxes' . DS . 'settings-general', false, true, 'admin');
22
  }
23
 
 
 
 
 
24
  function settings_linksimages() {
25
  $this -> render('metaboxes' . DS . 'settings-linksimages', false, true, 'admin');
26
  }
21
  $this -> render('metaboxes' . DS . 'settings-general', false, true, 'admin');
22
  }
23
 
24
+ function settings_wprelated() {
25
+ $this -> render('metaboxes' . DS . 'settings-wprelated', false, true, 'admin');
26
+ }
27
+
28
  function settings_linksimages() {
29
  $this -> render('metaboxes' . DS . 'settings-linksimages', false, true, 'admin');
30
  }
images/listgrid.png ADDED
Binary file
js/gallery.js CHANGED
@@ -38,7 +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.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];
@@ -118,7 +118,7 @@ TINY.slideshow.prototype={
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
  }
@@ -131,7 +131,7 @@ TINY.slideshow.prototype={
131
  this.q.style.cursor='default';
132
  }
133
  var m= tag('img',this.f);
134
- if(m.length > 2){
135
  this.f.removeChild(m[0])
136
  }
137
  },
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];
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 + '",maxWidth:"90%",maxHeight:"90%",title:"' + this.a[s].t + '"})');
122
  } else {
123
  this.q.onclick = new Function('window.open("' + this.a[s].l + '","' + this.a[s].tg + '")');
124
  }
131
  this.q.style.cursor='default';
132
  }
133
  var m= tag('img',this.f);
134
+ if(m.length >= 2){
135
  this.f.removeChild(m[0])
136
  }
137
  },
js/tinymce/dialog.php CHANGED
@@ -27,11 +27,11 @@ $galleries = $wpdb -> get_results($galleriesquery);
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>
33
- <script language="javascript" type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
34
- <script language="javascript" type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-includes/js/jquery/jquery.js"></script>
35
  <script language="javascript" type="text/javascript">
36
 
37
  var _self = tinyMCEPopup;
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 echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
31
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
32
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
33
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
34
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/jquery/jquery.js"></script>
35
  <script language="javascript" type="text/javascript">
36
 
37
  var _self = tinyMCEPopup;
models/galleryslides.php CHANGED
@@ -14,6 +14,7 @@ class GalleryGallerySlides extends GalleryDbHelper {
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`)",
@@ -64,8 +65,7 @@ class GalleryGallerySlides extends GalleryDbHelper {
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 {
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
+ 'order' => "INT(11) NOT NULL DEFAULT '0'",
18
  'created' => "DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'",
19
  'modified' => "DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'",
20
  'key' => "PRIMARY KEY (`id`)",
65
 
66
  if (empty($this -> errors)) {
67
  if ($galleryslide = $this -> find(array('gallery_id' => $gallery_id, 'slide_id' => $slide_id))) {
68
+ $this -> data -> id = $galleryslide -> id;
 
69
  }
70
  }
71
  } else {
models/slide.php CHANGED
@@ -78,7 +78,6 @@ class GallerySlide extends GalleryDbHelper {
78
  extract($data, EXTR_SKIP);
79
 
80
  if (empty($title)) { $this -> errors['title'] = __('Please fill in a title', $this -> plugin_name); }
81
- //if (empty($description)) { $this -> errors['description'] = __('Please fill in a description', $this -> plugin_name); }
82
  if (empty($type)) { $this -> errors['type'] = __('Please select an image type', $this -> plugin_name); }
83
  elseif ($type == "file") {
84
  if (!empty($image_oldfile) && empty($_FILES['image_file']['name'])) {
78
  extract($data, EXTR_SKIP);
79
 
80
  if (empty($title)) { $this -> errors['title'] = __('Please fill in a title', $this -> plugin_name); }
 
81
  if (empty($type)) { $this -> errors['type'] = __('Please select an image type', $this -> plugin_name); }
82
  elseif ($type == "file") {
83
  if (!empty($image_oldfile) && empty($_FILES['image_file']['name'])) {
readme.txt CHANGED
@@ -3,26 +3,43 @@ 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: 3.1
6
- Tested up to: 3.4.1
7
- Stable tag: 1.2.2.1
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
11
  == Description ==
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.
@@ -47,9 +64,9 @@ Installing the WordPress slideshow gallery plugin is very easy. Simply follow th
47
  1. Extract the package to obtain the `slideshow-gallery` folder
48
  1. Upload the `slideshow-gallery` folder to the `/wp-content/plugins/` directory
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
 
@@ -80,6 +97,21 @@ Yes, you can use the `exclude` parameter to exclude post images by their order i
80
 
81
  == Changelog ==
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  = 1.2.2.1 =
84
  * IMPROVE: Upgrade of TimThumb from 2.8.9 to 2.8.10 to fix broken images.
85
 
@@ -119,7 +151,6 @@ Yes, you can use the `exclude` parameter to exclude post images by their order i
119
  * IMPROVE: Change 1=1 for the CSS
120
  * FIX: Code showing in the RSS feed.
121
  * ADD: Shortcode parameters
122
- * ADD: Multiple slideshows per post/page
123
  * ADD: Setting to turn off the next/previous navigation
124
  * IMPROVE: "Previous Image" and "Next Image" in language file
125
  * FIX: Not all thumbnails load the first time
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: 3.1
6
+ Tested up to: 3.4.2
7
+ Stable tag: 1.2.3
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
11
  == Description ==
12
 
13
+ Feature content in beatiful and fast JavaScript powered slideshow gallery showcases 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/pages.
16
 
17
+ The slideshow is flexible, all aspects can easily be configured and embedding/hardcoding the slideshow gallery is a breeze.
18
 
19
+ Here are several ways to display a slideshow:
20
+
21
+ = Shortcode for all slides =
22
+
23
+ To embed a slideshow with all slides under **Slideshow > Manage Slides** in the plugin, simply insert `[slideshow]` into the content of a post/page.
24
+
25
+ = Shortcode for a gallery's slides =
26
+
27
+ To embed a slideshow with slides from a specific gallery under **Slideshow > Manage Galleries** in the plugin, simply insert `[slideshow gallery_id="X"]` (where X is the ID value of the gallery) into the content of a post/page.
28
+
29
+ = Shortcode for the images of a WordPress post/page =
30
+
31
+ To embed a slideshow with the images uploaded to a WordPress post/page through it's media gallery, simply insert `[slideshow post_id="X"]` (where X is the ID value of the post). Whether you want to display the images from a post or a page, the parameter remains `post_id`.
32
+
33
+ = Hardcode into any plugin/theme with PHP =
34
 
35
  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()); } ?>`.
36
 
37
+ = Parameters for shortcode/hardcode to customize each slideshow =
38
+
39
  You can use any of the following parameters with both the hardcoding and shortcode to customize each slideshow gallery:
40
 
41
  * `resizeimages` [ true | false ] = Set to 'true' to resize images to fit the slideshow dimensions.
42
+ * `imagesoverlay` [ true | false ] (default: setting) = Set to 'true' to display links of slides that are images in a Colorbox overlay on the page.
43
  * `orderby` [ random ] = Set to 'random' to randomly order the slides. Leave this shortcode parameter to order by the order set on the slides.
44
  * `width` [ width | auto ] = Width of the slideshow in pixels. Don't specify 'px' part, just the numeric value for the height.
45
  * `height` [ height ] (default: setting) = Height of the slideshow in pixels. Don't specify the 'px' part, just the numeric value for the height.
64
  1. Extract the package to obtain the `slideshow-gallery` folder
65
  1. Upload the `slideshow-gallery` folder to the `/wp-content/plugins/` directory
66
  1. Activate the plugin through the 'Plugins' menu in WordPress
67
+ 1. Configure the settings according to your needs through the **Slideshow > Configuration** menu
68
  1. Add and manage your slides in the 'Slideshow' section
69
+ 1. Put `[slideshow post_id="X"]` 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 under **Slideshow > Manage 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.
70
 
71
  == Frequently Asked Questions ==
72
 
97
 
98
  == Changelog ==
99
 
100
+ = 1.2.3 =
101
+ * ADD: List/grid switching for ordering of slides
102
+ * ADD: Permission/role settings for sections
103
+ * ADD: 'imagesoverlay' parameter to turn On/Off the Colorbox overlay per slideshow
104
+ * ADD: "Resize Images" setting TimThumb test case for debugging
105
+ * ADD: Order slides per gallery
106
+ * ADD: Order slides randomly
107
+ * IMPROVE: Change WP_PLUGIN_DIR to plugins_url() for styles/scripts
108
+ * IMPROVE: Change mysql_list_fields() to a compatible function
109
+ * IMPROVE: Remove previous image to prevent overlapping
110
+ * IMPROVE: Max width/height for Colorbox overlay for images
111
+ * FIX: Null ID value on insert of slide
112
+ * FIX: Validation errors
113
+ * FIX: Slide current/new window problem
114
+
115
  = 1.2.2.1 =
116
  * IMPROVE: Upgrade of TimThumb from 2.8.9 to 2.8.10 to fix broken images.
117
 
151
  * IMPROVE: Change 1=1 for the CSS
152
  * FIX: Code showing in the RSS feed.
153
  * ADD: Shortcode parameters
 
154
  * ADD: Setting to turn off the next/previous navigation
155
  * IMPROVE: "Previous Image" and "Next Image" in language file
156
  * FIX: Not all thumbnails load the first time
slideshow-gallery-ajax.php CHANGED
@@ -15,7 +15,7 @@ class GalleryAjax extends GalleryPlugin {
15
  $this -> register_plugin('slideshow-gallery', __FILE__);
16
 
17
  if (!empty($cmd)) {
18
- if (in_array($cmd, $this -> safecommands) || current_user_can('edit_plugins')) {
19
  if (method_exists($this, $cmd)) {
20
  $this -> $cmd();
21
  }
@@ -26,10 +26,14 @@ class GalleryAjax extends GalleryPlugin {
26
  function slides_order() {
27
  if (!empty($_REQUEST['item'])) {
28
  foreach ($_REQUEST['item'] as $order => $slide_id) {
29
- $this -> Slide -> save_field('order', $order, array('id' => $slide_id));
 
 
 
 
30
  }
31
 
32
- ?><br/><div style="color:red;"><?php _e('Slides have been ordered', $this -> plugin_name); ?></div><?php
33
  }
34
  }
35
  }
15
  $this -> register_plugin('slideshow-gallery', __FILE__);
16
 
17
  if (!empty($cmd)) {
18
+ if (in_array($cmd, $this -> safecommands) || current_user_can('gallery_slides')) {
19
  if (method_exists($this, $cmd)) {
20
  $this -> $cmd();
21
  }
26
  function slides_order() {
27
  if (!empty($_REQUEST['item'])) {
28
  foreach ($_REQUEST['item'] as $order => $slide_id) {
29
+ if (empty($_REQUEST['gallery_id'])) {
30
+ $this -> Slide -> save_field('order', ($order + 1), array('id' => $slide_id));
31
+ } else {
32
+ $this -> GallerySlides -> save_field('order', ($order + 1), array('slide_id' => $slide_id, 'gallery_id' => $_REQUEST['gallery_id']));
33
+ }
34
  }
35
 
36
+ _e('Slides have been ordered', $this -> plugin_name);
37
  }
38
  }
39
  }
slideshow-gallery-plugin.php CHANGED
@@ -16,7 +16,6 @@ class GalleryPlugin {
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
 
@@ -24,9 +23,7 @@ class GalleryPlugin {
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) {
@@ -101,6 +98,7 @@ class GalleryPlugin {
101
 
102
  function initialize_options() {
103
  if (!is_admin()) { return; }
 
104
 
105
  $styles = array(
106
  'width' => "450",
@@ -109,7 +107,7 @@ class GalleryPlugin {
109
  'background' => "#000000",
110
  'infobackground' => "#000000",
111
  'infocolor' => "#FFFFFF",
112
- 'resizeimages' => "Y",
113
  );
114
 
115
  $this -> add_option('styles', $styles);
@@ -134,6 +132,57 @@ class GalleryPlugin {
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
  }
@@ -275,7 +324,7 @@ class GalleryPlugin {
275
  wp_enqueue_script('wp-lists');
276
  wp_enqueue_script('postbox');
277
 
278
- wp_enqueue_script('settings-editor', '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/settings-editor.js', array('jquery'), '1.0');
279
  }
280
 
281
  if ($_GET['page'] == "slideshow-slides" && $_GET['method'] == "order") {
@@ -283,21 +332,18 @@ class GalleryPlugin {
283
  }
284
  }
285
 
286
- wp_enqueue_script('colorbox', WP_PLUGIN_URL . '/' . $this -> plugin_name . '/js/colorbox.js', array('jquery'), '1.3.19');
287
- wp_enqueue_script($this -> plugin_name . 'admin', '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/admin.js', null, '1.0');
288
  } else {
289
- wp_enqueue_script($this -> plugin_name, '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/gallery.js', null, '1.0');
290
-
291
- if ($this -> get_option('imagesthickbox') == "Y") {
292
- wp_enqueue_script('colorbox', WP_PLUGIN_URL . '/' . $this -> plugin_name . '/js/colorbox.js', array('jquery'), '1.3.19');
293
- }
294
  }
295
 
296
  return true;
297
  }
298
 
299
  function get_css_url($attr = null) {
300
- $css_url = WP_PLUGIN_URL . '/' . $this -> plugin_name . '/css/gallery-css.php?';
301
 
302
  $default_attr = $this -> get_option('styles');
303
  $styles = wp_parse_args($attr, $default_attr);
@@ -336,7 +382,7 @@ class GalleryPlugin {
336
  }
337
 
338
  function url() {
339
- return rtrim(get_bloginfo('wpurl'), '/') . '/' . substr(preg_replace("/\\" . DS . "/si", "/", $this -> plugin_base()), strlen(ABSPATH));
340
  }
341
 
342
  function add_option($name = '', $value = '') {
@@ -432,18 +478,12 @@ class GalleryPlugin {
432
  global $wpdb;
433
 
434
  if (!empty($table)) {
435
- $fullname = $table;
436
-
437
- if (($tablefields = mysql_list_fields(DB_NAME, $fullname, $wpdb -> dbh)) !== false) {
438
- $columns = mysql_num_fields($tablefields);
439
-
440
- $field_array = array();
441
- for ($i = 0; $i < $columns; $i++) {
442
- $fieldname = mysql_field_name($tablefields, $i);
443
- $field_array[] = $fieldname;
444
  }
445
-
446
- return $field_array;
447
  }
448
  }
449
 
16
 
17
  var $helpers = array('Db', 'Html', 'Form', 'Metabox');
18
  var $models = array('Slide', 'Gallery', 'GallerySlides');
 
19
  var $debugging = false; //set to "true" to turn on debugging
20
  var $debug_level = 2; //set to 2 for PHP and DB errors or 1 for just DB errors
21
 
23
  $this -> plugin_name = $name;
24
  $this -> plugin_base = rtrim(dirname($base), DS);
25
  $this -> sections = (object) $this -> sections;
 
26
  $this -> initialize_classes();
 
27
 
28
  global $wpdb;
29
  if ($this -> debugging == true) {
98
 
99
  function initialize_options() {
100
  if (!is_admin()) { return; }
101
+ $this -> init_roles();
102
 
103
  $styles = array(
104
  'width' => "450",
107
  'background' => "#000000",
108
  'infobackground' => "#000000",
109
  'infocolor' => "#FFFFFF",
110
+ 'resizeimages' => "N",
111
  );
112
 
113
  $this -> add_option('styles', $styles);
132
  $this -> add_option('imagesthickbox', "N");
133
  }
134
 
135
+ function check_roles() {
136
+ global $wp_roles;
137
+ $permissions = $this -> get_option('permissions');
138
+
139
+ if ($role = get_role('administrator')) {
140
+ if (!empty($this -> sections)) {
141
+ foreach ($this -> sections as $section_key => $section_menu) {
142
+ if (empty($role -> capabilities['gallery_' . $section_key])) {
143
+ $role -> add_cap('gallery_' . $section_key);
144
+ $permissions[$section_key][] = 'administrator';
145
+ }
146
+ }
147
+
148
+ $this -> update_option('permissions', $permissions);
149
+ }
150
+ }
151
+
152
+ return false;
153
+ }
154
+
155
+ function init_roles($sections = null) {
156
+ global $wp_roles;
157
+ $sections = $this -> sections;
158
+ $role =& get_role('administrator');
159
+
160
+ if (!empty($role)) {
161
+ if (!empty($sections)) {
162
+ foreach ($sections as $section_key => $section_menu) {
163
+ $role -> add_cap('gallery_' . $section_key);
164
+ }
165
+ }
166
+ } elseif (empty($role) && !is_multisite()) {
167
+ $newrolecapabilities['read'] = 1;
168
+ add_role('slideshow', __('Slideshow Manager', $this -> plugin_name), $newrolecapabilities);
169
+ $role = get_role('slideshow');
170
+ $role -> add_cap('read');
171
+ $role -> add_cap('gallery_slides');
172
+ $role -> add_cap('gallery_galleries');
173
+ $role -> add_cap('gallery_settings');
174
+ }
175
+
176
+ if (!empty($sections)) {
177
+ $permissions = array();
178
+ foreach ($sections as $section_key => $section_menu) {
179
+ $permissions[$section_key][] = 'administrator';
180
+ }
181
+
182
+ $this -> update_option('permissions', $permissions);
183
+ }
184
+ }
185
+
186
  function render_msg($message = null) {
187
  $this -> render('msg-top', array('message' => $message), true, 'admin');
188
  }
324
  wp_enqueue_script('wp-lists');
325
  wp_enqueue_script('postbox');
326
 
327
+ wp_enqueue_script('settings-editor', plugins_url() . '/' . $this -> plugin_name . '/js/settings-editor.js', array('jquery'), '1.0');
328
  }
329
 
330
  if ($_GET['page'] == "slideshow-slides" && $_GET['method'] == "order") {
332
  }
333
  }
334
 
335
+ wp_enqueue_script('colorbox', plugins_url() . '/' . $this -> plugin_name . '/js/colorbox.js', array('jquery'), '1.3.19');
336
+ wp_enqueue_script($this -> plugin_name . 'admin', plugins_url() . '/' . $this -> plugin_name . '/js/admin.js', null, '1.0');
337
  } else {
338
+ wp_enqueue_script($this -> plugin_name, plugins_url() . '/' . $this -> plugin_name . '/js/gallery.js', null, '1.0');
339
+ wp_enqueue_script('colorbox', plugins_url() . '/' . $this -> plugin_name . '/js/colorbox.js', array('jquery'), '1.3.19');
 
 
 
340
  }
341
 
342
  return true;
343
  }
344
 
345
  function get_css_url($attr = null) {
346
+ $css_url = plugins_url() . '/' . $this -> plugin_name . '/css/gallery-css.php?';
347
 
348
  $default_attr = $this -> get_option('styles');
349
  $styles = wp_parse_args($attr, $default_attr);
382
  }
383
 
384
  function url() {
385
+ return site_url() . '/' . substr(preg_replace("/\\" . DS . "/si", "/", $this -> plugin_base()), strlen(ABSPATH));
386
  }
387
 
388
  function add_option($name = '', $value = '') {
478
  global $wpdb;
479
 
480
  if (!empty($table)) {
481
+ $fullname = $table;
482
+ $field_array = array();
483
+ if ($fields = $wpdb -> get_results("SHOW COLUMNS FROM " . $fullname)) {
484
+ foreach ($fields as $field) {
485
+ $field_array[] = $field -> Field;
 
 
 
 
486
  }
 
 
487
  }
488
  }
489
 
slideshow-gallery.php CHANGED
@@ -6,7 +6,7 @@ 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 (function_exists('slideshow')) { slideshow($output = true, $post_id = false, $gallery_id = false, $params = array()); } ?&gt;</code>.
9
- Version: 1.2.2.1
10
  */
11
 
12
  define('DS', DIRECTORY_SEPARATOR);
@@ -19,7 +19,6 @@ if (!class_exists('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
@@ -47,25 +46,23 @@ if (!class_exists('Gallery')) {
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
  }
@@ -76,7 +73,8 @@ if (!class_exists('Gallery')) {
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');
@@ -124,9 +122,11 @@ if (!class_exists('Gallery')) {
124
 
125
  // default shortcode parameters
126
  $defaults = array(
 
127
  'gallery_id' => false,
128
  'orderby' => array('order', "ASC"),
129
  'resizeimages' => (($styles['resizeimages'] == "Y") ? "true" : "false"),
 
130
  'width' => ($styles['width']),
131
  'height' => ($styles['height']),
132
  'auto' => (($this -> get_option('autoslide') == "Y") ? "true" : "false"),
@@ -158,7 +158,12 @@ if (!class_exists('Gallery')) {
158
  $orderbystring = "ORDER BY RAND()";
159
  } else {
160
  list($orderf, $orderd) = $orderby;
161
- $orderbystring = "ORDER BY " . $this -> Slide -> table . "." . $orderf . " " . $orderd . "";
 
 
 
 
 
162
  }
163
 
164
  $slidesquery = "SELECT * FROM " . $this -> Slide -> table . " LEFT JOIN " . $this -> GallerySlides -> table .
@@ -170,6 +175,7 @@ if (!class_exists('Gallery')) {
170
  $slides[$skey] -> image_path = 'wp-content/uploads/slideshow-gallery/' . $slide -> image;
171
  }
172
 
 
173
  $content = $this -> render('gallery', array('slides' => $slides, 'options' => $s, 'frompost' => false), false, 'default');
174
  }
175
  } elseif (!empty($custom) || empty($post_id)) {
@@ -185,6 +191,7 @@ if (!class_exists('Gallery')) {
185
  }
186
  }
187
 
 
188
  $content = $this -> render('gallery', array('slides' => $slides, 'options' => $s, 'frompost' => false), false, 'default');
189
  } else {
190
  global $post;
@@ -205,6 +212,7 @@ if (!class_exists('Gallery')) {
205
  }
206
  }
207
 
 
208
  $content = $this -> render('gallery', array('slides' => $attachments, 'options' => $s, 'frompost' => true), false, 'default');
209
  }
210
  }
@@ -213,7 +221,9 @@ if (!class_exists('Gallery')) {
213
  return $content;
214
  }
215
 
216
- function admin_slides() {
 
 
217
  switch ($_GET['method']) {
218
  case 'delete' :
219
  if (!empty($_GET['id'])) {
@@ -268,8 +278,22 @@ if (!class_exists('Gallery')) {
268
  }
269
  break;
270
  case 'order' :
271
- $slides = $this -> Slide -> find_all(null, null, array('order', "ASC"));
272
- $this -> render('slides' . DS . 'order', array('slides' => $slides), true, 'admin');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  break;
274
  default :
275
  $data = $this -> paginate('Slide');
@@ -381,7 +405,37 @@ if (!class_exists('Gallery')) {
381
  default :
382
  if (!empty($_POST)) {
383
  foreach ($_POST as $pkey => $pval) {
384
- $this -> update_option($pkey, $pval);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  }
386
 
387
  $message = __('Configuration has been saved', $this -> plugin_name);
@@ -397,6 +451,7 @@ if (!class_exists('Gallery')) {
397
 
398
  //initialize a Gallery object
399
  $Gallery = new Gallery();
 
400
 
401
  if (!function_exists('slideshow')) {
402
  function slideshow($output = true, $gallery_id = null, $post_id = null, $params = array()) {
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 (function_exists('slideshow')) { slideshow($output = true, $post_id = false, $gallery_id = false, $params = array()); } ?&gt;</code>.
9
+ Version: 1.2.3
10
  */
11
 
12
  define('DS', DIRECTORY_SEPARATOR);
19
  $url = explode("&", $_SERVER['REQUEST_URI']);
20
  $this -> url = $url[0];
21
  $this -> referer = (empty($_SERVER['HTTP_REFERER'])) ? $this -> url : $_SERVER['HTTP_REFERER'];
 
22
  $this -> register_plugin('slideshow-gallery', __FILE__);
23
 
24
  //WordPress action hooks
46
  }
47
 
48
  function wp_head() {
49
+ ?>
50
+
51
+ <script type="text/javascript">
52
+ jQuery(document).ready(function() {
53
+ jQuery('.colorbox').colorbox({maxWidth:'90%', maxHeight:'90%'});
54
+ });
55
+ </script>
56
+
57
+ <?php
 
 
 
58
  }
59
 
60
  function admin_menu() {
61
+ $this -> check_roles();
62
+ add_menu_page(__('Slideshow', $this -> plugin_name), __('Slideshow', $this -> plugin_name), 'gallery_slides', $this -> sections -> slides, array($this, 'admin_slides'), $this -> url() . '/images/icon.png');
63
+ $this -> menus['slideshow-slides'] = add_submenu_page($this -> sections -> slides, __('Manage Slides', $this -> plugin_name), __('Manage Slides', $this -> plugin_name), 'gallery_slides', $this -> sections -> slides, array($this, 'admin_slides'));
64
+ $this -> menus['slideshow-galleries'] = add_submenu_page($this -> sections -> slides, __('Manage Galleries', $this -> plugin_name), __('Manage Galleries', $this -> plugin_name), 'gallery_galleries', $this -> sections -> galleries, array($this, 'admin_galleries'));
65
+ $this -> menus['slideshow-settings'] = add_submenu_page($this -> sections -> slides, __('Configuration', $this -> plugin_name), __('Configuration', $this -> plugin_name), 'gallery_settings', $this -> sections -> settings, array($this, 'admin_settings'));
66
 
67
  add_action('admin_head-' . $this -> menus['slideshow-settings'], array($this, 'admin_head_gallery_settings'));
68
  }
73
 
74
  function admin_head_gallery_settings() {
75
  add_meta_box('submitdiv', __('Save Settings', $this -> plugin_name), array($this -> Metabox, "settings_submit"), $this -> menus['slideshow-settings'], 'side', 'core');
76
+ add_meta_box('aboutdiv', __('About This Plugin', $this -> plugin_name), array($this -> Metabox, "settings_about"), $this -> menus['slideshow-settings'], 'side', 'core');
77
+ add_meta_box('wprelateddiv', __('WordPress Related', $this -> plugin_name), array($this -> Metabox, "settings_wprelated"), $this -> menus['slideshow-settings'], 'normal', 'core');
78
  add_meta_box('generaldiv', __('General Settings', $this -> plugin_name), array($this -> Metabox, "settings_general"), $this -> menus['slideshow-settings'], 'normal', 'core');
79
  add_meta_box('linksimagesdiv', __('Links &amp; Images Overlay', $this -> plugin_name), array($this -> Metabox, "settings_linksimages"), $this -> menus['slideshow-settings'], 'normal', 'core');
80
  add_meta_box('stylesdiv', __('Appearance &amp; Styles', $this -> plugin_name), array($this -> Metabox, "settings_styles"), $this -> menus['slideshow-settings'], 'normal', 'core');
122
 
123
  // default shortcode parameters
124
  $defaults = array(
125
+ 'source' => "slides",
126
  'gallery_id' => false,
127
  'orderby' => array('order', "ASC"),
128
  'resizeimages' => (($styles['resizeimages'] == "Y") ? "true" : "false"),
129
+ 'imagesoverlay' => (($this -> get_option('imagesthickbox') == "Y") ? "true" : "false"),
130
  'width' => ($styles['width']),
131
  'height' => ($styles['height']),
132
  'auto' => (($this -> get_option('autoslide') == "Y") ? "true" : "false"),
158
  $orderbystring = "ORDER BY RAND()";
159
  } else {
160
  list($orderf, $orderd) = $orderby;
161
+
162
+ if ($orderf == "order") {
163
+ $orderbystring = "ORDER BY " . $this -> GallerySlides -> table . ".order " . $orderd . "";
164
+ } else {
165
+ $orderbystring = "ORDER BY " . $this -> Slide -> table . "." . $orderf . " " . $orderd . "";
166
+ }
167
  }
168
 
169
  $slidesquery = "SELECT * FROM " . $this -> Slide -> table . " LEFT JOIN " . $this -> GallerySlides -> table .
175
  $slides[$skey] -> image_path = 'wp-content/uploads/slideshow-gallery/' . $slide -> image;
176
  }
177
 
178
+ if ($orderby == "random") { shuffle($slides); }
179
  $content = $this -> render('gallery', array('slides' => $slides, 'options' => $s, 'frompost' => false), false, 'default');
180
  }
181
  } elseif (!empty($custom) || empty($post_id)) {
191
  }
192
  }
193
 
194
+ if ($orderby == "random") { shuffle($slides); }
195
  $content = $this -> render('gallery', array('slides' => $slides, 'options' => $s, 'frompost' => false), false, 'default');
196
  } else {
197
  global $post;
212
  }
213
  }
214
 
215
+ if ($orderby == "random") { shuffle($attachments); }
216
  $content = $this -> render('gallery', array('slides' => $attachments, 'options' => $s, 'frompost' => true), false, 'default');
217
  }
218
  }
221
  return $content;
222
  }
223
 
224
+ function admin_slides() {
225
+ global $wpdb;
226
+
227
  switch ($_GET['method']) {
228
  case 'delete' :
229
  if (!empty($_GET['id'])) {
278
  }
279
  break;
280
  case 'order' :
281
+ if (!empty($_GET['gallery_id'])) {
282
+ $gallery = $this -> Gallery -> find(array('id' => $_GET['gallery_id']));
283
+
284
+ $slides = array();
285
+ $gsquery = "SELECT gs.slide_id FROM `" . $this -> GallerySlides -> table . "` gs WHERE `gallery_id` = '" . $gallery -> id . "' ORDER BY gs.order ASC";
286
+ if ($gs = $wpdb -> get_results($gsquery)) {
287
+ foreach ($gs as $galleryslide) {
288
+ $slides[] = $this -> Slide -> find(array('id' => $galleryslide -> slide_id));
289
+ }
290
+ }
291
+
292
+ $this -> render('slides' . DS . 'order', array('gallery' => $gallery, 'slides' => $slides), true, 'admin');
293
+ } else {
294
+ $slides = $this -> Slide -> find_all(null, null, array('order', "ASC"));
295
+ $this -> render('slides' . DS . 'order', array('slides' => $slides), true, 'admin');
296
+ }
297
  break;
298
  default :
299
  $data = $this -> paginate('Slide');
405
  default :
406
  if (!empty($_POST)) {
407
  foreach ($_POST as $pkey => $pval) {
408
+ switch ($pkey) {
409
+ case 'permissions' :
410
+ global $wp_roles;
411
+ $role_names = $wp_roles -> get_names();
412
+
413
+ if (!empty($_POST['permissions'])) {
414
+ $permissions = $_POST['permissions'];
415
+
416
+ foreach ($this -> sections as $section_key => $section_menu) {
417
+ foreach ($role_names as $role_key => $role_name) {
418
+ $wp_roles -> remove_cap($role_key, 'gallery_' . $section_key);
419
+ }
420
+
421
+ if (!empty($permissions[$section_key])) {
422
+ foreach ($permissions[$section_key] as $role) {
423
+ $wp_roles -> add_cap($role, 'gallery_' . $section_key);
424
+ }
425
+ } else {
426
+ /* No roles were selected for this capability, at least add 'administrator' */
427
+ $wp_roles -> add_cap('administrator', 'gallery_' . $section_key);
428
+ $permissions[$section_key][] = 'administrator';
429
+ }
430
+ }
431
+ }
432
+
433
+ $this -> update_option('permissions', $permissions);
434
+ break;
435
+ default :
436
+ $this -> update_option($pkey, $pval);
437
+ break;
438
+ }
439
  }
440
 
441
  $message = __('Configuration has been saved', $this -> plugin_name);
451
 
452
  //initialize a Gallery object
453
  $Gallery = new Gallery();
454
+ register_activation_hook(plugin_basename(__FILE__), array($Gallery, 'initialize_options'));
455
 
456
  if (!function_exists('slideshow')) {
457
  function slideshow($output = true, $gallery_id = null, $post_id = null, $params = array()) {
vendors/timthumb.php CHANGED
@@ -30,7 +30,7 @@ if(! defined('BLOCK_EXTERNAL_LEECHERS') ) define ('BLOCK_EXTERNAL_LEECHERS', fa
30
 
31
  //Image fetching and caching
32
  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
33
- if(! defined('ALLOW_ALL_EXTERNAL_SITES') ) define ('ALLOW_ALL_EXTERNAL_SITES', false); // Less secure.
34
  if(! defined('FILE_CACHE_ENABLED') ) define ('FILE_CACHE_ENABLED', TRUE); // Should we store resized/modified images on disk to speed things up?
35
  if(! defined('FILE_CACHE_TIME_BETWEEN_CLEANS')) define ('FILE_CACHE_TIME_BETWEEN_CLEANS', 86400); // How often the cache is cleaned
36
 
30
 
31
  //Image fetching and caching
32
  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
33
+ if(! defined('ALLOW_ALL_EXTERNAL_SITES') ) define ('ALLOW_ALL_EXTERNAL_SITES', true); // Less secure.
34
  if(! defined('FILE_CACHE_ENABLED') ) define ('FILE_CACHE_ENABLED', TRUE); // Should we store resized/modified images on disk to speed things up?
35
  if(! defined('FILE_CACHE_TIME_BETWEEN_CLEANS')) define ('FILE_CACHE_TIME_BETWEEN_CLEANS', 86400); // How often the cache is cleaned
36
 
views/admin/galleries/index.php CHANGED
@@ -56,6 +56,7 @@
56
  <span class="view"><?php echo $this -> Html -> link(__('View', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=view&amp;id=" . $gallery -> id); ?> |</span>
57
  <span class="edit"><?php echo $this -> Html -> link(__('Edit', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=save&amp;id=" . $gallery -> id); ?> |</span>
58
  <span class="edit"><?php echo $this -> Html -> link(__('Hardcode', $this -> plugin_name), '?page=' . $this -> sections -> galleries . "&amp;method=hardcode&amp;id=" . $gallery -> id); ?> |</span>
 
59
  <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>
60
  </div>
61
  </td>
56
  <span class="view"><?php echo $this -> Html -> link(__('View', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=view&amp;id=" . $gallery -> id); ?> |</span>
57
  <span class="edit"><?php echo $this -> Html -> link(__('Edit', $this -> plugin_name), "?page=" . $this -> sections -> galleries . "&amp;method=save&amp;id=" . $gallery -> id); ?> |</span>
58
  <span class="edit"><?php echo $this -> Html -> link(__('Hardcode', $this -> plugin_name), '?page=' . $this -> sections -> galleries . "&amp;method=hardcode&amp;id=" . $gallery -> id); ?> |</span>
59
+ <span class="edit"><?php echo $this -> Html -> link(__('Order Slides', $this -> plugin_name), '?page=' . $this -> sections -> slides . '&amp;method=order&amp;gallery_id=' . $gallery -> id); ?> |</span>
60
  <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>
61
  </div>
62
  </td>
views/admin/galleries/view.php CHANGED
@@ -15,5 +15,5 @@
15
  </div>
16
  </div>
17
 
18
- <?php $this -> render('slides' . DS . 'loop', array('slides' => $slides, 'paginate' => $paginate), true, 'admin'); ?>
19
  </div>
15
  </div>
16
  </div>
17
 
18
+ <?php $this -> render('slides' . DS . 'loop', array('gallery' => $gallery, 'slides' => $slides, 'paginate' => $paginate), true, 'admin'); ?>
19
  </div>
views/admin/metaboxes/settings-about.php CHANGED
@@ -1,6 +1,9 @@
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>
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://wordpress.org/extend/plugins/slideshow-gallery/" target="_blank">Vote/rate on WordPress.org, please!</a>
6
+ </div>
7
  <div class="misc-pub-section">
8
  <a href="http://docs.tribulant.com/wordpress-slideshow-gallery/1758" target="_blank">Online Documentation</a>
9
  </div>
views/admin/metaboxes/settings-styles.php CHANGED
@@ -5,9 +5,24 @@
5
  <tr>
6
  <th><label for="styles.resizeimages"><?php _e('Resize Images', $this -> plugin_name); ?></label></th>
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>
5
  <tr>
6
  <th><label for="styles.resizeimages"><?php _e('Resize Images', $this -> plugin_name); ?></label></th>
7
  <td>
8
+ <label><input onclick="jQuery('#resizeimagesYdiv').show();" <?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 onclick="jQuery('#resizeimagesYdiv').hide();" <?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
+
12
+ <div id="resizeimagesYdiv" style="display:<?php echo ($styles['resizeimages'] == "Y") ? 'block' : 'none'; ?>;">
13
+ <p>
14
+ <?php _e('When resize images is turned on, TimThumb will be used to resize/crop images.', $this -> plugin_name); ?><br/>
15
+ <?php _e('Below is a test image and the URL to the image to ensure that TimThumb works.', $this -> plugin_name); ?><br/>
16
+ </p>
17
+ <?php
18
+
19
+ $img = 'wp-content/plugins/' . $this -> plugin_name . '/screenshot-1.png';
20
+ $src = site_url() . '/wp-content/plugins/slideshow-gallery/vendors/timthumb.php?src=' . $img . '&w=50&h=50&q=100&a=t';
21
+ echo '<p><a target="_blank" href="' . $src . '">' . $src . '</a> <small>(' . __('click to open to test TimThumb', $this -> plugin_name) . ')</small></p>';
22
+ echo '<p><img src="' . $src . '" /></p>';
23
+
24
+ ?>
25
+ </div>
26
  </td>
27
  </tr>
28
  <tr>
views/admin/metaboxes/settings-wprelated.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ global $user_ID, $wp_roles;
4
+ $permissions = $this -> get_option('permissions');
5
+ $cu = wp_get_current_user();
6
+
7
+ ?>
8
+
9
+ <?php if (!empty($cu -> roles) && in_array('administrator', $cu -> roles)) : ?>
10
+ <table class="form-table">
11
+ <thead>
12
+ <tr>
13
+ <th></th>
14
+ <?php foreach ($wp_roles -> role_names as $role_name) : ?>
15
+ <th style="font-weight:bold; text-align:center;"><?php echo esc_attr(stripslashes($role_name)); ?></th>
16
+ <?php endforeach; ?>
17
+ </tr>
18
+ </thead>
19
+ <tbody>
20
+ <?php $class = false; ?>
21
+ <?php foreach ($this -> sections as $section_key => $section_menu) : ?>
22
+ <tr class="<?php echo $class = (empty($class)) ? 'arow' : ''; ?>">
23
+ <th style="white-space:nowrap; text-align:right;"><label for="perm_<?php echo $section_key; ?>"><?php echo GalleryHtmlHelper::section_name($section_key); ?></label></th>
24
+ <?php foreach ($wp_roles -> role_names as $role_key => $role_name) : ?>
25
+ <td style="text-align:center;"><label><input <?php echo (!empty($permissions[$section_key]) && in_array($role_key, $permissions[$section_key])) ? 'checked="checked"' : ''; ?> type="checkbox" name="permissions[<?php echo $section_key; ?>][]" value="<?php echo esc_attr(stripslashes($role_key)); ?>" id="<?php echo $section_key; ?>_<?php echo $role_key; ?>" /></label></td>
26
+ <?php endforeach; ?>
27
+ </tr>
28
+ <?php endforeach; ?>
29
+ </tbody>
30
+ </table>
31
+ <?php else : ?>
32
+ <p class="howto"><?php _e('Only the administrator role can edit roles/permissions.', $this -> plugin_name); ?>
33
+ <?php endif; ?>
views/admin/settings.php CHANGED
@@ -26,7 +26,6 @@ wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
26
  <?php do_meta_boxes($this -> menus['slideshow-settings'], 'normal', $post); ?>
27
  </div>
28
  </div>
29
- <br class="clear" />
30
  </div>
31
  </form>
32
  </div>
26
  <?php do_meta_boxes($this -> menus['slideshow-settings'], 'normal', $post); ?>
27
  </div>
28
  </div>
 
29
  </div>
30
  </form>
31
  </div>
views/admin/slides/loop.php CHANGED
@@ -2,7 +2,11 @@
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>
@@ -45,7 +49,7 @@
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>
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
+ <?php if (!empty($_GET['page']) && $_GET['page'] == $this -> sections -> galleries) : ?>
6
+ <a href="?page=<?php echo $this -> sections -> slides; ?>&amp;method=order&amp;gallery_id=<?php echo $gallery -> id; ?>" class="button"><?php _e('Order Slides', $this -> plugin_name); ?></a>
7
+ <?php else : ?>
8
+ <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>
9
+ <?php endif; ?>
10
 
11
  <select name="action" class="action">
12
  <option value=""><?php _e('- Bulk Actions -', $this -> plugin_name); ?></option>
49
  <td><?php echo $slide -> id; ?></td>
50
  <td style="width:75px;">
51
  <?php $image = $slide -> image; ?>
52
+ <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, 40, 40, 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" /></a>
53
  </td>
54
  <td>
55
  <a class="row-title" href="<?php echo $this -> url; ?>&amp;method=save&amp;id=<?php echo $slide -> id; ?>" title=""><?php echo $slide -> title; ?></a>
views/admin/slides/order.php CHANGED
@@ -3,54 +3,58 @@
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">
9
  <a href="<?php echo $this -> url; ?>"><?php _e('&larr; Manage All Slides', $this -> plugin_name); ?></a>
10
  </div>
11
 
12
  <?php if (!empty($slides)) : ?>
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() {
 
 
 
 
 
 
 
 
 
27
  jQuery("ul#slidelist").sortable({
 
 
 
28
  start: function(request) {
 
29
  jQuery("#slidemessage").slideUp();
30
  },
31
  stop: function(request) {
32
- jQuery("#slidemessage").load(GalleryAjax + "?cmd=slides_order", jQuery("ul#slidelist").sortable('serialize')).slideDown("slow");
33
- },
34
- axis: "y"
 
35
  });
36
  });
37
  </script>
38
-
39
- <style type="text/css">
40
- #slidelist li.lineitem {
41
- list-style: none;
42
- margin: 3px 0px !important;
43
- padding: 2px 5px 2px 5px;
44
- background-color: #F1F1F1 !important;
45
- border:1px solid #B2B2B2;
46
- cursor: move;
47
- vertical-align: middle !important;
48
- display: block;
49
- clear: both;
50
- -moz-border-radius: 4px;
51
- -webkit-border-radius: 4px;
52
- }
53
- </style>
54
  <?php else : ?>
55
  <p style="color:red;"><?php _e('No slides found', $this -> plugin_name); ?></p>
56
  <?php endif; ?>
3
  <img src="<?php echo $this -> url(); ?>/images/icon-32.png" />
4
  </div>
5
 
6
+ <h2><?php _e('Order Slides', $this -> plugin_name); ?><?php echo (!empty($gallery)) ? ': ' . $gallery -> title : ''; ?></h2>
7
 
8
  <div style="float:none;" class="subsubsub">
9
  <a href="<?php echo $this -> url; ?>"><?php _e('&larr; Manage All Slides', $this -> plugin_name); ?></a>
10
  </div>
11
 
12
  <?php if (!empty($slides)) : ?>
13
+ <div id="slidemessage" class="updated fade" style="display:none; width:31%;"><!-- message will go here --></div>
14
+ <div class="gallery_slides_list">
15
+ <span class="gallery_slides_convert_list"><a href="#" id="gallery_convert_list"><?php _e('List', $this -> plugin_name); ?></a></span>
16
+ <span class="gallery_slides_convert_grid"><a href="#" id="gallery_convert_grid"><?php _e('Grid', $this -> plugin_name); ?></a></span>
17
+ <br class="clear" />
18
+ <ul id="slidelist">
19
+ <?php foreach ($slides as $slide) : ?>
20
+ <li class="gallerylineitem" id="item_<?php echo $slide -> id; ?>">
21
+ <?php /*<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>
22
+ <h4><?php echo $slide -> title; ?></h4>
23
+ <hr class="clear" style="clear:both; visibility:hidden; height:1px; display:block;" />*/ ?>
24
+ <span class="gallery_slide_image" style="display:none;"><img src="<?php echo $this -> Html -> timthumb_image_src($slide -> image_path, 89, 89, 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> title); ?>" /></span>
25
+ <span class="gallery_slide_title"><?php echo __($slide -> title); ?></span>
26
+ </li>
27
+ <?php endforeach; ?>
28
+ </ul>
29
+ </div>
30
 
31
  <script type="text/javascript">
32
+ var request_slides = false;
33
+ jQuery(document).ready(function() {
34
+ jQuery('#gallery_convert_list').click(function() {
35
+ jQuery('.gallery_slides_grid').removeClass('gallery_slides_grid').addClass('gallery_slides_list');
36
+ });
37
+
38
+ jQuery('#gallery_convert_grid').click(function() {
39
+ jQuery('.gallery_slides_list').removeClass('gallery_slides_list').addClass('gallery_slides_grid');
40
+ });
41
+
42
  jQuery("ul#slidelist").sortable({
43
+ placeholder: "gallery-placeholder",
44
+ revert: 100,
45
+ distance: 5,
46
  start: function(request) {
47
+ if (request_slides) { request_slides.abort(); }
48
  jQuery("#slidemessage").slideUp();
49
  },
50
  stop: function(request) {
51
+ jQuery.post(GalleryAjax + '?cmd=slides_order<?php echo (!empty($gallery)) ? '&gallery_id=' . $gallery -> id : ''; ?>', jQuery('#slidelist').sortable('serialize'), function(response) {
52
+ jQuery('#slidemessage').html('<p>' + response + '</p>').fadeIn();
53
+ });
54
+ }
55
  });
56
  });
57
  </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  <?php else : ?>
59
  <p style="color:red;"><?php _e('No slides found', $this -> plugin_name); ?></p>
60
  <?php endif; ?>
views/default/gallery.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
 
3
- $rand = 's' . rand(1,99) . 'w';
4
- $wrapperid = "slideshow-wrapper-" . $rand;
5
  $slides = stripslashes_deep($slides);
6
 
7
  ?>
8
 
9
  <?php if (!empty($slides)) : ?>
10
  <ul id="slideshow" class="slideshow" style="display:none;">
 
11
  <?php if ($frompost) : ?>
12
  <?php foreach ($slides as $slide) : ?>
13
  <li>
@@ -33,6 +33,7 @@ $slides = stripslashes_deep($slides);
33
  <?php endif; ?>
34
  </li>
35
  <?php endforeach; ?>
 
36
  <?php else : ?>
37
  <?php foreach ($slides as $slide) : ?>
38
  <li>
@@ -50,7 +51,13 @@ $slides = stripslashes_deep($slides);
50
  <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); ?>" />
51
  <?php endif; ?>
52
  <?php else : ?>
53
- <a href="<?php echo $slide -> link; ?>" title="<?php echo $slide -> title; ?>"></a>
 
 
 
 
 
 
54
  <?php endif; ?>
55
  </li>
56
  <?php endforeach; ?>
@@ -59,30 +66,30 @@ $slides = stripslashes_deep($slides);
59
 
60
  <div id="<?php echo $wrapperid; ?>">
61
  <?php if ($options['showthumbs'] == "true" && $options['thumbsposition'] == "top") : ?>
62
- <div id="thumbnails<?php echo $rand; ?>" class="thumbstop">
63
- <div id="slideleft<?php echo $rand; ?>" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
64
- <div id="slidearea<?php echo $rand; ?>">
65
- <div id="slider<?php echo $rand; ?>"></div>
66
  </div>
67
- <div id="slideright<?php echo $rand; ?>" title="<?php _e('Slide Right', $this -> plugin_name); ?>"></div>
68
  <br style="clear:both; visibility:hidden; height:1px;" />
69
  </div>
70
  <?php endif; ?>
71
 
72
- <div id="fullsize<?php echo $rand; ?>">
73
  <?php $navb = false; $navf = false; ?>
74
  <?php if ($options['shownav'] == "true" && count($slides) > 1) : ?>
75
- <?php $navb = "imgprev" . $rand; ?>
76
- <div id="imgprev<?php echo $rand; ?>" class="imgnav" title="<?php _e('Previous Image', $this -> plugin_name); ?>"></div>
77
  <?php endif; ?>
78
- <div id="imglink<?php echo $rand; ?>" class="imglink"><!-- link --></div>
79
  <?php if ($options['shownav'] == "true" && count($slides) > 1) : ?>
80
- <?php $navf = "imgnext" . $rand; ?>
81
- <div id="imgnext<?php echo $rand; ?>" class="imgnav" title="<?php _e('Next Image', $this -> plugin_name); ?>"></div>
82
  <?php endif; ?>
83
- <div id="image<?php echo $rand; ?>"></div>
84
  <?php if ($options['showinfo'] == "true") : ?>
85
- <div id="information<?php echo $rand; ?>">
86
  <h3></h3>
87
  <p></p>
88
  </div>
@@ -90,12 +97,12 @@ $slides = stripslashes_deep($slides);
90
  </div>
91
 
92
  <?php if ($options['showthumbs'] == "true" && $options['thumbsposition'] == "bottom") : ?>
93
- <div id="thumbnails<?php echo $rand; ?>" class="thumbsbot">
94
- <div id="slideleft<?php echo $rand; ?>" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
95
- <div id="slidearea<?php echo $rand; ?>">
96
- <div id="slider<?php echo $rand; ?>"></div>
97
  </div>
98
- <div id="slideright<?php echo $rand; ?>" title="<?php _e('Slide Right', $this -> plugin_name); ?>"></div>
99
  <br style="clear:both; visibility:hidden; height:1px;" />
100
  </div>
101
  <?php endif; ?>
@@ -106,9 +113,8 @@ $slides = stripslashes_deep($slides);
106
  tid('slideshow').style.display = "none";
107
  tid('<?php echo $wrapperid; ?>').style.display = 'block';
108
  tid('<?php echo $wrapperid; ?>').style.visibility = 'hidden';
109
- // append the spinner
110
- jQuery("#fullsize<?php echo $rand; ?>").append('<div id="spinner<?php echo $rand; ?>"><img src="<?php echo $this -> url(); ?>/images/spinner.gif"></div>');
111
- tid('spinner<?php echo $rand; ?>').style.visibility = 'visible';
112
 
113
  var slideshow = new TINY.slideshow("slideshow");
114
  jQuery(document).ready(function() {
@@ -120,18 +126,19 @@ $slides = stripslashes_deep($slides);
120
  slideshow.navHover = <?php echo $options['navhoveropacity']; ?>;
121
  slideshow.letterbox = "#000000";
122
  slideshow.linkclass = "linkhover";
123
- slideshow.info = "<?php echo ($options['showinfo'] == "true") ? 'information' . $rand : ''; ?>";
124
  slideshow.infoSpeed = <?php echo $options['infospeed']; ?>;
125
- slideshow.thumbs = "<?php echo ($options['showthumbs'] == "true") ? 'slider' . $rand : ''; ?>";
126
  slideshow.thumbOpacity = <?php echo $this -> get_option('thumbopacity'); ?>;
127
- slideshow.left = "slideleft<?php echo $rand; ?>";
128
- slideshow.right = "slideright<?php echo $rand; ?>";
129
  slideshow.scrollSpeed = <?php echo $options['thumbsspeed']; ?>;
130
  slideshow.spacing = <?php echo $options['thumbsspacing']; ?>;
131
  slideshow.active = "<?php echo $options['thumbsborder']; ?>";
132
- slideshow.imagesthickbox = "<?php echo ($this -> get_option('imagesthickbox') == "Y") ? 'true' : 'false'; ?>";
133
- jQuery("#spinner<?php echo $rand; ?>").remove();
134
- slideshow.init("slideshow","image<?php echo $rand; ?>","<?php echo $navb; ?>","<?php echo $navf; ?>","imglink<?php echo $rand; ?>");
 
135
  tid('<?php echo $wrapperid; ?>').style.visibility = 'visible';
136
  }
137
  });
@@ -139,7 +146,6 @@ $slides = stripslashes_deep($slides);
139
 
140
  <?php
141
 
142
- $cssattr['wrapperrand'] = $rand;
143
  $cssattr['wrapperid'] = $wrapperid;
144
  $cssattr['resizeimages'] = (($options['resizeimages'] == "true") ? "Y" : "N");
145
  $cssattr['width'] = $options['width'];
@@ -155,8 +161,10 @@ $slides = stripslashes_deep($slides);
155
 
156
  <!--[if IE 6]>
157
  <style type="text/css">
158
- .imglink, #imglink<?php echo $rand; ?> { display: none !important; }
159
  .linkhover { display: none !important; }
160
  </style>
161
  <![endif]-->
 
 
162
  <?php endif; ?>
1
  <?php
2
 
3
+ $wrapperid = "slideshow-wrapper";
 
4
  $slides = stripslashes_deep($slides);
5
 
6
  ?>
7
 
8
  <?php if (!empty($slides)) : ?>
9
  <ul id="slideshow" class="slideshow" style="display:none;">
10
+ <!-- From a WordPress post/page -->
11
  <?php if ($frompost) : ?>
12
  <?php foreach ($slides as $slide) : ?>
13
  <li>
33
  <?php endif; ?>
34
  </li>
35
  <?php endforeach; ?>
36
+ <!-- From all slides or gallery slides -->
37
  <?php else : ?>
38
  <?php foreach ($slides as $slide) : ?>
39
  <li>
51
  <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); ?>" />
52
  <?php endif; ?>
53
  <?php else : ?>
54
+ <?php if ($slide -> uselink == "Y" && !empty($slide -> link)) : ?>
55
+ <a href="<?php echo $slide -> link; ?>" target="_<?php echo $slide -> linktarget; ?>" title="<?php echo $slide -> title; ?>"></a>
56
+ <?php elseif ($options['imagesoverlay'] == "true") : ?>
57
+ <a href="<?php echo site_url('/') . $slide -> image_path; ?>" target="_<?php echo $slide -> linktarget; ?>" title="<?php echo $slide -> title; ?>"></a>
58
+ <?php else : ?>
59
+ <a></a>
60
+ <?php endif; ?>
61
  <?php endif; ?>
62
  </li>
63
  <?php endforeach; ?>
66
 
67
  <div id="<?php echo $wrapperid; ?>">
68
  <?php if ($options['showthumbs'] == "true" && $options['thumbsposition'] == "top") : ?>
69
+ <div id="thumbnails" class="thumbstop">
70
+ <div id="slideleft" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
71
+ <div id="slidearea">
72
+ <div id="slider"></div>
73
  </div>
74
+ <div id="slideright" title="<?php _e('Slide Right', $this -> plugin_name); ?>"></div>
75
  <br style="clear:both; visibility:hidden; height:1px;" />
76
  </div>
77
  <?php endif; ?>
78
 
79
+ <div id="fullsize">
80
  <?php $navb = false; $navf = false; ?>
81
  <?php if ($options['shownav'] == "true" && count($slides) > 1) : ?>
82
+ <?php $navb = "imgprev"; ?>
83
+ <div id="imgprev" class="imgnav" title="<?php _e('Previous Image', $this -> plugin_name); ?>"></div>
84
  <?php endif; ?>
85
+ <div id="imglink" class="imglink"><!-- link --></div>
86
  <?php if ($options['shownav'] == "true" && count($slides) > 1) : ?>
87
+ <?php $navf = "imgnext"; ?>
88
+ <div id="imgnext" class="imgnav" title="<?php _e('Next Image', $this -> plugin_name); ?>"></div>
89
  <?php endif; ?>
90
+ <div id="image"></div>
91
  <?php if ($options['showinfo'] == "true") : ?>
92
+ <div id="information">
93
  <h3></h3>
94
  <p></p>
95
  </div>
97
  </div>
98
 
99
  <?php if ($options['showthumbs'] == "true" && $options['thumbsposition'] == "bottom") : ?>
100
+ <div id="thumbnails" class="thumbsbot">
101
+ <div id="slideleft" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
102
+ <div id="slidearea">
103
+ <div id="slider"></div>
104
  </div>
105
+ <div id="slideright" title="<?php _e('Slide Right', $this -> plugin_name); ?>"></div>
106
  <br style="clear:both; visibility:hidden; height:1px;" />
107
  </div>
108
  <?php endif; ?>
113
  tid('slideshow').style.display = "none";
114
  tid('<?php echo $wrapperid; ?>').style.display = 'block';
115
  tid('<?php echo $wrapperid; ?>').style.visibility = 'hidden';
116
+ jQuery("#fullsize").append('<div id="spinner"><img src="<?php echo $this -> url(); ?>/images/spinner.gif"></div>');
117
+ tid('spinner').style.visibility = 'visible';
 
118
 
119
  var slideshow = new TINY.slideshow("slideshow");
120
  jQuery(document).ready(function() {
126
  slideshow.navHover = <?php echo $options['navhoveropacity']; ?>;
127
  slideshow.letterbox = "#000000";
128
  slideshow.linkclass = "linkhover";
129
+ slideshow.info = "<?php echo ($options['showinfo'] == "true") ? 'information' : ''; ?>";
130
  slideshow.infoSpeed = <?php echo $options['infospeed']; ?>;
131
+ slideshow.thumbs = "<?php echo ($options['showthumbs'] == "true") ? 'slider' : ''; ?>";
132
  slideshow.thumbOpacity = <?php echo $this -> get_option('thumbopacity'); ?>;
133
+ slideshow.left = "slideleft";
134
+ slideshow.right = "slideright";
135
  slideshow.scrollSpeed = <?php echo $options['thumbsspeed']; ?>;
136
  slideshow.spacing = <?php echo $options['thumbsspacing']; ?>;
137
  slideshow.active = "<?php echo $options['thumbsborder']; ?>";
138
+ slideshow.imagesthickbox = "<?php echo $options['imagesoverlay']; ?>";
139
+ console.log(slideshow.imagesthickbox);
140
+ jQuery("#spinner").remove();
141
+ slideshow.init("slideshow","image","<?php echo $navb; ?>","<?php echo $navf; ?>","imglink");
142
  tid('<?php echo $wrapperid; ?>').style.visibility = 'visible';
143
  }
144
  });
146
 
147
  <?php
148
 
 
149
  $cssattr['wrapperid'] = $wrapperid;
150
  $cssattr['resizeimages'] = (($options['resizeimages'] == "true") ? "Y" : "N");
151
  $cssattr['width'] = $options['width'];
161
 
162
  <!--[if IE 6]>
163
  <style type="text/css">
164
+ .imglink, #imglink { display: none !important; }
165
  .linkhover { display: none !important; }
166
  </style>
167
  <![endif]-->
168
+ <?php else : ?>
169
+ <?php _e('No slides are available.', $this -> plugin_name); ?>
170
  <?php endif; ?>