'Name', 'class' => 'form-control', 'id' => 'adfoxly-campaign-name', 'default' => '', 'type' => 'text', ), array( 'label' => 'Max ad views', 'id' => 'adfoxly-ad-options-maxviews', 'type' => 'number', 'help-block' => 'If "0", ad doesnt have set maximal views, after which will be hided. Ad will be always visible until you manually remove it, or disable', 'class' => 'form-control' ), array( 'label' => 'Max ad clicks', 'id' => 'adfoxly-ad-options-maxclicks', 'type' => 'number', 'help-block' => 'If "0", ad doesnt have set maximal clicks, after which will be hided. Ad will be always visible until you manually remove it, or disable', 'class' => 'form-control' ), array( 'label' => 'Campaign start', 'id' => 'adfoxly-ad-campaign-start', 'type' => 'date', 'class' => 'form-control' ), array( 'label' => 'Campaign ends', 'id' => 'adfoxly-ad-campaign-end', 'type' => 'date', 'class' => 'form-control' ), array( 'label' => 'Countries / Region', 'id' => 'adfoxly-ad-campaign-countries', 'type' => 'tab', 'class' => 'form-control' ), array( 'label' => 'Days and Hours', 'id' => 'adfoxly-ad-campaign-days-hours', 'type' => 'campaign_days_and_hours', 'class' => 'form-control' ), array( 'label' => 'Max views for one user per ad in campaign', 'id' => 'adfoxly-campaign-maxviews-user', 'type' => 'number', 'help-block' => 'If "0", ad doesnt have set maximal views, after which will be hided. Ad will be always visible until you manually remove it, or disable', 'class' => 'form-control', 'is_premium' => true ), array( 'label' => 'Included Ads', 'class' => 'form-control', 'id' => 'adfoxly-campaign-ads-list', 'default' => '', 'type' => 'checkbox', ), ); function __construct() { if ( isset( $_GET[ 'edit' ] ) ) { if ( $_GET[ 'edit' ] !== 'new' ) { $campaign = new CampaignController(); $g_id = $_GET[ 'edit' ]; if ( isset( $campaign->getCampaign( $g_id )[ 'details' ]->post_title ) && ! empty( $campaign->getCampaign( $g_id )[ 'details' ]->post_title ) ) { $this->meta_fields[ 0 ][ 'value' ] = $campaign->getCampaign( $g_id )[ 'details' ]->post_title; } $ad_campaign_maxviews = get_post_meta( $g_id, 'adfoxly-ad-options-maxviews', true ); $ad_campaign_maxclicks = get_post_meta( $g_id, 'adfoxly-ad-options-maxclicks', true ); $ad_campaign_start = get_post_meta( $g_id, 'adfoxly-ad-campaign-start', true ); $ad_campaign_end = get_post_meta( $g_id, 'adfoxly-ad-campaign-end', true ); $adfoxlyCampaignMaxviewsUser = get_post_meta( $g_id, 'adfoxly-campaign-maxviews-user', true ); if ( isset( $ad_campaign_maxviews ) && ! empty( $ad_campaign_maxviews ) ) { $this->meta_fields[ 1 ][ 'value' ] = $ad_campaign_maxviews; } if ( isset( $ad_campaign_maxclicks ) && ! empty( $ad_campaign_maxclicks ) ) { $this->meta_fields[ 2 ][ 'value' ] = $ad_campaign_maxclicks; } if ( isset( $ad_campaign_start ) && ! empty( $ad_campaign_start ) ) { $this->meta_fields[ 3 ][ 'value' ] = $ad_campaign_start; } if ( isset( $ad_campaign_end ) && ! empty( $ad_campaign_end ) ) { $this->meta_fields[ 4 ][ 'value' ] = $ad_campaign_end; } if ( isset( $adfoxlyCampaignMaxviewsUser ) && ! empty( $adfoxlyCampaignMaxviewsUser ) ) { $this->meta_fields[ 7 ][ 'value' ] = $adfoxlyCampaignMaxviewsUser; } } } } }