This repository was archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathslider.php
More file actions
2488 lines (2216 loc) · 87.8 KB
/
Copy pathslider.php
File metadata and controls
2488 lines (2216 loc) · 87.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
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
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
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
735
736
737
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
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
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
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
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
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/*
Plugin Name: Huge IT Slider
Plugin URI: http://huge-it.com/slider
Description: Huge IT slider is a convenient tool for organizing the images represented on your website into sliders. Each product on the slider is assigned with a relevant slider, which makes it easier for the customers to search and identify the needed images within the slider.
Version: 2.9.9
Author: http://huge-it.com/
License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
add_action('media_buttons_context', 'add_my_custom_button');
function add_my_custom_button($context) {
$img = plugins_url( '/images/post.button.png' , __FILE__ );
$container_id = 'huge_it_slider';
$title = 'Select Huge IT Slider to insert into post';
$context .= '<a class="button thickbox" title="Select slider to insert into post" href="?page=sliders_huge_it_slider&task=add_shortcode_post&TB_iframe=1&width=400&inlineId='.$container_id.'">
<span class="wp-media-buttons-icon" style="background: url('.$img.'); background-repeat: no-repeat; background-position: left bottom;"></span>
Add Slider
</a>';
return $context;
}
function remove_media_tab($strings) {
//unset($strings["insertFromUrlTitle"]);
return $strings;
}
add_filter('media_view_strings','remove_media_tab');
add_action('init', 'hugesl_do_output_buffer');
function hugesl_do_output_buffer() {
ob_start();
}
$ident = 1;
add_action('admin_head', 'huge_it_ajax_func');
function huge_it_ajax_func()
{
?>
<script>
var huge_it_ajax = '<?php echo admin_url("admin-ajax.php"); ?>';
</script>
<?php
}
function huge_it_slider_images_list_shotrcode($atts)
{
extract(shortcode_atts(array(
'id' => 'no huge_it slider',
), $atts));
add_style_to_header($atts['id']);
add_action('wp_footer', 'add_style_to_header');
return huge_it_cat_images_list($atts['id']);
}
function slider_after_search_results($query)
{
global $wpdb;
if (isset($_REQUEST['s']) && $_REQUEST['s']) {
$serch_word = htmlspecialchars(($_REQUEST['s']));
$query = str_replace($wpdb->prefix . "posts.post_content", gen_string_slider_search($serch_word, $wpdb->prefix . 'posts.post_content') . " " . $wpdb->prefix . "posts.post_content", $query);
}
return $query;
}
add_filter('posts_request', 'slider_after_search_results');
function gen_string_slider_search($serch_word, $wordpress_query_post)
{
$string_search = '';
global $wpdb;
if ($serch_word) {
$rows_slider = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_itslider_sliders WHERE (description LIKE %s) OR (name LIKE %s)", '%' . $serch_word . '%', "%" . $serch_word . "%"));
$count_cat_rows = count($rows_slider);
for ($i = 0; $i < $count_cat_rows; $i++) {
$string_search .= $wordpress_query_post . ' LIKE \'%[huge_it_slider id="' . $rows_slider[$i]->id . '" details="1" %\' OR ' . $wordpress_query_post . ' LIKE \'%[huge_it_slider id="' . $rows_slider[$i]->id . '" details="1"%\' OR ';
}
$rows_slider = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_itslider_sliders WHERE (name LIKE %s)","'%" . $serch_word . "%'"));
$count_cat_rows = count($rows_slider);
for ($i = 0; $i < $count_cat_rows; $i++) {
$string_search .= $wordpress_query_post . ' LIKE \'%[huge_it_slider id="' . $rows_slider[$i]->id . '" details="0"%\' OR ' . $wordpress_query_post . ' LIKE \'%[huge_it_slider id="' . $rows_slider[$i]->id . '" details="0"%\' OR ';
}
$rows_single = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "huge_itslider_images WHERE name LIKE %s","'%" . $serch_word . "%'"));
$count_sing_rows = count($rows_single);
if ($count_sing_rows) {
for ($i = 0; $i < $count_sing_rows; $i++) {
$string_search .= $wordpress_query_post . ' LIKE \'%[huge_it_slider_Product id="' . $rows_single[$i]->id . '"]%\' OR ';
}
}
}
return $string_search;
}
add_shortcode('huge_it_slider', 'huge_it_slider_images_list_shotrcode');
function huge_it_cat_images_list($id)
{
require_once("slider_front_end.html.php");
require_once("slider_front_end.php");
if (isset($_GET['product_id'])) {
if (isset($_GET['view'])) {
if ($_GET['view'] == 'huge_itslider') {
return showPublishedimages_1($id);
} else {
return front_end_single_product($_GET['product_id']);
}
} else {
return front_end_single_product($_GET['product_id']);
}
} else {
return showPublishedimages_1($id);
}
}
add_action('admin_menu', 'huge_it_slider_options_panel');
function huge_it_slider_options_panel()
{
$page_cat = add_menu_page('Theme page title', 'Huge IT Slider', 'delete_pages', 'sliders_huge_it_slider', 'sliders_huge_it_slider', plugins_url('images/sidebar.icon.png', __FILE__));
add_submenu_page('sliders_huge_it_slider', 'Sliders', 'Sliders', 'delete_pages', 'sliders_huge_it_slider', 'sliders_huge_it_slider');
$page_option = add_submenu_page('sliders_huge_it_slider', 'General Options', 'General Options', 'manage_options', 'Options_slider_styles', 'Options_slider_styles');
add_submenu_page( 'sliders_huge_it_slider', 'Licensing', 'Licensing', 'manage_options', 'huge_it_slider_Licensing', 'huge_it_slider_Licensing');
add_submenu_page('sliders_huge_it_slider', 'Featured Plugins', 'Featured Plugins', 'manage_options', 'huge_it_slider_featured_plugins', 'huge_it_slider_featured_plugins');
add_action('admin_print_styles-' . $page_cat, 'huge_it_slider_admin_script');
add_action('admin_print_styles-' . $page_option, 'huge_it_slider_option_admin_script');
}
function huge_it_slider_Licensing(){
?>
<div style="width:95%">
<p>
This plugin is the non-commercial version of the Huge IT slider. If you want to customize to the styles and colors of your website,than you need to buy a license.
Purchasing a license will add possibility to customize the general options of the Huge IT slider.
</p>
<br /><br />
<a href="http://huge-it.com/slider/" class="button-primary" target="_blank">Purchase a License</a>
<br /><br /><br />
<p>After the purchasing the commercial version follow this steps:</p>
<ol>
<li>Deactivate Huge IT slider Plugin</li>
<li>Delete Huge IT slider Plugin</li>
<li>Install the downloaded commercial version of the plugin</li>
</ol>
</div>
<?php
}
function huge_it_slider_featured_plugins()
{
?>
<style>
.element {
position: relative;
width:93%;
margin:5px 0px 5px 0px;
padding:2%;
clear:both;
overflow: hidden;
border:1px solid #DEDEDE;
background:#F9F9F9;
}
.element > div {
display:table-cell;
}
.element div.left-block {
padding-right:10px;
}
.element div.left-block .main-image-block {
clear:both;
}
.element div.left-block .thumbs-block {
position:relative;
margin-top:10px;
}
.element div.left-block .thumbs-block ul {
width:240px;
height:auto;
display:table;
margin:0px;
padding:0px;
list-style:none;
}
.element div.left-block .thumbs-block ul li {
margin:0px 3px 0px 2px;
padding:0px;
width:75px;
height:75px;
float:left;
}
.element div.left-block .thumbs-block ul li a {
display:block;
width:75px;
height:75px;
}
.element div.left-block .thumbs-block ul li a img {
width:75px;
height:75px;
}
.element div.right-block {
vertical-align:top;
}
.element div.right-block > div {
width:100%;
padding-bottom:10px;
margin-top:10px;
}
.element div.right-block > div:last-child {
background:none;
}
.element div.right-block .title-block {
margin-top:3px;
}
.element div.right-block .title-block h3 {
margin:0px;
padding:0px;
font-weight:normal;
font-size:18px !important;
line-height:18px !important;
color:#0074A2;
}
.element div.right-block .description-block p,.element div.right-block .description-block * {
margin:0px;
padding:0px;
font-weight:normal;
font-size:14px;
color:#555555;
}
.element div.right-block .description-block h1,
.element div.right-block .description-block h2,
.element div.right-block .description-block h3,
.element div.right-block .description-block h4,
.element div.right-block .description-block h5,
.element div.right-block .description-block h6,
.element div.right-block .description-block p,
.element div.right-block .description-block strong,
.element div.right-block .description-block span {
padding:2px !important;
margin:0px !important;
}
.element div.right-block .description-block ul,
.element div.right-block .description-block li {
padding:2px 0px 2px 5px;
margin:0px 0px 0px 8px;
}
.element .button-block {
position:relative;
}
.element div.right-block .button-block a,.element div.right-block .button-block a:link,.element div.right-block .button-block a:visited {
position:relative;
display:inline-block;
padding:6px 12px;
background:#2EA2CD;
color:#FFFFFF;
font-size:14;
text-decoration:none;
}
.element div.right-block .button-block a:hover,.pupup-elemen.element div.right-block .button-block a:focus,.element div.right-block .button-block a:active {
background:#0074A2;
color:#FFFFFF;
}
.button-block a {
float: right;
}
.description-block p {
text-align: justify !important;
}
@media only screen and (max-width: 767px) {
.element > div {
display:block;
width:100%;
clear:both;
}
.element div.left-block {
padding-right:0px;
}
.element div.left-block .main-image-block {
clear:both;
width:100%;
}
.element div.left-block .main-image-block img {
width:100% !important;
height:auto;
}
.element div.left-block .thumbs-block ul {
width:100%;
}
}
</style>
<div class="element hugeitmicro-item">
<div class="left-block">
<div class="main-image-block">
<a href="<?php echo plugins_url( 'images/image-gallery-icon.png' , __FILE__ ); ?>" rel="content"><img src="<?php echo plugins_url( 'images/image-gallery-icon.png' , __FILE__ ); ?>"></a>
</div>
</div>
<div class="right-block">
<div class="title-block"><h3>Wordpress Image Gallery</h3></div>
<div class="description-block">
<p>Huge-IT Gallery images is perfect for using for creating various galleries within various views, to creating various sliders with plenty of styles, beautiful lightboxes with it’s options for any taste. The product allows adding descriptions and titles for each image of the Gallery. It is rather useful wherever using with various pages and posts, as well as within custom location.</p>
</div>
<div class="button-block">
<a href="http://huge-it.com/wordpress-gallery/" target="_blank">View Plugin</a>
</div>
</div>
</div>
<div class="element hugeitmicro-item">
<div class="left-block">
<div class="main-image-block">
<a href="<?php echo plugins_url( 'images/potfolio-gallery-logo.png' , __FILE__ ); ?>" rel="content"><img src="<?php echo plugins_url( 'images/potfolio-gallery-logo.png' , __FILE__ ); ?>"></a>
</div>
</div>
<div class="right-block">
<div class="title-block"><h3>Wordpress Portfolio/Gallery</h3></div>
<div class="description-block">
<p>Portfolio Gallery is perfect for using for creating various portfolios or gallery within various views. The product allows adding descriptions and titles for each portfolio gallery. It is rather useful whever using with various pages and posts, as well as within custom location.</p>
</div>
<div class="button-block">
<a href="http://huge-it.com/portfolio-gallery/" target="_blank">View Plugin</a>
</div>
</div>
</div>
<div class="element hugeitmicro-item">
<div class="left-block">
<div class="main-image-block">
<a href="<?php echo plugins_url( 'images/lightbox-logo.jpg' , __FILE__ ); ?>" rel="content"><img src="<?php echo plugins_url( 'images/lightbox-logo.jpg' , __FILE__ ); ?>"></a>
</div>
</div>
<div class="right-block">
<div class="title-block"><h3>Wordpress Lightbox</h3></div>
<div class="description-block">
<p>Lightbox is a perfect tool for viewing photos. It is created especially for simplification of using, permits you to view larger version of images and giving an interesting design. With the help of slideshow and various styles, betray a unique image to your website.</p>
</div>
<div class="button-block">
<a href="http://huge-it.com/lightbox/" target="_blank">View Plugin</a>
</div>
</div>
</div>
<div class="element hugeitmicro-item">
<div class="left-block">
<div class="main-image-block">
<a href="<?php echo plugins_url( 'images/video-gallery-logo.png' , __FILE__ ); ?>" rel="content"><img src="<?php echo plugins_url( 'images/video-gallery-logo.png' , __FILE__ ); ?>"></a>
</div>
</div>
<div class="right-block">
<div class="title-block"><h3>Wordpress Video Gallery</h3></div>
<div class="description-block">
<p>Video Gallery plugin was created and specifically designed to show your video files in unusual splendid ways. It has 5 good-looking views. Each are made in different taste so that you can choose any of them, according to the style of your website.</p>
</div>
<div class="button-block">
<a href="http://huge-it.com/wordpress-video-gallery/" target="_blank">View Plugin</a>
</div>
</div>
</div>
<div class="element hugeitmicro-item">
<div class="left-block">
<div class="main-image-block">
<a href="<?php echo plugins_url( 'images/share-buttons-logo.png' , __FILE__ ); ?>" rel="content"><img src="<?php echo plugins_url( 'images/share-buttons-logo.png' , __FILE__ ); ?>"></a>
</div>
</div>
<div class="right-block">
<div class="title-block"><h3>Wordpress Share Buttons</h3></div>
<p>Social network is one of the popular places where people get information about everything in the world. Adding social share buttons into your blog or website page is very necessary and useful element for "socialization" of the project.</p>
<div class="description-block">
</div>
<div class="button-block">
<a href="http://huge-it.com/share-buttons/" target="_blank">View Plugin</a>
</div>
</div>
</div>
<div class="element hugeitmicro-item">
<div class="left-block">
<div class="main-image-block">
<a href="<?php echo plugins_url( 'images/google-maps-logo.png' , __FILE__ ); ?>" rel="content"><img src="<?php echo plugins_url( 'images/google-maps-logo.png' , __FILE__ ); ?>"></a>
</div>
</div>
<div class="right-block">
<div class="title-block"><h3>Wordpress Google Map</h3></div>
<p>Huge-IT Google Map. One more perfect tool from Huge-IT. Improved Google Map, where we have our special contribution. Most simple and effective tool for rapid creation of individual Google Map in posts and pages.</p>
<div class="description-block">
</div>
<div class="button-block">
<a href="http://huge-it.com/google-map/" target="_blank">View Plugin</a>
</div>
</div>
</div>
<div class="element hugeitmicro-item">
<div class="left-block">
<div class="main-image-block">
<a href="<?php echo plugins_url( 'images/colorbox-logo.png' , __FILE__ ); ?>" rel="content"><img src="<?php echo plugins_url( 'images/colorbox-logo.png' , __FILE__ ); ?>"></a>
</div>
</div>
<div class="right-block">
<div class="title-block"><h3>Wordpress Colorbox</h3></div>
<p>Huge-It Colorbox is the most spellbinding plugin in WordPress that implement Lightbox-effect look of the images and videos (when you click on the thumbnail of the image/video it nicely opens and increases in the same window with a beautiful effect).</p>
<div class="description-block">
</div>
<div class="button-block">
<a href="http://huge-it.com/colorbox/" target="_blank">View Plugin</a>
</div>
</div>
</div>
<?php
}
function huge_it_slider_admin_script()
{
wp_enqueue_media();
wp_enqueue_style("jquery_ui", "http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css", FALSE);
if ( !defined( 'ICL_SITEPRESS_VERSION' ) || ICL_PLUGIN_INACTIVE ) {
wp_enqueue_script("jquery_new", "http://code.jquery.com/jquery-1.10.2.js", FALSE);
wp_enqueue_script("jquery_ui_new", "http://code.jquery.com/ui/1.10.4/jquery-ui.js", FALSE);
}
wp_enqueue_script("simple_slider_js", plugins_url("js/simple-slider.js", __FILE__), FALSE);
wp_enqueue_style("simple_slider_css", plugins_url("style/simple-slider.css", __FILE__), FALSE);
wp_enqueue_style("admin_css", plugins_url("style/admin.style.css", __FILE__), FALSE);
wp_enqueue_script("admin_js", plugins_url("js/admin.js", __FILE__), FALSE);
wp_enqueue_script('param_block2', plugins_url("elements/jscolor/jscolor.js", __FILE__));
}
function huge_it_enque_bx_slider (){
wp_register_script( 'bxSlider',plugins_url("js/jquery.bxslider.js", __FILE__) ,array ('jquery'), '1.0.0', true);
wp_enqueue_script('bxSlider');
wp_register_script( 'bxSliderSetup',plugins_url("js/bxslider.setup.js", __FILE__) ,array ('jquery'), '1.0.0', true);
wp_enqueue_script('bxSliderSetup');
wp_register_style( 'bxSlidercss',plugins_url("style/jquery.bxslider.css", __FILE__));
wp_enqueue_style('bxSlidercss');
}
add_action('wp_footer','huge_it_enque_bx_slider' );
function huge_it_slider_option_admin_script()
{
wp_enqueue_script("jquery_old", "http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js", FALSE);
if (!wp_script_is( 'jQuery.ui' ))
{
// wp_enqueue_script("jquery_new", "http://code.jquery.com/jquery-1.10.2.js", FALSE);
wp_enqueue_script("jquery_ui_new", "http://code.jquery.com/ui/1.10.4/jquery-ui.js", FALSE);
}
wp_enqueue_script("simple_slider_js", plugins_url("js/simple-slider.js", __FILE__), FALSE);
wp_enqueue_style("simple_slider_css", plugins_url("style/simple-slider.css", __FILE__), FALSE);
wp_enqueue_style("admin_css", plugins_url("style/admin.style.css", __FILE__), FALSE);
wp_enqueue_script("admin_js", plugins_url("js/admin.js", __FILE__), FALSE);
wp_enqueue_script('param_block2', plugins_url("elements/jscolor/jscolor.js", __FILE__));
}
function sliders_huge_it_slider()
{
require_once("sliders.php");
require_once("sliders.html.php");
if (!function_exists('print_html_nav'))
require_once("slider_function/html_slider_func.php");
if (isset($_GET["task"]))
$task = $_GET["task"];
else
$task = '';
if (isset($_GET["id"]))
$id = $_GET["id"];
else
$id = 0;
global $wpdb;
switch ($task) {
case 'add_cat':
add_slider();
break;
case 'add_shortcode_post':
add_shortcode_post();
break;
case 'popup_posts':
if ($id)
popup_posts($id);
break;
case 'popup_video':
if ($id)
popup_video($id);
else {
$id = $wpdb->get_var("SELECT MAX( id ) FROM " . $wpdb->prefix . "huge_itslider_sliders");
popup_video($id);
}
break;
case 'edit_cat':
if ($id)
editslider($id);
else {
$id = $wpdb->get_var("SELECT MAX( id ) FROM " . $wpdb->prefix . "huge_itslider_sliders");
editslider($id);
}
break;
case 'save':
if ($id)
apply_cat($id);
case 'apply':
if ($id) {
apply_cat($id);
editslider($id);
}
break;
case 'remove_cat':
removeslider($id);
showslider();
break;
default:
showslider();
break;
}
}
function add_shortcode_post()
{
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#hugeitsliderinsert').on('click', function() {
jQuery('#save-buttom').click();
var id = jQuery('#huge_it_slider-select option:selected').val();
if(window.parent.tinyMCE || window.parent.tinyMCE.activeEditor)
{
window.parent.send_to_editor('[huge_it_slider id="'+id+'"]');
}
tb_remove();
})
});
</script>
<style>
#wpadminbar,.auto-fold #adminmenu, .auto-fold #adminmenu li.menu-top, .auto-fold #adminmenuback, .auto-fold #adminmenuwrap {
display: none;
}
#wpcontent {
margin-top: -55px;
}
.wp-core-ui .button {margin:0px 0px 0px 10px !important;}
#slider-unique-options-list li {
clear:both;
margin:10px 0px 5px 0px;
}
#slider-unique-options-list li label {width:130px;}
#save-buttom {display:none;}
h3 {
margin:30px 0px 15px 0px;
}
</style>
<div class="clear"></div>
<h3>Select the Slider</h3>
<div id="huge_it_slider">
<?php
global $wpdb;
$query="SELECT * FROM ".$wpdb->prefix."huge_itslider_sliders";
$firstrow=$wpdb->get_row($query);
if(isset($_POST["hugeit_slider_id"])){
$id=$_POST["hugeit_slider_id"];
}
else{
$id=$firstrow->id;
}
if(isset($_GET["htslider_id"]) && $_GET["htslider_id"] == $_POST["hugeit_slider_id"]){
if($_GET["hugeit_save"]==1){
$wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_itslider_sliders SET sl_width = '%s' WHERE id = %d ", $_POST["sl_width"], $id));
$wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_itslider_sliders SET sl_height = '%s' WHERE id = %d ", $_POST["sl_height"], $id));
$wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_itslider_sliders SET pause_on_hover = '%s' WHERE id = %d ", $_POST["pause_on_hover"], $id));
$wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_itslider_sliders SET slider_list_effects_s = '%s' WHERE id = %d ", $_POST["slider_effects_list"], $id));
$wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_itslider_sliders SET description = '%s' WHERE id = %d ", $_POST["sl_pausetime"], $id));
$wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_itslider_sliders SET param = '%s' WHERE id = %d ", $_POST["sl_changespeed"], $id));
$wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_itslider_sliders SET sl_position = '%s' WHERE id = %d ", $_POST["sl_position"], $id));
$wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_itslider_sliders SET sl_loading_icon = '%s' WHERE id = %d ", $_POST["sl_loading_icon"], $id));
$wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."huge_itslider_sliders SET show_thumb = '%s' WHERE id = %d ", $_POST["show_thumb"], $id));/*add*/
}
}
$query="SELECT * FROM ".$wpdb->prefix."huge_itslider_sliders order by id ASC";
$shortcodesliders=$wpdb->get_results($query);
$query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_itslider_sliders WHERE id= %d", $id);
$row=$wpdb->get_row($query);
$container_id = 'huge_it_slider'; ?>
<form action="?page=sliders_huge_it_slider&task=add_shortcode_post&TB_iframe=1&width=400&inlineId=<?php echo $container_id; ?>&hugeit_save=1&htslider_id=<?php echo $id; ?>" method="post" name="adminForm" id="adminForm">
<?php if (count($shortcodesliders)) {
echo "<select id='huge_it_slider-select' onchange='this.form.submit()' name='hugeit_slider_id'>";
foreach ($shortcodesliders as $shortcodeslider) {
$selected='';
if($shortcodeslider->id == $_POST["hugeit_slider_id"]){$selected='selected="selected"';}
echo "<option ".$selected." value='".$shortcodeslider->id."'>".$shortcodeslider->name."</option>";
}
echo "</select>";
echo "<button class='button primary' id='hugeitsliderinsert'>Insert Slider</button>";
} else {
echo "No slideshows found", "huge_it_slider";
}
$container_id = 'huge_it_slider';
?>
</div>
<div id="" class="meta-box-sortables ui-sortable">
<div id="slider-unique-options" class="">
<h3 class="hndle"><span>Current Slider Options</span></h3>
<ul id="slider-unique-options-list">
<li>
<label for="sl_width">Width</label>
<input type="text" name="sl_width" id="sl_width" value="<?php echo $row->sl_width; ?>" class="text_area" />
</li>
<li>
<label for="sl_height">Height</label>
<input type="text" name="sl_height" id="sl_height" value="<?php echo $row->sl_height; ?>" class="text_area" />
</li>
<li>
<label for="pause_on_hover">Pause on Hover</label>
<input type="hidden" value="off" name="pause_on_hover" />
<input type="checkbox" name="pause_on_hover" value="on" id="pause_on_hover" <?php if($row->pause_on_hover == 'on'){ echo 'checked="checked"'; } ?> />
</li>
<li>
<label for="slider_effects_list">Effects</label>
<select name="slider_effects_list" id="slider_effects_list">
<option <?php if($row->slider_list_effects_s == 'none'){ echo 'selected'; } ?> value="none">None</option>
<option <?php if($row->slider_list_effects_s == 'cubeH'){ echo 'selected'; } ?> value="cubeH">Cube Horizontal</option>
<option <?php if($row->slider_list_effects_s == 'cubeV'){ echo 'selected'; } ?> value="cubeV">Cube Vertical</option>
<option <?php if($row->slider_list_effects_s == 'fade'){ echo 'selected'; } ?> value="fade">Fade</option>
<option <?php if($row->slider_list_effects_s == 'sliceH'){ echo 'selected'; } ?> value="sliceH">Slice Horizontal</option>
<option <?php if($row->slider_list_effects_s == 'sliceV'){ echo 'selected'; } ?> value="sliceV">Slice Vertical</option>
<option <?php if($row->slider_list_effects_s == 'slideH'){ echo 'selected'; } ?> value="slideH">Slide Horizontal</option>
<option <?php if($row->slider_list_effects_s == 'slideV'){ echo 'selected'; } ?> value="slideV">Slide Vertical</option>
<option <?php if($row->slider_list_effects_s == 'scaleOut'){ echo 'selected'; } ?> value="scaleOut">Scale Out</option>
<option <?php if($row->slider_list_effects_s == 'scaleIn'){ echo 'selected'; } ?> value="scaleIn">Scale In</option>
<option <?php if($row->slider_list_effects_s == 'blockScale'){ echo 'selected'; } ?> value="blockScale">Block Scale</option>
<option <?php if($row->slider_list_effects_s == 'kaleidoscope'){ echo 'selected'; } ?> value="kaleidoscope">Kaleidoscope</option>
<option <?php if($row->slider_list_effects_s == 'fan'){ echo 'selected'; } ?> value="fan">Fan</option>
<option <?php if($row->slider_list_effects_s == 'blindH'){ echo 'selected'; } ?> value="blindH">Blind Horizontal</option>
<option <?php if($row->slider_list_effects_s == 'blindV'){ echo 'selected'; } ?> value="blindV">Blind Vertical</option>
<option <?php if($row->slider_list_effects_s == 'random'){ echo 'selected'; } ?> value="random">Random</option>
</select>
</li>
<li>
<label for="sl_pausetime">Pause Time</label>
<input type="text" name="sl_pausetime" id="sl_pausetime" value="<?php echo $row->description; ?>" class="text_area" />
</li>
<li>
<label for="sl_changespeed">Change Speed</label>
<input type="text" name="sl_changespeed" id="sl_changespeed" value="<?php echo $row->param; ?>" class="text_area" />
</li>
<li>
<label for="slider_position">Slider Position</label>
<select name="sl_position" id="slider_position">
<option <?php if($row->sl_position == 'left'){ echo 'selected'; } ?> value="left">Left</option>
<option <?php if($row->sl_position == 'right'){ echo 'selected'; } ?> value="right">Right</option>
<option <?php if($row->sl_position == 'center'){ echo 'selected'; } ?> value="center">Center</option>
</select>
</li>
<li>
<label for="sl_loading_icon">Loading Icon</label>
<select id="sl_loading_icon" name="sl_loading_icon">
<option <?php if($row->sl_loading_icon == 'on'){ echo 'selected'; } ?> value="on">On</option>
<option <?php if($row->sl_loading_icon == 'off'){ echo 'selected'; } ?> value="off">Off</option>
</select>
</li>
<li>
<label for="show_thumb">Navigate By</label>
<input type="hidden" value="off" name="show_thumb" />
<select id="show_thumb" name="show_thumb">
<option <?php if($row->show_thumb == 'dotstop'){ echo 'selected'; } ?> value="dotstop">Dots</option>
<option <?php if($row->show_thumb == 'thumbnails'){ echo 'selected'; } ?> value="thumbnails">Thumbnails</option>
<option <?php if($row->show_thumb == 'nonav'){ echo 'selected'; } ?> value="nonav">No Navigation</option>
</select>
</li>
</ul>
<input type="submit" value="Save Slider" id="save-buttom" class="button button-primary button-large">
</div>
</div>
</form>
<?php
}
function Options_slider_styles()
{
require_once("slider_Options.php");
require_once("slider_Options.html.php");
if (isset($_GET['task']))
if ($_GET['task'] == 'save')
save_styles_options();
showStyles();
}
/**
* Huge IT Widget
*/
class Huge_it_Widget extends WP_Widget {
public function __construct() {
parent::__construct(
'Huge_it_Widget',
'Huge IT Slider',
array( 'description' => __( 'Huge IT Slider', 'huge_it_slider' ), )
);
}
public function widget( $args, $instance ) {
extract($args);
if (isset($instance['slider_id'])) {
$slider_id = $instance['slider_id'];
$title = apply_filters( 'widget_title', $instance['title'] );
echo $before_widget;
if ( ! empty( $title ) )
echo $before_title . $title . $after_title;
echo do_shortcode("[huge_it_slider id={$slider_id}]");
echo $after_widget;
}
}
public function update( $new_instance, $old_instance ) {
$instance = array();
$instance['slider_id'] = strip_tags( $new_instance['slider_id'] );
$instance['title'] = strip_tags( $new_instance['title'] );
return $instance;
}
public function form( $instance ) {
$selected_slider = 0;
$title = "";
$sliders = false;
if (isset($instance['slider_id'])) {
$selected_slider = $instance['slider_id'];
}
if (isset($instance['title'])) {
$title = $instance['title'];
}
?>
<p>
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
</p>
<label for="<?php echo $this->get_field_id('slider_id'); ?>"><?php _e('Select Slider:', 'huge_it_slider'); ?></label>
<select id="<?php echo $this->get_field_id('slider_id'); ?>" name="<?php echo $this->get_field_name('slider_id'); ?>">
<?php
global $wpdb;
$query="SELECT * FROM ".$wpdb->prefix."huge_itslider_sliders ";
$rowwidget=$wpdb->get_results($query);
foreach($rowwidget as $rowwidgetecho){
selected
?>
<option <?php if($rowwidgetecho->id == $instance['slider_id']){ echo 'selected'; } ?> value="<?php echo $rowwidgetecho->id; ?>"><?php echo $rowwidgetecho->name; ?></option>
<?php } ?>
</select>
</p>
<?php
}
}
add_action('widgets_init', 'register_Huge_it_Widget');
function register_Huge_it_Widget() {
register_widget('Huge_it_Widget');
}
/***<add>***/
function add_style_to_header($id) {
global $wpdb;
$query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_itslider_images where slider_id = '%d' order by ordering ASC",$id);
$images=$wpdb->get_results($query);
$query=$wpdb->prepare("SELECT * FROM ".$wpdb->prefix."huge_itslider_sliders where id = '%d' order by id ASC",$id);
$slider=$wpdb->get_results($query);
$query="SELECT * FROM ".$wpdb->prefix."huge_itslider_params";
$rowspar = $wpdb->get_results($query);
$paramssld = array();
foreach ($rowspar as $rowpar) {
$key = $rowpar->name;
$value = $rowpar->value;
$paramssld[$key] = $value;
}
if(isset($slider[0]->id)){
$sliderID=$slider[0]->id;
}else{
$sliderID='';
}
if(isset($slider[0]->name)){
$slidertitle=$slider[0]->name;
}else{
$slidertitle='';
}
if(isset($slider[0]->sl_height)){
$sliderheight=$slider[0]->sl_height;
}else{
$sliderheight='';
}
if(isset($slider[0]->sl_width)){
$sliderwidth=$slider[0]->sl_width;
}else{
$sliderwidth='';
}
if(isset($slider[0]->slider_list_effects_s)){
$slidereffect=$slider[0]->slider_list_effects_s;
}else{
$slidereffect='';
}
if(isset($slidepausetime)){
$slidepausetime=($slider[0]->description+$slider[0]->param);
}else{
$slidepausetime='';
}
if(isset($slider[0]->pause_on_hover)){
$sliderpauseonhover=$slider[0]->pause_on_hover;
}else{
$sliderpauseonhover='';
}
if(isset($slider[0]->sl_position)){
$sliderposition=$slider[0]->sl_position;
}else{
$sliderposition='';
}
if(isset($slider[0]->param)){
$slidechangespeed=$slider[0]->param;
}else{
$slidechangespeed='';
}
if(isset($slider[0]->sl_loading_icon)){
$sliderloadingicon=$slider[0]->sl_loading_icon;
}else{
$sliderloadingicon='';
}
if(isset($slider[0]->show_thumb)){
$sliderthumbslider=$slider[0]->show_thumb;
}else{
$sliderthumbslider='';
}
$slideshow_title_position = explode('-', trim($paramssld['slider_title_position']));
$slideshow_description_position = explode('-', trim($paramssld['slider_description_position']));
?>
<style>
/***<add>***/
?>
#huge_it_loading_image_<?php echo $sliderID; ?> {
height:<?php echo $sliderheight; ?>px;
width:<?php echo $sliderwidth; ?>px;
display: table-cell;
text-align: center;
vertical-align: middle;
font-size: <?php echo $descValue?>px;
font-weight: <?php echo $titleValue?>px;
}
#huge_it_loading_image_<?php echo $sliderID; ?>.display {
display: table-cell;
}
#huge_it_loading_image_<?php echo $sliderID; ?>.nodisplay {
display: none;
}
#huge_it_loading_image_<?php echo $sliderID; ?> img {
margin: auto 0;
width: 20% !important;
}
.huge_it_slideshow_image_wrap_<?php echo $sliderID; ?> {
height:<?php echo $sliderheight ; ?>px;
width:<?php echo $sliderwidth ; ?>px;
position:relative;
display: block;
text-align: center;
/*HEIGHT FROM HEADER.PHP*/
clear:both;
<?php if($sliderposition=="left"){ $position='float:left;';}elseif($sliderposition=="right"){$position='float:right;';}else{$position='float:none; margin:0px auto;';} ?>
<?php echo $position; ?>
border-style:solid;
border-left:0px !important;
border-right:0px !important;
}
.huge_it_slideshow_image_wrap1_<?php echo $sliderID; ?>.display {
width: 100%;
height:100%;
}
.huge_it_slideshow_image_wrap1_<?php echo $sliderID; ?>.display {
display:block;
}
.huge_it_slideshow_image_wrap1_<?php echo $sliderID; ?>.nodisplay {
display:none;
}
.huge_it_slideshow_image_wrap_<?php echo $sliderID; ?> * {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.huge_it_slideshow_image_<?php echo $sliderID; ?> {
/*width:100%;*/
}
#huge_it_slideshow_left_<?php echo $sliderID; ?>,
#huge_it_slideshow_right_<?php echo $sliderID; ?> {
cursor: pointer;
display:none;
display: block;
height: 100%;
outline: medium none;
position: absolute;
/*z-index: 10130;*/
z-index: 13;
bottom:25px;
top:50%;
}
#huge_it_slideshow_left-ico_<?php echo $sliderID; ?>,
#huge_it_slideshow_right-ico_<?php echo $sliderID; ?> {
z-index: 13;
-moz-box-sizing: content-box;
box-sizing: content-box;
cursor: pointer;
display: table;
left: -9999px;
line-height: 0;
margin-top: -15px;
position: absolute;
top: 50%;
/*z-index: 10135;*/
}
#huge_it_slideshow_left-ico_<?php echo $sliderID; ?>:hover,
#huge_it_slideshow_right-ico_<?php echo $sliderID; ?>:hover {
cursor: pointer;
}
.huge_it_slideshow_image_container_<?php echo $sliderID; ?> {
display: table;
position: relative;
top:0px;
left:0px;
text-align: center;
vertical-align: middle;
width:100%;
}
.huge_it_slideshow_title_text_<?php echo $sliderID; ?> {
text-decoration: none;
position: absolute;
z-index: 11;
display: inline-block;
<?php if($paramssld['slider_title_has_margin']=='on'){
$slider_title_width=($paramssld['slider_title_width']-6);
$slider_title_height=($paramssld['slider_title_height']-6);
$slider_title_margin="3";