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.
';
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);
?>