Ejemplo n.º 1
0
    function sf_campaign_sidebar()
    {
        global $post;
        $campaign = new ATCF_Campaign($post->ID);
        $download_id = $post->ID;
        $prices = edd_get_variable_prices($download_id);
        $type = edd_single_price_option_mode($download_id) ? 'checkbox' : 'radio';
        $extra_class = "";
        if ($campaign->is_donations_only()) {
            $extra_class = 'project-donate-only';
        }
        ?>
            <div id="back-this-project" class="campaign-sidebar <?php 
        echo esc_attr($extra_class);
        ?>
 col-sm-4">
                <?php 
        if ($campaign->is_active()) {
            if ($campaign->is_donations_only()) {
                echo '<p class="donate-only">' . __('This project is donation only, and you can donate using the button below.', 'swiftframework') . '</p>';
                echo edd_get_purchase_link(array('download_id' => $post->ID, 'class' => 'accent sf-button contribute-now', 'price' => false, 'text' => __('Donate Now', 'swiftframework')));
            } else {
                echo edd_get_purchase_link(array('download_id' => $post->ID, 'class' => 'accent sf-button contribute-now', 'price' => false, 'text' => __('Contribute Now', 'swiftframework')));
            }
        } else {
            // Inactive, just show options with no button
            if ($campaign->is_donations_only()) {
                echo '<p class="project-ended">' . __('This project has ended.', 'swiftframework') . '</p>';
            } else {
                atcf_campaign_contribute_options($prices, $type, $download_id);
            }
        }
        ?>
            </div>
        <?php 
    }
">
				  	<?php 
_e('Donate now', TEXTDOMAIN);
?>
				</button>
			</div>

			<?php 
if ($campaign->is_funded()) {
    ?>
				<span class="campaign-successful"><?php 
    _e('Successful', TEXTDOMAIN);
    ?>
</span>
			<?php 
} elseif (!$campaign->is_active() && !$campaign->is_funded()) {
    ?>
				<span class="campaign-unsuccessful"><?php 
    _e('Unsuccessful', TEXTDOMAIN);
    ?>
</span>
			<?php 
}
?>
			<div class="entry-date">
				<p class="day"><?php 
the_time('d');
?>
</p>
				<p class="month"><?php 
the_time('M');