getOpts(); } function getOpts() { if (isset($this->opts) AND !empty($this->opts)) {return;} $this->opts=get_option("vrwaff"); if (!empty($this->opts)) {return;} $this->opts=Array ('title' => 'Vacation Rentals:', 'afID' => '', 'border' => '','homepage'=>'1','onlypost'=>'0','runplugin'=>'1', 'bordstyle' => '1', 'width' => '100%', 'height' => '1','pos' => 'Top','change' => '5','margin' => '20','featured' => '','message' => 'Book your vacation rentals here and save 8% with a coupon: PROMO! These luxurious rentals, nestled in the finest resort areas, offer complete furnishing and essential amenities to enhance your stay. Bid farewell to endless emails and phone calls - secure your dream vacation rental now using the convenient search box above.'); } function admin_menu() { global $vrwaff_version; if (isset($_POST["vrwaff_submit"]) && isset($_POST['nonce']) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'])), 'vrwaff_update' )) { $sanitized=Array(); $sanitized['title'] = (isset($_POST['title'])?sanitize_text_field(wp_unslash($_POST['title'])):'Vacation Rentals:'); $sanitized['afID'] = (isset($_POST['afID'])?sanitize_text_field(wp_unslash($_POST['afID'])):''); $sanitized['border'] = (isset($_POST['border'])?sanitize_text_field(wp_unslash($_POST['border'])):'0'); $sanitized['homepage'] = (isset($_POST['homepage'])?sanitize_text_field(wp_unslash($_POST['homepage'])):'0'); $sanitized['onlypost'] = (isset($_POST['onlypost'])?sanitize_text_field(wp_unslash($_POST['onlypost'])):'0'); $sanitized['runplugin'] = (isset($_POST['runplugin'])?sanitize_text_field(wp_unslash($_POST['runplugin'])):'0'); $sanitized['bordstyle'] = (isset($_POST['bordstyle'])?sanitize_text_field(wp_unslash($_POST['bordstyle'])):'1'); $sanitized['width'] = (isset($_POST['width'])?sanitize_text_field(wp_unslash($_POST['width'])):'100%'); $sanitized['height'] = (isset($_POST['height'])?sanitize_text_field(wp_unslash($_POST['height'])):'1'); $sanitized['pos'] = (isset($_POST['pos'])?sanitize_text_field(wp_unslash($_POST['pos'])):'Top'); $sanitized['change'] = (isset($_POST['change'])?sanitize_text_field(wp_unslash($_POST['change'])):'5'); $sanitized['margin'] = (isset($_POST['margin'])?sanitize_text_field(wp_unslash($_POST['margin'])):'20'); $sanitized['message'] = (isset($_POST['message'])?sanitize_textarea_field(wp_unslash($_POST['message'])):''); $sanitized['featured'] = (isset($_POST['featured'])?sanitize_text_field(wp_unslash($_POST['featured'])):''); $this->opts=$sanitized; update_option('vrwaff',$this->opts); echo '

Options Updated!

'; } $this->getOpts(); $hashes='coupon=PROMO&a_id='.$this->opts['afID']; ?>

Affiliate Ads for Vacation Rentals (V )

For further Information visit the Plugin Site.
Notes:
- You will receive 7% of the base rent price if a traveler has books a vacation by clicking on your affiliate form/link. The average base rent of a booking on our platform is about $3,000. You will receive 7% of that rent.
- To place an ad block in the widget area (sidebar), go to the 'Appearance -> Widgets' SubPanel, add the "Affiliate Ads for Vacation Rentals" to your sidebar and configure it.
- The ad block can be inserted using the shortcode API: [vrwaff]. Place [vrwaff] in any post, page, or widget to display the ad block.
- If you see only its name instead of the plugin - your theme, removes the tags. Choose a different theme or use widgets.
- Up to 3 ad blocks can be placed on each page. If there are more of them, an empty window will be displayed.

Border Radius:
border-radius:9px;">
">

getOpts(); $title = $this->opts['title']; $afID = $this->opts['afID']; $border=($this->opts['border']=='1'?1:0); $itw=200; $ith=190; $margin=(isset($this->opts ['margin'])?(int)$this->opts ['margin']:20); $marg=floor($margin/2);//magin to apply: half from 1 side + half from 2 side $width=$this->opts['width']; $height=$this->opts['height']; if($width!= "100%"){$width= (($itw+$margin)*$width+ ($margin*$border)).'px';} $height=(($ith+$margin)*$height+($margin*$border)).'px'; $refer=esc_url(home_url( $wp->request )); if(strpos($title,'ebook')!==false || strpos($title,'e-book')!==false){$title='';} $hashes='coupon=PROMO&a_id='.$afID.'&referer='.$refer; $featured=''; wp_enqueue_script ( 'js', plugins_url('/js.js', __FILE__),array(),$vrwaff_version,array('in_footer' => true,'strategy' => 'defer') ); $allowed_tags = wp_kses_allowed_html( 'post' ); $ourdiv='

'.($title!=''?"".$title."":"").' Vacation Rentals' .($this->opts['message']!=''?wp_kses(str_replace("\n","
",$this->opts['message']),$allowed_tags):"").($featured!=''?"
Featured:
".$featured:"").'

'; return $ourdiv; } var $vrwaff_blocks=0; function vrwaff_out_to_page($content) { global $vrwaff_version,$vrwaff_blocks; $this->getOpts(); if(!isset($this->opts['runplugin']) || $this->opts['runplugin']!="1"){return $content;}// exit if plugin blocked if(is_home() && (!isset($this->opts['homepage']) || $this->opts['homepage']!="1")){return $content;}// exit if homepage blocked if(!is_single() && !is_home() && (isset($this->opts['onlypost']) && $this->opts['onlypost']=="1")){return $content;}// exit if for post only if ($vrwaff_blocks==1){return $content;} $vrwaff_blocks=1;// exit for pages with multiple posts - show only in 1 post $ourdiv=$this->vrwaff_ad_block(); if ($this->opts['pos'] == "Top") {$content = '
'.$ourdiv.'

'.$content;} if ($this->opts['pos'] != "Top") {$content = $content.'
'.$ourdiv.'
';} return $content; } }//class }//if $vrwaff = new vrwaff(); function vrwaff_menu() { global $vrwaff; if (function_exists('add_options_page')) {add_options_page('Affiliate Ads for Vacation Rentals', 'Affiliate Ads for Vacation Rentals', 'administrator', 'options_page_slug', array(&$vrwaff, 'admin_menu'));} //tag title, text link in menu, , ,[class,function] } add_action('admin_menu', 'vrwaff_menu'); add_filter('the_content', array($vrwaff, 'vrwaff_out_to_page')); //out to page add_shortcode('vrwaff', array($vrwaff, 'vrwaff_ad_block')); // ------- WIDGET ----------- add_action('widgets_init', 'vrwaff_widget'); function vrwaff_widget() { register_widget('vrwaff_Widget');} class vrwaff_Widget extends WP_Widget { function __construct() { $widget_ops = ['name' => 'Affiliate Ads for Vacation Rentals','description' => 'This widget creates a graphic banner to display Vacation Rentals ads.']; parent::__construct( 'vrwaff_Widget', 'Affiliate Ads for Vacation Rentals widget', $widget_ops ); } function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = sanitize_text_field($new_instance['title']); $instance['afID'] = sanitize_text_field($new_instance['afID']); $instance['border'] = (isset($new_instance['border']) && $new_instance['border']=="1"?"1":"0"); $instance['bordstyle'] = sanitize_text_field($new_instance['bordstyle']); $instance['height'] = sanitize_text_field($new_instance['height']); $instance['width'] = sanitize_text_field($new_instance['width']); $instance['change'] = sanitize_text_field($new_instance['change']); $instance['margin'] = sanitize_text_field($new_instance['margin']); $instance['message'] = sanitize_textarea_field($new_instance['message']); return $instance; } function form($instance) { $defaults = array('title' => 'Vacation Rentals', 'afID' => '0','border' => '1', 'bordstyle' => '1', 'width' => '3', 'height' => '5', 'change' => '5', 'margin' => '20', 'message' => 'Book your vacation rentals here and save 8% with a coupon: PROMO! These luxurious rentals, nestled in the finest resort areas, offer complete furnishing and essential amenities to enhance your stay. Bid farewell to endless emails and phone calls - secure your dream vacation rental now using the convenient search box above.'); $instance = wp_parse_args((array) $instance, $defaults); ?>


text-align:center;padding:3px 3px 7px;background:#fff;width:90px;display:inline-block;border-radius:9px;">
text-align:center;padding:3px 3px 7px;background:#fff;width:90px;display:inline-block;">

request )); $hashes='coupon=PROMO&a_id='.$instance['afID'].'&referer='.$refer; wp_enqueue_script ( 'js', plugins_url('/js.js', __FILE__),array(),$vrwaff_version,array('in_footer' => true,'strategy' => 'defer') ); ?>

Vacation Rentals ",$instance['message']),$allowed_tags):"")."

"; echo wp_kses($after_widget,$allowed_tags); } } ?>