Version Description
- ADDED: Default, English language file in the
languages
folder. - ADDED: Configuration setting to turn On/Off resizing of images via CSS.
- ADDED: Webkit border radius in CSS for thumbnail images.
- ADDED:
post_id
parameter for the[slideshow]
shortcode to display images from a post/page. - IMPROVED: Plugin doesn't utilize PHP short open tags anymore.
- COMPATIBILITY: Removed
autoLoad
(introduced in PHP 5) parameter fromclass_exists
function for PHP 4 compatibility. - IMPROVED: Directory separator constant DS from DIRECTORY_SEPARATOR.
Download this release
Release Info
Developer | contrid |
Plugin | Slideshow Gallery |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.0.3
- css/gallery-css.php +11 -11
- helpers/db.php +281 -281
- helpers/form.php +4 -4
- helpers/html.php +1 -1
- languages/slideshow-gallery-en_US.mo +0 -0
- languages/slideshow-gallery-en_US.po +402 -0
- readme.txt +55 -0
- trunk/screenshot-1.png → screenshot-1.png +0 -0
- trunk/screenshot-2.png → screenshot-2.png +0 -0
- trunk/screenshot-3.png → screenshot-3.png +0 -0
- trunk/screenshot-4.png → screenshot-4.png +0 -0
- slideshow-gallery-ajax.php +2 -1
- slideshow-gallery-plugin.php +28 -18
- slideshow-gallery.php +37 -23
- trunk/css/gallery-css.php +0 -32
- trunk/helpers/db.php +0 -282
- trunk/helpers/form.php +0 -89
- trunk/helpers/html.php +0 -177
- trunk/helpers/metabox.php +0 -25
- trunk/images/icon.png +0 -0
- trunk/images/left.gif +0 -0
- trunk/images/link.gif +0 -0
- trunk/images/right.gif +0 -0
- trunk/images/scroll-left.gif +0 -0
- trunk/images/scroll-right.gif +0 -0
- trunk/js/admin.js +0 -22
- trunk/js/gallery.js +0 -178
- trunk/models/slide.php +0 -98
- trunk/readme.txt +0 -46
- trunk/slideshow-gallery-ajax.php +0 -35
- trunk/slideshow-gallery-plugin.php +0 -472
- trunk/slideshow-gallery.php +0 -161
- trunk/vendors/class.paginate.php +0 -216
- trunk/views/admin/err-top.php +0 -5
- trunk/views/admin/head.php +0 -3
- trunk/views/admin/metaboxes/settings-general.php +0 -126
- trunk/views/admin/metaboxes/settings-styles.php +0 -44
- trunk/views/admin/metaboxes/settings-submit.php +0 -17
- trunk/views/admin/msg-top.php +0 -5
- trunk/views/admin/paginate.php +0 -5
- trunk/views/admin/settings.php +0 -28
- trunk/views/admin/slides/index.php +0 -68
- trunk/views/admin/slides/order.php +0 -49
- trunk/views/admin/slides/save.php +0 -42
- trunk/views/default/gallery.php +0 -85
- views/admin/err-top.php +1 -1
- views/admin/head.php +1 -1
- views/admin/metaboxes/settings-general.php +20 -20
- views/admin/metaboxes/settings-styles.php +14 -6
- views/admin/metaboxes/settings-submit.php +1 -1
- views/admin/msg-top.php +1 -1
- views/admin/paginate.php +1 -1
- views/admin/settings.php +6 -2
- views/admin/slides/index.php +58 -56
- views/admin/slides/order.php +8 -4
- views/admin/slides/save.php +10 -10
- views/default/gallery.php +47 -26
css/gallery-css.php
CHANGED
@@ -7,18 +7,18 @@
|
|
7 |
|
8 |
#slideshow { list-style:none; color:#fff; }
|
9 |
#slideshow span { display:none; }
|
10 |
-
#wrapper { width
|
11 |
#wrapper * { margin:0; padding:0; }
|
12 |
-
#fullsize { position:relative; overflow:hidden; width
|
13 |
-
#information { position:absolute; bottom:0; width
|
14 |
-
#information h3 { color
|
15 |
-
#information p { color
|
16 |
-
#image { width
|
17 |
-
|
18 |
-
.imgnav { position:absolute; width:25%; height
|
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; height
|
22 |
.linkhover { background:url('../images/link.gif') center center no-repeat; }
|
23 |
#thumbnails { }
|
24 |
.thumbstop { margin-bottom:15px !important; }
|
@@ -27,6 +27,6 @@
|
|
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
|
31 |
#slider { position:absolute; left:0; height:81px; }
|
32 |
-
#slider img { cursor:pointer; border:1px solid #666; padding:2px; -moz-border-radius
|
7 |
|
8 |
#slideshow { list-style:none; color:#fff; }
|
9 |
#slideshow span { display:none; }
|
10 |
+
#wrapper { width:<?php echo ((int) $styles['width'] - 6); ?>px; background:<?php echo $styles['background']; ?>; padding:2px; border:<?php echo $styles['border']; ?>; margin:25px auto; display:none; }
|
11 |
#wrapper * { margin:0; padding:0; }
|
12 |
+
#fullsize { position:relative; overflow:hidden; width:<?php echo ((int) $styles['width'] - 6); ?>px; height:<?php echo $styles['height']; ?>px; }
|
13 |
+
#information { 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; font-size:14px; }
|
15 |
+
#information p { color:<?php echo $styles['infocolor']; ?>; padding:0 8px 8px; }
|
16 |
+
#image { width:<?php echo ((int) $styles['width'] - 6); ?>px; }
|
17 |
+
<?php if (empty($styles['resizeimages']) || $styles['resizeimages'] == "Y") : ?>#image img { position:absolute; border:none; width:<?php echo ((int) $styles['width'] - 6); ?>px; }<?php else : ?>#image img { position:absolute; border:none; width:auto; }<?php endif; ?>
|
18 |
+
.imgnav { position:absolute; width:25%; height:<?php echo ((int) $styles['height'] + 6); ?>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; height:<?php echo ((int) $styles['height'] + 6); ?>px; width:100%; z-index:100; opacity:.4; filter:alpha(opacity=40); }
|
22 |
.linkhover { background:url('../images/link.gif') center center no-repeat; }
|
23 |
#thumbnails { }
|
24 |
.thumbstop { margin-bottom:15px !important; }
|
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'] - 55); ?>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; }
|
helpers/db.php
CHANGED
@@ -1,282 +1,282 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class GalleryDbHelper extends GalleryPlugin {
|
4 |
-
|
5 |
-
var $name = 'Db';
|
6 |
-
|
7 |
-
function find($conditions = array(), $fields = false, $order = array('id', "DESC"), $assign = true, $atts = array()) {
|
8 |
-
global $wpdb;
|
9 |
-
|
10 |
-
$newfields = "*";
|
11 |
-
|
12 |
-
if (!empty($fields)) {
|
13 |
-
if (is_array($fields)) {
|
14 |
-
$newfields = "";
|
15 |
-
$f = 1;
|
16 |
-
|
17 |
-
foreach ($fields as $field) {
|
18 |
-
$newfields .= "`" . $field . "`";
|
19 |
-
|
20 |
-
if ($f < count($fields)) {
|
21 |
-
$newfields .= ", ";
|
22 |
-
}
|
23 |
-
|
24 |
-
$f++;
|
25 |
-
}
|
26 |
-
} else {
|
27 |
-
$newfields = $fields;
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
$query = "SELECT " . $newfields . " FROM `" . $this -> table . "`";
|
32 |
-
|
33 |
-
if (!empty($conditions) && is_array($conditions)) {
|
34 |
-
$query .= " WHERE";
|
35 |
-
$c = 1;
|
36 |
-
|
37 |
-
foreach ($conditions as $ckey => $cval) {
|
38 |
-
$query .= " `" . $ckey . "` = '" . $cval . "'";
|
39 |
-
|
40 |
-
if ($c < count($conditions)) {
|
41 |
-
$query .= " AND";
|
42 |
-
}
|
43 |
-
|
44 |
-
$c++;
|
45 |
-
}
|
46 |
-
}
|
47 |
-
|
48 |
-
$order = (empty($order)) ? array('id', "DESC") : $order;
|
49 |
-
list($ofield, $odir) = $order;
|
50 |
-
$query .= " ORDER BY `" . $ofield . "` " . $odir . "";
|
51 |
-
$query .= " LIMIT 1";
|
52 |
-
|
53 |
-
if ($record = $wpdb -> get_row($query)) {
|
54 |
-
if (!empty($record)) {
|
55 |
-
$data = $this -> init_class($this -> model, $record);
|
56 |
-
|
57 |
-
if ($assign == true) {
|
58 |
-
$this -> data = $data;
|
59 |
-
}
|
60 |
-
|
61 |
-
return $data;
|
62 |
-
}
|
63 |
-
}
|
64 |
-
|
65 |
-
return false;
|
66 |
-
}
|
67 |
-
|
68 |
-
function find_all($conditions = array(), $fields = false, $order = array('id', "DESC"), $limit = false, $assign = false, $distinct = false) {
|
69 |
-
global $wpdb;
|
70 |
-
|
71 |
-
$newfields = "*";
|
72 |
-
if (!empty($fields) && !is_array($fields)) { $newfields = $fields; }
|
73 |
-
$distinct = (!empty($distinct)) ? "DISTINCT " : "";
|
74 |
-
|
75 |
-
$query = "SELECT " . $distinct . $newfields . " FROM `" . $this -> table . "`";
|
76 |
-
|
77 |
-
if (!empty($conditions) && is_array($conditions)) {
|
78 |
-
$query .= " WHERE";
|
79 |
-
$c = 1;
|
80 |
-
|
81 |
-
foreach ($conditions as $ckey => $cval) {
|
82 |
-
$query .= " `" . $ckey . "` = '" . $cval . "'";
|
83 |
-
|
84 |
-
if ($c < count($conditions)) {
|
85 |
-
$query .= " AND";
|
86 |
-
}
|
87 |
-
|
88 |
-
$c++;
|
89 |
-
}
|
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)) {
|
98 |
-
if (!empty($records)) {
|
99 |
-
$data = array();
|
100 |
-
|
101 |
-
foreach ($records as $record) {
|
102 |
-
$data[] = $this -> init_class($this -> model, $record);
|
103 |
-
}
|
104 |
-
|
105 |
-
if ($assign == true) {
|
106 |
-
$this -> data = $data;
|
107 |
-
}
|
108 |
-
|
109 |
-
return $data;
|
110 |
-
}
|
111 |
-
}
|
112 |
-
|
113 |
-
return false;
|
114 |
-
}
|
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')) {
|
127 |
-
$this -> validate($r);
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
if (empty($this -> errors)) {
|
132 |
-
switch ($this -> model) {
|
133 |
-
case 'Slide' :
|
134 |
-
$this -> data -> image = basename($this -> data -> image_url);
|
135 |
-
break;
|
136 |
-
}
|
137 |
-
|
138 |
-
//the MySQL query
|
139 |
-
$query = (empty($this -> data -> id)) ? $this -> insert_query($this -> model) : $this -> update_query($this -> model);
|
140 |
-
|
141 |
-
if ($wpdb -> query($query)) {
|
142 |
-
$this -> insertid = $insertid = (empty($this -> data -> id)) ? $wpdb -> insert_id : $this -> data -> id;
|
143 |
-
return true;
|
144 |
-
}
|
145 |
-
}
|
146 |
-
|
147 |
-
return false;
|
148 |
-
}
|
149 |
-
|
150 |
-
function save_field($field = null, $value = null, $conditions = array()) {
|
151 |
-
if (!empty($this -> model)) {
|
152 |
-
global $wpdb;
|
153 |
-
|
154 |
-
if (!empty($field)) {
|
155 |
-
$query = "UPDATE `" . $this -> table . "` SET `" . $field . "` = '" . $value . "'";
|
156 |
-
|
157 |
-
if (!empty($conditions) && is_array($conditions)) {
|
158 |
-
$query .= " WHERE";
|
159 |
-
$c = 1;
|
160 |
-
|
161 |
-
foreach ($conditions as $ckey => $cval) {
|
162 |
-
$query .= " `" . $ckey . "` = '" . $cval . "'";
|
163 |
-
|
164 |
-
if ($c < count($conditions)) {
|
165 |
-
$query .= " AND";
|
166 |
-
}
|
167 |
-
|
168 |
-
$c++;
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
if ($wpdb -> query($query)) {
|
173 |
-
return true;
|
174 |
-
}
|
175 |
-
}
|
176 |
-
}
|
177 |
-
|
178 |
-
return false;
|
179 |
-
}
|
180 |
-
|
181 |
-
function delete($record_id = '') {
|
182 |
-
global $wpdb;
|
183 |
-
|
184 |
-
if (!empty($record_id) && $record = $this -> find(array('id' => $record_id))) {
|
185 |
-
$query = "DELETE FROM `" . $this -> table . "` WHERE `id` = '" . $record_id . "' LIMIT 1";
|
186 |
-
|
187 |
-
if ($wpdb -> query($query)) {
|
188 |
-
//do nothing...
|
189 |
-
return true;
|
190 |
-
}
|
191 |
-
}
|
192 |
-
|
193 |
-
return false;
|
194 |
-
}
|
195 |
-
|
196 |
-
function insert_query($model = '') {
|
197 |
-
if (!empty($model)) {
|
198 |
-
global $wpdb;
|
199 |
-
|
200 |
-
if (!empty($this -> data)) {
|
201 |
-
if (empty($this -> data -> id)) {
|
202 |
-
$query1 = "INSERT INTO `" . $this -> table . "` (";
|
203 |
-
$query2 = "";
|
204 |
-
$c = 1;
|
205 |
-
unset($this -> fields['key']);
|
206 |
-
|
207 |
-
foreach (array_keys($this -> fields) as $field) {
|
208 |
-
if (!empty($this -> data -> {$field}) || $this -> data -> {$field} == "0") {
|
209 |
-
if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
|
210 |
-
$value = serialize($this -> data -> {$field});
|
211 |
-
} else {
|
212 |
-
$value = mysql_escape_string($this -> data -> {$field});
|
213 |
-
}
|
214 |
-
|
215 |
-
$query1 .= "`" . $field . "`";
|
216 |
-
$query2 .= "'" . $value . "'";
|
217 |
-
|
218 |
-
if ($c < count($this -> fields)) {
|
219 |
-
$query1 .= ", ";
|
220 |
-
$query2 .= ", ";
|
221 |
-
}
|
222 |
-
}
|
223 |
-
|
224 |
-
$c++;
|
225 |
-
}
|
226 |
-
|
227 |
-
$query1 .= ") VALUES (";
|
228 |
-
$query = $query1 . "" . $query2 . ");";
|
229 |
-
|
230 |
-
return $query;
|
231 |
-
} else {
|
232 |
-
$query = $this -> update_query($model);
|
233 |
-
|
234 |
-
return $query;
|
235 |
-
}
|
236 |
-
}
|
237 |
-
}
|
238 |
-
|
239 |
-
return false;
|
240 |
-
}
|
241 |
-
|
242 |
-
function update_query($model = '') {
|
243 |
-
if (!empty($model)) {
|
244 |
-
global $wpdb;
|
245 |
-
|
246 |
-
if (!empty($this -> data)) {
|
247 |
-
$query = "UPDATE `" . $this -> table . "` SET ";
|
248 |
-
$c = 1;
|
249 |
-
|
250 |
-
unset($this -> fields['id']);
|
251 |
-
unset($this -> fields['key']);
|
252 |
-
unset($this -> fields['created']);
|
253 |
-
|
254 |
-
foreach (array_keys($this -> fields) as $field) {
|
255 |
-
//if (!empty($this -> data -> {$field}) || $this -> data -> {$field} == "0") {
|
256 |
-
if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
|
257 |
-
$value = serialize($this -> data -> {$field});
|
258 |
-
} else {
|
259 |
-
$value = mysql_escape_string($this -> data -> {$field});
|
260 |
-
}
|
261 |
-
|
262 |
-
$query .= "`" . $field . "` = '" . $value . "'";
|
263 |
-
|
264 |
-
if ($c < count($this -> fields)) {
|
265 |
-
$query .= ", ";
|
266 |
-
}
|
267 |
-
//}
|
268 |
-
|
269 |
-
$c++;
|
270 |
-
}
|
271 |
-
|
272 |
-
$query .= " WHERE `id` = '" . $this -> data -> id . "' LIMIT 1";
|
273 |
-
|
274 |
-
return $query;
|
275 |
-
}
|
276 |
-
}
|
277 |
-
|
278 |
-
return false;
|
279 |
-
}
|
280 |
-
}
|
281 |
-
|
282 |
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class GalleryDbHelper extends GalleryPlugin {
|
4 |
+
|
5 |
+
var $name = 'Db';
|
6 |
+
|
7 |
+
function find($conditions = array(), $fields = false, $order = array('id', "DESC"), $assign = true, $atts = array()) {
|
8 |
+
global $wpdb;
|
9 |
+
|
10 |
+
$newfields = "*";
|
11 |
+
|
12 |
+
if (!empty($fields)) {
|
13 |
+
if (is_array($fields)) {
|
14 |
+
$newfields = "";
|
15 |
+
$f = 1;
|
16 |
+
|
17 |
+
foreach ($fields as $field) {
|
18 |
+
$newfields .= "`" . $field . "`";
|
19 |
+
|
20 |
+
if ($f < count($fields)) {
|
21 |
+
$newfields .= ", ";
|
22 |
+
}
|
23 |
+
|
24 |
+
$f++;
|
25 |
+
}
|
26 |
+
} else {
|
27 |
+
$newfields = $fields;
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
$query = "SELECT " . $newfields . " FROM `" . $this -> table . "`";
|
32 |
+
|
33 |
+
if (!empty($conditions) && is_array($conditions)) {
|
34 |
+
$query .= " WHERE";
|
35 |
+
$c = 1;
|
36 |
+
|
37 |
+
foreach ($conditions as $ckey => $cval) {
|
38 |
+
$query .= " `" . $ckey . "` = '" . $cval . "'";
|
39 |
+
|
40 |
+
if ($c < count($conditions)) {
|
41 |
+
$query .= " AND";
|
42 |
+
}
|
43 |
+
|
44 |
+
$c++;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
$order = (empty($order)) ? array('id', "DESC") : $order;
|
49 |
+
list($ofield, $odir) = $order;
|
50 |
+
$query .= " ORDER BY `" . $ofield . "` " . $odir . "";
|
51 |
+
$query .= " LIMIT 1";
|
52 |
+
|
53 |
+
if ($record = $wpdb -> get_row($query)) {
|
54 |
+
if (!empty($record)) {
|
55 |
+
$data = $this -> init_class($this -> model, $record);
|
56 |
+
|
57 |
+
if ($assign == true) {
|
58 |
+
$this -> data = $data;
|
59 |
+
}
|
60 |
+
|
61 |
+
return $data;
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
function find_all($conditions = array(), $fields = false, $order = array('id', "DESC"), $limit = false, $assign = false, $distinct = false) {
|
69 |
+
global $wpdb;
|
70 |
+
|
71 |
+
$newfields = "*";
|
72 |
+
if (!empty($fields) && !is_array($fields)) { $newfields = $fields; }
|
73 |
+
$distinct = (!empty($distinct)) ? "DISTINCT " : "";
|
74 |
+
|
75 |
+
$query = "SELECT " . $distinct . $newfields . " FROM `" . $this -> table . "`";
|
76 |
+
|
77 |
+
if (!empty($conditions) && is_array($conditions)) {
|
78 |
+
$query .= " WHERE";
|
79 |
+
$c = 1;
|
80 |
+
|
81 |
+
foreach ($conditions as $ckey => $cval) {
|
82 |
+
$query .= " `" . $ckey . "` = '" . $cval . "'";
|
83 |
+
|
84 |
+
if ($c < count($conditions)) {
|
85 |
+
$query .= " AND";
|
86 |
+
}
|
87 |
+
|
88 |
+
$c++;
|
89 |
+
}
|
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)) {
|
98 |
+
if (!empty($records)) {
|
99 |
+
$data = array();
|
100 |
+
|
101 |
+
foreach ($records as $record) {
|
102 |
+
$data[] = $this -> init_class($this -> model, $record);
|
103 |
+
}
|
104 |
+
|
105 |
+
if ($assign == true) {
|
106 |
+
$this -> data = $data;
|
107 |
+
}
|
108 |
+
|
109 |
+
return $data;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
return false;
|
114 |
+
}
|
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')) {
|
127 |
+
$this -> validate($r);
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
if (empty($this -> errors)) {
|
132 |
+
switch ($this -> model) {
|
133 |
+
case 'Slide' :
|
134 |
+
$this -> data -> image = basename($this -> data -> image_url);
|
135 |
+
break;
|
136 |
+
}
|
137 |
+
|
138 |
+
//the MySQL query
|
139 |
+
$query = (empty($this -> data -> id)) ? $this -> insert_query($this -> model) : $this -> update_query($this -> model);
|
140 |
+
|
141 |
+
if ($wpdb -> query($query)) {
|
142 |
+
$this -> insertid = $insertid = (empty($this -> data -> id)) ? $wpdb -> insert_id : $this -> data -> id;
|
143 |
+
return true;
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
return false;
|
148 |
+
}
|
149 |
+
|
150 |
+
function save_field($field = null, $value = null, $conditions = array()) {
|
151 |
+
if (!empty($this -> model)) {
|
152 |
+
global $wpdb;
|
153 |
+
|
154 |
+
if (!empty($field)) {
|
155 |
+
$query = "UPDATE `" . $this -> table . "` SET `" . $field . "` = '" . $value . "'";
|
156 |
+
|
157 |
+
if (!empty($conditions) && is_array($conditions)) {
|
158 |
+
$query .= " WHERE";
|
159 |
+
$c = 1;
|
160 |
+
|
161 |
+
foreach ($conditions as $ckey => $cval) {
|
162 |
+
$query .= " `" . $ckey . "` = '" . $cval . "'";
|
163 |
+
|
164 |
+
if ($c < count($conditions)) {
|
165 |
+
$query .= " AND";
|
166 |
+
}
|
167 |
+
|
168 |
+
$c++;
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
if ($wpdb -> query($query)) {
|
173 |
+
return true;
|
174 |
+
}
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
return false;
|
179 |
+
}
|
180 |
+
|
181 |
+
function delete($record_id = '') {
|
182 |
+
global $wpdb;
|
183 |
+
|
184 |
+
if (!empty($record_id) && $record = $this -> find(array('id' => $record_id))) {
|
185 |
+
$query = "DELETE FROM `" . $this -> table . "` WHERE `id` = '" . $record_id . "' LIMIT 1";
|
186 |
+
|
187 |
+
if ($wpdb -> query($query)) {
|
188 |
+
//do nothing...
|
189 |
+
return true;
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
return false;
|
194 |
+
}
|
195 |
+
|
196 |
+
function insert_query($model = '') {
|
197 |
+
if (!empty($model)) {
|
198 |
+
global $wpdb;
|
199 |
+
|
200 |
+
if (!empty($this -> data)) {
|
201 |
+
if (empty($this -> data -> id)) {
|
202 |
+
$query1 = "INSERT INTO `" . $this -> table . "` (";
|
203 |
+
$query2 = "";
|
204 |
+
$c = 1;
|
205 |
+
unset($this -> fields['key']);
|
206 |
+
|
207 |
+
foreach (array_keys($this -> fields) as $field) {
|
208 |
+
if (!empty($this -> data -> {$field}) || $this -> data -> {$field} == "0") {
|
209 |
+
if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
|
210 |
+
$value = serialize($this -> data -> {$field});
|
211 |
+
} else {
|
212 |
+
$value = mysql_escape_string($this -> data -> {$field});
|
213 |
+
}
|
214 |
+
|
215 |
+
$query1 .= "`" . $field . "`";
|
216 |
+
$query2 .= "'" . $value . "'";
|
217 |
+
|
218 |
+
if ($c < count($this -> fields)) {
|
219 |
+
$query1 .= ", ";
|
220 |
+
$query2 .= ", ";
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
$c++;
|
225 |
+
}
|
226 |
+
|
227 |
+
$query1 .= ") VALUES (";
|
228 |
+
$query = $query1 . "" . $query2 . ");";
|
229 |
+
|
230 |
+
return $query;
|
231 |
+
} else {
|
232 |
+
$query = $this -> update_query($model);
|
233 |
+
|
234 |
+
return $query;
|
235 |
+
}
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
return false;
|
240 |
+
}
|
241 |
+
|
242 |
+
function update_query($model = '') {
|
243 |
+
if (!empty($model)) {
|
244 |
+
global $wpdb;
|
245 |
+
|
246 |
+
if (!empty($this -> data)) {
|
247 |
+
$query = "UPDATE `" . $this -> table . "` SET ";
|
248 |
+
$c = 1;
|
249 |
+
|
250 |
+
unset($this -> fields['id']);
|
251 |
+
unset($this -> fields['key']);
|
252 |
+
unset($this -> fields['created']);
|
253 |
+
|
254 |
+
foreach (array_keys($this -> fields) as $field) {
|
255 |
+
//if (!empty($this -> data -> {$field}) || $this -> data -> {$field} == "0") {
|
256 |
+
if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
|
257 |
+
$value = serialize($this -> data -> {$field});
|
258 |
+
} else {
|
259 |
+
$value = mysql_escape_string($this -> data -> {$field});
|
260 |
+
}
|
261 |
+
|
262 |
+
$query .= "`" . $field . "` = '" . $value . "'";
|
263 |
+
|
264 |
+
if ($c < count($this -> fields)) {
|
265 |
+
$query .= ", ";
|
266 |
+
}
|
267 |
+
//}
|
268 |
+
|
269 |
+
$c++;
|
270 |
+
}
|
271 |
+
|
272 |
+
$query .= " WHERE `id` = '" . $this -> data -> id . "' LIMIT 1";
|
273 |
+
|
274 |
+
return $query;
|
275 |
+
}
|
276 |
+
}
|
277 |
+
|
278 |
+
return false;
|
279 |
+
}
|
280 |
+
}
|
281 |
+
|
282 |
?>
|
helpers/form.php
CHANGED
@@ -14,7 +14,7 @@ class GalleryFormHelper extends GalleryPlugin {
|
|
14 |
|
15 |
ob_start();
|
16 |
|
17 |
-
?><input type="hidden" name="
|
18 |
|
19 |
$hidden = ob_get_clean();
|
20 |
return $hidden;
|
@@ -38,7 +38,7 @@ class GalleryFormHelper extends GalleryPlugin {
|
|
38 |
|
39 |
ob_start();
|
40 |
|
41 |
-
?><input class="
|
42 |
|
43 |
if ($error == true) {
|
44 |
echo $this -> Html -> field_error($name);
|
@@ -62,7 +62,7 @@ class GalleryFormHelper extends GalleryPlugin {
|
|
62 |
|
63 |
ob_start();
|
64 |
|
65 |
-
?><textarea class="
|
66 |
|
67 |
if ($error == true) {
|
68 |
echo $this -> Html -> field_error($name);
|
@@ -79,7 +79,7 @@ class GalleryFormHelper extends GalleryPlugin {
|
|
79 |
|
80 |
ob_start();
|
81 |
|
82 |
-
?><input class="
|
83 |
|
84 |
$submit = ob_get_clean();
|
85 |
return $submit;
|
14 |
|
15 |
ob_start();
|
16 |
|
17 |
+
?><input type="hidden" name="<?php echo $this -> Html -> field_name($name); ?>" value="<?php echo $value; ?>" id="<?php echo $name; ?>" /><?php
|
18 |
|
19 |
$hidden = ob_get_clean();
|
20 |
return $hidden;
|
38 |
|
39 |
ob_start();
|
40 |
|
41 |
+
?><input class="<?php echo $class; ?>" type="text" autocomplete="<?php echo $autocomplete; ?>" style="width:<?php echo $width; ?>" name="<?php echo $this -> Html -> field_name($name); ?>" value="<?php echo $value; ?>" id="<?php echo $id; ?>" /><?php
|
42 |
|
43 |
if ($error == true) {
|
44 |
echo $this -> Html -> field_error($name);
|
62 |
|
63 |
ob_start();
|
64 |
|
65 |
+
?><textarea class="<?php echo $class; ?>" name="<?php echo $this -> Html -> field_name($name); ?>" rows="<?php echo $rows; ?>" style="width:<?php echo $width; ?>;" cols="<?php echo $cols; ?>" id="<?php echo $name; ?>"><?php echo $this -> Html -> field_value($name); ?></textarea><?php
|
66 |
|
67 |
if ($error == true) {
|
68 |
echo $this -> Html -> field_error($name);
|
79 |
|
80 |
ob_start();
|
81 |
|
82 |
+
?><input class="<?php echo $class; ?>" type="submit" name="<?php echo $this -> Html -> sanitize($name); ?>" value="<?php echo $name; ?>" /><?php
|
83 |
|
84 |
$submit = ob_get_clean();
|
85 |
return $submit;
|
helpers/html.php
CHANGED
@@ -16,7 +16,7 @@ class GalleryHtmlHelper extends GalleryPlugin {
|
|
16 |
|
17 |
ob_start();
|
18 |
|
19 |
-
?><a class="
|
20 |
|
21 |
$link = ob_get_clean();
|
22 |
return $link;
|
16 |
|
17 |
ob_start();
|
18 |
|
19 |
+
?><a class="<?php echo $class; ?>" rel="<?php echo $rel; ?>" <?php echo (!empty($onclick)) ? 'onclick="' . $onclick . '"' : ''; ?> href="<?php echo $href; ?>" target="<?php echo $target; ?>" title="<?php echo $title; ?>"><?php echo $name; ?></a><?php
|
20 |
|
21 |
$link = ob_get_clean();
|
22 |
return $link;
|
languages/slideshow-gallery-en_US.mo
ADDED
Binary file
|
languages/slideshow-gallery-en_US.po
ADDED
@@ -0,0 +1,402 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: WordPress Slideshow Gallery v1.0.3\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2009-12-15 23:30+0200\n"
|
6 |
+
"PO-Revision-Date: \n"
|
7 |
+
"Last-Translator: Antonie Potgieter <antonie.potgieter@gmail.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"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-Language: English\n"
|
13 |
+
"X-Poedit-Country: SOUTH AFRICA\n"
|
14 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
15 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
16 |
+
"X-Poedit-Basepath: ../\n"
|
17 |
+
"X-Poedit-SearchPath-0: ..\n"
|
18 |
+
|
19 |
+
#: ../slideshow-gallery/slideshow-gallery-ajax.php:29
|
20 |
+
msgid "Slides have been ordered"
|
21 |
+
msgstr ""
|
22 |
+
|
23 |
+
#: ../slideshow-gallery/slideshow-gallery-plugin.php:213
|
24 |
+
msgid "Uploads folder named \""
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: ../slideshow-gallery/slideshow-gallery.php:32
|
28 |
+
msgid "Slideshow"
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: ../slideshow-gallery/slideshow-gallery.php:33
|
32 |
+
msgid "Manage Slides"
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: ../slideshow-gallery/slideshow-gallery.php:34
|
36 |
+
msgid "Configuration"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: ../slideshow-gallery/slideshow-gallery.php:94
|
40 |
+
msgid "Slide has been saved"
|
41 |
+
msgstr ""
|
42 |
+
|
43 |
+
#: ../slideshow-gallery/slideshow-gallery.php:114
|
44 |
+
msgid "Selected slides have been removed"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: ../slideshow-gallery/slideshow-gallery.php:119
|
48 |
+
msgid "No slides were selected"
|
49 |
+
msgstr ""
|
50 |
+
|
51 |
+
#: ../slideshow-gallery/slideshow-gallery.php:123
|
52 |
+
msgid "No action was specified"
|
53 |
+
msgstr ""
|
54 |
+
|
55 |
+
#: ../slideshow-gallery/slideshow-gallery.php:145
|
56 |
+
msgid "All configuration settings have been reset to their defaults"
|
57 |
+
msgstr ""
|
58 |
+
|
59 |
+
#: ../slideshow-gallery/slideshow-gallery.php:149
|
60 |
+
msgid "Configuration settings could not be reset"
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
#: ../slideshow-gallery/slideshow-gallery.php:162
|
64 |
+
msgid "Configuration has been saved"
|
65 |
+
msgstr ""
|
66 |
+
|
67 |
+
#: ../slideshow-gallery/models/slide.php:62
|
68 |
+
msgid "Please fill in a title"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: ../slideshow-gallery/models/slide.php:63
|
72 |
+
msgid "Please fill in a description"
|
73 |
+
msgstr ""
|
74 |
+
|
75 |
+
#: ../slideshow-gallery/models/slide.php:64
|
76 |
+
msgid "Please specify an image"
|
77 |
+
msgstr ""
|
78 |
+
|
79 |
+
#: ../slideshow-gallery/models/slide.php:91
|
80 |
+
msgid "No data was posted"
|
81 |
+
msgstr ""
|
82 |
+
|
83 |
+
#: ../slideshow-gallery/vendors/class.paginate.php:176
|
84 |
+
msgid "Displaying"
|
85 |
+
msgstr ""
|
86 |
+
|
87 |
+
#: ../slideshow-gallery/vendors/class.paginate.php:176
|
88 |
+
msgid "of"
|
89 |
+
msgstr ""
|
90 |
+
|
91 |
+
#: ../slideshow-gallery/vendors/class.paginate.php:179
|
92 |
+
msgid "Previous Page"
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: ../slideshow-gallery/vendors/class.paginate.php:187
|
96 |
+
msgid "Page"
|
97 |
+
msgstr ""
|
98 |
+
|
99 |
+
#: ../slideshow-gallery/vendors/class.paginate.php:198
|
100 |
+
msgid "Next Page"
|
101 |
+
msgstr ""
|
102 |
+
|
103 |
+
#: ../slideshow-gallery/views/admin/settings.php:7
|
104 |
+
msgid "Save Settings"
|
105 |
+
msgstr ""
|
106 |
+
|
107 |
+
#: ../slideshow-gallery/views/admin/settings.php:8
|
108 |
+
msgid "General Settings"
|
109 |
+
msgstr ""
|
110 |
+
|
111 |
+
#: ../slideshow-gallery/views/admin/settings.php:9
|
112 |
+
msgid "Appearance & Styles"
|
113 |
+
msgstr ""
|
114 |
+
|
115 |
+
#: ../slideshow-gallery/views/admin/settings.php:18
|
116 |
+
msgid "Configuration Settings"
|
117 |
+
msgstr ""
|
118 |
+
|
119 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:4
|
120 |
+
msgid "Auto Slide"
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:6
|
124 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:53
|
125 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:79
|
126 |
+
msgid "Yes"
|
127 |
+
msgstr ""
|
128 |
+
|
129 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:7
|
130 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:54
|
131 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:80
|
132 |
+
msgid "No"
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:17
|
136 |
+
msgid "Auto Speed"
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:19
|
140 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:113
|
141 |
+
msgid "speed"
|
142 |
+
msgstr ""
|
143 |
+
|
144 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:20
|
145 |
+
msgid "default:10"
|
146 |
+
msgstr ""
|
147 |
+
|
148 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:20
|
149 |
+
msgid "lower number for shorter interval between images"
|
150 |
+
msgstr ""
|
151 |
+
|
152 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:30
|
153 |
+
msgid "Image Fading Speed"
|
154 |
+
msgstr ""
|
155 |
+
|
156 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:33
|
157 |
+
msgid "default:10 recommended:1-20"
|
158 |
+
msgstr ""
|
159 |
+
|
160 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:33
|
161 |
+
msgid "lower number for quicker fading of images"
|
162 |
+
msgstr ""
|
163 |
+
|
164 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:37
|
165 |
+
msgid "Navigation Default Opacity"
|
166 |
+
msgstr ""
|
167 |
+
|
168 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:39
|
169 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:46
|
170 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:99
|
171 |
+
msgid "% <!-- percentage -->"
|
172 |
+
msgstr ""
|
173 |
+
|
174 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:40
|
175 |
+
msgid "opacity of the prev/next buttons by default"
|
176 |
+
msgstr ""
|
177 |
+
|
178 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:44
|
179 |
+
msgid "Navigation Hover Opacity"
|
180 |
+
msgstr ""
|
181 |
+
|
182 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:47
|
183 |
+
msgid "opacity of the prev/next buttons when they are hovered"
|
184 |
+
msgstr ""
|
185 |
+
|
186 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:51
|
187 |
+
msgid "Show Information"
|
188 |
+
msgstr ""
|
189 |
+
|
190 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:64
|
191 |
+
msgid "Information Speed"
|
192 |
+
msgstr ""
|
193 |
+
|
194 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:67
|
195 |
+
msgid "speed at which the information will slide in"
|
196 |
+
msgstr ""
|
197 |
+
|
198 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:77
|
199 |
+
msgid "Show Thumbnails"
|
200 |
+
msgstr ""
|
201 |
+
|
202 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:90
|
203 |
+
msgid "Thumbnails Position"
|
204 |
+
msgstr ""
|
205 |
+
|
206 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:92
|
207 |
+
msgid "Top"
|
208 |
+
msgstr ""
|
209 |
+
|
210 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:93
|
211 |
+
msgid "Bottom"
|
212 |
+
msgstr ""
|
213 |
+
|
214 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:97
|
215 |
+
msgid "Thumbnail Opacity"
|
216 |
+
msgstr ""
|
217 |
+
|
218 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:100
|
219 |
+
msgid "default opacity of thumbnails when they are not hovered"
|
220 |
+
msgstr ""
|
221 |
+
|
222 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:104
|
223 |
+
msgid "Thumbnail Active Border"
|
224 |
+
msgstr ""
|
225 |
+
|
226 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:107
|
227 |
+
msgid "border color (hexidecimal) for the active image thumbnail. default:#FFFFFF"
|
228 |
+
msgstr ""
|
229 |
+
|
230 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:111
|
231 |
+
msgid "Thumbnails Scroll Speed"
|
232 |
+
msgstr ""
|
233 |
+
|
234 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:114
|
235 |
+
msgid "default:5 recommended:1-20"
|
236 |
+
msgstr ""
|
237 |
+
|
238 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:118
|
239 |
+
msgid "Thumbnail Spacing"
|
240 |
+
msgstr ""
|
241 |
+
|
242 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:120
|
243 |
+
msgid "px"
|
244 |
+
msgstr ""
|
245 |
+
|
246 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-general.php:121
|
247 |
+
msgid "horizontal margin/spacing between thumbnails"
|
248 |
+
msgstr ""
|
249 |
+
|
250 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:6
|
251 |
+
msgid "Resize Images"
|
252 |
+
msgstr ""
|
253 |
+
|
254 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:10
|
255 |
+
msgid "should images be resized proportionally to fit the width of the slideshow area"
|
256 |
+
msgstr ""
|
257 |
+
|
258 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:14
|
259 |
+
msgid "Gallery Width"
|
260 |
+
msgstr ""
|
261 |
+
|
262 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:17
|
263 |
+
msgid "width of the slideshow gallery"
|
264 |
+
msgstr ""
|
265 |
+
|
266 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:21
|
267 |
+
msgid "Gallery Height"
|
268 |
+
msgstr ""
|
269 |
+
|
270 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:24
|
271 |
+
msgid "height of the slideshow gallery"
|
272 |
+
msgstr ""
|
273 |
+
|
274 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:28
|
275 |
+
msgid "Slideshow Border"
|
276 |
+
msgstr ""
|
277 |
+
|
278 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:34
|
279 |
+
msgid "Slideshow Background"
|
280 |
+
msgstr ""
|
281 |
+
|
282 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:40
|
283 |
+
msgid "Information Background"
|
284 |
+
msgstr ""
|
285 |
+
|
286 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-styles.php:46
|
287 |
+
msgid "Information Text Color"
|
288 |
+
msgstr ""
|
289 |
+
|
290 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-submit.php:6
|
291 |
+
msgid "Reset all configuration settings to their default values"
|
292 |
+
msgstr ""
|
293 |
+
|
294 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-submit.php:6
|
295 |
+
msgid "Are you sure you wish to reset all configuration settings?"
|
296 |
+
msgstr ""
|
297 |
+
|
298 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-submit.php:6
|
299 |
+
msgid "Reset to Defaults"
|
300 |
+
msgstr ""
|
301 |
+
|
302 |
+
#: ../slideshow-gallery/views/admin/metaboxes/settings-submit.php:13
|
303 |
+
msgid "Save Configuration"
|
304 |
+
msgstr ""
|
305 |
+
|
306 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:2
|
307 |
+
msgid "add new"
|
308 |
+
msgstr ""
|
309 |
+
|
310 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:7
|
311 |
+
msgid "slides"
|
312 |
+
msgstr ""
|
313 |
+
|
314 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:13
|
315 |
+
msgid "Are you sure you wish to execute this action on the selected slides?"
|
316 |
+
msgstr ""
|
317 |
+
|
318 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:16
|
319 |
+
msgid "Order all your slides"
|
320 |
+
msgstr ""
|
321 |
+
|
322 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:16
|
323 |
+
#: ../slideshow-gallery/views/admin/slides/order.php:2
|
324 |
+
msgid "Order Slides"
|
325 |
+
msgstr ""
|
326 |
+
|
327 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:19
|
328 |
+
msgid "Bulk Actions"
|
329 |
+
msgstr ""
|
330 |
+
|
331 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:20
|
332 |
+
msgid "Delete"
|
333 |
+
msgstr ""
|
334 |
+
|
335 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:22
|
336 |
+
msgid "Apply"
|
337 |
+
msgstr ""
|
338 |
+
|
339 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:31
|
340 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:40
|
341 |
+
msgid "Image"
|
342 |
+
msgstr ""
|
343 |
+
|
344 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:32
|
345 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:41
|
346 |
+
#: ../slideshow-gallery/views/admin/slides/save.php:11
|
347 |
+
msgid "Title"
|
348 |
+
msgstr ""
|
349 |
+
|
350 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:33
|
351 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:42
|
352 |
+
msgid "Date"
|
353 |
+
msgstr ""
|
354 |
+
|
355 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:34
|
356 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:43
|
357 |
+
msgid "Order"
|
358 |
+
msgstr ""
|
359 |
+
|
360 |
+
#: ../slideshow-gallery/views/admin/slides/index.php:68
|
361 |
+
#: ../slideshow-gallery/views/admin/slides/order.php:51
|
362 |
+
msgid "No slides found"
|
363 |
+
msgstr ""
|
364 |
+
|
365 |
+
#: ../slideshow-gallery/views/admin/slides/order.php:5
|
366 |
+
msgid "← Manage All Slides"
|
367 |
+
msgstr ""
|
368 |
+
|
369 |
+
#: ../slideshow-gallery/views/admin/slides/save.php:2
|
370 |
+
msgid "Save a Slide"
|
371 |
+
msgstr ""
|
372 |
+
|
373 |
+
#: ../slideshow-gallery/views/admin/slides/save.php:18
|
374 |
+
msgid "Description"
|
375 |
+
msgstr ""
|
376 |
+
|
377 |
+
#: ../slideshow-gallery/views/admin/slides/save.php:25
|
378 |
+
msgid "Image URL"
|
379 |
+
msgstr ""
|
380 |
+
|
381 |
+
#: ../slideshow-gallery/views/admin/slides/save.php:32
|
382 |
+
msgid "Link To"
|
383 |
+
msgstr ""
|
384 |
+
|
385 |
+
#: ../slideshow-gallery/views/admin/slides/save.php:39
|
386 |
+
msgid "Save Slide"
|
387 |
+
msgstr ""
|
388 |
+
|
389 |
+
#: ../slideshow-gallery/views/default/gallery.php:45
|
390 |
+
#: ../slideshow-gallery/views/default/gallery.php:69
|
391 |
+
msgid "Slide Left"
|
392 |
+
msgstr ""
|
393 |
+
|
394 |
+
#: ../slideshow-gallery/views/default/gallery.php:49
|
395 |
+
#: ../slideshow-gallery/views/default/gallery.php:73
|
396 |
+
msgid "Slide Right"
|
397 |
+
msgstr ""
|
398 |
+
|
399 |
+
#: ../slideshow-gallery.1/tags/1.0/trunk/views/admin/settings.php:5
|
400 |
+
msgid "Styles"
|
401 |
+
msgstr ""
|
402 |
+
|
readme.txt
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Slideshow Gallery ===
|
2 |
+
Contributors: Antonie Potgieter
|
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.8
|
6 |
+
Tested up to: 2.9 beta 2
|
7 |
+
Stable tag: 1.0.3
|
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 |
+
The slideshow is flexible and all aspects can easily be configured.
|
16 |
+
|
17 |
+
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. 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); }; ?>`.
|
18 |
+
|
19 |
+
== Installation ==
|
20 |
+
|
21 |
+
Installing the WordPress slideshow gallery plugin is very easy. Simply follow the steps below.
|
22 |
+
|
23 |
+
1. Extract the package to obtain the `slideshow-gallery` folder
|
24 |
+
1. Upload the `slideshow-gallery` folder to the `/wp-content/plugins/` directory
|
25 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress
|
26 |
+
1. Configure the settings according to your needs through the 'Slideshow' > 'Configuration' menu
|
27 |
+
1. Add and manage your slides in the 'Slideshow' section
|
28 |
+
1. Put `[slideshow post_id=X]` into your posts/pages or `<?php if (class_exists('Gallery')) { $Gallery = new Gallery(); $Gallery -> slideshow($output = true, $post_id = null); }; ?>` into your WordPress theme
|
29 |
+
|
30 |
+
== Frequently Asked Questions ==
|
31 |
+
|
32 |
+
= Can I display/embed multiple instances of the slideshow gallery? =
|
33 |
+
|
34 |
+
Yes, you can
|
35 |
+
|
36 |
+
== Screenshots ==
|
37 |
+
|
38 |
+
1. Slideshow gallery with thumbnails at the bottom
|
39 |
+
2. Slideshow gallery with thumbnails turned OFF
|
40 |
+
3. Slideshow gallery with thumbnails at the top
|
41 |
+
4. Different styles/colors
|
42 |
+
|
43 |
+
== Changelog ==
|
44 |
+
|
45 |
+
= 1.0 =
|
46 |
+
* Initial release of the WordPress Slideshow Gallery plugin
|
47 |
+
|
48 |
+
= 1.0.3 =
|
49 |
+
* ADDED: Default, English language file in the `languages` folder.
|
50 |
+
* ADDED: Configuration setting to turn On/Off resizing of images via CSS.
|
51 |
+
* ADDED: Webkit border radius in CSS for thumbnail images.
|
52 |
+
* ADDED: `post_id` parameter for the `[slideshow]` shortcode to display images from a post/page.
|
53 |
+
* IMPROVED: Plugin doesn't utilize PHP short open tags anymore.
|
54 |
+
* COMPATIBILITY: Removed `autoLoad` (introduced in PHP 5) parameter from `class_exists` function for PHP 4 compatibility.
|
55 |
+
* IMPROVED: Directory separator constant DS from DIRECTORY_SEPARATOR.
|
trunk/screenshot-1.png → screenshot-1.png
RENAMED
File without changes
|
trunk/screenshot-2.png → screenshot-2.png
RENAMED
File without changes
|
trunk/screenshot-3.png → screenshot-3.png
RENAMED
File without changes
|
trunk/screenshot-4.png → screenshot-4.png
RENAMED
File without changes
|
slideshow-gallery-ajax.php
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
<?php
|
2 |
|
|
|
3 |
include_once('../../../wp-config.php');
|
4 |
-
include_once(ABSPATH . 'wp-admin
|
5 |
|
6 |
class GalleryAjax extends GalleryPlugin {
|
7 |
|
1 |
<?php
|
2 |
|
3 |
+
define('DS', DIRECTORY_SEPARATOR);
|
4 |
include_once('../../../wp-config.php');
|
5 |
+
include_once(ABSPATH . 'wp-admin' . DS . 'admin-functions.php');
|
6 |
|
7 |
class GalleryAjax extends GalleryPlugin {
|
8 |
|
slideshow-gallery-plugin.php
CHANGED
@@ -2,9 +2,8 @@
|
|
2 |
|
3 |
class GalleryPlugin {
|
4 |
|
5 |
-
|
6 |
var $plugin_name;
|
7 |
-
//the plugin absolute path
|
8 |
var $plugin_base;
|
9 |
var $pre = 'Gallery';
|
10 |
var $debugging = true;
|
@@ -14,7 +13,7 @@ class GalleryPlugin {
|
|
14 |
|
15 |
function register_plugin($name, $base) {
|
16 |
$this -> plugin_name = $name;
|
17 |
-
$this -> plugin_base = rtrim(dirname($base),
|
18 |
|
19 |
$this -> enqueue_scripts();
|
20 |
$this -> enqueue_styles();
|
@@ -22,6 +21,16 @@ class GalleryPlugin {
|
|
22 |
$this -> initialize_classes();
|
23 |
$this -> initialize_options();
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
return true;
|
26 |
}
|
27 |
|
@@ -44,7 +53,7 @@ class GalleryPlugin {
|
|
44 |
function initialize_classes() {
|
45 |
if (!empty($this -> helpers)) {
|
46 |
foreach ($this -> helpers as $helper) {
|
47 |
-
$hfile = dirname(__FILE__) . '
|
48 |
|
49 |
if (file_exists($hfile)) {
|
50 |
require_once($hfile);
|
@@ -52,7 +61,7 @@ class GalleryPlugin {
|
|
52 |
if (!is_object($this -> {$helper})) {
|
53 |
$classname = $this -> pre . $helper . 'Helper';
|
54 |
|
55 |
-
if (class_exists($classname
|
56 |
$this -> {$helper} = new $classname;
|
57 |
}
|
58 |
}
|
@@ -62,7 +71,7 @@ class GalleryPlugin {
|
|
62 |
|
63 |
if (!empty($this -> models)) {
|
64 |
foreach ($this -> models as $model) {
|
65 |
-
$mfile = dirname(__FILE__) . '
|
66 |
|
67 |
if (file_exists($mfile)) {
|
68 |
require_once($mfile);
|
@@ -70,7 +79,7 @@ class GalleryPlugin {
|
|
70 |
if (!is_object($this -> {$model})) {
|
71 |
$classname = $this -> pre . $model;
|
72 |
|
73 |
-
if (class_exists($classname
|
74 |
$this -> {$model} = new $classname;
|
75 |
}
|
76 |
}
|
@@ -87,6 +96,7 @@ class GalleryPlugin {
|
|
87 |
'background' => "#000000",
|
88 |
'infobackground' => "#000000",
|
89 |
'infocolor' => "#FFFFFF",
|
|
|
90 |
);
|
91 |
|
92 |
$this -> add_option('styles', $styles);
|
@@ -131,7 +141,7 @@ class GalleryPlugin {
|
|
131 |
?>
|
132 |
|
133 |
<script type="text/javascript">
|
134 |
-
window.location = '
|
135 |
</script>
|
136 |
|
137 |
<?php
|
@@ -176,7 +186,7 @@ class GalleryPlugin {
|
|
176 |
function vendor($name = '', $folder = '') {
|
177 |
if (!empty($name)) {
|
178 |
$filename = 'class.' . strtolower($name) . '.php';
|
179 |
-
$filepath = rtrim(dirname(__FILE__),
|
180 |
$filefull = $filepath . $filename;
|
181 |
|
182 |
if (file_exists($filefull)) {
|
@@ -193,7 +203,7 @@ class GalleryPlugin {
|
|
193 |
}
|
194 |
|
195 |
function check_uploaddir() {
|
196 |
-
$uploaddir = ABSPATH . 'wp-content
|
197 |
|
198 |
if (!file_exists($uploaddir)) {
|
199 |
if (@mkdir($uploaddir, 0777)) {
|
@@ -253,9 +263,12 @@ class GalleryPlugin {
|
|
253 |
return true;
|
254 |
}
|
255 |
|
|
|
|
|
|
|
|
|
256 |
function url() {
|
257 |
-
|
258 |
-
return $url;
|
259 |
}
|
260 |
|
261 |
function add_option($name = '', $value = '') {
|
@@ -338,7 +351,7 @@ class GalleryPlugin {
|
|
338 |
}
|
339 |
|
340 |
if (!empty($this -> table_query)) {
|
341 |
-
require_once(ABSPATH . 'wp-admin
|
342 |
dbDelta($this -> table_query, true);
|
343 |
}
|
344 |
}
|
@@ -433,13 +446,10 @@ class GalleryPlugin {
|
|
433 |
return false;
|
434 |
}
|
435 |
|
436 |
-
function render($file = '', $params = array(), $output = true, $folder = 'admin') {
|
437 |
-
//the absolute path to the plugin base
|
438 |
-
$this -> plugin_base = rtrim(dirname(__FILE__), '/');
|
439 |
-
|
440 |
if (!empty($file)) {
|
441 |
$filename = $file . '.php';
|
442 |
-
$filepath = $this -> plugin_base . '
|
443 |
$filefull = $filepath . $filename;
|
444 |
|
445 |
if (file_exists($filefull)) {
|
2 |
|
3 |
class GalleryPlugin {
|
4 |
|
5 |
+
var $version = '1.0.3';
|
6 |
var $plugin_name;
|
|
|
7 |
var $plugin_base;
|
8 |
var $pre = 'Gallery';
|
9 |
var $debugging = true;
|
13 |
|
14 |
function register_plugin($name, $base) {
|
15 |
$this -> plugin_name = $name;
|
16 |
+
$this -> plugin_base = rtrim(dirname($base), DS);
|
17 |
|
18 |
$this -> enqueue_scripts();
|
19 |
$this -> enqueue_styles();
|
21 |
$this -> initialize_classes();
|
22 |
$this -> initialize_options();
|
23 |
|
24 |
+
if (function_exists('load_plugin_textdomain')) {
|
25 |
+
$currentlocale = get_locale();
|
26 |
+
if(!empty($currentlocale)) {
|
27 |
+
$moFile = dirname(__FILE__) . DS . "languages" . DS . $this -> plugin_name . "-" . $currentlocale . ".mo";
|
28 |
+
if(@file_exists($moFile) && is_readable($moFile)) {
|
29 |
+
load_textdomain($this -> plugin_name, $moFile);
|
30 |
+
}
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
return true;
|
35 |
}
|
36 |
|
53 |
function initialize_classes() {
|
54 |
if (!empty($this -> helpers)) {
|
55 |
foreach ($this -> helpers as $helper) {
|
56 |
+
$hfile = dirname(__FILE__) . DS . 'helpers' . DS . strtolower($helper) . '.php';
|
57 |
|
58 |
if (file_exists($hfile)) {
|
59 |
require_once($hfile);
|
61 |
if (!is_object($this -> {$helper})) {
|
62 |
$classname = $this -> pre . $helper . 'Helper';
|
63 |
|
64 |
+
if (class_exists($classname)) {
|
65 |
$this -> {$helper} = new $classname;
|
66 |
}
|
67 |
}
|
71 |
|
72 |
if (!empty($this -> models)) {
|
73 |
foreach ($this -> models as $model) {
|
74 |
+
$mfile = dirname(__FILE__) . DS . 'models' . DS . strtolower($model) . '.php';
|
75 |
|
76 |
if (file_exists($mfile)) {
|
77 |
require_once($mfile);
|
79 |
if (!is_object($this -> {$model})) {
|
80 |
$classname = $this -> pre . $model;
|
81 |
|
82 |
+
if (class_exists($classname)) {
|
83 |
$this -> {$model} = new $classname;
|
84 |
}
|
85 |
}
|
96 |
'background' => "#000000",
|
97 |
'infobackground' => "#000000",
|
98 |
'infocolor' => "#FFFFFF",
|
99 |
+
'resizeimages' => "Y",
|
100 |
);
|
101 |
|
102 |
$this -> add_option('styles', $styles);
|
141 |
?>
|
142 |
|
143 |
<script type="text/javascript">
|
144 |
+
window.location = '<?php echo (empty($url)) ? get_option('home') : $url; ?>';
|
145 |
</script>
|
146 |
|
147 |
<?php
|
186 |
function vendor($name = '', $folder = '') {
|
187 |
if (!empty($name)) {
|
188 |
$filename = 'class.' . strtolower($name) . '.php';
|
189 |
+
$filepath = rtrim(dirname(__FILE__), DS) . DS . 'vendors' . DS . $folder . '';
|
190 |
$filefull = $filepath . $filename;
|
191 |
|
192 |
if (file_exists($filefull)) {
|
203 |
}
|
204 |
|
205 |
function check_uploaddir() {
|
206 |
+
$uploaddir = ABSPATH . 'wp-content' . DS . 'uploads' . DS . $this -> plugin_name . DS;
|
207 |
|
208 |
if (!file_exists($uploaddir)) {
|
209 |
if (@mkdir($uploaddir, 0777)) {
|
263 |
return true;
|
264 |
}
|
265 |
|
266 |
+
function plugin_base() {
|
267 |
+
return rtrim(dirname(__FILE__), '/');
|
268 |
+
}
|
269 |
+
|
270 |
function url() {
|
271 |
+
return rtrim(get_bloginfo('wpurl'), '/') . '/' . substr(preg_replace("/\\" . DS . "/si", "/", $this -> plugin_base()), strlen(ABSPATH));
|
|
|
272 |
}
|
273 |
|
274 |
function add_option($name = '', $value = '') {
|
351 |
}
|
352 |
|
353 |
if (!empty($this -> table_query)) {
|
354 |
+
require_once(ABSPATH . 'wp-admin' . DS . 'upgrade-functions.php');
|
355 |
dbDelta($this -> table_query, true);
|
356 |
}
|
357 |
}
|
446 |
return false;
|
447 |
}
|
448 |
|
449 |
+
function render($file = '', $params = array(), $output = true, $folder = 'admin') {
|
|
|
|
|
|
|
450 |
if (!empty($file)) {
|
451 |
$filename = $file . '.php';
|
452 |
+
$filepath = $this -> plugin_base() . DS . 'views' . DS . $folder . DS;
|
453 |
$filefull = $filepath . $filename;
|
454 |
|
455 |
if (file_exists($filefull)) {
|
slideshow-gallery.php
CHANGED
@@ -5,12 +5,12 @@ 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. To hardcode into your theme, simply use <code><?php $Gallery -> slideshow(); ?></code
|
9 |
-
Version: 1.0
|
10 |
*/
|
11 |
|
12 |
-
|
13 |
-
require_once(dirname(__FILE__) . '
|
14 |
|
15 |
class Gallery extends GalleryPlugin {
|
16 |
|
@@ -30,6 +30,7 @@ class Gallery extends GalleryPlugin {
|
|
30 |
|
31 |
function admin_menu() {
|
32 |
add_menu_page(__('Slideshow', $this -> plugin_name), __('Slideshow', $this -> plugin_name), 10, basename(__FILE__), array($this, 'admin_slides'), $this -> url() . '/images/icon.png');
|
|
|
33 |
add_submenu_page(basename(__FILE__), __('Configuration', $this -> plugin_name), __('Configuration', $this -> plugin_name), 10, $this -> plugin_name . '-settings', array($this, 'admin_settings'));
|
34 |
}
|
35 |
|
@@ -46,25 +47,40 @@ class Gallery extends GalleryPlugin {
|
|
46 |
}
|
47 |
}
|
48 |
|
49 |
-
function slideshow($output = true) {
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
$content = $this -> render('gallery', array('slides' => $
|
55 |
-
return $content;
|
56 |
}
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
-
return
|
60 |
}
|
61 |
|
62 |
-
function embed($atts = array()) {
|
63 |
-
|
|
|
|
|
|
|
64 |
extract(shortcode_atts($defaults, $atts));
|
65 |
|
66 |
-
if ($
|
67 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
|
70 |
return $content;
|
@@ -78,21 +94,19 @@ class Gallery extends GalleryPlugin {
|
|
78 |
$message = __('Slide has been saved', $this -> plugin_name);
|
79 |
$this -> redirect($this -> url, "message", $message);
|
80 |
} else {
|
81 |
-
$this -> render('slides
|
82 |
}
|
83 |
} else {
|
84 |
$this -> Db -> model = $this -> Slide -> model;
|
85 |
$this -> Slide -> find(array('id' => $_GET['id']));
|
86 |
-
$this -> render('slides
|
87 |
}
|
88 |
break;
|
89 |
case 'mass' :
|
90 |
if (!empty($_POST['action'])) {
|
91 |
if (!empty($_POST['Slide']['checklist'])) {
|
92 |
switch ($_POST['action']) {
|
93 |
-
case 'delete' :
|
94 |
-
$this -> debug($_POST);
|
95 |
-
|
96 |
foreach ($_POST['Slide']['checklist'] as $slide_id) {
|
97 |
$this -> Slide -> delete($slide_id);
|
98 |
}
|
@@ -112,11 +126,11 @@ class Gallery extends GalleryPlugin {
|
|
112 |
break;
|
113 |
case 'order' :
|
114 |
$slides = $this -> Slide -> find_all(null, null, array('order', "ASC"));
|
115 |
-
$this -> render('slides
|
116 |
break;
|
117 |
default :
|
118 |
$data = $this -> paginate('Slide');
|
119 |
-
$this -> render('slides
|
120 |
break;
|
121 |
}
|
122 |
}
|
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><?php if (class_exists('Gallery')) { $Gallery = new Gallery(); $Gallery -> slideshow($output = true, $post_id = null); } ?></code> and specify the required <code>$post_id</code> parameter accordingly.
|
9 |
+
Version: 1.0.3
|
10 |
*/
|
11 |
|
12 |
+
define('DS', DIRECTORY_SEPARATOR);
|
13 |
+
require_once(dirname(__FILE__) . DS . 'slideshow-gallery-plugin.php');
|
14 |
|
15 |
class Gallery extends GalleryPlugin {
|
16 |
|
30 |
|
31 |
function admin_menu() {
|
32 |
add_menu_page(__('Slideshow', $this -> plugin_name), __('Slideshow', $this -> plugin_name), 10, basename(__FILE__), array($this, 'admin_slides'), $this -> url() . '/images/icon.png');
|
33 |
+
add_submenu_page(basename(__FILE__), __('Manage Slides', $this -> plugin_name), __('Manage Slides', $this -> plugin_name), 10, $this -> plugin_name . '.php', array($this, 'admin_slides'));
|
34 |
add_submenu_page(basename(__FILE__), __('Configuration', $this -> plugin_name), __('Configuration', $this -> plugin_name), 10, $this -> plugin_name . '-settings', array($this, 'admin_settings'));
|
35 |
}
|
36 |
|
47 |
}
|
48 |
}
|
49 |
|
50 |
+
function slideshow($output = true, $post_id = null) {
|
51 |
+
global $wpdb;
|
52 |
+
|
53 |
+
if (!empty($post_id) && $post = get_post($post_id)) {
|
54 |
+
if ($attachments = get_children("post_parent=" . $post -> ID . "&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC")) {
|
55 |
+
$content = $this -> render('gallery', array('slides' => $attachments, 'frompost' => true), false, 'default');
|
|
|
56 |
}
|
57 |
+
} else {
|
58 |
+
$slides = $this -> Slide -> find_all(null, null, array('order', "ASC"));
|
59 |
+
$content = $this -> render('gallery', array('slides' => $slides, 'frompost' => false), false, 'default');
|
60 |
}
|
61 |
|
62 |
+
if ($output) { echo $content; } else { return $content; }
|
63 |
}
|
64 |
|
65 |
+
function embed($atts = array(), $content = null) {
|
66 |
+
//global variables
|
67 |
+
global $wpdb;
|
68 |
+
|
69 |
+
$defaults = array('post_id' => null, 'custom' => null);
|
70 |
extract(shortcode_atts($defaults, $atts));
|
71 |
|
72 |
+
if (!empty($custom)) {
|
73 |
+
$slides = $this -> Slide -> find_all(null, null, array('order', "ASC"));
|
74 |
+
$content = $this -> render('gallery', array('slides' => $slides, 'frompost' => false), false, 'default');
|
75 |
+
} else {
|
76 |
+
global $post;
|
77 |
+
$pid = (empty($post_id)) ? $post -> ID : $post_id;
|
78 |
+
|
79 |
+
if (!empty($pid) && $post = get_post($pid)) {
|
80 |
+
if ($attachments = get_children("post_parent=" . $post -> ID . "&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC")) {
|
81 |
+
$content = $this -> render('gallery', array('slides' => $attachments, 'frompost' => true), false, 'default');
|
82 |
+
}
|
83 |
+
}
|
84 |
}
|
85 |
|
86 |
return $content;
|
94 |
$message = __('Slide has been saved', $this -> plugin_name);
|
95 |
$this -> redirect($this -> url, "message", $message);
|
96 |
} else {
|
97 |
+
$this -> render('slides' . DS . 'save', false, true, 'admin');
|
98 |
}
|
99 |
} else {
|
100 |
$this -> Db -> model = $this -> Slide -> model;
|
101 |
$this -> Slide -> find(array('id' => $_GET['id']));
|
102 |
+
$this -> render('slides' . DS . 'save', false, true, 'admin');
|
103 |
}
|
104 |
break;
|
105 |
case 'mass' :
|
106 |
if (!empty($_POST['action'])) {
|
107 |
if (!empty($_POST['Slide']['checklist'])) {
|
108 |
switch ($_POST['action']) {
|
109 |
+
case 'delete' :
|
|
|
|
|
110 |
foreach ($_POST['Slide']['checklist'] as $slide_id) {
|
111 |
$this -> Slide -> delete($slide_id);
|
112 |
}
|
126 |
break;
|
127 |
case 'order' :
|
128 |
$slides = $this -> Slide -> find_all(null, null, array('order', "ASC"));
|
129 |
+
$this -> render('slides' . DS . 'order', array('slides' => $slides), true, 'admin');
|
130 |
break;
|
131 |
default :
|
132 |
$data = $this -> paginate('Slide');
|
133 |
+
$this -> render('slides' . DS . 'index', array('slides' => $data[$this -> Slide -> model], 'paginate' => $data['Paginate']), true, 'admin');
|
134 |
break;
|
135 |
}
|
136 |
}
|
trunk/css/gallery-css.php
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
<?php header("Content-Type: text/css"); ?>
|
2 |
-
|
3 |
-
<?php $styles = array(); ?>
|
4 |
-
<?php foreach ($_GET as $skey => $sval) : ?>
|
5 |
-
<?php $styles[$skey] = urldecode($sval); ?>
|
6 |
-
<?php endforeach; ?>
|
7 |
-
|
8 |
-
#slideshow { list-style:none; color:#fff; }
|
9 |
-
#slideshow span { display:none; }
|
10 |
-
#wrapper { width:<?= ((int) $styles['width'] - 6); ?>px; background:<?= $styles['background']; ?>; padding:2px; border:<?= $styles['border']; ?>; margin:25px auto; display:none; }
|
11 |
-
#wrapper * { margin:0; padding:0; }
|
12 |
-
#fullsize { position:relative; overflow:hidden; width:<?= ((int) $styles['width'] - 6); ?>px; height:<?= $styles['height']; ?>px; }
|
13 |
-
#information { position:absolute; bottom:0; width:<?= ((int) $styles['width'] - 6); ?>px; height:0; background:<?= $styles['infobackground']; ?>; color:<?= $styles['infocolor']; ?>; overflow:hidden; z-index:200; opacity:.7; filter:alpha(opacity=70); }
|
14 |
-
#information h3 { color:<?= $styles['infocolor']; ?>; padding:4px 8px 3px; font-size:14px; }
|
15 |
-
#information p { color:<?= $styles['infocolor']; ?>; padding:0 8px 8px; }
|
16 |
-
#image { width:<?= ((int) $styles['width'] - 6); ?>px; }
|
17 |
-
#image img { position:absolute; border:none; z-index:25; width:<?= ((int) $styles['width'] - 6); ?>px; }
|
18 |
-
.imgnav { position:absolute; width:25%; height:<?= ((int) $styles['height'] + 6); ?>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; height:<?= ((int) $styles['height'] + 6); ?>px; width:100%; z-index:100; opacity:.4; filter:alpha(opacity=40); }
|
22 |
-
.linkhover { background:url('../images/link.gif') center center no-repeat; }
|
23 |
-
#thumbnails { }
|
24 |
-
.thumbstop { margin-bottom:15px !important; }
|
25 |
-
.thumbsbot { margin-top:15px !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:<?= $styles['background']; ?>; position:relative; width:<?= ((int) $styles['width'] - 55); ?>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-bottomleft:4px; -moz-border-radius-bottomright:4px; -moz-border-radius-topleft:4px; -moz-border-radius-topright:4px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/helpers/db.php
DELETED
@@ -1,282 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class GalleryDbHelper extends GalleryPlugin {
|
4 |
-
|
5 |
-
var $name = 'Db';
|
6 |
-
|
7 |
-
function find($conditions = array(), $fields = false, $order = array('id', "DESC"), $assign = true, $atts = array()) {
|
8 |
-
global $wpdb;
|
9 |
-
|
10 |
-
$newfields = "*";
|
11 |
-
|
12 |
-
if (!empty($fields)) {
|
13 |
-
if (is_array($fields)) {
|
14 |
-
$newfields = "";
|
15 |
-
$f = 1;
|
16 |
-
|
17 |
-
foreach ($fields as $field) {
|
18 |
-
$newfields .= "`" . $field . "`";
|
19 |
-
|
20 |
-
if ($f < count($fields)) {
|
21 |
-
$newfields .= ", ";
|
22 |
-
}
|
23 |
-
|
24 |
-
$f++;
|
25 |
-
}
|
26 |
-
} else {
|
27 |
-
$newfields = $fields;
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
$query = "SELECT " . $newfields . " FROM `" . $this -> table . "`";
|
32 |
-
|
33 |
-
if (!empty($conditions) && is_array($conditions)) {
|
34 |
-
$query .= " WHERE";
|
35 |
-
$c = 1;
|
36 |
-
|
37 |
-
foreach ($conditions as $ckey => $cval) {
|
38 |
-
$query .= " `" . $ckey . "` = '" . $cval . "'";
|
39 |
-
|
40 |
-
if ($c < count($conditions)) {
|
41 |
-
$query .= " AND";
|
42 |
-
}
|
43 |
-
|
44 |
-
$c++;
|
45 |
-
}
|
46 |
-
}
|
47 |
-
|
48 |
-
$order = (empty($order)) ? array('id', "DESC") : $order;
|
49 |
-
list($ofield, $odir) = $order;
|
50 |
-
$query .= " ORDER BY `" . $ofield . "` " . $odir . "";
|
51 |
-
$query .= " LIMIT 1";
|
52 |
-
|
53 |
-
if ($record = $wpdb -> get_row($query)) {
|
54 |
-
if (!empty($record)) {
|
55 |
-
$data = $this -> init_class($this -> model, $record);
|
56 |
-
|
57 |
-
if ($assign == true) {
|
58 |
-
$this -> data = $data;
|
59 |
-
}
|
60 |
-
|
61 |
-
return $data;
|
62 |
-
}
|
63 |
-
}
|
64 |
-
|
65 |
-
return false;
|
66 |
-
}
|
67 |
-
|
68 |
-
function find_all($conditions = array(), $fields = false, $order = array('id', "DESC"), $limit = false, $assign = false, $distinct = false) {
|
69 |
-
global $wpdb;
|
70 |
-
|
71 |
-
$newfields = "*";
|
72 |
-
if (!empty($fields) && !is_array($fields)) { $newfields = $fields; }
|
73 |
-
$distinct = (!empty($distinct)) ? "DISTINCT " : "";
|
74 |
-
|
75 |
-
$query = "SELECT " . $distinct . $newfields . " FROM `" . $this -> table . "`";
|
76 |
-
|
77 |
-
if (!empty($conditions) && is_array($conditions)) {
|
78 |
-
$query .= " WHERE";
|
79 |
-
$c = 1;
|
80 |
-
|
81 |
-
foreach ($conditions as $ckey => $cval) {
|
82 |
-
$query .= " `" . $ckey . "` = '" . $cval . "'";
|
83 |
-
|
84 |
-
if ($c < count($conditions)) {
|
85 |
-
$query .= " AND";
|
86 |
-
}
|
87 |
-
|
88 |
-
$c++;
|
89 |
-
}
|
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)) {
|
98 |
-
if (!empty($records)) {
|
99 |
-
$data = array();
|
100 |
-
|
101 |
-
foreach ($records as $record) {
|
102 |
-
$data[] = $this -> init_class($this -> model, $record);
|
103 |
-
}
|
104 |
-
|
105 |
-
if ($assign == true) {
|
106 |
-
$this -> data = $data;
|
107 |
-
}
|
108 |
-
|
109 |
-
return $data;
|
110 |
-
}
|
111 |
-
}
|
112 |
-
|
113 |
-
return false;
|
114 |
-
}
|
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')) {
|
127 |
-
$this -> validate($r);
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
if (empty($this -> errors)) {
|
132 |
-
switch ($this -> model) {
|
133 |
-
case 'Slide' :
|
134 |
-
$this -> data -> image = basename($this -> data -> image_url);
|
135 |
-
break;
|
136 |
-
}
|
137 |
-
|
138 |
-
//the MySQL query
|
139 |
-
$query = (empty($this -> data -> id)) ? $this -> insert_query($this -> model) : $this -> update_query($this -> model);
|
140 |
-
|
141 |
-
if ($wpdb -> query($query)) {
|
142 |
-
$this -> insertid = $insertid = (empty($this -> data -> id)) ? $wpdb -> insert_id : $this -> data -> id;
|
143 |
-
return true;
|
144 |
-
}
|
145 |
-
}
|
146 |
-
|
147 |
-
return false;
|
148 |
-
}
|
149 |
-
|
150 |
-
function save_field($field = null, $value = null, $conditions = array()) {
|
151 |
-
if (!empty($this -> model)) {
|
152 |
-
global $wpdb;
|
153 |
-
|
154 |
-
if (!empty($field)) {
|
155 |
-
$query = "UPDATE `" . $this -> table . "` SET `" . $field . "` = '" . $value . "'";
|
156 |
-
|
157 |
-
if (!empty($conditions) && is_array($conditions)) {
|
158 |
-
$query .= " WHERE";
|
159 |
-
$c = 1;
|
160 |
-
|
161 |
-
foreach ($conditions as $ckey => $cval) {
|
162 |
-
$query .= " `" . $ckey . "` = '" . $cval . "'";
|
163 |
-
|
164 |
-
if ($c < count($conditions)) {
|
165 |
-
$query .= " AND";
|
166 |
-
}
|
167 |
-
|
168 |
-
$c++;
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
if ($wpdb -> query($query)) {
|
173 |
-
return true;
|
174 |
-
}
|
175 |
-
}
|
176 |
-
}
|
177 |
-
|
178 |
-
return false;
|
179 |
-
}
|
180 |
-
|
181 |
-
function delete($record_id = '') {
|
182 |
-
global $wpdb;
|
183 |
-
|
184 |
-
if (!empty($record_id) && $record = $this -> find(array('id' => $record_id))) {
|
185 |
-
$query = "DELETE FROM `" . $this -> table . "` WHERE `id` = '" . $record_id . "' LIMIT 1";
|
186 |
-
|
187 |
-
if ($wpdb -> query($query)) {
|
188 |
-
//do nothing...
|
189 |
-
return true;
|
190 |
-
}
|
191 |
-
}
|
192 |
-
|
193 |
-
return false;
|
194 |
-
}
|
195 |
-
|
196 |
-
function insert_query($model = '') {
|
197 |
-
if (!empty($model)) {
|
198 |
-
global $wpdb;
|
199 |
-
|
200 |
-
if (!empty($this -> data)) {
|
201 |
-
if (empty($this -> data -> id)) {
|
202 |
-
$query1 = "INSERT INTO `" . $this -> table . "` (";
|
203 |
-
$query2 = "";
|
204 |
-
$c = 1;
|
205 |
-
unset($this -> fields['key']);
|
206 |
-
|
207 |
-
foreach (array_keys($this -> fields) as $field) {
|
208 |
-
if (!empty($this -> data -> {$field}) || $this -> data -> {$field} == "0") {
|
209 |
-
if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
|
210 |
-
$value = serialize($this -> data -> {$field});
|
211 |
-
} else {
|
212 |
-
$value = mysql_escape_string($this -> data -> {$field});
|
213 |
-
}
|
214 |
-
|
215 |
-
$query1 .= "`" . $field . "`";
|
216 |
-
$query2 .= "'" . $value . "'";
|
217 |
-
|
218 |
-
if ($c < count($this -> fields)) {
|
219 |
-
$query1 .= ", ";
|
220 |
-
$query2 .= ", ";
|
221 |
-
}
|
222 |
-
}
|
223 |
-
|
224 |
-
$c++;
|
225 |
-
}
|
226 |
-
|
227 |
-
$query1 .= ") VALUES (";
|
228 |
-
$query = $query1 . "" . $query2 . ");";
|
229 |
-
|
230 |
-
return $query;
|
231 |
-
} else {
|
232 |
-
$query = $this -> update_query($model);
|
233 |
-
|
234 |
-
return $query;
|
235 |
-
}
|
236 |
-
}
|
237 |
-
}
|
238 |
-
|
239 |
-
return false;
|
240 |
-
}
|
241 |
-
|
242 |
-
function update_query($model = '') {
|
243 |
-
if (!empty($model)) {
|
244 |
-
global $wpdb;
|
245 |
-
|
246 |
-
if (!empty($this -> data)) {
|
247 |
-
$query = "UPDATE `" . $this -> table . "` SET ";
|
248 |
-
$c = 1;
|
249 |
-
|
250 |
-
unset($this -> fields['id']);
|
251 |
-
unset($this -> fields['key']);
|
252 |
-
unset($this -> fields['created']);
|
253 |
-
|
254 |
-
foreach (array_keys($this -> fields) as $field) {
|
255 |
-
//if (!empty($this -> data -> {$field}) || $this -> data -> {$field} == "0") {
|
256 |
-
if (is_array($this -> data -> {$field}) || is_object($this -> data -> {$field})) {
|
257 |
-
$value = serialize($this -> data -> {$field});
|
258 |
-
} else {
|
259 |
-
$value = mysql_escape_string($this -> data -> {$field});
|
260 |
-
}
|
261 |
-
|
262 |
-
$query .= "`" . $field . "` = '" . $value . "'";
|
263 |
-
|
264 |
-
if ($c < count($this -> fields)) {
|
265 |
-
$query .= ", ";
|
266 |
-
}
|
267 |
-
//}
|
268 |
-
|
269 |
-
$c++;
|
270 |
-
}
|
271 |
-
|
272 |
-
$query .= " WHERE `id` = '" . $this -> data -> id . "' LIMIT 1";
|
273 |
-
|
274 |
-
return $query;
|
275 |
-
}
|
276 |
-
}
|
277 |
-
|
278 |
-
return false;
|
279 |
-
}
|
280 |
-
}
|
281 |
-
|
282 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/helpers/form.php
DELETED
@@ -1,89 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class GalleryFormHelper extends GalleryPlugin {
|
4 |
-
|
5 |
-
function hidden($name = '', $args = array()) {
|
6 |
-
global $wpcoHtml;
|
7 |
-
|
8 |
-
$defaults = array(
|
9 |
-
'value' => (empty($args['value'])) ? $this -> Html -> field_value($name) : $args['value'],
|
10 |
-
);
|
11 |
-
|
12 |
-
$r = wp_parse_args($args, $defaults);
|
13 |
-
extract($r, EXTR_SKIP);
|
14 |
-
|
15 |
-
ob_start();
|
16 |
-
|
17 |
-
?><input type="hidden" name="<?= $this -> Html -> field_name($name); ?>" value="<?= $value; ?>" id="<?= $name; ?>" /><?php
|
18 |
-
|
19 |
-
$hidden = ob_get_clean();
|
20 |
-
return $hidden;
|
21 |
-
}
|
22 |
-
|
23 |
-
function text($name = '', $args = array()) {
|
24 |
-
$defaults = array(
|
25 |
-
'id' => (empty($args['id'])) ? $name : $args['id'],
|
26 |
-
'width' => '100%',
|
27 |
-
'class' => "widefat",
|
28 |
-
'error' => true,
|
29 |
-
'value' => (empty($args['value'])) ? GalleryHtmlHelper::field_value($name) : $args['value'],
|
30 |
-
'autocomplete' => "on",
|
31 |
-
);
|
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();
|
40 |
-
|
41 |
-
?><input class="<?= $class; ?>" type="text" autocomplete="<?= $autocomplete; ?>" style="width:<?= $width; ?>" name="<?= $this -> Html -> field_name($name); ?>" value="<?= $value; ?>" id="<?= $id; ?>" /><?php
|
42 |
-
|
43 |
-
if ($error == true) {
|
44 |
-
echo $this -> Html -> field_error($name);
|
45 |
-
}
|
46 |
-
|
47 |
-
$text = ob_get_clean();
|
48 |
-
return $text;
|
49 |
-
}
|
50 |
-
|
51 |
-
function textarea($name = '', $args = array()) {
|
52 |
-
$defaults = array(
|
53 |
-
'error' => true,
|
54 |
-
'width' => '100%',
|
55 |
-
'class' => "widefat",
|
56 |
-
'rows' => 4,
|
57 |
-
'cols' => "100%",
|
58 |
-
);
|
59 |
-
|
60 |
-
$r = wp_parse_args($args, $defaults);
|
61 |
-
extract($r, EXTR_SKIP);
|
62 |
-
|
63 |
-
ob_start();
|
64 |
-
|
65 |
-
?><textarea class="<?= $class; ?>" name="<?= $this -> Html -> field_name($name); ?>" rows="<?= $rows; ?>" style="width:<?= $width; ?>;" cols="<?= $cols; ?>" id="<?= $name; ?>"><?= $this -> Html -> field_value($name); ?></textarea><?php
|
66 |
-
|
67 |
-
if ($error == true) {
|
68 |
-
echo $this -> Html -> field_error($name);
|
69 |
-
}
|
70 |
-
|
71 |
-
$textarea = ob_get_clean();
|
72 |
-
return $textarea;
|
73 |
-
}
|
74 |
-
|
75 |
-
function submit($name = '', $args = array()) {
|
76 |
-
$defaults = array('class' => "button-primary");
|
77 |
-
$r = wp_parse_args($args, $defaults);
|
78 |
-
extract($r, EXTR_SKIP);
|
79 |
-
|
80 |
-
ob_start();
|
81 |
-
|
82 |
-
?><input class="<?= $class; ?>" type="submit" name="<?= $this -> Html -> sanitize($name); ?>" value="<?= $name; ?>" /><?php
|
83 |
-
|
84 |
-
$submit = ob_get_clean();
|
85 |
-
return $submit;
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/helpers/html.php
DELETED
@@ -1,177 +0,0 @@
|
|
1 |
-
<?php
|
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'],
|
8 |
-
'target' => "_self",
|
9 |
-
'class' => "wpco",
|
10 |
-
'rel' => "",
|
11 |
-
'onclick' => "",
|
12 |
-
);
|
13 |
-
|
14 |
-
$r = wp_parse_args($args, $defaults);
|
15 |
-
extract($r, EXTR_SKIP);
|
16 |
-
|
17 |
-
ob_start();
|
18 |
-
|
19 |
-
?><a class="<?= $class; ?>" rel="<?= $rel; ?>" <?= (!empty($onclick)) ? 'onclick="' . $onclick . '"' : ''; ?> href="<?= $href; ?>" target="<?= $target; ?>" title="<?= $title; ?>"><?= $name; ?></a><?php
|
20 |
-
|
21 |
-
$link = ob_get_clean();
|
22 |
-
return $link;
|
23 |
-
}
|
24 |
-
|
25 |
-
function filename($url = null) {
|
26 |
-
if (!empty($url)) {
|
27 |
-
return basename($url);
|
28 |
-
}
|
29 |
-
|
30 |
-
return false;
|
31 |
-
}
|
32 |
-
|
33 |
-
function thumbname($filename = null, $append = "thumb") {
|
34 |
-
if (!empty($filename)) {
|
35 |
-
$name = $this -> strip_ext($filename, "name");
|
36 |
-
$ext = $this -> strip_ext($filename, "ext");
|
37 |
-
|
38 |
-
return $name . '-' . $append . '.' . $ext;
|
39 |
-
}
|
40 |
-
|
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;
|
50 |
-
}
|
51 |
-
|
52 |
-
function field_name($name = '') {
|
53 |
-
if (!empty($name)) {
|
54 |
-
if ($mn = $this -> strip_mn($name)) {
|
55 |
-
return $mn[1] . '[' . $mn[2] . ']';
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
return $name;
|
60 |
-
}
|
61 |
-
|
62 |
-
function field_error($name = '', $el = "p") {
|
63 |
-
if (!empty($name)) {
|
64 |
-
if ($mn = $this -> strip_mn($name)) {
|
65 |
-
$errors = array();
|
66 |
-
|
67 |
-
switch ($mn[1]) {
|
68 |
-
case 'Slide' :
|
69 |
-
$errors = GallerySlide::validate($_POST);
|
70 |
-
break;
|
71 |
-
}
|
72 |
-
|
73 |
-
if (!empty($errors[$mn[2]])) {
|
74 |
-
$error = '<' . $el . ' class="' . $this -> pre . 'error">' . $errors[$mn[2]] . '</' . $el . '>';
|
75 |
-
|
76 |
-
return $error;
|
77 |
-
}
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
return false;
|
82 |
-
}
|
83 |
-
|
84 |
-
function field_value($name = '') {
|
85 |
-
if ($mn = $this -> strip_mn($name)) {
|
86 |
-
|
87 |
-
$value = $this -> {$mn[1]} -> data -> {$mn[2]};
|
88 |
-
|
89 |
-
return $value;
|
90 |
-
}
|
91 |
-
|
92 |
-
return false;
|
93 |
-
}
|
94 |
-
|
95 |
-
function retainquery($add = '') {
|
96 |
-
$url = $_SERVER['REQUEST_URI'];
|
97 |
-
|
98 |
-
if (($urls = @explode("?", $url)) !== false) {
|
99 |
-
if (!empty($urls[1])) {
|
100 |
-
if (!empty($add)) {
|
101 |
-
if (($adds = explode("&", str_replace("&", "&", $add))) !== false) {
|
102 |
-
foreach ($adds as $qstring) {
|
103 |
-
if (($qparts = @explode("=", $qstring)) !== false) {
|
104 |
-
if (!empty($qparts[0])) {
|
105 |
-
if (preg_match("/\&?" . $qparts[0] . "\=([0-9a-z+]*)/i", $urls[1], $matches)) {
|
106 |
-
$urls[1] = preg_replace("/\&?" . $qparts[0] . "\=([0-9a-z+]*)/i", "", $urls[1]);
|
107 |
-
}
|
108 |
-
}
|
109 |
-
}
|
110 |
-
}
|
111 |
-
}
|
112 |
-
}
|
113 |
-
}
|
114 |
-
}
|
115 |
-
|
116 |
-
$urls[1] = preg_replace("/\&?" . $this -> pre . "message\=([0-9a-z+]*)/i", "", $urls[1]);
|
117 |
-
$url = $urls[0];
|
118 |
-
$url .= '?';
|
119 |
-
$url .= (empty($urls[1])) ? '' : $urls[1] . '&';
|
120 |
-
$url .= $add;
|
121 |
-
|
122 |
-
return preg_replace("/\?(\&)?/si", "?", $url);
|
123 |
-
}
|
124 |
-
|
125 |
-
function strip_ext($filename = '', $return = 'ext') {
|
126 |
-
if (!empty($filename)) {
|
127 |
-
$extArray = split("[/\\.]", $filename);
|
128 |
-
|
129 |
-
if ($return == 'ext') {
|
130 |
-
$p = count($extArray) - 1;
|
131 |
-
$extension = $extArray[$p];
|
132 |
-
return $extension;
|
133 |
-
} else {
|
134 |
-
$p = count($extArray) - 2;
|
135 |
-
$filename = $extArray[$p];
|
136 |
-
return $filename;
|
137 |
-
}
|
138 |
-
}
|
139 |
-
|
140 |
-
return false;
|
141 |
-
}
|
142 |
-
|
143 |
-
function strip_mn($name = '') {
|
144 |
-
if (!empty($name)) {
|
145 |
-
if (preg_match("/^(.*?)\.(.*?)$/si", $name, $matches)) {
|
146 |
-
return $matches;
|
147 |
-
}
|
148 |
-
}
|
149 |
-
|
150 |
-
return false;
|
151 |
-
}
|
152 |
-
|
153 |
-
function gen_date($format = "Y-m-d H:i:s", $time = false) {
|
154 |
-
$time = (empty($time)) ? time() : $time;
|
155 |
-
$date = date($format, $time);
|
156 |
-
|
157 |
-
return $date;
|
158 |
-
}
|
159 |
-
|
160 |
-
function array_to_object($array = array()) {
|
161 |
-
//type casting...
|
162 |
-
return (object) $array;
|
163 |
-
}
|
164 |
-
|
165 |
-
function sanitize($string = '', $sep = '-') {
|
166 |
-
if (!empty($string)) {
|
167 |
-
$string = ereg_replace("[^0-9a-z" . $sep . "]", "", strtolower(str_replace(" ", $sep, $string)));
|
168 |
-
$string = preg_replace("/" . $sep . "[" . $sep . "]*/i", $sep, $string);
|
169 |
-
|
170 |
-
return $string;
|
171 |
-
}
|
172 |
-
|
173 |
-
return false;
|
174 |
-
}
|
175 |
-
}
|
176 |
-
|
177 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/helpers/metabox.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class GalleryMetaboxHelper extends GalleryPlugin {
|
4 |
-
|
5 |
-
var $name = 'Metabox';
|
6 |
-
|
7 |
-
function GalleryMetaboxHelper() {
|
8 |
-
$url = explode("&", $_SERVER['REQUEST_URI']);
|
9 |
-
$this -> url = $url[0];
|
10 |
-
}
|
11 |
-
|
12 |
-
function settings_submit() {
|
13 |
-
$this -> render('metaboxes/settings-submit', false, true, 'admin');
|
14 |
-
}
|
15 |
-
|
16 |
-
function settings_general() {
|
17 |
-
$this -> render('metaboxes/settings-general', false, true, 'admin');
|
18 |
-
}
|
19 |
-
|
20 |
-
function settings_styles() {
|
21 |
-
$this -> render('metaboxes/settings-styles', false, true, 'admin');
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/images/icon.png
DELETED
Binary file
|
trunk/images/left.gif
DELETED
Binary file
|
trunk/images/link.gif
DELETED
Binary file
|
trunk/images/right.gif
DELETED
Binary file
|
trunk/images/scroll-left.gif
DELETED
Binary file
|
trunk/images/scroll-right.gif
DELETED
Binary file
|
trunk/js/admin.js
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function(){
|
2 |
-
jQuery("input[id*=checkboxall]").click(function() {
|
3 |
-
var checked_status = this.checked;
|
4 |
-
jQuery("input[id*=checklist]").each(function() {
|
5 |
-
this.checked = checked_status;
|
6 |
-
});
|
7 |
-
});
|
8 |
-
|
9 |
-
jQuery("input[id*=checkinvert]").click(function() {
|
10 |
-
this.checked = false;
|
11 |
-
|
12 |
-
jQuery("input[id*=checklist]").each(function() {
|
13 |
-
var status = this.checked;
|
14 |
-
|
15 |
-
if (status == true) {
|
16 |
-
this.checked = false;
|
17 |
-
} else {
|
18 |
-
this.checked = true;
|
19 |
-
}
|
20 |
-
});
|
21 |
-
});
|
22 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/js/gallery.js
DELETED
@@ -1,178 +0,0 @@
|
|
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;
|
8 |
-
this.thumbOpacity=this.navHover=70;
|
9 |
-
this.navOpacity=25;
|
10 |
-
this.scrollSpeed=5;
|
11 |
-
this.letterbox='#000';
|
12 |
-
this.n=n;
|
13 |
-
this.c=0;
|
14 |
-
this.a=[]
|
15 |
-
};
|
16 |
-
|
17 |
-
TINY.slideshow.prototype={
|
18 |
-
init:function(s,z,b,f,q){
|
19 |
-
s=tid(s);
|
20 |
-
var m= tag('li',s), i=0, w=0;
|
21 |
-
this.l=m.length;
|
22 |
-
this.q=tid(q);
|
23 |
-
this.f=tid(z);
|
24 |
-
this.r=tid(this.info);
|
25 |
-
this.o=parseInt(TINY.style.val(z,'width'));
|
26 |
-
if(this.thumbs){
|
27 |
-
var u=tid(this.left), r=tid(this.right);
|
28 |
-
u.onmouseover=new Function('TINY.scroll.init("'+this.thumbs+'",-1,'+this.scrollSpeed+')');
|
29 |
-
u.onmouseout=r.onmouseout=new Function('TINY.scroll.cl("'+this.thumbs+'")');
|
30 |
-
r.onmouseover=new Function('TINY.scroll.init("'+this.thumbs+'",1,'+this.scrollSpeed+')');
|
31 |
-
this.p=tid(this.thumbs)
|
32 |
-
}
|
33 |
-
for(i;i<this.l;i++){
|
34 |
-
this.a[i]={};
|
35 |
-
var h=m[i], a=this.a[i];
|
36 |
-
a.t= tag('h3',h)[0].innerHTML;
|
37 |
-
a.d= tag('p',h)[0].innerHTML;
|
38 |
-
a.l= tag('a',h)[0]? tag('a',h)[0].href:'';
|
39 |
-
a.p= tag('span',h)[0].innerHTML;
|
40 |
-
if(this.thumbs){
|
41 |
-
var g= tag('img',h)[0];
|
42 |
-
this.p.appendChild(g);
|
43 |
-
w+=parseInt(g.offsetWidth);
|
44 |
-
if(i!=this.l-1){
|
45 |
-
g.style.marginRight=this.spacing+'px';
|
46 |
-
w+=this.spacing
|
47 |
-
}
|
48 |
-
this.p.style.width=w+'px';
|
49 |
-
g.style.opacity=this.thumbOpacity/100;
|
50 |
-
g.style.filter='alpha(opacity='+this.thumbOpacity+')';
|
51 |
-
g.onmouseover=new Function('TINY.alpha.set(this,100,5)');
|
52 |
-
g.onmouseout=new Function('TINY.alpha.set(this,'+this.thumbOpacity+',5)');
|
53 |
-
g.onclick=new Function(this.n+'.pr('+i+',1)')
|
54 |
-
}
|
55 |
-
}
|
56 |
-
if(b&&f){
|
57 |
-
b=tid(b);
|
58 |
-
f=tid(f);
|
59 |
-
b.style.opacity=f.style.opacity=this.navOpacity/100;
|
60 |
-
b.style.filter=f.style.filter='alpha(opacity='+this.navOpacity+')';
|
61 |
-
b.onmouseover=f.onmouseover=new Function('TINY.alpha.set(this,'+this.navHover+',5)');
|
62 |
-
b.onmouseout=f.onmouseout=new Function('TINY.alpha.set(this,'+this.navOpacity+',5)');
|
63 |
-
b.onclick=new Function(this.n+'.mv(-1,1)');
|
64 |
-
f.onclick=new Function(this.n+'.mv(1,1)')
|
65 |
-
}
|
66 |
-
this.auto?this.is(0,0):this.is(0,1)
|
67 |
-
},
|
68 |
-
mv:function(d,c){
|
69 |
-
var t=this.c+d;
|
70 |
-
this.c=t=t<0?this.l-1:t>this.l-1?0:t;
|
71 |
-
this.pr(t,c)
|
72 |
-
},
|
73 |
-
pr:function(t,c){
|
74 |
-
clearTimeout(this.lt);
|
75 |
-
if(c){
|
76 |
-
clearTimeout(this.at)
|
77 |
-
}
|
78 |
-
this.c=t;
|
79 |
-
this.is(t,c)
|
80 |
-
},
|
81 |
-
is:function(s,c){
|
82 |
-
if(this.info){
|
83 |
-
TINY.height.set(this.r,1,this.infoSpeed/2,-1)
|
84 |
-
}
|
85 |
-
var i=new Image();
|
86 |
-
i.style.opacity=0;
|
87 |
-
i.style.filter='alpha(opacity=0)';
|
88 |
-
this.i=i;
|
89 |
-
i.onload=new Function(this.n+'.le('+s+','+c+')');
|
90 |
-
i.src=this.a[s].p;
|
91 |
-
if(this.thumbs){
|
92 |
-
var a= tag('img',this.p), l=a.length, x=0;
|
93 |
-
for(x;x<l;x++){
|
94 |
-
a[x].style.borderColor=x!=s?'':this.active
|
95 |
-
}
|
96 |
-
}
|
97 |
-
},
|
98 |
-
le:function(s,c){
|
99 |
-
this.f.appendChild(this.i);
|
100 |
-
var w=this.o-parseInt(this.i.offsetWidth);
|
101 |
-
if(w>0){
|
102 |
-
var l=Math.floor(w/2);
|
103 |
-
this.i.style.borderLeft=l+'px solid '+this.letterbox;
|
104 |
-
this.i.style.borderRight=(w-l)+'px solid '+this.letterbox
|
105 |
-
}
|
106 |
-
TINY.alpha.set(this.i,100,this.imgSpeed);
|
107 |
-
var n=new Function(this.n+'.nf('+s+')');
|
108 |
-
this.lt=setTimeout(n,this.imgSpeed*100);
|
109 |
-
if(!c){
|
110 |
-
this.at=setTimeout(new Function(this.n+'.mv(1,0)'),this.speed*1000)
|
111 |
-
}
|
112 |
-
if(this.a[s].l!=''){
|
113 |
-
this.q.onclick=new Function('window.location="'+this.a[s].l+'"');
|
114 |
-
this.q.onmouseover=new Function('this.className="'+this.link+'"');
|
115 |
-
this.q.onmouseout=new Function('this.className=""');
|
116 |
-
this.q.style.cursor='pointer'
|
117 |
-
}else{
|
118 |
-
this.q.onclick=this.q.onmouseover=null;
|
119 |
-
this.q.style.cursor='default'
|
120 |
-
}
|
121 |
-
var m= tag('img',this.f);
|
122 |
-
if(m.length>2){
|
123 |
-
this.f.removeChild(m[0])
|
124 |
-
}
|
125 |
-
},
|
126 |
-
nf:function(s){
|
127 |
-
if(this.info){
|
128 |
-
s=this.a[s];
|
129 |
-
tag('h3',this.r)[0].innerHTML=s.t;
|
130 |
-
tag('p',this.r)[0].innerHTML=s.d;
|
131 |
-
this.r.style.height='auto';
|
132 |
-
var h=parseInt(this.r.offsetHeight);
|
133 |
-
this.r.style.height=0;
|
134 |
-
TINY.height.set(this.r,h,this.infoSpeed,0)
|
135 |
-
}
|
136 |
-
}
|
137 |
-
};
|
138 |
-
|
139 |
-
TINY.scroll=function(){
|
140 |
-
return{
|
141 |
-
init:function(e,d,s){
|
142 |
-
e=typeof e=='object'?e: tid(e); var p=e.style.left||TINY.style.val(e,'left'); e.style.left=p;
|
143 |
-
var l=d==1?parseInt(e.offsetWidth)-parseInt(e.parentNode.offsetWidth):0; e.si=setInterval(function(){TINY.scroll.mv(e,l,d,s)},20)
|
144 |
-
},
|
145 |
-
mv:function(e,l,d,s){
|
146 |
-
var c=parseInt(e.style.left); if(c==l){TINY.scroll.cl(e)}else{var i=Math.abs(l+c); i=i<s?i:s; var n=c-i*d; e.style.left=n+'px'}
|
147 |
-
},
|
148 |
-
cl:function(e){e=typeof e=='object'?e: tid(e); clearInterval(e.si)}
|
149 |
-
}
|
150 |
-
}();
|
151 |
-
|
152 |
-
TINY.height=function(){
|
153 |
-
return{
|
154 |
-
set:function(e,h,s,d){
|
155 |
-
e=typeof e=='object'?e:tid(e); var oh=e.offsetHeight, ho=e.style.height||TINY.style.val(e,'height');
|
156 |
-
ho=oh-parseInt(ho); var hd=oh-ho>h?-1:1; clearInterval(e.si); e.si=setInterval(function(){TINY.height.tw(e,h,ho,hd,s)},20)
|
157 |
-
},
|
158 |
-
tw:function(e,h,ho,hd,s){
|
159 |
-
var oh=e.offsetHeight-ho;
|
160 |
-
if(oh==h){clearInterval(e.si)}else{if(oh!=h){e.style.height=oh+(Math.ceil(Math.abs(h-oh)/s)*hd)+'px'}}
|
161 |
-
}
|
162 |
-
}
|
163 |
-
}();
|
164 |
-
|
165 |
-
TINY.alpha=function(){
|
166 |
-
return{
|
167 |
-
set:function(e,a,s){
|
168 |
-
e=typeof e=='object'?e:tid(e); var o=e.style.opacity||TINY.style.val(e,'opacity'),
|
169 |
-
d=a>o*100?1:-1; e.style.opacity=o; clearInterval(e.ai); e.ai=setInterval(function(){TINY.alpha.tw(e,a,d,s)},20)
|
170 |
-
},
|
171 |
-
tw:function(e,a,d,s){
|
172 |
-
var o=Math.round(e.style.opacity*100);
|
173 |
-
if(o==a){clearInterval(e.ai)}else{var n=o+Math.ceil(Math.abs(a-o)/s)*d; e.style.opacity=n/100; e.style.filter='alpha(opacity='+n+')'}
|
174 |
-
}
|
175 |
-
}
|
176 |
-
}();
|
177 |
-
|
178 |
-
TINY.style=function(){return{val:function(e,p){e=typeof e=='object'?e:tid(e); return e.currentStyle?e.currentStyle[p]:document.defaultView.getComputedStyle(e,null).getPropertyValue(p)}}}();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/models/slide.php
DELETED
@@ -1,98 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class GallerySlide extends GalleryDbHelper {
|
4 |
-
|
5 |
-
var $table;
|
6 |
-
var $model = 'Slide';
|
7 |
-
var $controller = "slides";
|
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 |
-
'description' => "TEXT NOT NULL",
|
17 |
-
'image' => "VARCHAR(50) NOT NULL DEFAULT ''",
|
18 |
-
'image_url' => "VARCHAR(200) NOT NULL DEFAULT ''",
|
19 |
-
'link' => "VARCHAR(200) NOT NULL DEFAULT ''",
|
20 |
-
'order' => "INT(11) NOT NULL DEFAULT '0'",
|
21 |
-
'created' => "DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'",
|
22 |
-
'modified' => "DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'",
|
23 |
-
'key' => "PRIMARY KEY (`id`)",
|
24 |
-
);
|
25 |
-
|
26 |
-
function GallerySlide($data = array()) {
|
27 |
-
global $wpdb;
|
28 |
-
$this -> table = $wpdb -> prefix . strtolower($this -> pre) . "_" . $this -> controller;
|
29 |
-
$this -> check_table($this -> model);
|
30 |
-
|
31 |
-
if (!empty($data)) {
|
32 |
-
foreach ($data as $dkey => $dval) {
|
33 |
-
$this -> {$dkey} = $dval;
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
-
return true;
|
38 |
-
}
|
39 |
-
|
40 |
-
function defaults() {
|
41 |
-
$defaults = array(
|
42 |
-
'order' => 0,
|
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($title)) { $this -> errors['title'] = __('Please fill in a title', $this -> plugin_name); }
|
63 |
-
if (empty($description)) { $this -> errors['description'] = __('Please fill in a description', $this -> plugin_name); }
|
64 |
-
if (empty($image_url)) { $this -> errors['image_url'] = __('Please specify an image', $this -> plugin_name); }
|
65 |
-
else {
|
66 |
-
if ($image = wp_remote_fopen($image_url)) {
|
67 |
-
$filename = basename($image_url);
|
68 |
-
$filepath = ABSPATH . 'wp-content/uploads/' . $this -> plugin_name . '/';
|
69 |
-
$filefull = $filepath . $filename;
|
70 |
-
|
71 |
-
if (!file_exists($filefull)) {
|
72 |
-
$fh = @fopen($filefull, "w");
|
73 |
-
@fwrite($fh, $image);
|
74 |
-
@fclose($fh);
|
75 |
-
|
76 |
-
$name = GalleryHtmlHelper::strip_ext($filename, 'filename');
|
77 |
-
$ext = GalleryHtmlHelper::strip_ext($filename, 'ext');
|
78 |
-
$thumbfull = $filepath . $name . '-thumb.' . $ext;
|
79 |
-
$smallfull = $filepath . $name . '-small.' . $ext;
|
80 |
-
|
81 |
-
image_resize($filefull, $width = null, $height = 75, $crop = false, $append = 'thumb', $dest = null, $quality = 100);
|
82 |
-
image_resize($filefull, $width = 50, $height = 50, $crop = true, $append = 'small', $dest = null, $quality = 100);
|
83 |
-
|
84 |
-
@chmod($filefull, 0777);
|
85 |
-
@chmod($thumbfull, 0777);
|
86 |
-
@chmod($smallfull, 0777);
|
87 |
-
}
|
88 |
-
}
|
89 |
-
}
|
90 |
-
} else {
|
91 |
-
$this -> errors[] = __('No data was posted', $this -> plugin_name);
|
92 |
-
}
|
93 |
-
|
94 |
-
return $this -> errors;
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/readme.txt
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
=== Slideshow Gallery ===
|
2 |
-
Contributors: Antonie Potgieter
|
3 |
-
Donate link: http://tribulant.com/
|
4 |
-
Tags: slideshow, gallery, featured content, content gallery, javascript, javascript slideshow, slideshow gallery
|
5 |
-
Requires at least: 2.8
|
6 |
-
Tested up to: 2.8.4
|
7 |
-
Stable tag: 1.0
|
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 |
-
The slideshow is flexible and all aspects can easily be configured.
|
16 |
-
|
17 |
-
Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert `[slideshow]` into its content. To hardcode into your theme, simply use `<?php $Gallery -> slideshow(); ?>`.
|
18 |
-
|
19 |
-
== Installation ==
|
20 |
-
|
21 |
-
Installing the WordPress slideshow gallery plugin is very easy. Simply follow the steps below.
|
22 |
-
|
23 |
-
1. Extract the package to obtain the `slideshow-gallery` folder
|
24 |
-
1. Upload the `slideshow-gallery` folder to the `/wp-content/plugins/` directory
|
25 |
-
1. Activate the plugin through the 'Plugins' menu in WordPress
|
26 |
-
1. Configure the settings according to your needs through the 'Slideshow' > 'Configuration' menu
|
27 |
-
1. Add and manage your slides in the 'Slideshow' section
|
28 |
-
1. Put `[slideshow]` into your posts/pages or `<?php $Gallery -> slideshow(); ?>` into your WordPress theme
|
29 |
-
|
30 |
-
== Frequently Asked Questions ==
|
31 |
-
|
32 |
-
= Can I display/embed multiple instances of the slideshow gallery? =
|
33 |
-
|
34 |
-
Yes, you can
|
35 |
-
|
36 |
-
== Screenshots ==
|
37 |
-
|
38 |
-
1. Slideshow gallery with thumbnails at the bottom
|
39 |
-
2. Slideshow gallery with thumbnails turned OFF
|
40 |
-
3. Slideshow gallery with thumbnails at the top
|
41 |
-
4. Different styles/colors
|
42 |
-
|
43 |
-
== Changelog ==
|
44 |
-
|
45 |
-
= 1.0 =
|
46 |
-
* Initial release of the WordPress Slideshow Gallery plugin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/slideshow-gallery-ajax.php
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
include_once('../../../wp-config.php');
|
4 |
-
include_once(ABSPATH . 'wp-admin/admin-functions.php');
|
5 |
-
|
6 |
-
class GalleryAjax extends GalleryPlugin {
|
7 |
-
|
8 |
-
var $safecommands = array('slides_order');
|
9 |
-
|
10 |
-
function GalleryAjax($cmd) {
|
11 |
-
$this -> register_plugin('gallery', __FILE__);
|
12 |
-
|
13 |
-
if (!empty($cmd)) {
|
14 |
-
if (in_array($cmd, $this -> safecommands) || current_user_can('edit_plugins')) {
|
15 |
-
if (method_exists($this, $cmd)) {
|
16 |
-
$this -> $cmd();
|
17 |
-
}
|
18 |
-
}
|
19 |
-
}
|
20 |
-
}
|
21 |
-
|
22 |
-
function slides_order() {
|
23 |
-
if (!empty($_REQUEST['item'])) {
|
24 |
-
foreach ($_REQUEST['item'] as $order => $slide_id) {
|
25 |
-
$this -> Slide -> save_field('order', $order, array('id' => $slide_id));
|
26 |
-
}
|
27 |
-
|
28 |
-
?><br/><div style="color:red;"><?php _e('Slides have been ordered', $this -> plugin_name); ?></div><?php
|
29 |
-
}
|
30 |
-
}
|
31 |
-
}
|
32 |
-
|
33 |
-
$GalleryAjax = new GalleryAjax($_GET['cmd']);
|
34 |
-
|
35 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/slideshow-gallery-plugin.php
DELETED
@@ -1,472 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class GalleryPlugin {
|
4 |
-
|
5 |
-
//the plugin internal name
|
6 |
-
var $plugin_name;
|
7 |
-
//the plugin absolute path
|
8 |
-
var $plugin_base;
|
9 |
-
var $pre = 'Gallery';
|
10 |
-
var $debugging = true;
|
11 |
-
|
12 |
-
var $helpers = array('Db', 'Html', 'Form', 'Metabox');
|
13 |
-
var $models = array('Slide');
|
14 |
-
|
15 |
-
function register_plugin($name, $base) {
|
16 |
-
$this -> plugin_name = $name;
|
17 |
-
$this -> plugin_base = rtrim(dirname($base), '/');
|
18 |
-
|
19 |
-
$this -> enqueue_scripts();
|
20 |
-
$this -> enqueue_styles();
|
21 |
-
|
22 |
-
$this -> initialize_classes();
|
23 |
-
$this -> initialize_options();
|
24 |
-
|
25 |
-
return true;
|
26 |
-
}
|
27 |
-
|
28 |
-
function init_class($name = null, $params = array()) {
|
29 |
-
if (!empty($name)) {
|
30 |
-
$name = $this -> pre . $name;
|
31 |
-
|
32 |
-
if (class_exists($name)) {
|
33 |
-
if ($class = new $name($params)) {
|
34 |
-
return $class;
|
35 |
-
}
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
$this -> init_class('Country');
|
40 |
-
|
41 |
-
return false;
|
42 |
-
}
|
43 |
-
|
44 |
-
function initialize_classes() {
|
45 |
-
if (!empty($this -> helpers)) {
|
46 |
-
foreach ($this -> helpers as $helper) {
|
47 |
-
$hfile = dirname(__FILE__) . '/helpers/' . strtolower($helper) . '.php';
|
48 |
-
|
49 |
-
if (file_exists($hfile)) {
|
50 |
-
require_once($hfile);
|
51 |
-
|
52 |
-
if (!is_object($this -> {$helper})) {
|
53 |
-
$classname = $this -> pre . $helper . 'Helper';
|
54 |
-
|
55 |
-
if (class_exists($classname, true)) {
|
56 |
-
$this -> {$helper} = new $classname;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
}
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
if (!empty($this -> models)) {
|
64 |
-
foreach ($this -> models as $model) {
|
65 |
-
$mfile = dirname(__FILE__) . '/models/' . strtolower($model) . '.php';
|
66 |
-
|
67 |
-
if (file_exists($mfile)) {
|
68 |
-
require_once($mfile);
|
69 |
-
|
70 |
-
if (!is_object($this -> {$model})) {
|
71 |
-
$classname = $this -> pre . $model;
|
72 |
-
|
73 |
-
if (class_exists($classname, true)) {
|
74 |
-
$this -> {$model} = new $classname;
|
75 |
-
}
|
76 |
-
}
|
77 |
-
}
|
78 |
-
}
|
79 |
-
}
|
80 |
-
}
|
81 |
-
|
82 |
-
function initialize_options() {
|
83 |
-
$styles = array(
|
84 |
-
'width' => "450",
|
85 |
-
'height' => "250",
|
86 |
-
'border' => "1px solid #CCCCCC",
|
87 |
-
'background' => "#000000",
|
88 |
-
'infobackground' => "#000000",
|
89 |
-
'infocolor' => "#FFFFFF",
|
90 |
-
);
|
91 |
-
|
92 |
-
$this -> add_option('styles', $styles);
|
93 |
-
|
94 |
-
//General Settings
|
95 |
-
$this -> add_option('fadespeed', 10);
|
96 |
-
$this -> add_option('navopacity', 25);
|
97 |
-
$this -> add_option('navhover', 70);
|
98 |
-
$this -> add_option('information', "Y");
|
99 |
-
$this -> add_option('infospeed', 10);
|
100 |
-
$this -> add_option('thumbnails', "N");
|
101 |
-
$this -> add_option('thumbposition', "bottom");
|
102 |
-
$this -> add_option('thumbopacity', 70);
|
103 |
-
$this -> add_option('thumbscrollspeed', 5);
|
104 |
-
$this -> add_option('thumbspacing', 5);
|
105 |
-
$this -> add_option('thumbactive', "#FFFFFF");
|
106 |
-
$this -> add_option('autoslide', "Y");
|
107 |
-
$this -> add_option('autospeed', 10);
|
108 |
-
}
|
109 |
-
|
110 |
-
function render_msg($message = '') {
|
111 |
-
$this -> render('msg-top', array('message' => $message), true, 'admin');
|
112 |
-
}
|
113 |
-
|
114 |
-
function render_err($message = '') {
|
115 |
-
$this -> render('err-top', array('message' => $message), true, 'admin');
|
116 |
-
}
|
117 |
-
|
118 |
-
function redirect($location = '', $msgtype = '', $message = '') {
|
119 |
-
$url = $location;
|
120 |
-
|
121 |
-
if ($msgtype == "message") {
|
122 |
-
$url .= '&' . $this -> pre . 'updated=true';
|
123 |
-
} elseif ($msgtype == "error") {
|
124 |
-
$url .= '&' . $this -> pre . 'error=true';
|
125 |
-
}
|
126 |
-
|
127 |
-
if (!empty($message)) {
|
128 |
-
$url .= '&' . $this -> pre . 'message=' . urlencode($message);
|
129 |
-
}
|
130 |
-
|
131 |
-
?>
|
132 |
-
|
133 |
-
<script type="text/javascript">
|
134 |
-
window.location = '<?= (empty($url)) ? get_option('home') : $url; ?>';
|
135 |
-
</script>
|
136 |
-
|
137 |
-
<?php
|
138 |
-
|
139 |
-
flush();
|
140 |
-
}
|
141 |
-
|
142 |
-
function paginate($model = null, $fields = '*', $sub = null, $conditions = null, $searchterm = null, $per_page = 10, $order = array('modified', "DESC")) {
|
143 |
-
global $wpdb;
|
144 |
-
|
145 |
-
if (!empty($model)) {
|
146 |
-
global $paginate;
|
147 |
-
$paginate = $this -> vendor('Paginate');
|
148 |
-
$paginate -> table = $this -> {$model} -> table;
|
149 |
-
$paginate -> sub = (empty($sub)) ? $this -> {$model} -> controller : $sub;
|
150 |
-
$paginate -> fields = (empty($fields)) ? '*' : $fields;
|
151 |
-
$paginate -> where = (empty($conditions)) ? false : $conditions;
|
152 |
-
$paginate -> searchterm = (empty($searchterm)) ? false : $searchterm;
|
153 |
-
$paginate -> per_page = $per_page;
|
154 |
-
$paginate -> order = $order;
|
155 |
-
|
156 |
-
$data = $paginate -> start_paging($_GET[$this -> pre . 'page']);
|
157 |
-
|
158 |
-
if (!empty($data)) {
|
159 |
-
$newdata = array();
|
160 |
-
|
161 |
-
foreach ($data as $record) {
|
162 |
-
$newdata[] = $this -> init_class($model, $record);
|
163 |
-
}
|
164 |
-
|
165 |
-
$data = array();
|
166 |
-
$data[$model] = $newdata;
|
167 |
-
$data['Paginate'] = $paginate;
|
168 |
-
}
|
169 |
-
|
170 |
-
return $data;
|
171 |
-
}
|
172 |
-
|
173 |
-
return false;
|
174 |
-
}
|
175 |
-
|
176 |
-
function vendor($name = '', $folder = '') {
|
177 |
-
if (!empty($name)) {
|
178 |
-
$filename = 'class.' . strtolower($name) . '.php';
|
179 |
-
$filepath = rtrim(dirname(__FILE__), '/') . '/vendors/' . $folder . '';
|
180 |
-
$filefull = $filepath . $filename;
|
181 |
-
|
182 |
-
if (file_exists($filefull)) {
|
183 |
-
require_once($filefull);
|
184 |
-
$class = 'Gallery' . $name;
|
185 |
-
|
186 |
-
if (${$name} = new $class) {
|
187 |
-
return ${$name};
|
188 |
-
}
|
189 |
-
}
|
190 |
-
}
|
191 |
-
|
192 |
-
return false;
|
193 |
-
}
|
194 |
-
|
195 |
-
function check_uploaddir() {
|
196 |
-
$uploaddir = ABSPATH . 'wp-content/uploads/' . $this -> plugin_name . '/';
|
197 |
-
|
198 |
-
if (!file_exists($uploaddir)) {
|
199 |
-
if (@mkdir($uploaddir, 0777)) {
|
200 |
-
@chmod($uploaddir, 0777);
|
201 |
-
return true;
|
202 |
-
} else {
|
203 |
-
$message = __('Uploads folder named "' . $this -> plugin_name . '" cannot be created inside "wp-content/uploads"', $this -> plugin_name);
|
204 |
-
$this -> render_msg($message);
|
205 |
-
}
|
206 |
-
}
|
207 |
-
|
208 |
-
return false;
|
209 |
-
}
|
210 |
-
|
211 |
-
function add_action($action, $function = null, $priority = 10, $params = 1) {
|
212 |
-
if (add_action($action, array($this, (empty($function)) ? $action : $function), $priority, $params)) {
|
213 |
-
return true;
|
214 |
-
}
|
215 |
-
|
216 |
-
return false;
|
217 |
-
}
|
218 |
-
|
219 |
-
function enqueue_scripts() {
|
220 |
-
wp_enqueue_script('jquery');
|
221 |
-
wp_enqueue_script($this -> plugin_name, '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/gallery.js', null, "1.0");
|
222 |
-
|
223 |
-
if (is_admin()) {
|
224 |
-
if (!empty($_GET['page'])) {
|
225 |
-
if ($_GET['page'] == "slideshow-gallery-settings" || ($_GET['page'] == $this -> plugin_name . ".php" && $_GET['method'] == "order")) {
|
226 |
-
wp_enqueue_script('suggest');
|
227 |
-
wp_enqueue_script('jquery-ui-tabs');
|
228 |
-
wp_enqueue_script('wp-lists');
|
229 |
-
wp_enqueue_script('jquery-ui-sortable');
|
230 |
-
wp_enqueue_script('postbox');
|
231 |
-
wp_enqueue_script('post');
|
232 |
-
}
|
233 |
-
}
|
234 |
-
|
235 |
-
wp_enqueue_script($this -> plugin_name . 'admin', '/' . PLUGINDIR . '/' . $this -> plugin_name . '/js/admin.js', null, '1.0');
|
236 |
-
add_thickbox();
|
237 |
-
}
|
238 |
-
|
239 |
-
return true;
|
240 |
-
}
|
241 |
-
|
242 |
-
function enqueue_styles() {
|
243 |
-
$src = '/' . PLUGINDIR . '/' . $this -> plugin_name . '/css/gallery-css.php?1=1';
|
244 |
-
|
245 |
-
if ($styles = $this -> get_option('styles')) {
|
246 |
-
foreach ($styles as $skey => $sval) {
|
247 |
-
$src .= "&" . $skey . "=" . urlencode($sval);
|
248 |
-
}
|
249 |
-
}
|
250 |
-
|
251 |
-
wp_enqueue_style($this -> plugin_name, $src, null, '1.0', 'screen');
|
252 |
-
|
253 |
-
return true;
|
254 |
-
}
|
255 |
-
|
256 |
-
function url() {
|
257 |
-
$url = get_option('siteurl') . substr($this -> plugin_base, strlen(realpath(ABSPATH)));
|
258 |
-
return $url;
|
259 |
-
}
|
260 |
-
|
261 |
-
function add_option($name = '', $value = '') {
|
262 |
-
if (add_option($this -> pre . $name, $value)) {
|
263 |
-
return true;
|
264 |
-
}
|
265 |
-
|
266 |
-
return false;
|
267 |
-
}
|
268 |
-
|
269 |
-
function update_option($name = '', $value = '') {
|
270 |
-
if (update_option($this -> pre . $name, $value)) {
|
271 |
-
return true;
|
272 |
-
}
|
273 |
-
|
274 |
-
return false;
|
275 |
-
}
|
276 |
-
|
277 |
-
function get_option($name = '', $stripslashes = true) {
|
278 |
-
if ($option = get_option($this -> pre . $name)) {
|
279 |
-
if (@unserialize($option) !== false) {
|
280 |
-
return unserialize($option);
|
281 |
-
}
|
282 |
-
|
283 |
-
if ($stripslashes == true) {
|
284 |
-
$option = stripslashes_deep($option);
|
285 |
-
}
|
286 |
-
|
287 |
-
return $option;
|
288 |
-
}
|
289 |
-
|
290 |
-
return false;
|
291 |
-
}
|
292 |
-
|
293 |
-
function debug($var = array()) {
|
294 |
-
if ($this -> debugging) {
|
295 |
-
echo '<pre>' . print_r($var, true) . '</pre>';
|
296 |
-
return true;
|
297 |
-
}
|
298 |
-
|
299 |
-
return false;
|
300 |
-
}
|
301 |
-
|
302 |
-
function check_table($model = null) {
|
303 |
-
global $wpdb;
|
304 |
-
|
305 |
-
if (!empty($model)) {
|
306 |
-
if (!empty($this -> fields) && is_array($this -> fields)) {
|
307 |
-
if (!$wpdb -> get_var("SHOW TABLES LIKE '" . $this -> table . "'")) {
|
308 |
-
$query = "CREATE TABLE `" . $this -> table . "` (";
|
309 |
-
$c = 1;
|
310 |
-
|
311 |
-
foreach ($this -> fields as $field => $attributes) {
|
312 |
-
if ($field != "key") {
|
313 |
-
$query .= "`" . $field . "` " . $attributes . "";
|
314 |
-
} else {
|
315 |
-
$query .= "" . $attributes . "";
|
316 |
-
}
|
317 |
-
|
318 |
-
if ($c < count($this -> fields)) {
|
319 |
-
$query .= ",";
|
320 |
-
}
|
321 |
-
|
322 |
-
$c++;
|
323 |
-
}
|
324 |
-
|
325 |
-
$query .= ") ENGINE=MyISAM AUTO_INCREMENT=1 CHARSET=UTF8;";
|
326 |
-
|
327 |
-
if (!empty($query)) {
|
328 |
-
$this -> table_query[] = $query;
|
329 |
-
}
|
330 |
-
} else {
|
331 |
-
$field_array = $this -> get_fields($this -> table);
|
332 |
-
|
333 |
-
foreach ($this -> fields as $field => $attributes) {
|
334 |
-
if ($field != "key") {
|
335 |
-
$this -> add_field($this -> table, $field, $attributes);
|
336 |
-
}
|
337 |
-
}
|
338 |
-
}
|
339 |
-
|
340 |
-
if (!empty($this -> table_query)) {
|
341 |
-
require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
|
342 |
-
dbDelta($this -> table_query, true);
|
343 |
-
}
|
344 |
-
}
|
345 |
-
}
|
346 |
-
|
347 |
-
return false;
|
348 |
-
}
|
349 |
-
|
350 |
-
function get_fields($table = null) {
|
351 |
-
global $wpdb;
|
352 |
-
|
353 |
-
if (!empty($table)) {
|
354 |
-
$fullname = $table;
|
355 |
-
|
356 |
-
if (($tablefields = mysql_list_fields(DB_NAME, $fullname, $wpdb -> dbh)) !== false) {
|
357 |
-
$columns = mysql_num_fields($tablefields);
|
358 |
-
|
359 |
-
$field_array = array();
|
360 |
-
for ($i = 0; $i < $columns; $i++) {
|
361 |
-
$fieldname = mysql_field_name($tablefields, $i);
|
362 |
-
$field_array[] = $fieldname;
|
363 |
-
}
|
364 |
-
|
365 |
-
return $field_array;
|
366 |
-
}
|
367 |
-
}
|
368 |
-
|
369 |
-
return false;
|
370 |
-
}
|
371 |
-
|
372 |
-
function delete_field($table = '', $field = '') {
|
373 |
-
global $wpdb;
|
374 |
-
|
375 |
-
if (!empty($table)) {
|
376 |
-
if (!empty($field)) {
|
377 |
-
$query = "ALTER TABLE `" . $wpdb -> prefix . "" . $table . "` DROP `" . $field . "`";
|
378 |
-
|
379 |
-
if ($wpdb -> query($query)) {
|
380 |
-
return false;
|
381 |
-
}
|
382 |
-
}
|
383 |
-
}
|
384 |
-
|
385 |
-
return false;
|
386 |
-
}
|
387 |
-
|
388 |
-
function change_field($table = '', $field = '', $newfield = '', $attributes = "TEXT NOT NULL") {
|
389 |
-
global $wpdb;
|
390 |
-
|
391 |
-
if (!empty($table)) {
|
392 |
-
if (!empty($field)) {
|
393 |
-
if (!empty($newfield)) {
|
394 |
-
$field_array = $this -> get_fields($table);
|
395 |
-
|
396 |
-
if (!in_array($field, $field_array)) {
|
397 |
-
if ($this -> add_field($table, $newfield)) {
|
398 |
-
return true;
|
399 |
-
}
|
400 |
-
} else {
|
401 |
-
$query = "ALTER TABLE `" . $table . "` CHANGE `" . $field . "` `" . $newfield . "` " . $attributes . ";";
|
402 |
-
|
403 |
-
if ($wpdb -> query($query)) {
|
404 |
-
return true;
|
405 |
-
}
|
406 |
-
}
|
407 |
-
}
|
408 |
-
}
|
409 |
-
}
|
410 |
-
|
411 |
-
return false;
|
412 |
-
}
|
413 |
-
|
414 |
-
function add_field($table = '', $field = '', $attributes = "TEXT NOT NULL") {
|
415 |
-
global $wpdb;
|
416 |
-
|
417 |
-
if (!empty($table)) {
|
418 |
-
if (!empty($field)) {
|
419 |
-
$field_array = $this -> get_fields($table);
|
420 |
-
|
421 |
-
if (!empty($field_array)) {
|
422 |
-
if (!in_array($field, $field_array)) {
|
423 |
-
$query = "ALTER TABLE `" . $table . "` ADD `" . $field . "` " . $attributes . ";";
|
424 |
-
|
425 |
-
if ($wpdb -> query($query)) {
|
426 |
-
return true;
|
427 |
-
}
|
428 |
-
}
|
429 |
-
}
|
430 |
-
}
|
431 |
-
}
|
432 |
-
|
433 |
-
return false;
|
434 |
-
}
|
435 |
-
|
436 |
-
function render($file = '', $params = array(), $output = true, $folder = 'admin') {
|
437 |
-
//the absolute path to the plugin base
|
438 |
-
$this -> plugin_base = rtrim(dirname(__FILE__), '/');
|
439 |
-
|
440 |
-
if (!empty($file)) {
|
441 |
-
$filename = $file . '.php';
|
442 |
-
$filepath = $this -> plugin_base . '/views/' . $folder . '/';
|
443 |
-
$filefull = $filepath . $filename;
|
444 |
-
|
445 |
-
if (file_exists($filefull)) {
|
446 |
-
if (!empty($params)) {
|
447 |
-
foreach ($params as $pkey => $pval) {
|
448 |
-
${$pkey} = $pval;
|
449 |
-
}
|
450 |
-
}
|
451 |
-
|
452 |
-
if ($output == false) {
|
453 |
-
ob_start();
|
454 |
-
}
|
455 |
-
|
456 |
-
include($filefull);
|
457 |
-
|
458 |
-
if ($output == false) {
|
459 |
-
$data = ob_get_clean();
|
460 |
-
return $data;
|
461 |
-
} else {
|
462 |
-
flush();
|
463 |
-
return true;
|
464 |
-
}
|
465 |
-
}
|
466 |
-
}
|
467 |
-
|
468 |
-
return false;
|
469 |
-
}
|
470 |
-
}
|
471 |
-
|
472 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/slideshow-gallery.php
DELETED
@@ -1,161 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
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. To hardcode into your theme, simply use <code><?php $Gallery -> slideshow(); ?></code>.
|
9 |
-
Version: 1.0
|
10 |
-
*/
|
11 |
-
|
12 |
-
//include the GalleryPlugin class file
|
13 |
-
require_once(dirname(__FILE__) . '/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 |
-
|
21 |
-
$this -> register_plugin('slideshow-gallery', __FILE__);
|
22 |
-
|
23 |
-
//WordPress action hooks
|
24 |
-
$this -> add_action('admin_menu');
|
25 |
-
$this -> add_action('admin_head');
|
26 |
-
$this -> add_action('admin_notices');
|
27 |
-
|
28 |
-
add_shortcode('slideshow', array($this, 'embed'));
|
29 |
-
}
|
30 |
-
|
31 |
-
function admin_menu() {
|
32 |
-
add_menu_page(__('Slideshow', $this -> plugin_name), __('Slideshow', $this -> plugin_name), 10, basename(__FILE__), array($this, 'admin_slides'), $this -> url() . '/images/icon.png');
|
33 |
-
add_submenu_page(basename(__FILE__), __('Configuration', $this -> plugin_name), __('Configuration', $this -> plugin_name), 10, $this -> plugin_name . '-settings', array($this, 'admin_settings'));
|
34 |
-
}
|
35 |
-
|
36 |
-
function admin_head() {
|
37 |
-
$this -> render('head', false, true, 'admin');
|
38 |
-
}
|
39 |
-
|
40 |
-
function admin_notices() {
|
41 |
-
$this -> check_uploaddir();
|
42 |
-
|
43 |
-
if (!empty($_GET[$this -> pre . 'message'])) {
|
44 |
-
$msg_type = (!empty($_GET[$this -> pre . 'updated'])) ? 'msg' : 'err';
|
45 |
-
call_user_method('render_' . $msg_type, $this, $_GET[$this -> pre . 'message']);
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
function slideshow($output = true) {
|
50 |
-
if ($slides = $this -> Slide -> find_all(null, null, array('order', "ASC"))) {
|
51 |
-
if ($output) {
|
52 |
-
$this -> render('gallery', array('slides' => $slides), true, 'default');
|
53 |
-
} else {
|
54 |
-
$content = $this -> render('gallery', array('slides' => $slides), false, 'default');
|
55 |
-
return $content;
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
return false;
|
60 |
-
}
|
61 |
-
|
62 |
-
function embed($atts = array()) {
|
63 |
-
$defaults = array();
|
64 |
-
extract(shortcode_atts($defaults, $atts));
|
65 |
-
|
66 |
-
if ($slides = $this -> Slide -> find_all(null, null, array('order', "ASC"))) {
|
67 |
-
$content = $this -> render('gallery', array('slides' => $slides), false, 'default');
|
68 |
-
}
|
69 |
-
|
70 |
-
return $content;
|
71 |
-
}
|
72 |
-
|
73 |
-
function admin_slides() {
|
74 |
-
switch ($_GET['method']) {
|
75 |
-
case 'save' :
|
76 |
-
if (!empty($_POST)) {
|
77 |
-
if ($this -> Slide -> save($_POST, true)) {
|
78 |
-
$message = __('Slide has been saved', $this -> plugin_name);
|
79 |
-
$this -> redirect($this -> url, "message", $message);
|
80 |
-
} else {
|
81 |
-
$this -> render('slides/save', false, true, 'admin');
|
82 |
-
}
|
83 |
-
} else {
|
84 |
-
$this -> Db -> model = $this -> Slide -> model;
|
85 |
-
$this -> Slide -> find(array('id' => $_GET['id']));
|
86 |
-
$this -> render('slides/save', false, true, 'admin');
|
87 |
-
}
|
88 |
-
break;
|
89 |
-
case 'mass' :
|
90 |
-
if (!empty($_POST['action'])) {
|
91 |
-
if (!empty($_POST['Slide']['checklist'])) {
|
92 |
-
switch ($_POST['action']) {
|
93 |
-
case 'delete' :
|
94 |
-
$this -> debug($_POST);
|
95 |
-
|
96 |
-
foreach ($_POST['Slide']['checklist'] as $slide_id) {
|
97 |
-
$this -> Slide -> delete($slide_id);
|
98 |
-
}
|
99 |
-
|
100 |
-
$message = __('Selected slides have been removed', $this -> plugin_name);
|
101 |
-
$this -> redirect($this -> url, 'message', $message);
|
102 |
-
break;
|
103 |
-
}
|
104 |
-
} else {
|
105 |
-
$message = __('No slides were selected', $this -> plugin_name);
|
106 |
-
$this -> redirect($this -> url, "error", $message);
|
107 |
-
}
|
108 |
-
} else {
|
109 |
-
$message = __('No action was specified', $this -> plugin_name);
|
110 |
-
$this -> redirect($this -> url, "error", $message);
|
111 |
-
}
|
112 |
-
break;
|
113 |
-
case 'order' :
|
114 |
-
$slides = $this -> Slide -> find_all(null, null, array('order', "ASC"));
|
115 |
-
$this -> render('slides/order', array('slides' => $slides), true, 'admin');
|
116 |
-
break;
|
117 |
-
default :
|
118 |
-
$data = $this -> paginate('Slide');
|
119 |
-
$this -> render('slides/index', array('slides' => $data[$this -> Slide -> model], 'paginate' => $data['Paginate']), true, 'admin');
|
120 |
-
break;
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
function admin_settings() {
|
125 |
-
switch ($_GET['method']) {
|
126 |
-
case 'reset' :
|
127 |
-
global $wpdb;
|
128 |
-
$query = "DELETE FROM `" . $wpdb -> prefix . "options` WHERE `option_name` LIKE '" . $this -> pre . "%';";
|
129 |
-
|
130 |
-
if ($wpdb -> query($query)) {
|
131 |
-
$message = __('All configuration settings have been reset to their defaults', $this -> plugin_name);
|
132 |
-
$msg_type = 'message';
|
133 |
-
$this -> render_msg($message);
|
134 |
-
} else {
|
135 |
-
$message = __('Configuration settings could not be reset', $this -> plugin_name);
|
136 |
-
$msg_type = 'error';
|
137 |
-
$this -> render_err($message);
|
138 |
-
}
|
139 |
-
|
140 |
-
$this -> redirect($this -> url, $msg_type, $message);
|
141 |
-
break;
|
142 |
-
default :
|
143 |
-
if (!empty($_POST)) {
|
144 |
-
foreach ($_POST as $pkey => $pval) {
|
145 |
-
$this -> update_option($pkey, $pval);
|
146 |
-
}
|
147 |
-
|
148 |
-
$message = __('Configuration has been saved', $this -> plugin_name);
|
149 |
-
$this -> render_msg($message);
|
150 |
-
}
|
151 |
-
break;
|
152 |
-
}
|
153 |
-
|
154 |
-
$this -> render('settings', false, true, 'admin');
|
155 |
-
}
|
156 |
-
}
|
157 |
-
|
158 |
-
//initialize a Gallery object
|
159 |
-
$Gallery = new Gallery();
|
160 |
-
|
161 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/vendors/class.paginate.php
DELETED
@@ -1,216 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class GalleryPaginate extends GalleryPlugin {
|
4 |
-
|
5 |
-
/**
|
6 |
-
* DB table name to paginate on
|
7 |
-
*
|
8 |
-
*/
|
9 |
-
var $table = '';
|
10 |
-
|
11 |
-
/**
|
12 |
-
* Fields for SELECT query
|
13 |
-
* Only these fields will be fetched.
|
14 |
-
* Use asterix for all available fields
|
15 |
-
*
|
16 |
-
*/
|
17 |
-
var $fields = '*';
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Current page
|
21 |
-
*
|
22 |
-
*/
|
23 |
-
var $page = 1;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Records to show per page
|
27 |
-
*
|
28 |
-
*/
|
29 |
-
var $per_page = 10;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* WHERE conditions
|
33 |
-
* This should be an array
|
34 |
-
*
|
35 |
-
*/
|
36 |
-
var $where = '';
|
37 |
-
|
38 |
-
/**
|
39 |
-
* ORDER condition
|
40 |
-
*
|
41 |
-
*/
|
42 |
-
var $order = array('modified', "DESC");
|
43 |
-
|
44 |
-
var $plugin_url = '';
|
45 |
-
var $sub = '';
|
46 |
-
var $parent = '';
|
47 |
-
|
48 |
-
var $allcount = 0;
|
49 |
-
var $allRecords = array();
|
50 |
-
|
51 |
-
var $pagination = '';
|
52 |
-
|
53 |
-
function GalleryPaginate($table = '', $fields = '', $sub = '', $parent = '') {
|
54 |
-
$this -> sub = $sub;
|
55 |
-
$this -> parentd = $parent;
|
56 |
-
|
57 |
-
if (!empty($table)) {
|
58 |
-
$this -> table = $table;
|
59 |
-
}
|
60 |
-
|
61 |
-
if (!empty($fields)) {
|
62 |
-
$this -> fields = $fields;
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
function start_paging($page = '') {
|
67 |
-
global $wpdb;
|
68 |
-
|
69 |
-
$page = (empty($page)) ? 1 : $page;
|
70 |
-
|
71 |
-
if (!empty($page)) {
|
72 |
-
$this -> page = $page;
|
73 |
-
}
|
74 |
-
|
75 |
-
if (!empty($this -> fields)) {
|
76 |
-
if (is_array($this -> fields)) {
|
77 |
-
$this -> fields = implode(", ", $this -> fields);
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
$query = "SELECT " . $this -> fields . " FROM `" . $this -> table . "`";
|
82 |
-
$countquery = "SELECT COUNT(*) FROM `" . $this -> table . "`";
|
83 |
-
|
84 |
-
//check if some conditions where passed.
|
85 |
-
if (!empty($this -> where)) {
|
86 |
-
//append the "WHERE" command to the query
|
87 |
-
$query .= " WHERE";
|
88 |
-
$countquery .= " WHERE";
|
89 |
-
$c = 1;
|
90 |
-
|
91 |
-
foreach ($this -> where as $key => $val) {
|
92 |
-
if (!empty($val) && is_array($val)) {
|
93 |
-
$k = 1;
|
94 |
-
|
95 |
-
foreach ($val as $vkey => $vval) {
|
96 |
-
if (eregi("LIKE", $val)) {
|
97 |
-
$query .= " `" . $key . "` " . $vval . "";
|
98 |
-
$countquery .= " `" . $key . "` " . $vval . "";
|
99 |
-
} elseif (preg_match("/SE (.*)/si", $vval, $vmatches)) {
|
100 |
-
if (!empty($vmatches[1])) {
|
101 |
-
$query .= " `" . $key . "` <= " . $vmatches[1] . "";
|
102 |
-
$countquery .= " `" . $key . "` <= " . $vmatches[1] . "";;
|
103 |
-
}
|
104 |
-
} elseif (preg_match("/LE (.*)/si", $vval, $vmatches)) {
|
105 |
-
if (!empty($vmatches[1])) {
|
106 |
-
$query .= " `" . $key . "` >= " . $vmatches[1] . "";
|
107 |
-
$countquery .= " `" . $key . "` >= " . $vmatches[1] . "";
|
108 |
-
}
|
109 |
-
} else {
|
110 |
-
$query .= " `" . $key . "` = '" . $vval . "'";
|
111 |
-
$countquery .= " `" . $key . "` = '" . $vval . "'";
|
112 |
-
}
|
113 |
-
|
114 |
-
if ($k < count($val)) {
|
115 |
-
$query .= " AND";
|
116 |
-
$countquery .= " AND";
|
117 |
-
}
|
118 |
-
|
119 |
-
$k++;
|
120 |
-
$vmatches = false;
|
121 |
-
}
|
122 |
-
} else {
|
123 |
-
if (eregi("LIKE", $val)) {
|
124 |
-
$query .= " `" . $key . "` " . $val . "";
|
125 |
-
$countquery .= " `" . $key . "` " . $val . "";
|
126 |
-
} elseif (preg_match("/SE (.*)/si", $val, $vmatches)) {
|
127 |
-
if (!empty($vmatches[1])) {
|
128 |
-
$query .= " `" . $key . "` <= " . $vmatches[1] . "";
|
129 |
-
$countquery .= " `" . $key . "` <= " . $vmatches[1] . "";
|
130 |
-
}
|
131 |
-
} elseif (preg_match("/LE (.*)/si", $val, $vmatches)) {
|
132 |
-
if (!empty($vmatches[1])) {
|
133 |
-
$query .= " `" . $key . "` >= " . $vmatches[1] . "";
|
134 |
-
$countquery .= " `" . $key . "` >= " . $vmatches[1] . "";
|
135 |
-
}
|
136 |
-
} else {
|
137 |
-
$query .= " `" . $key . "` = '" . $val . "'";
|
138 |
-
$countquery .= " `" . $key . "` = '" . $val . "'";
|
139 |
-
}
|
140 |
-
|
141 |
-
if ($c < count($this -> where)) {
|
142 |
-
$query .= " AND";
|
143 |
-
$countquery .= " AND";
|
144 |
-
}
|
145 |
-
|
146 |
-
$c++;
|
147 |
-
$vmatches = false;
|
148 |
-
}
|
149 |
-
}
|
150 |
-
}
|
151 |
-
|
152 |
-
$r = 1;
|
153 |
-
|
154 |
-
$this -> doberecords();
|
155 |
-
list($osortby, $osort) = $this -> order;
|
156 |
-
$query .= " ORDER BY `" . $osortby . "` " . $osort . " LIMIT " . $this -> begRecord . " , " . $this -> per_page . ";";
|
157 |
-
//echo $query;
|
158 |
-
|
159 |
-
$records = $wpdb -> get_results($query);
|
160 |
-
$records_count = count($records);
|
161 |
-
$allRecordsCount = $this -> allcount = $wpdb -> get_var($countquery);
|
162 |
-
$totalpagescount = round($records_count/$this -> per_page);
|
163 |
-
|
164 |
-
$pageparam = (!empty($this -> sub) && $this -> sub == "N") ? '' : 'page=' . $this -> pre . $this -> sub . '&';
|
165 |
-
$pageparam = '';
|
166 |
-
$search = (empty($this -> searchterm)) ? '' : '&' . $this -> pre . 'searchterm=' . urlencode($this -> searchterm);
|
167 |
-
|
168 |
-
if (count($records) < $allRecordsCount) {
|
169 |
-
$p = 1;
|
170 |
-
$k = 1;
|
171 |
-
$n = $this -> page;
|
172 |
-
|
173 |
-
$add_prev = $pageparam . $this -> pre . 'page=' . ($this -> page - 1) . $search . '';
|
174 |
-
$add_next = $pageparam . $this -> pre . 'page=' . ($this -> page + 1) . $search . '';
|
175 |
-
|
176 |
-
$this -> pagination .= '<span class="displaying-num">' . __('Displaying', $this -> plugin_name) . ' ' . ($this -> begRecord + 1) . ' - ' . ($this -> begRecord + count($records)) . ' ' . __('of', $this -> plugin_name) . ' ' . $allRecordsCount . '</span>';
|
177 |
-
|
178 |
-
if ($this -> page > 1) {
|
179 |
-
$this -> pagination .= '<a class="prev page-numbers" href="' . GalleryHtmlHelper::retainquery($add_prev) . '" title="' . __('Previous Page', $this -> plugin_name) . '">«</a>';
|
180 |
-
}
|
181 |
-
|
182 |
-
while ($p <= $allRecordsCount) {
|
183 |
-
$add_numbers = $pageparam . $this -> pre . 'page=' . ($k) . $search . '';
|
184 |
-
|
185 |
-
if ($k >= ($this -> page - 5) && $k <= ($this -> page + 5)) {
|
186 |
-
if ($k != $this -> page) {
|
187 |
-
$this -> pagination .= '<a class="page-numbers" href="' . GalleryHtmlHelper::retainquery($add_numbers) . '" title="' . __('Page', $this -> plugin_name) . ' ' . $k . '">' . $k . '</a>';
|
188 |
-
} else {
|
189 |
-
$this -> pagination .= '<span class="page-numbers current">' . $k . '</span>';
|
190 |
-
}
|
191 |
-
}
|
192 |
-
|
193 |
-
$p = $p + $this -> per_page;
|
194 |
-
$k++;
|
195 |
-
}
|
196 |
-
|
197 |
-
if ((count($records) + $this -> begRecord) < $allRecordsCount) {
|
198 |
-
$this -> pagination .= '<a class="next page-numbers" href="' . GalleryHtmlHelper::retainquery($add_next) . '" title="' . __('Next Page', $this -> plugin_name) . '">»</a>';
|
199 |
-
}
|
200 |
-
}
|
201 |
-
|
202 |
-
return $records;
|
203 |
-
}
|
204 |
-
|
205 |
-
function doberecords() {
|
206 |
-
if ($this -> page > 1) {
|
207 |
-
$this -> begRecord = (($this -> page * $this -> per_page) - ($this -> per_page));
|
208 |
-
} else {
|
209 |
-
$this -> begRecord = 0;
|
210 |
-
}
|
211 |
-
|
212 |
-
$this -> endRecord = $this -> begRecord + $this -> per_page;
|
213 |
-
}
|
214 |
-
}
|
215 |
-
|
216 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/views/admin/err-top.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php if (!empty($message)) : ?>
|
2 |
-
<div class="error fade">
|
3 |
-
<p><?= $message; ?></p>
|
4 |
-
</div>
|
5 |
-
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
trunk/views/admin/head.php
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
<script type="text/javascript">
|
2 |
-
var GalleryAjax = "<?= $this -> url(); ?>/<?= $this -> plugin_name; ?>-ajax.php";
|
3 |
-
</script>
|
|
|
|
|
|
trunk/views/admin/metaboxes/settings-general.php
DELETED
@@ -1,126 +0,0 @@
|
|
1 |
-
<table class="form-table">
|
2 |
-
<tbody>
|
3 |
-
<tr>
|
4 |
-
<th><label for="autoslideY"><?php _e('Auto Slide', $this -> plugin_name); ?></label></th>
|
5 |
-
<td>
|
6 |
-
<label><input onclick="jQuery('#autoslide_div').show();" <?= ($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();" <?= ($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>
|
11 |
-
</table>
|
12 |
-
|
13 |
-
<div id="autoslide_div" style="display:<?= ($this -> get_option('autoslide') == "Y") ? 'block' : 'none'; ?>;">
|
14 |
-
<table class="form-table">
|
15 |
-
<tbody>
|
16 |
-
<tr>
|
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="<?= $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>
|
24 |
-
</table>
|
25 |
-
</div>
|
26 |
-
|
27 |
-
<table class="form-table">
|
28 |
-
<tbody>
|
29 |
-
<tr>
|
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="<?= $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="<?= $this -> get_option('navopacity'); ?>" id="navopacity" style="width:45px;" /> <?php _e('% <!-- 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="<?= $this -> get_option('navhover'); ?>" id="navhover" style="width:45px;" /> <?php _e('% <!-- 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();" <?= ($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();" <?= ($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>
|
58 |
-
</table>
|
59 |
-
|
60 |
-
<div id="information_div" style="display:<?= ($this -> get_option('information') == "Y") ? 'block' : 'none'; ?>;">
|
61 |
-
<table class="form-table">
|
62 |
-
<tbody>
|
63 |
-
<tr>
|
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="<?= $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>
|
71 |
-
</table>
|
72 |
-
</div>
|
73 |
-
|
74 |
-
<table class="form-table">
|
75 |
-
<tbody>
|
76 |
-
<tr>
|
77 |
-
<th><label for="thumbnailsN"><?php _e('Show Thumbnails', $this -> plugin_name); ?></label></th>
|
78 |
-
<td>
|
79 |
-
<label><input onclick="jQuery('#thumbnails_div').show();" <?= ($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();" <?= ($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>
|
84 |
-
</table>
|
85 |
-
|
86 |
-
<div id="thumbnails_div" style="display:<?= ($this -> get_option('thumbnails') == "Y") ? 'block' : 'none'; ?>;">
|
87 |
-
<table class="form-table">
|
88 |
-
<tbody>
|
89 |
-
<tr>
|
90 |
-
<th><label for="thubmpositionbottom"><?php _e('Thumbnails Position', $this -> plugin_name); ?></label></th>
|
91 |
-
<td>
|
92 |
-
<label><input <?= ($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 <?= ($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="<?= $this -> get_option('thumbopacity'); ?>" id="thumbopacity" /> <?php _e('% <!-- 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="<?= $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 style="width:45px;" name="thumbscrollspeed" value="<?= $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="<?= $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>
|
125 |
-
</table>
|
126 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/views/admin/metaboxes/settings-styles.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php $styles = $this -> get_option('styles'); ?>
|
2 |
-
|
3 |
-
<table class="form-table">
|
4 |
-
<tbody>
|
5 |
-
<tr>
|
6 |
-
<th><label for="styles.width"><?php _e('Gallery Width', $this -> plugin_name); ?></label></th>
|
7 |
-
<td>
|
8 |
-
<input style="width:45px;" id="styles.width" type="text" name="styles[width]" value="<?= $styles['width']; ?>" /> <?php _e('px', $this -> plugin_name); ?>
|
9 |
-
<span class="howto"><?php _e('width of the slideshow gallery', $this -> plugin_name); ?></span>
|
10 |
-
</td>
|
11 |
-
</tr>
|
12 |
-
<tr>
|
13 |
-
<th><label for="styles.height"><?php _e('Gallery Height', $this -> plugin_name); ?></label></th>
|
14 |
-
<td>
|
15 |
-
<input style="width:45px;" id="styles.height" type="text" name="styles[height]" value="<?= $styles['height']; ?>" /> <?php _e('px', $this -> plugin_name); ?>
|
16 |
-
<span class="howto"><?php _e('height of the slideshow gallery', $this -> plugin_name); ?></span>
|
17 |
-
</td>
|
18 |
-
</tr>
|
19 |
-
<tr>
|
20 |
-
<th><label for="styles.border"><?php _e('Slideshow Border', $this -> plugin_name); ?></label></th>
|
21 |
-
<td>
|
22 |
-
<input type="text" name="styles[border]" value="<?= $styles['border']; ?>" id="styles.border" style="width:145px;" />
|
23 |
-
</td>
|
24 |
-
</tr>
|
25 |
-
<tr>
|
26 |
-
<th><label for="styles.background"><?php _e('Slideshow Background', $this -> plugin_name); ?></label></th>
|
27 |
-
<td>
|
28 |
-
<input type="text" name="styles[background]" value="<?= $styles['background']; ?>" id="styles.background" style="width:65px;" />
|
29 |
-
</td>
|
30 |
-
</tr>
|
31 |
-
<tr>
|
32 |
-
<th><label for="styles.infobackground"><?php _e('Information Background', $this -> plugin_name); ?></label></th>
|
33 |
-
<td>
|
34 |
-
<input type="text" name="styles[infobackground]" value="<?= $styles['infobackground']; ?>" id="styles.infobackground" style="width:65px;" />
|
35 |
-
</td>
|
36 |
-
</tr>
|
37 |
-
<tr>
|
38 |
-
<th><label for="styles.infocolor"><?php _e('Information Text Color', $this -> plugin_name); ?></label></th>
|
39 |
-
<td>
|
40 |
-
<input type="text" name="styles[infocolor]" value="<?= $styles['infocolor']; ?>" id="styles.infocolor" style="width:65px;" />
|
41 |
-
</td>
|
42 |
-
</tr>
|
43 |
-
</tbody>
|
44 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/views/admin/metaboxes/settings-submit.php
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
<div class="submitbox" id="submitpost">
|
2 |
-
<div id="minor-publishing">
|
3 |
-
<div id="misc-publishing-actions">
|
4 |
-
<div class="misc-pub-section">
|
5 |
-
<ul>
|
6 |
-
<li><a href="<?= $this -> url; ?>&method=reset" title="<?php _e('Reset all configuration settings to their default values', $this -> plugin_name); ?>" onclick="if (!confirm('<?php _e('Are you sure you wish to reset all configuration settings?', $this -> plugin_name); ?>')) { return false; }"><?php _e('Reset to Defaults', $this -> plugin_name); ?></a></li>
|
7 |
-
</ul>
|
8 |
-
</div>
|
9 |
-
</div>
|
10 |
-
</div>
|
11 |
-
<div id="major-publishing-actions">
|
12 |
-
<div id="publishing-action">
|
13 |
-
<input class="button-primary" type="submit" name="save" value="<?php _e('Save Configuration', $this -> plugin_name); ?>" />
|
14 |
-
</div>
|
15 |
-
<br class="clear" />
|
16 |
-
</div>
|
17 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/views/admin/msg-top.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php if (!empty($message)) : ?>
|
2 |
-
<div class="updated fade">
|
3 |
-
<p><?= $message; ?></p>
|
4 |
-
</div>
|
5 |
-
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
trunk/views/admin/paginate.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php if (!empty($paginate -> pagination)) : ?>
|
2 |
-
<div class="tablenav-pages">
|
3 |
-
<?= $paginate -> pagination; ?>
|
4 |
-
</div>
|
5 |
-
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
trunk/views/admin/settings.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
add_meta_box('submitdiv', __('Save Settings', $this -> plugin_name), array($this -> Metabox, "settings_submit"), 'post', 'side', 'core');
|
4 |
-
add_meta_box('generaldiv', __('General Settings', $this -> plugin_name), array($this -> Metabox, "settings_general"), 'post', 'normal', 'core');
|
5 |
-
add_meta_box('stylesdiv', __('Styles', $this -> plugin_name), array($this -> Metabox, "settings_styles"), 'post', 'normal', 'core');
|
6 |
-
|
7 |
-
//WordPress security measurements for calls
|
8 |
-
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
|
9 |
-
wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
|
10 |
-
|
11 |
-
?>
|
12 |
-
|
13 |
-
<div class="wrap">
|
14 |
-
<h2><?php _e('Configuration Settings', $this -> plugin_name); ?></h2>
|
15 |
-
|
16 |
-
<form action="<?= $this -> url; ?>" method="post">
|
17 |
-
<div id="poststuff" class="metabox-holder has-right-sidebar">
|
18 |
-
<div id="side-info-column" class="inner-sidebar">
|
19 |
-
<?php do_meta_boxes('post', 'side', $post); ?>
|
20 |
-
</div>
|
21 |
-
<div id="post-body" class="has-sidebar">
|
22 |
-
<div id="post-body-content" class="has-sidebar-content">
|
23 |
-
<?php do_meta_boxes('post', 'normal', $post); ?>
|
24 |
-
</div>
|
25 |
-
</div>
|
26 |
-
</div>
|
27 |
-
</form>
|
28 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/views/admin/slides/index.php
DELETED
@@ -1,68 +0,0 @@
|
|
1 |
-
<div class="wrap">
|
2 |
-
<h2><?php _e('Manage Slides', $this -> plugin_name); ?> (<?= $this -> Html -> link(__('add new'), $this -> url . '&method=save'); ?>)</h2>
|
3 |
-
|
4 |
-
<?php if (!empty($slides)) : ?>
|
5 |
-
<form id="posts-filter" action="<?= $this -> url; ?>" method="post">
|
6 |
-
<ul class="subsubsub">
|
7 |
-
<li><?= $paginate -> allcount; ?> <?php _e('slides', $this -> plugin_name); ?></li>
|
8 |
-
</ul>
|
9 |
-
|
10 |
-
|
11 |
-
</form>
|
12 |
-
<?php endif; ?>
|
13 |
-
|
14 |
-
<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="<?= $this -> url; ?>&method=mass" method="post">
|
15 |
-
<div class="tablenav">
|
16 |
-
<div class="alignleft actions">
|
17 |
-
<a href="<?= $this -> url; ?>&method=order" title="<?php _e('Order all your slides', $this -> plugin_name); ?>" class="button"><?php _e('Order Slides', $this -> plugin_name); ?></a>
|
18 |
-
|
19 |
-
<select name="action" class="action">
|
20 |
-
<option value="">- <?php _e('Bulk Actions', $this -> plugin_name); ?> -</option>
|
21 |
-
<option value="delete"><?php _e('Delete', $this -> plugin_name); ?></option>
|
22 |
-
</select>
|
23 |
-
<input type="submit" class="button" value="<?php _e('Apply', $this -> plugin_name); ?>" name="execute" />
|
24 |
-
</div>
|
25 |
-
<?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<table class="widefat">
|
29 |
-
<thead>
|
30 |
-
<tr>
|
31 |
-
<th class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></th>
|
32 |
-
<th><?php _e('Image', $this -> plugin_name); ?></th>
|
33 |
-
<th><?php _e('Title', $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('Date', $this -> plugin_name); ?></th>
|
44 |
-
<th><?php _e('Order', $this -> plugin_name); ?></th>
|
45 |
-
</tr>
|
46 |
-
</tfoot>
|
47 |
-
<tbody>
|
48 |
-
<?php foreach ($slides as $slide) : ?>
|
49 |
-
<tr class="<?= $class = (empty($class)) ? 'alternate' : ''; ?>">
|
50 |
-
<th class="check-column"><input type="checkbox" name="Slide[checklist][]" value="<?= $slide -> id; ?>" id="checklist<?= $slide -> id; ?>" /></th>
|
51 |
-
<td style="width:75px;">
|
52 |
-
<?php $image = basename($slide -> image_url); ?>
|
53 |
-
<a href="<?= $this -> Html -> image_url($image); ?>" title="<?= $slide -> title; ?>" class="thickbox"><img src="<?= $this -> Html -> image_url($this -> Html -> thumbname($image, "small")); ?>" alt="<?= $this -> Html -> sanitize($slide -> title); ?>" /></a>
|
54 |
-
</td>
|
55 |
-
<td><a class="row-title" href="<?= $this -> url; ?>&method=save&id=<?= $slide -> id; ?>" title=""><?= $slide -> title; ?></a></td>
|
56 |
-
<td><abbr title="<?= $slide -> modified; ?>"><?= date("Y-m-d", strtotime($slide -> modified)); ?></abbr></td>
|
57 |
-
<td><?= ((int) $slide -> order + 1); ?></td>
|
58 |
-
</tr>
|
59 |
-
<?php endforeach; ?>
|
60 |
-
</tbody>
|
61 |
-
</table>
|
62 |
-
|
63 |
-
<div class="tablenav">
|
64 |
-
|
65 |
-
<?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
|
66 |
-
</div>
|
67 |
-
</form>
|
68 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/views/admin/slides/order.php
DELETED
@@ -1,49 +0,0 @@
|
|
1 |
-
<div class="wrap">
|
2 |
-
<h2><?php _e('Order Slides', $this -> plugin_name); ?></h2>
|
3 |
-
|
4 |
-
<div style="float:none;" class="subsubsub">
|
5 |
-
<a href="<?= $this -> url; ?>"><?php _e('← Manage All Slides', $this -> plugin_name); ?></a>
|
6 |
-
</div>
|
7 |
-
|
8 |
-
<?php if (!empty($slides)) : ?>
|
9 |
-
<ul id="slidelist">
|
10 |
-
<?php foreach ($slides as $slide) : ?>
|
11 |
-
<li class="lineitem" id="item_<?= $slide -> id; ?>">
|
12 |
-
<span><img src="<?= $this -> Html -> image_url($this -> Html -> thumbname($slide -> image, "small")); ?>" alt="<?= $this -> Html -> sanitize($slide -> title); ?>" /></span>
|
13 |
-
<?= $slide -> title; ?>
|
14 |
-
</li>
|
15 |
-
<?php endforeach; ?>
|
16 |
-
</ul>
|
17 |
-
|
18 |
-
<div id="slidemessage"></div>
|
19 |
-
|
20 |
-
<script type="text/javascript">
|
21 |
-
jQuery(document).ready(function() {
|
22 |
-
jQuery("ul#slidelist").sortable({
|
23 |
-
start: function(request) {
|
24 |
-
jQuery("#slidemessage").slideUp();
|
25 |
-
},
|
26 |
-
stop: function(request) {
|
27 |
-
jQuery("#slidemessage").load(GalleryAjax + "?cmd=slides_order", jQuery("ul#slidelist").sortable('serialize')).slideDown("slow");
|
28 |
-
},
|
29 |
-
axis: "y"
|
30 |
-
});
|
31 |
-
});
|
32 |
-
</script>
|
33 |
-
|
34 |
-
<style type="text/css">
|
35 |
-
#slidelist li.lineitem {
|
36 |
-
list-style: none;
|
37 |
-
margin: 3px 0px !important;
|
38 |
-
padding: 2px 5px 2px 5px;
|
39 |
-
background-color: #F1F1F1 !important;
|
40 |
-
border:1px solid #B2B2B2;
|
41 |
-
cursor: move;
|
42 |
-
vertical-align: middle !important;
|
43 |
-
display: block;
|
44 |
-
}
|
45 |
-
</style>
|
46 |
-
<?php else : ?>
|
47 |
-
<p style="color:red;"><?php _e('No slides found', $this -> plugin_name); ?></p>
|
48 |
-
<?php endif; ?>
|
49 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/views/admin/slides/save.php
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
<div class="wrap">
|
2 |
-
<h2><?php _e('Save a Slide', $this -> plugin_name); ?></h2>
|
3 |
-
|
4 |
-
<form action="<?= $this -> url; ?>&method=save" method="post">
|
5 |
-
<input type="hidden" name="Slide[id]" value="<?= $this -> Slide -> data -> id; ?>" />
|
6 |
-
<input type="hidden" name="Slide[order]" value="<?= $this -> Slide -> data -> order; ?>" />
|
7 |
-
|
8 |
-
<table class="form-table">
|
9 |
-
<tbody>
|
10 |
-
<tr>
|
11 |
-
<th><label for="Slide.title"><?php _e('Title', $this -> plugin_name); ?></label></th>
|
12 |
-
<td>
|
13 |
-
<input class="widefat" type="text" name="Slide[title]" value="<?= esc_attr($this -> Slide -> data -> title); ?>" id="Slide.title" />
|
14 |
-
<?= (!empty($this -> Slide -> errors['title'])) ? '<div style="color:red;">' . $this -> Slide -> errors['title'] . '</div>' : ''; ?>
|
15 |
-
</td>
|
16 |
-
</tr>
|
17 |
-
<tr>
|
18 |
-
<th><label for="Slide.description"><?php _e('Description', $this -> plugin_name); ?></label></th>
|
19 |
-
<td>
|
20 |
-
<textarea class="widefat" name="Slide[description]"><?= esc_attr($this -> Slide -> data -> description); ?></textarea>
|
21 |
-
<?= (!empty($this -> Slide -> errors['description'])) ? '<div style="color:red;">' . $this -> Slide -> errors['description'] . '</div>' : ''; ?>
|
22 |
-
</td>
|
23 |
-
</tr>
|
24 |
-
<tr>
|
25 |
-
<th><label for="Slide.image_url"><?php _e('Image URL', $this -> plugin_name); ?></th>
|
26 |
-
<td>
|
27 |
-
<input class="widefat" type="text" name="Slide[image_url]" value="<?= esc_attr($this -> Slide -> data -> image_url); ?>" id="Slide.image_url" />
|
28 |
-
<?= (!empty($this -> Slide -> errors['image_url'])) ? '<div style="color:red;">' . $this -> Slide -> errors['image_url'] . '</div>' : ''; ?>
|
29 |
-
</td>
|
30 |
-
</tr>
|
31 |
-
<tr>
|
32 |
-
<th><label for="Slide.link"><?php _e('Link To', $this -> plugin_name); ?></label></th>
|
33 |
-
<td><input class="widefat" type="text" name="Slide[link]" value="<?= esc_attr($this -> Slide -> data -> link); ?>" id="Slide.link" /></td>
|
34 |
-
</tr>
|
35 |
-
</tbody>
|
36 |
-
</table>
|
37 |
-
|
38 |
-
<p class="submit">
|
39 |
-
<input class="button-primary" type="submit" name="submit" value="<?php _e('Save Slide', $this -> plugin_name); ?>" />
|
40 |
-
</p>
|
41 |
-
</form>
|
42 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trunk/views/default/gallery.php
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
<?php if (!empty($slides)) : ?>
|
2 |
-
<ul id="slideshow" style="display:none;">
|
3 |
-
<?php foreach ($slides as $slide) : ?>
|
4 |
-
<li>
|
5 |
-
<h3><?= $slide -> title; ?></h3>
|
6 |
-
<span><?= get_option('siteurl'); ?>/wp-content/uploads/<?= $this -> plugin_name; ?>/<?= basename($slide -> image_url); ?></span>
|
7 |
-
<p><?= $slide -> description; ?></p>
|
8 |
-
<?php if ($this -> get_option('thumbnails') == "Y") : ?>
|
9 |
-
<?php if (!empty($slide -> link)) : ?>
|
10 |
-
<a href="<?= $slide -> link; ?>" title="<?= $slide -> title; ?>"><img src="<?= $this -> Html -> image_url($this -> Html -> thumbname(basename($slide -> image_url))); ?>" alt="<?= $this -> Html -> sanitize($slide -> title); ?>" /></a>
|
11 |
-
<?php else : ?>
|
12 |
-
<img src="<?= $this -> Html -> image_url($this -> Html -> thumbname(basename($slide -> image_url))); ?>" alt="<?= $this -> Html -> sanitize($slide -> title); ?>" />
|
13 |
-
<?php endif; ?>
|
14 |
-
<?php else : ?>
|
15 |
-
<a href="<?= $slide -> link; ?>" title="<?= $slide -> title; ?>"></a>
|
16 |
-
<?php endif; ?>
|
17 |
-
</li>
|
18 |
-
<?php endforeach; ?>
|
19 |
-
</ul>
|
20 |
-
|
21 |
-
<div id="wrapper">
|
22 |
-
<?php if ($this -> get_option('thumbnails') == "Y" && $this -> get_option('thumbposition') == "top") : ?>
|
23 |
-
<div id="thumbnails" class="thumbstop">
|
24 |
-
<div id="slideleft" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
|
25 |
-
<div id="slidearea">
|
26 |
-
<div id="slider"></div>
|
27 |
-
</div>
|
28 |
-
<div id="slideright" title="<?php _e('Slide Right', $this -> plugin_name); ?>"></div>
|
29 |
-
<br style="clear:both; visibility:hidden; height:1px;" />
|
30 |
-
</div>
|
31 |
-
<?php endif; ?>
|
32 |
-
|
33 |
-
<div id="fullsize">
|
34 |
-
<div id="imgprev" class="imgnav" title="Previous Image"></div>
|
35 |
-
<div id="imglink"></div>
|
36 |
-
<div id="imgnext" class="imgnav" title="Next Image"></div>
|
37 |
-
<div id="image"></div>
|
38 |
-
<?php if ($this -> get_option('information') == "Y") : ?>
|
39 |
-
<div id="information">
|
40 |
-
<h3></h3>
|
41 |
-
<p></p>
|
42 |
-
</div>
|
43 |
-
<?php endif; ?>
|
44 |
-
</div>
|
45 |
-
|
46 |
-
<?php if ($this -> get_option('thumbnails') == "Y" && $this -> get_option('thumbposition') == "bottom") : ?>
|
47 |
-
<div id="thumbnails" class="thumbsbot">
|
48 |
-
<div id="slideleft" title="<?php _e('Slide Left', $this -> plugin_name); ?>"></div>
|
49 |
-
<div id="slidearea">
|
50 |
-
<div id="slider"></div>
|
51 |
-
</div>
|
52 |
-
<div id="slideright" title="<?php _e('Slide Right', $this -> plugin_name); ?>"></div>
|
53 |
-
<br style="clear:both; visibility:hidden; height:1px;" />
|
54 |
-
</div>
|
55 |
-
<?php endif; ?>
|
56 |
-
</div>
|
57 |
-
|
58 |
-
<script type="text/javascript">
|
59 |
-
jQuery.noConflict();
|
60 |
-
tid('slideshow').style.display = "none";
|
61 |
-
tid('wrapper').style.display = 'block';
|
62 |
-
|
63 |
-
var slideshow = new TINY.slideshow("slideshow");
|
64 |
-
|
65 |
-
jQuery(document).ready(function() {
|
66 |
-
<?php if ($this -> get_option('autoslide')) : ?>slideshow.auto = true;<?php else : ?>slideshow.auto = false;<?php endif; ?>
|
67 |
-
slideshow.speed = <?= $this -> get_option('autospeed'); ?>;
|
68 |
-
slideshow.imgSpeed = <?= $this -> get_option('fadespeed'); ?>;
|
69 |
-
slideshow.navOpacity = <?= $this -> get_option('navopacity'); ?>;
|
70 |
-
slideshow.navHover = <?= $this -> get_option('navhover'); ?>;
|
71 |
-
slideshow.letterbox = "#000000";
|
72 |
-
slideshow.link = "linkhover";
|
73 |
-
slideshow.info = "<?= ($this -> get_option('information') == "Y") ? 'information' : ''; ?>";
|
74 |
-
slideshow.infoSpeed = <?= $this -> get_option('infospeed'); ?>;
|
75 |
-
slideshow.thumbs = "<?= ($this -> get_option('thumbnails') == "Y") ? 'slider' : ''; ?>";
|
76 |
-
slideshow.thumbOpacity = <?= $this -> get_option('thumbopacity'); ?>;
|
77 |
-
slideshow.left = "slideleft";
|
78 |
-
slideshow.right = "slideright";
|
79 |
-
slideshow.scrollSpeed = <?= $this -> get_option('thumbscrollspeed'); ?>;
|
80 |
-
slideshow.spacing = <?= $this -> get_option('thumbspacing'); ?>;
|
81 |
-
slideshow.active = "<?= $this -> get_option('thumbactive'); ?>";
|
82 |
-
slideshow.init("slideshow","image","imgprev","imgnext","imglink");
|
83 |
-
});
|
84 |
-
</script>
|
85 |
-
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/admin/err-top.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php if (!empty($message)) : ?>
|
2 |
<div class="error fade">
|
3 |
-
<p
|
4 |
</div>
|
5 |
<?php endif; ?>
|
1 |
<?php if (!empty($message)) : ?>
|
2 |
<div class="error fade">
|
3 |
+
<p><?php echo $message; ?></p>
|
4 |
</div>
|
5 |
<?php endif; ?>
|
views/admin/head.php
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
<script type="text/javascript">
|
2 |
-
var GalleryAjax = "
|
3 |
</script>
|
1 |
<script type="text/javascript">
|
2 |
+
var GalleryAjax = "<?php echo $this -> url(); ?>/<?php echo $this -> plugin_name; ?>-ajax.php";
|
3 |
</script>
|
views/admin/metaboxes/settings-general.php
CHANGED
@@ -3,20 +3,20 @@
|
|
3 |
<tr>
|
4 |
<th><label for="autoslideY"><?php _e('Auto Slide', $this -> plugin_name); ?></label></th>
|
5 |
<td>
|
6 |
-
<label><input onclick="jQuery('#autoslide_div').show();"
|
7 |
-
<label><input onclick="jQuery('#autoslide_div').hide();"
|
8 |
</td>
|
9 |
</tr>
|
10 |
</tbody>
|
11 |
</table>
|
12 |
|
13 |
-
<div id="autoslide_div" style="display
|
14 |
<table class="form-table">
|
15 |
<tbody>
|
16 |
<tr>
|
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="
|
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>
|
@@ -29,41 +29,41 @@
|
|
29 |
<tr>
|
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="
|
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="
|
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="
|
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();"
|
54 |
-
<label><input onclick="jQuery('#information_div').hide();"
|
55 |
</td>
|
56 |
</tr>
|
57 |
</tbody>
|
58 |
</table>
|
59 |
|
60 |
-
<div id="information_div" style="display
|
61 |
<table class="form-table">
|
62 |
<tbody>
|
63 |
<tr>
|
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="
|
67 |
<span class="howto"><?php _e('speed at which the information will slide in', $this -> plugin_name); ?></span>
|
68 |
</td>
|
69 |
</tr>
|
@@ -76,48 +76,48 @@
|
|
76 |
<tr>
|
77 |
<th><label for="thumbnailsN"><?php _e('Show Thumbnails', $this -> plugin_name); ?></label></th>
|
78 |
<td>
|
79 |
-
<label><input onclick="jQuery('#thumbnails_div').show();"
|
80 |
-
<label><input onclick="jQuery('#thumbnails_div').hide();"
|
81 |
</td>
|
82 |
</tr>
|
83 |
</tbody>
|
84 |
</table>
|
85 |
|
86 |
-
<div id="thumbnails_div" style="display
|
87 |
<table class="form-table">
|
88 |
<tbody>
|
89 |
<tr>
|
90 |
<th><label for="thubmpositionbottom"><?php _e('Thumbnails Position', $this -> plugin_name); ?></label></th>
|
91 |
<td>
|
92 |
-
<label><input
|
93 |
-
<label><input
|
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="
|
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="
|
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 style="width:45px;" name="thumbscrollspeed" value="
|
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="
|
121 |
<span class="howto"><?php _e('horizontal margin/spacing between thumbnails', $this -> plugin_name); ?></span>
|
122 |
</td>
|
123 |
</tr>
|
3 |
<tr>
|
4 |
<th><label for="autoslideY"><?php _e('Auto Slide', $this -> plugin_name); ?></label></th>
|
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>
|
11 |
</table>
|
12 |
|
13 |
+
<div id="autoslide_div" style="display:<?php echo ($this -> get_option('autoslide') == "Y") ? 'block' : 'none'; ?>;">
|
14 |
<table class="form-table">
|
15 |
<tbody>
|
16 |
<tr>
|
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>
|
29 |
<tr>
|
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('% <!-- 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('% <!-- 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>
|
58 |
</table>
|
59 |
|
60 |
+
<div id="information_div" style="display:<?php echo ($this -> get_option('information') == "Y") ? 'block' : 'none'; ?>;">
|
61 |
<table class="form-table">
|
62 |
<tbody>
|
63 |
<tr>
|
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>
|
76 |
<tr>
|
77 |
<th><label for="thumbnailsN"><?php _e('Show Thumbnails', $this -> plugin_name); ?></label></th>
|
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>
|
84 |
</table>
|
85 |
|
86 |
+
<div id="thumbnails_div" style="display:<?php echo ($this -> get_option('thumbnails') == "Y") ? 'block' : 'none'; ?>;">
|
87 |
<table class="form-table">
|
88 |
<tbody>
|
89 |
<tr>
|
90 |
<th><label for="thubmpositionbottom"><?php _e('Thumbnails Position', $this -> plugin_name); ?></label></th>
|
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('% <!-- 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 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>
|
views/admin/metaboxes/settings-styles.php
CHANGED
@@ -2,42 +2,50 @@
|
|
2 |
|
3 |
<table class="form-table">
|
4 |
<tbody>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
<tr>
|
6 |
<th><label for="styles.width"><?php _e('Gallery Width', $this -> plugin_name); ?></label></th>
|
7 |
<td>
|
8 |
-
<input style="width:45px;" id="styles.width" type="text" name="styles[width]" value="
|
9 |
<span class="howto"><?php _e('width of the slideshow gallery', $this -> plugin_name); ?></span>
|
10 |
</td>
|
11 |
</tr>
|
12 |
<tr>
|
13 |
<th><label for="styles.height"><?php _e('Gallery Height', $this -> plugin_name); ?></label></th>
|
14 |
<td>
|
15 |
-
<input style="width:45px;" id="styles.height" type="text" name="styles[height]" value="
|
16 |
<span class="howto"><?php _e('height of the slideshow gallery', $this -> plugin_name); ?></span>
|
17 |
</td>
|
18 |
</tr>
|
19 |
<tr>
|
20 |
<th><label for="styles.border"><?php _e('Slideshow Border', $this -> plugin_name); ?></label></th>
|
21 |
<td>
|
22 |
-
<input type="text" name="styles[border]" value="
|
23 |
</td>
|
24 |
</tr>
|
25 |
<tr>
|
26 |
<th><label for="styles.background"><?php _e('Slideshow Background', $this -> plugin_name); ?></label></th>
|
27 |
<td>
|
28 |
-
<input type="text" name="styles[background]" value="
|
29 |
</td>
|
30 |
</tr>
|
31 |
<tr>
|
32 |
<th><label for="styles.infobackground"><?php _e('Information Background', $this -> plugin_name); ?></label></th>
|
33 |
<td>
|
34 |
-
<input type="text" name="styles[infobackground]" value="
|
35 |
</td>
|
36 |
</tr>
|
37 |
<tr>
|
38 |
<th><label for="styles.infocolor"><?php _e('Information Text Color', $this -> plugin_name); ?></label></th>
|
39 |
<td>
|
40 |
-
<input type="text" name="styles[infocolor]" value="
|
41 |
</td>
|
42 |
</tr>
|
43 |
</tbody>
|
2 |
|
3 |
<table class="form-table">
|
4 |
<tbody>
|
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>
|
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>
|
views/admin/metaboxes/settings-submit.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<div id="misc-publishing-actions">
|
4 |
<div class="misc-pub-section">
|
5 |
<ul>
|
6 |
-
<li><a href="
|
7 |
</ul>
|
8 |
</div>
|
9 |
</div>
|
3 |
<div id="misc-publishing-actions">
|
4 |
<div class="misc-pub-section">
|
5 |
<ul>
|
6 |
+
<li><a href="<?php echo $this -> url; ?>&method=reset" title="<?php _e('Reset all configuration settings to their default values', $this -> plugin_name); ?>" onclick="if (!confirm('<?php _e('Are you sure you wish to reset all configuration settings?', $this -> plugin_name); ?>')) { return false; }"><?php _e('Reset to Defaults', $this -> plugin_name); ?></a></li>
|
7 |
</ul>
|
8 |
</div>
|
9 |
</div>
|
views/admin/msg-top.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php if (!empty($message)) : ?>
|
2 |
<div class="updated fade">
|
3 |
-
<p
|
4 |
</div>
|
5 |
<?php endif; ?>
|
1 |
<?php if (!empty($message)) : ?>
|
2 |
<div class="updated fade">
|
3 |
+
<p><?php echo $message; ?></p>
|
4 |
</div>
|
5 |
<?php endif; ?>
|
views/admin/paginate.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php if (!empty($paginate -> pagination)) : ?>
|
2 |
<div class="tablenav-pages">
|
3 |
-
|
4 |
</div>
|
5 |
<?php endif; ?>
|
1 |
<?php if (!empty($paginate -> pagination)) : ?>
|
2 |
<div class="tablenav-pages">
|
3 |
+
<?php echo $paginate -> pagination; ?>
|
4 |
</div>
|
5 |
<?php endif; ?>
|
views/admin/settings.php
CHANGED
@@ -1,8 +1,12 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
3 |
add_meta_box('submitdiv', __('Save Settings', $this -> plugin_name), array($this -> Metabox, "settings_submit"), 'post', 'side', 'core');
|
4 |
add_meta_box('generaldiv', __('General Settings', $this -> plugin_name), array($this -> Metabox, "settings_general"), 'post', 'normal', 'core');
|
5 |
-
add_meta_box('stylesdiv', __('Styles', $this -> plugin_name), array($this -> Metabox, "settings_styles"), 'post', 'normal', 'core');
|
6 |
|
7 |
//WordPress security measurements for calls
|
8 |
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
|
@@ -13,7 +17,7 @@ wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
|
|
13 |
<div class="wrap">
|
14 |
<h2><?php _e('Configuration Settings', $this -> plugin_name); ?></h2>
|
15 |
|
16 |
-
<form action="
|
17 |
<div id="poststuff" class="metabox-holder has-right-sidebar">
|
18 |
<div id="side-info-column" class="inner-sidebar">
|
19 |
<?php do_meta_boxes('post', 'side', $post); ?>
|
1 |
<?php
|
2 |
|
3 |
+
global $post_ID, $post, $wp_meta_boxes;
|
4 |
+
$post_ID = 1;
|
5 |
+
$wp_meta_boxes = false;
|
6 |
+
|
7 |
add_meta_box('submitdiv', __('Save Settings', $this -> plugin_name), array($this -> Metabox, "settings_submit"), 'post', 'side', 'core');
|
8 |
add_meta_box('generaldiv', __('General Settings', $this -> plugin_name), array($this -> Metabox, "settings_general"), 'post', 'normal', 'core');
|
9 |
+
add_meta_box('stylesdiv', __('Appearance & Styles', $this -> plugin_name), array($this -> Metabox, "settings_styles"), 'post', 'normal', 'core');
|
10 |
|
11 |
//WordPress security measurements for calls
|
12 |
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
|
17 |
<div class="wrap">
|
18 |
<h2><?php _e('Configuration Settings', $this -> plugin_name); ?></h2>
|
19 |
|
20 |
+
<form action="<?php echo $this -> url; ?>" method="post">
|
21 |
<div id="poststuff" class="metabox-holder has-right-sidebar">
|
22 |
<div id="side-info-column" class="inner-sidebar">
|
23 |
<?php do_meta_boxes('post', 'side', $post); ?>
|
views/admin/slides/index.php
CHANGED
@@ -1,68 +1,70 @@
|
|
1 |
<div class="wrap">
|
2 |
-
<h2><?php _e('Manage Slides', $this -> plugin_name); ?> (
|
3 |
|
4 |
<?php if (!empty($slides)) : ?>
|
5 |
-
<form id="posts-filter" action="
|
6 |
<ul class="subsubsub">
|
7 |
-
<li
|
8 |
</ul>
|
9 |
-
|
10 |
-
|
11 |
</form>
|
12 |
<?php endif; ?>
|
13 |
|
14 |
-
|
15 |
-
<
|
16 |
-
<div class="
|
17 |
-
<
|
18 |
-
|
19 |
-
|
20 |
-
<
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
24 |
</div>
|
25 |
-
<?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<table class="widefat">
|
29 |
-
<thead>
|
30 |
-
<tr>
|
31 |
-
<th class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></th>
|
32 |
-
<th><?php _e('Image', $this -> plugin_name); ?></th>
|
33 |
-
<th><?php _e('Title', $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('Date', $this -> plugin_name); ?></th>
|
44 |
-
<th><?php _e('Order', $this -> plugin_name); ?></th>
|
45 |
-
</tr>
|
46 |
-
</tfoot>
|
47 |
-
<tbody>
|
48 |
-
<?php foreach ($slides as $slide) : ?>
|
49 |
-
<tr class="<?= $class = (empty($class)) ? 'alternate' : ''; ?>">
|
50 |
-
<th class="check-column"><input type="checkbox" name="Slide[checklist][]" value="<?= $slide -> id; ?>" id="checklist<?= $slide -> id; ?>" /></th>
|
51 |
-
<td style="width:75px;">
|
52 |
-
<?php $image = basename($slide -> image_url); ?>
|
53 |
-
<a href="<?= $this -> Html -> image_url($image); ?>" title="<?= $slide -> title; ?>" class="thickbox"><img src="<?= $this -> Html -> image_url($this -> Html -> thumbname($image, "small")); ?>" alt="<?= $this -> Html -> sanitize($slide -> title); ?>" /></a>
|
54 |
-
</td>
|
55 |
-
<td><a class="row-title" href="<?= $this -> url; ?>&method=save&id=<?= $slide -> id; ?>" title=""><?= $slide -> title; ?></a></td>
|
56 |
-
<td><abbr title="<?= $slide -> modified; ?>"><?= date("Y-m-d", strtotime($slide -> modified)); ?></abbr></td>
|
57 |
-
<td><?= ((int) $slide -> order + 1); ?></td>
|
58 |
-
</tr>
|
59 |
-
<?php endforeach; ?>
|
60 |
-
</tbody>
|
61 |
-
</table>
|
62 |
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
68 |
</div>
|
1 |
<div class="wrap">
|
2 |
+
<h2><?php _e('Manage Slides', $this -> plugin_name); ?> (<?php echo $this -> Html -> link(__('add new'), $this -> url . '&method=save'); ?>)</h2>
|
3 |
|
4 |
<?php if (!empty($slides)) : ?>
|
5 |
+
<form id="posts-filter" action="<?php echo $this -> url; ?>" method="post">
|
6 |
<ul class="subsubsub">
|
7 |
+
<li><?php echo $paginate -> allcount; ?> <?php _e('slides', $this -> plugin_name); ?></li>
|
8 |
</ul>
|
|
|
|
|
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; ?>&method=mass" method="post">
|
14 |
+
<div class="tablenav">
|
15 |
+
<div class="alignleft actions">
|
16 |
+
<a href="<?php echo $this -> url; ?>&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('Date', $this -> plugin_name); ?></th>
|
34 |
+
<th><?php _e('Order', $this -> plugin_name); ?></th>
|
35 |
+
</tr>
|
36 |
+
</thead>
|
37 |
+
<tfoot>
|
38 |
+
<tr>
|
39 |
+
<th class="check-column"><input type="checkbox" name="checkboxall" id="checkboxall" value="checkboxall" /></th>
|
40 |
+
<th><?php _e('Image', $this -> plugin_name); ?></th>
|
41 |
+
<th><?php _e('Title', $this -> plugin_name); ?></th>
|
42 |
+
<th><?php _e('Date', $this -> plugin_name); ?></th>
|
43 |
+
<th><?php _e('Order', $this -> plugin_name); ?></th>
|
44 |
+
</tr>
|
45 |
+
</tfoot>
|
46 |
+
<tbody>
|
47 |
+
<?php foreach ($slides as $slide) : ?>
|
48 |
+
<tr class="<?php echo $class = (empty($class)) ? 'alternate' : ''; ?>">
|
49 |
+
<th class="check-column"><input type="checkbox" name="Slide[checklist][]" value="<?php echo $slide -> id; ?>" id="checklist<?php echo $slide -> id; ?>" /></th>
|
50 |
+
<td style="width:75px;">
|
51 |
+
<?php $image = basename($slide -> image_url); ?>
|
52 |
+
<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>
|
53 |
+
</td>
|
54 |
+
<td><a class="row-title" href="<?php echo $this -> url; ?>&method=save&id=<?php echo $slide -> id; ?>" title=""><?php echo $slide -> title; ?></a></td>
|
55 |
+
<td><abbr title="<?php echo $slide -> modified; ?>"><?php echo date("Y-m-d", strtotime($slide -> modified)); ?></abbr></td>
|
56 |
+
<td><?php echo ((int) $slide -> order + 1); ?></td>
|
57 |
+
</tr>
|
58 |
+
<?php endforeach; ?>
|
59 |
+
</tbody>
|
60 |
+
</table>
|
61 |
|
62 |
+
<div class="tablenav">
|
63 |
+
|
64 |
+
<?php $this -> render('paginate', array('paginate' => $paginate), true, 'admin'); ?>
|
65 |
+
</div>
|
66 |
+
</form>
|
67 |
+
<?php else : ?>
|
68 |
+
<p style="color:red;"><?php _e('No slides found', $this -> plugin_name); ?></p>
|
69 |
+
<?php endif; ?>
|
70 |
</div>
|
views/admin/slides/order.php
CHANGED
@@ -2,15 +2,16 @@
|
|
2 |
<h2><?php _e('Order Slides', $this -> plugin_name); ?></h2>
|
3 |
|
4 |
<div style="float:none;" class="subsubsub">
|
5 |
-
<a href="
|
6 |
</div>
|
7 |
|
8 |
<?php if (!empty($slides)) : ?>
|
9 |
<ul id="slidelist">
|
10 |
<?php foreach ($slides as $slide) : ?>
|
11 |
-
<li class="lineitem" id="item_
|
12 |
-
<span><img src="
|
13 |
-
|
|
|
14 |
</li>
|
15 |
<?php endforeach; ?>
|
16 |
</ul>
|
@@ -41,6 +42,9 @@
|
|
41 |
cursor: move;
|
42 |
vertical-align: middle !important;
|
43 |
display: block;
|
|
|
|
|
|
|
44 |
}
|
45 |
</style>
|
46 |
<?php else : ?>
|
2 |
<h2><?php _e('Order Slides', $this -> plugin_name); ?></h2>
|
3 |
|
4 |
<div style="float:none;" class="subsubsub">
|
5 |
+
<a href="<?php echo $this -> url; ?>"><?php _e('← Manage All Slides', $this -> plugin_name); ?></a>
|
6 |
</div>
|
7 |
|
8 |
<?php if (!empty($slides)) : ?>
|
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>
|
42 |
cursor: move;
|
43 |
vertical-align: middle !important;
|
44 |
display: block;
|
45 |
+
clear: both;
|
46 |
+
-moz-border-radius: 4px;
|
47 |
+
-webkit-border-radius: 4px;
|
48 |
}
|
49 |
</style>
|
50 |
<?php else : ?>
|
views/admin/slides/save.php
CHANGED
@@ -1,36 +1,36 @@
|
|
1 |
<div class="wrap">
|
2 |
<h2><?php _e('Save a Slide', $this -> plugin_name); ?></h2>
|
3 |
|
4 |
-
<form action="
|
5 |
-
<input type="hidden" name="Slide[id]" value="
|
6 |
-
<input type="hidden" name="Slide[order]" value="
|
7 |
|
8 |
<table class="form-table">
|
9 |
<tbody>
|
10 |
<tr>
|
11 |
<th><label for="Slide.title"><?php _e('Title', $this -> plugin_name); ?></label></th>
|
12 |
<td>
|
13 |
-
<input class="widefat" type="text" name="Slide[title]" value="
|
14 |
-
|
15 |
</td>
|
16 |
</tr>
|
17 |
<tr>
|
18 |
<th><label for="Slide.description"><?php _e('Description', $this -> plugin_name); ?></label></th>
|
19 |
<td>
|
20 |
-
<textarea class="widefat" name="Slide[description]"
|
21 |
-
|
22 |
</td>
|
23 |
</tr>
|
24 |
<tr>
|
25 |
<th><label for="Slide.image_url"><?php _e('Image URL', $this -> plugin_name); ?></th>
|
26 |
<td>
|
27 |
-
<input class="widefat" type="text" name="Slide[image_url]" value="
|
28 |
-
|
29 |
</td>
|
30 |
</tr>
|
31 |
<tr>
|
32 |
<th><label for="Slide.link"><?php _e('Link To', $this -> plugin_name); ?></label></th>
|
33 |
-
<td><input class="widefat" type="text" name="Slide[link]" value="
|
34 |
</tr>
|
35 |
</tbody>
|
36 |
</table>
|
1 |
<div class="wrap">
|
2 |
<h2><?php _e('Save a Slide', $this -> plugin_name); ?></h2>
|
3 |
|
4 |
+
<form action="<?php echo $this -> url; ?>&method=save" method="post">
|
5 |
+
<input type="hidden" name="Slide[id]" value="<?php echo $this -> Slide -> data -> id; ?>" />
|
6 |
+
<input type="hidden" name="Slide[order]" value="<?php echo $this -> Slide -> data -> order; ?>" />
|
7 |
|
8 |
<table class="form-table">
|
9 |
<tbody>
|
10 |
<tr>
|
11 |
<th><label for="Slide.title"><?php _e('Title', $this -> plugin_name); ?></label></th>
|
12 |
<td>
|
13 |
+
<input class="widefat" type="text" name="Slide[title]" value="<?php echo esc_attr($this -> Slide -> data -> title); ?>" id="Slide.title" />
|
14 |
+
<?php echo (!empty($this -> Slide -> errors['title'])) ? '<div style="color:red;">' . $this -> Slide -> errors['title'] . '</div>' : ''; ?>
|
15 |
</td>
|
16 |
</tr>
|
17 |
<tr>
|
18 |
<th><label for="Slide.description"><?php _e('Description', $this -> plugin_name); ?></label></th>
|
19 |
<td>
|
20 |
+
<textarea class="widefat" name="Slide[description]"><?php echo esc_attr($this -> Slide -> data -> description); ?></textarea>
|
21 |
+
<?php echo (!empty($this -> Slide -> errors['description'])) ? '<div style="color:red;">' . $this -> Slide -> errors['description'] . '</div>' : ''; ?>
|
22 |
</td>
|
23 |
</tr>
|
24 |
<tr>
|
25 |
<th><label for="Slide.image_url"><?php _e('Image URL', $this -> plugin_name); ?></th>
|
26 |
<td>
|
27 |
+
<input class="widefat" type="text" name="Slide[image_url]" value="<?php echo esc_attr($this -> Slide -> data -> image_url); ?>" id="Slide.image_url" />
|
28 |
+
<?php echo (!empty($this -> Slide -> errors['image_url'])) ? '<div style="color:red;">' . $this -> Slide -> errors['image_url'] . '</div>' : ''; ?>
|
29 |
</td>
|
30 |
</tr>
|
31 |
<tr>
|
32 |
<th><label for="Slide.link"><?php _e('Link To', $this -> plugin_name); ?></label></th>
|
33 |
+
<td><input class="widefat" type="text" name="Slide[link]" value="<?php echo esc_attr($this -> Slide -> data -> link); ?>" id="Slide.link" /></td>
|
34 |
</tr>
|
35 |
</tbody>
|
36 |
</table>
|
views/default/gallery.php
CHANGED
@@ -1,21 +1,42 @@
|
|
1 |
<?php if (!empty($slides)) : ?>
|
2 |
<ul id="slideshow" style="display:none;">
|
3 |
-
<?php
|
4 |
-
|
5 |
-
<
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
<?php else : ?>
|
12 |
-
<
|
13 |
<?php endif; ?>
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</ul>
|
20 |
|
21 |
<div id="wrapper">
|
@@ -62,23 +83,23 @@
|
|
62 |
|
63 |
var slideshow = new TINY.slideshow("slideshow");
|
64 |
|
65 |
-
jQuery(document).ready(function() {
|
66 |
<?php if ($this -> get_option('autoslide')) : ?>slideshow.auto = true;<?php else : ?>slideshow.auto = false;<?php endif; ?>
|
67 |
-
slideshow.speed =
|
68 |
-
slideshow.imgSpeed =
|
69 |
-
slideshow.navOpacity =
|
70 |
-
slideshow.navHover =
|
71 |
slideshow.letterbox = "#000000";
|
72 |
slideshow.link = "linkhover";
|
73 |
-
slideshow.info = "
|
74 |
-
slideshow.infoSpeed =
|
75 |
-
slideshow.thumbs = "
|
76 |
-
slideshow.thumbOpacity =
|
77 |
slideshow.left = "slideleft";
|
78 |
slideshow.right = "slideright";
|
79 |
-
slideshow.scrollSpeed =
|
80 |
-
slideshow.spacing =
|
81 |
-
slideshow.active = "
|
82 |
slideshow.init("slideshow","image","imgprev","imgnext","imglink");
|
83 |
});
|
84 |
</script>
|
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>
|
19 |
<?php endif; ?>
|
20 |
+
</li>
|
21 |
+
<?php endforeach; ?>
|
22 |
+
<?php else : ?>
|
23 |
+
<?php foreach ($slides as $slide) : ?>
|
24 |
+
<li>
|
25 |
+
<h3><?php echo $slide -> title; ?></h3>
|
26 |
+
<span><?php echo get_bloginfo('wpurl'); ?>/wp-content/uploads/<?php echo $this -> plugin_name; ?>/<?php echo basename($slide -> image_url); ?></span>
|
27 |
+
<p><?php echo $slide -> description; ?></p>
|
28 |
+
<?php if ($this -> get_option('thumbnails') == "Y") : ?>
|
29 |
+
<?php if (!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(basename($slide -> image_url))); ?>" 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(basename($slide -> image_url))); ?>" 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>
|
36 |
+
<?php endif; ?>
|
37 |
+
</li>
|
38 |
+
<?php endforeach; ?>
|
39 |
+
<?php endif; ?>
|
40 |
</ul>
|
41 |
|
42 |
<div id="wrapper">
|
83 |
|
84 |
var slideshow = new TINY.slideshow("slideshow");
|
85 |
|
86 |
+
jQuery(document).ready(function() {
|
87 |
<?php if ($this -> get_option('autoslide')) : ?>slideshow.auto = true;<?php else : ?>slideshow.auto = false;<?php endif; ?>
|
88 |
+
slideshow.speed = <?php echo $this -> get_option('autospeed'); ?>;
|
89 |
+
slideshow.imgSpeed = <?php echo $this -> get_option('fadespeed'); ?>;
|
90 |
+
slideshow.navOpacity = <?php echo $this -> get_option('navopacity'); ?>;
|
91 |
+
slideshow.navHover = <?php echo $this -> get_option('navhover'); ?>;
|
92 |
slideshow.letterbox = "#000000";
|
93 |
slideshow.link = "linkhover";
|
94 |
+
slideshow.info = "<?php echo ($this -> get_option('information') == "Y") ? 'information' : ''; ?>";
|
95 |
+
slideshow.infoSpeed = <?php echo $this -> get_option('infospeed'); ?>;
|
96 |
+
slideshow.thumbs = "<?php echo ($this -> get_option('thumbnails') == "Y") ? 'slider' : ''; ?>";
|
97 |
+
slideshow.thumbOpacity = <?php echo $this -> get_option('thumbopacity'); ?>;
|
98 |
slideshow.left = "slideleft";
|
99 |
slideshow.right = "slideright";
|
100 |
+
slideshow.scrollSpeed = <?php echo $this -> get_option('thumbscrollspeed'); ?>;
|
101 |
+
slideshow.spacing = <?php echo $this -> get_option('thumbspacing'); ?>;
|
102 |
+
slideshow.active = "<?php echo $this -> get_option('thumbactive'); ?>";
|
103 |
slideshow.init("slideshow","image","imgprev","imgnext","imglink");
|
104 |
});
|
105 |
</script>
|