示例#1
0
function ym_fbook_admin()
{
    global $wpdb, $ym_formgen, $facebook_settings;
    include YM_FBOOK_BASE_DIR . 'includes/ym_facebook_constants.php';
    ym_facebook_settings(TRUE);
    $pricing_data = get_option('ym_fbook_pricing');
    if ($_POST) {
        foreach ($settings as $setting) {
            $facebook_settings->{$setting} = $_POST[$setting];
        }
        // images
        foreach ($images as $image) {
            if (is_uploaded_file($_FILES[$image]['tmp_name'])) {
                $file = $_FILES[$image];
                $ym_upload = new ym_dl_file_upload();
                $ym_upload->upload_dir = $ym_upload_root;
                $ym_upload->max_length_filename = 100;
                $ym_upload->rename_file = false;
                $ym_upload->the_temp_file = $file['tmp_name'];
                $ym_upload->the_file = $file['name'];
                $ym_upload->http_error = $file['error'];
                $ym_upload->replace = "y";
                $ym_upload->do_filename_check = "n";
                if ($ym_upload->upload()) {
                    $filename = $ym_upload_url . $ym_upload->file_copy;
                    $facebook_settings->{$image} = $filename;
                } else {
                    ym_display_message(sprintf(__('unable to move file to %s', 'ym'), $ym_upload->upload_dir), 'error');
                }
            }
        }
        update_option('ym_fbook_options', $facebook_settings);
        echo '<div id="message" class="updated fade"><p>Settings were updated</p></div>';
        $packs = ym_get_packs();
        foreach ($packs as $pack) {
            $id = 'pack_' . $pack['id'];
            $post = 'override_price_' . $id;
            $price = ym_post($post);
            if ($price) {
                $price = number_format((double) $price, 0);
            }
            $pricing_data->{$id} = $price;
        }
        $query = 'SELECT post_id FROM ' . $wpdb->prefix . 'postmeta WHERE meta_key = \'ym_post_purchasable\' AND meta_value = 1';
        foreach ($wpdb->get_results($query) as $post) {
            $id = 'post_' . $post->post_id;
            $post = 'override_price_' . $id;
            $price = ym_post($post);
            if ($price) {
                $price = number_format((double) $price, 0);
            }
            $pricing_data->{$id} = $price;
        }
        $query = 'SELECT id, name FROM ' . $wpdb->prefix . 'ym_post_pack ORDER BY id ASC';
        foreach ($wpdb->get_results($query) as $bundle) {
            $id = 'bundle_' . $bundle->id;
            $post = 'override_price_' . $id;
            $price = ym_post($post);
            if ($price) {
                $price = number_format((double) $price, 0);
            }
            $pricing_data->{$id} = $price;
        }
        $price = ym_post('override_price_post_override');
        if ($price) {
            $price = number_format((double) $price, 0);
        }
        $pricing_data->post_override = $price;
        $price = ym_post('override_price_bundle_override');
        if ($price) {
            $price = number_format((double) $price, 0);
        }
        $pricing_data->bundle_override = $price;
        update_option('ym_fbook_pricing', $pricing_data);
        echo '<div id="message" class="updated fade"><p>Pricings were updated</p></div>';
    }
    echo '
<script type="text/javascript">
	jQuery(document).ready(function() {
		jQuery(\'#ym_fbook_tabs\').tabs({
			fx: {opacity: \'toggle\'},
			selected: ' . ym_post('ym_fb_tab_select', ym_get('ym_fb_tab_select', 0)) . '
		});
		jQuery(\'.subtabs\').tabs({
			fx: {opacity: \'toggle\'}
		});
		jQuery(\'#tabkiller\').click(function() {
			jQuery(this).hide();
			jQuery(\'.subtabs\').slideUp(function() {
				jQuery(\'.subtabs\').tabs(\'destroy\');
				jQuery(\'.subtabs ul\').hide();
				jQuery(\'.subtabs\').slideDown();
			});
			jQuery(\'#ym_fbook_tabs\').slideUp(function() {
				jQuery(\'#ym_fbook_tabs\').tabs(\'destroy\');
				jQuery(\'#ym_fbook_tabs ul\').hide();
				jQuery(\'#transaction_logging\').hide();
				jQuery(\'#ym_fbook_tabs\').slideDown();
			});
		});
		jQuery(\'#ym_fb\').submit(function() {
			var selected = jQuery(\'#ym_fbook_tabs\').tabs(\'option\', \'selected\');
			jQuery(\'#ym_fb_tab_select\').val(selected);
		});
		jQuery(\'table\').after(\'<p class="submit" style="text-align: right;"><input type="submit" value="Save Settings" /></p>\');
	});
</script>
';
    echo '<div class="wrap" id="poststuff">';
    //	echo '<h2>YourMembers in Facebook | Settings</h2>';
    //	echo '<p style="text-align: right;"><a href="#nowhere" id="tabkiller">Remove Tabs/All Settings on a single page</a></p>';
    echo '<div id="ym_fbook_tabs">';
    echo '<form action="" method="post" enctype="multipart/form-=data" id="ym_fb">';
    $credits = FALSE;
    global $ym_active_modules;
    if (in_array('ym_facebook_credits', $ym_active_modules)) {
        //	if (get_option('ym_facebook_credits')) {
        $credits = TRUE;
    }
    echo '
<ul>
	<li><a href="#guide">Guide</a></li>
	<li><a href="#facebook_settings">Facebook</a></li>
	<li><a href="#settings_settings">Settings</a></li>
	<li><a href="';
    if ($credits) {
        echo '#facebook_credits';
    }
    echo '">Facebook Credits</a></li>
	<li><a href="';
    if ($credits) {
        echo '#facebook_pricing';
    }
    echo '">Facebook Pricing</a></li>
	<li><a href="#share_control">Like/Share</a></li>
	<li><a href="#open_graph">Open Graph</a></li>
	<li><a href="';
    if ($credits) {
        echo '#transaction_logging';
    }
    echo '">Transaction Log</a></li>
</ul>';
    echo '<div id="guide">';
    ym_box_top('Guide');
    echo '<div id="message" class="updated">';
    echo '<p>We have written a guide that should help you get Your Members Facebook Integration Up and Running, you can read it <a href="http://www.yourmembers.co.uk/the-support/guides-tutorials/your-members-facebook-integration/" target="_blank">here</a></p>';
    echo '</div>';
    ym_box_bottom();
    echo '</div>';
    echo '<div id="facebook_settings" class="subtabs">';
    echo '
<ul>
	<li><a href="#master_enable">Master Enable</a></li>
	<li><a href="#keys_settings">Application Keys</a></li>
	<li><a href="#canvas_settings">Canvas Settings</a></li>
	<li><a href="#page_settings">Page Settings</a></li>
	<li><a href="#dim_settings">Dimensions</a></li>
	<li><a href="#permissions">Permissions</a></li>
</ul>
';
    echo '<div id="master_enable">';
    ym_box_top('Enable Facebook');
    $review = '';
    if (!$facebook_settings->app_id) {
        $review .= '<div id="message" class="updated"><p>If you havn&#39;t created an app yet, you can do so <a href="http://developers.facebook.com/setup" target="_new">here</a></p></div>';
    }
    echo $review;
    echo '<table class="form-table">';
    $ym_formgen->render_form_table_radio_row('Enable Facebook', 'enabled', $facebook_settings->enabled, 'If not enabled if a users access the app, they are redirected to the site');
    echo '</table>';
    ym_box_bottom();
    echo '</div>
<div id="keys_settings">';
    ym_box_top('Application Keys');
    $review .= '<p>You can find and review these settings <a href="https://developers.facebook.com/apps/';
    if ($facebook_settings->app_id) {
        $review .= $facebook_settings->app_id;
    }
    $review .= '" target="_new">Here</a></p>';
    echo $review;
    echo '<table class="form-table">';
    $ym_formgen->render_form_table_text_row('Facebook Application ID', 'app_id', $facebook_settings->app_id, 'The application ID');
    $ym_formgen->render_form_table_text_row('Facebook Application Secret', 'app_secret', $facebook_settings->app_secret, 'The application secret');
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '<div id="canvas_settings">';
    ym_box_top('Canvas Settings');
    echo $review;
    echo '<table class="form-table">';
    echo '<tr><th>Facebook Canvas Name</th><td>http://apps.facebook.com/<input class="ym_input" type="text" name="canvas_url" id="canvas_url" value="' . $facebook_settings->canvas_url . '" /></td></tr>';
    echo '<tr><th>Facebook Canvas Landing</th><td>' . site_url('/') . '<input class="ym_input" type="text" name="canvas_landing" id="canvas_landing" value="' . $facebook_settings->canvas_landing . '" /></td></tr>';
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '<div id="page_settings">';
    ym_box_top('Page Settings');
    echo $review;
    echo '<p>If you have a (fan) page vanity url specified the app will do its best to stay in the (fan) page if the session starts on the (fan) page</p>';
    if ($facebook_settings->app_id) {
        echo '<p>You will have needed to have added your Application as a Tab to your Facebook Fan Page, you can do that <a href="http://www.facebook.com/apps/application.php?id=' . $facebook_settings->app_id . '">here</a> and then click <strong>Add to my Page</strong></p>';
    }
    echo '<table class="form-table">';
    echo '<tr><th>Facebook (fan) Page Vanity Url</th><td>http://www.facebook.com/<input class="ym_input" type="text" name="page_url" id="page_url" value="' . $facebook_settings->page_url . '" /></td></tr>';
    echo '<tr><th>Facebook Page Landing</th><td>' . site_url('/') . '<input class="ym_input" type="text" name="page_landing" id="page_landing" value="' . $facebook_settings->page_landing . '" /></td></tr>';
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '<div id="dim_settings">';
    ym_box_top('Dimension Settings');
    echo '<table class="form-table">';
    $ym_formgen->render_combo_from_array_row('IFrame Size', 'iframe_size', $iframe_options, $facebook_settings->iframe_size, 'Make sure this setting is set identical to the setting in Facebook Application settings');
    $ym_formgen->render_form_table_text_row('IFrame Height', 'iframe_size_height', $facebook_settings->iframe_size_height, 'If you are using Scrollbars you can specify the height you want here, in px');
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '<div id="permissions">';
    ym_box_top('Permissions');
    echo '<table class="form-table">';
    echo '<tr><td></td><td style="width: 50px;"></td></tr>';
    $ym_formgen->render_form_table_radio_row('Likewalls - user_likes', 'permission_likewall', $facebook_settings->permission_likewall, 'If using likewalls, we need to extended permissions to get User Likes, as some users have their Likes set to Private');
    $ym_formgen->render_form_table_radio_row('Email Address - email', 'permission_email', $facebook_settings->permission_email, 'For the registration with Facebook you can enable this to pre fill the email entry with their Primary Facebook Email Address. Users will be asked to accept additional permissions.');
    $ym_formgen->render_form_table_radio_row('Offline Access - offline_access', 'permission_offline_access', $facebook_settings->permission_offline_access, 'Access Tokens are on average valid for about an hour. Which means once an hour we have to send the user thru a loop, normally this is transparent. However if you do not want this you can enable offline access to get a longer access key');
    $ym_formgen->render_form_table_radio_row('Offline Access - publish_actions', 'permission_publish_actions', $facebook_settings->permission_publish_actions, 'Part of the new Open Graph Actions');
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '</div>';
    echo '<div id="settings_settings" class="subtabs">';
    echo '
<ul>
	<li><a href="#access_settings">Access Settings</a></li>
	<li><a href="#registration_settings">Registration Settings</a></li>
	<li><a href="#content_settings">Content Settings</a></li>
	<li><a href="#comment_settings">Comment Settings</a></li>
	<li><a href="#analytics_settings">Analytics Settings</a></li>
</ul>
';
    echo '<div id="access_settings">';
    ym_box_top('Access Settings');
    echo '<table class="form-table">';
    $ym_formgen->render_form_table_radio_row('Force Facebook', 'force_facebook', $facebook_settings->force_facebook, 'Make YM Facebook only, force users visting the Website to access via Facebook');
    $ym_formgen->render_form_table_radio_row('Force Application Add', 'force_facebook_auth', $facebook_settings->force_facebook_auth, 'Force a user to be logged into Facebook and authorised the Application');
    $ym_formgen->render_form_table_radio_row('Force WordPress Login', 'force_wordpress_auth', $facebook_settings->force_wordpress_auth, 'Force a user to be logged into WordPress');
    $ym_formgen->render_form_table_radio_row('Require Link', 'require_link', $facebook_settings->require_link, 'Require a User to link their Facebook and WordPress Accounts if Logged in (unless superseeded by above)');
    $ym_formgen->render_form_table_radio_row('Disable the Link Suggested Message', 'disable_link_message', $facebook_settings->disable_link_message, 'When a user is logged out do not prompt them to link/login');
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '<div id="registration_settings">';
    ym_box_top('Registration Settings');
    echo '<p>Using Hidden Register? You might want to turn on the Email Permission on the Facebook->Permissions Tab</p>';
    echo '<table class="form-table">';
    //	$ym_formgen->render_form_table_radio_row('Register with Facebook', 'register_with_facebook', $facebook_settings->register_with_facebook, 'Allow a user to register a WordPress accout using their Facebook Account as a Base');
    $ym_formgen->render_form_table_radio_row('Hidden Register with Facebook', 'register_with_facebook_hidden', $facebook_settings->register_with_facebook_hidden, 'If a User uses the Facebook App and are not logged into WordPress create them a WordPress Account. If they are found by their username or email address, the two accounts are Auto Linked. (Implies Require Link and Force Redirect)');
    //	$ym_formgen->render_form_table_radio_row('Email Address', 'permission_emailb', $facebook_settings->permission_email, 'For the registration with Facebook you can enable this to pre fill the email entry with their Primary Facebook Email Address. Users will be asked to accept additional permissions.');
    $packs = ym_get_packs();
    $ym_packs = array();
    $ym_packs[0] = 'No Account';
    foreach ($packs as $pack) {
        $ym_packs[$pack['id']] = ym_get_pack_label($pack['id']);
    }
    $ym_formgen->render_combo_from_array_row('Hidden Register Subscription', 'register_with_facebook_hidden_subid', $ym_packs, $facebook_settings->register_with_facebook_hidden_subid, 'Which Subscription To Put a Hidden Regsiter User on. It will <strong>not</strong> prompt for Payment');
    $ym_formgen->render_form_table_text_row('Hidden Register Redirect', 'register_with_facebook_hidden_redirect', $facebook_settings->register_with_facebook_hidden_redirect, 'On Hidden Register Complete Redirect the users to a page');
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '<div id="content_settings">';
    ym_box_top('Content Settings');
    echo '<p>fb.php status is: ';
    $result = locate_template('fb.php');
    if (empty($result)) {
        echo 'Not Present';
    } else {
        echo 'Present';
    }
    echo '</p>';
    echo '<table class="form-table">';
    $ym_formgen->render_form_table_radio_row('fb.php', 'enable_fb_php', $facebook_settings->enable_fb_php, 'Enable the use of the Theme File fb.php instead of YM FB Theme, if fb.php is present');
    echo '</table>';
    echo '<p>If you use a theme fb.php file, most of these options are redundant, unless you implement them in your Theme File</p>';
    echo '<table class="form-table">';
    $ym_formgen->render_form_table_radio_row('Allow Leave Facebook', 'enable_leave_facebook', $facebook_settings->enable_leave_facebook, 'Allow a user to start a website session from inside facebook, if a user vists the blog on Facebook first, they will stay inside Facebook, (is overriden by force facebook)');
    $ym_formgen->render_form_table_radio_row('Post Breakout', 'post_breakout', $facebook_settings->post_breakout, 'when viewing the end post, breakout (overrides Force Facebook)');
    $ym_formgen->render_form_table_radio_row('Page Breakout', 'page_breakout', $facebook_settings->page_breakout, 'when viewing the end page, breakout (overrides Force Facebook)');
    $ym_formgen->render_form_table_radio_row('Use excerpt', 'use_excerpt', $facebook_settings->use_excerpt, 'Use excerpts on post pages? (Template dependant)');
    $menus = array('Auto', 'Slug');
    $query = 'SELECT name FROM ' . $wpdb->prefix . 'term_taxonomy tt LEFT JOIN ' . $wpdb->prefix . 'terms t ON t.term_id = tt.term_id WHERE taxonomy = \'nav_menu\'';
    foreach ($wpdb->get_results($query) as $row) {
        $menus[] = $row->name;
    }
    $ym_formgen->render_combo_from_array_row('Menu Control', 'menu', $menus, $facebook_settings->menu, 'We can use the First non blank menu, or you can pick your own. Menus are controlled <a href="' . site_url('/wp-admin/nav-menus.php') . '">here</a>');
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '<div id="comment_settings">';
    ym_box_top('Comment Settings');
    echo '<p>You can replace the standard comment form with a Facebook Powered comment form</p>';
    echo '<table class="form-table">';
    $ym_formgen->render_form_table_radio_row('Use Facebook Comments on Facebook', 'use_facebook_comments', $facebook_settings->use_facebook_comments);
    $ym_formgen->render_form_table_radio_row('Use Facebook Comments on the Site', 'use_facebook_comments_on_site', $facebook_settings->use_facebook_comments_on_site);
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '<div id="analytics_settings">';
    ym_box_top('Analytics');
    echo '<p>You need to set the Website URL of the Profile to <strong>' . site_url('?ymfbook=googleanalytics') . '</strong> in order for Check Status to succeed</p>';
    echo '<p>Its recommended you use a separate profile under the same domain to track the Facebook Application</p>';
    echo '<table class="form-table">';
    $ym_formgen->render_form_table_text_row('Google Analytics Profile ID', 'google_analytics_profile_id', $facebook_settings->google_analytics_profile_id, 'Uses the Standard code with this ID');
    $ym_formgen->render_form_table_textarea_row('Tracking Code', 'analytics_tracking_code', $facebook_settings->analytics_tracking_code, 'This will override the standard Google Analytics Code');
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '</div>';
    if ($credits) {
        echo '<div id="facebook_credits">';
        ym_box_top(__('Facebook Credits', 'ym_facebook'));
        echo __('<p>Facebook Credits can only be used inside Facebook</p>', 'ym_facebook');
        echo sprintf(__('<p>You will need a Credits Callback URL, please use this: <strong>%s</strong></p>', 'ym_facebook'), site_url('?ym_process=ym_facebook_credits'));
        ym_box_bottom();
        ym_box_top(__('Primary Button', 'ym_facebook'));
        echo __('<p>In line with the Facebook Credits branding guide, you have a choice of three Pay with Facebook Credits Icons</p>', 'ym_facebook');
        $select = $facebook_settings->logo;
        echo '<table class="form-table">';
        echo '<tr><th>' . __('Option A', 'ym_facebook') . '</th>
			<td>
				<input type="radio" name="logo" id="logoa" value="' . YM_IMAGES_DIR_URL . 'pg/facebook_credits_a.png" ' . ($select == YM_IMAGES_DIR_URL . 'pg/facebook_credits_a.png' ? 'checked="checked"' : '') . ' />
				<label for="logoa">
					<img src="' . YM_IMAGES_DIR_URL . 'pg/facebook_credits_a.png" />
				</label>
			</td>
		</tr>';
        echo '<tr><th>' . __('Option B', 'ym_facebook') . '</th>
			<td>
				<input type="radio" name="logo" id="logob" value="' . YM_IMAGES_DIR_URL . 'pg/facebook_credits_b.png" ' . ($select == YM_IMAGES_DIR_URL . 'pg/facebook_credits_b.png' ? 'checked="checked"' : '') . ' />
				<label for="logob">
					<img src="' . YM_IMAGES_DIR_URL . 'pg/facebook_credits_b.png" />
				</label>
			</td>
		</tr>';
        echo '<tr><th>' . __('Option C', 'ym_facebook') . '</th>
			<td>
				<input type="radio" name="logo" id="logoc" value="' . YM_IMAGES_DIR_URL . 'pg/facebook_credits_c.png" ' . ($select == YM_IMAGES_DIR_URL . 'pg/facebook_credits_c.png' ? 'checked="checked"' : '') . ' />
				<label for="logoc">
					<img src="' . YM_IMAGES_DIR_URL . 'pg/facebook_credits_c.png" />
				</label>
			</td>
		</tr>';
        echo '</table>';
        ym_box_bottom();
        ym_box_top(__('Credits Dialog Images', 'ym_facebook'));
        echo __('<p>When purchasing a item users are shown a title, description, cost and a icon/logo. You can crontol these logos here</p>', 'ym_facebook');
        echo '<table class="form-table">';
        echo '
		<tr>
			<th>' . __('Subscription Purchase Image', 'ym_facebook') . '</th>
			<td>
				<input type="file" name="credits_purchase_sub_image" id="credits_purchase_sub_image" />';
        if ($facebook_settings->credits_purchase_sub_image) {
            echo '<div style="margin-top: 5px;"><img src="' . $facebook_settings->credits_purchase_sub_image . '" alt="' . __('Subscription Purchase Image', 'ym_facebook') . '" /></div>';
        }
        echo '
			</td>
		</tr>
		<tr>
			<th>' . __('Post Purchase Image', 'ym_facebook') . '</th>
			<td>
				<input type="file" name="credits_purchase_post_image" id="credits_purchase_post_image" />';
        if ($facebook_settings->credits_purchase_post_image) {
            echo '<div style="margin-top: 5px;"><img src="' . $facebook_settings->credits_purchase_post_image . '" alt="' . __('Post Purchase Image', 'ym_facebook') . '" /></div>';
        }
        echo '
			</td>
		</tr>
		<tr>
			<th>' . __('Bundle Purchase Image', 'ym_facebook') . '</th>
			<td>
				<input type="file" name="credits_purchase_bundle_image" id="credits_purchase_bundle_image" />';
        if ($facebook_settings->credits_purchase_bundle_image) {
            echo '<div style="margin-top: 5px;"><img src="' . $facebook_settings->credits_purchase_bundle_image . '" alt="' . __('Bundle Purchase Image', 'ym_facebook') . '" /></div>';
        }
        echo '
			</td>
		</tr>
		';
        echo '</table>';
        ym_box_bottom();
        ym_box_top(__('Other Settings', 'ym_facebook'));
        echo '<table class="form-table">';
        $ym_formgen->render_form_table_radio_row('Exclusive Facebook Credits', 'credits_exclusive', $facebook_settings->credits_exclusive, 'Use only Facebook Credits when inside Facebook');
        echo '<tr><td></td><td><p>';
        echo 'Facebook takes a 30% fee on all transactions.<br />' . 'For Transactions in non USD Facebook pays out based on:<br />' . 'Each Facebook Credit is $0.10 and then converts this into your native currency based on that days exchange rate<br />' . 'So 10 Credits is $1 and 100 is $10<br />' . 'Transactions can only occur in whole credits, so if any math involved results in a decimal prices will be rounded up<br />' . 'Costs can only be in Whole Credits';
        global $ym_res;
        if ($ym_res->currency != 'USD') {
            echo '<br /><br />So you can either specify an exchange rate, or set a Facebook credits price per item on the Facebook Pricing Tab';
            echo '</p></td></tr>';
            $ym_formgen->render_form_table_text_row('Specify a Exchange Rate', 'exchange_rate', $facebook_settings->exchange_rate, 'If you specify an exchange rate, it will be used. Its the Exchange rate for your Currency to USD');
        } else {
            echo '<br /><br />You are using USD, so you do not need to worry about an exchange rate, but you can still set a Facebook credits price per item on the Facebook Pricing Tab';
            echo '</p></td></tr>';
        }
        $ym_formgen->render_combo_from_array_row('Rounding', 'exchange_round', $round_options, $facebook_settings->exchange_round, 'You can control the rounding method if any');
        echo '</table>';
        ym_box_bottom();
        echo '</div>';
        echo '<div id="facebook_pricing" class="subtabs">';
        echo '
<ul>
	<li><a href="#pack_pricing">Pack</a></li>
	<li><a href="#post_pricing">Post</a></li>
	<li><a href="#bundle_pricing">Bundle</a></li>
</ul>
';
        echo '<div id="pack_pricing">';
        ym_box_top('Pack Pricing');
        echo '<p>Remember: 1 Credit is USD 0.10 and pricing is in whole credits, if a override price is set Exchange Rates and Rouding is ignored</p>';
        echo '<table class="form-table">';
        $pricing_data = get_option('ym_fbook_pricing');
        // subs
        $packs = ym_get_packs();
        foreach ($packs as $pack) {
            $id = 'pack_' . $pack['id'];
            $ym_formgen->render_form_table_text_row('Pack Price: ' . ym_get_pack_label($pack['id']), 'override_price_' . $id, $pricing_data->{$id});
        }
        echo '</table>';
        ym_box_bottom();
        echo '</div>';
        echo '<div id="post_pricing">';
        ym_box_top('Post Pricing');
        echo '<p>Remember: 1 Credit is USD 0.10 and pricing is in whole credits, if a override price is set Exchange Rates and Rouding is ignored</p>';
        echo '<table class="form-table">';
        $query = 'SELECT post_id FROM ' . $wpdb->prefix . 'postmeta WHERE meta_key = \'ym_post_purchasable\' AND meta_value = 1';
        foreach ($wpdb->get_results($query) as $post) {
            $id = 'post_' . $post->post_id;
            $postdata = get_post($post);
            $ym_formgen->render_form_table_text_row('Post Price: ' . $postdata->post_title, 'override_price_' . $id, $pricing_data->{$id});
        }
        if (!$wpdb->num_rows) {
            echo '<tr><td></td><th>No Available Posts</th></tr>';
        }
        $ym_formgen->render_form_table_text_row('Default Override Pack Price', 'override_price_post_override', $pricing_data->post_override, 'You can set a default price to override if one is not set');
        echo '</table>';
        ym_box_bottom();
        echo '</div>';
        echo '<div id="bundle_pricing">';
        ym_box_top('Bundle Pricing');
        echo '<p>Remember: 1 Credit is USD 0.10 and pricing is in whole credits, if a override price is set Exchange Rates and Rouding is ignored</p>';
        echo '<table class="form-table">';
        $query = 'SELECT id, name FROM ' . $wpdb->prefix . 'ym_post_pack ORDER BY id ASC';
        foreach ($wpdb->get_results($query) as $bundle) {
            $id = 'bundle_' . $bundle->id;
            $ym_formgen->render_form_table_text_row('Bundle Price: ' . $bundle->name, 'override_price_' . $id, $pricing_data->{$id});
        }
        if (!$wpdb->num_rows) {
            echo '<tr><td></td><th>No Available Bundles</th></tr>';
        }
        $ym_formgen->render_form_table_text_row('Default Override Bundle Price', 'override_price_bundle_override', $pricing_data->bundle_override, 'You can set a default price to override if one is not set');
        echo '</table>';
        ym_box_bottom();
        echo '</div>';
        echo '</div>';
    }
    echo '<div id="share_control" class="subtabs">';
    echo '
<ul>
	<li><a href="#post_control">Post Like/Share</a></li>
	<li><a href="#footer_control">Footer Like/Share</a></li>
	<li><a href="#shortcode_control">Shortcode Like/Share</a></li>
	<li><a href="#likewall_control">Likewall Like/Share</a></li>
</ul>
';
    echo '<div id="post_control">';
    ym_box_top('Post Share Control');
    echo '<p>This are the options for adding Share/Send buttons to Posts/Pages</p>';
    echo '<table class="form-table">';
    $ym_formgen->render_form_table_radio_row('Enable Facebook Share', 'enable_share', $facebook_settings->enable_share, 'Allow people to share content to Facebook Feeds from within the App');
    $ym_formgen->render_form_table_radio_row('Enable Facebook Send', 'enable_send', $facebook_settings->enable_send, 'Allow people to share content via PM (needs Share to be on)');
    $ym_formgen->render_combo_from_array_row('Share Box to Use', 'share_box', $sharebox_options, $facebook_settings->share_box);
    $ym_formgen->render_form_table_radio_row('Show faces', 'show_faces', $facebook_settings->show_faces, 'Show the faces of Friend who have shared the same link');
    $ym_formgen->render_combo_from_array_row('Verb to Use', 'verb', $verbs, $facebook_settings->verb);
    $ym_formgen->render_combo_from_array_row('Color Scheme', 'color_scheme', $color_schemes, $facebook_settings->color_scheme);
    $ym_formgen->render_combo_from_array_row('Font', 'font', $fonts, $facebook_settings->font, 'The Font to use for the Buttons');
    //	$ym_formgen->render_form_table_text_row('Add a Ref', 'ref', $facebook_settings->ref, 'A reference for tracking');
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '<div id="footer_control">';
    ym_box_top('Footer Share Control');
    echo '<table class="form-table">';
    $ym_formgen->render_form_table_radio_row('Enable Facebook Share Footer', 'enable_share_footer', $facebook_settings->enable_share_footer, 'Add a Share button for the whole site in the footer');
    $ym_formgen->render_form_table_radio_row('Enable Facebook Send Footer', 'enable_send_footer', $facebook_settings->enable_send_footer, 'Allow people to share content via PM (needs Share to be on)');
    $ym_formgen->render_combo_from_array_row('Share Box to Use', 'share_box_footer', $sharebox_options, $facebook_settings->share_box_footer);
    $ym_formgen->render_form_table_radio_row('Show faces', 'show_faces_footer', $facebook_settings->show_faces_footer, 'Show the faces of Friend who have shared the same link');
    $ym_formgen->render_combo_from_array_row('Verb to Use', 'verb_footer', $verbs, $facebook_settings->verb_footer);
    $ym_formgen->render_combo_from_array_row('Color Scheme', 'color_scheme_footer', $color_schemes, $facebook_settings->color_scheme_footer);
    $ym_formgen->render_combo_from_array_row('Font', 'font_footer', $fonts, $facebook_settings->font_footer, 'The Font to use for the Buttons');
    //	$ym_formgen->render_form_table_text_row('Add a Ref', 'ref_footer', $facebook_settings->ref_footer, 'A reference for tracking');
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '<div id="shortcode_control">';
    ym_box_top('Shortcode Share Control');
    echo '<p>You can use the shortcode [ym_fb_like]</p>';
    echo '<p>You can specify a shareurl to use, if not the post permalink will be used</p>';
    //	echo '<p>You can specify a type to use, if not the "post" tab settings will be used, specify "shortcode" to use the below settings, or "footer" to use the footer tab settings</p>';
    echo '<table class="form-table">';
    $ym_formgen->render_form_table_radio_row('Enable Facebook Share Shortcode', 'enable_share_shortcode', $facebook_settings->enable_share_shortcode);
    $ym_formgen->render_form_table_radio_row('Auto Add to the bottom of posts on non Facebook Pages', 'enable_share_auto_nonfb', $facebook_settings->enable_share_auto_nonfb, 'Add a Share button to the bottom of all posts on non Facebook Framed Pages');
    $ym_formgen->render_form_table_radio_row('Enable Facebook Send Shortcode', 'enable_send_shortcode', $facebook_settings->enable_send_shortcode, 'Allow people to share content via PM (needs Share to be on)');
    $ym_formgen->render_combo_from_array_row('Share Box to Use', 'share_box_shortcode', $sharebox_options, $facebook_settings->share_box_shortcode);
    $ym_formgen->render_form_table_radio_row('Show faces', 'show_faces_shortcode', $facebook_settings->show_faces_shortcode, 'Show the faces of Friend who have shared the same link');
    $ym_formgen->render_combo_from_array_row('Verb to Use', 'verb_shortcode', $verbs, $facebook_settings->verb_shortcode);
    $ym_formgen->render_combo_from_array_row('Color Scheme', 'color_scheme_shortcode', $color_schemes, $facebook_settings->color_scheme_shortcode);
    $ym_formgen->render_combo_from_array_row('Font', 'font_shortcode', $fonts, $facebook_settings->font_shortcode, 'The Font to use for the Buttons');
    //	$ym_formgen->render_form_table_text_row('Add a Ref', 'ref_shortcode', $facebook_settings->ref_shortcode, 'A reference for tracking');
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '<div id="likewall_control">';
    ym_box_top('Likewall Share Control');
    echo '<table class="form-table">';
    //		$ym_formgen->render_form_table_radio_row('Enable Facebook Share LikeWall', 'enable_share_likewall', $facebook_settings->enable_share_likewall, 'Add a Share button for the whole site in the likewall');
    //		$ym_formgen->render_form_table_radio_row('Enable Facebook Send LikeWall', 'enable_send_likewall', $facebook_settings->enable_send_likewall, 'Allow people to share content via PM (needs Share to be on)');
    $ym_formgen->render_combo_from_array_row('Share Box to Use', 'share_box_likewall', $sharebox_options, $facebook_settings->share_box_likewall);
    $ym_formgen->render_form_table_radio_row('Show faces', 'show_faces_likewall', $facebook_settings->show_faces_likewall, 'Show the faces of Friend who have shared the same link');
    $ym_formgen->render_combo_from_array_row('Verb to Use', 'verb_likewall', $verbs, $facebook_settings->verb_likewall);
    $ym_formgen->render_combo_from_array_row('Color Scheme', 'color_scheme_likewall', $color_schemes, $facebook_settings->color_scheme_likewall);
    $ym_formgen->render_combo_from_array_row('Font', 'font_likewall', $fonts, $facebook_settings->font_likewall, 'The Font to use for the Buttons');
    //	$ym_formgen->render_form_table_text_row('Add a Ref', 'ref_likewall', $facebook_settings->ref_likewall, 'A reference for tracking');
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '</div>';
    echo '<div id="open_graph">';
    ym_box_top('Open Graph Options');
    echo '<table class="form-table">';
    echo '
	<tr>
		<th>Open Graph Image
			<div style="color: gray; margin-top: 5px; font-size: 11px;">This image is used when a user links/shares content from your site.</div>
		</th>
		<td>
			<input type="file" name="open_graph_image" id="open_graph_image" />';
    if ($facebook_settings->open_graph_image) {
        echo '<div style="margin-top: 5px;"><img src="' . $facebook_settings->open_graph_image . '" alt="Open Graph Image" /></div>';
    }
    echo '
		</td>
	</tr>
	';
    $ym_formgen->render_combo_from_array_row('Default Open Graph Type', 'open_graph_type', $types, $facebook_settings->open_graph_type);
    $ym_formgen->render_form_table_text_row('Admin Ids', 'open_graph_admins', $facebook_settings->open_graph_admins, 'Users who should be linked/denoted as admins for your YM in Facebook, comma separated');
    echo '</table>';
    ym_box_bottom();
    echo '</div>';
    echo '<input type="hidden" name="ym_fb_tab_select" id="ym_fb_tab_select" value="0" />';
    echo '</form>';
    if ($credits) {
        // facebook credits appears to be enabled in YM
        echo '<div id="transaction_logging">';
        ym_box_top('Facebook Credits Transaction Logging');
        include YM_FBOOK_BASE_DIR . 'admin/ym_facebook_transaction_log.php';
        ym_box_bottom();
        echo '</div>';
    }
    echo '</div>';
    echo '</div>';
}
            $sub_id = ym_post('package', false);
            $package_type = ym_post('package_type', false);
            if (ym_group_membership_create_child($email_address, $username, $password, $c_password, $sub_id, $package_type, TRUE)) {
                // reload
                $ym_user = new YourMember_User($ym_user->ID);
            }
        } else {
            ym_display_message(__('Unknown Action Requested', 'ym'), 'error');
        }
    }
}
// get breakdown
$current_counts = ym_group_membership_get_counts();
echo '<div id="poststuff" class="wrap">
	<h2>' . __('Group Membership', 'ym') . '</h2>';
ym_box_top('&nbsp;');
echo '<p>' . sprintf(__('You are eligible to have %s account%s in your Group, you currently have %s Child Account%s', 'ym'), $ym_user->child_accounts_allowed, $ym_user->child_accounts_allowed != 1 ? 's' : '', count($ym_user->child_ids), count($ym_user->child_ids) != 1 ? 's' : '') . '</p>';
echo '
<table class="form-table widefat">';
if (count($ym_user->child_ids)) {
    echo '<tr>
		<th>' . __('User Email', 'ym') . '</th>
		<th>' . __('User Login', 'ym') . '</th>
		<th>' . __('Package Type', 'ym') . '</th>
		<th>' . __('Status, click to Toggle', 'ym') . '</th>
		<th>' . __('Delete', 'ym') . '</th>
	</tr>';
    foreach ($ym_user->child_ids as $child) {
        echo '<tr>';
        $child = get_user_by('id', $child);
        if ($child) {
示例#3
0
 private function get_lists($is_option = FALSE)
 {
     $lists = $this->mailchimp->lists();
     if (!count($lists->data)) {
         ym_box_top($this->name . ' Error');
         echo '<p>' . __('You have no lists on ' . $this->name . ' to associate with') . '</p>';
         ym_box_bottom();
         return;
     }
     $list_data = array();
     if ($is_option) {
         $list_data[] = __('--Select--');
     }
     foreach ($lists->data as $data) {
         $list_data[$data->id] = $data->name;
     }
     return $list_data;
 }
示例#4
0
    function invoice_tab()
    {
        $invoice = new ym_invoice();
        global $wpdb;
        if (ym_post('user_id')) {
            $user_id = ym_post('user_id');
            $op = ym_post('op', '');
            $undo = ym_post('undo', FALSE);
            $user = new YourMember_User($user_id);
            if ($undo) {
                $data = array('status' => YM_STATUS_PENDING, 'status_str' => __('Invoice Undo', 'ym'));
                $user->update($data);
                $user->save();
                $packet = array('user_id' => $user_id, 'status' => FALSE);
                do_action('ym_invoice_status_update', $packet);
            } else {
                if ($op == 'resend') {
                    $invoice->generate_invoice($user, $invoice);
                    echo '<div id="message" class="updated"><p>' . __('Inovice Resent', 'ym') . '</p></div>';
                    @ym_log_transaction(YM_USER_STATUS_UPDATE, __('Invoice Resent', 'ym'), $user_id);
                } else {
                    if ($op == 'active') {
                        $data = array('status' => YM_STATUS_ACTIVE, 'status_str' => __('Invoice Paid', 'ym'), 'amount' => intval(ym_post('amount', 0)), 'last_pay_date' => time());
                        $current_status = $user->status;
                        if ($current_status == YM_STATUS_GRACE) {
                            $extend = $user->last_pay_date;
                            $packdata = ym_get_pack_by_id($user->pack_id);
                            $data['expire_date'] = $user->expiry_time($packdata['duration'], $packdata['duration_type'], $extend);
                        }
                        // check for force end
                        if (isset($packdata['force_end_date'])) {
                            $force_end_date = $packdata['force_end_date'];
                            if ($force_end_date > time()) {
                                // greater than now
                                @ym_log_transaction(YM_ACCESS_EXTENSION, 'Adjustment (Force End Date): ' . $force_end_date, $user_id);
                                $data['expire_date'] = $force_end_date;
                            }
                        }
                        $data['amount'] = preg_replace('/[^\\d\\.]/', '', $data['amount']);
                        $data['amount'] = number_format($data['amount'], 2, '.', '');
                        $user->update($data, TRUE);
                        $optional = ym_post('optional');
                        if (!$optional) {
                            $optional = __('Invoice Paid', 'ym');
                        }
                        @ym_log_transaction(YM_IPN, $optional, $user_id);
                        @ym_log_transaction(YM_PAYMENT, $data['amount'], $user_id);
                        @ym_log_transaction(YM_USER_STATUS_UPDATE, $data['status'] . ' - ' . $data['status_str'], $user_id);
                        echo '<div id="message" class="updated"><p>' . __('Updated and Activated the User', 'ym') . '</p></div>';
                        $packet = array('user_id' => $user_id, 'pack_id' => $user->pack_id, 'status' => TRUE);
                        $invoice = new ym_invoice();
                        $invoice->notify_user($packet);
                        do_action('ym_invoice_status_update', $packet);
                    }
                }
            }
        }
        echo '<div id="poststuff" class="wrap">';
        ym_box_top(__('Invoice Management', 'ym'));
        $search = ym_post('ym_invoice_search', false);
        if ($search) {
            $query = 'SELECT u.user_id AS ID FROM ' . $wpdb->usermeta . ' u
				LEFT JOIN ' . $wpdb->usermeta . ' s ON s.user_id = u.user_id
				LEFT JOIN ' . $wpdb->users . ' us ON us.id = u.user_id
				WHERE
				u.meta_key = \'ym_payment_type\' AND u.meta_value = \'invoice\' 
				AND s.meta_key = \'ym_status\'
				AND (
					us.user_login LIKE \'%' . $search . '%\'
					OR
					us.user_email LIKE \'%' . $search . '%\'
				)
				ORDER BY ID DESC
				';
        } else {
            $query = 'SELECT u.user_id AS ID FROM ' . $wpdb->prefix . 'usermeta u
				LEFT JOIN ' . $wpdb->prefix . 'usermeta s ON s.user_id = u.user_id
				WHERE
				u.meta_key = \'ym_payment_type\' AND u.meta_value = \'invoice\' 
				AND s.meta_key = \'ym_status\'
				ORDER BY ID DESC
				';
        }
        $results = $wpdb->get_results($query);
        // quick search
        if ($wpdb->num_rows != 0 || $search) {
            // render search form
            echo '
<form action="" method="post" style="float: right;">
<fieldset>
	' . __('Username/Email Search:', 'ym') . '
	<input type="text" name="ym_invoice_search" value="' . $search . '" />
	<input type="submit" value="' . __('Search', 'ym') . '" />
</fieldset>
</form>';
        }
        echo '<p>' . __('Here you can update users based on the honouring of their invoice, you can use the Info to store field to store extra IPN style info such as a Cheque Number', 'ym') . '</p>';
        if ($wpdb->num_rows == 0) {
            echo ym_display_message(__('No Users are Invoice Pending', 'ym'), 'error');
        } else {
            echo '<table class="widefat">';
            echo '<tr>
				<th>' . __('Member', 'ym') . '</th>
				<th>' . __('Invoice Ref', 'ym') . '</th>
				<th>' . __('Purchasing', 'ym') . '</th>
				<th>' . __('Paid/Invoiced On Date', 'ym') . '</th>
				<th>' . __('Member Status', 'ym') . '</th>
				<th>' . __('Payment', 'ym') . '</th>
			</tr>';
            foreach ($results as $row) {
                $user = new YourMember_User($row->ID);
                echo '<tr>';
                echo '<td>(' . $row->ID . ') ' . $user->data->user_email;
                echo '<br />';
                if ($user->data->user_email != $user->data->user_login) {
                    echo $user->data->user_login . ' ';
                }
                echo $user->data->display_name;
                echo '</td>';
                echo '<td>#' . $user->invoice_id . '</td>';
                echo '<td>' . ym_get_pack_label($user->pack_id) . '</td>';
                echo '<td nowrap="nowrap" style="';
                // go red if overdue
                $limit = $user->invoiced_date + 86400 * $invoice->invoice_limit;
                // last pay date is invoiced on date
                // limit is due date for this invoice
                if (time() > $limit && $user->status != YM_STATUS_ACTIVE) {
                    echo 'background: red;';
                } else {
                    if (time() < $limit && $user->status != YM_STATUS_ACTIVE) {
                        echo 'background: #EFEFEF;';
                    }
                }
                echo '">';
                if ($user->status != YM_STATUS_ACTIVE) {
                    echo __('Invoiced', 'ym') . ' ' . date(YM_DATE, $user->invoiced_date);
                    echo '<br />' . __('Due', 'ym') . ' ' . date(YM_DATE, $limit);
                } else {
                    echo date(YM_DATE, $user->last_pay_date);
                }
                echo '</td>';
                echo '<td>' . $user->status . ' - ' . $user->status_str . '</td>';
                echo '<td>
				<form action="" method="post">
				<table><tr><td nowrap="nowrap">
					<input type="hidden" name="search" value="' . $search . '" />
					<input type="hidden" name="user_id" value="' . $row->ID . '" />
					';
                if ($user->status == YM_STATUS_ACTIVE) {
                    echo $user->amount;
                    // last ipn
                    $query = 'SELECT data FROM ' . $wpdb->prefix . 'ym_transaction WHERE action_id = ' . YM_IPN . ' AND user_id = ' . $row->ID . ' ORDER BY id DESC LIMIT 1';
                    $data = $wpdb->get_var($query);
                    if (substr($data, 0, 2) != 'a:') {
                        echo ' - ';
                        echo $data;
                    }
                    echo '</td><td>';
                    echo '</td><td>';
                    echo '
					<input type="hidden" name="undo" value="1" />
					<input type="submit" class="button-secondary deletelink" style="float: right;" value="' . __('Undo Active', 'ym') . '" />
					';
                } else {
                    echo '
					<label for="amount">' . __('Payment Amount', 'ym') . '</label> 
					<br />
					<label for="optional">' . __('Info to Store', 'ym') . ' 
					</td><td>
					<input type="text" name="amount" id="amount" value="" size="4" />
					<br />
					<input type="text" name="optional" id="optional" value="" size="4" /></label> 
					';
                    echo '</td><td>';
                    echo '
					<input type="submit" class="button-secondary deletelink" style="float: right;" value="' . __('Payment Recieved - Make Active', 'ym') . '" onclick="jQuery(\'#op_' . $row->ID . '\').val(\'active\');" />
					';
                    echo '</td><td>';
                    echo '
					<input type="submit" class="button-secondary" style="float: right;" value="' . __('Resend Invoice', 'ym') . '" onclick="jQuery(\'#op_' . $row->ID . '\').val(\'resend\');" />
					';
                }
                echo '
					<input type="hidden" name="op" id="op_' . $row->ID . '" value="" />
				</td></tr></table>
				</form>
					</td>';
                echo '</tr>';
            }
            echo '</table>';
        }
        ym_box_bottom();
        echo '</div>';
    }
示例#5
0
            if ($emails) {
                echo $ym_formgen->render_combo_from_array_row(__('Select Prior Email', 'ym_mailmanager'), 'email_id', $emails, '', __('Select a previously created email', 'ym_mailmanager'));
            }
            $days = array();
            for ($x = 0; $x <= 365; $x++) {
                $days[$x] = $x . ' Days';
            }
            echo $ym_formgen->render_combo_from_array_row(__('Select Delay', 'ym_mailmanager'), 'delay', $days, '', __('Select number of days between emails', 'ym_mailmanager'));
            echo '
			</table>
			<p style="text-align: right;">
			<input type="submit" value="' . __('Add Email to Series', 'ym_mailmanager') . '" />
			</p>
			</form>';
            ym_box_bottom();
            ym_box_top(__('Current Series Content', 'ym_mailmanager'));
            echo '<p>' . __('Currently in this series', 'ym_mailmanager') . '</p>';
            echo '<table class="form-table">
			<tr><th>' . __('ID', 'ym_mailmanager') . '</th><th>' . __('Email', 'ym_mailmanager') . '</th><th>' . __('Delay', 'ym_mailmanager') . '</th><th>' . __('Preview', 'ym_mailmanager') . '</th><th>' . __('Action', 'ym_mailmanager') . '</th></tr>
			';
            $sql = 'SELECT eis.id AS id, e.id as series, name, delay_days, email_id FROM ' . $wpdb->prefix . 'mm_email_in_series eis LEFT JOIN ' . $wpdb->prefix . 'mm_email e ON e.id = eis.email_id WHERE series_id = ' . $series;
            foreach ($wpdb->get_results($sql) as $row) {
                echo '<tr>';
                echo '<td>' . $row->id . '</td>';
                echo '<td>' . $row->name . '</td>';
                echo '<td>' . $row->delay_days . ' ' . __('Days') . '</td>';
                echo '<td><a href="' . $mm->page_root . '&mm_action=preview&iframe_preview=' . $row->email_id . '" class="previewlink">' . __('Email Preview', 'ym_mailmanager') . '</a></td>';
                echo '<td><a href="' . $mm->page_root . '&mm_action=series&series_action=assoc&series=' . $row->series . '&deleteid=' . $row->id . '" class="deletelink">' . __('Delete', 'ym_mailmanager') . '</a></td>';
                echo '</tr>';
            }
            echo '
$ym_formgen->render_form_table_text_row(__('Reminder Subject (Recurring Subscriptions)', 'ym'), 'email_reminder_subject_recur', $ym_sys->email_reminder_subject_recur, __('Supports [site_name]', 'ym'));
$ym_formgen->render_form_table_wp_editor_row(__('Reminder Message (Recurring Subscriptions)', 'ym'), 'email_reminder_message_recur', $ym_sys->email_reminder_message_recur);
echo '<tr><td></td><td>
<p class="submit" style="float: left;">
	' . __('Send Test Email to ', 'ym') . $target . '
	<input type="submit" name="send_test_recur" value="' . __('Send', 'ym') . ' &raquo;" class="button-secondary" />
</p>
</td></tr>
';
echo '</table>

<p class="submit" style="text-align: right;">
	<input type="submit" name="settings_update" value="' . __('Save Settings', 'ym') . ' &raquo;" class="button-primary" />
</p>
';
echo ym_end_box();
echo ym_box_top(__('Email Reminder for Drip Fed Content', 'ym'));
echo '<table class="form-table">';
$ym_formgen->render_form_table_radio_row(__('Enable Drip Feeding Reminder Email', 'ym'), 'email_drip_reminder_enable', $ym_sys->email_drip_reminder_enable);
$ym_formgen->render_form_table_text_row(__('Reminder Subject (New Dripped Content)', 'ym'), 'email_drip_subject', $ym_sys->email_drip_subject, __('Supports [site_name]', 'ym'));
$ym_formgen->render_form_table_wp_editor_row(__('Reminder Message (New Dripped Content)', 'ym'), 'email_drip_message', $ym_sys->email_drip_message);
echo '</table>

<p class="submit" style="text-align: right;">
	<input type="submit" name="settings_update" value="' . __('Save Settings', 'ym') . ' &raquo;" class="button-primary" />
</p>

</form>
';
echo ym_end_box();
echo '</div>';
            }
        }
    }
    update_option('ym_packs', $ym_packs);
    ym_display_message(__('Packs Updated', 'ym'));
    // core
    $ym_sys->login_redirect_url = $fields['login_redirect_url'];
    $ym_sys->wpadmin_disable_redirect_url = $fields['wpadmin_disable_redirect_url'];
    $ym_sys->logout_redirect_url = $fields['logout_redirect_url'];
    update_option('ym_sys', $ym_sys);
    ym_display_message(__('System Updated', 'ym'));
}
echo '<div class="wrap" id="poststuff">
<form action="" method="post">
';
echo ym_box_top(__('Redirects Control', 'ym'));
echo '<p>' . __('This page Collects together all Redirect options, that are duplicated/refined by Pack', 'ym') . '</p>';
echo '<table>
<tr>
	<th style="width: 300px">' . __('Redirect For', 'ym') . '</th><td style="min-width: 700px;"></td>
</tr>
';
$last_pack_id = FALSE;
foreach ($fields as $key => $value) {
    echo '
<tr>
';
    echo ' ';
    if (substr($key, 0, 8) == 'ym_pack_') {
        list($pack_id, $item) = explode('-', substr($key, 8));
        if (!$last_pack_id || $last_pack_id != $pack_id) {
				</select>
				<input type="submit" class="button-secondary" name="del_btn" value="Go" style="font-size: 13px; width: auto;" />
			</form>
			';
    } else {
        echo '-';
    }
    echo '
		</td>
	</tr>
	';
}
echo '</table>';
echo '</form>';
ym_box_bottom();
ym_box_top(__('Create a new Package Type', 'ym'));
echo '
<form action="" method="post">
	<fieldset>
		<table class="form-table">
		<tr><td>
			<label for="new_package_type">' . __('Create a new Package Type', 'ym') . '</label>
		</td><td>
			<input type="text" name="new_package_type" id="new_package_type" value="" />
		</td><td>
			<input type="submit" class="button-primary" value="' . __('Add New Package Type', 'ym') . '" />
		</td></tr>
		</table>
	</fieldset>
</form>
';
示例#9
0
 function broadcast_create($email_id, $email_subject, $email_content, $recipient_list, $time)
 {
     define('STOP_BROADCAST', TRUE);
     // burn baby burn
     //send_newsletter($campaign_id, $from_field = FALSE, $subject, $contents, $flags, $contacts = FALSE, $get_contacts = FALSE, $suppressions = FALSE, $get_suppressions = FALSE) {
     $flags = array('clicktrack', 'openrate');
     $test = explode('_', $recipient_list);
     if ($test[0] == 'wordpress') {
         // everyone
         $key = 'everyone';
     } else {
         if ($test[1] == 'ac') {
             $key = 'segment_account_type';
         } else {
             if ($test[1] == 'pack') {
                 $key = 'segment_pack_id';
             } else {
                 if ($test[1] == 'all') {
                     $key = 'segment_all';
                 } else {
                     echo '<div id="message" class="error"><p>An error occured with determining who to send to</p></div>';
                     return;
                 }
             }
         }
     }
     if ($key != 'everyone') {
         $paras = array('customs' => array(array('name' => $key, 'content' => array('EQUALS' => $recipient_list))));
     } else {
         $paras = array('campaigns' => array($this->options->campaign_id));
     }
     $from_email_id = $this->from_id();
     if (!$from_email_id) {
         echo '<div id="message" class="error"><p>An error occured with determining a Send From ID</p></div>';
         return;
     }
     $contents = array('plain' => strip_tags($email_content), 'html' => $email_content);
     if ($time < time()) {
         // now
         $r = $this->getresponse->send_newsletter($this->options->campaign_id, $from_email_id, $email_subject, $contents, $flags, FALSE, $paras, FALSE, FALSE);
         echo '<div id="message" class="';
         if ($r) {
             echo 'updated"><p>Message was sent successfully</p></div>';
         } else {
             echo 'error"><p>An Error Occured</p></div>';
         }
     } else {
         $email_json = array('campaign_id' => $this->options->campaign_id, 'from_email_id' => $from_email_id, 'email_subject' => $email_subject, 'contents' => $contents, 'flags' => $flags, 'paras' => $paras);
         $email_json = json_encode($email_json);
         // scheduler
         global $wpdb;
         if (!$email_id) {
             $sql = 'INSERT INTO ' . $wpdb->prefix . 'mm_email(name, subject, body) VALUES (\'broadcast_' . $email_subject . '\', \'' . $email_subject . '\', \'' . $email_json . '\')';
             $wpdb->query($sql);
             $email_id = $wpdb->insert_id;
         } else {
             // build json packet
             $sql = 'UPDATE ' . $wpdb->prefix . 'mm_email SET subject = \'json_encode_for_schedule\', body = \'' . $email_json . '\' WHERE id = ' . $email_id;
             $wpdb->query($sql);
         }
         $args = array($email_id, $recipient_list);
         wp_schedule_single_event($time, 'mm_scheduled_email', $args);
         ym_box_top('Broadcast');
         echo 'Scheduled for ' . date('r', $time) . ' it is currently ' . date('r', time());
         ym_box_bottom();
     }
     return;
 }
示例#10
0
echo '<ul id="ym_graph_nav">';
foreach ($graphs_to_render as $graph) {
    echo '<li><a href="#' . $graph[0] . '">' . $graph[1] . '</a></li>';
}
echo '</ul>';
echo '<div id="ym_graph_holder" class="aligncenter">';
ym_render_graphs($graphs_to_render);
echo '</div>';
ym_box_bottom();
echo '</div>';
echo '<div class="ym_two_third alignleft">';
ym_box_top(__('Posts Purchased', 'ym'), 300);
ym_render_posts_purchased(false, true);
ym_box_bottom();
echo '<div style="clear:both;">&nbsp;</div>';
ym_box_top(__('Recent History', 'ym'), 300);
if ($limit = ym_post('ym_home_timeline_log_limit', FALSE)) {
    update_option('ym_home_timeline_log_limit', ym_post('ym_home_timeline_log_limit'));
} else {
    $limit = get_option('ym_home_timeline_log_limit', 20);
}
ym_show_timeline_log_home($limit);
echo '
<form action="" method="post" class="alignright"><fieldset>
	<input type="text" name="ym_home_timeline_log_limit" value="' . $limit . '" size="4" /> <input type="submit" value="' . __('Change Limit', 'ym') . '" />
</fieldset></form>
';
ym_box_bottom();
echo '</div>';
echo '<div class="ym_third alignright">';
do_action('ym_nm_news_box');
示例#11
0
echo '<table class="form-table">';
echo $ym_formgen->render_form_table_email_row(__('Email Address', 'ym'), 'cron_notify_email', $ym_sys->cron_notify_email, __('Output from YM Cron Tasks can be Forwarded to a Email Address for Logging Needs', 'ym'));
echo $ym_formgen->render_form_table_text_row(__('Email Subject', 'ym'), 'cron_notify_subject', $ym_sys->cron_notify_subject, __('Choose the Subject, useful for Mail Sorting', 'ym'));
echo '</table>';
echo ym_end_box();
?>
<p class="submit" style="text-align: right;">
	<input type="submit" name="settings_update" value="<?php 
_e('Save Settings', 'ym');
?>
 &raquo;" class="button-primary" style="float: right;" />
</p>
</form>
<?php 
$schedules = wp_get_schedules();
echo ym_box_top(__('Cron Jobs', 'ym'));
echo '<table class="form-table">';
echo '<thead><tr>
	<th>' . __('Task', 'ym') . '</th>
	<th style="width: 60px;">' . __('Exists', 'ym') . '</th>
	<th style="width: 60px;">' . __('Enabled', 'ym') . '</th>
	<th style="width: 75px;">' . __('Schedule', 'ym') . '</th>
	<th style="width: 75px;">' . __('Next Scheduled Run', 'ym') . '</th>
	<th style="width: 75px;">' . __('Change Schedule', 'ym') . '</th>
	<th style="width: 90px;">' . __('Run Now', 'ym') . '</th>
</tr></thead>';
echo '<tbody>';
$string = __('Never', 'ym');
if ($ym_sys->enable_manual_cron) {
    $string = __('Manual', 'ym');
}
示例#12
0
echo '<table class="form-table">';
echo $ym_formgen->render_form_table_radio_row(__('Enable This Message', 'ym_mailmanager'), 'subscription_enabled', $data->subscription_enabled);
echo $ym_formgen->render_form_table_text_row(__('Email Subject', 'ym_mailmanager'), 'subscription_subject', $data->subscription_subject, __('Subject of Message', 'ym_mailmanager'));
$ym_formgen->render_form_table_wp_editor_row(__('Email Message', 'ym_mailmanager'), 'subscription_message', $data->subscription_message);
echo '</table>';
ym_box_bottom();
echo '</div><div id="post">';
ym_box_top(__('Post Purchase Complete', 'ym_mailmanager'));
echo '<table class="form-table">';
echo $ym_formgen->render_form_table_radio_row(__('Enable This Message', 'ym_mailmanager'), 'post_enabled', $data->post_enabled);
echo $ym_formgen->render_form_table_text_row(__('Email Subject', 'ym_mailmanager'), 'post_subject', $data->post_subject, __('Subject of Message', 'ym_mailmanager'));
$ym_formgen->render_form_table_wp_editor_row(__('Email Message', 'ym_mailmanager'), 'post_message', $data->post_message);
echo '</table>';
ym_box_bottom();
echo '</div><div id="bundle">';
ym_box_top(__('Bundle Purchase Complete', 'ym_mailmanager'));
echo '<table class="form-table">';
echo $ym_formgen->render_form_table_radio_row(__('Enable This Message', 'ym_mailmanager'), 'bundle_enabled', $data->bundle_enabled);
echo $ym_formgen->render_form_table_text_row(__('Email Subject', 'ym_mailmanager'), 'bundle_subject', $data->bundle_subject, __('Subject of Message', 'ym_mailmanager'));
$ym_formgen->render_form_table_wp_editor_row(__('Email Message', 'ym_mailmanager'), 'bundle_message', $data->bundle_message);
echo '</table>';
ym_box_bottom();
echo '</div>
<p class="submit" style="text-align: right;"><input type="submit" name="submit" value="' . __('Update All Messages', 'ym_mailmanager') . '" /></p>
</form>
</div>';
echo '

<script type="text/javascript">
	jQuery(document).ready(function() {
		setTimeout(\'tabulate()\', 500);
示例#13
0
function mailmanager_list_stats()
{
    ym_box_top('List Stats');
    echo '<ul>';
    foreach (mailmanager_get_recipients() as $value => $text) {
        echo '<li>';
        echo $text;
        echo ' - ';
        echo mailmanager_get_size_of_list($value);
        echo ' ' . __('Subscribers', 'ym_mailmanager');
        echo '</li>';
    }
    echo '</ul>';
    ym_box_bottom();
}
$ym_formgen->render_form_table_text_row(__('What to show next to required custom fields?', 'ym'), 'required_custom_field_symbol', $ym_sys->required_custom_field_symbol, __('Most commonly "* Required"', 'ym'));
?>
	</table>
	
	<p class="submit" style="text-align: right;">
		<input type="submit" class="button-primary" name="settings_update" value="<?php 
_e('Save Settings', 'ym');
?>
 &raquo;" />
	</p>
<?php 
echo ym_end_box();
echo '</div>';
echo '<div class="wrap" id="poststuff">
';
echo ym_box_top(__('SSL Control', 'ym'));
echo '<p>' . __('This control is redudant if your entire site runs over SSL', 'ym') . '</p>';
$url = get_option('siteurl');
if (substr($url, 0, 5) == 'https') {
    echo '<p>' . __('And you are running in SSL Only', 'ym') . '</p>';
} else {
    echo '<table class="form-table">';
    $ym_formgen->render_form_table_radio_row(__('Enable SSL Only WordPress Registration', 'ym'), 'register_https_only', $ym_sys->register_https_only);
    //$ym_formgen->render_form_table_radio_row(__('Escape SSL When Not Registration', 'ym'), 'register_https_escape', $ym_sys->register_https_escape);
    echo '</table>';
    echo '<p>' . __('You can enable Registration to be done over SSL, in the case of Registration Flow Pages, or Pages that have the [ym_register] shortcode on, in order to avoid a meta Refresh, this control exists', 'ym') . '</p>';
    echo '<table class="form-table">';
    $ym_formgen->render_form_table_text_row(__('Comma Separated List of Page/Post IDs', 'ym'), 'register_https_pages', $ym_sys->register_https_pages);
    ?>
	</table>
	<p class="submit" style="text-align: right;">
示例#15
0
 function series_precontent()
 {
     ym_box_top('Message');
     echo '<p>' . __('Series are being kept synced with') . ' ' . $this->name . '</p>';
     echo '<p>' . __('The ' . $this->name . ' Associated Lists can only be sent to via') . ' ' . $this->name . ' A series link exists only for Sync Purposes</p>';
     ym_box_bottom();
     add_filter('mailmanager_adjust_recipients', array($this, 'filter_lists_remove'), 10, 1);
 }
示例#16
0
<?php

do_action('mailmanager_view_emails');
if (defined('STOP_VIEW_EMAILS')) {
    return;
}
ym_box_top(__('Email List', 'ym_mailmanager'));
echo '<table class="form-table">';
echo '<tr><th>' . __('Email Name', 'ym_mailmanager') . '</th><th>' . __('Email Subject', 'ym_mailmanager') . '</th><th>' . __('Preview', 'ym_mailmanager') . '</th><th>' . __('Edit', 'ym_mailmanager') . '</th></tr>';
$emails = array();
$sql = 'SELECT * FROM ' . $wpdb->prefix . 'mm_email ORDER BY name';
foreach ($wpdb->get_results($sql) as $email) {
    $emails[] = $email;
}
$emails = apply_filters('mailmanager_view_emails_filter', $emails);
foreach ($emails as $email) {
    echo '<tr>';
    echo '<td>' . $email->name . '</td>';
    echo '<td>' . $email->subject . '</td>';
    echo '<td><a href="' . $mm->page_root . '&mm_action=preview&iframe_preview=' . $email->id . '" class="previewlink">' . __('Email Preview', 'ym_mailmanager') . '</a></td>';
    echo '<td><a href="' . $mm->page_root . '&mm_action=create&email_id=' . $email->id . '">' . __('Edit', 'ym_mailmanager') . '</a></td>';
    echo '</tr>';
}
echo '</table>';
ym_box_bottom();
示例#17
0
        //		add_filter('ym_beta_db_check_target', 'ym_dev_ym_beta_db_check_target');
        //		ym_database_updater();
        $file = YM_PLUGIN_DIR_PATH . 'sql/sql_update_' . $_POST['db_step'] . '.php';
        if (is_file($file)) {
            $queries = array();
            include $file;
            foreach ($queries as $query) {
                $wpdb->query($query);
            }
            echo '<div class="update-nag" style="display: block;">' . sprintf(__('Updated the Your Members database to Version %s', 'ym'), $_POST['db_step']) . '</div>';
        }
    }
}
if (@$_POST) {
    ym_box_bottom();
    ym_box_top('Reset');
}
echo '<p style="float: right;"><a href="' . YM_ADMIN_URL . '&ym_page=ym-dev-tools&ym_dev=1">Disable Tools</a></p>';
echo '
<form action="" method="post">
	<input type="submit" name="reset_sys" value="Reset YM SYS" />
</form>
<form action="" method="post">
	<input type="submit" name="reset_res" value="Reset YM RES" />
</form>
<form action="" method="post">
	<input type="submit" name="reset_all" value="Reset YM" />
</form>
<br /><br />
<form action="" method="post">
	<input type="submit" name="fidget_patch" value="Convert StdClass ym_user to YM Object with Scalar Uncode" />
示例#18
0
    function settings(&$break)
    {
        global $ym_formgen, $mm;
        $break = TRUE;
        if ($_POST) {
            $this->options->canspam = ym_post('canspam');
            $this->options->broadcast_header = ym_post('broadcast_header');
            $this->options->broadcast_footer = ym_post('broadcast_footer');
            $this->options->generic_header = ym_post('generic_header');
            $this->options->generic_footer = ym_post('generic_footer');
            $this->options->postal_address = ym_post('postal_address');
            $this->options->unsubscribe_page = ym_post('unsubscribe_page');
            ym_box_top('Mail Manager Settings');
            if (ym_post('canspam') == 1) {
                if (!ym_post('postal_address')) {
                    $this->options->canspam = 0;
                    echo '<p>You must provide you Postal Address for CAN-SPAM Act (2003) Compliance</p>';
                }
                if (FALSE === strpos($this->options->broadcast_footer, '[unsubscribe]')) {
                    $this->options->canspam = 0;
                    echo '<p>You must include the unsubscribe shortcode in your Broadcast Footer for CAN-SPAM Act (2003) Compliance</p>';
                }
                if (FALSE === strpos($this->options->generic_footer, '[unsubscribe]')) {
                    $this->options->canspam = 0;
                    echo '<p>You must include the unsubscribe shortcode in your Generic Footer for CAN-SPAM Act (2003) Compliance</p>';
                }
                if (FALSE === strpos($this->options->broadcast_footer, '[address]')) {
                    $this->options->canspam = 0;
                    echo '<p>You must include the address shortcode in your Broadcast Footer for CAN-SPAM Act (2003) Compliance</p>';
                }
                if (FALSE === strpos($this->options->generic_footer, '[address]')) {
                    $this->options->canspam = 0;
                    echo '<p>You must include the address shortcode in your Generic Footer for CAN-SPAM Act (2003) Compliance</p>';
                }
            }
            $this->saveoptions();
            echo '<p>Settings were updated</p>';
            ym_box_bottom();
            echo '<meta http-equiv="refresh" content="5" />';
            return;
        }
        echo '<form action="" method="post">';
        ym_box_top('CAN-SPAM Compliant');
        echo '<p>This option allows you to turn compliancy with the <a href="http://en.wikipedia.org/wiki/CAN-SPAM_Act_of_2003">CAN-SPAM Act of 2003</a> on or off. 
		<!--
		If it is on when somebody signs up to an email series then it will first send a confirmation email to the registrant to click before it will add them to the list. When this is off it will just sign them up.
		-->
		</p>';
        echo '<table class="form-table">';
        echo $ym_formgen->render_form_table_radio_row('CAN-SPAM Act (2003) Compliant?', 'canspam', $this->options->canspam);
        echo '</table>
		<p class="submit" style="text-align: right;">
			<input type="submit" name="submit" value="' . __('Save Settings', 'ym') . ' &raquo;" />
		</p>
		';
        ym_box_bottom();
        ym_box_top('Email Templates', TRUE);
        echo '<table class="form-table">';
        echo $ym_formgen->render_form_table_textarea_row('Broadcast Email Header', 'broadcast_header', $this->options->broadcast_header, 'This will be attached to the start of any email messages that are broadcasts');
        echo $ym_formgen->render_form_table_textarea_row('Broadcast Email Footer', 'broadcast_footer', $this->options->broadcast_footer, 'This will be attached to the end of any email messages that are broadcasts. You can use the following hooks:<br />
		[unsubscribe] = The unsubscribe link (required for CAN-SPAM compliance)<br />
		[address] = The address you entered on this page (required for CAN-SPAM compliance]');
        echo $ym_formgen->render_form_table_textarea_row('Generic Email Header', 'generic_header', $this->options->generic_header, 'This will be attached to the start of any non broadcast emails');
        echo $ym_formgen->render_form_table_textarea_row('Generic Email Footer', 'generic_footer', $this->options->generic_footer, 'This will be attached to the end of any non broadcast emails. You can use the following hooks:<br />
		[unsubscribe] = The unsubscribe link (required for CAN-SPAM compliance)<br />
		[address] = The address you entered on this page (required for CAN-SPAM compliance]');
        echo $ym_formgen->render_form_table_textarea_row('Postal Address', 'postal_address', $this->options->postal_address, 'A postal address which can be inserted into your emails if you use the [address] hook (required for CAN-SPAM compliance)');
        echo '</table>';
        echo '
		<p class="submit" style="text-align: right;">
			<input type="submit" name="submit" value="' . __('Save Settings', 'ym') . ' &raquo;" />
		</p>
		';
        ym_box_bottom();
        ym_box_top('Un/Subscribe');
        echo '<table class="form-table">';
        echo $ym_formgen->render_form_table_text_row('Series Unsubscribe Page', 'unsubscribe_page', $this->options->unsubscribe_page, 'Users will be redirect here when they unsubscribe from a series');
        echo '
		</table>
		<p class="submit" style="text-align: right;">
			<input type="submit" name="submit" value="' . __('Save Settings', 'ym') . ' &raquo;" />
		</p>
		';
        ym_box_bottom();
        echo '</form>';
    }
示例#19
0
function yss_s3_distribution($type, $id)
{
    global $ym_formgen, $yss_cloudfront, $yss_db, $wpdb;
    // file details
    $s3file = yss_get($id);
    if ($_POST) {
        // here we go
        $distro = $_POST['distro'];
        list($can, $oai, $bucket, $file, $domain, $type) = explode('|', $distro);
        $packet = array('type' => 'CanonicalUser', 'id' => $can, 'name' => 'CloudFront Origin Access Identity ' . $oai, 'permission' => 'READ');
        $acp = array();
        require_once YSS_CLASSES_DIR . 'S3.php';
        $s3 = new S3();
        $s3->setAuth(get_option('yss_user_key'), get_option('yss_secret_key'));
        //get existing and merge
        $acp = $s3->getAccessControlPolicy($bucket, $file);
        $acp['acl'][] = $packet;
        if ($s3->setAccessControlPolicy($bucket, $file, $acp)) {
            $acp = $s3->getAccessControlPolicy($bucket, $file);
            // store
            $distribution = json_decode($s3file->distribution);
            if ($type == 'stream') {
                $distribution->streaming = $domain;
            } else {
                $distribution->download = $domain;
            }
            $distribution = json_encode($distribution);
            $sql = 'UPDATE ' . $yss_db . ' SET
						distribution = \'' . $distribution . '\'
					WHERE id = ' . $id;
            $wpdb->query($sql);
            echo '<div id="message" class="updated"><p>Permissions updated</p></div>';
            yss_s3_list();
            return;
        } else {
            echo '<div id="message" class="error"><p>Permissions update failed</p></div>';
        }
    }
    if ($type == 'stream') {
        $data = $yss_cloudfront->get_streaming();
    } else {
        $data = $yss_cloudfront->get_distribution();
    }
    if (is_array($data)) {
        $test = array_keys($data);
        if ($test[0] != '0') {
            $data = array($data);
        }
    }
    if (is_array($data)) {
        echo ym_box_top('Deploy');
        echo '
<form action="" method="post">
	<fieldset>
		<p>You can select a distribution to expose the file, ' . $s3file->bucket . '/' . $s3file->resource_path . ' onto</p>
		<table class="form-table">
			';
        $items = array('blank' => 'Select');
        foreach ($data as $item) {
            $bucket = $item['S3Origin']['DNSName']['value'];
            list($bucket, $null) = explode('.', $bucket, 2);
            $enabled = $item['Enabled']['value'];
            if ($enabled == 'true' && $s3file->bucket == $bucket) {
                // Distribution is enabled and is for this bucket matches
                $status = $item['Status']['value'];
                $domain = $item['DomainName']['value'];
                $oai = $item['S3Origin']['OriginAccessIdentity']['value'];
                list($null, $nulm, $oai) = explode('/', $oai);
                // oai needs canonical
                $canonical = $yss_cloudfront->get_oai_canonical($oai);
                $value = $canonical . '|' . $oai . '|' . $bucket . '|' . $s3file->resource_path . '|' . $domain . '|' . $type;
                //echo '<option value="' . $value . '">' . $domain . '</option>';
                $items[$value] = $domain;
            }
        }
        $ym_formgen->render_combo_from_array_row('Distribution', 'distro', $items, '', 'Which Distribution to expose this file on');
        echo '
		</table>
		<p class="submit">
			<input type="submit" value="Deploy!" />
		</p>
	</fieldset>
</form>
';
        echo ym_box_bottom();
    } else {
        echo '<div id="message" class="error"><p>Failed to load Distributions or none available</p></div>';
    }
}
示例#20
0
    }
} else {
    ym_box_top(__('Error', 'ym'));
    echo __('<p>Failed to connect to the Forums</p>', 'ym');
    ym_box_bottom();
}
echo '</div>';
echo '<div id="posts">';
$url = 'http://yourmembers.co.uk/forum/feed.php?mode=posts';
if ($data = ym_remote_request($url)) {
    $data = xml2array($data, 1, 'nottag');
    foreach ($data['feed']['entry'] as $forum) {
        $title = $forum['title']['value'];
        $url = $forum['link']['attr']['href'];
        $content = $forum['content']['value'];
        $updated = $forum['updated']['value'];
        ym_box_top('<a href="' . $url . '">' . $title . '</a>');
        echo $content;
        ym_box_bottom();
    }
} else {
    ym_box_top(__('Error', 'ym'));
    echo __('<p>Failed to connect to the Forums</p>', 'ym');
    ym_box_bottom();
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '
<script type="text/javascript">
' . "\n\tjQuery(document).ready(function() {\n\t\tjQuery('#tabs').tabs({\n\t\t\tselected: 0\n\t\t});\n\t});\n</script>\n";
            }
            echo '<td>' . $page_fields . '</td>';
            echo '<td><a href="' . $thispage . '&action=edit&what=page&id=' . $row->page_id . '" class="button-primary">' . __('Edit', 'ym') . '</a>
	<a href="' . $thispage . '&action=delete&what=page&id=' . $row->page_id . '" class="deletelink button-secondary">' . __('Delete', 'ym') . '</a></td>';
            echo '</tr>';
        }
        if (!$wpdb->num_rows) {
            echo '<tr><td colspan="4" style="text-align: center;">' . __('There are currently no flow pages', 'ym') . '</td></tr>';
        }
        echo '<tr>
<td colspan="3">&nbsp;</td>
<td><a href="' . $thispage . '&action=createpage" class="button-primary">' . __('Create Page', 'ym') . '</a></td>
</tr>';
        echo '</table>';
        ym_box_bottom();
        ym_box_top(__('Widget Settings', 'ym'));
        echo '<p>' . __('Some Registration Flow Page elements have settings, you can set them below', 'ym') . '</p>';
        echo '
<form action="" method="post">
	<fieldset>
		<input type="hidden" name="action" value="update_facebook_widget" />

		<table class="form-table">
			<tr>
				<th>' . __('Facebook App ID', 'ym') . '</th>
				<td><input type="text" name="ym_register_flow_fb_app_id" value="' . get_option('ym_register_flow_fb_app_id') . '" /></td>
			</tr><tr>
				<th>' . __('Facebook Secret', 'ym') . '</th>
				<td><input type="text" name="ym_register_flow_fb_secret" value="' . get_option('ym_register_flow_fb_secret') . '" /></td>
			</tr>';
        /*
	</p>
</form>
 
<?php 
    echo ym_end_box();
    ?>
</div>
</div>
<?php 
} else {
    // New Form
    ?>
<div class="wrap" id="poststuff">

<?php 
    ym_box_top(__('Add Custom Field', 'ym'), TRUE);
    ?>

 <form action="" method="post">

 <p><label><?php 
    _e('Name:', 'ym');
    ?>
<br />
 <input type="text" name="name" style="width: 250px;"/></label></p>
<?php 
    echo __('Name can only contain a-z, 0-9, and _ characters and is limited to 10 Characters in length, anything not matching this rule will not be syncing with MailChimp', 'ym');
    ?>
 <p><label><?php 
    _e('Label:', 'ym');
    ?>
示例#23
0
            $wpdb->query($sql);
            $email_id = $wpdb->insert_id;
        }
        $args = array($email_id, $recipient_list);
        wp_schedule_single_event($time, 'mm_scheduled_email', $args);
        ym_box_top(__('Broadcast', 'ym_mailamager'));
        echo '<p>' . sprintf(__('Scheduled for %s it is currently %s', 'ym_mailmanager'), date('r', $time), date('r', time())) . '</p>';
        ym_box_bottom();
        $passed_id = $email_id;
        include 'preview.php';
        global $mm;
        echo '<meta http-equiv="refresh" content="10;' . $mm->page_root . '" />';
        return;
    }
}
ym_box_top(__('Broadcast', 'ym_mailmanager'));
echo '<form action="" method="post">';
echo '<p>' . __('Schedule or send immediately a message to selected Users', 'ym_mailmanager') . '</p>';
echo '<table class="form-table">';
define('BROADCAST_FORM_OPEN', TRUE);
do_action('mailmanager_broadcast_form');
if (!defined('MAILMANAGER_FORM_REPLACED')) {
    echo $ym_formgen->render_combo_from_array_row(__('Recipients', 'ym_mailmanager'), 'recipient_list', mailmanager_get_recipients(), $recipient_list, __('Select a List to send to', 'ym_mailmanager'));
    $emails = mailmanager_get_emails(TRUE);
    if ($emails) {
        echo $ym_formgen->render_combo_from_array_row(__('Select Prior Email', 'ym_mailmanager'), 'email_id', $emails, $email_id, __('Select a previously created email', 'ym_mailmanager'));
    }
    echo $ym_formgen->render_form_table_text_row(__('Email Subject', 'ym_mailmanager'), 'email_subject', $email_subject, __('Subject of Message', 'ym_mailmanager'));
    $ym_formgen->render_form_table_wp_editor_row(__('Email Message', 'ym_mailmanager'), 'email_message', $email_message, __('Message to Send, you can use HTML. You can use [ym_mm_custom_field field=""] [ym_mm_if_custom_field field=""]content[/ym_mm_if_custom_field] where the "" is a Custom Profile Field', 'ym_mailmanager'));
    echo $ym_formgen->render_form_table_datetime_picker_row(__('Send At', 'ym_mailmanager'), 'email_date', $time, __('Date/Time to send Message', 'ym_mailmanager'));
}
 function options()
 {
     global $ym_upload_url, $ym_upload_root;
     if ($_POST && isset($_POST['submit'])) {
         // call save
         if (method_exists($this, 'save_options')) {
             $this->save_options();
         } else {
             $this->buildnsave();
         }
     }
     echo '<div class="wrap" id="poststuff">';
     if (method_exists($this, 'my_options')) {
         // use class methid
         $this->my_options();
     } else {
         if (method_exists($this, 'load_options')) {
             ym_box_top('&nbsp');
             echo '<form action="" method="post" enctype="multipart/form-data">';
             // use generator
             $options = $this->load_options();
             //			if (!$options) {
             if (!is_array($options)) {
                 return;
             }
             if (method_exists($this, 'pay_per_post_bundle')) {
                 array_unshift($options, array('name' => 'bundle_purchase_words', 'label' => __('Bundle Purchase', 'ym'), 'caption' => __('You can change the Gateway Name/Bundle Purchase Words display to something more customer Friendly', 'ym'), 'type' => 'text'));
             }
             if (method_exists($this, 'pay_per_post')) {
                 array_unshift($options, array('name' => 'post_purchase_words', 'label' => __('Post Purchase', 'ym'), 'caption' => __('You can change the Gateway Name/Post Purchase Words display to something more customer Friendly', 'ym'), 'type' => 'text'));
             }
             array_unshift($options, array('name' => 'membership_words', 'label' => __('Gateway Name', 'ym'), 'caption' => __('You can change the Gateway Name/Membership Words display to something more customer Friendly', 'ym'), 'type' => 'text'));
             $options[] = array('name' => 'logo', 'label' => __('Button/Logo', 'ym'), 'caption' => '', 'type' => 'image');
             $options[] = array('name' => 'callback_script', 'label' => __('Callback Script', 'ym'), 'caption' => __('Javascript to run on a successfully return from PayPal, useful for integration with affiliate schemes or other tracking. This is a Raw HTML field and is applied to the HTML Head. You can use these short codes to represent certain vaiables: [user_id], [pack_id], [post_id], [post_pack_id], [cost], [account_type], [item_code], [if_cb_pack][/if_cb_pack] show content if a pack, [if_cb_post][/if_cb_post] show content if a post, [if_cb_bundle][/if_cb_bundle] show content if a bundle', 'ym'), 'type' => 'textarea');
             foreach ($options as $option) {
                 echo '<div class="ym_option">';
                 echo '<label for="' . $option['name'] . '">' . $option['label'] . '</label>';
                 if ($option['caption']) {
                     echo '<p class="caption">' . $option['caption'] . '</p>';
                 }
                 $var = $option['name'];
                 $val = isset($this->{$var}) ? $this->{$var} : '';
                 if ($option['type'] == 'image') {
                     echo '<p class="caption">' . __('Current:', 'ym') . '<br /><img src="' . $val . '" alt="Image" /></p>';
                 }
                 echo '<span class="input">';
                 switch ($option['type']) {
                     case 'yesno':
                         echo '<select name="' . $option['name'] . '">';
                         echo '<option value="1" ' . ($val == 1 ? 'selected="selected"' : '') . ' >' . __('Yes', 'ym') . '</option>';
                         echo '<option value="0"' . ($val == 1 ? '' : 'selected="selected"') . '>' . __('No', 'ym') . '</option>';
                         echo '</select>';
                         break;
                     case 'status':
                         $option['options'] = array('test' => 'test', 'live' => 'live');
                     case 'select':
                         echo '<select name="' . $option['name'] . '">';
                         if ($option['type'] == 'select') {
                             echo '<option value="">' . __('--Select--', 'ym') . '</option>';
                         }
                         foreach ($option['options'] as $optionkey => $optionval) {
                             echo '<option value="' . $optionkey . '"';
                             if ($val == $optionkey) {
                                 echo ' selected="selected" ';
                             }
                             echo '>' . ucwords($optionval) . '</option>';
                         }
                         echo '</select>';
                         break;
                     case 'image':
                     case 'file':
                         echo '<input type="file" name="' . $option['name'] . '" id="' . $option['name'] . '" />';
                         break;
                     case 'textarea':
                         echo '<textarea name="' . $option['name'] . '" id="' . $option['name'] . '" cols="50" rows="5">' . $val . '</textarea>';
                         break;
                     case 'wp_editor':
                         echo '<div style="width: 650px;">';
                         wp_editor($val, $option['name'], array('media_buttons' => FALSE));
                         echo '</div>';
                         break;
                     case 'url':
                         echo site_url();
                     case 'text':
                     default:
                         echo '<input type="text" name="' . $option['name'] . '" id="' . $option['name'] . '" value="' . $val . '" />';
                 }
                 echo '</span>';
                 echo '</div>';
             }
             echo '<input type="submit" class="button-primary" style="float: right;" name="submit" value="' . sprintf(__('Save Settings for %s', 'ym'), $this->name) . '" />';
             echo '</form>';
             ym_box_bottom();
             if (method_exists($this, 'options_additional')) {
                 $this->options_additional();
             }
         } else {
             echo '<div id="message" class="error"><p>' . sprintf(__('There are no user settable options for this gateway, %s', 'ym'), $this->name) . '</p></div>';
         }
     }
     echo '</div>';
     return;
 }
        if (ym_get('message')) {
            echo '<div id="message" class="updated fade"><p>';
        }
        if (ym_get('message') == 'ok') {
            echo __('Packages were updated', 'ym');
        }
        if (ym_get('message') == 'order') {
            echo __('Package order was updated', 'ym');
        }
        if (ym_get('message') == 'deleted') {
            echo __('The Pack was deleted', 'ym');
        }
        if (ym_get('message')) {
            echo '</p></div>';
        }
        ym_box_top('&nbsp');
        echo '<form action="' . $link . 'order" method="post" onsubmit="ym_process_sort();">';
        echo '<table class="form-table" id="sorttable">';
        $header = '<tr>
				<th style="width: 20px;">' . __('ID', 'ym') . '</th>
				<th>' . __('Label', 'ym') . '</th>
				<th>' . __('Cost', 'ym') . '</th>
				<th>' . __('Package Type', 'ym') . '</th>
				<th>' . __('WP Role', 'ym') . '</th>
				<th style="width: 40px;">' . __('Visible', 'ym') . '</th>
				<th style="width: 40px;">' . __('Group', 'ym') . '</th>
				<th style="width: 100px; text-align: center;">' . __('User Count', 'ym') . '</th>
				<th style="width: 20px;"></th><th style="width: 20px;"></th>
			</tr>';
        echo '<thead>' . $header . '</thead>';
        echo '<tfoot>' . $header . '</tfoot>';
function ym_tos_checks()
{
    global $ym_version_resp, $ym_auth;
    $key = ym_post('registration_email', FALSE);
    $tos_result = FALSE;
    $ym_tos_version_accepted = get_option('ym_tos_version_accepted', 0);
    if ($ym_tos_version_accepted < $ym_version_resp->tos->tos_version_id) {
        if (ym_post('activate_plugin') == 'tosterms') {
            // submitted form
            $tos_result = $ym_auth->tos_submit();
            if (!is_wp_error($tos_result) && $key) {
                // reload for recon
                ym_check_version(TRUE);
                ym_activate_last_step($key);
            }
        }
        // Show FORM
        echo '
<div class="wrap" id="poststuff">
	<h2>' . YM_ADMIN_NAME . '</h2>';
        ym_box_top(__('The End User License has been Updated', 'ym'));
        if (is_wp_error($tos_result)) {
            echo '<div id="message" class="error ym_auth">';
            echo '<div style="margin: 5px 0px; color:red; font-weight:bold;">';
            echo $tos_result->get_error_message();
            echo '</div></div>';
        }
        echo '<iframe src="' . $ym_version_resp->tos->tos_text_url . '" style="width: 100%; height: 500px;"></iframe>';
        echo '<p style="float: right;"><a href="' . $ym_version_resp->tos->tos_text_url . '">' . __('Download EULA', 'ym') . '</a></p>';
        echo '
	<form action="" method="post">
		<fieldset>
			<table class="form-table" style="width: 50%; margin: 10px auto; text-align: center;" >
				<tr>
					<td>
			<label for="confirm_email">' . __('Please confirm your Email', 'ym') . '</label>
					</td><td>
			<input type="email" name="confirm_email" id="confirm_email" value="' . ym_post('confirm_email') . '" style="width: 300px;" />
			<input type="hidden" name="registration_email" value="' . ym_post('registration_email') . '" />
					</td>
				</tr>
				<tr>
					<td colspan="2">

			<p>' . __('To continue you must accept the terms of this agreement:', 'ym') . '</p>
				<input type="hidden" name="activate_plugin" value="tosterms" />
				<input type="hidden" name="tosversion" value="' . $ym_version_resp->tos->tos_version_id . '" />
					</td>
				</tr><tr>
					<td colspan="2">
						<label for="tickbox">' . __('I accept the terms of this agreement:', 'ym') . '</label>
						<input type="checkbox" name="tickbox" id="tickbox" value="ticked" />
					</td>
				</tr><tr>
					<td colspan="2">
						<p class="submit" style="text-align: center;">
							<input type="submit" class="button-secondary" name="tos" value="Uninstall" />
							<input type="submit" class="button-primary" name="tos" value="Continue" style="font-weight: 700;" />
						</p>
					</td>
				</tr>
			</table>
		</fieldset>
	</form>';
        ym_box_bottom();
        echo '
</div>
';
    } else {
        if ($key) {
            // TOS OK/already accepted
            ym_activate_last_step($key);
        } else {
            return FALSE;
        }
    }
    return TRUE;
}
</p>
<?php 
echo ym_box_top(__('Your Members Admin Area Access', 'ym'));
echo '<table class="form-table">';
echo $ym_formgen->render_combo_from_array_row(__('WP Role Level', 'ym'), 'admin_role', $roles_array, $ym_sys->admin_role);
echo $ym_formgen->render_combo_from_array_row(__('Minimum WP Role for Content User interface', 'ym'), 'account_interface_admin_role', $roles_array, $ym_sys->account_interface_admin_role, __('The minimum WP Role that the user must have to see the account interface (post and page editor sidebar box for authoring) for YM', 'ym'));
echo '</table>';
echo ym_end_box();
?>
<p class="submit" style="text-align: right;">
	<input type="submit" name="settings_update" value="<?php 
_e('Save Settings', 'ym');
?>
 &raquo;" class="button-primary" style="float: right;" />
</p>
<?php 
echo ym_box_top(__('Dev Tools', 'ym'));
echo $ym_formgen->render_form_table_radio_row(__('Dev Tools', 'ym'), 'dev_tools', $ym_sys->dev_tools);
echo ym_end_box();
?>

<p class="submit" style="text-align: right;">
	<input type="submit" name="settings_update" value="<?php 
_e('Save Settings', 'ym');
?>
 &raquo;" class="button-primary" style="float: right;" />
</p>

</form>
</div>
示例#28
0
 function series_precontent()
 {
     ym_box_top('Message');
     echo '<p>' . __('Series are being kept synced with Aweber.') . '</p>';
     echo '<p>' . __('The Aweber Associated Lists can only be sent to via Aweber, a series entry exists for Sync Reasons') . '</p>';
     ym_box_bottom();
     add_filter('mailmanager_adjust_recipients', array($this, 'filter_lists_remove'), 10, 1);
 }
示例#29
0
        } else {
            if (isset($state->update) && version_compare($state->update->version, $ym_update_checker->getInstalledVersion(), '<')) {
                echo '<div id="message" class="updated"><p>' . sprintf(__('You are running a newer version, <a href="%s">Reinstall Latest (V%s)</a> or <a href="%s">Download</a>', 'ym'), $reinstall, $state->update->version, $download_url) . '</p></div>';
            }
        }
    }
} else {
    if (!defined('DISABLE_VERSIONING')) {
        define('DISABLE_VERSIONING', TRUE);
    }
}
echo '
<div class="wrap" id="poststuff">
<h2>' . YM_ADMIN_NAME . '</h2>
';
ym_box_top(__('About', 'ym') . ' ' . YM_ADMIN_NAME);
echo '
<p style="text-align: center;">
<img src="' . YM_IMAGES_DIR_URL . 'logo.png" alt="' . YM_ADMIN_NAME . ' Logo" />
</p>
';
echo '
<p>
' . YM_ADMIN_NAME . ' Version ' . YM_PLUGIN_VERSION . '
</p><p>
' . YM_ADMIN_NAME . ' is Copyright <a href="http://CodingFutures.co.uk/">Coding Futures Ltd</a> all rights reserved (' . date('Y', time()) . ')
</p><p>
Support Information: PHP Version ' . phpversion() . ', WordPress version: ' . $wp_version . '
</p><p>
A copy of the End User License Agreement should be included in the download zip file, one can be obtained from ';
if (defined('DISABLE_VERSIONING')) {
示例#30
0
	</p>';
    ym_box_bottom();
} else {
    if (!$page && empty($filters['by_option'])) {
        // case: No users found
        echo '
	<div id="message" class="error"><p><strong><center>' . __('There are no subscribed users.', 'ym') . '</center></strong></p></div>
';
        ym_box_top(__('Tasks', 'ym'));
        echo '<label for="create_user"><input type="submit" id="ym_members_create_user" name="task" class="button-secondary" value="' . $ym_members_tasks['create_user'] . '" /></label>';
        ym_box_bottom();
    } else {
        echo '
	<div id="message" class="error"><p><strong><center>' . __('There are no users on this page.', 'ym') . '</center></strong></p></div>
';
        ym_box_top(__('Tasks', 'ym'));
        echo '<label for="create_user"><input type="submit" id="ym_members_create_user" name="task" class="button-secondary" value="' . $ym_members_tasks['create_user'] . '" /></label>';
        ym_box_bottom();
        ym_members_filters($filters);
    }
}
echo '</form>';
echo '
<form id="ym_members_create_user_form" method="post">
';
wp_nonce_field('ymmembertasks', 'ym-members');
echo '
	<fieldset>
		<legend>' . __('Create a User', 'ym') . '</legend>
		<table>
';