예제 #1
0
function bfox_plans_edit_schedule_meta_box_cb()
{
    global $post;
    wp_nonce_field('bfox', 'bfox_plan_edit_schedule_nonce');
    ?>
	<p><?php 
    _e('You can add an optional schedule to your reading plan.', 'bfox');
    ?>
</p>

	<h4><?php 
    _e('Start Date', 'bfox');
    ?>
</h4>
	<p><?php 
    _e('Set the date you want to start reading this reading plan (in YYYY-MM-DD format - ex. \'2010-12-31\')', 'bfox');
    ?>
</p>
	<p><input type="text" name="schedule-start" id="schedule-start" class="datepicker" value="<?php 
    echo bfox_plan_meta('start_date');
    ?>
" /></p>
	<p><?php 
    _e('Use YYYY-MM-DD format (ex. \'2010-12-31\')', 'bfox');
    ?>
</p>

	<h4><?php 
    _e('Reading Frequency', 'bfox');
    ?>
</h4>
	<p><?php 
    _e('How often will you read?', 'bfox');
    ?>
</p>
	<p>
	<?php 
    foreach (bfox_plan_schedule_frequencies() as $key => $frequency) {
        ?>
			<label><input type="radio" name="schedule-frequency" value="<?php 
        echo $key;
        ?>
"<?php 
        checked($key, bfox_plan_meta('frequency'));
        ?>
 /> <?php 
        echo $frequency['label'];
        ?>
</label>
	<?php 
    }
    ?>
	</p>

	<h4><?php 
    _e('Readings Per Day', 'bfox');
    ?>
</h4>
	<p><?php 
    _e('How many readings will you read at a time?', 'bfox');
    ?>
</p>
	<p><input type="text" name="schedule-per-day" id="schedule-per-day" value="1" /></p>

	<h4><?php 
    _e('Days of the Week', 'bfox');
    ?>
</h4>
	<p><?php 
    _e('Which days of the week will you read?', 'bfox');
    ?>
</p>
	<p>
		<label><input type="checkbox" name="schedule-days[]" value="0"<?php 
    checked(bfox_plan_is_day_included(0));
    ?>
/> <?php 
    _e('Su', 'bfox');
    ?>
</label>
		<label><input type="checkbox" name="schedule-days[]" value="1"<?php 
    checked(bfox_plan_is_day_included(1));
    ?>
/> <?php 
    _e('M', 'bfox');
    ?>
</label>
		<label><input type="checkbox" name="schedule-days[]" value="2"<?php 
    checked(bfox_plan_is_day_included(2));
    ?>
/> <?php 
    _e('Tu', 'bfox');
    ?>
</label>
		<label><input type="checkbox" name="schedule-days[]" value="3"<?php 
    checked(bfox_plan_is_day_included(3));
    ?>
/> <?php 
    _e('W', 'bfox');
    ?>
</label>
		<label><input type="checkbox" name="schedule-days[]" value="4"<?php 
    checked(bfox_plan_is_day_included(4));
    ?>
/> <?php 
    _e('Th', 'bfox');
    ?>
</label>
		<label><input type="checkbox" name="schedule-days[]" value="5"<?php 
    checked(bfox_plan_is_day_included(5));
    ?>
/> <?php 
    _e('F', 'bfox');
    ?>
</label>
		<label><input type="checkbox" name="schedule-days[]" value="6"<?php 
    checked(bfox_plan_is_day_included(6));
    ?>
/> <?php 
    _e('Sa', 'bfox');
    ?>
</label>
	</p>

	<h4><?php 
    _e('Excluded Dates', 'bfox');
    ?>
</h4>
	<textarea name="schedule-exclude" id="schedule-exclude" cols="28" rows="5"><?php 
    echo bfox_plan_excluded_dates_text();
    ?>
</textarea><br/>
	<p><?php 
    _e('You can exclude dates by entering them here in YYYY-MM-DD format (ex. \'2010-12-31\'). Separate individual dates by semicolons (\';\') or put them on separate lines. You can also create date ranges by using a colon in between two dates (ex. \'2010-12-31:2011-01-01\')', 'bfox');
    ?>
</p>
	<?php 
}
예제 #2
0
function bfox_plan_update_period_rss($post_id = 0)
{
    $freqs = bfox_plan_schedule_frequencies();
    $key = bfox_plan_meta('frequency', $post_id);
    return apply_filters('bfox_plan_update_period_rss', $freqs[$key]['adjective']);
}