function bfox_plan_last_build_date_rss($format = 'D, d M Y H:i:s +0000', $post_id = 0)
{
    $last_reading_date = bfox_plan_reading_gmdate(bfox_plan_latest_reading(), $format);
    $last_reading_time = strtotime($last_reading_date);
    $post = get_post($post_id);
    $last_save_date = mysql2date($format, $post->post_modified_gmt, false);
    $last_save_time = strtotime($last_save_date);
    if ($last_save_time > $last_reading_time) {
        return $last_save_date;
    } else {
        return $last_reading_date;
    }
}
Example #2
0
function bfox_plan_reading_shortcode($atts)
{
    // [bible-reading plan="cbr" intersects="old"]
    extract(shortcode_atts(array('post_id' => 0, 'reading' => 'latest', 'intersects' => '', 'tool' => ''), $atts));
    if (empty($post_id)) {
        return;
    }
    if ($reading == 'latest') {
        $reading = bfox_plan_latest_reading($post_id);
    }
    $reading_id = intval($reading);
    if ($reading_id >= bfox_plan_reading_count($post_id)) {
        return;
    }
    $ref_str = bfox_plan_reading_ref_str($reading_id, $post_id);
    if (!empty($intersects)) {
        $ref = new BfoxRef($ref_str);
        $sub = new BibleGroupPassage('bible');
        $sub->sub_ref(new BibleGroupPassage($intersects));
        $ref->sub_ref($sub);
        $ref_str = $ref->get_string();
    }
    $link = bfox_ref_link($ref_str);
    $content = $link;
    if (!empty($tool)) {
        $passage = bfox_tool_shortcode(array('tool' => $tool, 'ref' => $ref_str));
        $content = "{$link} {$passage}";
    }
    return $content;
}