CMP – Coming Soon & Maintenance Plugin by NiteoThemes - Version 3.6.5

Version Description

Download this release

Release Info

Developer niteo
Plugin Icon 128x128 CMP – Coming Soon & Maintenance Plugin by NiteoThemes
Version 3.6.5
Comparing to
See all releases

Code changes from version 3.6.4 to 3.6.5

img/banner_bundle.jpg CHANGED
Binary file
inc/class-cmp-render_html.php CHANGED
@@ -6,218 +6,14 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
6
  */
7
  class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Maintenance {
8
 
 
 
 
 
9
  // Render Background
10
  public function cmp_background( $niteoCS_banner, $themeslug ) {
11
 
12
- $size = $this->isMobile() ? 'large' : 'full';
13
- $html = '';
14
-
15
- // change background if preview is set
16
- if ( isset( $_GET['background'] ) && !empty($_GET['background']) ) {
17
- $niteoCS_banner = $_GET['background'] == '1' ? 0 : esc_attr($_GET['background']);
18
- }
19
-
20
- switch ( $niteoCS_banner ) {
21
- // custom media
22
- case '0':
23
- $banner_ids = $this->cmp_get_banner_ids();
24
-
25
- if ( !empty($banner_ids) ) {
26
- $banner_url = wp_get_attachment_image_src( $banner_ids[mt_rand(0, count( $banner_ids ) - 1)], $size);
27
-
28
- if ( isset($banner_url[0]) ) {
29
- $banner_url = $banner_url[0];
30
- }
31
-
32
- } else {
33
- // send default image
34
- $banner_url = $this->cmp_themeURL( $themeslug ).$themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
35
- }
36
-
37
- $html = '<div id="background-image" class="image" style="background-image:url(\''.esc_url( $banner_url ).'\')"></div>';
38
- break;
39
-
40
- case '1':
41
- // unsplash
42
- $background_class = 'image';
43
- $unplash_feed = get_option('niteoCS_unsplash_feed', '3');
44
-
45
- switch ( $unplash_feed ) {
46
- // specific photo from id
47
- case '0':
48
- $params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0', '') );
49
- $unsplash = $this->niteo_unsplash( $params );
50
- break;
51
-
52
- // random from user
53
- case '1':
54
- $params = array('feed' => '1', 'custom_str' => get_option('niteoCS_unsplash_1', '') );
55
- $unsplash = $this->niteo_unsplash( $params );
56
- break;
57
-
58
- // random from collection
59
- case '2':
60
- $params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2', '') );
61
- $unsplash = $this->niteo_unsplash( $params );
62
- break;
63
-
64
- // random photo
65
- case '3':
66
- $params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3', ''), 'feat' => get_option('niteoCS_unsplash_feat', '0') );
67
- $unsplash = $this->niteo_unsplash( $params );
68
- break;
69
- default:
70
- break;
71
- }
72
- // get raw url from response
73
- if ( isset( $unsplash['response'] ) && $unsplash['response'] == '200' ) {
74
- $body = json_decode ($unsplash['body'], true );
75
-
76
- if ( isset( $body[0] ) ) {
77
- foreach ( $body as $item ) {
78
- $unsplash_download = $item['links']['download_location'];
79
- }
80
-
81
- } else {
82
- $unsplash_download = $body['links']['download_location'];
83
- }
84
-
85
- switch ( $themeslug ) {
86
- case 'element':
87
- $width = 1;
88
- $height = 0.6;
89
- break;
90
-
91
- default:
92
- $width = 1;
93
- $height = 1;
94
- break;
95
- }
96
-
97
- ob_start(); ?>
98
-
99
- <script>
100
- var unsplash_download = '<?php echo esc_url( $unsplash_download );?>';
101
-
102
- var width = document.getElementById('background-wrapper').offsetWidth * <?php echo esc_attr( $width );?>;
103
- var height = document.getElementById('background-wrapper').offsetHeight * <?php echo esc_attr( $height );?>;
104
- var dimension = 'w=' + width;
105
- if ( width < height ) {
106
- dimension = 'h=' + height;
107
- }
108
-
109
- var unsplash_url = '<?php echo esc_url( $unsplash_download );?>?client_id=41f043163758cf2e898e8a868bc142c20bc3f5966e7abac4779ee684088092ab';
110
-
111
- fetch(unsplash_url, {
112
- method: 'GET',
113
- })
114
- .then((res) => {
115
- return res.json();
116
- })
117
- .then((data) => {
118
-
119
- var imgContainer = '<div id="background-image" class="image" style="background-image:url()"></div>';
120
-
121
- var image = document.createElement('div');
122
-
123
- image.id = 'background-image';
124
-
125
-
126
- var container = document.getElementById("background-wrapper");
127
-
128
- if ( container == null ) {
129
- container = document.getElementById("banner-wrapper");
130
- }
131
-
132
- container.insertAdjacentElement('afterbegin', image);
133
-
134
- var unsplashImg = new Image();
135
-
136
- unsplashImg.onload = function() {
137
- image.className = 'image loaded';
138
- image.style.backgroundImage = `url("${unsplashImg.src}")`;
139
- }
140
-
141
- unsplashImg.src = `${data.url}&fit=crop&${dimension}`;
142
-
143
- })
144
- .catch(function(error) { console.log(error.message); });
145
- </script>
146
- <?php
147
-
148
- $html = ob_get_clean();
149
- }
150
-
151
- break;
152
-
153
- case '2':
154
- // default image
155
- $banner_url = $this->cmp_themeURL( $themeslug ).$themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
156
- $html = '<div id="background-image" class="image" style="background-image:url(\''.esc_url( $banner_url ).'\')"></div>';
157
- break;
158
-
159
- case '3':
160
- // Pattern
161
- $niteoCS_banner_pattern = get_option('niteoCS_banner_pattern', 'sakura');
162
-
163
- if ( $niteoCS_banner_pattern != 'custom' ) {
164
- $banner_url = plugin_dir_url( dirname( __FILE__ ) ).'img/patterns/'.esc_attr( $niteoCS_banner_pattern ).'.png';
165
-
166
- } else {
167
- $banner_url = get_option('niteoCS_banner_pattern_custom');
168
- $banner_url = wp_get_attachment_image_src( $banner_url, 'large' );
169
- if ( isset($banner_url[0]) ){
170
- $banner_url = $banner_url[0];
171
- }
172
- }
173
- $html = '<div id="background-image" class="pattern" style="background-image:url(\''.esc_url( $banner_url ).'\')"></div>';
174
- break;
175
-
176
- case '4':
177
- // Color
178
- $color = get_option('niteoCS_banner_color', '#e5e5e5');
179
-
180
- $html ='<div id="background-image" class="color loaded" style="background-color:'.esc_url( $color ).'"></div>';
181
- break;
182
-
183
- case '5':
184
- $html = '<div id="player" class="video-banner"></div>';
185
- break;
186
-
187
- case '6':
188
- // Gradient
189
- $background_class = 'gradient';
190
- $niteoCS_gradient = get_option('niteoCS_gradient', '#1A2980:#26D0CE');
191
- if ( $niteoCS_gradient == 'custom' ) {
192
- $niteoCS_gradient_one = get_option('niteoCS_banner_gradient_one', '#e5e5e5');
193
- $niteoCS_gradient_two = get_option('niteoCS_banner_gradient_two', '#e5e5e5');
194
- } else {
195
- $gradient = explode(":", $niteoCS_gradient);
196
- $niteoCS_gradient_one = $gradient[0];
197
- $niteoCS_gradient_two = $gradient[1];
198
- }
199
-
200
-
201
- $html = '<div id="background-image" class="gradient loaded" style="background:-moz-linear-gradient(-45deg, '.esc_attr( $niteoCS_gradient_one ).' 0%, '.esc_attr( $niteoCS_gradient_two ).' 100%);background:-webkit-linear-gradient(-45deg, '.esc_attr( $niteoCS_gradient_one ).' 0%, '.esc_attr( $niteoCS_gradient_two ).' 100%);background:linear-gradient(135deg,'.esc_attr( $niteoCS_gradient_one ).' 0%, '.esc_attr( $niteoCS_gradient_two ).' 100%)"></div>';
202
- break;
203
-
204
- // CHAMELEON BACKGROUND
205
- case '7':
206
- $html ='<div id="background-image" class="color chameleon loaded"></div>';
207
- break;
208
-
209
- default:
210
- break;
211
- }
212
-
213
- // add overlay to images/videos
214
- if ( $niteoCS_banner != '4' && $niteoCS_banner != '6' && $niteoCS_banner != '7') {
215
- $overlay = $this->background_overlay( $themeslug );
216
- $html .= $overlay;
217
- }
218
-
219
- // add text overlay
220
- $html .= $this->background_text_overlay( $themeslug );
221
 
222
  return $html;
223
  }
@@ -226,177 +22,8 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
226
  // render slider
227
  public function cmp_slider( $themeslug ) {
228
 
229
- // change background if preview is set
230
- if ( isset( $_GET['background'] ) && $_GET['background'] !== '1' ) {
231
- echo $this->cmp_background( $_GET['background'], $themeslug );
232
- return;
233
- }
234
-
235
- $niteoCS_banner = get_option('niteoCS_banner', '1');
236
- $slider_count = get_option('niteoCS_slider_count', '3');
237
- $slider_effect = get_option('niteoCS_slider_effect', 'true');
238
- $slider_autoplay = get_option('niteoCS_slider_auto', '1');
239
- $size = $this->isMobile() ? 'large' : 'full';
240
- $banner_ids = $this->cmp_get_banner_ids();
241
-
242
- // break slider if only one custom image uploaded
243
- if ( $niteoCS_banner == '0' && isset( $banner_ids ) && count( $banner_ids ) < 2 ) {
244
- echo $this->cmp_background( '0', $themeslug ) ;
245
- return false;
246
- } ?>
247
-
248
- <div id="slider-wrapper">
249
-
250
- <div id="slider" class="slides effect-<?php echo esc_attr( $slider_effect );?>" data-autoplay="<?php echo esc_attr( $slider_autoplay );?>">
251
- <?php
252
- switch ( $niteoCS_banner ) {
253
- // custom media
254
- case '0':
255
- if ( isset( $banner_ids ) ) {
256
- foreach ( $banner_ids as $id ) {
257
- $slide_url = wp_get_attachment_image_src( $id, $size);
258
-
259
- if ( isset( $slide_url[0] ) ) {
260
- $slide_url = $slide_url[0];
261
- } ?>
262
- <div class="slide">
263
- <div class="slide-background" style="background-image:url('<?php echo esc_url( $slide_url ); ?>')"></div>
264
- </div>
265
- <?php
266
- }
267
- }
268
- break;
269
-
270
- // unsplash
271
- case '1':
272
- $unplash_feed = get_option('niteoCS_unsplash_feed', '3');
273
-
274
- switch ( $unplash_feed ) {
275
- // specific photo from id
276
- case '0':
277
- $params = array( 'feed' => '0', 'url' => get_option('niteoCS_unsplash_0', ''), 'count' => $slider_count );
278
- $unsplash = $this->niteo_unsplash( $params );
279
- break;
280
-
281
- // random from user
282
- case '1':
283
- $params = array( 'feed' => '1', 'custom_str' => get_option('niteoCS_unsplash_1', ''), 'count' => $slider_count );
284
- $unsplash = $this->niteo_unsplash( $params );
285
- break;
286
-
287
- // random from collection
288
- case '2':
289
- $params = array( 'feed' => '2', 'url' => get_option('niteoCS_unsplash_2', ''), 'count' => $slider_count );
290
- $unsplash = $this->niteo_unsplash( $params );
291
- break;
292
-
293
- // random photo
294
- case '3':
295
- $params = array( 'feed' => '3', 'url' => get_option('niteoCS_unsplash_3', ''), 'feat' => get_option('niteoCS_unsplash_feat', '0'), 'count' => $slider_count );
296
- $unsplash = $this->niteo_unsplash( $params );
297
- break;
298
-
299
- default:
300
- break;
301
- }
302
-
303
- // get raw url from response
304
- if ( isset( $unsplash['response'] ) && $unsplash['response'] == '200' ) {
305
- $unsplash_body = json_decode($unsplash['body'], true);
306
-
307
- $imgs = array();
308
-
309
- if ( isset( $unsplash_body[0] ) ) {
310
- foreach ( $unsplash_body as $item ) {
311
- array_push( $imgs, $item['urls']['raw']);
312
- }
313
-
314
- } else {
315
- $imgs[0] = $unsplash_body['urls']['raw'];
316
- }
317
-
318
- $imgs = json_encode( $imgs );
319
-
320
- switch ( $themeslug ) {
321
- case 'element':
322
- $width = 1;
323
- $height = 0.6;
324
- break;
325
-
326
- default:
327
- $width = 1;
328
- $height = 1;
329
- break;
330
- }
331
- ?>
332
-
333
- <script>
334
- var imgs = <?php echo $imgs;?>;
335
-
336
- var width = document.getElementById('slider-wrapper').offsetWidth * <?php echo $width;?>;
337
- var height = document.getElementById('slider-wrapper').offsetHeight * <?php echo $height;?>;
338
- var dimension = 'w=' + width;
339
- if ( width < height ) {
340
- dimension = 'h=' + height;
341
- }
342
- var query = '?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&' + dimension;
343
- var img = '';
344
-
345
- for ( i=0; i < imgs.length; i++ ) {
346
- var slide = document.createElement('div');
347
-
348
- slide.className = 'slide';
349
- img = imgs[i] + query;
350
- var slide_background = '<div class="slide-background" style="background-image:url(\''+img+'\')"></div>';
351
-
352
- slide.innerHTML = slide_background;
353
- document.getElementById('slider').appendChild(slide);
354
- }
355
- </script>
356
-
357
- <?php
358
- }
359
-
360
- default:
361
- break;
362
- } ?>
363
- </div>
364
-
365
- <?php
366
- echo $this->background_overlay( $themeslug );
367
-
368
- ?>
369
-
370
- </div>
371
-
372
- <div class="slider-nav prev"></div>
373
- <div class="slider-nav next"></div>
374
-
375
- <?php
376
-
377
- // render dot navigation for apollo theme
378
- if ( $themeslug == 'apollo' ) {
379
-
380
- if ( $niteoCS_banner == '0') {
381
- $slider_count = count( $banner_ids );
382
- }
383
-
384
- echo '<div class="dot-nav">';
385
-
386
- for ( $i=0; $i < $slider_count; $i++ ) {
387
- $slide_nm = $i + 1;
388
-
389
- if ( $i == 0 ) {
390
- echo '<div class="slide-number active" data-slide="0">0' . $slide_nm . '</div>';
391
- } else {
392
- echo '<div class="slide-number" data-slide="' . $i . '">0' . $slide_nm . '</div>';
393
- }
394
-
395
- }
396
-
397
- echo '</div>';
398
-
399
- }
400
 
401
  return;
402
  }
@@ -409,36 +36,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
409
  **/
410
  public function background_overlay( $themeslug ) {
411
 
412
- $overlay = get_option('niteoCS_overlay', 'solid-color');
413
- $opacity = get_option('niteoCS_overlay[opacity]', '0.4');
414
- $color = get_option('niteoCS_overlay[color]', '#0a0a0a');
415
- $html = '';
416
-
417
- switch ( $overlay ) {
418
- case 'solid-color':
419
- $html = '<div class="background-overlay solid-color" style="background-color:'.esc_attr( $color ).';opacity:'.esc_attr( $opacity ).'"></div>';
420
- break;
421
-
422
- case 'gradient':
423
- $overlay_gradient = get_option('niteoCS_overlay[gradient]', '#d53369:#cbad6d');
424
-
425
- if ( $overlay_gradient == 'custom' ) {
426
- $gradient_one = get_option('niteoCS_overlay[gradient_one]', '#e5e5e5');
427
- $gradient_two = get_option('niteoCS_overlay[gradient_two]', '#e5e5e5');
428
-
429
- } else {
430
- $gradient = explode(":", $overlay_gradient);
431
- $gradient_one = $gradient[0];
432
- $gradient_two = $gradient[1];
433
- }
434
-
435
-
436
- $html = '<div class="background-overlay gradient" style="background:-moz-linear-gradient(-45deg, '.esc_attr( $gradient_one ).' 0%, '.esc_attr( $gradient_two ).' 100%);background:-webkit-linear-gradient(-45deg, '.esc_attr( $gradient_one ).' 0%, '.esc_attr( $gradient_two ).' 100%);background:linear-gradient(135deg,'.esc_attr( $gradient_one ).' 0%, '.esc_attr( $gradient_two ).' 100%);opacity:'.esc_attr( $opacity ).'"></div>';
437
- break;
438
-
439
- default:
440
- break;
441
- }
442
 
443
  return $html;
444
  }
@@ -451,23 +49,10 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
451
  * @return HTML
452
  **/
453
  public function background_text_overlay( $themeslug ) {
454
- $overlay_text_status = get_option('niteoCS_overlay_text[status]', '1');
455
-
456
- // return if overlay is disabled
457
- if ( $overlay_text_status == '0' || !in_array( $themeslug, $this->cmp_overlay_text_themes() ) ) {
458
- return;
459
- }
460
-
461
- $heading = stripslashes(get_option('niteoCS_overlay_text[heading]', 'NEW WEBSITE ON THE WAY!'));
462
- $paragraph = stripslashes(get_option('niteoCS_overlay_text[paragraph]', ''));
463
- $button_text = stripslashes(get_option('niteoCS_overlay_text[button_text]', 'Call to Action!'));
464
- $button_url = get_option('niteoCS_overlay_text[button_url]', '');
465
 
466
- $heading = ( $heading == '' ) ? '' : '<h2 class="animated fadeInRight delay-small">'.esc_html( $heading ).'</h2>';
467
- $paragraph = ( $paragraph == '' ) ? '' : '<div class="animated fadeInRight delay-big">'. wpautop( esc_html( $paragraph ) ) . '</div>';
468
- $button = ( $button_text == '' ) ? '' : '<a href="'.esc_html( $button_url ).'" class="button animated fadeInRight delay-huge" target="_blank">'.esc_html( $button_text ).'</a>';
469
 
470
- return '<div class="overlay-content">' . $heading . $paragraph . $button . '</div>';
471
 
472
  }
473
 
@@ -475,118 +60,16 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
475
  // render Social Icons
476
  public function cmp_social_icons( $mode = 'icon', $title = false, $themeslug = false, $ulclass = '', $liclass = '' ) {
477
 
478
- $html = '';
479
- $ulclass = ( $ulclass != '' ) ? ' ' . $ulclass : $ulclass;
480
- $liclass = ( $liclass != '' ) ? ' ' . $liclass : $liclass;
481
 
482
- if ( $title == true ) {
483
- $soc_title = stripslashes( get_option('niteoCS_soc_title', 'GET SOCIAL WITH US') );
484
- $html = ( $soc_title == '' ) ? '' : '<h2 class="soc-title">' . esc_html( $soc_title ) . '</h2>';
485
- }
486
-
487
- // migrate social media to new option after update 1.4.0
488
- if ( get_option('niteoCS_socialmedia') ) {
489
-
490
- $socialmedia = stripslashes( get_option('niteoCS_socialmedia') );
491
- $socialmedia = json_decode( $socialmedia, true );
492
- //sort social icons array by hidden, then order key
493
- uasort( $socialmedia , array($this,'sort_social') );
494
-
495
- $html = $html.'<ul class="social-list' . $ulclass . '">';
496
-
497
- $theme_html = ( $themeslug == 'stylo' ) ? '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="3em" height="3em" viewBox="0 0 80 80" xml:space="preserve"><circle transform="rotate(-90 40 40)" class="another-circle" cx="40" cy="40" r="36" /></svg>' : '';
498
-
499
- ob_start();
500
-
501
- foreach ( $socialmedia as $social ) {
502
-
503
- if ( $social['hidden'] == '0' && $social['active'] == '1') {
504
- $href = '';
505
- $name = ucfirst($social['name']);
506
-
507
- switch ($social['name']) {
508
- case 'envelope-o':
509
- $href = 'mailto:';
510
- $name = __('Email', 'cmp-coming-soon-maintenance');
511
- break;
512
- case 'phone':
513
- $href = 'tel:';
514
- $name = __('Phone', 'cmp-coming-soon-maintenance');
515
- break;
516
- case 'whatsapp':
517
- $name = 'WhatsApp';
518
- $href = 'https://api.whatsapp.com/send?phone=';
519
- break;
520
- case 'youtube':
521
- $name = 'YouTube';
522
- break;
523
- case 'linkedin':
524
- $name = 'LinkedIn';
525
- break;
526
- case 'deviantart':
527
- $name = 'DeviantArt';
528
- break;
529
- case 'soundcloud':
530
- $name = 'SoundCloud';
531
- break;
532
- case 'vk':
533
- $name = 'VK';
534
- break;
535
- case 'github':
536
- $name = 'GitHub';
537
- break;
538
- default:
539
- break;
540
- }
541
-
542
- echo ( $mode == 'text' ) ? '<li class="social-child' . $liclass . '"><a href="'.$href.esc_attr($social['url']).'" target="top" class="social-'.$social['name'].'">'.$name.'</a></li>' : '<li class="social-child' . $liclass . '"><a href="'.$href.esc_attr($social['url']).'" target="top" class="social-'.$social['name'].'">'.$theme_html.'<i class="fa fa-'.$social['name'].'" aria-hidden="true"></i></a></li>';
543
- }
544
- }
545
-
546
- $social_list = ob_get_clean();
547
-
548
- if ( $social_list != '' ) {
549
- return $html.$social_list.'</ul>';
550
- }
551
- }
552
-
553
- return;
554
 
555
  }
556
 
557
  // Render Logo
558
  public function cmp_logo( $themeslug, $class = '' ) {
559
 
560
- $logo_type = get_option('niteoCS_logo_type', 'text');
561
-
562
- $html = '';
563
- $class = ( $class != '' ) ? ' ' . $class : $class;
564
-
565
- switch ( $logo_type ) {
566
- case 'graphic':
567
- // get logo id
568
- $logo_id = get_option('niteoCS_logo_id');
569
-
570
- // get logo
571
- if ( $logo_id != '' ) {
572
- $logo_url = wp_get_attachment_image_src( $logo_id, 'full' );
573
- }
574
-
575
- if ( isset($logo_url[0]) ) {
576
- $html = '<div class="logo-wrapper image' . esc_attr( $class ) . '"><a href="'. esc_url( get_site_url() ) .'" style="text-decoration:none"><img src="'.esc_url( $logo_url[0] ).'" class="graphic-logo" alt="logo"></a></div>';
577
- }
578
- break;
579
-
580
- case 'text':
581
- $text_logo = stripslashes(get_option('niteoCS_text_logo', get_bloginfo( 'name', 'display' )));
582
-
583
- $html = '<div class="logo-wrapper text text-logo-wrapper' . esc_attr( $class ) . '"><a href="'. esc_url( get_site_url() ) .'" style="text-decoration:none;color:inherit"><h1 class="text-logo">'.esc_html( $text_logo ).'</h1></a></div>';
584
- break;
585
-
586
- case 'disabled':
587
- default:
588
- break;
589
- }
590
 
591
  return $html;
592
  }
@@ -594,210 +77,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
594
 
595
  // render subscribe form
596
  public function cmp_subscribe_form( $label = FALSE, $firstname = FALSE, $lastname = FALSE ) {
597
- // process emails first
598
- $response = $this->niteo_subscribe( true );
599
-
600
- $html = '';
601
-
602
- // get current theme
603
- $theme = $this->cmp_selectedTheme();
604
-
605
- // get type of susbscribe
606
- $subscribe = get_option('niteoCS_subscribe_type', '2');
607
-
608
- // if subscribers is 3rd party plugin, render form by shortcode
609
- if ( $subscribe == '1' ) {
610
- $replace = array('<p>', '</p>' );
611
- $html = str_replace($replace, '', do_shortcode( stripslashes( get_option('niteoCS_subscribe_code') ))) ;
612
-
613
- // CMP subscribe form
614
- } else if ( $subscribe == '2' ) {
615
-
616
- // get GDPR message
617
- $niteoCS_subscribe_label = stripslashes( get_option('niteoCS_subscribe_label') );
618
-
619
- // get translation if exists
620
- $translation = json_decode( get_option('niteoCS_translation'), true );
621
- $placeholder = isset($translation[4]['translation']) ? stripslashes( $translation[4]['translation'] ) : 'Insert your email address.';
622
- $placeholder_firstname = isset($translation[10]['translation']) ? stripslashes( $translation[10]['translation'] ) : 'First Name';
623
- $placeholder_lastname = isset($translation[11]['translation']) ? stripslashes( $translation[11]['translation'] ) : 'Last Name';
624
- $submit = isset($translation[8]['translation']) ? stripslashes( $translation[8]['translation'] ) : 'Submit';
625
-
626
- // overwrite it with theme specific requirements
627
- if ( $this->cmp_selectedTheme() == 'stylo' ) {
628
- $placeholder = '&#xf003; ' . $placeholder;
629
- $placeholder_firstname = '&#xf2c0; ' . $placeholder_firstname;
630
- $placeholder_lastname = '&#xf2c0; ' . $placeholder_lastname;
631
- }
632
-
633
- // overwrite it with theme specific requirements
634
- if ( $this->cmp_selectedTheme() == 'pluto' ) {
635
- $placeholder = '&#xf003; ' . $placeholder;
636
- }
637
-
638
- $submit = ( $this->cmp_selectedTheme() == 'postery' ) ? '&#xf1d9;' : $submit;
639
- $submit = ( $this->cmp_selectedTheme() == 'juno' ) ? '&#xf1d8;' : $submit;
640
- $submit = ( $this->cmp_selectedTheme() == 'agency' ) ? '&#xf105;' : $submit;
641
- $submit = ( $this->cmp_selectedTheme() == 'libra' ) ? '&#xf1d9;' : $submit;
642
-
643
- ?>
644
-
645
- <form id="subscribe-form" method="post" class="cmp-subscribe">
646
- <div class="cmp-form-inputs">
647
-
648
- <?php wp_nonce_field('save_options','save_options_field'); ?>
649
- <?php
650
- // display placeholders or labels
651
- switch ( $label ) {
652
- case TRUE:
653
- if ( $firstname === TRUE ) { ?>
654
- <div class="firstname input-wrapper">
655
- <label for="firstname-subscribe"><?php echo esc_attr( $placeholder_firstname );?></label>
656
- <input type="text" id="firstname-subscribe" name="cmp_firstname">
657
- </div>
658
- <?php
659
- }
660
-
661
- if ( $lastname === TRUE ) { ?>
662
- <div class="lastname input-wrapper">
663
- <label for="lastname-subscribe"><?php echo esc_attr( $placeholder_lastname );?></label>
664
- <input type="text" id="lastname-subscribe" name="cmp_lastname">
665
- </div>
666
- <?php
667
- } ?>
668
- <div class="email input-wrapper">
669
- <label for="email-subscribe"><?php echo esc_attr( $placeholder );?></label>
670
- <input type="email" id="email-subscribe" name="email" required>
671
- </div>
672
- <?php
673
- break;
674
-
675
- case FALSE:
676
- if ( $firstname === TRUE ) { ?>
677
- <input type="text" id="firstname-subscribe" name="cmp_firstname" placeholder="<?php echo esc_attr( $placeholder_firstname );?>">
678
- <?php
679
- }
680
-
681
- if ( $lastname === TRUE ) { ?>
682
- <input type="text" id="lastname-subscribe" name="cmp_lastname" placeholder="<?php echo esc_attr( $placeholder_lastname );?>">
683
- <?php
684
- } ?>
685
-
686
- <input type="email" id="email-subscribe" name="email" placeholder="<?php echo esc_attr( $placeholder );?>" required>
687
- <?php
688
- break;
689
-
690
- default:
691
- break;
692
- }
693
-
694
- if ( $this->cmp_selectedTheme() == 'mercury' ) { ?>
695
- <button type="submit" id="submit-subscribe" value="<?php echo esc_attr( $submit );?>"><?php echo esc_attr( $submit );?></button>
696
- <?php
697
- } else { ?>
698
- <input type="submit" id="submit-subscribe" value="<?php echo esc_attr( $submit );?>">
699
- <?php
700
- } ?>
701
-
702
- <div style="display: none;">
703
- <input type="text" name="form_honeypot" value="" tabindex="-1" autocomplete="off">
704
- </div>
705
-
706
- <div id="subscribe-response"><?php echo isset( $response ) ? $response : '';?></div>
707
-
708
- <div id="subscribe-overlay"></div>
709
- </div>
710
-
711
- <?php
712
- // render Subscribe form Message/GDPR
713
- if ( $niteoCS_subscribe_label != '' ) {
714
-
715
- $allowed_html = array(
716
- 'a' => array(
717
- 'href' => array(),
718
- 'title' => array()
719
- ),
720
- );
721
- ?>
722
-
723
- <div class="cmp-form-notes">
724
- <?php echo wpautop(wp_kses( $niteoCS_subscribe_label, $allowed_html )); ?>
725
- </div>
726
- <?php
727
- } ?>
728
-
729
- </form>
730
-
731
- <script>
732
- /* Subscribe form script */
733
- <?php
734
- $url = parse_url( admin_url() );
735
- $path = isset($url['path']) ? $url['path'] : '/wp-admin/';
736
- ?>
737
-
738
- var ajaxurl = '<?php echo esc_attr($path);?>admin-ajax.php';
739
- var security = '<?php echo wp_create_nonce( 'cmp-subscribe-action' );?>';
740
- var msg = '';
741
-
742
- window.addEventListener('load',function(event) {
743
- subForm( 'subscribe-form', 'submit-subscribe', 'subscribe-response', 'email-subscribe', 'firstname-subscribe', 'lastname-subscribe' );
744
- });
745
-
746
- subForm = function(formID, buttonID, resultID, emailID, firstnameID, lastnameID) {
747
-
748
- let selectForm = document.getElementById(formID); // Select the form by ID.
749
- let selectButton = document.getElementById(buttonID); // Select the button by ID.
750
- let selectResult = document.getElementById(resultID); // Select result element by ID.
751
- let emailInput = document.getElementById(emailID); // Select email input by ID.
752
- let firstnameInput = document.getElementById(firstnameID); // Select firstname input by ID.
753
- let lastnameInput = document.getElementById(lastnameID); // Select lastname input by ID.
754
- let firstname = '';
755
- let lastname = '';
756
- selectButton.onclick = function(e){ // If clicked on the button.
757
-
758
- if ( emailInput.value !== '' ) {
759
- firstname = firstnameInput === null ? '' : firstnameInput.value;
760
- lastname = lastnameInput === null ? '' : lastnameInput.value;
761
-
762
- // I'm using the whatwg-fetch polyfill and a polyfill for Promises.
763
- fetch(ajaxurl, {
764
- method: 'POST',
765
- headers: {
766
- 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
767
- 'Access-Control-Allow-Origin': '*',
768
- },
769
- body: `action=niteo_subscribe&ajax=true&form_honeypot=&email=${emailInput.value}&firstname=${firstname}&lastname=${lastname}&security=${security}`,
770
- credentials: 'same-origin'
771
- })
772
- .then((res) => {
773
- return res.json();
774
- })
775
- .then((data) => {
776
- selectResult.innerHTML = data.message; // Display the result inside result element.
777
- selectForm.classList.add('-subscribed');
778
- if (data.status == 1) {
779
- selectForm.classList.remove('-subscribe-failed');
780
- selectForm.classList.add('-subscribe-successful');
781
- emailInput.value = '';
782
- firstnameInput ? firstnameInput.value = '' : null;
783
- lastnameInput ? lastnameInput.value = '' : null;
784
- <?php do_action('cmp-successfull-subscribe-action'); ?>
785
-
786
- } else {
787
- selectForm.classList.add('-subscribe-failed');
788
- }
789
- })
790
- .catch(function(error) { console.log(error.message); });
791
- }
792
- }
793
-
794
- selectForm.onsubmit = function(){ // Prevent page refresh
795
- return false;
796
- }
797
- }
798
- </script>
799
- <?php
800
- }
801
 
802
  return $html;
803
 
@@ -811,15 +91,9 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
811
  **/
812
  public function cmp_get_body() {
813
 
814
- $body = stripslashes( get_option('niteoCS_body', '') );
815
-
816
- if ( isset($GLOBALS['wp_embed']) ) {
817
- $body = $GLOBALS['wp_embed']->autoembed( $body );
818
- }
819
-
820
- $body = wpautop( do_shortcode( $body ) );
821
 
822
- return $body;
823
  }
824
 
825
  /**
@@ -829,20 +103,10 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
829
  * @return HTML
830
  **/
831
  public function cmp_get_title( $class = '' ) {
832
- global $allowedposttags;
833
 
834
- $title = stripslashes( get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!') );
835
 
836
- // wrap text between stars in title in span for future formatting
837
- $title_array = explode('*', $title);
838
-
839
- if ( count($title_array) == 3 ) {
840
- $title = '<span class="cmp-title light">' . $title_array[0] . '</span><span class="cmp-title bold">' . $title_array[1] . '</span><span class="cmp-title light">' . $title_array[2] . '</span>';
841
- }
842
-
843
- $title = ( $title == '' ) ? '' : '<h2 class="cmp-title animated '. $class .'">' . wp_kses( $title, $allowedposttags ) . '</h2>';
844
-
845
- return $title;
846
 
847
  }
848
 
@@ -854,130 +118,14 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
854
  * @return HTML
855
  **/
856
  public function cmp_get_fonts( $heading_font = array(), $content_font = array() ) {
857
- $custom = '';
858
- $google_fonts = '';
859
- $custom_font = '';
860
-
861
- // get google fonts html
862
- if ( $heading_font['variant'] !== 'Not Applicable' || $content_font['variant'] !== 'Not Applicable' ) {
863
 
864
- // get fonts subset
865
- $google_fonts = $this->cmp_get_google_fonts();
866
- $heading_break = FALSE;
867
- $content_break = FALSE;
868
-
869
- foreach ( $google_fonts as $font => $val ) {
870
-
871
- if ( $val['text'] == $heading_font['family'] ) {
872
- $heading_subsets = $val['subset'];
873
- $heading_break = TRUE;
874
- }
875
-
876
- if ( $val['text'] == $content_font['family'] ) {
877
- $content_subsets = $val['subset'];
878
- $content_break = TRUE;
879
- }
880
-
881
- if ( $heading_break === TRUE && $content_break === TRUE ) {
882
- break;
883
- }
884
- }
885
-
886
- if ( $heading_subsets === null || $content_subsets === null ) {
887
- $subset = ($heading_subsets === null) ? $content_subsets : $heading_subsets;
888
- $subset = ($content_subsets === null) ? $heading_subsets : $content_subsets;
889
-
890
- } else {
891
- $subset = array_unique( array_merge( $heading_subsets, $content_subsets ) );
892
- }
893
-
894
- if ( $heading_font['variant'] !== 'Not Applicable' ) {
895
- $heading = esc_attr( str_replace(' ', '+', $heading_font['family']) ) .':'. esc_attr(str_replace('italic', 'i', $heading_font['variant'] ));
896
- }
897
-
898
- if ( $content_font['variant'] !== 'Not Applicable' ) {
899
- $content = esc_attr( str_replace(' ', '+', $content_font['family']) ) .':400,700,'. esc_attr(str_replace('italic', '', $content_font['variant'] ));
900
- }
901
-
902
- $separator = ( $heading !== null && $content !== null ) ? '%7C' : '';
903
-
904
-
905
- $google_fonts = '<link href="https://fonts.googleapis.com/css?family='. $heading . $separator . $content .'&amp;subset=' . implode(',', $subset) . '" rel="stylesheet">';
906
-
907
- }
908
-
909
- // get custom font html
910
- if ( $heading_font['variant'] === 'Not Applicable' || $content_font['variant'] === 'Not Applicable' ) {
911
-
912
- $custom_fonts = json_decode(get_option('niteoCS_custom_fonts'), true);
913
- $custom_font = '';
914
-
915
- foreach ( $custom_fonts as $custom ) {
916
-
917
- if ( $custom['id'] === $heading_font['family'] ) {
918
- if ( is_array($custom['ids']) ) {
919
- $custom_font .= $this->cmp_get_font_src( $heading_font['family'], $custom['ids'] );
920
- }
921
- }
922
-
923
-
924
- if ( $custom['id'] === $content_font['family'] ) {
925
- if ( is_array($custom['ids']) ) {
926
- $custom_font .= $this->cmp_get_font_src( $content_font['family'], $custom['ids'] );
927
- }
928
- }
929
-
930
- }
931
- }
932
 
933
  return $google_fonts . PHP_EOL . $custom_font . PHP_EOL;
934
  }
935
 
936
 
937
- /**
938
- * helper function to render style css for custom fonts
939
- *
940
- * @since 3.5
941
- * @param string,array
942
- * @return HTML
943
- **/
944
- public function cmp_get_font_src( $family, $ids ) {
945
-
946
- foreach ( $ids as $attachment_id ) {
947
-
948
- $url = wp_get_attachment_url($attachment_id);
949
- $ext = pathinfo($url, PATHINFO_EXTENSION);
950
- $new_src = '';
951
-
952
- switch ($ext) {
953
- case 'eot':
954
- $eot = 'src: url("'.esc_url($url).'");' . PHP_EOL;
955
- break;
956
- case 'woff':
957
- $new_src = 'url("'.esc_url($url).'")' . ' format("woff"),';
958
- break;
959
- case 'woff2':
960
- $new_src = 'url("'.esc_url($url).'")' . ' format("woff2"),';
961
- break;
962
- case 'otf':
963
- $new_src = 'url("'.esc_url($url).'")' . ' format("opentype"),';
964
- break;
965
- case 'ttf':
966
- $new_src = 'url("'.esc_url($url).'")' . ' format("truetype"),';
967
- break;
968
- case 'svg':
969
- $new_src = 'url("'.esc_url($url).'#filename")' . ' format("svg"),';
970
- break;
971
- default:
972
- break;
973
- }
974
-
975
- $src .= $new_src;
976
- }
977
-
978
- return '<style>'. PHP_EOL .'@font-face {font-family: "'.$family.'";' . PHP_EOL . $eot . 'src: ' . rtrim( $src, ',').';}'. PHP_EOL .'</style>';
979
 
980
- }
981
 
982
  /**
983
  * render theme head SEO.
@@ -986,51 +134,8 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
986
  * @return HTML
987
  **/
988
  public function cmp_get_seo() {
989
- ob_start();
990
-
991
- $title = stripslashes( get_option('niteoCS_title', get_bloginfo('name').' Coming soon!') );
992
- $descr = stripslashes( get_option('niteoCS_descr', 'Just another Coming Soon Page') );
993
-
994
- $seo_img_id = get_option('niteoCS_seo_img_id');
995
- $seo_img_url = wp_get_attachment_image_src($seo_img_id, 'large');
996
- $seo_img_url = isset($seo_img_url[0]) ? $seo_img_url[0] : $this->cmp_get_background_img();
997
- ?>
998
- <!-- SEO -->
999
- <title><?php echo esc_html( $title ); ?></title>
1000
- <meta name="description" content="<?php echo esc_html( $descr ); ?>"/>
1001
-
1002
- <!-- og meta for facebook, googleplus -->
1003
- <meta property="og:title" content="<?php echo esc_html( $title ); ?>"/>
1004
- <meta property="og:description" content="<?php echo esc_html( $descr ); ?>"/>
1005
- <meta property="og:url" content="<?php echo get_home_url()?>"/>
1006
- <meta property="og:type" content="website" />
1007
- <meta property="og:image" content="<?php echo esc_url( $seo_img_url );?>"/>
1008
-
1009
- <!-- twitter meta -->
1010
- <meta name="twitter:card" content="summary_large_image">
1011
- <meta name="twitter:title" content="<?php echo esc_html( $title ); ?>"/>
1012
- <meta name="twitter:description" content="<?php echo esc_html( $descr ); ?>"/>
1013
- <meta name="twitter:url" content="<?php echo get_home_url();?>"/>
1014
- <meta name="twitter:image" content="<?php echo esc_url( $seo_img_url );?>"/>
1015
-
1016
- <?php
1017
- // display favicon
1018
- $favicon_id = get_option('niteoCS_favicon_id');
1019
-
1020
- if ( $favicon_id && $favicon_id != '' ) {
1021
- $favicon_url = wp_get_attachment_image_src( $favicon_id, 'thumbnail' );
1022
- if ( isset($favicon_url[0]) ) {
1023
- echo '<link id="favicon" rel="shortcut icon" href="' . $favicon_url[0] . '" type="image/x-icon"/>';
1024
- }
1025
- } else {
1026
- wp_site_icon();
1027
- }
1028
 
1029
- if ( get_option( 'blog_public', '1' ) == '0' ) {
1030
- echo '<meta name="robots" content="noindex,nofollow" />' . PHP_EOL;
1031
- }
1032
-
1033
- $html = ob_get_clean();
1034
 
1035
  return $html;
1036
  }
@@ -1043,148 +148,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
1043
  **/
1044
  public function cmp_get_custom_css() {
1045
 
1046
- $css = '';
1047
-
1048
- $themeslug = $this->cmp_selectedTheme();
1049
-
1050
- if ( isset($_GET['theme']) && !empty($_GET['theme']) ) {
1051
- $themeslug = esc_attr($_GET['theme']);
1052
- }
1053
-
1054
- $banner = get_option('niteoCS_banner', '2');
1055
-
1056
- if ( isset( $_GET['background'] ) && !empty($_GET['background']) ) {
1057
- $banner = esc_attr( $_GET['background'] );
1058
-
1059
- if ( $themeslug === 'pluto' && $banner === '4' ) {
1060
- $banner = '2';
1061
- }
1062
- }
1063
-
1064
- // add CMP CSS to all themes
1065
- ob_start();
1066
-
1067
- // add blur effect if enabled
1068
- $blur = get_option('niteoCS_effect_blur', '0.0');
1069
-
1070
- if ( $blur != '0.0' ) {
1071
- ?>
1072
- <!-- blur effect -->
1073
- <style>
1074
- #background-image,
1075
- .slide-background,
1076
- .video-banner {filter:blur(<?php echo esc_attr($blur);?>px);}
1077
- #background-image,
1078
- .video-banner,
1079
- .background-overlay,
1080
- .slide-background {transform:scale(1.1);}
1081
- #background-wrapper, #slider-wrapper {overflow:hidden;}
1082
- #background-image:not(.slide) {background-attachment: initial;}
1083
- </style>
1084
-
1085
- <?php
1086
- } ?>
1087
-
1088
- <style>
1089
- /* wp video shortcode */
1090
- .wp-video {margin: 0 auto;}
1091
- .wp-video-shortcode {max-width: 100%;}
1092
- /* google recaptcha badge */
1093
- .grecaptcha-badge {display: none;}
1094
- </style>
1095
-
1096
- <?php
1097
- if ( get_option('niteoCS_logo_custom_size', '0') !== '0' ) { ?>
1098
- <!-- custom logo height -->
1099
- <style>
1100
- @media screen and (min-width:1024px) {
1101
- .logo-wrapper img {max-height: <?php echo esc_attr(get_option('niteoCS_logo_size', '0'));?>px}
1102
- }
1103
- </style>
1104
- <?php
1105
- }
1106
-
1107
- // CHAMELEON BACKGROUND STYLES
1108
- if ( $themeslug === 'pluto' && $banner === '2' ): ?>
1109
- <style>
1110
- #background-image {
1111
- -webkit-animation: chameleon 19s infinite;
1112
- animation: chameleon 19s infinite;
1113
- }
1114
- @-webkit-keyframes chameleon {
1115
- 0% {background: #2ecc71;}
1116
- 25% { background: #f1c40f;}
1117
- 50% { background: #e74c3c;}
1118
- 75% {background: #3498db;}
1119
- 100% {background: #2ecc71;}
1120
- }
1121
- @keyframes chameleon {
1122
- 0% {background: #2ecc71; }
1123
- 25% {background: #f1c40f;}
1124
- 50% {background: #e74c3c;}
1125
- 75% {background: #3498db;}
1126
- 100% {background: #2ecc71;}
1127
- }
1128
- </style>
1129
- <?php endif;?>
1130
-
1131
- <?php
1132
- // check for premium themes special effects
1133
- if ( in_array( $themeslug, $this->cmp_premium_themes_installed() ) ) {
1134
-
1135
- $effect = get_option('niteoCS_special_effect', 'disabled');
1136
-
1137
- // change effect for preview
1138
- if ( isset($_GET['effect']) && is_numeric($_GET['effect'])) {
1139
- $effect = $_GET['effect'];
1140
- }
1141
-
1142
- switch ( $effect ) {
1143
- case 'constellation':
1144
- case '1': ?>
1145
- <!-- constellation effect -->
1146
- <style>
1147
- .particles-js-canvas-el {position: absolute; top:0; left:0;}
1148
- <?php
1149
- switch ( $themeslug ) {
1150
- case 'frame': ?>
1151
- .particles-js-canvas-el {z-index: -1;}
1152
- #background-image, .video-banner {z-index: -3;}
1153
- .background-overlay {z-index: -2;}
1154
- <?php
1155
- break;
1156
-
1157
- case 'stylo':
1158
- case 'eclipse': ?>
1159
- .particles-js-canvas-el {z-index: 1;}
1160
- <?php
1161
- break;
1162
- default:
1163
- break;
1164
- } ?>
1165
- </style>
1166
- <?php
1167
- break;
1168
-
1169
- case 'bubbles':
1170
- case '2': ?>
1171
- <!-- constellation effect -->
1172
- <style>
1173
- canvas {position: absolute; top:0; left:0;}
1174
- </style>
1175
- <?php
1176
- break;
1177
-
1178
- default:
1179
- break;
1180
- }
1181
- }
1182
-
1183
- $css = ob_get_clean();
1184
-
1185
- $custom_css = ( get_option('niteoCS_custom_css', '') != '' ) ? '<style>'.stripslashes( wp_filter_nohtml_kses( get_option('niteoCS_custom_css') ) ).'</style>' : '';
1186
-
1187
- $css .= $custom_css;
1188
 
1189
  return $css;
1190
  }
@@ -1196,24 +160,10 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
1196
  * @return HTML
1197
  **/
1198
  public function cmp_get_copyright() {
1199
- if ( get_option( 'niteoCS_copyright', 'Made by <a href="https://niteothemes.com">NiteoThemes</a> with love.' ) !== '' ) {
1200
- $copyright = stripslashes( get_option('niteoCS_copyright', 'Made by <a href="https://niteothemes.com">NiteoThemes</a> with love.') );
1201
- $allowed_html = array(
1202
- 'a' => array(
1203
- 'href' => array(),
1204
- 'title' => array(),
1205
- 'target' => array(),
1206
- ),
1207
- 'br' => array(),
1208
- 'em' => array(),
1209
- 'strong' => array(),
1210
- );
1211
-
1212
- return '<p class="copyright">' . wp_kses( $copyright, $allowed_html ) . '</p>';
1213
-
1214
- }
1215
 
1216
- return false;
 
 
1217
  }
1218
 
1219
  /**
@@ -1223,26 +173,9 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
1223
  **/
1224
  public function cmp_enqueue_styles( $themeslug = 'hardwork', $font_ani = false, $slider = '0', $banner_type = '2', $fa = false, $gutenberg = false ) {
1225
 
1226
- $ver = $this->cmp_theme_version( $themeslug );
1227
-
1228
- if ( $gutenberg === true ) {
1229
- echo '<link rel="stylesheet" href="'.includes_url('/css/dist/block-library/style.min.css').'" type="text/css" media="all" />' . PHP_EOL;
1230
- }
1231
-
1232
- // theme stylesheet
1233
- echo '<link rel="stylesheet" href="' . $this->cmp_themeURL( $themeslug ) . $themeslug.'/style.css?v='.$ver . '" type="text/css" media="all">' . PHP_EOL;
1234
-
1235
- if ( $font_ani !== false || $font_ani !== 'none' ) {
1236
- echo '<link rel="stylesheet" href="'. esc_url( $this->cmp_asset_url('/css/animate.min.css') ) . '">' . PHP_EOL;
1237
- }
1238
-
1239
- if ( $slider == '1' && ($banner_type == '0' || $banner_type == '1') ) {
1240
- echo '<link href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css" rel="stylesheet">' . PHP_EOL;
1241
- }
1242
 
1243
- if ( $fa === true ) {
1244
- echo '<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" >' . PHP_EOL;
1245
- }
1246
 
1247
  }
1248
 
@@ -1253,66 +186,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
1253
  **/
1254
  public function cmp_head_scripts() {
1255
 
1256
- $this->cmp_wp_head();
1257
-
1258
- do_action('cmp-before-header-scripts');
1259
-
1260
- $head_scripts = json_decode( get_option('niteoCS_head_scripts', '[]'), true );
1261
-
1262
- if ( !empty( $head_scripts ) ) {
1263
- foreach ( $head_scripts as $script ) {
1264
- if ( $script != '' ) {
1265
- $file = pathinfo( $script );
1266
- switch ( $file['extension'] ) {
1267
- case 'js':
1268
- echo '<script src="' . esc_url( $script ). '"></script>' . PHP_EOL;
1269
- break;
1270
- case 'css':
1271
- echo '<link href="' . esc_url( $script ). '" rel="stylesheet">' . PHP_EOL;
1272
- break;
1273
- default:
1274
- break;
1275
- }
1276
- }
1277
- }
1278
-
1279
- do_action('cmp-after-header-scripts');
1280
- }
1281
-
1282
- switch ( get_option('niteoCS_analytics_status', 'disabled') ) {
1283
- //disabled analytics
1284
- case 'disabled':
1285
- break;
1286
- // google analytics
1287
- case 'google':
1288
-
1289
- if ( get_option('niteoCS_analytics', '') !== '' ) { ?>
1290
- <!-- Google analytics code -->
1291
- <script>
1292
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
1293
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
1294
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
1295
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
1296
-
1297
- ga('create', '<?php echo esc_attr(get_option('niteoCS_analytics'));?>', 'auto');
1298
- ga('send', 'pageview');
1299
-
1300
- </script>
1301
- <?php
1302
- }
1303
-
1304
- break;
1305
- // other js code
1306
- case 'other':
1307
- if ( get_option('niteoCS_analytics_other', '') !== '' ) {
1308
- $analytics_code = get_option('niteoCS_analytics_other', '');
1309
- echo stripslashes( $analytics_code );
1310
- }
1311
-
1312
- break;
1313
- default:
1314
- break;
1315
- }
1316
 
1317
  return;
1318
  }
@@ -1326,393 +200,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
1326
  **/
1327
  public function cmp_javascripts( $background, $themeslug ) {
1328
 
1329
- do_action('cmp-before-footer-scripts');
1330
-
1331
- $jquery = FALSE;
1332
-
1333
- if ( isset($_GET['background']) && is_numeric($_GET['background']) ) {
1334
- $background = esc_attr($_GET['background']);
1335
- } ?>
1336
-
1337
- <!-- Fade in background image after load -->
1338
- <script>
1339
- window.addEventListener("load",function(event) {
1340
- init();
1341
- });
1342
-
1343
- function init(){
1344
-
1345
- var image = document.getElementById('background-image');
1346
- var body = document.getElementById('body');
1347
- if ( image === null ) {
1348
- image = document.getElementById('body');
1349
- }
1350
-
1351
- if ( image != null ) {
1352
- image.classList.add('loaded');
1353
- body.classList.add('loaded');
1354
- }
1355
-
1356
- <?php
1357
- // theme specific function after init
1358
- switch ( $themeslug ) {
1359
- case 'fifty': ?>
1360
- var contentWrapper = document.getElementsByClassName('content-wrapper')[0];
1361
- setTimeout(function(){ contentWrapper.className += " overflow"; }, 1500);
1362
-
1363
- <?php
1364
- break;
1365
-
1366
- case 'hardwork_premium': ?>
1367
- var contentWrapper = document.getElementsByClassName('section-body')[0];
1368
- setTimeout(function(){ contentWrapper.className += " overflow"; }, 1500);
1369
- <?php
1370
- break;
1371
-
1372
- default:
1373
- break;
1374
- } ?>
1375
- }
1376
- </script>
1377
-
1378
- <?php
1379
- // include background scripts
1380
- switch ( $background ) {
1381
- // VIDIM script for background video
1382
- case '5':
1383
- $video_autoloop = get_option('niteoCS_video_autoloop', '1'); ?>
1384
- <script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/vidim.min.js?v=1.0.2"');?>'></script>
1385
- <script>
1386
- <?php
1387
- $video_poster = wp_get_attachment_image_src( get_option('niteoCS_video_thumb'), 'large' );
1388
-
1389
- if ( !empty( $video_poster ) ) {
1390
- $video_poster = $video_poster[0];
1391
- }
1392
- // video
1393
- $source = get_option('niteoCS_banner_video');
1394
-
1395
- // sanitize source
1396
- switch ( $source ) {
1397
- case 'youtube':
1398
- $source = 'YouTube';
1399
- break;
1400
- case 'local':
1401
- $source = 'video/mp4';
1402
- break;
1403
- default:
1404
- break;
1405
- }
1406
-
1407
- switch ( $source ) {
1408
- case 'YouTube':
1409
- $banner_url = get_option('niteoCS_youtube_url'); ?>
1410
-
1411
- var myBackground = new vidim( '#player', {
1412
- src: '<?php echo esc_url( $banner_url ); ?>',
1413
- type: 'YouTube',
1414
- poster: '<?php echo esc_url( $video_poster ); ?>',
1415
- quality: 'hd1080',
1416
- muted: true,
1417
- loop: <?php echo $video_autoloop ? 'true' : 'false' ; ?>
1418
- });
1419
-
1420
- <?php
1421
- break;
1422
-
1423
- case 'vimeo':
1424
- $banner_url = get_option('niteoCS_vimeo_url'); ?>
1425
- var myBackground = new vidim( '#player', {
1426
- src: '<?php echo esc_url( $banner_url ); ?>',
1427
- type: 'vimeo',
1428
- poster: '<?php echo esc_url( $video_poster ); ?>',
1429
- loop: <?php echo $video_autoloop ? 'true' : 'false' ; ?>
1430
- });
1431
- <?php
1432
- break;
1433
-
1434
- case 'video/mp4':
1435
- $banner_url = get_option('niteoCS_video_file_url');
1436
- $banner_url = wp_get_attachment_url( $banner_url ); ?>
1437
- var myBackground = new vidim( '#player', {
1438
- src: [
1439
- {
1440
- type: 'video/mp4',
1441
- src: '<?php echo esc_url( $banner_url ); ?>',
1442
- },
1443
- ],
1444
- poster: '<?php echo esc_url( $video_poster ); ?>',
1445
- loop: <?php echo $video_autoloop ? 'true' : 'false' ; ?>
1446
- });
1447
- <?php
1448
- break;
1449
- default:
1450
- break;
1451
- } ?>
1452
- </script>
1453
- <?php
1454
- break;
1455
-
1456
- // SLIDER SCRIPTS FOR UNSPLASH or Custom IMAGES
1457
- case '0':
1458
- case '1':
1459
- $slider = get_option('niteoCS_slider', '0');
1460
-
1461
- if ( $slider == '1' ) {
1462
- $slider_effect = get_option('niteoCS_slider_effect', 'true');
1463
- $slider_autoplay = get_option('niteoCS_slider_auto', '1');
1464
-
1465
- switch ( $slider_effect ) {
1466
- // slice effect scripts
1467
- case 'slice':
1468
- ?>
1469
- <script src='<?php echo plugins_url('js/external/imagesloaded.pkgd.min.js', __DIR__);?>'></script>
1470
- <script src='<?php echo plugins_url('js/external/anime.min.js', __DIR__);?>'></script>
1471
- <script src='<?php echo plugins_url('js/external/uncover.js', __DIR__);?>'></script>
1472
- <script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/slice.js';?>'></script>
1473
- <?php
1474
- break;
1475
-
1476
- // mask transition effect scripts
1477
- case 'mask-transition':
1478
- if ( !$jquery ) {
1479
- echo '<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" Crossorigin="anonymous"></script>';
1480
- $jquery = TRUE;
1481
- } ?>
1482
- <script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/modernizr-custom.js';?>'></script>
1483
- <script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/imagesloaded.pkgd.min.js';?>'></script>
1484
- <script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/mask-transition.js';?>'></script>
1485
-
1486
- <?php
1487
- break;
1488
-
1489
- case 'train':
1490
- break;
1491
-
1492
- // default (true, false) means slick carousel scripts
1493
- default:
1494
- if ( !$jquery ) {
1495
- echo '<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" Crossorigin="anonymous"></script>';
1496
- $jquery = TRUE;
1497
- } ?>
1498
- <!-- slick carousel script -->
1499
- <script src='https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.js'></script>
1500
- <script>
1501
- $('#slider').slick({
1502
- slide: '.slide',
1503
- slidesToShow: 1,
1504
- arrows: false,
1505
- fade: <?php echo esc_attr( $slider_effect );?>,
1506
- speed: 1000,
1507
- autoplay: <?php echo esc_attr( $slider_autoplay );?>,
1508
- autoplaySpeed: 7000,
1509
- });
1510
-
1511
- $('.prev').click(function() {
1512
- $('#slider').slick('slickPrev');
1513
- });
1514
-
1515
- $('.next').click(function() {
1516
- $('#slider').slick('slickNext');
1517
- });
1518
-
1519
- // custom dots navigation
1520
- $('.slide-number').click(function() {
1521
- $('#slider').slick('slickGoTo', parseInt($(this).data('slide')) );
1522
-
1523
- });
1524
-
1525
- // update custom dots on change
1526
- $('#slider').on('beforeChange', function(event, slick, currentSlide, nextSlide){
1527
- $('.slide-number').removeClass('active');
1528
- $('[data-slide="' + nextSlide + '"]').addClass('active');
1529
- });
1530
-
1531
- </script>
1532
- <?php
1533
- break;
1534
- }
1535
-
1536
- }
1537
-
1538
- break;
1539
-
1540
- default:
1541
- break;
1542
- }
1543
-
1544
- // render redirect script if CMP is in redirect mode
1545
- if ( $this->cmp_mode() == 3 ) {
1546
- $url = get_option('niteoCS_URL_redirect');
1547
- $time = get_option('niteoCS_redirect_time'); ?>
1548
-
1549
- <script>
1550
- setTimeout(function() {
1551
- window.location.href = "<?php echo esc_url( $url );?>";
1552
- }, <?php echo esc_attr( $time * 1000 );?>);
1553
- </script>
1554
-
1555
- <?php
1556
- }
1557
-
1558
- // check for CMP Subscribe shortcode to include CF7 captcha
1559
- $subscribe = get_option('niteoCS_subscribe_type');
1560
- $sub_cf7 = false;
1561
- if ( $subscribe == '1' ) {
1562
- $subscribe_code = get_option('niteoCS_subscribe_code');
1563
- if ( strpos($subscribe_code, 'contact-form-7') !== false ) {
1564
- $sub_cf7 = true;
1565
- }
1566
- }
1567
-
1568
- // include jquery and CF7 scripts for CF7 themes or themes using CF7 for subscribe form
1569
- if ( (in_array( $themeslug, $this->cmp_cf7_themes() ) && get_option('niteoCS_contact_form_type') == 'cf7') || $sub_cf7 === true ) {
1570
-
1571
- $site_url = str_replace( '/', '\/', site_url() );
1572
-
1573
- if ( !$jquery ) {
1574
- echo '<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" Crossorigin="anonymous"></script>';
1575
- $jquery = TRUE;
1576
- }
1577
-
1578
- if ( class_exists('WPCF7') ) {
1579
- $sitekeys = WPCF7::get_option( 'recaptcha');
1580
- if ( $sitekeys ) {
1581
- $sitekeys = array_keys( $sitekeys ); ?>
1582
- <!-- CF7 Recaptcha script -->
1583
- <script type='text/javascript' src='https://www.google.com/recaptcha/api.js?render=<?php echo esc_attr($sitekeys[0]);?>&#038;ver=3.0'></script>
1584
- <script>!function(e,t){var a=function(){e.execute("<?php echo esc_attr($sitekeys[0]);?>",{action:"homepage"}).then(function(e){for(var t=document.getElementsByTagName("form"),a=0;a<t.length;a++)for(var n=t[a].getElementsByTagName("input"),r=0;r<n.length;r++){var c=n[r];if("g-recaptcha-response"===c.getAttribute("name")){c.setAttribute("value",e);break}}})};e.ready(a),document.addEventListener("wpcf7submit",a,!1)}(grecaptcha);</script>
1585
- <?php
1586
- } ?>
1587
-
1588
- <script type='text/javascript'>
1589
- /* <![CDATA[ */
1590
- var wpcf7 = {"apiSettings":{"root":"<?php echo $site_url;?>\/index.php?rest_route=\/contact-form-7\/v1","namespace":"contact-form-7\/v1"}};
1591
- /* ]]> */
1592
- </script>
1593
- <script src='<?php echo plugins_url('contact-form-7/includes/js/scripts.js?ver=5.0.1');?>'></script>
1594
- <?php
1595
- }
1596
- }
1597
-
1598
- // special effects scripts for premium themes
1599
- if ( in_array( $themeslug, $this->cmp_premium_themes_installed() ) ) {
1600
-
1601
- $effect = get_option('niteoCS_special_effect', 'disabled');
1602
-
1603
- // change effect for preview
1604
- if ( isset($_GET['effect']) && is_numeric($_GET['effect'])) {
1605
- $effect = $_GET['effect'];
1606
- }
1607
-
1608
- switch ( $effect ) {
1609
- case 'constellation':
1610
- case '1': ?>
1611
- <!-- load external Particles script -->
1612
- <script src="//cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
1613
- <!-- INI particles -->
1614
- <script>
1615
- <?php
1616
- if ( $themeslug === 'libra' ) { ?>
1617
- var wrapper = document.getElementById('body');
1618
- var background= 'body';
1619
- <?php
1620
- } else { ?>
1621
- var wrapper=document.getElementById("background-wrapper");
1622
- var background=(null===wrapper)?"slider-wrapper":"background-wrapper";
1623
- <?php
1624
- } ?>
1625
- particlesJS(background,{particles:{number:{value:100,density:{enable:!0,value_area:1e3}},color:{value:"<?php echo esc_attr( get_option('niteoCS_special_effect[constellation][color]', '#ffffff') );?>"},shape:{type:"circle",stroke:{width:0,color:"#fff"},polygon:{nb_sides:5}},opacity:{value:.6,random:!1,anim:{enable:!1,speed:1,opacity_min:.1,sync:!1}},size:{value:2,random:!0,anim:{enable:!1,speed:40,size_min:.1,sync:!1}},line_linked:{enable:!0,distance:120,color:"<?php echo esc_attr( get_option('niteoCS_special_effect[constellation][color]', '#ffffff') );?>",opacity:.4,width:1}},interactivity:{detect_on:"canvas",events:{onhover:{enable:!0,mode:"grab"},onclick:{enable:!1},resize:!0},modes:{grab:{distance:140,line_linked:{opacity:1}},bubble:{distance:400,size:40,duration:2,opacity:8,speed:3},repulse:{distance:200,duration:.4},push:{particles_nb:4},remove:{particles_nb:2}}},retina_detect:!0});
1626
- </script>
1627
- <?php
1628
- break;
1629
-
1630
- case 'bubbles':
1631
- case '2':
1632
- if ( !$jquery ) {
1633
- echo '<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" Crossorigin="anonymous"></script>';
1634
- $jquery = TRUE;
1635
- } ?>
1636
- <!-- INI bubbles -->
1637
- <script>
1638
- <?php
1639
- if ( $themeslug === 'libra' ) { ?>
1640
- var $wrapper = $('#body');
1641
- <?php
1642
- } else { ?>
1643
- var $wrapper=$("#background-wrapper").length?$("#background-wrapper"):$("#slider-wrapper")
1644
- <?php
1645
- } ?>
1646
- $wrapper.append("<canvas></canvas><canvas></canvas><canvas></canvas>"),function(a){var e=$wrapper.children("canvas"),n=e[0],r=e[1],i=e[2],o={circle:{amount:18,layer:3,color:[<?php echo $this->hex2rgba( get_option('niteoCS_special_effect[constellation][color]', '#ffffff') );?>],alpha:.3},line:{amount:12,layer:3,color:[<?php echo $this->hex2rgba( get_option('niteoCS_special_effect[constellation][color]', '#ffffff') );?>],alpha:.3},speed:.5,angle:20};if(n.getContext){n.getContext("2d");var t,l,c,d=r.getContext("2d"),m=i.getContext("2d"),w=window.Math,s=o.angle/360*w.PI*2,p=[],u=[];requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(a,e){setTimeout(a,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||window.oCancelAnimationFrame||clearTimeout;var h=function(){t=a(window).width(),l=a(window).height(),e.each(function(){this.width=t,this.height=l})},v=function(){var a,e,n,r,i,h,f,y,g,A,F,C,b,x,q=w.sin(s),R=w.cos(s);if(o.circle.amount>0&&o.circle.layer>0){d.clearRect(0,0,t,l);for(var k=0,S=p.length;k<S;k++){var $=(I=p[k]).x,P=I.y,T=I.radius,z=I.speed;$>t+T?$=-T:$<-T?$=t+T:$+=q*z,P>l+T?P=-T:P<-T?P=l+T:P-=R*z,I.x=$,I.y=P,a=$,e=P,n=T,r=I.color,i=I.alpha,h=void 0,(h=d.createRadialGradient(a,e,n,a,e,0)).addColorStop(0,"rgba("+r[0]+","+r[1]+","+r[2]+","+i+")"),h.addColorStop(1,"rgba("+r[0]+","+r[1]+","+r[2]+","+(i-.1)+")"),d.beginPath(),d.arc(a,e,n,0,2*w.PI,!0),d.fillStyle=h,d.fill()}}if(o.line.amount>0&&o.line.layer>0){m.clearRect(0,0,t,l);var G=0;for(S=u.length;G<S;G++){$=(I=u[G]).x,P=I.y;var I,j=I.width;z=I.speed;$>t+j*q?$=-j*q:$<-j*q?$=t+j*q:$+=q*z,P>l+j*R?P=-j*R:P<-j*R?P=l+j*R:P-=R*z,I.x=$,I.y=P,f=$,y=P,g=j,A=I.color,F=I.alpha,void 0,void 0,x=void 0,C=f+w.sin(s)*g,b=y-w.cos(s)*g,(x=m.createLinearGradient(f,y,C,b)).addColorStop(0,"rgba("+A[0]+","+A[1]+","+A[2]+","+F+")"),x.addColorStop(1,"rgba("+A[0]+","+A[1]+","+A[2]+","+(F-.1)+")"),m.beginPath(),m.moveTo(f,y),m.lineTo(C,b),m.lineWidth=3,m.lineCap="round",m.strokeStyle=x,m.stroke()}}c=requestAnimationFrame(v)},f=function(){if(p=[],u=[],o.circle.amount>0&&o.circle.layer>0)for(var a=0;a<o.circle.amount/o.circle.layer;a++)for(var e=0;e<o.circle.layer;e++)p.push({x:w.random()*t,y:w.random()*l,radius:w.random()*(20+5*e)+(20+5*e),color:o.circle.color,alpha:.2*w.random()+(o.circle.alpha-.1*e),speed:o.speed*(1+.5*e)});if(o.line.amount>0&&o.line.layer>0)for(var n=0;n<o.line.amount/o.line.layer;n++)for(var r=0;r<o.line.layer;r++)u.push({x:w.random()*t,y:w.random()*l,width:w.random()*(20+5*r)+(20+5*r),color:o.line.color,alpha:.2*w.random()+(o.line.alpha-.1*r),speed:o.speed*(1+.5*r)});cancelAnimationFrame(c),c=requestAnimationFrame(v)};a(document).ready(function(){h(),f()}),a(window).resize(function(){h(),f()})}}(jQuery);
1647
- </script>
1648
- <?php
1649
- break;
1650
-
1651
- default:
1652
- break;
1653
- }
1654
- }
1655
-
1656
- // check if content includes iframe, and if yes, include full-width video resize script
1657
- $content = $this->cmp_get_body();
1658
-
1659
- if ( strpos( $content, 'iframe' ) !== false ) { ?>
1660
- <!-- Script for full-width size of embedded UT and VIMEO Iframes -->
1661
- <script>
1662
- (function ( window, document, undefined ) {
1663
- var iframes = document.getElementsByTagName( 'iframe' );
1664
- for ( var i = 0; i < iframes.length; i++ ) {
1665
- var iframe = iframes[i],
1666
- players = /www.youtube.com|player.vimeo.com/;
1667
- if ( iframe.src.search( players ) > 0 ) {
1668
- var videoRatio = ( iframe.height / iframe.width ) * 100;
1669
- iframe.style.position = 'absolute';
1670
- iframe.style.top = '0';
1671
- iframe.style.left = '0';
1672
- iframe.width = '100%';
1673
- iframe.height = '100%';
1674
- var wrap = document.createElement( 'div' );
1675
- wrap.className = 'fluid-vids';
1676
- wrap.style.width = '100%';
1677
- wrap.style.position = 'relative';
1678
- wrap.style.paddingTop = videoRatio + '%';
1679
- var iframeParent = iframe.parentNode;
1680
- iframeParent.className = 'video-paragraph';
1681
- iframeParent.insertBefore( wrap, iframe );
1682
- wrap.appendChild( iframe );
1683
- }
1684
- }
1685
- })( window, document );
1686
- </script>
1687
- <?php
1688
- }
1689
-
1690
- $footer_scripts = json_decode( get_option('niteoCS_footer_scripts', '[]'), true );
1691
-
1692
- if ( !empty( $footer_scripts ) ) {
1693
- foreach ( $footer_scripts as $f_script ) {
1694
- if ( $f_script != '' ) {
1695
- $file = pathinfo( $f_script );
1696
- switch ( $file['extension'] ) {
1697
- case 'js':
1698
- echo '<script src="' . esc_url( $f_script ). '"></script>' . PHP_EOL;
1699
- break;
1700
- case 'css':
1701
- echo '<link href="' . esc_url( $f_script ). '" rel="stylesheet">' . PHP_EOL;
1702
- break;
1703
- default:
1704
- break;
1705
- }
1706
- }
1707
- }
1708
- }
1709
-
1710
- do_action('cmp-after-footer-scripts');
1711
-
1712
- $this->cmp_wp_footer();
1713
-
1714
- // render nt&cmp notes
1715
- echo $this->cmp_render_nt_info();
1716
 
1717
  return false;
1718
  }
@@ -1724,24 +212,8 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
1724
  * @return HTML
1725
  **/
1726
  public function cmp_contact_form() {
1727
- $form_type = get_option('niteoCS_contact_form_type', 'cf7');
1728
 
1729
- if ( $form_type == 'disabled' ) {
1730
- return false;
1731
- }
1732
-
1733
- $form_id = get_option('niteoCS_contact_form_id', '');
1734
-
1735
- switch ( $form_type ) {
1736
- case 'cf7':
1737
- $replace = array('<p>', '</p>' );
1738
- $html = str_replace( $replace, '', do_shortcode('[contact-form-7 id='.$form_id.']') ) ;
1739
- break;
1740
-
1741
- default:
1742
- $html = '';
1743
- break;
1744
- }
1745
 
1746
  return $html;
1747
  }
@@ -1754,10 +226,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
1754
  **/
1755
  public function cmp_render_nt_info() {
1756
 
1757
- $html = '
1758
- <!-- Build by CMP – Coming Soon & Maintenance Plugin by NiteoThemes -->
1759
- <!-- Visit plugin page https://wordpress.org/plugins/cmp-coming-soon-maintenance/ -->
1760
- <!-- More CMP Themes on https://niteothemes.com -->';
1761
 
1762
  return $html;
1763
  }
@@ -1780,6 +249,51 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
1780
  return $banner_ids;
1781
  }
1782
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1783
  /**
1784
  * print whitelisted scripts and styles to cmp_head
1785
  *
@@ -1803,22 +317,44 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
1803
  **/
1804
  public function cmp_wp_footer() {
1805
 
1806
- /**
1807
- * Detect plugin. For use on Front End only.
1808
- */
1809
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1810
 
1811
- // Plugin Name: Insert Headers and Footers
1812
- if ( class_exists('InsertHeadersAndFooters') ) {
1813
- $ihaf = new InsertHeadersAndFooters();
1814
- $ihaf->frontendFooter();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1815
  }
1816
 
1817
- // Plugin Name: SimpleAnalytics
1818
- if ( is_plugin_active( 'simpleanalytics/simple-analytics.php' ) ) {
1819
- echo '<script src="https://cdn.simpleanalytics.io/hello.js"></script>' . PHP_EOL;
1820
- }
1821
-
1822
  }
1823
 
1824
  }
6
  */
7
  class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Maintenance {
8
 
9
+
10
+ function __construct() {
11
+ $this->jquery = FALSE;
12
+ }
13
  // Render Background
14
  public function cmp_background( $niteoCS_banner, $themeslug ) {
15
 
16
+ include dirname( __FILE__) . '/render/graphic-background.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  return $html;
19
  }
22
  // render slider
23
  public function cmp_slider( $themeslug ) {
24
 
25
+ include dirname( __FILE__) . '/render/graphic-slider.php';
26
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  return;
29
  }
36
  **/
37
  public function background_overlay( $themeslug ) {
38
 
39
+ include dirname( __FILE__) . '/render/graphic-overlay.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  return $html;
42
  }
49
  * @return HTML
50
  **/
51
  public function background_text_overlay( $themeslug ) {
 
 
 
 
 
 
 
 
 
 
 
52
 
53
+ include dirname( __FILE__) . '/render/text-overlay.php';
 
 
54
 
55
+ return $html;
56
 
57
  }
58
 
60
  // render Social Icons
61
  public function cmp_social_icons( $mode = 'icon', $title = false, $themeslug = false, $ulclass = '', $liclass = '' ) {
62
 
63
+ include dirname( __FILE__) . '/render/social-icons.php';
 
 
64
 
65
+ return $html;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
  }
68
 
69
  // Render Logo
70
  public function cmp_logo( $themeslug, $class = '' ) {
71
 
72
+ include dirname( __FILE__) . '/render/logo.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  return $html;
75
  }
77
 
78
  // render subscribe form
79
  public function cmp_subscribe_form( $label = FALSE, $firstname = FALSE, $lastname = FALSE ) {
80
+ include dirname( __FILE__) . '/render/subscribe-form.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
  return $html;
83
 
91
  **/
92
  public function cmp_get_body() {
93
 
94
+ include dirname( __FILE__) . '/render/content.php';
 
 
 
 
 
 
95
 
96
+ return $html;
97
  }
98
 
99
  /**
103
  * @return HTML
104
  **/
105
  public function cmp_get_title( $class = '' ) {
 
106
 
107
+ include dirname( __FILE__) . '/render/title.php';
108
 
109
+ return $html;
 
 
 
 
 
 
 
 
 
110
 
111
  }
112
 
118
  * @return HTML
119
  **/
120
  public function cmp_get_fonts( $heading_font = array(), $content_font = array() ) {
 
 
 
 
 
 
121
 
122
+ include dirname( __FILE__) . '/render/fonts.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
 
124
  return $google_fonts . PHP_EOL . $custom_font . PHP_EOL;
125
  }
126
 
127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
 
129
 
130
  /**
131
  * render theme head SEO.
134
  * @return HTML
135
  **/
136
  public function cmp_get_seo() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
+ include dirname( __FILE__) . '/render/seo.php';
 
 
 
 
139
 
140
  return $html;
141
  }
148
  **/
149
  public function cmp_get_custom_css() {
150
 
151
+ include dirname( __FILE__) . '/render/custom-css.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
 
153
  return $css;
154
  }
160
  * @return HTML
161
  **/
162
  public function cmp_get_copyright() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
 
164
+ include dirname( __FILE__) . '/render/copyright.php';
165
+
166
+ return $html;
167
  }
168
 
169
  /**
173
  **/
174
  public function cmp_enqueue_styles( $themeslug = 'hardwork', $font_ani = false, $slider = '0', $banner_type = '2', $fa = false, $gutenberg = false ) {
175
 
176
+ include dirname( __FILE__) . '/render/enqueue-styles.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
 
178
+ return;
 
 
179
 
180
  }
181
 
186
  **/
187
  public function cmp_head_scripts() {
188
 
189
+ include dirname( __FILE__) . '/render/head-scripts.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
 
191
  return;
192
  }
200
  **/
201
  public function cmp_javascripts( $background, $themeslug ) {
202
 
203
+ include dirname( __FILE__) . '/render/javascripts.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
 
205
  return false;
206
  }
212
  * @return HTML
213
  **/
214
  public function cmp_contact_form() {
 
215
 
216
+ include dirname( __FILE__) . '/render/contact-form.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
 
218
  return $html;
219
  }
226
  **/
227
  public function cmp_render_nt_info() {
228
 
229
+ include dirname( __FILE__) . '/render/niteothemes-info.php';
 
 
 
230
 
231
  return $html;
232
  }
249
  return $banner_ids;
250
  }
251
 
252
+ /**
253
+ * helper function to render style css for custom fonts
254
+ *
255
+ * @since 3.5
256
+ * @param string,array
257
+ * @return HTML
258
+ **/
259
+ public function cmp_get_font_src( $family, $ids ) {
260
+
261
+ foreach ( $ids as $attachment_id ) {
262
+
263
+ $url = wp_get_attachment_url($attachment_id);
264
+ $ext = pathinfo($url, PATHINFO_EXTENSION);
265
+ $new_src = '';
266
+
267
+ switch ($ext) {
268
+ case 'eot':
269
+ $eot = 'src: url("'.esc_url($url).'");' . PHP_EOL;
270
+ break;
271
+ case 'woff':
272
+ $new_src = 'url("'.esc_url($url).'")' . ' format("woff"),';
273
+ break;
274
+ case 'woff2':
275
+ $new_src = 'url("'.esc_url($url).'")' . ' format("woff2"),';
276
+ break;
277
+ case 'otf':
278
+ $new_src = 'url("'.esc_url($url).'")' . ' format("opentype"),';
279
+ break;
280
+ case 'ttf':
281
+ $new_src = 'url("'.esc_url($url).'")' . ' format("truetype"),';
282
+ break;
283
+ case 'svg':
284
+ $new_src = 'url("'.esc_url($url).'#filename")' . ' format("svg"),';
285
+ break;
286
+ default:
287
+ break;
288
+ }
289
+
290
+ $src .= $new_src;
291
+ }
292
+
293
+ return '<style>'. PHP_EOL .'@font-face {font-family: "'.$family.'";' . PHP_EOL . $eot . 'src: ' . rtrim( $src, ',').';}'. PHP_EOL .'</style>';
294
+
295
+ }
296
+
297
  /**
298
  * print whitelisted scripts and styles to cmp_head
299
  *
317
  **/
318
  public function cmp_wp_footer() {
319
 
320
+ include dirname( __FILE__) . '/render/footer.php';
 
 
 
321
 
322
+ return;
323
+ }
324
+
325
+ /**
326
+ * Helper function to return subscribe type
327
+ *
328
+ * @since 3.6.5
329
+ * @access public
330
+ * @return int
331
+ */
332
+ public function cmp_subscribe_type() {
333
+ $subscribe_type = get_option('niteoCS_subscribe_type', '2');
334
+ if ( $subscribe_type == '3' ) {
335
+ $optin_type = $this->mailoptin_campaign_type();
336
+ $subscribe_type = $optin_type === 'lightbox' ? '0' : $subscribe_type;
337
+ }
338
+
339
+ return $subscribe_type;
340
+ }
341
+
342
+ /**
343
+ * Helper function to determine MailOptin campaign type
344
+ *
345
+ * @since 3.6.5
346
+ * @access public
347
+ * @return string
348
+ */
349
+ public function mailoptin_campaign_type() {
350
+
351
+ if ( class_exists('MailOptin\Core\Repositories\OptinCampaignsRepository') ) {
352
+ $campaign_id = get_option('niteoCS_mailoptin_selected');
353
+ $campaign = MailOptin\Core\Repositories\OptinCampaignsRepository::get_optin_campaign_by_id($campaign_id);
354
+ return $campaign['optin_type'];
355
  }
356
 
357
+ return false;
 
 
 
 
358
  }
359
 
360
  }
inc/render/contact-form.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $form_type = get_option('niteoCS_contact_form_type', 'cf7');
4
+
5
+ if ( $form_type == 'disabled' ) {
6
+ return false;
7
+ }
8
+
9
+ $form_id = get_option('niteoCS_contact_form_id', '');
10
+
11
+ switch ( $form_type ) {
12
+ case 'cf7':
13
+ $replace = array('<p>', '</p>' );
14
+ $html = str_replace( $replace, '', do_shortcode('[contact-form-7 id='.$form_id.']') ) ;
15
+ break;
16
+
17
+ default:
18
+ $html = '';
19
+ break;
20
+ }
inc/render/content.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $html = stripslashes( get_option('niteoCS_body', '') );
4
+
5
+ if ( isset($GLOBALS['wp_embed']) ) {
6
+ $html = $GLOBALS['wp_embed']->autoembed( $html );
7
+ }
8
+
9
+ $html = wpautop( do_shortcode( $html ) );
inc/render/copyright.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( get_option( 'niteoCS_copyright', 'Made by <a href="https://niteothemes.com">NiteoThemes</a> with love.' ) !== '' ) {
4
+ $copyright = stripslashes( get_option('niteoCS_copyright', 'Made by <a href="https://niteothemes.com">NiteoThemes</a> with love.') );
5
+ $allowed_html = array(
6
+ 'a' => array(
7
+ 'href' => array(),
8
+ 'title' => array(),
9
+ 'target' => array(),
10
+ ),
11
+ 'br' => array(),
12
+ 'em' => array(),
13
+ 'strong' => array(),
14
+ );
15
+
16
+ $html = '<p class="copyright">' . wp_kses( $copyright, $allowed_html ) . '</p>';
17
+
18
+ }
inc/render/custom-css.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php
3
+
4
+ $css = '';
5
+
6
+ $themeslug = $this->cmp_selectedTheme();
7
+
8
+ if ( isset($_GET['theme']) && !empty($_GET['theme']) ) {
9
+ $themeslug = esc_attr($_GET['theme']);
10
+ }
11
+
12
+ $banner = get_option('niteoCS_banner', '2');
13
+
14
+ if ( isset( $_GET['background'] ) && !empty($_GET['background']) ) {
15
+ $banner = esc_attr( $_GET['background'] );
16
+
17
+ if ( $themeslug === 'pluto' && $banner === '4' ) {
18
+ $banner = '2';
19
+ }
20
+ }
21
+
22
+ // add CMP CSS to all themes
23
+ ob_start();
24
+
25
+ // add blur effect if enabled
26
+ $blur = get_option('niteoCS_effect_blur', '0.0');
27
+
28
+ if ( $blur != '0.0' ) {
29
+ ?>
30
+ <!-- blur effect -->
31
+ <style>
32
+ #background-image,
33
+ .slide-background,
34
+ .video-banner {filter:blur(<?php echo esc_attr($blur);?>px);}
35
+ #background-image,
36
+ .video-banner,
37
+ .background-overlay,
38
+ .slide-background {transform:scale(1.1);}
39
+ #background-wrapper, #slider-wrapper {overflow:hidden;}
40
+ #background-image:not(.slide) {background-attachment: initial;}
41
+ </style>
42
+
43
+ <?php
44
+ } ?>
45
+
46
+ <style>
47
+ /* wp video shortcode */
48
+ .wp-video {margin: 0 auto;}
49
+ .wp-video-shortcode {max-width: 100%;}
50
+ /* google recaptcha badge */
51
+ .grecaptcha-badge {display: none;}
52
+ </style>
53
+
54
+ <?php
55
+ if ( get_option('niteoCS_logo_custom_size', '0') !== '0' ) { ?>
56
+ <!-- custom logo height -->
57
+ <style>
58
+ @media screen and (min-width:1024px) {
59
+ .logo-wrapper img {max-height: <?php echo esc_attr(get_option('niteoCS_logo_size', '0'));?>px}
60
+ }
61
+ </style>
62
+ <?php
63
+ }
64
+
65
+ // CHAMELEON BACKGROUND STYLES
66
+ if ( $themeslug === 'pluto' && $banner === '2' ): ?>
67
+ <style>
68
+ #background-image {
69
+ -webkit-animation: chameleon 19s infinite;
70
+ animation: chameleon 19s infinite;
71
+ }
72
+ @-webkit-keyframes chameleon {
73
+ 0% {background: #2ecc71;}
74
+ 25% { background: #f1c40f;}
75
+ 50% { background: #e74c3c;}
76
+ 75% {background: #3498db;}
77
+ 100% {background: #2ecc71;}
78
+ }
79
+ @keyframes chameleon {
80
+ 0% {background: #2ecc71; }
81
+ 25% {background: #f1c40f;}
82
+ 50% {background: #e74c3c;}
83
+ 75% {background: #3498db;}
84
+ 100% {background: #2ecc71;}
85
+ }
86
+ </style>
87
+ <?php endif;?>
88
+
89
+ <?php
90
+ // check for premium themes special effects
91
+ if ( in_array( $themeslug, $this->cmp_premium_themes_installed() ) ) {
92
+
93
+ $effect = get_option('niteoCS_special_effect', 'disabled');
94
+
95
+ // change effect for preview
96
+ if ( isset($_GET['effect']) && is_numeric($_GET['effect'])) {
97
+ $effect = $_GET['effect'];
98
+ }
99
+
100
+ switch ( $effect ) {
101
+ case 'constellation':
102
+ case '1': ?>
103
+ <!-- constellation effect -->
104
+ <style>
105
+ .particles-js-canvas-el {position: absolute; top:0; left:0;}
106
+ <?php
107
+ switch ( $themeslug ) {
108
+ case 'frame': ?>
109
+ .particles-js-canvas-el {z-index: -1;}
110
+ #background-image, .video-banner {z-index: -3;}
111
+ .background-overlay {z-index: -2;}
112
+ <?php
113
+ break;
114
+
115
+ case 'stylo':
116
+ case 'eclipse': ?>
117
+ .particles-js-canvas-el {z-index: 1;}
118
+ <?php
119
+ break;
120
+ default:
121
+ break;
122
+ } ?>
123
+ </style>
124
+ <?php
125
+ break;
126
+
127
+ case 'bubbles':
128
+ case '2': ?>
129
+ <!-- constellation effect -->
130
+ <style>
131
+ canvas {position: absolute; top:0; left:0;}
132
+ </style>
133
+ <?php
134
+ break;
135
+
136
+ default:
137
+ break;
138
+ }
139
+ }
140
+
141
+ $css = ob_get_clean();
142
+
143
+ $custom_css = ( get_option('niteoCS_custom_css', '') != '' ) ? '<style>'.stripslashes( wp_filter_nohtml_kses( get_option('niteoCS_custom_css') ) ).'</style>' : '';
144
+
145
+ $css .= $custom_css;
inc/render/enqueue-styles.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $ver = $this->cmp_theme_version( $themeslug );
4
+
5
+ if ( $gutenberg === true ) {
6
+ echo '<link rel="stylesheet" href="'.includes_url('/css/dist/block-library/style.min.css').'" type="text/css" media="all" />' . PHP_EOL;
7
+ }
8
+
9
+ // theme stylesheet
10
+ echo '<link rel="stylesheet" href="' . $this->cmp_themeURL( $themeslug ) . $themeslug.'/style.css?v='.$ver . '" type="text/css" media="all">' . PHP_EOL;
11
+
12
+ if ( $font_ani !== false || $font_ani !== 'none' ) {
13
+ echo '<link rel="stylesheet" href="'. esc_url( $this->cmp_asset_url('/css/animate.min.css') ) . '">' . PHP_EOL;
14
+ }
15
+
16
+ if ( $slider == '1' && ($banner_type == '0' || $banner_type == '1') ) {
17
+ echo '<link href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css" rel="stylesheet">' . PHP_EOL;
18
+ }
19
+
20
+ if ( $fa === true ) {
21
+ echo '<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" >' . PHP_EOL;
22
+ }
inc/render/fonts.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $custom = '';
3
+ $google_fonts = '';
4
+ $custom_font = '';
5
+
6
+ // get google fonts html
7
+ if ( $heading_font['variant'] !== 'Not Applicable' || $content_font['variant'] !== 'Not Applicable' ) {
8
+
9
+ // get fonts subset
10
+ $google_fonts = $this->cmp_get_google_fonts();
11
+ $heading_break = FALSE;
12
+ $content_break = FALSE;
13
+
14
+ foreach ( $google_fonts as $font => $val ) {
15
+
16
+ if ( $val['text'] == $heading_font['family'] ) {
17
+ $heading_subsets = $val['subset'];
18
+ $heading_break = TRUE;
19
+ }
20
+
21
+ if ( $val['text'] == $content_font['family'] ) {
22
+ $content_subsets = $val['subset'];
23
+ $content_break = TRUE;
24
+ }
25
+
26
+ if ( $heading_break === TRUE && $content_break === TRUE ) {
27
+ break;
28
+ }
29
+ }
30
+
31
+ if ( $heading_subsets === null || $content_subsets === null ) {
32
+ $subset = ($heading_subsets === null) ? $content_subsets : $heading_subsets;
33
+ $subset = ($content_subsets === null) ? $heading_subsets : $content_subsets;
34
+
35
+ } else {
36
+ $subset = array_unique( array_merge( $heading_subsets, $content_subsets ) );
37
+ }
38
+
39
+ if ( $heading_font['variant'] !== 'Not Applicable' ) {
40
+ $heading = esc_attr( str_replace(' ', '+', $heading_font['family']) ) .':'. esc_attr(str_replace('italic', 'i', $heading_font['variant'] ));
41
+ }
42
+
43
+ if ( $content_font['variant'] !== 'Not Applicable' ) {
44
+ $content = esc_attr( str_replace(' ', '+', $content_font['family']) ) .':400,700,'. esc_attr(str_replace('italic', '', $content_font['variant'] ));
45
+ }
46
+
47
+ $separator = ( $heading !== null && $content !== null ) ? '%7C' : '';
48
+
49
+
50
+ $google_fonts = '<link href="https://fonts.googleapis.com/css?family='. $heading . $separator . $content .'&amp;subset=' . implode(',', $subset) . '" rel="stylesheet">';
51
+
52
+ }
53
+
54
+ // get custom font html
55
+ if ( $heading_font['variant'] === 'Not Applicable' || $content_font['variant'] === 'Not Applicable' ) {
56
+
57
+ $custom_fonts = json_decode(get_option('niteoCS_custom_fonts'), true);
58
+ $custom_font = '';
59
+
60
+ foreach ( $custom_fonts as $custom ) {
61
+
62
+ if ( $custom['id'] === $heading_font['family'] ) {
63
+ if ( is_array($custom['ids']) ) {
64
+ $custom_font .= $this->cmp_get_font_src( $heading_font['family'], $custom['ids'] );
65
+ }
66
+ }
67
+
68
+
69
+ if ( $custom['id'] === $content_font['family'] ) {
70
+ if ( is_array($custom['ids']) ) {
71
+ $custom_font .= $this->cmp_get_font_src( $content_font['family'], $custom['ids'] );
72
+ }
73
+ }
74
+
75
+ }
76
+ }
inc/render/footer.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ * Detect plugin. For use on Front End only.
6
+ */
7
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
8
+
9
+ // Plugin Name: Insert Headers and Footers
10
+ if ( class_exists('InsertHeadersAndFooters') ) {
11
+ $ihaf = new InsertHeadersAndFooters();
12
+ $ihaf->frontendFooter();
13
+ }
14
+
15
+ // Plugin Name: SimpleAnalytics
16
+ if ( is_plugin_active( 'simpleanalytics/simple-analytics.php' ) ) {
17
+ echo '<script src="https://cdn.simpleanalytics.io/hello.js"></script>' . PHP_EOL;
18
+ }
19
+
20
+ // Plugin Name: SimpleAnalytics
21
+ if ( get_option('niteoCS_subscribe_type', '2') === '3' && defined('MAILOPTIN_VERSION_NUMBER') ) {
22
+
23
+ $optin_id = get_option('niteoCS_mailoptin_selected');
24
+ $campaign_type = MailOptin\Core\Repositories\OptinCampaignsRepository::get_optin_campaign_by_id($optin_id);
25
+
26
+ if ( $campaign_type['optin_type'] === 'lightbox') {
27
+ if ( !$this->jquery ) {
28
+ echo '<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" Crossorigin="anonymous"></script>';
29
+ $this->jquery = TRUE;
30
+ }
31
+ echo MailOptin\Core\Admin\Customizer\OptinForm\OptinFormFactory::build(absint($optin_id));
32
+ } ?>
33
+
34
+ <script type='text/javascript'>
35
+ /* <![CDATA[ */
36
+ var mailoptin_globals = {"mailoptin_ajaxurl":"?mailoptin-ajax=%%endpoint%%","is_customize_preview":"false","disable_impression_tracking":"false","sidebar":"0"};
37
+ /* ]]> */
38
+ </script>
39
+ <script type='text/javascript' src='<?php echo MAILOPTIN_ASSETS_URL;?>js/mailoptin.min.js?ver=<?php echo MAILOPTIN_VERSION_NUMBER;?>'></script>
40
+ <?php
41
+ }
inc/render/graphic-background.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $size = $this->isMobile() ? 'large' : 'full';
4
+ $html = '';
5
+
6
+ // change background if preview is set
7
+ if ( isset( $_GET['background'] ) && !empty($_GET['background']) ) {
8
+ $niteoCS_banner = $_GET['background'] == '1' ? 0 : esc_attr($_GET['background']);
9
+ }
10
+
11
+ switch ( $niteoCS_banner ) {
12
+ // custom media
13
+ case '0':
14
+ $banner_ids = $this->cmp_get_banner_ids();
15
+
16
+ if ( !empty($banner_ids) ) {
17
+ $banner_url = wp_get_attachment_image_src( $banner_ids[mt_rand(0, count( $banner_ids ) - 1)], $size);
18
+
19
+ if ( isset($banner_url[0]) ) {
20
+ $banner_url = $banner_url[0];
21
+ }
22
+
23
+ } else {
24
+ // send default image
25
+ $banner_url = $this->cmp_themeURL( $themeslug ).$themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
26
+ }
27
+
28
+ $html = '<div id="background-image" class="image" style="background-image:url(\''.esc_url( $banner_url ).'\')"></div>';
29
+ break;
30
+
31
+ case '1':
32
+ // unsplash
33
+ $background_class = 'image';
34
+ $unplash_feed = get_option('niteoCS_unsplash_feed', '3');
35
+
36
+ switch ( $unplash_feed ) {
37
+ // specific photo from id
38
+ case '0':
39
+ $params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0', '') );
40
+ $unsplash = $this->niteo_unsplash( $params );
41
+ break;
42
+
43
+ // random from user
44
+ case '1':
45
+ $params = array('feed' => '1', 'custom_str' => get_option('niteoCS_unsplash_1', '') );
46
+ $unsplash = $this->niteo_unsplash( $params );
47
+ break;
48
+
49
+ // random from collection
50
+ case '2':
51
+ $params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2', '') );
52
+ $unsplash = $this->niteo_unsplash( $params );
53
+ break;
54
+
55
+ // random photo
56
+ case '3':
57
+ $params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3', ''), 'feat' => get_option('niteoCS_unsplash_feat', '0') );
58
+ $unsplash = $this->niteo_unsplash( $params );
59
+ break;
60
+ default:
61
+ break;
62
+ }
63
+ // get raw url from response
64
+ if ( isset( $unsplash['response'] ) && $unsplash['response'] == '200' ) {
65
+ $body = json_decode ($unsplash['body'], true );
66
+
67
+ if ( isset( $body[0] ) ) {
68
+ foreach ( $body as $item ) {
69
+ $unsplash_download = $item['links']['download_location'];
70
+ }
71
+
72
+ } else {
73
+ $unsplash_download = $body['links']['download_location'];
74
+ }
75
+
76
+ switch ( $themeslug ) {
77
+ case 'element':
78
+ $width = 1;
79
+ $height = 0.6;
80
+ break;
81
+
82
+ default:
83
+ $width = 1;
84
+ $height = 1;
85
+ break;
86
+ }
87
+
88
+ ob_start(); ?>
89
+
90
+ <script>
91
+ var unsplash_download = '<?php echo esc_url( $unsplash_download );?>';
92
+
93
+ var width = document.getElementById('background-wrapper').offsetWidth * <?php echo esc_attr( $width );?>;
94
+ var height = document.getElementById('background-wrapper').offsetHeight * <?php echo esc_attr( $height );?>;
95
+ var dimension = 'w=' + width;
96
+ if ( width < height ) {
97
+ dimension = 'h=' + height;
98
+ }
99
+
100
+ var unsplash_url = '<?php echo esc_url( $unsplash_download );?>?client_id=41f043163758cf2e898e8a868bc142c20bc3f5966e7abac4779ee684088092ab';
101
+
102
+ fetch(unsplash_url, {
103
+ method: 'GET',
104
+ })
105
+ .then((res) => {
106
+ return res.json();
107
+ })
108
+ .then((data) => {
109
+
110
+ var imgContainer = '<div id="background-image" class="image" style="background-image:url()"></div>';
111
+
112
+ var image = document.createElement('div');
113
+
114
+ image.id = 'background-image';
115
+
116
+
117
+ var container = document.getElementById("background-wrapper");
118
+
119
+ if ( container == null ) {
120
+ container = document.getElementById("banner-wrapper");
121
+ }
122
+
123
+ container.insertAdjacentElement('afterbegin', image);
124
+
125
+ var unsplashImg = new Image();
126
+
127
+ unsplashImg.onload = function() {
128
+ image.className = 'image loaded';
129
+ image.style.backgroundImage = `url("${unsplashImg.src}")`;
130
+ }
131
+
132
+ unsplashImg.src = `${data.url}&fit=crop&${dimension}`;
133
+
134
+ })
135
+ .catch(function(error) { console.log(error.message); });
136
+ </script>
137
+ <?php
138
+
139
+ $html = ob_get_clean();
140
+ }
141
+
142
+ break;
143
+
144
+ case '2':
145
+ // default image
146
+ $banner_url = $this->cmp_themeURL( $themeslug ).$themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
147
+ $html = '<div id="background-image" class="image" style="background-image:url(\''.esc_url( $banner_url ).'\')"></div>';
148
+ break;
149
+
150
+ case '3':
151
+ // Pattern
152
+ $niteoCS_banner_pattern = get_option('niteoCS_banner_pattern', 'sakura');
153
+
154
+ if ( $niteoCS_banner_pattern != 'custom' ) {
155
+ $banner_url = plugins_url().'/cmp-coming-soon-maintenance/img/patterns/'.esc_attr( $niteoCS_banner_pattern ).'.png';
156
+
157
+ } else {
158
+ $banner_url = get_option('niteoCS_banner_pattern_custom');
159
+ $banner_url = wp_get_attachment_image_src( $banner_url, 'large' );
160
+ if ( isset($banner_url[0]) ){
161
+ $banner_url = $banner_url[0];
162
+ }
163
+ }
164
+ $html = '<div id="background-image" class="pattern" style="background-image:url(\''.esc_url( $banner_url ).'\')"></div>';
165
+ break;
166
+
167
+ case '4':
168
+ // Color
169
+ $color = get_option('niteoCS_banner_color', '#e5e5e5');
170
+
171
+ $html ='<div id="background-image" class="color loaded" style="background-color:'.esc_url( $color ).'"></div>';
172
+ break;
173
+
174
+ case '5':
175
+ $html = '<div id="player" class="video-banner"></div>';
176
+ break;
177
+
178
+ case '6':
179
+ // Gradient
180
+ $background_class = 'gradient';
181
+ $niteoCS_gradient = get_option('niteoCS_gradient', '#1A2980:#26D0CE');
182
+ if ( $niteoCS_gradient == 'custom' ) {
183
+ $niteoCS_gradient_one = get_option('niteoCS_banner_gradient_one', '#e5e5e5');
184
+ $niteoCS_gradient_two = get_option('niteoCS_banner_gradient_two', '#e5e5e5');
185
+ } else {
186
+ $gradient = explode(":", $niteoCS_gradient);
187
+ $niteoCS_gradient_one = $gradient[0];
188
+ $niteoCS_gradient_two = $gradient[1];
189
+ }
190
+
191
+
192
+ $html = '<div id="background-image" class="gradient loaded" style="background:-moz-linear-gradient(-45deg, '.esc_attr( $niteoCS_gradient_one ).' 0%, '.esc_attr( $niteoCS_gradient_two ).' 100%);background:-webkit-linear-gradient(-45deg, '.esc_attr( $niteoCS_gradient_one ).' 0%, '.esc_attr( $niteoCS_gradient_two ).' 100%);background:linear-gradient(135deg,'.esc_attr( $niteoCS_gradient_one ).' 0%, '.esc_attr( $niteoCS_gradient_two ).' 100%)"></div>';
193
+ break;
194
+
195
+ // CHAMELEON BACKGROUND
196
+ case '7':
197
+ $html ='<div id="background-image" class="color chameleon loaded"></div>';
198
+ break;
199
+
200
+ default:
201
+ break;
202
+ }
203
+
204
+ // add overlay to images/videos
205
+ if ( $niteoCS_banner != '4' && $niteoCS_banner != '6' && $niteoCS_banner != '7') {
206
+ $overlay = $this->background_overlay( $themeslug );
207
+ $html .= $overlay;
208
+ }
209
+
210
+ // add text overlay
211
+ $html .= $this->background_text_overlay( $themeslug );
inc/render/graphic-overlay.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $overlay = get_option('niteoCS_overlay', 'solid-color');
3
+ $opacity = get_option('niteoCS_overlay[opacity]', '0.4');
4
+ $color = get_option('niteoCS_overlay[color]', '#0a0a0a');
5
+ $html = '';
6
+
7
+ switch ( $overlay ) {
8
+ case 'solid-color':
9
+ $html = '<div class="background-overlay solid-color" style="background-color:'.esc_attr( $color ).';opacity:'.esc_attr( $opacity ).'"></div>';
10
+ break;
11
+
12
+ case 'gradient':
13
+ $overlay_gradient = get_option('niteoCS_overlay[gradient]', '#d53369:#cbad6d');
14
+
15
+ if ( $overlay_gradient == 'custom' ) {
16
+ $gradient_one = get_option('niteoCS_overlay[gradient_one]', '#e5e5e5');
17
+ $gradient_two = get_option('niteoCS_overlay[gradient_two]', '#e5e5e5');
18
+
19
+ } else {
20
+ $gradient = explode(":", $overlay_gradient);
21
+ $gradient_one = $gradient[0];
22
+ $gradient_two = $gradient[1];
23
+ }
24
+
25
+
26
+ $html = '<div class="background-overlay gradient" style="background:-moz-linear-gradient(-45deg, '.esc_attr( $gradient_one ).' 0%, '.esc_attr( $gradient_two ).' 100%);background:-webkit-linear-gradient(-45deg, '.esc_attr( $gradient_one ).' 0%, '.esc_attr( $gradient_two ).' 100%);background:linear-gradient(135deg,'.esc_attr( $gradient_one ).' 0%, '.esc_attr( $gradient_two ).' 100%);opacity:'.esc_attr( $opacity ).'"></div>';
27
+ break;
28
+
29
+ default:
30
+ break;
31
+ }
inc/render/graphic-slider.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // change background if preview is set
4
+ if ( isset( $_GET['background'] ) && $_GET['background'] !== '1' ) {
5
+ echo $this->cmp_background( $_GET['background'], $themeslug );
6
+ return;
7
+ }
8
+
9
+ $niteoCS_banner = get_option('niteoCS_banner', '1');
10
+ $slider_count = get_option('niteoCS_slider_count', '3');
11
+ $slider_effect = get_option('niteoCS_slider_effect', 'true');
12
+ $slider_autoplay = get_option('niteoCS_slider_auto', '1');
13
+ $size = $this->isMobile() ? 'large' : 'full';
14
+ $banner_ids = $this->cmp_get_banner_ids();
15
+
16
+ // break slider if only one custom image uploaded
17
+ if ( $niteoCS_banner == '0' && isset( $banner_ids ) && count( $banner_ids ) < 2 ) {
18
+ echo $this->cmp_background( '0', $themeslug ) ;
19
+ return false;
20
+ } ?>
21
+
22
+ <div id="slider-wrapper">
23
+
24
+ <div id="slider" class="slides effect-<?php echo esc_attr( $slider_effect );?>" data-autoplay="<?php echo esc_attr( $slider_autoplay );?>">
25
+ <?php
26
+ switch ( $niteoCS_banner ) {
27
+ // custom media
28
+ case '0':
29
+ if ( isset( $banner_ids ) ) {
30
+ foreach ( $banner_ids as $id ) {
31
+ $slide_url = wp_get_attachment_image_src( $id, $size);
32
+
33
+ if ( isset( $slide_url[0] ) ) {
34
+ $slide_url = $slide_url[0];
35
+ } ?>
36
+ <div class="slide">
37
+ <div class="slide-background" style="background-image:url('<?php echo esc_url( $slide_url ); ?>')"></div>
38
+ </div>
39
+ <?php
40
+ }
41
+ }
42
+ break;
43
+
44
+ // unsplash
45
+ case '1':
46
+ $unplash_feed = get_option('niteoCS_unsplash_feed', '3');
47
+
48
+ switch ( $unplash_feed ) {
49
+ // specific photo from id
50
+ case '0':
51
+ $params = array( 'feed' => '0', 'url' => get_option('niteoCS_unsplash_0', ''), 'count' => $slider_count );
52
+ $unsplash = $this->niteo_unsplash( $params );
53
+ break;
54
+
55
+ // random from user
56
+ case '1':
57
+ $params = array( 'feed' => '1', 'custom_str' => get_option('niteoCS_unsplash_1', ''), 'count' => $slider_count );
58
+ $unsplash = $this->niteo_unsplash( $params );
59
+ break;
60
+
61
+ // random from collection
62
+ case '2':
63
+ $params = array( 'feed' => '2', 'url' => get_option('niteoCS_unsplash_2', ''), 'count' => $slider_count );
64
+ $unsplash = $this->niteo_unsplash( $params );
65
+ break;
66
+
67
+ // random photo
68
+ case '3':
69
+ $params = array( 'feed' => '3', 'url' => get_option('niteoCS_unsplash_3', ''), 'feat' => get_option('niteoCS_unsplash_feat', '0'), 'count' => $slider_count );
70
+ $unsplash = $this->niteo_unsplash( $params );
71
+ break;
72
+
73
+ default:
74
+ break;
75
+ }
76
+
77
+ // get raw url from response
78
+ if ( isset( $unsplash['response'] ) && $unsplash['response'] == '200' ) {
79
+ $unsplash_body = json_decode($unsplash['body'], true);
80
+
81
+ $imgs = array();
82
+
83
+ if ( isset( $unsplash_body[0] ) ) {
84
+ foreach ( $unsplash_body as $item ) {
85
+ array_push( $imgs, $item['urls']['raw']);
86
+ }
87
+
88
+ } else {
89
+ $imgs[0] = $unsplash_body['urls']['raw'];
90
+ }
91
+
92
+ $imgs = json_encode( $imgs );
93
+
94
+ switch ( $themeslug ) {
95
+ case 'element':
96
+ $width = 1;
97
+ $height = 0.6;
98
+ break;
99
+
100
+ default:
101
+ $width = 1;
102
+ $height = 1;
103
+ break;
104
+ }
105
+ ?>
106
+
107
+ <script>
108
+ var imgs = <?php echo $imgs;?>;
109
+
110
+ var width = document.getElementById('slider-wrapper').offsetWidth * <?php echo $width;?>;
111
+ var height = document.getElementById('slider-wrapper').offsetHeight * <?php echo $height;?>;
112
+ var dimension = 'w=' + width;
113
+ if ( width < height ) {
114
+ dimension = 'h=' + height;
115
+ }
116
+ var query = '?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&' + dimension;
117
+ var img = '';
118
+
119
+ for ( i=0; i < imgs.length; i++ ) {
120
+ var slide = document.createElement('div');
121
+
122
+ slide.className = 'slide';
123
+ img = imgs[i] + query;
124
+ var slide_background = '<div class="slide-background" style="background-image:url(\''+img+'\')"></div>';
125
+
126
+ slide.innerHTML = slide_background;
127
+ document.getElementById('slider').appendChild(slide);
128
+ }
129
+ </script>
130
+
131
+ <?php
132
+ }
133
+
134
+ default:
135
+ break;
136
+ } ?>
137
+ </div>
138
+
139
+ <?php
140
+ echo $this->background_overlay( $themeslug );
141
+
142
+ ?>
143
+
144
+ </div>
145
+
146
+ <div class="slider-nav prev"></div>
147
+ <div class="slider-nav next"></div>
148
+
149
+ <?php
150
+
151
+ // render dot navigation for apollo theme
152
+ if ( $themeslug == 'apollo' ) {
153
+
154
+ if ( $niteoCS_banner == '0') {
155
+ $slider_count = count( $banner_ids );
156
+ }
157
+
158
+ echo '<div class="dot-nav">';
159
+
160
+ for ( $i=0; $i < $slider_count; $i++ ) {
161
+ $slide_nm = $i + 1;
162
+
163
+ if ( $i == 0 ) {
164
+ echo '<div class="slide-number active" data-slide="0">0' . $slide_nm . '</div>';
165
+ } else {
166
+ echo '<div class="slide-number" data-slide="' . $i . '">0' . $slide_nm . '</div>';
167
+ }
168
+
169
+ }
170
+
171
+ echo '</div>';
172
+
173
+ }
inc/render/head-scripts.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $this->cmp_wp_head();
4
+
5
+ do_action('cmp-before-header-scripts');
6
+
7
+ $head_scripts = json_decode( get_option('niteoCS_head_scripts', '[]'), true );
8
+
9
+ if ( !empty( $head_scripts ) ) {
10
+ foreach ( $head_scripts as $script ) {
11
+ if ( $script != '' ) {
12
+ $file = pathinfo( $script );
13
+ switch ( $file['extension'] ) {
14
+ case 'js':
15
+ echo '<script src="' . esc_url( $script ). '"></script>' . PHP_EOL;
16
+ break;
17
+ case 'css':
18
+ echo '<link href="' . esc_url( $script ). '" rel="stylesheet">' . PHP_EOL;
19
+ break;
20
+ default:
21
+ break;
22
+ }
23
+ }
24
+ }
25
+
26
+ do_action('cmp-after-header-scripts');
27
+ }
28
+
29
+ switch ( get_option('niteoCS_analytics_status', 'disabled') ) {
30
+ //disabled analytics
31
+ case 'disabled':
32
+ break;
33
+ // google analytics
34
+ case 'google':
35
+
36
+ if ( get_option('niteoCS_analytics', '') !== '' ) { ?>
37
+ <!-- Google analytics code -->
38
+ <script>
39
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
40
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
41
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
42
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
43
+
44
+ ga('create', '<?php echo esc_attr(get_option('niteoCS_analytics'));?>', 'auto');
45
+ ga('send', 'pageview');
46
+
47
+ </script>
48
+ <?php
49
+ }
50
+
51
+ break;
52
+ // other js code
53
+ case 'other':
54
+ if ( get_option('niteoCS_analytics_other', '') !== '' ) {
55
+ $analytics_code = get_option('niteoCS_analytics_other', '');
56
+ echo stripslashes( $analytics_code );
57
+ }
58
+
59
+ break;
60
+ default:
61
+ break;
62
+ }
inc/render/javascripts.php ADDED
@@ -0,0 +1,390 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <?php
3
+
4
+ do_action('cmp-before-footer-scripts');
5
+
6
+ if ( isset($_GET['background']) && is_numeric($_GET['background']) ) {
7
+ $background = esc_attr($_GET['background']);
8
+ } ?>
9
+
10
+ <!-- Fade in background image after load -->
11
+ <script>
12
+ window.addEventListener("load",function(event) {
13
+ init();
14
+ });
15
+
16
+ function init(){
17
+
18
+ var image = document.getElementById('background-image');
19
+ var body = document.getElementById('body');
20
+ if ( image === null ) {
21
+ image = document.getElementById('body');
22
+ }
23
+
24
+ if ( image != null ) {
25
+ image.classList.add('loaded');
26
+ body.classList.add('loaded');
27
+ }
28
+
29
+ <?php
30
+ // theme specific function after init
31
+ switch ( $themeslug ) {
32
+ case 'fifty': ?>
33
+ var contentWrapper = document.getElementsByClassName('content-wrapper')[0];
34
+ setTimeout(function(){ contentWrapper.className += " overflow"; }, 1500);
35
+
36
+ <?php
37
+ break;
38
+
39
+ case 'hardwork_premium': ?>
40
+ var contentWrapper = document.getElementsByClassName('section-body')[0];
41
+ setTimeout(function(){ contentWrapper.className += " overflow"; }, 1500);
42
+ <?php
43
+ break;
44
+
45
+ default:
46
+ break;
47
+ } ?>
48
+ }
49
+ </script>
50
+
51
+ <?php
52
+ // include background scripts
53
+ switch ( $background ) {
54
+ // VIDIM script for background video
55
+ case '5':
56
+ $video_autoloop = get_option('niteoCS_video_autoloop', '1'); ?>
57
+ <script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/vidim.min.js?v=1.0.2"');?>'></script>
58
+ <script>
59
+ <?php
60
+ $video_poster = wp_get_attachment_image_src( get_option('niteoCS_video_thumb'), 'large' );
61
+
62
+ if ( !empty( $video_poster ) ) {
63
+ $video_poster = $video_poster[0];
64
+ }
65
+ // video
66
+ $source = get_option('niteoCS_banner_video');
67
+
68
+ // sanitize source
69
+ switch ( $source ) {
70
+ case 'youtube':
71
+ $source = 'YouTube';
72
+ break;
73
+ case 'local':
74
+ $source = 'video/mp4';
75
+ break;
76
+ default:
77
+ break;
78
+ }
79
+
80
+ switch ( $source ) {
81
+ case 'YouTube':
82
+ $banner_url = get_option('niteoCS_youtube_url'); ?>
83
+
84
+ var myBackground = new vidim( '#player', {
85
+ src: '<?php echo esc_url( $banner_url ); ?>',
86
+ type: 'YouTube',
87
+ poster: '<?php echo esc_url( $video_poster ); ?>',
88
+ quality: 'hd1080',
89
+ muted: true,
90
+ loop: <?php echo $video_autoloop ? 'true' : 'false' ; ?>
91
+ });
92
+
93
+ <?php
94
+ break;
95
+
96
+ case 'vimeo':
97
+ $banner_url = get_option('niteoCS_vimeo_url'); ?>
98
+ var myBackground = new vidim( '#player', {
99
+ src: '<?php echo esc_url( $banner_url ); ?>',
100
+ type: 'vimeo',
101
+ poster: '<?php echo esc_url( $video_poster ); ?>',
102
+ loop: <?php echo $video_autoloop ? 'true' : 'false' ; ?>
103
+ });
104
+ <?php
105
+ break;
106
+
107
+ case 'video/mp4':
108
+ $banner_url = get_option('niteoCS_video_file_url');
109
+ $banner_url = wp_get_attachment_url( $banner_url ); ?>
110
+ var myBackground = new vidim( '#player', {
111
+ src: [
112
+ {
113
+ type: 'video/mp4',
114
+ src: '<?php echo esc_url( $banner_url ); ?>',
115
+ },
116
+ ],
117
+ poster: '<?php echo esc_url( $video_poster ); ?>',
118
+ loop: <?php echo $video_autoloop ? 'true' : 'false' ; ?>
119
+ });
120
+ <?php
121
+ break;
122
+ default:
123
+ break;
124
+ } ?>
125
+ </script>
126
+ <?php
127
+ break;
128
+
129
+ // SLIDER SCRIPTS FOR UNSPLASH or Custom IMAGES
130
+ case '0':
131
+ case '1':
132
+ $slider = get_option('niteoCS_slider', '0');
133
+
134
+ if ( $slider == '1' ) {
135
+ $slider_effect = get_option('niteoCS_slider_effect', 'true');
136
+ $slider_autoplay = get_option('niteoCS_slider_auto', '1');
137
+
138
+ switch ( $slider_effect ) {
139
+ // slice effect scripts
140
+ case 'slice':
141
+ ?>
142
+ <script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/imagesloaded.pkgd.min.js' );?>'></script>
143
+ <script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/anime.min.js' );?>'></script>
144
+ <script src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/external/uncover.js' );?>'></script>
145
+ <script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/slice.js';?>'></script>
146
+ <?php
147
+ break;
148
+
149
+ // mask transition effect scripts
150
+ case 'mask-transition':
151
+ if ( !$this->jquery ) {
152
+ echo '<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" Crossorigin="anonymous"></script>';
153
+ $this->jquery = TRUE;
154
+ } ?>
155
+ <script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/modernizr-custom.js';?>'></script>
156
+ <script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/imagesloaded.pkgd.min.js';?>'></script>
157
+ <script src='<?php echo $this->cmp_themeURL($themeslug).$themeslug.'/js/mask-transition.js';?>'></script>
158
+
159
+ <?php
160
+ break;
161
+
162
+ case 'train':
163
+ break;
164
+
165
+ // default (true, false) means slick carousel scripts
166
+ default:
167
+ if ( !$this->jquery ) {
168
+ echo '<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" Crossorigin="anonymous"></script>';
169
+ $this->jquery = TRUE;
170
+ } ?>
171
+ <!-- slick carousel script -->
172
+ <script src='https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.js'></script>
173
+ <script>
174
+ $('#slider').slick({
175
+ slide: '.slide',
176
+ slidesToShow: 1,
177
+ arrows: false,
178
+ fade: <?php echo esc_attr( $slider_effect );?>,
179
+ speed: 1000,
180
+ autoplay: <?php echo esc_attr( $slider_autoplay );?>,
181
+ autoplaySpeed: 7000,
182
+ });
183
+
184
+ $('.prev').click(function() {
185
+ $('#slider').slick('slickPrev');
186
+ });
187
+
188
+ $('.next').click(function() {
189
+ $('#slider').slick('slickNext');
190
+ });
191
+
192
+ // custom dots navigation
193
+ $('.slide-number').click(function() {
194
+ $('#slider').slick('slickGoTo', parseInt($(this).data('slide')) );
195
+
196
+ });
197
+
198
+ // update custom dots on change
199
+ $('#slider').on('beforeChange', function(event, slick, currentSlide, nextSlide){
200
+ $('.slide-number').removeClass('active');
201
+ $('[data-slide="' + nextSlide + '"]').addClass('active');
202
+ });
203
+
204
+ </script>
205
+ <?php
206
+ break;
207
+ }
208
+
209
+ }
210
+
211
+ break;
212
+
213
+ default:
214
+ break;
215
+ }
216
+
217
+ // render redirect script if CMP is in redirect mode
218
+ if ( $this->cmp_mode() == 3 ) {
219
+ $url = get_option('niteoCS_URL_redirect');
220
+ $time = get_option('niteoCS_redirect_time'); ?>
221
+
222
+ <script>
223
+ setTimeout(function() {
224
+ window.location.href = "<?php echo esc_url( $url );?>";
225
+ }, <?php echo esc_attr( $time * 1000 );?>);
226
+ </script>
227
+
228
+ <?php
229
+ }
230
+
231
+ // check for CMP Subscribe shortcode to include CF7 captcha
232
+ $subscribe = get_option('niteoCS_subscribe_type');
233
+ $sub_cf7 = false;
234
+ if ( $subscribe == '1' ) {
235
+ $subscribe_code = get_option('niteoCS_subscribe_code');
236
+ if ( strpos($subscribe_code, 'contact-form-7') !== false ) {
237
+ $sub_cf7 = true;
238
+ }
239
+ }
240
+
241
+ // include jquery and CF7 scripts for CF7 themes or themes using CF7 for subscribe form
242
+ if ( (in_array( $themeslug, $this->cmp_cf7_themes() ) && get_option('niteoCS_contact_form_type') == 'cf7') || $sub_cf7 === true ) {
243
+
244
+ $site_url = str_replace( '/', '\/', site_url() );
245
+
246
+ if ( !$this->jquery ) {
247
+ echo '<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" Crossorigin="anonymous"></script>';
248
+ $this->jquery = TRUE;
249
+ }
250
+
251
+ if ( class_exists('WPCF7') ) {
252
+ $sitekeys = WPCF7::get_option( 'recaptcha');
253
+ if ( $sitekeys ) {
254
+ $sitekeys = array_keys( $sitekeys ); ?>
255
+ <!-- CF7 Recaptcha script -->
256
+ <script type='text/javascript' src='https://www.google.com/recaptcha/api.js?render=<?php echo esc_attr($sitekeys[0]);?>&#038;ver=3.0'></script>
257
+ <script>!function(e,t){var a=function(){e.execute("<?php echo esc_attr($sitekeys[0]);?>",{action:"homepage"}).then(function(e){for(var t=document.getElementsByTagName("form"),a=0;a<t.length;a++)for(var n=t[a].getElementsByTagName("input"),r=0;r<n.length;r++){var c=n[r];if("g-recaptcha-response"===c.getAttribute("name")){c.setAttribute("value",e);break}}})};e.ready(a),document.addEventListener("wpcf7submit",a,!1)}(grecaptcha);</script>
258
+ <?php
259
+ } ?>
260
+
261
+ <script type='text/javascript'>
262
+ /* <![CDATA[ */
263
+ var wpcf7 = {"apiSettings":{"root":"<?php echo $site_url;?>\/index.php?rest_route=\/contact-form-7\/v1","namespace":"contact-form-7\/v1"}};
264
+ /* ]]> */
265
+ </script>
266
+ <script src='<?php echo plugins_url('contact-form-7/includes/js/scripts.js?ver=5.0.1');?>'></script>
267
+ <?php
268
+ }
269
+ }
270
+
271
+
272
+
273
+ // special effects scripts for premium themes
274
+ if ( in_array( $themeslug, $this->cmp_premium_themes_installed() ) ) {
275
+
276
+ $effect = get_option('niteoCS_special_effect', 'disabled');
277
+
278
+ // change effect for preview
279
+ if ( isset($_GET['effect']) && is_numeric($_GET['effect'])) {
280
+ $effect = $_GET['effect'];
281
+ }
282
+
283
+ switch ( $effect ) {
284
+ case 'constellation':
285
+ case '1': ?>
286
+ <!-- load external Particles script -->
287
+ <script src="//cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
288
+ <!-- INI particles -->
289
+ <script>
290
+ <?php
291
+ if ( $themeslug === 'libra' ) { ?>
292
+ var wrapper = document.getElementById('body');
293
+ var background= 'body';
294
+ <?php
295
+ } else { ?>
296
+ var wrapper=document.getElementById("background-wrapper");
297
+ var background=(null===wrapper)?"slider-wrapper":"background-wrapper";
298
+ <?php
299
+ } ?>
300
+ particlesJS(background,{particles:{number:{value:100,density:{enable:!0,value_area:1e3}},color:{value:"<?php echo esc_attr( get_option('niteoCS_special_effect[constellation][color]', '#ffffff') );?>"},shape:{type:"circle",stroke:{width:0,color:"#fff"},polygon:{nb_sides:5}},opacity:{value:.6,random:!1,anim:{enable:!1,speed:1,opacity_min:.1,sync:!1}},size:{value:2,random:!0,anim:{enable:!1,speed:40,size_min:.1,sync:!1}},line_linked:{enable:!0,distance:120,color:"<?php echo esc_attr( get_option('niteoCS_special_effect[constellation][color]', '#ffffff') );?>",opacity:.4,width:1}},interactivity:{detect_on:"canvas",events:{onhover:{enable:!0,mode:"grab"},onclick:{enable:!1},resize:!0},modes:{grab:{distance:140,line_linked:{opacity:1}},bubble:{distance:400,size:40,duration:2,opacity:8,speed:3},repulse:{distance:200,duration:.4},push:{particles_nb:4},remove:{particles_nb:2}}},retina_detect:!0});
301
+ </script>
302
+ <?php
303
+ break;
304
+
305
+ case 'bubbles':
306
+ case '2':
307
+ if ( !$this->jquery ) {
308
+ echo '<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" Crossorigin="anonymous"></script>';
309
+ $this->jquery = TRUE;
310
+ } ?>
311
+ <!-- INI bubbles -->
312
+ <script>
313
+ <?php
314
+ if ( $themeslug === 'libra' ) { ?>
315
+ var $wrapper = $('#body');
316
+ <?php
317
+ } else { ?>
318
+ var $wrapper=$("#background-wrapper").length?$("#background-wrapper"):$("#slider-wrapper")
319
+ <?php
320
+ } ?>
321
+ $wrapper.append("<canvas></canvas><canvas></canvas><canvas></canvas>"),function(a){var e=$wrapper.children("canvas"),n=e[0],r=e[1],i=e[2],o={circle:{amount:18,layer:3,color:[<?php echo $this->hex2rgba( get_option('niteoCS_special_effect[constellation][color]', '#ffffff') );?>],alpha:.3},line:{amount:12,layer:3,color:[<?php echo $this->hex2rgba( get_option('niteoCS_special_effect[constellation][color]', '#ffffff') );?>],alpha:.3},speed:.5,angle:20};if(n.getContext){n.getContext("2d");var t,l,c,d=r.getContext("2d"),m=i.getContext("2d"),w=window.Math,s=o.angle/360*w.PI*2,p=[],u=[];requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(a,e){setTimeout(a,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||window.oCancelAnimationFrame||clearTimeout;var h=function(){t=a(window).width(),l=a(window).height(),e.each(function(){this.width=t,this.height=l})},v=function(){var a,e,n,r,i,h,f,y,g,A,F,C,b,x,q=w.sin(s),R=w.cos(s);if(o.circle.amount>0&&o.circle.layer>0){d.clearRect(0,0,t,l);for(var k=0,S=p.length;k<S;k++){var $=(I=p[k]).x,P=I.y,T=I.radius,z=I.speed;$>t+T?$=-T:$<-T?$=t+T:$+=q*z,P>l+T?P=-T:P<-T?P=l+T:P-=R*z,I.x=$,I.y=P,a=$,e=P,n=T,r=I.color,i=I.alpha,h=void 0,(h=d.createRadialGradient(a,e,n,a,e,0)).addColorStop(0,"rgba("+r[0]+","+r[1]+","+r[2]+","+i+")"),h.addColorStop(1,"rgba("+r[0]+","+r[1]+","+r[2]+","+(i-.1)+")"),d.beginPath(),d.arc(a,e,n,0,2*w.PI,!0),d.fillStyle=h,d.fill()}}if(o.line.amount>0&&o.line.layer>0){m.clearRect(0,0,t,l);var G=0;for(S=u.length;G<S;G++){$=(I=u[G]).x,P=I.y;var I,j=I.width;z=I.speed;$>t+j*q?$=-j*q:$<-j*q?$=t+j*q:$+=q*z,P>l+j*R?P=-j*R:P<-j*R?P=l+j*R:P-=R*z,I.x=$,I.y=P,f=$,y=P,g=j,A=I.color,F=I.alpha,void 0,void 0,x=void 0,C=f+w.sin(s)*g,b=y-w.cos(s)*g,(x=m.createLinearGradient(f,y,C,b)).addColorStop(0,"rgba("+A[0]+","+A[1]+","+A[2]+","+F+")"),x.addColorStop(1,"rgba("+A[0]+","+A[1]+","+A[2]+","+(F-.1)+")"),m.beginPath(),m.moveTo(f,y),m.lineTo(C,b),m.lineWidth=3,m.lineCap="round",m.strokeStyle=x,m.stroke()}}c=requestAnimationFrame(v)},f=function(){if(p=[],u=[],o.circle.amount>0&&o.circle.layer>0)for(var a=0;a<o.circle.amount/o.circle.layer;a++)for(var e=0;e<o.circle.layer;e++)p.push({x:w.random()*t,y:w.random()*l,radius:w.random()*(20+5*e)+(20+5*e),color:o.circle.color,alpha:.2*w.random()+(o.circle.alpha-.1*e),speed:o.speed*(1+.5*e)});if(o.line.amount>0&&o.line.layer>0)for(var n=0;n<o.line.amount/o.line.layer;n++)for(var r=0;r<o.line.layer;r++)u.push({x:w.random()*t,y:w.random()*l,width:w.random()*(20+5*r)+(20+5*r),color:o.line.color,alpha:.2*w.random()+(o.line.alpha-.1*r),speed:o.speed*(1+.5*r)});cancelAnimationFrame(c),c=requestAnimationFrame(v)};a(document).ready(function(){h(),f()}),a(window).resize(function(){h(),f()})}}(jQuery);
322
+ </script>
323
+ <?php
324
+ break;
325
+
326
+ default:
327
+ break;
328
+ }
329
+ }
330
+
331
+ // check if content includes iframe, and if yes, include full-width video resize script
332
+ $content = $this->cmp_get_body();
333
+
334
+ if ( strpos( $content, 'iframe' ) !== false ) { ?>
335
+ <!-- Script for full-width size of embedded UT and VIMEO Iframes -->
336
+ <script>
337
+ (function ( window, document, undefined ) {
338
+ var iframes = document.getElementsByTagName( 'iframe' );
339
+ for ( var i = 0; i < iframes.length; i++ ) {
340
+ var iframe = iframes[i],
341
+ players = /www.youtube.com|player.vimeo.com/;
342
+ if ( iframe.src.search( players ) > 0 ) {
343
+ var videoRatio = ( iframe.height / iframe.width ) * 100;
344
+ iframe.style.position = 'absolute';
345
+ iframe.style.top = '0';
346
+ iframe.style.left = '0';
347
+ iframe.width = '100%';
348
+ iframe.height = '100%';
349
+ var wrap = document.createElement( 'div' );
350
+ wrap.className = 'fluid-vids';
351
+ wrap.style.width = '100%';
352
+ wrap.style.position = 'relative';
353
+ wrap.style.paddingTop = videoRatio + '%';
354
+ var iframeParent = iframe.parentNode;
355
+ iframeParent.className = 'video-paragraph';
356
+ iframeParent.insertBefore( wrap, iframe );
357
+ wrap.appendChild( iframe );
358
+ }
359
+ }
360
+ })( window, document );
361
+ </script>
362
+ <?php
363
+ }
364
+
365
+ $footer_scripts = json_decode( get_option('niteoCS_footer_scripts', '[]'), true );
366
+
367
+ if ( !empty( $footer_scripts ) ) {
368
+ foreach ( $footer_scripts as $f_script ) {
369
+ if ( $f_script != '' ) {
370
+ $file = pathinfo( $f_script );
371
+ switch ( $file['extension'] ) {
372
+ case 'js':
373
+ echo '<script src="' . esc_url( $f_script ). '"></script>' . PHP_EOL;
374
+ break;
375
+ case 'css':
376
+ echo '<link href="' . esc_url( $f_script ). '" rel="stylesheet">' . PHP_EOL;
377
+ break;
378
+ default:
379
+ break;
380
+ }
381
+ }
382
+ }
383
+ }
384
+
385
+ do_action('cmp-after-footer-scripts');
386
+
387
+ $this->cmp_wp_footer();
388
+
389
+ // render nt&cmp notes
390
+ echo $this->cmp_render_nt_info();
inc/render/logo.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $logo_type = get_option('niteoCS_logo_type', 'text');
4
+
5
+ $html = '';
6
+ $class = ( $class != '' ) ? ' ' . $class : $class;
7
+
8
+ switch ( $logo_type ) {
9
+ case 'graphic':
10
+ // get logo id
11
+ $logo_id = get_option('niteoCS_logo_id');
12
+
13
+ // get logo
14
+ if ( $logo_id != '' ) {
15
+ $logo_url = wp_get_attachment_image_src( $logo_id, 'full' );
16
+ }
17
+
18
+ if ( isset($logo_url[0]) ) {
19
+ $html = '<div class="logo-wrapper image' . esc_attr( $class ) . '"><a href="'. esc_url( get_site_url() ) .'" style="text-decoration:none"><img src="'.esc_url( $logo_url[0] ).'" class="graphic-logo" alt="logo"></a></div>';
20
+ }
21
+ break;
22
+
23
+ case 'text':
24
+ $text_logo = stripslashes(get_option('niteoCS_text_logo', get_bloginfo( 'name', 'display' )));
25
+
26
+ $html = '<div class="logo-wrapper text text-logo-wrapper' . esc_attr( $class ) . '"><a href="'. esc_url( get_site_url() ) .'" style="text-decoration:none;color:inherit"><h1 class="text-logo">'.esc_html( $text_logo ).'</h1></a></div>';
27
+ break;
28
+
29
+ case 'disabled':
30
+ default:
31
+ break;
32
+ }
inc/render/niteothemes-info.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $html = '
4
+ <!-- Build by CMP – Coming Soon & Maintenance Plugin by NiteoThemes -->
5
+ <!-- Visit plugin page https://wordpress.org/plugins/cmp-coming-soon-maintenance/ -->
6
+ <!-- More CMP Themes on https://niteothemes.com -->';
inc/render/seo.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ ob_start();
5
+
6
+ $title = stripslashes( get_option('niteoCS_title', get_bloginfo('name').' Coming soon!') );
7
+ $descr = stripslashes( get_option('niteoCS_descr', 'Just another Coming Soon Page') );
8
+
9
+ $seo_img_id = get_option('niteoCS_seo_img_id');
10
+ $seo_img_url = wp_get_attachment_image_src($seo_img_id, 'large');
11
+ $seo_img_url = isset($seo_img_url[0]) ? $seo_img_url[0] : $this->cmp_get_background_img();
12
+ ?>
13
+ <!-- SEO -->
14
+ <title><?php echo esc_html( $title ); ?></title>
15
+ <meta name="description" content="<?php echo esc_html( $descr ); ?>"/>
16
+
17
+ <!-- og meta for facebook, googleplus -->
18
+ <meta property="og:title" content="<?php echo esc_html( $title ); ?>"/>
19
+ <meta property="og:description" content="<?php echo esc_html( $descr ); ?>"/>
20
+ <meta property="og:url" content="<?php echo get_home_url()?>"/>
21
+ <meta property="og:type" content="website" />
22
+ <meta property="og:image" content="<?php echo esc_url( $seo_img_url );?>"/>
23
+
24
+ <!-- twitter meta -->
25
+ <meta name="twitter:card" content="summary_large_image">
26
+ <meta name="twitter:title" content="<?php echo esc_html( $title ); ?>"/>
27
+ <meta name="twitter:description" content="<?php echo esc_html( $descr ); ?>"/>
28
+ <meta name="twitter:url" content="<?php echo get_home_url();?>"/>
29
+ <meta name="twitter:image" content="<?php echo esc_url( $seo_img_url );?>"/>
30
+
31
+ <?php
32
+ // display favicon
33
+ $favicon_id = get_option('niteoCS_favicon_id');
34
+
35
+ if ( $favicon_id && $favicon_id != '' ) {
36
+ $favicon_url = wp_get_attachment_image_src( $favicon_id, 'thumbnail' );
37
+ if ( isset($favicon_url[0]) ) {
38
+ echo '<link id="favicon" rel="shortcut icon" href="' . $favicon_url[0] . '" type="image/x-icon"/>';
39
+ }
40
+ } else {
41
+ wp_site_icon();
42
+ }
43
+
44
+ if ( get_option( 'blog_public', '1' ) == '0' ) {
45
+ echo '<meta name="robots" content="noindex,nofollow" />' . PHP_EOL;
46
+ }
47
+
48
+ $html = ob_get_clean();
inc/render/social-icons.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $html = '';
3
+ $ulclass = ( $ulclass != '' ) ? ' ' . $ulclass : $ulclass;
4
+ $liclass = ( $liclass != '' ) ? ' ' . $liclass : $liclass;
5
+
6
+ // migrate social media to new option after update 1.4.0
7
+ if ( get_option('niteoCS_socialmedia') ) {
8
+
9
+ $socialmedia = stripslashes( get_option('niteoCS_socialmedia') );
10
+ $socialmedia = json_decode( $socialmedia, true );
11
+ //sort social icons array by hidden, then order key
12
+ uasort( $socialmedia , array($this,'sort_social') );
13
+
14
+ $theme_html = ( $themeslug == 'stylo' ) ? '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="3em" height="3em" viewBox="0 0 80 80" xml:space="preserve"><circle transform="rotate(-90 40 40)" class="another-circle" cx="40" cy="40" r="36" /></svg>' : '';
15
+
16
+ if ( $title == true ) {
17
+ $soc_title = stripslashes( get_option('niteoCS_soc_title', 'GET SOCIAL WITH US') );
18
+ $html = ( $soc_title == '' ) ? '' : '<h2 class="soc-title">' . esc_html( $soc_title ) . '</h2>';
19
+ }
20
+
21
+ ob_start();
22
+
23
+ foreach ( $socialmedia as $social ) {
24
+
25
+ if ( $social['hidden'] == '0' && $social['active'] == '1') {
26
+ $href = '';
27
+ $name = ucfirst($social['name']);
28
+
29
+ switch ($social['name']) {
30
+ case 'envelope-o':
31
+ $href = 'mailto:';
32
+ $name = __('Email', 'cmp-coming-soon-maintenance');
33
+ break;
34
+ case 'phone':
35
+ $href = 'tel:';
36
+ $name = __('Phone', 'cmp-coming-soon-maintenance');
37
+ break;
38
+ case 'whatsapp':
39
+ $name = 'WhatsApp';
40
+ $href = 'https://api.whatsapp.com/send?phone=';
41
+ break;
42
+ case 'youtube':
43
+ $name = 'YouTube';
44
+ break;
45
+ case 'linkedin':
46
+ $name = 'LinkedIn';
47
+ break;
48
+ case 'deviantart':
49
+ $name = 'DeviantArt';
50
+ break;
51
+ case 'soundcloud':
52
+ $name = 'SoundCloud';
53
+ break;
54
+ case 'vk':
55
+ $name = 'VK';
56
+ break;
57
+ case 'github':
58
+ $name = 'GitHub';
59
+ break;
60
+ default:
61
+ break;
62
+ }
63
+
64
+ echo ( $mode == 'text' ) ? '<li class="social-child' . $liclass . '"><a href="'.$href.esc_attr($social['url']).'" target="top" class="social-'.$social['name'].'">'.$name.'</a></li>' : '<li class="social-child' . $liclass . '"><a href="'.$href.esc_attr($social['url']).'" target="top" class="social-'.$social['name'].'">'.$theme_html.'<i class="fa fa-'.$social['name'].'" aria-hidden="true"></i></a></li>';
65
+ }
66
+ }
67
+
68
+ $social_list = ob_get_clean();
69
+
70
+ if ( $social_list != '' ) {
71
+ $html = $html . '<ul class="social-list' . $ulclass . '">' . $social_list.'</ul>';
72
+ }
73
+ }
inc/render/subscribe-form.php ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // process emails first
4
+ $response = $this->niteo_subscribe( true );
5
+
6
+ $html = '';
7
+
8
+ // get current theme
9
+ $theme = $this->cmp_selectedTheme();
10
+
11
+ // get type of susbscribe
12
+ $subscribe_type = get_option('niteoCS_subscribe_type', '2');
13
+
14
+ // if subscribers is 3rd party plugin, render form by shortcode
15
+ switch ($subscribe_type) {
16
+ // custom shortcode
17
+ case '1':
18
+ $replace = array('<p>', '</p>' );
19
+ $html = str_replace($replace, '', do_shortcode( stripslashes( get_option('niteoCS_subscribe_code') ))) ;
20
+ break;
21
+ // CMP subscribe form
22
+ case '2':
23
+ // get GDPR message
24
+ $niteoCS_subscribe_label = stripslashes( get_option('niteoCS_subscribe_label') );
25
+
26
+ // get translation if exists
27
+ $translation = json_decode( get_option('niteoCS_translation'), true );
28
+ $placeholder = isset($translation[4]['translation']) ? stripslashes( $translation[4]['translation'] ) : 'Insert your email address.';
29
+ $placeholder_firstname = isset($translation[10]['translation']) ? stripslashes( $translation[10]['translation'] ) : 'First Name';
30
+ $placeholder_lastname = isset($translation[11]['translation']) ? stripslashes( $translation[11]['translation'] ) : 'Last Name';
31
+ $submit = isset($translation[8]['translation']) ? stripslashes( $translation[8]['translation'] ) : 'Submit';
32
+
33
+ // overwrite it with theme specific requirements
34
+ if ( $this->cmp_selectedTheme() == 'stylo' ) {
35
+ $placeholder = '&#xf003; ' . $placeholder;
36
+ $placeholder_firstname = '&#xf2c0; ' . $placeholder_firstname;
37
+ $placeholder_lastname = '&#xf2c0; ' . $placeholder_lastname;
38
+ }
39
+
40
+ // overwrite it with theme specific requirements
41
+ if ( $this->cmp_selectedTheme() == 'pluto' ) {
42
+ $placeholder = '&#xf003; ' . $placeholder;
43
+ }
44
+
45
+ $submit = ( $this->cmp_selectedTheme() == 'postery' ) ? '&#xf1d9;' : $submit;
46
+ $submit = ( $this->cmp_selectedTheme() == 'juno' ) ? '&#xf1d8;' : $submit;
47
+ $submit = ( $this->cmp_selectedTheme() == 'agency' ) ? '&#xf105;' : $submit;
48
+ $submit = ( $this->cmp_selectedTheme() == 'libra' ) ? '&#xf1d9;' : $submit;
49
+
50
+ ?>
51
+
52
+ <form id="subscribe-form" method="post" class="cmp-subscribe">
53
+ <div class="cmp-form-inputs">
54
+
55
+ <?php wp_nonce_field('save_options','save_options_field'); ?>
56
+ <?php
57
+ // display placeholders or labels
58
+ switch ( $label ) {
59
+ case TRUE:
60
+ if ( $firstname === TRUE ) { ?>
61
+ <div class="firstname input-wrapper">
62
+ <label for="firstname-subscribe"><?php echo esc_attr( $placeholder_firstname );?></label>
63
+ <input type="text" id="firstname-subscribe" name="cmp_firstname">
64
+ </div>
65
+ <?php
66
+ }
67
+
68
+ if ( $lastname === TRUE ) { ?>
69
+ <div class="lastname input-wrapper">
70
+ <label for="lastname-subscribe"><?php echo esc_attr( $placeholder_lastname );?></label>
71
+ <input type="text" id="lastname-subscribe" name="cmp_lastname">
72
+ </div>
73
+ <?php
74
+ } ?>
75
+ <div class="email input-wrapper">
76
+ <label for="email-subscribe"><?php echo esc_attr( $placeholder );?></label>
77
+ <input type="email" id="email-subscribe" name="email" required>
78
+ </div>
79
+ <?php
80
+ break;
81
+
82
+ case FALSE:
83
+ if ( $firstname === TRUE ) { ?>
84
+ <input type="text" id="firstname-subscribe" name="cmp_firstname" placeholder="<?php echo esc_attr( $placeholder_firstname );?>">
85
+ <?php
86
+ }
87
+
88
+ if ( $lastname === TRUE ) { ?>
89
+ <input type="text" id="lastname-subscribe" name="cmp_lastname" placeholder="<?php echo esc_attr( $placeholder_lastname );?>">
90
+ <?php
91
+ } ?>
92
+
93
+ <input type="email" id="email-subscribe" name="email" placeholder="<?php echo esc_attr( $placeholder );?>" required>
94
+ <?php
95
+ break;
96
+
97
+ default:
98
+ break;
99
+ }
100
+
101
+ if ( $this->cmp_selectedTheme() == 'mercury' ) { ?>
102
+ <button type="submit" id="submit-subscribe" value="<?php echo esc_attr( $submit );?>"><?php echo esc_attr( $submit );?></button>
103
+ <?php
104
+ } else { ?>
105
+ <input type="submit" id="submit-subscribe" value="<?php echo esc_attr( $submit );?>">
106
+ <?php
107
+ } ?>
108
+
109
+ <div style="display: none;">
110
+ <input type="text" name="form_honeypot" value="" tabindex="-1" autocomplete="off">
111
+ </div>
112
+
113
+ <div id="subscribe-response"><?php echo isset( $response ) ? $response : '';?></div>
114
+
115
+ <div id="subscribe-overlay"></div>
116
+ </div>
117
+
118
+ <?php
119
+ // render Subscribe form Message/GDPR
120
+ if ( $niteoCS_subscribe_label != '' ) {
121
+
122
+ $allowed_html = array(
123
+ 'a' => array(
124
+ 'href' => array(),
125
+ 'title' => array()
126
+ ),
127
+ );
128
+ ?>
129
+
130
+ <div class="cmp-form-notes">
131
+ <?php echo wpautop(wp_kses( $niteoCS_subscribe_label, $allowed_html )); ?>
132
+ </div>
133
+ <?php
134
+ } ?>
135
+
136
+ </form>
137
+
138
+ <script>
139
+ /* Subscribe form script */
140
+ <?php
141
+ $url = parse_url( admin_url() );
142
+ $path = isset($url['path']) ? $url['path'] : '/wp-admin/';
143
+ ?>
144
+
145
+ var ajaxurl = '<?php echo esc_attr($path);?>admin-ajax.php';
146
+ var security = '<?php echo wp_create_nonce( 'cmp-subscribe-action' );?>';
147
+ var msg = '';
148
+
149
+ window.addEventListener('load',function(event) {
150
+ subForm( 'subscribe-form', 'submit-subscribe', 'subscribe-response', 'email-subscribe', 'firstname-subscribe', 'lastname-subscribe' );
151
+ });
152
+
153
+ subForm = function(formID, buttonID, resultID, emailID, firstnameID, lastnameID) {
154
+
155
+ let selectForm = document.getElementById(formID); // Select the form by ID.
156
+ let selectButton = document.getElementById(buttonID); // Select the button by ID.
157
+ let selectResult = document.getElementById(resultID); // Select result element by ID.
158
+ let emailInput = document.getElementById(emailID); // Select email input by ID.
159
+ let firstnameInput = document.getElementById(firstnameID); // Select firstname input by ID.
160
+ let lastnameInput = document.getElementById(lastnameID); // Select lastname input by ID.
161
+ let firstname = '';
162
+ let lastname = '';
163
+ selectButton.onclick = function(e){ // If clicked on the button.
164
+
165
+ if ( emailInput.value !== '' ) {
166
+ firstname = firstnameInput === null ? '' : firstnameInput.value;
167
+ lastname = lastnameInput === null ? '' : lastnameInput.value;
168
+
169
+ // I'm using the whatwg-fetch polyfill and a polyfill for Promises.
170
+ fetch(ajaxurl, {
171
+ method: 'POST',
172
+ headers: {
173
+ 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
174
+ 'Access-Control-Allow-Origin': '*',
175
+ },
176
+ body: `action=niteo_subscribe&ajax=true&form_honeypot=&email=${emailInput.value}&firstname=${firstname}&lastname=${lastname}&security=${security}`,
177
+ credentials: 'same-origin'
178
+ })
179
+ .then((res) => {
180
+ return res.json();
181
+ })
182
+ .then((data) => {
183
+ selectResult.innerHTML = data.message; // Display the result inside result element.
184
+ selectForm.classList.add('-subscribed');
185
+ if (data.status == 1) {
186
+ selectForm.classList.remove('-subscribe-failed');
187
+ selectForm.classList.add('-subscribe-successful');
188
+ emailInput.value = '';
189
+ firstnameInput ? firstnameInput.value = '' : null;
190
+ lastnameInput ? lastnameInput.value = '' : null;
191
+ <?php do_action('cmp-successfull-subscribe-action'); ?>
192
+
193
+ } else {
194
+ selectForm.classList.add('-subscribe-failed');
195
+ }
196
+ })
197
+ .catch(function(error) { console.log(error.message); });
198
+ }
199
+ }
200
+
201
+ selectForm.onsubmit = function(){ // Prevent page refresh
202
+ return false;
203
+ }
204
+ }
205
+ </script>
206
+ <?php
207
+ break;
208
+ // MailOPtin
209
+ case '3':
210
+
211
+ if ( defined('MAILOPTIN_VERSION_NUMBER') ) {
212
+
213
+ $campaign_id = get_option('niteoCS_mailoptin_selected');
214
+ $campaign= MailOptin\Core\Repositories\OptinCampaignsRepository::get_optin_campaign_by_id($campaign_id);
215
+ if ( $campaign['optin_type'] !== 'lightbox' ) {
216
+ if ( !$this->jquery ) {
217
+ echo '<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" Crossorigin="anonymous"></script>';
218
+ $this->jquery = TRUE;
219
+ }
220
+ $html = do_shortcode( '[mo-optin-form id="'. get_option('niteoCS_mailoptin_selected') .'"]' );
221
+ }
222
+ }
223
+ break;
224
+ default:
225
+ break;
226
+ }
227
+
228
+ return $html;
inc/render/text-overlay.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $overlay_text_status = get_option('niteoCS_overlay_text[status]', '1');
4
+
5
+ $html = '';
6
+
7
+ // return if overlay is disabled
8
+ if ( $overlay_text_status == '0' || !in_array( $themeslug, $this->cmp_overlay_text_themes() ) ) {
9
+ return;
10
+ }
11
+
12
+ $heading = stripslashes(get_option('niteoCS_overlay_text[heading]', 'NEW WEBSITE ON THE WAY!'));
13
+ $paragraph = stripslashes(get_option('niteoCS_overlay_text[paragraph]', ''));
14
+ $button_text = stripslashes(get_option('niteoCS_overlay_text[button_text]', 'Call to Action!'));
15
+ $button_url = get_option('niteoCS_overlay_text[button_url]', '');
16
+
17
+ $heading = ( $heading == '' ) ? '' : '<h2 class="animated fadeInRight delay-small">'.esc_html( $heading ).'</h2>';
18
+ $paragraph = ( $paragraph == '' ) ? '' : '<div class="animated fadeInRight delay-big">'. wpautop( esc_html( $paragraph ) ) . '</div>';
19
+ $button = ( $button_text == '' ) ? '' : '<a href="'.esc_html( $button_url ).'" class="button animated fadeInRight delay-huge" target="_blank">'.esc_html( $button_text ).'</a>';
20
+
21
+ $html = '<div class="overlay-content">' . $heading . $paragraph . $button . '</div>';
inc/render/title.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ global $allowedposttags;
4
+
5
+ $html = stripslashes( get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!') );
6
+
7
+ // wrap text between stars in title in span for future formatting
8
+ $title_array = explode('*', $html);
9
+
10
+ if ( count($title_array) == 3 ) {
11
+ $html = '<span class="cmp-title light">' . $title_array[0] . '</span><span class="cmp-title bold">' . $title_array[1] . '</span><span class="cmp-title light">' . $title_array[2] . '</span>';
12
+ }
13
+
14
+ $html = ( $html == '' ) ? '' : '<h2 class="cmp-title animated '. $class .'">' . wp_kses( $html, $allowedposttags ) . '</h2>';
inc/settings/settings-subscribe.php CHANGED
@@ -35,6 +35,10 @@ if (isset($_POST['niteoCS_mailster_list_selected'])) {
35
  update_option('niteoCS_mailster_list_selected', sanitize_text_field($_POST['niteoCS_mailster_list_selected']));
36
  }
37
 
 
 
 
 
38
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
39
 
40
  if ( isset($_POST['niteoCS_mailchimp_double_opt']) ) {
@@ -65,7 +69,7 @@ $mailchimp_list_selected = get_option('niteoCS_mailchimp_list_selected');
65
  $mailchimp_lists = json_decode(get_option('niteoCS_mailchimp_lists', false), true);
66
  $mailpoet_list_selected = get_option('niteoCS_mailpoet_list_selected');
67
  $mailster_list_selected = get_option('niteoCS_mailster_list_selected');
68
-
69
  ?>
70
 
71
  <div class="table-wrapper content" id="subscribe-section">
@@ -81,19 +85,25 @@ $mailster_list_selected = get_option('niteoCS_mailster_list_selected');
81
 
82
  <p>
83
  <label title="CMP Subscribe Form">
84
- <input type="radio" class="subscribe" name="niteoCS_subscribe_type" value="2"<?php if ( $niteoCS_subscribe_type == 2) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('CMP Subscribe Form', 'cmp-coming-soon-maintenance');?>
 
 
 
 
 
 
85
  </label>
86
  </p>
87
 
88
  <p>
89
  <label title="3rd Party Plugin">
90
- <input type="radio" class="subscribe" name="niteoCS_subscribe_type" value="1"<?php if ( $niteoCS_subscribe_type == 1) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('3rd Party Plugin', 'cmp-coming-soon-maintenance');?>
91
  </label>
92
  </p>
93
 
94
  <p>
95
  <label title="Disabled">
96
- <input type="radio" class="subscribe" name="niteoCS_subscribe_type" value="0"<?php if ( $niteoCS_subscribe_type == 0) { echo ' checked="checked"'; } ?>>&nbsp;<?php _e('Disabled', 'cmp-coming-soon-maintenance');?>
97
  </label>
98
  </p>
99
 
@@ -252,6 +262,53 @@ $mailster_list_selected = get_option('niteoCS_mailster_list_selected');
252
  </fieldset>
253
  </td>
254
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  </tr>
256
 
257
  <?php echo $this->render_settings->submit(); ?>
35
  update_option('niteoCS_mailster_list_selected', sanitize_text_field($_POST['niteoCS_mailster_list_selected']));
36
  }
37
 
38
+ if (isset($_POST['niteoCS_mailoptin_selected'])) {
39
+ update_option('niteoCS_mailoptin_selected', sanitize_text_field($_POST['niteoCS_mailoptin_selected']));
40
+ }
41
+
42
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
43
 
44
  if ( isset($_POST['niteoCS_mailchimp_double_opt']) ) {
69
  $mailchimp_lists = json_decode(get_option('niteoCS_mailchimp_lists', false), true);
70
  $mailpoet_list_selected = get_option('niteoCS_mailpoet_list_selected');
71
  $mailster_list_selected = get_option('niteoCS_mailster_list_selected');
72
+ $mailoptin_selected = get_option('niteoCS_mailoptin_selected');
73
  ?>
74
 
75
  <div class="table-wrapper content" id="subscribe-section">
85
 
86
  <p>
87
  <label title="CMP Subscribe Form">
88
+ <input type="radio" class="subscribe" name="niteoCS_subscribe_type" value="2"<?php checked($niteoCS_subscribe_type, 2);?>>&nbsp;<?php _e('CMP Subscribe Form', 'cmp-coming-soon-maintenance');?>
89
+ </label>
90
+ </p>
91
+
92
+ <p>
93
+ <label title="MailOptin">
94
+ <input type="radio" class="subscribe" name="niteoCS_subscribe_type" value="3"<?php checked($niteoCS_subscribe_type, 3);?>>&nbsp;<?php _e('MailOptin Integration', 'cmp-coming-soon-maintenance');?>
95
  </label>
96
  </p>
97
 
98
  <p>
99
  <label title="3rd Party Plugin">
100
+ <input type="radio" class="subscribe" name="niteoCS_subscribe_type" value="1"<?php checked($niteoCS_subscribe_type, 1);?>>&nbsp;<?php _e('3rd Party Plugin', 'cmp-coming-soon-maintenance');?>
101
  </label>
102
  </p>
103
 
104
  <p>
105
  <label title="Disabled">
106
+ <input type="radio" class="subscribe" name="niteoCS_subscribe_type" value="0"<?php checked($niteoCS_subscribe_type, 0);?>>&nbsp;<?php _e('Disabled', 'cmp-coming-soon-maintenance');?>
107
  </label>
108
  </p>
109
 
262
  </fieldset>
263
  </td>
264
 
265
+ <td id="subscribe-niteo" class="subscribe-switch x3">
266
+
267
+ <p><?php _e('MailOptin is a proven list building plugin that allows you to create popups and embedded forms so you can convert visitors to your coming soon site into subscribers. Supports all major email providers including. MailChimp, AWeber, Campaign Monitor, Constant Contact, Mailerlite.', 'cmp-coming-soon-maintenance'); ?></p>
268
+ <?php
269
+
270
+ if ( file_exists( WP_PLUGIN_DIR . '/mailoptin/mailoptin.php' ) ) {
271
+
272
+ if ( is_plugin_active('mailoptin/mailoptin.php') ) {
273
+ $optins = MailOptin\Core\Repositories\OptinCampaignsRepository::get_optin_campaigns();
274
+ ?>
275
+ <fieldset>
276
+ <label for="niteoCS_mailoptin_list"><?php _e('Select MailOptin Campaigns.', 'cmp-coming-soon-maintenance');?>
277
+ <select name="niteoCS_mailoptin_selected" id="niteoCS_mailoptin_list">
278
+ <?php
279
+ if ( !empty( $optins ) ) {
280
+ foreach ( $optins as $optin) { ?>
281
+ <option value="<?php echo esc_attr( $optin['id'] );?>" <?php selected( $optin['id'], $mailoptin_selected ); ?>><?php echo esc_attr( $optin['name'] );?></option>
282
+ <?php
283
+ }
284
+ } else { ?>
285
+ <option value="error"><?php _e('No MailOptin Campaign was found. Please make there is at least one Optin Campaign created.', 'cmp-coming-soon-maintenance');?></option>
286
+ <?php
287
+ } ?>?>
288
+ </select>
289
+ </label>
290
+ </fieldset>
291
+ <?php
292
+ } else {
293
+ $activate_url = wp_nonce_url(admin_url('plugins.php?action=activate&plugin=mailoptin%2Fmailoptin.php'), 'activate-plugin_mailoptin/mailoptin.php');
294
+ ?>
295
+ <p><?php _e('Please activate MailOptin plugin first by clicking button below.');?></p>
296
+ <a href="<?php echo $activate_url;?>" class="button" target="_blank"><?php _e('Activate MailOptin plugin', 'cmp-coming-soon-maintenance');?></a>
297
+ <?php
298
+ }
299
+
300
+ } else {
301
+ $install_url = wp_nonce_url(
302
+ admin_url('update.php?action=install-plugin&plugin=mailoptin'),
303
+ 'install-plugin_mailoptin'
304
+ )
305
+ ?>
306
+ <p><?php _e('Please Install MailOptin plugin first by clicking button below.');?></p>
307
+ <a href="<?php echo $install_url;?>" class="button" target="_blank"><?php _e('Install MailOptin plugin', 'cmp-coming-soon-maintenance');?></a>
308
+ <?php
309
+ } ?>
310
+ </td>
311
+
312
  </tr>
313
 
314
  <?php echo $this->render_settings->submit(); ?>
js/external/imagesloaded.pkgd.min.js CHANGED
@@ -1,5 +1,5 @@
1
  /*!
2
- * imagesLoaded PACKAGED v4.1.4
3
  * JavaScript is all like "You images are done yet or what?"
4
  * MIT License
5
  */
1
  /*!
2
+ * c PACKAGED v4.1.4
3
  * JavaScript is all like "You images are done yet or what?"
4
  * MIT License
5
  */
niteo-cmp.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: CMP - Coming Soon & Maintenance Plugin
4
  Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
5
  Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
6
- Version: 3.6.4
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
@@ -64,7 +64,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
64
 
65
  private function constants() {
66
  // define constants
67
- $this->define( 'CMP_VERSION', '3.6.4' );
68
  $this->define( 'CMP_DEBUG', FALSE );
69
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
70
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
@@ -545,6 +545,18 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
545
 
546
  // function to display CMP landing page
547
  public function cmp_displayPage() {
 
 
 
 
 
 
 
 
 
 
 
 
548
  // register html class for rendering of HTML elements in Themes
549
  $html = new CMP_Coming_Soon_and_Maintenance_Render_HTML();
550
 
@@ -570,7 +582,6 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
570
 
571
  }
572
 
573
-
574
  // finally render theme preview cmp_preview=true
575
  if ( file_exists( $this->cmp_theme_dir( $this->cmp_selectedTheme() ).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php') ) {
576
  require_once ( $this->cmp_theme_dir( $this->cmp_selectedTheme() ).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php' );
@@ -607,8 +618,8 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
607
  // Render CMP Theme mode if is activated and not in immediate redirect mode
608
  if ( $this->cmp_active() == '1' ) {
609
 
610
- // check if user logged in, page filters and access role
611
- if ( !is_user_logged_in() && $this->cmp_page_filter() ) {
612
 
613
  // if themes with countdown timer
614
  if ( in_array($this->cmp_selectedTheme(), $this->cmp_countdown_themes()) ){
3
  Plugin Name: CMP - Coming Soon & Maintenance Plugin
4
  Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
5
  Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
6
+ Version: 3.6.5
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
64
 
65
  private function constants() {
66
  // define constants
67
+ $this->define( 'CMP_VERSION', '3.6.5' );
68
  $this->define( 'CMP_DEBUG', FALSE );
69
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
70
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
545
 
546
  // function to display CMP landing page
547
  public function cmp_displayPage() {
548
+
549
+ // check for mailpoptin ajax
550
+ if ( isset($_GET['mailoptin-ajax']) ) {
551
+
552
+ $campaign_id = get_option('niteoCS_mailoptin_selected');
553
+ $campaign = MailOptin\Core\Repositories\OptinCampaignsRepository::get_optin_campaign_by_id($campaign_id);
554
+
555
+ if ( isset($_POST['optin_data']) && $_POST['optin_data']['optin_uuid'] == $campaign['uuid'] ) {
556
+ return true;
557
+ }
558
+
559
+ }
560
  // register html class for rendering of HTML elements in Themes
561
  $html = new CMP_Coming_Soon_and_Maintenance_Render_HTML();
562
 
582
 
583
  }
584
 
 
585
  // finally render theme preview cmp_preview=true
586
  if ( file_exists( $this->cmp_theme_dir( $this->cmp_selectedTheme() ).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php') ) {
587
  require_once ( $this->cmp_theme_dir( $this->cmp_selectedTheme() ).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php' );
618
  // Render CMP Theme mode if is activated and not in immediate redirect mode
619
  if ( $this->cmp_active() == '1' ) {
620
 
621
+ // check if user is bypassing roles or current page is on whitelist / blacklist
622
+ if ( !$this->cmp_roles_filter() && $this->cmp_page_filter() ) {
623
 
624
  // if themes with countdown timer
625
  if ( in_array($this->cmp_selectedTheme(), $this->cmp_countdown_themes()) ){
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KV2JF
4
  Tags: coming soon, landing page, launch page, maintenance mode, under construction
5
  Requires at least: 3.0
6
  Requires PHP: 5.3
7
- Tested up to: 5.2
8
- Stable tag: 3.6.4
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -49,6 +49,7 @@ Packed with functions like Whitelist/Blacklist to enable CMP only on specific pa
49
  <li><a href="https://wordpress.org/plugins/simpleanalytics/" target="_blank>Simple Analytics</a> fully compatible.</li>
50
  <li><a href="https://wordpress.org/plugins/mailpoet/" target="_blank>MailPoet – Emails and Newsletters in WordPress</a> fully integrated.</li>
51
  <li><a href="https://mailster.co/" target="_blank>Mailster – The Ultimate Newsletter Plugin for WordPress</a> fully integrated.</li>
 
52
  <li>We are working on more plugins to be compatible with CMP - feel free to send us suggestions what plugin you might need together with CMP.</li>
53
  </ul>
54
 
@@ -146,6 +147,12 @@ https://www.youtube.com/watch?v=uxuJfHzwdtE
146
  <p>Nothing is better than a good feedback! Please go to <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/">Plugin reviews</a> and rate it! Alternatively you can click on a Donate button too!:)</p>
147
 
148
  == Changelog ==
 
 
 
 
 
 
149
  <h4>CMP 3.6.4 - 14-Oct-19</h4>
150
  <ul>
151
  <li>Resolved persiting bug with http string added in social media links icons.</li>
4
  Tags: coming soon, landing page, launch page, maintenance mode, under construction
5
  Requires at least: 3.0
6
  Requires PHP: 5.3
7
+ Tested up to: 5.3
8
+ Stable tag: 3.6.5
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
49
  <li><a href="https://wordpress.org/plugins/simpleanalytics/" target="_blank>Simple Analytics</a> fully compatible.</li>
50
  <li><a href="https://wordpress.org/plugins/mailpoet/" target="_blank>MailPoet – Emails and Newsletters in WordPress</a> fully integrated.</li>
51
  <li><a href="https://mailster.co/" target="_blank>Mailster – The Ultimate Newsletter Plugin for WordPress</a> fully integrated.</li>
52
+ <li><a href="https://wordpress.org/plugins/mailoptin/" target="_blank>MailOptin – WordPress Popup, Optin Form, Email Newsletter Plugin</a> fully integrated.</li>
53
  <li>We are working on more plugins to be compatible with CMP - feel free to send us suggestions what plugin you might need together with CMP.</li>
54
  </ul>
55
 
147
  <p>Nothing is better than a good feedback! Please go to <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/">Plugin reviews</a> and rate it! Alternatively you can click on a Donate button too!:)</p>
148
 
149
  == Changelog ==
150
+ <h4>CMP 3.6.5 - 28-Oct-19</h4>
151
+ <ul>
152
+ <li>MailOPtin plugin integration.</li>
153
+ <li>Added compatibility with WordPress 5.3 release.</li>
154
+ </ul>
155
+
156
  <h4>CMP 3.6.4 - 14-Oct-19</h4>
157
  <ul>
158
  <li>Resolved persiting bug with http string added in social media links icons.</li>
themes/construct/construct-theme.php CHANGED
@@ -77,13 +77,13 @@
77
  } ?>
78
  </section>
79
 
80
- <section class="section section-banner" id="banner-wrapper">
81
  <?php
82
  if ( method_exists ( $html, 'cmp_background' ) ) {
83
  echo $html->cmp_background( $banner_type, $themeslug );
84
 
85
  } ?>
86
- </section>
87
 
88
 
89
  <section class="section section-body">
77
  } ?>
78
  </section>
79
 
80
+ <div id="banner-wrapper">
81
  <?php
82
  if ( method_exists ( $html, 'cmp_background' ) ) {
83
  echo $html->cmp_background( $banner_type, $themeslug );
84
 
85
  } ?>
86
+ </div>
87
 
88
 
89
  <section class="section section-body">
themes/construct/style.css CHANGED
@@ -1,6 +1,6 @@
1
  /*
2
  Theme Name: Construct
3
- Theme URI: http://cmp.niteothemes.com/?cmp_preview=true&selector=true&theme=construct
4
  Author: NiteoThemes
5
  Author URI: https://niteothemes.com
6
 
@@ -30,7 +30,7 @@ img {
30
  :focus {outline:none;}
31
  h1,h2,h3,h4,h5,h6{font-weight: 400;}
32
  .text-logo {font-size: 1.8em;}
33
- .section {padding: 50px 2em;text-align: center;
34
  position: relative;
35
  display: -moz-flex;
36
  display: -ms-flex;
@@ -52,13 +52,15 @@ h1,h2,h3,h4,h5,h6{font-weight: 400;}
52
  -ms-flex-positive: 1;
53
  flex-grow: 1;
54
  -webkit-flex-grow: 1;
55
- -moz-flex-grow: 1;}
 
 
56
  .section-logo {max-width:100%; margin: 0 auto;}
57
  .section-logo img {max-width: 100%;max-height: 300px;}
58
- .section-banner{height: 700px;overflow:hidden;}
59
  .section-body p{width:70%;max-width: 900px;margin:0.5em auto;}
60
- .section-social{background-color: #f8f8f8;}
61
- .section-footer{background-color: #2a2829;color:#a3a1a2;padding: 1em;font-size:1em;}
62
  .background-overlay{position: absolute;top: 0;right: 0;bottom: 0;left: 0;}
63
  #background-image, .video-banner{position: absolute;top: 0;right: 0;bottom: 0;left: 0;background-attachment: scroll!important;background-position: center center;background-repeat: no-repeat;background-size: cover;}
64
  #background-image {opacity: 0; -webkit-transition: opacity 400ms; transition: opacity 400ms;}
@@ -67,15 +69,15 @@ h1,h2,h3,h4,h5,h6{font-weight: 400;}
67
  #background-image.pattern{background-size: initial; background-repeat: repeat;}
68
  .social-list{padding:0;margin: 0;}
69
  .social-list li{list-style: none;display: inline-block; padding: 0 5px;}
70
- .section-body form{width: 400px;max-width:100%;margin: 0 auto;margin-top: 70px;margin-bottom: 30px;text-align:left;}
71
- .section-body form br {display: none;}
72
- label {display: block;padding-bottom: 5px;text-indent: 5px;font-size:.9em;}
73
- input {display: inline-block;font-size: 0.9em;line-height: 3em;height: 3em;-webkit-box-sizing: border-box;box-sizing: border-box;vertical-align: middle;margin-bottom: 10px;}
74
- input[type="email"],
75
- input[type="text"],
76
- textarea {width: calc(100% - 2px);border-radius:5px; background-color: #f8f8f8;text-indent: 15px;font-style: italic;border: 1px solid #dcdcdc; }
77
- input[type="submit"] {padding: 0 1em;color: white;font-weight:700;min-width:120px;border: none;border-radius:5px;letter-spacing: 1px;cursor:pointer;}
78
- input[type="text"] {width: calc(100% - 2px);}
79
  .cmp-subscribe input[type="email"] {width:280px; border-top-right-radius:0;border-bottom-right-radius:0;}
80
  .cmp-subscribe input[type="submit"] {margin-left:-7px;width: 120px;border-top-left-radius:0;border-bottom-left-radius:0;}
81
  .social-list a{display: block;height: 3em;width: 3em;line-height: 3em;background: transparent;-webkit-transition: background 300ms linear;transition: background 300ms linear;border-radius: 5px;}
@@ -146,7 +148,7 @@ div.wpcf7-response-output { border:none;margin: 0; padding: 0;}
146
 
147
 
148
  @media only screen and (max-width : 1920px) {
149
- .section-banner {
150
  height: 500px;
151
  }
152
  }
@@ -154,20 +156,20 @@ div.wpcf7-response-output { border:none;margin: 0; padding: 0;}
154
  @media only screen and (max-width : 1024px) {
155
  body {font-size: 16px!important;}
156
  h1:not(.text-logo),h2, h3,h4,h5,h6,.text-logo-wrapper {font-size: 1.8em!important;}
157
- .section-banner { height: 300px; }
158
 
159
  }
160
 
161
 
162
  @media only screen and (max-width : 680px) {
163
  body {font-size: 15px!important;}
164
- .section-banner {height: 250px;}
165
  .social-list a {height: 2em; width: 2em;line-height: 2em;}
166
  }
167
 
168
  @media only screen and (max-width : 480px) {
169
  .section:not(.section-banner) {padding: 20px 10px;}
170
- .section-banner {
171
  height: 250px;
172
  }
173
 
1
  /*
2
  Theme Name: Construct
3
+ Theme URI: https://niteothemes.com/cmp-coming-soon-maintenance/?theme=construct
4
  Author: NiteoThemes
5
  Author URI: https://niteothemes.com
6
 
30
  :focus {outline:none;}
31
  h1,h2,h3,h4,h5,h6{font-weight: 400;}
32
  .text-logo {font-size: 1.8em;}
33
+ section {padding: 50px 2em;text-align: center;
34
  position: relative;
35
  display: -moz-flex;
36
  display: -ms-flex;
52
  -ms-flex-positive: 1;
53
  flex-grow: 1;
54
  -webkit-flex-grow: 1;
55
+ -moz-flex-grow: 1;
56
+ max-width: 960px;
57
+ margin: 0 auto}
58
  .section-logo {max-width:100%; margin: 0 auto;}
59
  .section-logo img {max-width: 100%;max-height: 300px;}
60
+ #banner-wrapper{height: 700px;overflow:hidden;position:relative;}
61
  .section-body p{width:70%;max-width: 900px;margin:0.5em auto;}
62
+ .section-social{background-color: #f8f8f8;max-width: 100%;width: 100%;box-sizing: border-box;}
63
+ .section-footer{background-color: #2a2829;color:#a3a1a2;padding: 1em;font-size:1em;text-align:center}
64
  .background-overlay{position: absolute;top: 0;right: 0;bottom: 0;left: 0;}
65
  #background-image, .video-banner{position: absolute;top: 0;right: 0;bottom: 0;left: 0;background-attachment: scroll!important;background-position: center center;background-repeat: no-repeat;background-size: cover;}
66
  #background-image {opacity: 0; -webkit-transition: opacity 400ms; transition: opacity 400ms;}
69
  #background-image.pattern{background-size: initial; background-repeat: repeat;}
70
  .social-list{padding:0;margin: 0;}
71
  .social-list li{list-style: none;display: inline-block; padding: 0 5px;}
72
+ .section-body .cmp-subscribe form{width: 400px;max-width:100%;margin: 0 auto;margin-top: 70px;margin-bottom: 30px;text-align:left;}
73
+ .section-body .cmp-subscribe form br {display: none;}
74
+ .cmp-subscribe label {display: block;padding-bottom: 5px;text-indent: 5px;font-size:.9em;}
75
+ .cmp-subscribe input {display: inline-block;font-size: 0.9em;line-height: 3em;height: 3em;-webkit-box-sizing: border-box;box-sizing: border-box;vertical-align: middle;margin-bottom: 10px;}
76
+ .cmp-subscribe input[type="email"],
77
+ .cmp-subscribe input[type="text"],
78
+ .cmp-subscribe textarea {width: calc(100% - 2px);border-radius:5px; background-color: #f8f8f8;text-indent: 15px;font-style: italic;border: 1px solid #dcdcdc; }
79
+ .cmp-subscribe input[type="submit"] {padding: 0 1em;color: white;font-weight:700;min-width:120px;border: none;border-radius:5px;letter-spacing: 1px;cursor:pointer;}
80
+ .cmp-subscribe input[type="text"] {width: calc(100% - 2px);}
81
  .cmp-subscribe input[type="email"] {width:280px; border-top-right-radius:0;border-bottom-right-radius:0;}
82
  .cmp-subscribe input[type="submit"] {margin-left:-7px;width: 120px;border-top-left-radius:0;border-bottom-left-radius:0;}
83
  .social-list a{display: block;height: 3em;width: 3em;line-height: 3em;background: transparent;-webkit-transition: background 300ms linear;transition: background 300ms linear;border-radius: 5px;}
148
 
149
 
150
  @media only screen and (max-width : 1920px) {
151
+ #banner-wrapper {
152
  height: 500px;
153
  }
154
  }
156
  @media only screen and (max-width : 1024px) {
157
  body {font-size: 16px!important;}
158
  h1:not(.text-logo),h2, h3,h4,h5,h6,.text-logo-wrapper {font-size: 1.8em!important;}
159
+ #banner-wrapper { height: 300px; }
160
 
161
  }
162
 
163
 
164
  @media only screen and (max-width : 680px) {
165
  body {font-size: 15px!important;}
166
+ #banner-wrapper {height: 250px;}
167
  .social-list a {height: 2em; width: 2em;line-height: 2em;}
168
  }
169
 
170
  @media only screen and (max-width : 480px) {
171
  .section:not(.section-banner) {padding: 20px 10px;}
172
+ #banner-wrapper {
173
  height: 250px;
174
  }
175
 
themes/countdown/countdown-theme.php CHANGED
@@ -46,12 +46,12 @@
46
  body {font-size:<?php echo esc_attr( $content_font['size'] );?>px;}
47
  h1,h2,h3,h4,h5,h6 {font-family:'<?php echo esc_attr( $heading_font['family'] );?>', 'sans-serif';}
48
  a {color:<?php echo esc_attr( $font_color ); ?>;}
49
- input[type="submit"] {background-color: <?php echo esc_attr( $active_color );?>;}
50
- ::-webkit-input-placeholder {color: <?php echo esc_attr( $font_color_light );?>;}
51
- ::-moz-placeholder {color: <?php echo esc_attr( $font_color_light );?>;}
52
- :-ms-input-placeholder {color: <?php echo esc_attr( $font_color_light );?>;}
53
- ::-moz-placeholder {color: <?php echo esc_attr( $font_color_light );?>;}
54
- .input-icon:before,input[type="email"],input[type="text"]{color: <?php echo esc_attr( $font_color_light );?>;}
55
  /* input[type="email"],input[type="text"] {border:1px solid <?php echo esc_attr( $font_color_light );?>;} */
56
  footer, footer a {color: <?php echo esc_attr( $font_color_light );?>;}
57
  .social-list.body a {background-color: <?php echo esc_attr( $font_color ); ?>;}
46
  body {font-size:<?php echo esc_attr( $content_font['size'] );?>px;}
47
  h1,h2,h3,h4,h5,h6 {font-family:'<?php echo esc_attr( $heading_font['family'] );?>', 'sans-serif';}
48
  a {color:<?php echo esc_attr( $font_color ); ?>;}
49
+ .cmp-subscribe input[type="submit"] {background-color: <?php echo esc_attr( $active_color );?>;}
50
+ .cmp-subscribe ::-webkit-input-placeholder {color: <?php echo esc_attr( $font_color_light );?>;}
51
+ .cmp-subscribe ::-moz-placeholder {color: <?php echo esc_attr( $font_color_light );?>;}
52
+ .cmp-subscribe :-ms-input-placeholder {color: <?php echo esc_attr( $font_color_light );?>;}
53
+ .cmp-subscribe ::-moz-placeholder {color: <?php echo esc_attr( $font_color_light );?>;}
54
+ .input-icon:before, .cmp-subscribe input[type="email"],.cmp-subscribe input[type="text"]{color: <?php echo esc_attr( $font_color_light );?>;}
55
  /* input[type="email"],input[type="text"] {border:1px solid <?php echo esc_attr( $font_color_light );?>;} */
56
  footer, footer a {color: <?php echo esc_attr( $font_color_light );?>;}
57
  .social-list.body a {background-color: <?php echo esc_attr( $font_color ); ?>;}
themes/countdown/style.css CHANGED
@@ -1,6 +1,6 @@
1
  /*
2
  Theme Name: Countdown
3
- Theme URI: http://cmp.niteothemes.com/?cmp_preview=true&selector=true&theme=countdown
4
  Author: NiteoThemes
5
  Author URI: https//niteothemes.com
6
 
@@ -158,7 +158,7 @@ textarea {
158
  outline: none;
159
  }
160
 
161
- textarea {
162
  overflow: auto;
163
  padding: 0;
164
  border-radius: 5px;
@@ -452,18 +452,18 @@ footer {
452
  margin-top: 0;
453
  }
454
 
455
- .inner-content form {
456
  max-width: 400px;
457
  margin: 0 auto;
458
  width: 100%;
459
  text-align: left;
460
  }
461
 
462
- .inner-content form br {
463
  display: none;
464
  }
465
 
466
- input {
467
  display: inline-block;
468
  line-height: 3em;
469
  height: 3em;
@@ -472,7 +472,7 @@ input {
472
  margin-bottom: 10px;
473
  }
474
 
475
- label {
476
  display: block;
477
  text-align: left;
478
  font-size: .8em;
@@ -491,7 +491,7 @@ label {
491
  padding-left: 10px;
492
  }
493
 
494
- input[type="email"].subscribe-input {
495
  text-indent: 35px;
496
  }
497
 
@@ -501,8 +501,8 @@ input[type="email"].subscribe-input {
501
  }
502
 
503
 
504
- input[type="email"],
505
- input[type="text"] {
506
  width: 100%;
507
  background-color: rgba(0, 0, 0, 0.5);
508
  text-indent: 15px;
@@ -519,7 +519,7 @@ input[type="text"] {
519
  border-bottom-right-radius: 0;
520
  }
521
 
522
- input[type="submit"] {
523
  width: 25%;
524
  padding: 0;
525
  border-radius: 5px;
1
  /*
2
  Theme Name: Countdown
3
+ Theme URI: https://niteothemes.com/cmp-coming-soon-maintenance/?theme=countdown
4
  Author: NiteoThemes
5
  Author URI: https//niteothemes.com
6
 
158
  outline: none;
159
  }
160
 
161
+ .cmp-subscribe textarea {
162
  overflow: auto;
163
  padding: 0;
164
  border-radius: 5px;
452
  margin-top: 0;
453
  }
454
 
455
+ .inner-content .cmp-subscribe form {
456
  max-width: 400px;
457
  margin: 0 auto;
458
  width: 100%;
459
  text-align: left;
460
  }
461
 
462
+ .inner-content .cmp-subscribe form br {
463
  display: none;
464
  }
465
 
466
+ .cmp-subscribe input {
467
  display: inline-block;
468
  line-height: 3em;
469
  height: 3em;
472
  margin-bottom: 10px;
473
  }
474
 
475
+ .cmp-subscribe label {
476
  display: block;
477
  text-align: left;
478
  font-size: .8em;
491
  padding-left: 10px;
492
  }
493
 
494
+ .cmp-subscribe input[type="email"].subscribe-input {
495
  text-indent: 35px;
496
  }
497
 
501
  }
502
 
503
 
504
+ .cmp-subscribe input[type="email"],
505
+ .cmp-subscribe input[type="text"] {
506
  width: 100%;
507
  background-color: rgba(0, 0, 0, 0.5);
508
  text-indent: 15px;
519
  border-bottom-right-radius: 0;
520
  }
521
 
522
+ .cmp-subscribe input[type="submit"] {
523
  width: 25%;
524
  padding: 0;
525
  border-radius: 5px;
themes/hardwork/style.css CHANGED
@@ -1,6 +1,6 @@
1
  /*
2
  Theme Name: Hardwork
3
- Theme URI: http://cmp.niteothemes.com/?cmp_preview=true&selector=true&theme=hardwork
4
  Author: NiteoThemes
5
  Author URI: https://niteothemes.com
6
 
@@ -8,7 +8,7 @@ Normalizing styles have been helped along thanks to the fine work of
8
  Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normaalize.css/
9
  */
10
 
11
- body{
12
  display: flex;
13
  flex-direction: column;
14
  margin:0;
@@ -53,8 +53,6 @@ img {
53
  }
54
 
55
 
56
-
57
-
58
  .graphic-logo {
59
  width: auto;
60
  max-width: 500px;
1
  /*
2
  Theme Name: Hardwork
3
+ Theme URI: https://niteothemes.com/cmp-coming-soon-maintenance/?theme=hardwork
4
  Author: NiteoThemes
5
  Author URI: https://niteothemes.com
6
 
8
  Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normaalize.css/
9
  */
10
 
11
+ body {
12
  display: flex;
13
  flex-direction: column;
14
  margin:0;
53
  }
54
 
55
 
 
 
56
  .graphic-logo {
57
  width: auto;
58
  max-width: 500px;