function ewic_earn_xtra_money() { wp_enqueue_script('ewic-wnew'); $aff_id = ewic_get_aff_option('ewic_affiliate_info', 'ewic_aff_id', ''); $aff_name = ewic_get_aff_option('ewic_affiliate_info', 'ewic_aff_name', ''); $aff_email = ewic_get_aff_option('ewic_affiliate_info', 'ewic_aff_email', ''); if ($aff_id != '') { $iscon = 'style="display:none;"'; $isdis = ''; $ists = 'Connected'; $intext = 'Disconnect'; $dnonce = 'data-nonce="' . wp_create_nonce('ewicaffiliate') . '"'; $dcmd = 'data-cmd="ewic_affiliate_dis"'; } else { $iscon = ''; $isdis = 'display:none;'; $ists = ''; $intext = 'Connect'; $dnonce = 'data-nonce="' . wp_create_nonce('ewicaffiliate') . '"'; $dcmd = 'data-cmd="ewic_affiliate_con"'; } ob_start(); ?> <div id="ewic-not-yet" <?php echo $iscon; ?> > <h3>If you don't have a GhozyLab Affiliate account yet, you can sign up today for free <a href="https://secure.ghozylab.com/affiliate-area/" target="_blank">here</a></h3> <p class="ewic-iscon" style="font-style:italic; color:#666; border-bottom: 1px dotted #CCC; margin-top: 35px; padding-bottom: 5px;"><?php _e('Fill your Affiliate Account Email or Payment Email and press Connect button to start earn extra Money with us!'); ?> </p> </div> <div id="ewic-aff-registered" style="width: auto;<?php echo $isdis; ?> "> <h3 id="ewic-aff-holder">Hi, <?php echo $aff_name . ' (' . $aff_email . ' )'; ?> </h3> <hr /> </div> <form method="post"> <?php settings_fields('ewic_aff_section'); ?> <table class="form-table"> <tbody> <tr valign="top"> <th style="width:155px !important;" scope="row" valign="top"> <?php _e('Account Email or Payment Email'); ?> </th> <td> <input id="ewic_aff_email" name="ewic_aff_email" type="text" class="regular-text" value="<?php esc_attr_e($aff_email); ?> " /> <label id="is-status" style="color:green; font-style:italic;" class="description" for="ewic_aff_section_email"><?php echo $ists; ?> </label> <?php if (false !== $aff_id) { ?> <?php wp_nonce_field('ewic_aff_section_nonce', 'ewic_aff_section_nonce'); ?> <br /><input style="margin-top: 10px;" <?php echo $dnonce; ?> <?php echo $dcmd; ?> type="submit" class="button-secondary" id="ewic-aff" name="ewic-aff" value="<?php echo $intext; ?> "/><span id="loader"></span><br /><br /> <span class="ewic-aff-note">NOTE: To respect <a href="https://wordpress.org/plugins/about/guidelines/" target="_blank">Plugin Guidelines</a> ( point 10 ) so by pressing the connect button that means you are agree to displaying <strong>Powered by</strong> link in your slider footer</span> <?php } ?> </td> </tr> </tbody> </table> </form> <hr style="margin-bottom:20px;"> <div class="feature-section"> <img src="<?php echo EWIC_URL . '/images/assets/aff-sc.jpg'; ?> " class="ewic-affiliate-screenshots"/> <h4><?php _e('How does it work?', 'image-slider-widget'); ?> </h4> <p><?php _e('After successfully registered with our Affiliate program what you have to do just :<ul style="margin-left: 30px;list-style-type: circle;"><li>Fill your Affiliate Account Email or Payment Email in field above and Hit Connect button</li><li>After connected you will see green connected status</li><li>Check your slider and you will find your affiliate link in the bottom of your slider like in the right side screenshot</li><li>Now when individuals follow that link and subsequently make a purchase, you will be credited for the transaction and you will receive a payout</li><li>Congratulations! You are ready to start to earn extra money :)</li></ul>', 'image-slider-widget'); ?> </p> </div> <?php echo ob_get_clean(); }
function ewic_generate_slider($id, $iswidget) { ob_start(); $allimgs = get_post_meta($id, 'ewic_meta_select_images', true); $imgsize = get_post_meta($id, 'ewic_meta_thumbsizelt', true); $easing = get_post_meta($id, 'ewic_meta_settings_effect', true); $tthumb = get_post_meta($id, 'ewic_meta_slide_timthumb', true); $smartttl = get_post_meta($id, 'ewic_meta_settings_smartttl', true); get_post_meta($id, 'ewic_meta_slide_auto', true) == 'on' ? $disenauto = 'true' : ($disenauto = 'false'); get_post_meta($id, 'ewic_meta_slide_title', true) == 'on' ? $disenttl = 'true' : ($disenttl = 'false'); get_post_meta($id, 'ewic_meta_slide_lightbox_autoslide', true) == 'on' ? $disenlbauto = 'true' : ($disenlbauto = 'false'); if (is_array($imgsize)) { if ($imgsize['width'] == 'auto' || $imgsize['width'] == '') { $sw = '0'; } else { $sw = $imgsize['width']; } if ($imgsize['height'] == 'auto') { $autoheight = 'true'; } else { $autoheight = 'false'; echo '<style>#ewic-con' . $iswidget . '-' . $id . ' .bx-wrapper, #ewic-con' . $iswidget . '-' . $id . ' .bx-viewport, #ewic-con' . $iswidget . '-' . $id . ' .bx-wrapper img { max-height: ' . $imgsize['height'] . 'px;}</style>'; } } else { $autoheight = 'true'; $sw = '0'; } if (is_array($allimgs)) { //Generate HTML Markup echo '<div id="preloader' . $iswidget . '-' . $id . '" class="sliderpreloader"></div>'; echo '<ul style="display:none;" class="bxslider' . $iswidget . '-' . $id . '">'; foreach ($allimgs as $dat) { // Timthumb Option @since @since 1.1.17 if ($sw != '0' && $tthumb == 'on') { $timg = wp_get_attachment_image_src($dat['images'], 'full'); $img = ewic_generate_timthumb($timg[0], $sw, $imgsize['height']); $imgtrgt = $timg[0]; } else { $timg = wp_get_attachment_image_src($dat['images'], 'full'); $img = $timg[0]; $imgtrgt = $img; } // End Timthumb if ($dat['ttl']) { if ($smartttl == 'on') { $isttl = 'title="' . ucwords(str_replace('-', ' ', $dat['ttl'])) . '"'; } else { $isttl = 'title="' . $dat['ttl'] . '"'; } } else { $isttl = ''; } if (get_post_meta($id, 'ewic_meta_slide_lightbox', true) == 'on') { echo '<li class="ewic-slider"><a href="' . $imgtrgt . '" ' . $isttl . ' rel="ewic' . $iswidget . 'prettyPhoto[' . $id . ']"><img ' . $isttl . ' class="ewic-wid-imgs" src="' . $img . '" /></a></li>'; } else { echo '<li class="ewic-slider"><img ' . $isttl . ' class="ewic-wid-imgs" src="' . $img . '" /></li>'; } } echo '</ul>'; if (ewic_get_aff_option('ewic_affiliate_info', 'ewic_aff_id', '')) { echo '<span class="ewc-aff-link">Powered by <a href="https://secure.ghozylab.com/demo/?ref=' . ewic_get_aff_option('ewic_affiliate_info', 'ewic_aff_id', '') . '&goto=ewic" target="_blank">Easy Image Slider Plugin</a></span>'; } echo '<br>'; //Generate Slider Script echo '<script type="text/javascript"> jQuery(document).ready(function() { jQuery("#preloader' . $iswidget . '-' . $id . '").fadeOut(2000, function () { jQuery(".bxslider' . $iswidget . '-' . $id . ', .ewc-aff-link").fadeIn(3000); jQuery(".bxslider' . $iswidget . '-' . $id . '").bxSlider({ slideWidth: ' . $sw . ', slideMargin: 10, minSlides: 1, pager: false, useCSS: false, easing: "' . $easing . '", auto: ' . $disenauto . ', autoControls: true, stopAuto: false, speed: 2000, pause: ' . get_post_meta($id, 'ewic_meta_slide_delay', true) . '000, adaptiveHeight: ' . $autoheight . ', adaptiveHeightSpeed: 700, controls: true, preloadImages: "visible", infiniteLoop: true, captions: ' . $disenttl . ', autoHover: true, mode: "' . get_post_meta($id, 'ewic_meta_slide_style', true) . '", onSlideBefore: function() { jQuery(".bxslider' . $iswidget . '-' . $id . ' .ewic-caption").slideUp(); }, onSlideAfter: function() { jQuery("."+jQuery(".bxslider' . $iswidget . '-' . $id . '").parent().next().find(".bx-controls-auto").find("a").attr("class")).trigger("click"); jQuery(".bxslider' . $iswidget . '-' . $id . ' .ewic-caption").slideDown(); } }); jQuery(".bx-clone a").removeAttr( "rel" ); ' . (get_post_meta($id, 'ewic_meta_slide_nav', true) != 'always' ? 'jQuery( ".bxslider' . $iswidget . '-' . $id . '" ).parent().parent().addClass( "navcontroller" );' : '') . ' jQuery("a[rel^=\'ewic' . $iswidget . 'prettyPhoto[' . $id . ']\']").ewcPhoto({theme: "ewc_default", allow_expand: false, deeplinking: false, slideshow:' . get_post_meta($id, 'ewic_meta_slide_lightbox_delay', true) . '000, autoplay_slideshow:' . $disenlbauto . ', social_tools:false}); }); }); </script>'; } $res = ob_get_clean(); return $res; }