<?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;
 }
Example #3
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;
}
function id_projectGoal($attrs)
{
    if (isset($attrs['product'])) {
        $project_id = $attrs['product'];
        $project = new ID_Project($project_id);
        //$goal = $project->the_goal();
        $goal = apply_filters('id_project_goal', $project->the_goal(), $project->get_project_postid());
        return '<span class="product-goal" style="clear: both;">' . $goal . '</span>';
    } else {
        return null;
    }
}
function manage_ign_product_columns($column_name, $id)
{
    global $post;
    require 'languages/text_variables.php';
    $post_id = $post->ID;
    $project_id = get_post_meta($id, 'ign_project_id', true);
    $project = new ID_Project($project_id);
    $cCode = $project->currency_code();
    switch ($column_name) {
        // display goal amount with currency formatting
        case 'author':
            echo !empty($post->post_author) ? $post->post_author : __('None', 'ignitiondeck');
            break;
        case 'type':
            $type = get_post_meta($post_id, 'ign_project_type', true);
            if (isset($type)) {
                if ($type == 'pwyw') {
                    $type = __('Pledge What You Want', 'Ignitiondeck');
                } else {
                    if ($type == 'level-based') {
                        $type = __('Level-Based', 'ignitiondeck');
                    }
                }
            }
            $type = apply_filters('id_project_type', $type);
            echo isset($type) ? $type : '';
            break;
        case 'goal':
            if (get_post_meta($post->ID, 'ign_fund_goal', true)) {
                //$goal_amt = number_format(get_post_meta( $post->ID, 'ign_fund_goal', true), 2, '.', ',');
                setlocale(LC_MONETARY, 'en_US');
                //echo //money_format('%(#10n', $goal_amt);
                //	$cCode.$goal_amt;
                $project = new ID_Project($project_id);
                $goal = apply_filters('id_project_goal', $project->the_goal(), $post_id);
                echo $goal;
            } else {
                echo '<em>' . $tr_No_Goal_set . '</em>';
            }
            break;
        case 'raised':
            if (isset($project_id)) {
                $project = new ID_Project($project_id);
                $post_id = $project->get_project_postid();
                $raised = apply_filters('id_funds_raised', $project->get_project_raised(), $post_id);
                echo $raised;
            }
            break;
            // display end date
        // display end date
        case 'enddate':
            if (get_post_meta($post->ID, 'ign_fund_end', true)) {
                echo get_post_meta($post->ID, 'ign_fund_end', true);
            } else {
                echo '<em>' . $tr_No_Date_set . '</em>';
            }
            break;
            // calculate days remaining
        // calculate days remaining
        case 'daysleft':
            if (get_post_meta($post->ID, 'ign_fund_end', true)) {
                $days_left = $project->days_left();
                //$ending = get_post_meta( $post->ID, 'ign_fund_end', true);
                //$daysleft = ID_Project::days_left($ending);
                echo $days_left;
            } else {
                echo '<em>' . $tr_No_Date_set . '</em>';
            }
            break;
            // return standard post columns
        // return standard post columns
        default:
            break;
    }
    // end switch
}