<?php

/**
 * The default template for displaying IgnitionDeck projects.
 */
$project_id = get_post_meta($post->ID, 'ign_project_id', true);
$project = new ID_Project($project_id);
$post_id = $project->get_project_postid();
$raised = apply_filters('id_funds_raised', $project->get_project_raised(), $project->get_project_postid());
$percent = apply_filters('id_percentage_raised', $project->percent(), apply_filters('id_funds_raised', $project->get_project_raised(), $post_id, true), $post_id, apply_filters('id_project_goal', $project->the_goal(), $post_id, true));
$colors = get_option('krown_colors');
//$retina = krown_retina();
?>
<div class="col-md-4">
	<article class="krown-id-item">

		<?php 
if (has_post_thumbnail($post->ID)) {
    $image = aq_resize(wp_get_attachment_url(get_post_thumbnail_id(), 'full'), $retina === 'true' ? 510 : 255, null, false, false);
    $img_obj = '<a class="fancybox-thumb" href="' . get_permalink($post->ID) . '"><figure class="img"><img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . get_the_title() . '" /></figure><span></span></a>';
} else {
    if (get_post_meta($post->ID, 'ign_product_image1', true) != '') {
        $image = aq_resize(get_post_meta($post->ID, 'ign_product_image1', true), $retina === 'true' ? 510 : 255, null, false, false);
        $img_obj = '<a class="fancybox-thumb" href="' . get_permalink($post->ID) . '"><figure class="img"><img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . get_the_title() . '" /></figure><span></span></a>';
    } else {
        $img_obj = '';
    }
}
echo $img_obj;
?>
 function hDeck()
 {
     //$the_project = parent::the_project();
     $prod_settings = parent::get_project_settings();
     if (empty($prod_settings)) {
         $prod_settings = getProductDefaultSettings();
     }
     $post_id = parent::get_project_postid();
     $end_type = get_post_meta($post_id, 'ign_end_type', true);
     $item_fund_goal = apply_filters('id_project_goal', parent::the_goal(), $post_id);
     $p_current_sale = apply_filters('id_funds_raised', parent::get_project_raised(), $post_id);
     //
     $item_fund_end = parent::end_date();
     $end_day = parent::end_day();
     $end_month = parent::end_month();
     $end_year = parent::end_year();
     $days_left = parent::days_left();
     //
     $rating_per = apply_filters('id_percentage_raised', parent::percent(), apply_filters('id_funds_raised', parent::get_project_raised(), $post_id, true), $post_id, apply_filters('id_project_goal', parent::the_goal(), $post_id, true));
     //$p_count = new stdClass;
     //$p_count->p_number = parent::get_project_orders();
     $p_number = apply_filters('id_number_pledges', parent::get_project_orders(), $post_id);
     $currencyCodeValue = $prod_settings->currency_code;
     $cCode = setCurrencyCode($currencyCodeValue);
     $hDeck = new stdClass();
     $hDeck->end_type = $end_type;
     $hDeck->goal = $item_fund_goal;
     $hDeck->total = $p_current_sale;
     // what is this for?
     //$hDeck->show_dates = $show_dates;
     $hDeck->end = $item_fund_end;
     $hDeck->day = $end_day;
     $hDeck->month = apply_filters('id_end_month', $end_month);
     $hDeck->year = $end_year;
     $hDeck->days_left = apply_filters('id_project_days_left', $days_left, $post_id);
     //
     $hDeck->percentage = $rating_per;
     $hDeck->pledges = $p_number;
     $hDeck->currency_code = $cCode;
     return $hDeck;
 }
 public static function set_percent_meta()
 {
     $projects = self::get_all_projects();
     foreach ($projects as $a_project) {
         $project = new ID_Project($a_project->id);
         $post_id = $project->get_project_postid();
         $percent = floatval($project->percent());
         if ($percent >= 100) {
             $successful = get_post_meta($post_id, 'ign_project_success', true);
             if (empty($successful) || !$successful) {
                 do_action('idcf_project_success', $post_id, $a_project->id);
             }
             if (apply_filters('idcf_do_project_success', true, $post_id, $a_project->id, $successful)) {
                 update_post_meta($post_id, 'ign_project_success', 1);
             }
         } else {
             do_action('idcf_pre_remove_success', $post_id);
             do_action('idcf_remove_success', $post_id);
         }
         update_post_meta($post_id, 'ign_percent_raised', $percent);
     }
 }
Ejemplo n.º 4
0
function the_project_summary($id)
{
    $post = get_post($id);
    $project_id = get_post_meta($id, 'ign_project_id', true);
    $project = new ID_Project($project_id);
    $image_url = the_project_image($id, "1");
    $name = $post->post_title;
    $short_desc = html_entity_decode(get_post_meta($id, 'ign_project_description', true));
    $total = apply_filters('id_funds_raised', $project->get_project_raised(), $id);
    $goal = apply_filters('id_project_goal', $project->the_goal(), $id);
    $end = get_post_meta($id, 'ign_fund_end', true);
    $end_type = get_post_meta($id, 'ign_end_type', true);
    $days_left = $project->days_left();
    $pledgers = apply_filters('id_number_pledges', $project->get_project_orders(), $id);
    // ID Function
    // GETTING product default settings
    $default_prod_settings = getProductDefaultSettings();
    // Getting product settings and if they are not present, set the default settings as product settings
    $prod_settings = getProductSettings($project_id);
    if (empty($prod_settings)) {
        $prod_settings = $default_prod_settings;
    }
    $currency_code = $prod_settings->currency_code;
    //GETTING the currency symbols
    $cCode = setCurrencyCode($currency_code);
    if ($end !== '') {
        $show_dates = true;
    } else {
        $show_dates = false;
    }
    // percentage bar
    $percentage = apply_filters('id_percentage_raised', $project->percent(), apply_filters('id_funds_raised', $project->get_project_raised(), $id, true), $id, apply_filters('id_project_goal', $project->the_goal(), $id, true));
    $successful = get_post_meta($id, 'ign_project_success', true);
    $summary = new stdClass();
    $summary->end_type = $end_type;
    $summary->image_url = $image_url;
    $summary->name = $name;
    $summary->short_description = $short_desc;
    $summary->total = $total;
    $summary->goal = $goal;
    $summary->pledgers = $pledgers;
    $summary->show_dates = $show_dates;
    if ($show_dates == true) {
        $summary->days_left = $days_left;
    }
    $summary->percentage = $percentage;
    $summary->successful = $successful;
    $summary->currency_code = $cCode;
    return $summary;
}