Version Description
- Off Buttons issue - Fixed.
- Function renamed for admin styles.
- Function for loading plugin text domain fixed.
- Some code indentation.
Download this release
Release Info
Developer | EnigmaWeb |
Plugin | Logo Slider |
Version | 1.4.5 |
Comparing to | |
See all releases |
Code changes from version 1.4.4 to 1.4.5
- logo-slider.php +774 -704
- readme.txt +13 -1
logo-slider.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Logo Slider
|
4 |
Plugin URI: http://www.wordpress.org/extend/plugins/logo-slider
|
5 |
Description: Add a logo slideshow carousel to your site quicky and easily.
|
6 |
-
Version: 1.4.
|
7 |
Author: Enigma Plugins
|
8 |
Author URI: http://www.enigmaplugins.com
|
9 |
*/
|
@@ -20,27 +20,29 @@ will be used throughout the plugin
|
|
20 |
error_reporting(0);
|
21 |
|
22 |
// Localization / Internationalization
|
23 |
-
|
|
|
|
|
|
|
|
|
24 |
|
25 |
-
//
|
26 |
$wp_logo_defaults = apply_filters('wp_logo_defaults', array(
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
'auto_slide_time' => '',
|
36 |
-
|
37 |
));
|
38 |
|
39 |
-
//
|
40 |
$wp_logo_slider_settings = get_option('wp_logo_slider_settings');
|
41 |
$wp_logo_slider_images = get_option('wp_logo_slider_images');
|
42 |
|
43 |
-
//
|
44 |
$wp_logo_slider_settings = wp_parse_args($wp_logo_slider_settings, $wp_logo_defaults);
|
45 |
|
46 |
|
@@ -51,33 +53,30 @@ to the proper actions in WordPress
|
|
51 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
52 |
*/
|
53 |
|
54 |
-
//
|
55 |
add_action('admin_init', 'wp_logo_register_settings');
|
56 |
function wp_logo_register_settings() {
|
57 |
-
|
58 |
-
|
59 |
}
|
60 |
-
//
|
61 |
add_action('admin_menu', 'wp_logo_slider_menu');
|
62 |
function wp_logo_slider_menu() {
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
$icon = plugin_dir_url( __FILE__ ).'icon.png';
|
71 |
-
add_menu_page($page_title,$menu_title,$capability,$menu_slug,$function,$icon);
|
72 |
-
|
73 |
}
|
74 |
|
75 |
-
//
|
76 |
add_filter('plugin_action_links_' . plugin_basename(__FILE__) , 'wp_logo_plugin_action_links');
|
77 |
function wp_logo_plugin_action_links($links) {
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
}
|
82 |
|
83 |
|
@@ -90,545 +89,613 @@ changes, as well as producing the visible page output.
|
|
90 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
91 |
*/
|
92 |
function wp_logo_slider() {
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
wp_logo_handle_upload();
|
98 |
-
|
99 |
-
// delete an image, if necessary
|
100 |
-
if(isset($_REQUEST['delete']))
|
101 |
-
wp_logo_delete_upload($_REQUEST['delete']);
|
102 |
-
|
103 |
-
// the image management form
|
104 |
-
wp_logo_images_admin();
|
105 |
-
|
106 |
-
// the settings management form
|
107 |
-
wp_logo_settings_admin();
|
108 |
|
109 |
-
|
110 |
-
|
|
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
/*
|
114 |
///////////////////////////////////////////////
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
119 |
*/
|
120 |
// this function handles the file upload,
|
121 |
// resize/crop, and adds the image data to the db
|
122 |
function wp_logo_handle_upload() {
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
}
|
194 |
|
195 |
-
//
|
196 |
-
//
|
197 |
function wp_logo_delete_upload($id) {
|
198 |
-
|
199 |
-
|
200 |
-
// if the ID passed to this function is invalid,
|
201 |
-
// halt the process, and don't try to delete.
|
202 |
-
if(!isset($wp_logo_slider_images[$id])) return;
|
203 |
-
|
204 |
-
// delete the image and thumbnail
|
205 |
-
unlink($wp_logo_slider_images[$id]['file']);
|
206 |
-
unlink($wp_logo_slider_images[$id]['thumbnail']);
|
207 |
-
|
208 |
-
// indicate that the image was deleted
|
209 |
-
$wp_logo_slider_images['update'] = 'Deleted';
|
210 |
-
|
211 |
-
// remove the image data from the db
|
212 |
-
unset($wp_logo_slider_images[$id]);
|
213 |
-
update_option('wp_logo_slider_images', $wp_logo_slider_images);
|
214 |
-
}
|
215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
|
217 |
/*
|
218 |
///////////////////////////////////////////////
|
219 |
-
these two functions check to see if an update
|
220 |
-
to the data just occurred. if it did, then they
|
221 |
-
will display a notice, and reset the update option.
|
222 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
223 |
*/
|
224 |
-
//
|
225 |
-
//
|
226 |
function wp_logo_slider_settings_update_check() {
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
|
|
|
|
|
|
|
|
233 |
}
|
234 |
-
|
235 |
-
//
|
|
|
236 |
function wp_logo_slider_images_update_check() {
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
}
|
244 |
|
245 |
-
|
246 |
/*
|
247 |
///////////////////////////////////////////////
|
248 |
these two functions display the front-end code
|
249 |
on the admin page. it's mostly form markup.
|
250 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
251 |
*/
|
252 |
-
//
|
253 |
function wp_logo_images_admin() { ?>
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
|
|
276 |
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
</
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
<form method="post" action="options.php">
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
</form>
|
313 |
|
314 |
-
|
315 |
</table>
|
316 |
-
<?php endif; ?>
|
317 |
-
|
318 |
<?php
|
|
|
319 |
}
|
320 |
|
321 |
-
|
322 |
/*
|
323 |
///////////////////////////////////////////////
|
324 |
-
|
325 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
326 |
*/
|
327 |
|
328 |
function image_sort(){
|
329 |
-
wp_enqueue_script('jquery');
|
|
|
330 |
?>
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
var ordr = jQuery(this).sortable('serialize') + '&action=list_update_order';
|
345 |
-
jQuery.post(ajaxurl, ordr, function(response){
|
346 |
-
//alert(response);
|
347 |
});
|
348 |
-
}
|
349 |
-
|
350 |
-
});
|
351 |
-
|
352 |
-
</script>
|
353 |
<?php
|
354 |
-
|
355 |
-
|
356 |
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
$list = $wp_logo_slider_images;
|
361 |
-
$new_order = $_POST['list_item'];
|
362 |
-
$new_list = array();
|
363 |
-
|
364 |
-
foreach($new_order as $v){
|
365 |
-
if(isset($list[$v])){
|
366 |
-
$new_list[$v] = $list[$v];
|
367 |
-
}
|
368 |
-
}
|
369 |
-
update_option('wp_logo_slider_images',$new_list);
|
370 |
-
}
|
371 |
-
add_action('wp_ajax_list_update_order','order_list');
|
372 |
|
373 |
-
|
|
|
|
|
374 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
|
376 |
-
|
377 |
-
function wp_logo_settings_admin() { ?>
|
378 |
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
|
|
|
|
|
|
|
|
|
|
384 |
<table class="form-table">
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
<tr><th scope="row"><?php _e('Images Per Slide','lgs') ?></th>
|
389 |
<td>
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
<option value="8" <?php echo ($options['num_img'] == '8' ? 'selected="selected"' : '') ?>><?php _e('8','lgs') ?></option>
|
399 |
-
</select> <small><?php _e('Number of logos per slide','lgs') ?></small> </td>
|
400 |
-
</tr>
|
401 |
-
|
402 |
-
<tr><th scope="row"><?php _e('Background Colour','lgs') ?></th>
|
403 |
-
<td><input type="text" name="wp_logo_slider_settings[bgcolour]" value="<?php echo $options['bgcolour'] ?>" /> <small><?php _e('Format: ','lgs') ?>#FFFFFF</small></td>
|
404 |
-
</tr>
|
405 |
-
|
406 |
-
<tr><th scope="row"><?php _e('Open logo links in New Window','lgs') ?></th>
|
407 |
-
<td><input type="checkbox" name="wp_logo_slider_settings[new_window]" <?php echo ($options['new_window'] == 'on' ? 'checked="checked"' : '' ) ?> /></td>
|
408 |
-
</tr>
|
409 |
-
|
410 |
-
<tr><th scope="row"><?php _e('Select Slider','lgs') ?></th>
|
411 |
<td>
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
<td id="arrow-style">
|
421 |
-
|
422 |
-
|
423 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
</td>
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
</tr>
|
429 |
-
|
430 |
-
<tr><th scope="row"><?php _e('Arrow Style','lgs') ?></th>
|
431 |
<td id="arrow-style">
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
449 |
</table>
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
|
|
|
|
|
|
|
|
|
|
466 |
|
467 |
<?php
|
468 |
}
|
469 |
|
470 |
-
|
471 |
/*
|
472 |
///////////////////////////////////////////////
|
473 |
-
these two functions sanitize the data before it
|
474 |
-
gets stored in the database via options.php
|
475 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
476 |
*/
|
477 |
-
//
|
478 |
function wp_logo_settings_validate($input) {
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
}
|
490 |
-
|
|
|
491 |
function wp_logo_images_validate($input) {
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
return $input;
|
503 |
}
|
504 |
|
505 |
/*
|
506 |
///////////////////////////////////////////////
|
507 |
-
this final section generates all the code that
|
508 |
-
is displayed on the front-end of the WP Theme
|
509 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
510 |
*/
|
511 |
function logo_slider($args = array(), $content = null) {
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
$
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
$
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
echo '</a>';
|
609 |
-
}
|
610 |
-
|
611 |
-
echo '</li>';
|
612 |
-
}
|
613 |
-
?>
|
614 |
-
</ul>
|
615 |
<?php
|
616 |
-
|
617 |
-
|
618 |
-
|
|
|
|
|
619 |
}
|
620 |
|
621 |
-
//
|
622 |
add_shortcode('logo-slider', 'wp_slider_shortcode');
|
623 |
function wp_slider_shortcode($atts) {
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
return $output;
|
631 |
-
|
632 |
}
|
633 |
|
634 |
add_action('wp_print_scripts', 'wp_LogoSlider_scripts');
|
@@ -643,240 +710,243 @@ function wp_LogoSlider_scripts() {
|
|
643 |
|
644 |
add_action( 'wp_head', 'wp_logo_slider_style' );
|
645 |
function wp_logo_slider_style() {
|
646 |
-
|
647 |
-
|
648 |
?>
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
position:relative;
|
656 |
-
|
657 |
}
|
658 |
-
.slider-controls{
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
}
|
663 |
#logo-slider {
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
}
|
673 |
-
.slide{
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
}
|
678 |
-
.slider-controls a{
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
}
|
684 |
#prev{
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
}
|
689 |
#next{
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
}
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
margin-left:32px;
|
735 |
-
}
|
736 |
}
|
737 |
@media screen and (min-width:321px) and (max-width:480px){
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
}
|
764 |
@media screen and (min-width:321px) and (max-width:360px){
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
}
|
790 |
@media screen and (min-width:481px) and (max-width:640px){
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
}
|
817 |
@media only screen and (min-width:641px) and (max-width:768px){
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
}
|
845 |
@media only screen and (min-width:770px){
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
}
|
|
|
|
|
|
|
872 |
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
|
|
|
|
|
|
|
3 |
Plugin Name: Logo Slider
|
4 |
Plugin URI: http://www.wordpress.org/extend/plugins/logo-slider
|
5 |
Description: Add a logo slideshow carousel to your site quicky and easily.
|
6 |
+
Version: 1.4.5
|
7 |
Author: Enigma Plugins
|
8 |
Author URI: http://www.enigmaplugins.com
|
9 |
*/
|
20 |
error_reporting(0);
|
21 |
|
22 |
// Localization / Internationalization
|
23 |
+
add_action( 'plugins_loaded', 'lgs_plugin_load_textdomain' );
|
24 |
+
function lgs_plugin_load_textdomain() {
|
25 |
+
load_plugin_textdomain( 'lgs', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
26 |
+
}
|
27 |
+
|
28 |
|
29 |
+
// define our defaults (filterable)
|
30 |
$wp_logo_defaults = apply_filters('wp_logo_defaults', array(
|
31 |
+
'custom_css' => 'You can write your custom CSS here.',
|
32 |
+
'arrow' => 1,
|
33 |
+
'bgcolour' => '#FFFFFF',
|
34 |
+
'slider_width' => 450,
|
35 |
+
'slider_height' => 198,
|
36 |
+
'num_img' => 2,
|
37 |
+
'auto_slide' => 1,
|
38 |
+
'auto_slide_time' => '',
|
|
|
|
|
39 |
));
|
40 |
|
41 |
+
// pull the settings from the db
|
42 |
$wp_logo_slider_settings = get_option('wp_logo_slider_settings');
|
43 |
$wp_logo_slider_images = get_option('wp_logo_slider_images');
|
44 |
|
45 |
+
// fallback
|
46 |
$wp_logo_slider_settings = wp_parse_args($wp_logo_slider_settings, $wp_logo_defaults);
|
47 |
|
48 |
|
53 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
54 |
*/
|
55 |
|
56 |
+
// this function registers our settings in the db
|
57 |
add_action('admin_init', 'wp_logo_register_settings');
|
58 |
function wp_logo_register_settings() {
|
59 |
+
register_setting('wp_logo_slider_images', 'wp_logo_slider_images', 'wp_logo_images_validate');
|
60 |
+
register_setting('wp_logo_slider_settings', 'wp_logo_slider_settings', 'wp_logo_settings_validate');
|
61 |
}
|
62 |
+
// this function adds the settings page to the Appearance tab
|
63 |
add_action('admin_menu', 'wp_logo_slider_menu');
|
64 |
function wp_logo_slider_menu() {
|
65 |
+
$page_title = 'Logo Slider';
|
66 |
+
$menu_title = 'Logo Slider';
|
67 |
+
$capability = 'manage_options';
|
68 |
+
$menu_slug = 'wp_logo_slider';
|
69 |
+
$function = 'wp_logo_slider';
|
70 |
+
$icon = plugin_dir_url( __FILE__ ).'icon.png';
|
71 |
+
add_menu_page($page_title,$menu_title,$capability,$menu_slug,$function,$icon);
|
|
|
|
|
|
|
72 |
}
|
73 |
|
74 |
+
// add "Settings" link to plugin page
|
75 |
add_filter('plugin_action_links_' . plugin_basename(__FILE__) , 'wp_logo_plugin_action_links');
|
76 |
function wp_logo_plugin_action_links($links) {
|
77 |
+
$wp_logo_settings_link = sprintf( '<a href="%s">%s</a>', admin_url( 'upload.php?page=wp_logo_slider' ), __('Settings') );
|
78 |
+
array_unshift($links, $wp_logo_settings_link);
|
79 |
+
return $links;
|
80 |
}
|
81 |
|
82 |
|
89 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
90 |
*/
|
91 |
function wp_logo_slider() {
|
92 |
+
echo '<div class="wrap">';
|
93 |
+
// handle image upload, if necessary
|
94 |
+
if($_REQUEST['action'] == 'wp_handle_upload')
|
95 |
+
wp_logo_handle_upload();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
+
// delete an image, if necessary
|
98 |
+
if(isset($_REQUEST['delete']))
|
99 |
+
wp_logo_delete_upload($_REQUEST['delete']);
|
100 |
|
101 |
+
// the image management form
|
102 |
+
wp_logo_images_admin();
|
103 |
+
|
104 |
+
// the settings management form
|
105 |
+
wp_logo_settings_admin();
|
106 |
+
echo '</div>';
|
107 |
+
}
|
108 |
|
109 |
/*
|
110 |
///////////////////////////////////////////////
|
111 |
+
this section handles uploading images, adding
|
112 |
+
the image data to the database, deleting images,
|
113 |
+
and deleting image data from the database.
|
114 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
115 |
*/
|
116 |
// this function handles the file upload,
|
117 |
// resize/crop, and adds the image data to the db
|
118 |
function wp_logo_handle_upload() {
|
119 |
+
global $wp_logo_slider_settings, $wp_logo_slider_images;
|
120 |
+
|
121 |
+
// upload the image
|
122 |
+
$upload = wp_handle_upload($_FILES['logo_images'], 0);
|
123 |
+
|
124 |
+
// extract the $upload array
|
125 |
+
extract($upload);
|
126 |
+
|
127 |
+
// the URL of the directory the file was loaded in
|
128 |
+
$upload_dir_url = str_replace(basename($file), '', $url);
|
129 |
+
|
130 |
+
// get the image dimensions
|
131 |
+
list($width, $height) = getimagesize($file);
|
132 |
+
|
133 |
+
// if the uploaded file is NOT an image
|
134 |
+
if(strpos($type, 'image') === FALSE) {
|
135 |
+
unlink($file); // delete the file
|
136 |
+
echo '<div class="error" id="message"><p>'.__('Sorry, but the file you uploaded does not seem to be a valid image. Please try again.','lgs').'</p></div>';
|
137 |
+
return;
|
138 |
+
}
|
139 |
+
|
140 |
+
// if the image is larger than the width/height requirements, then scale it down.
|
141 |
+
if($width > $wp_logo_slider_settings['slider_width'] || $height > $wp_logo_slider_settings['slider_height']) {
|
142 |
+
// resize the image
|
143 |
+
$width = $wp_logo_slider_settings['slider_width'];
|
144 |
+
$height = $wp_logo_slider_settings['slider_height'];
|
145 |
+
$image = wp_get_image_editor($file);
|
146 |
+
if(is_wp_error($image)){
|
147 |
+
return $image;
|
148 |
+
}
|
149 |
+
$resized = $image->resize($width, $height, TRUE);
|
150 |
+
$destFile = $image->generate_filename(NULL, NULL);
|
151 |
+
$saved = $image->save($destFile);
|
152 |
+
|
153 |
+
if(is_wp_error($saved)){
|
154 |
+
return $saved;
|
155 |
+
}
|
156 |
+
$newImgPath = $destFile;
|
157 |
+
}
|
158 |
+
|
159 |
+
// make the thumbnail
|
160 |
+
$thumb_height = round((100 * $wp_logo_slider_settings['slider_height']) / $wp_logo_slider_settings['slider_width']);
|
161 |
+
if(isset($upload['file'])) {
|
162 |
+
$thumbnail = image_resize($file, 100, $thumb_height, true, 'thumb');
|
163 |
+
$thumbnail_url = $upload_dir_url . basename($thumbnail);
|
164 |
+
}
|
165 |
+
|
166 |
+
$row = 1;
|
167 |
+
foreach((array)$wp_logo_slider_images as $image => $data) :
|
168 |
+
$row++;
|
169 |
+
endforeach;
|
170 |
+
|
171 |
+
// use the timestamp as the array key and id
|
172 |
+
$time = date('YmdHis');
|
173 |
+
|
174 |
+
// add the image data to the array
|
175 |
+
$wp_logo_slider_images[$time] = array(
|
176 |
+
'id' => $time,
|
177 |
+
'file' => $file,
|
178 |
+
'file_url' => $url,
|
179 |
+
'thumbnail' => $thumbnail,
|
180 |
+
'thumbnail_url' => $thumbnail_url,
|
181 |
+
'slide_title' => '',
|
182 |
+
'slide_desc' => '',
|
183 |
+
'image_links_to' => ''
|
184 |
+
);
|
185 |
+
|
186 |
+
// add the image information to the database
|
187 |
+
$wp_logo_slider_images['update'] = 'Added';
|
188 |
+
update_option('wp_logo_slider_images', $wp_logo_slider_images);
|
189 |
}
|
190 |
|
191 |
+
// this function deletes the image,
|
192 |
+
// and removes the image data from the db
|
193 |
function wp_logo_delete_upload($id) {
|
194 |
+
global $wp_logo_slider_images;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
|
196 |
+
// if the ID passed to this function is invalid,
|
197 |
+
// halt the process, and don't try to delete.
|
198 |
+
if(!isset($wp_logo_slider_images[$id])) return;
|
199 |
+
|
200 |
+
// delete the image and thumbnail
|
201 |
+
unlink($wp_logo_slider_images[$id]['file']);
|
202 |
+
unlink($wp_logo_slider_images[$id]['thumbnail']);
|
203 |
+
|
204 |
+
// indicate that the image was deleted
|
205 |
+
$wp_logo_slider_images['update'] = 'Deleted';
|
206 |
+
|
207 |
+
// remove the image data from the db
|
208 |
+
unset($wp_logo_slider_images[$id]);
|
209 |
+
update_option('wp_logo_slider_images', $wp_logo_slider_images);
|
210 |
+
}
|
211 |
|
212 |
/*
|
213 |
///////////////////////////////////////////////
|
214 |
+
these two functions check to see if an update
|
215 |
+
to the data just occurred. if it did, then they
|
216 |
+
will display a notice, and reset the update option.
|
217 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
218 |
*/
|
219 |
+
// this function checks to see if we just updated the settings
|
220 |
+
// if so, it displays the "updated" message.
|
221 |
function wp_logo_slider_settings_update_check() {
|
222 |
+
global $wp_logo_slider_settings;
|
223 |
+
if(isset($wp_logo_slider_settings['update'])) {
|
224 |
+
echo '<div class="updated fade" id="message">
|
225 |
+
<p>'.__('Wordpress Logo Slider Settings <strong>'.$wp_logo_slider_settings['update'],'lgs').'</strong>
|
226 |
+
</p>
|
227 |
+
</div>';
|
228 |
+
|
229 |
+
unset($wp_logo_slider_settings['update']);
|
230 |
+
update_option('wp_logo_slider_settings', $wp_logo_slider_settings);
|
231 |
+
}
|
232 |
}
|
233 |
+
|
234 |
+
// this function checks to see if we just added a new image
|
235 |
+
// if so, it displays the "updated" message.
|
236 |
function wp_logo_slider_images_update_check() {
|
237 |
+
global $wp_logo_slider_images;
|
238 |
+
if($wp_logo_slider_images['update'] == 'Added' || $wp_logo_slider_images['update'] == 'Deleted' || $wp_logo_slider_images['update'] == 'Updated') {
|
239 |
+
echo '<div class="updated fade" id="message"><p>'.__('Image(s) '.$wp_logo_slider_images['update'].' Successfully','lgs').'</p></div>';
|
240 |
+
unset($wp_logo_slider_images['update']);
|
241 |
+
update_option('wp_logo_slider_images', $wp_logo_slider_images);
|
242 |
+
}
|
243 |
}
|
244 |
|
|
|
245 |
/*
|
246 |
///////////////////////////////////////////////
|
247 |
these two functions display the front-end code
|
248 |
on the admin page. it's mostly form markup.
|
249 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
250 |
*/
|
251 |
+
// display the images administration code
|
252 |
function wp_logo_images_admin() { ?>
|
253 |
+
<?php global $wp_logo_slider_images; ?>
|
254 |
+
<?php wp_logo_slider_images_update_check(); ?>
|
255 |
+
<h2><?php _e('Wordpress LogoSlider Images','lgs'); ?></h2>
|
256 |
+
|
257 |
+
<table class="form-table">
|
258 |
+
<tr valign="top"><th scope="row"><?php _e('Upload New Image','lgs') ?></th>
|
259 |
+
<td>
|
260 |
+
<form enctype="multipart/form-data" method="post" action="?page=wp_logo_slider">
|
261 |
+
<input type="hidden" name="post_id" id="post_id" value="0" />
|
262 |
+
<input type="hidden" name="action" id="action" value="wp_handle_upload" />
|
263 |
+
|
264 |
+
<label for="logo_images"><?php _e('Select a File: ','lgs') ?></label>
|
265 |
+
<input type="file" name="logo_images" id="logo_images" />
|
266 |
+
<input type="submit" class="button-primary" name="html-upload" value="Upload" />
|
267 |
+
</form>
|
268 |
+
</td>
|
269 |
+
</tr>
|
270 |
+
</table>
|
271 |
+
<br />
|
272 |
+
|
273 |
+
<p style="border:2px solid #999; border-radius: 10px; font-size: 12px; padding: 6px 10px; width: 24%;">
|
274 |
+
<strong>Note: </strong>Drag & Drop is auto save.
|
275 |
+
</p>
|
276 |
|
277 |
+
<?php
|
278 |
+
if(!empty($wp_logo_slider_images)) :
|
279 |
+
?>
|
280 |
+
<table class="widefat fixed" cellspacing="0" id="image_sort" style="width:100%; table-layout:inherit;">
|
281 |
+
<thead>
|
282 |
+
<tr>
|
283 |
+
<th scope="col" class="column-slug"><?php _e('Image','lgs') ?></th>
|
284 |
+
<th scope="col"><?php _e('Image Links To','lgs') ?></th>
|
285 |
+
<th scope="col" class="column-slug"><?php _e('Actions','lgs') ?></th>
|
286 |
+
</tr>
|
287 |
+
</thead>
|
288 |
+
<tfoot>
|
289 |
+
<tr>
|
290 |
+
<th scope="col" class="column-slug"><?php _e('Image','lgs') ?></th>
|
291 |
+
<th scope="col"><?php _e('Image Links To','lgs') ?></th>
|
292 |
+
<th scope="col" class="column-slug"><?php _e('Actions','lgs') ?></th>
|
293 |
+
</tr>
|
294 |
+
</tfoot>
|
295 |
+
<tbody>
|
|
|
296 |
<form method="post" action="options.php">
|
297 |
+
<?php settings_fields('wp_logo_slider_images'); ?>
|
298 |
+
<?php foreach((array)$wp_logo_slider_images as $image => $data) : ?>
|
299 |
+
<tr id="list_item_<?php echo $image ?>" class="list_item">
|
300 |
+
<input type="hidden" name="wp_logo_slider_images[<?php echo $image; ?>][id]" value="<?php echo $data['id']; ?>" />
|
301 |
+
<input type="hidden" name="wp_logo_slider_images[<?php echo $image; ?>][file]" value="<?php echo $data['file']; ?>" />
|
302 |
+
<input type="hidden" name="wp_logo_slider_images[<?php echo $image; ?>][file_url]" value="<?php echo $data['file_url']; ?>" />
|
303 |
+
<input type="hidden" name="wp_logo_slider_images[<?php echo $image; ?>][thumbnail]" value="<?php //echo $data['thumbnail']; ?>" />
|
304 |
+
<input type="hidden" name="wp_logo_slider_images[<?php echo $image; ?>][thumbnail_url]" value="<?php echo $data['thumbnail_url']; ?>" />
|
305 |
+
<th scope="row" class="column-slug"><img src="<?php echo $data['thumbnail_url']; ?>" /></th>
|
306 |
+
<td>
|
307 |
+
<?php //echo $image; ?>
|
308 |
+
<input type="text" name="wp_logo_slider_images[<?php echo $image; ?>][image_links_to]" value="<?php echo $data['image_links_to']; ?>" size="30" />
|
309 |
+
</td>
|
310 |
+
<td class="column-slug">
|
311 |
+
<input type="submit" class="button-primary" value="Update" />
|
312 |
+
<a href="?page=wp_logo_slider&delete=<?php echo $image; ?>" class="button">Delete</a>
|
313 |
+
</td>
|
314 |
+
</tr>
|
315 |
+
<?php endforeach; ?>
|
316 |
+
<input type="hidden" name="wp_logo_slider_images[update]" value="Updated" />
|
317 |
</form>
|
318 |
|
319 |
+
</tbody>
|
320 |
</table>
|
|
|
|
|
321 |
<?php
|
322 |
+
endif;
|
323 |
}
|
324 |
|
|
|
325 |
/*
|
326 |
///////////////////////////////////////////////
|
327 |
+
SORTABLE FUNCTION.
|
328 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
329 |
*/
|
330 |
|
331 |
function image_sort(){
|
332 |
+
wp_enqueue_script('jquery');
|
333 |
+
wp_enqueue_script('jquery-ui-sortable');
|
334 |
?>
|
335 |
+
<script type="text/javascript">
|
336 |
+
jQuery(document).ready( function(e) {
|
337 |
+
jQuery('#image_sort').sortable({
|
338 |
+
items: '.list_item',
|
339 |
+
opacity: 0.5,
|
340 |
+
cursor: 'pointer',
|
341 |
+
axis: 'y',
|
342 |
+
update: function() {
|
343 |
+
var ordr = jQuery(this).sortable('serialize') + '&action=list_update_order';
|
344 |
+
jQuery.post(ajaxurl, ordr, function(response){
|
345 |
+
//alert(response);
|
346 |
+
});
|
347 |
+
}
|
|
|
|
|
|
|
348 |
});
|
349 |
+
});
|
350 |
+
</script>
|
|
|
|
|
|
|
351 |
<?php
|
352 |
+
}
|
353 |
+
add_action('admin_head','image_sort');
|
354 |
|
355 |
+
function order_list(){
|
356 |
+
global $wp_logo_slider_images;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
|
358 |
+
$list = $wp_logo_slider_images;
|
359 |
+
$new_order = $_POST['list_item'];
|
360 |
+
$new_list = array();
|
361 |
|
362 |
+
foreach($new_order as $v){
|
363 |
+
if(isset($list[$v])){
|
364 |
+
$new_list[$v] = $list[$v];
|
365 |
+
}
|
366 |
+
}
|
367 |
+
update_option('wp_logo_slider_images',$new_list);
|
368 |
+
}
|
369 |
+
add_action('wp_ajax_list_update_order','order_list');
|
370 |
|
371 |
+
/*============================================================================================*/
|
|
|
372 |
|
373 |
+
// display the settings administration code
|
374 |
+
function wp_logo_settings_admin() {
|
375 |
+
wp_logo_slider_settings_update_check();
|
376 |
+
?>
|
377 |
+
<h2><?php _e('Wordpress Logo Slider Settings','lgs'); ?></h2>
|
378 |
+
<form method="post" action="options.php">
|
379 |
+
<?php
|
380 |
+
settings_fields('wp_logo_slider_settings');
|
381 |
+
global $wp_logo_slider_settings; $options = $wp_logo_slider_settings;
|
382 |
+
?>
|
383 |
<table class="form-table">
|
384 |
+
<tr>
|
385 |
+
<th scope="row"><?php _e('Size','lgs') ?></th>
|
|
|
|
|
386 |
<td>
|
387 |
+
<?php _e('Width: ','lgs') ?>
|
388 |
+
<input type="text" name="wp_logo_slider_settings[slider_width]" value="<?php echo $options['slider_width'] ?>" size="4" />
|
389 |
+
<?php _e('Height: ','lgs') ?>
|
390 |
+
<input type="text" name="wp_logo_slider_settings[slider_height]" value="<?php echo $options['slider_height'] ?>" size="4" />
|
391 |
+
</td>
|
392 |
+
</tr>
|
393 |
+
<tr>
|
394 |
+
<th scope="row"><?php _e('Images Per Slide','lgs') ?></th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
395 |
<td>
|
396 |
+
<select name="wp_logo_slider_settings[num_img]">
|
397 |
+
<option value="1" <?php echo ($options['num_img'] == '1' ? 'selected="selected"' : '') ?>>
|
398 |
+
<?php _e('1','lgs') ?>
|
399 |
+
</option>
|
400 |
+
<option value="2" <?php echo ($options['num_img'] == '2' ? 'selected="selected"' : '') ?>>
|
401 |
+
<?php _e('2','lgs') ?>
|
402 |
+
</option>
|
403 |
+
<option value="3" <?php echo ($options['num_img'] == '3' ? 'selected="selected"' : '') ?>>
|
404 |
+
<?php _e('3','lgs') ?>
|
405 |
+
</option>
|
406 |
+
<option value="4" <?php echo ($options['num_img'] == '4' ? 'selected="selected"' : '') ?>>
|
407 |
+
<?php _e('4','lgs') ?>
|
408 |
+
</option>
|
409 |
+
<option value="5" <?php echo ($options['num_img'] == '5' ? 'selected="selected"' : '') ?>>
|
410 |
+
<?php _e('5','lgs') ?>
|
411 |
+
</option>
|
412 |
+
<option value="6" <?php echo ($options['num_img'] == '6' ? 'selected="selected"' : '') ?>>
|
413 |
+
<?php _e('6','lgs') ?>
|
414 |
+
</option>
|
415 |
+
<option value="7" <?php echo ($options['num_img'] == '7' ? 'selected="selected"' : '') ?>>
|
416 |
+
<?php _e('7','lgs') ?>
|
417 |
+
</option>
|
418 |
+
<option value="8" <?php echo ($options['num_img'] == '8' ? 'selected="selected"' : '') ?>>
|
419 |
+
<?php _e('8','lgs') ?>
|
420 |
+
</option>
|
421 |
+
</select>
|
422 |
+
<small><?php _e('Number of logos per slide','lgs') ?></small>
|
423 |
+
</td>
|
424 |
+
</tr>
|
425 |
+
<tr>
|
426 |
+
<th scope="row"><?php _e('Background Colour','lgs') ?></th>
|
427 |
+
<td>
|
428 |
+
<input type="text" name="wp_logo_slider_settings[bgcolour]" value="<?php echo $options['bgcolour'] ?>" />
|
429 |
+
<small><?php _e('Format: ','lgs') ?>#FFFFFF</small>
|
430 |
+
</td>
|
431 |
+
</tr>
|
432 |
+
<tr>
|
433 |
+
<th scope="row"><?php _e('Open logo links in New Window','lgs') ?></th>
|
434 |
+
<td>
|
435 |
+
<input type="checkbox" name="wp_logo_slider_settings[new_window]" <?php echo ($options['new_window'] == 'on' ? 'checked="checked"' : '' ) ?> />
|
436 |
+
</td>
|
437 |
+
</tr>
|
438 |
+
<tr>
|
439 |
+
<th scope="row"><?php _e('Select Slider','lgs') ?></th>
|
440 |
+
<td>
|
441 |
+
<select name="wp_logo_slider_settings[select_slider]">
|
442 |
+
<option value="slide" <?php echo ($options['select_slider'] == 'slide' ? 'selected="selected"' : '' ) ?>>
|
443 |
+
<?php _e('Slide','lgs') ?>
|
444 |
+
</option>
|
445 |
+
<option value="fade" <?php echo ($options['select_slider'] == 'fade' ? 'selected="selected"' : '' ) ?>>
|
446 |
+
<?php _e('Fade','lgs') ?>
|
447 |
+
</option>
|
448 |
+
</select>
|
449 |
+
</td>
|
450 |
+
</tr>
|
451 |
+
<tr>
|
452 |
+
<th scope="row"><?php _e('Auto Slide','lgs') ?></th>
|
453 |
<td id="arrow-style">
|
454 |
+
<?php _e('ON','lgs') ?>
|
455 |
+
<input type="radio" name="wp_logo_slider_settings[auto_slide]" value="1" <?php if($options['auto_slide']==1){echo 'checked="checked"';}?> />
|
456 |
+
<?php _e('OFF','lgs') ?>
|
457 |
+
<input type="radio" name="wp_logo_slider_settings[auto_slide]" value="2" <?php if($options['auto_slide']==2){echo 'checked="checked"';}?>/>
|
458 |
+
</td>
|
459 |
+
</tr>
|
460 |
+
<tr>
|
461 |
+
<th scope="row"><?php _e('Auto Slide Time','lgs') ?></th>
|
462 |
+
<td>
|
463 |
+
<input type="text" name="wp_logo_slider_settings[auto_slide_time]" value="<?php echo $options['auto_slide_time'] ?>" size="4" />
|
464 |
+
<small><?php _e('Set auto slide duration in seconds','lgs') ?></small>
|
465 |
</td>
|
466 |
+
</tr>
|
467 |
+
<tr>
|
468 |
+
<th scope="row"><?php _e('Arrow Style','lgs') ?></th>
|
|
|
|
|
|
|
469 |
<td id="arrow-style">
|
470 |
+
<p>
|
471 |
+
<img src="<?php echo plugin_dir_url(__FILE__); ?>/arrows/off.png" width="28" height="40" alt="" />
|
472 |
+
<br />
|
473 |
+
<input type="radio" name="wp_logo_slider_settings[arrow]" value="0" <?php if($options['arrow']==0){echo 'checked="checked"';}?> />
|
474 |
+
</p>
|
475 |
+
<p>
|
476 |
+
<img src="<?php echo plugin_dir_url(__FILE__); ?>/arrows/arrow1.png" width="28" height="40" alt="" />
|
477 |
+
<br />
|
478 |
+
<input type="radio" name="wp_logo_slider_settings[arrow]" value="1" <?php if($options['arrow']==1){echo 'checked="checked"';}?> />
|
479 |
+
</p>
|
480 |
+
<p>
|
481 |
+
<img src="<?php echo plugin_dir_url(__FILE__); ?>/arrows/arrow2.png" width="31" height="40" alt="" />
|
482 |
+
<br />
|
483 |
+
<input type="radio" name="wp_logo_slider_settings[arrow]" value="2" <?php if($options['arrow']==2){echo 'checked="checked"';}?>/>
|
484 |
+
</p>
|
485 |
+
<p>
|
486 |
+
<img src="<?php echo plugin_dir_url(__FILE__); ?>/arrows/arrow3.png" width="34" height="40" alt="" />
|
487 |
+
<br />
|
488 |
+
<input type="radio" name="wp_logo_slider_settings[arrow]" value="3" <?php if($options['arrow']==3){echo 'checked="checked"';}?>/>
|
489 |
+
</p>
|
490 |
+
<p>
|
491 |
+
<img src="<?php echo plugin_dir_url(__FILE__); ?>/arrows/arrow4.png" width="34" height="40" alt="" />
|
492 |
+
<br />
|
493 |
+
<input type="radio" name="wp_logo_slider_settings[arrow]" value="4" <?php if($options['arrow']==4){echo 'checked="checked"';}?>/>
|
494 |
+
</p>
|
495 |
+
<p>
|
496 |
+
<img src="<?php echo plugin_dir_url(__FILE__); ?>/arrows/arrow5.png" width="24" height="40" alt="" />
|
497 |
+
<br />
|
498 |
+
<input type="radio" name="wp_logo_slider_settings[arrow]" value="5" <?php if($options['arrow']==5){echo 'checked="checked"';}?>/>
|
499 |
+
</p>
|
500 |
+
<p>
|
501 |
+
<img src="<?php echo plugin_dir_url(__FILE__); ?>/arrows/arrow6.png" width="36" height="40" alt="" />
|
502 |
+
<br />
|
503 |
+
<input type="radio" name="wp_logo_slider_settings[arrow]" value="6" <?php if($options['arrow']==6){echo 'checked="checked"';}?>/>
|
504 |
+
</p>
|
505 |
+
<p>
|
506 |
+
<img src="<?php echo plugin_dir_url(__FILE__); ?>/arrows/arrow7.png" width="38" height="40" alt="" />
|
507 |
+
<br />
|
508 |
+
<input type="radio" name="wp_logo_slider_settings[arrow]" value="7" <?php if($options['arrow']==7){echo 'checked="checked"';}?>/>
|
509 |
+
</p>
|
510 |
+
</td>
|
511 |
+
</tr>
|
512 |
+
<tr valign="top">
|
513 |
+
<th scope="row"><?php _e('Custom CSS','lgs') ?></th>
|
514 |
+
<td>
|
515 |
+
<textarea name="wp_logo_slider_settings[custom_css]" rows="6" cols="70"><?php echo $options['custom_css']; ?></textarea>
|
516 |
+
</td>
|
517 |
+
</tr>
|
518 |
+
<input type="hidden" name="wp_logo_slider_settings[update]" value="UPDATED" />
|
519 |
</table>
|
520 |
+
|
521 |
+
<p class="submit">
|
522 |
+
<input type="submit" class="button-primary" value="<?php _e('Save Settings','lgs') ?>" />
|
523 |
+
</p>
|
524 |
+
</form>
|
525 |
+
|
526 |
+
<!-- The Reset Option -->
|
527 |
+
<form method="post" action="options.php">
|
528 |
+
<?php
|
529 |
+
settings_fields('wp_logo_slider_settings');
|
530 |
+
global $wp_logo_defaults; // use the defaults
|
531 |
+
|
532 |
+
foreach((array)$wp_logo_defaults as $key => $value) : ?>
|
533 |
+
<input type="hidden" name="wp_logo_slider_settings[<?php echo $key; ?>]" value="<?php echo $value; ?>" />
|
534 |
+
<?php
|
535 |
+
endforeach;
|
536 |
+
?>
|
537 |
+
<input type="hidden" name="wp_logo_slider_settings[update]" value="RESET" />
|
538 |
+
<input type="submit" class="button" value="<?php _e('Reset Settings','lgs') ?>" />
|
539 |
+
</form>
|
540 |
+
<!-- End Reset Option -->
|
541 |
|
542 |
<?php
|
543 |
}
|
544 |
|
|
|
545 |
/*
|
546 |
///////////////////////////////////////////////
|
547 |
+
these two functions sanitize the data before it
|
548 |
+
gets stored in the database via options.php
|
549 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
550 |
*/
|
551 |
+
// this function sanitizes our settings data for storage
|
552 |
function wp_logo_settings_validate($input) {
|
553 |
+
$input['slider_width'] = intval($input['slider_width']);
|
554 |
+
$input['slider_height'] = intval($input['slider_height']);
|
555 |
+
$input['num_img'] = intval($input['num_img']);
|
556 |
+
$input['arrow'] = intval($input['arrow']);
|
557 |
+
$input['custom_css'] = wp_filter_nohtml_kses($input['custom_css']);
|
558 |
+
$input['bgcolour'] = wp_filter_nohtml_kses($input['bgcolour']);
|
559 |
+
$input['auto_slide'] = intval($input['auto_slide']);
|
560 |
+
$input['auto_slide_time'] = intval($input['auto_slide_time']);
|
561 |
+
|
562 |
+
return $input;
|
563 |
}
|
564 |
+
|
565 |
+
// this function sanitizes our image data for storage
|
566 |
function wp_logo_images_validate($input) {
|
567 |
+
foreach((array)$input as $key => $value) {
|
568 |
+
if($key != 'update') {
|
569 |
+
$input[$key]['file_url'] = clean_url($value['file_url']);
|
570 |
+
$input[$key]['thumbnail_url'] = clean_url($value['thumbnail_url']);
|
571 |
+
|
572 |
+
if($value['image_links_to'])
|
573 |
+
$input[$key]['image_links_to'] = clean_url($value['image_links_to']);
|
574 |
+
}
|
575 |
+
}
|
576 |
+
return $input;
|
|
|
577 |
}
|
578 |
|
579 |
/*
|
580 |
///////////////////////////////////////////////
|
581 |
+
this final section generates all the code that
|
582 |
+
is displayed on the front-end of the WP Theme
|
583 |
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|
584 |
*/
|
585 |
function logo_slider($args = array(), $content = null) {
|
586 |
+
global $wp_logo_slider_settings, $wp_logo_slider_images;
|
587 |
+
|
588 |
+
// possible future use
|
589 |
+
$args = wp_parse_args($args, $wp_logo_slider_settings);
|
590 |
+
$newline = "\n"; // line break
|
591 |
+
|
592 |
+
echo '<div id="logo-slider-wraper">';
|
593 |
+
$check = $wp_logo_slider_settings['new_window'];
|
594 |
+
$new_window = '';
|
595 |
+
|
596 |
+
if(isset($check)) {
|
597 |
+
$new_window = 'target="_blank"';
|
598 |
+
} else {
|
599 |
+
$new_window = 'target="_parent"';
|
600 |
+
}
|
601 |
+
|
602 |
+
$img_num1 = 1;
|
603 |
+
$img_num2 = 2;
|
604 |
+
$img_num3 = 3;
|
605 |
+
$img_num4 = 4;
|
606 |
+
|
607 |
+
$num_img = $wp_logo_slider_settings['num_img'];
|
608 |
+
|
609 |
+
// Get web and other device engins for Responsive
|
610 |
+
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
|
611 |
+
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
|
612 |
+
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
|
613 |
+
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");
|
614 |
+
$webOS = stripos($_SERVER['HTTP_USER_AGENT'],"webOS");
|
615 |
+
$mobile = stripos($_SERVER['HTTP_USER_AGENT'],"mobile");
|
616 |
+
$BlackBerry = stripos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
|
617 |
+
$RimTablet= stripos($_SERVER['HTTP_USER_AGENT'],"RIM Tablet");
|
618 |
+
|
619 |
+
$msie = strpos($_SERVER["HTTP_USER_AGENT"], 'MSIE');
|
620 |
+
$firefox = strpos($_SERVER["HTTP_USER_AGENT"], 'Firefox');
|
621 |
+
$safari = strpos($_SERVER["HTTP_USER_AGENT"], 'Safari');
|
622 |
+
$chrome = strpos($_SERVER["HTTP_USER_AGENT"], 'Chrome');
|
623 |
+
$Opera = strpos($_SERVER["HTTP_USER_AGENT"], 'OPR');
|
624 |
+
$IE11 = strpos($_SERVER["HTTP_USER_AGENT"], 'rv:11.0');
|
625 |
+
|
626 |
+
if( $iPod || $iPhone ){
|
627 |
+
$data_chunks = array_chunk($wp_logo_slider_images, $img_num1);
|
628 |
+
}else if($iPad){
|
629 |
+
$data_chunks = array_chunk($wp_logo_slider_images, $img_num4);
|
630 |
+
}else if($Android){
|
631 |
+
$data_chunks = array_chunk($wp_logo_slider_images, $img_num1);
|
632 |
+
}else if($webOS){
|
633 |
+
$data_chunks = array_chunk($wp_logo_slider_images, $img_num1);
|
634 |
+
}else if($mobile){
|
635 |
+
$data_chunks = array_chunk($wp_logo_slider_images, $img_num1);
|
636 |
+
}else if($BlackBerry){
|
637 |
+
$data_chunks = array_chunk($wp_logo_slider_images, $img_num1);
|
638 |
+
}else if($RimTablet){
|
639 |
+
$data_chunks = array_chunk($wp_logo_slider_images, $img_num4);
|
640 |
+
}else if(($msie) || ($firefox) || ($safari) || ($chrome) || ($IE11)){
|
641 |
+
$data_chunks = array_chunk($wp_logo_slider_images, $num_img);
|
642 |
+
}
|
643 |
+
|
644 |
+
$slid = $wp_logo_slider_settings['select_slider'];
|
645 |
+
$lgs_slide_effect = '';
|
646 |
+
|
647 |
+
if($slid == 'slide') {
|
648 |
+
$lgs_slide_effect = 'scrollHorz';
|
649 |
+
} elseif($slid == 'fade') {
|
650 |
+
$lgs_slide_effect = 'fade';
|
651 |
+
} else {
|
652 |
+
$lgs_slide_effect = 'scrollHorz';
|
653 |
+
}
|
654 |
+
|
655 |
+
$lgs_auto_slide = $wp_logo_slider_settings['auto_slide'];
|
656 |
+
$lgs_slide_time = $wp_logo_slider_settings['auto_slide_time'];
|
657 |
+
|
658 |
+
// Logo Image Slider
|
659 |
+
?>
|
660 |
+
<ul id="logo-slider" class="cycle-slideshow"
|
661 |
+
data-cycle-fx="<?php echo $lgs_slide_effect ?>"
|
662 |
+
data-cycle-timeout="<?php echo (($lgs_auto_slide == 1 ) ? $lgs_slide_time * 1000 : 0) ?>"
|
663 |
+
data-cycle-next="#prev"
|
664 |
+
data-cycle-prev="#next"
|
665 |
+
data-cycle-speed="600"
|
666 |
+
data-cycle-slides="> li"
|
667 |
+
>
|
668 |
+
<?php
|
669 |
+
foreach ($data_chunks as $data_chunk) {
|
670 |
+
echo '<li class="slide">';
|
671 |
+
foreach($data_chunk as $data) {
|
672 |
+
if($data['image_links_to'])
|
673 |
+
echo '<a href="'.$data['image_links_to'].'" '.$new_window.'>';
|
674 |
+
echo '<img src="'.$data['file_url'].'" class="logo-img" alt="" />';
|
675 |
+
if($data['image_links_to'])
|
676 |
+
echo '</a>';
|
677 |
+
}
|
678 |
+
echo '</li>';
|
679 |
+
}
|
680 |
+
?>
|
681 |
+
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
<?php
|
683 |
+
if($wp_logo_slider_settings['arrow'] != 0) {
|
684 |
+
echo '<div class="slider-controls"><a href="#" id="prev"><</a> <a href="#" id="next">></a></div>';
|
685 |
+
}
|
686 |
+
|
687 |
+
echo '</div>';
|
688 |
}
|
689 |
|
690 |
+
// create the shortcode [wp_LogoSlider]
|
691 |
add_shortcode('logo-slider', 'wp_slider_shortcode');
|
692 |
function wp_slider_shortcode($atts) {
|
693 |
+
// Temp solution, output buffer the echo function.
|
694 |
+
ob_start();
|
695 |
+
logo_slider();
|
696 |
+
$output = ob_get_clean();
|
697 |
+
|
698 |
+
return $output;
|
|
|
|
|
699 |
}
|
700 |
|
701 |
add_action('wp_print_scripts', 'wp_LogoSlider_scripts');
|
710 |
|
711 |
add_action( 'wp_head', 'wp_logo_slider_style' );
|
712 |
function wp_logo_slider_style() {
|
713 |
+
global $wp_logo_slider_settings;
|
714 |
+
global $options;
|
715 |
?>
|
716 |
+
<style type="text/css" media="screen">
|
717 |
+
<?php
|
718 |
+
echo $wp_logo_slider_settings['custom_css'];
|
719 |
+
?>
|
720 |
+
#logo-slider-wraper {
|
721 |
+
position:relative;
|
|
|
|
|
722 |
}
|
723 |
+
.slider-controls {
|
724 |
+
position:absolute;
|
725 |
+
width:<?php echo $wp_logo_slider_settings['slider_width']; ?>px;
|
726 |
+
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px !important;
|
727 |
}
|
728 |
#logo-slider {
|
729 |
+
position: relative;
|
730 |
+
width: <?php echo $wp_logo_slider_settings['slider_width']; ?>px;
|
731 |
+
height: <?php echo $wp_logo_slider_settings['slider_height']?>px;
|
732 |
+
margin: 0; padding: 0;
|
733 |
+
overflow: hidden;
|
734 |
+
list-style:none;
|
735 |
+
background:<?php echo $wp_logo_slider_settings['bgcolour']; ?>;
|
736 |
+
text-align:center;
|
737 |
}
|
738 |
+
.slide {
|
739 |
+
list-style:none;
|
740 |
+
margin:0 !important;
|
741 |
+
width:<?php echo $wp_logo_slider_settings['slider_width']; ?>px !important;
|
742 |
}
|
743 |
+
.slider-controls a {
|
744 |
+
height:40px;
|
745 |
+
width:40px;
|
746 |
+
display:inline-block;
|
747 |
+
text-indent:-9000px;
|
748 |
}
|
749 |
#prev{
|
750 |
+
background:url(<?php echo WP_CONTENT_URL.'/plugins/logo-slider/arrows/arrow'. $wp_logo_slider_settings['arrow'].'.png'; ?>) no-repeat center;
|
751 |
+
float:right;
|
752 |
+
margin-right:-50px;
|
753 |
}
|
754 |
#next{
|
755 |
+
background:url(<?php echo WP_CONTENT_URL.'/plugins/logo-slider/arrows/arrow'. $wp_logo_slider_settings['arrow'].'-prev.png'; ?>) no-repeat center;
|
756 |
+
float:left;
|
757 |
+
margin-left:-50px
|
758 |
+
}
|
759 |
+
/*
|
760 |
+
===============================================================
|
761 |
+
--------------------_ Responsive _--------------------
|
762 |
+
===============================================================
|
763 |
+
*/
|
764 |
+
@media screen and (max-width:320px) {
|
765 |
+
#logo-slider-wraper{
|
766 |
+
position:relative !important;
|
767 |
+
width:52% !important;
|
768 |
+
left:42px;
|
769 |
+
}
|
770 |
+
.slider-controls {
|
771 |
+
position: absolute;
|
772 |
+
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
773 |
+
left:30px;
|
774 |
+
width: 100% !important;
|
775 |
+
}
|
776 |
+
#logo-slider {
|
777 |
+
background:<?php echo $wp_logo_slider_settings['bgcolour']; ?>;
|
778 |
+
height: <?php echo $wp_logo_slider_settings['slider_height']?>px;
|
779 |
+
list-style: none outside none;
|
780 |
+
margin: 0;
|
781 |
+
overflow: hidden;
|
782 |
+
padding: 0;
|
783 |
+
position: relative;
|
784 |
+
width: 110% !important;
|
785 |
+
}
|
786 |
+
.slide {
|
787 |
+
list-style: none outside none;
|
788 |
+
margin: 0 !important;
|
789 |
+
width: 100% !important;
|
790 |
+
}
|
791 |
+
#next{
|
792 |
+
background:url(<?php echo WP_CONTENT_URL.'/plugins/logo-slider/arrows/arrow'. $wp_logo_slider_settings['arrow'].'-prev.png'; ?>) no-repeat center;
|
793 |
+
float:left;
|
794 |
+
margin-left:-66px !important;
|
795 |
+
}
|
796 |
+
.logo-img {
|
797 |
+
margin-left:32px;
|
798 |
+
}
|
|
|
|
|
799 |
}
|
800 |
@media screen and (min-width:321px) and (max-width:480px){
|
801 |
+
#logo-slider-wraper{
|
802 |
+
position:relative;
|
803 |
+
width:35% !important;
|
804 |
+
left:55px !important;
|
805 |
+
}
|
806 |
+
.slider-controls {
|
807 |
+
position: absolute;
|
808 |
+
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
809 |
+
width: 100% !important;
|
810 |
+
}
|
811 |
+
#logo-slider {
|
812 |
+
background:<?php echo $wp_logo_slider_settings['bgcolour']; ?>;
|
813 |
+
height: <?php echo $wp_logo_slider_settings['slider_height']?>px;
|
814 |
+
list-style: none outside none;
|
815 |
+
margin: 0;
|
816 |
+
overflow: hidden;
|
817 |
+
padding: 0;
|
818 |
+
position: relative;
|
819 |
+
width: 102% !important;
|
820 |
+
}
|
821 |
+
.slide {
|
822 |
+
list-style: none outside none;
|
823 |
+
margin: 0 !important;
|
824 |
+
width: 100% !important;
|
825 |
+
}
|
826 |
}
|
827 |
@media screen and (min-width:321px) and (max-width:360px){
|
828 |
+
#logo-slider-wraper{
|
829 |
+
position:relative;
|
830 |
+
width:50% !important;
|
831 |
+
}
|
832 |
+
.slider-controls {
|
833 |
+
position: absolute;
|
834 |
+
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
835 |
+
width: 100% !important;
|
836 |
+
}
|
837 |
+
#logo-slider {
|
838 |
+
background:<?php echo $wp_logo_slider_settings['bgcolour']; ?>;
|
839 |
+
height: <?php echo $wp_logo_slider_settings['slider_height']?>px;
|
840 |
+
list-style: none outside none;
|
841 |
+
margin: 0;
|
842 |
+
overflow: hidden;
|
843 |
+
padding: 0;
|
844 |
+
position: relative;
|
845 |
+
width: 100% !important;
|
846 |
+
}
|
847 |
+
.slide {
|
848 |
+
list-style: none outside none;
|
849 |
+
margin: 0 !important;
|
850 |
+
width: 100% !important;
|
851 |
+
}
|
852 |
}
|
853 |
@media screen and (min-width:481px) and (max-width:640px){
|
854 |
+
#logo-slider-wraper{
|
855 |
+
position:relative;
|
856 |
+
width:28% !important;
|
857 |
+
left:34px !important;
|
858 |
+
}
|
859 |
+
.slider-controls {
|
860 |
+
position: absolute;
|
861 |
+
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
862 |
+
width: 100% !important;
|
863 |
+
}
|
864 |
+
#logo-slider {
|
865 |
+
background:<?php echo $wp_logo_slider_settings['bgcolour']; ?>;
|
866 |
+
height: <?php echo $wp_logo_slider_settings['slider_height']?>px;
|
867 |
+
list-style: none outside none;
|
868 |
+
margin: 0;
|
869 |
+
overflow: hidden;
|
870 |
+
padding: 0;
|
871 |
+
position: relative;
|
872 |
+
width: 100% !important;
|
873 |
+
}
|
874 |
+
.slide {
|
875 |
+
list-style: none outside none;
|
876 |
+
margin: 0 !important;
|
877 |
+
width: 100% !important;
|
878 |
+
}
|
879 |
}
|
880 |
@media only screen and (min-width:641px) and (max-width:768px){
|
881 |
+
#logo-slider-wraper{
|
882 |
+
position:relative;
|
883 |
+
width:78% !important;
|
884 |
+
left:34px !important
|
885 |
+
}
|
886 |
+
.slider-controls {
|
887 |
+
position: absolute;
|
888 |
+
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
889 |
+
width: 100% !important;
|
890 |
+
}
|
891 |
+
#logo-slider {
|
892 |
+
background:<?php echo $wp_logo_slider_settings['bgcolour']; ?>;
|
893 |
+
height: <?php echo $wp_logo_slider_settings['slider_height']?>px;
|
894 |
+
list-style: none outside none;
|
895 |
+
margin: 0;
|
896 |
+
overflow: hidden;
|
897 |
+
padding: 0;
|
898 |
+
position: relative;
|
899 |
+
width: 100% !important;
|
900 |
+
left:-12px;
|
901 |
+
}
|
902 |
+
.slide {
|
903 |
+
list-style: none outside none;
|
904 |
+
margin: 0 !important;
|
905 |
+
width: 100% !important;
|
906 |
+
}
|
907 |
}
|
908 |
@media only screen and (min-width:770px){
|
909 |
+
#logo-slider-wraper{
|
910 |
+
position:relative;
|
911 |
+
width:<?php echo $wp_logo_slider_settings['slider_width']; ?>px !important;
|
912 |
+
left:34px !important;
|
913 |
+
}
|
914 |
+
.slider-controls {
|
915 |
+
position: absolute;
|
916 |
+
top: <?php echo $wp_logo_slider_settings['slider_height'] / 2 - 19 ?>px;
|
917 |
+
width: 100% !important;
|
918 |
+
}
|
919 |
+
#logo-slider {
|
920 |
+
background:<?php echo $wp_logo_slider_settings['bgcolour']; ?>;
|
921 |
+
height: <?php echo $wp_logo_slider_settings['slider_height']?>px;
|
922 |
+
list-style: none outside none;
|
923 |
+
margin: 0;
|
924 |
+
overflow: hidden;
|
925 |
+
padding: 0;
|
926 |
+
position: relative;
|
927 |
+
width: 100% !important;
|
928 |
+
}
|
929 |
+
.slide {
|
930 |
+
list-style: none outside none;
|
931 |
+
margin: 0 !important;
|
932 |
+
width: <?php echo $wp_logo_slider_settings['slider_width']; ?>px !important;
|
933 |
+
}
|
934 |
}
|
935 |
+
</style>
|
936 |
+
<?php
|
937 |
+
}
|
938 |
|
939 |
+
add_action( 'admin_enqueue_scripts', 'wp_logo_slider_admin_styles' );
|
940 |
+
function wp_logo_slider_admin_styles(){ ?>
|
941 |
+
<style type="text/css" media="screen">
|
942 |
+
#arrow-style p {
|
943 |
+
float:left;
|
944 |
+
height:60px;
|
945 |
+
width:40px;
|
946 |
+
text-align:center;
|
947 |
+
margin-right:16px;
|
948 |
+
}
|
949 |
+
</style>
|
950 |
+
<?php
|
951 |
+
}
|
952 |
+
?>
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: EnigmaWeb
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CEJ9HFWJ94BG4
|
4 |
Tags: logo slide, logo slideshow, logo slide show, logo carousel, image carousel, logo slider, sponsors, logo showcase
|
5 |
Requires at least: 3.1
|
6 |
-
Tested up to: 4.
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
9 |
|
@@ -78,6 +78,12 @@ If you've tried all the obvious stuff and it's still not working please request
|
|
78 |
|
79 |
== Changelog ==
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
= 1.4.4 =
|
82 |
* Number of logos to be displayed in iPad - Fixed
|
83 |
|
@@ -116,6 +122,12 @@ If you've tried all the obvious stuff and it's still not working please request
|
|
116 |
|
117 |
== Upgrade Notice ==
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
= 1.4.4 =
|
120 |
* Number of logos to be displayed in iPad - Fixed
|
121 |
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CEJ9HFWJ94BG4
|
4 |
Tags: logo slide, logo slideshow, logo slide show, logo carousel, image carousel, logo slider, sponsors, logo showcase
|
5 |
Requires at least: 3.1
|
6 |
+
Tested up to: 4.2
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
9 |
|
78 |
|
79 |
== Changelog ==
|
80 |
|
81 |
+
= 1.4.5 =
|
82 |
+
* Off Buttons issue - Fixed.
|
83 |
+
* Function renamed for admin styles.
|
84 |
+
* Function for loading plugin text domain fixed.
|
85 |
+
* Some code indentation.
|
86 |
+
|
87 |
= 1.4.4 =
|
88 |
* Number of logos to be displayed in iPad - Fixed
|
89 |
|
122 |
|
123 |
== Upgrade Notice ==
|
124 |
|
125 |
+
= 1.4.5 =
|
126 |
+
* Off Buttons issue - Fixed.
|
127 |
+
* Function renamed for admin styles.
|
128 |
+
* Function for loading plugin text domain fixed.
|
129 |
+
* Some code indentation.
|
130 |
+
|
131 |
= 1.4.4 =
|
132 |
* Number of logos to be displayed in iPad - Fixed
|
133 |
|