Tweet about Advertwhirl. | Donate | Advertwhirl Support | Follow Mobile Sentience
Version: 1.0.2
License: GPL2
Author: Max Jonathan Spaulding - Mobile Sentience LLC
Author URI: http://www.mobilesentience.com
Stable tag: 1.0.2
*/
if(!class_exists('AdvertwhirlPlugin')){
require_once('AdvertwhirlPlugin.php');
require_once('libs/AdvertwhirlAllocations.php');
$advertwhirlPlugin = AdvertwhirlPlugin::GetInstance();
function_exists('register_activation_hook')?register_activation_hook(__FILE__, array(&$advertwhirlPlugin, 'ActivatePlugin')):add_action('activate_'.__FILE__, array(&$advertwhirlPlugin, 'ActivatePlugin'));
function_exists('register_deactivation_hook')?register_deactivation_hook(__FILE__, array(&$advertwhirlPlugin, 'DeactivatePlugin')):add_action('deactivate_'.__FILE__, array(&$advertwhirlPlugin, 'DeactivatePlugin'));
}
if(!class_exists('AdvertwhirlCampaignWidget')){
require_once('AdvertwhirlCampaignWidget.php');
add_action('widgets_init', create_function('', 'return register_widget("AdvertwhirlCampaignWidget");'));
}
if(!function_exists('advertwhirl_get_ad')){
function advertwhirl_get_ad($campaign){
global $wp_version;
$name = "Advertwhirl";
$options = maybe_unserialize(get_option($name . "_options"));
if(isset($options['adcampaigns'][$campaign])){
// Get the ad
$allocations = $options['adcampaigns'][$campaign]['allocations'];
if(isset($allocations) && sizeof($allocations) > 0){
foreach($allocations as $index => $allocation){
if(VerifyAllocation($allocation)){
return AllocateAd($campaign, $index, $allocation);
}
}
}
}
return AllocateAd($campaign, $index, null);
}
}