示例#1
0
 function html($widget, $params, $sidebar)
 {
     global $post, $wpdb;
     $show_mini = false;
     $page_project_id = 0;
     $custom = false;
     // Condition to store the product_id, if the page currently being visited is the project page or some other
     if (isset($post)) {
         if ($post->post_type == 'ignition_product') {
             $post_id = $post->ID;
             $page_project_id = get_post_meta($post_id, 'ign_project_id', true);
             //$page_project_id = projectPageof($post->ID, $params['product_id']);
         }
         // We have three conditions now
         // 1.	Show Mini widget only, on all pages
         // 2.	Show Full widget on all pages
         // 3.	Show Mini widget on all pages except the project page
         if (isset($params['widget_options'])) {
             if ($params['widget_options'] == "miniwidget") {
                 $show_mini = true;
             } else {
                 if ($params['widget_options'] == "fullwidget") {
                     $show_mini = false;
                 } else {
                     if ($params['widget_options'] == "miniallpages" && $page_project_id > 0) {
                         //2nd condition means it is a project page, containing some non-zero project_id
                         $show_mini = false;
                     } else {
                         $show_mini = true;
                     }
                 }
             }
         } else {
             $show_mini = true;
         }
         if (isset($params['deck_id']) && $params['deck_id'] > 0) {
             $deck_id = $params['deck_id'];
             $settings = Deck::get_deck_attrs($deck_id);
             if (!empty($settings)) {
                 $attrs = unserialize($settings->attributes);
                 $custom = true;
             }
         }
     }
     // If it's a project page, use the post_id to get the product, else use the product_id in $params
     if ($page_project_id > 0) {
         $project_id = $page_project_id;
     } else {
         $project_id = $params['product_id'];
     }
     $deck = new Deck($project_id);
     if ($show_mini == true) {
         $mini_deck = $deck->mini_deck();
         $post_id = $mini_deck->post_id;
     } else {
         $the_deck = $deck->the_deck();
         $post_id = $deck->post_id;
     }
     $custom = apply_filters('idcf_custom_deck', $custom, $post_id);
     $attrs = apply_filters('idcf_deck_attrs', isset($attrs) ? $attrs : null, $post_id);
     $widget_before = '';
     $widget_after = '';
     $mini_widget_before = '';
     $mini_widget_after = '';
     // Calling the HTML code
     ob_start();
     require ID_PATH . 'languages/text_variables.php';
     include ID_PATH . 'templates/_igWidget.php';
     $widget = ob_get_contents();
     ob_end_clean();
     if ($show_mini) {
         echo apply_filters('id_mini_widget', $widget);
     } else {
         echo apply_filters('id_widget', $widget);
     }
 }
示例#2
0
<?php

global $post;
$id = $post->ID;
$content = the_project_content($id);
$project_id = get_post_meta($id, 'ign_project_id', true);
if (class_exists('Deck')) {
    $deck = new Deck($project_id);
    $the_deck = $deck->the_deck();
    $levels = $the_deck->level_data;
    //$levels = the_levels($id);
    $type = get_post_meta($id, 'ign_project_type', true);
    $end_type = get_post_meta($id, 'ign_end_type', true);
    $project = new ID_Project($project_id);
    $days_left = $project->days_left();
}
?>
<aside id="sidebar">
  <?php 
get_template_part('project', 'author');
?>
  <!-- check for closed projects -->
   <h3 class="widget-title levels"><?php 
_e('REWARDS', 'fivehundred');
?>
</h3>
  <div class="project-sidebar-wrapper">
  <div id="ign-product-levels" data-projectid="<?php 
echo $project_id;
?>
">
示例#3
0
function fh_level_select($project_id)
{
    //ob_start();
    global $pwyw;
    $permalink_structure = get_option('permalink_structure');
    if (empty($permalink_structure)) {
        $prefix = '&';
    } else {
        $prefix = '?';
    }
    if (class_exists('Deck')) {
        //$project = new ID_Project($project_id);
        $deck = new Deck($project_id);
        $the_deck = $deck->the_deck();
        if (isset($the_deck) && $the_deck->project_type !== 'pwyw') {
            $post_id = $the_deck->post_id;
            if (function_exists('idc_checkout_image')) {
                $image = idc_checkout_image($post_id);
                $level_data = $the_deck->level_data;
                $action = get_permalink($post_id) . $prefix . 'purchaseform=500&prodid=' . $project_id;
                include_once ID_PATH . 'templates/_lbLevelSelect.php';
            }
            //$content = ob_get_contents();
            //ob_end_flush();
            //echo $content;
        }
    }
    return;
}
function id_projectPageComplete($attrs)
{
    if (isset($attrs['product'])) {
        ob_start();
        require 'languages/text_variables.php';
        $project_id = $attrs['product'];
        $deck = new Deck($project_id);
        $custom = false;
        if (isset($attrs['deck'])) {
            $deck_id = $attrs['deck'];
            $settings = Deck::get_deck_attrs($deck_id);
            if (!empty($settings)) {
                $attrs = unserialize($settings->attributes);
                $custom = true;
            }
        }
        $the_deck = $deck->the_deck();
        $post_id = $deck->get_project_postid();
        $settings = getSettings();
        $social_settings = maybe_unserialize(get_option('idsocial_settings'));
        $project_long_desc = html_entity_decode(get_post_meta($post_id, "ign_project_long_description", true));
        $float = 1;
        $custom = apply_filters('idcf_custom_deck', $custom, $the_deck->post_id);
        $attrs = apply_filters('idcf_deck_attrs', isset($attrs) ? $attrs : null, $the_deck->post_id);
        include 'templates/_projectContent.php';
        include 'templates/_igWidget.php';
        echo '<div style="clear: both;"></div>';
        $content = ob_get_contents();
        ob_end_clean();
        return apply_filters('id_project_complete', $content, $project_id);
    }
}
function embedWidget()
{
    global $wpdb;
    $tz = get_option('timezone_string');
    if (empty($tz)) {
        $tz = 'UTC';
    }
    date_default_timezone_set($tz);
    $theme_name = getThemeFileName();
    echo "<link rel='stylesheet' id='ignitiondeck-iframe-css'  href='" . plugins_url('/ignitiondeck-iframe.css?ver=3.1.3', __FILE__) . "' type='text/css' media='all' />";
    if (isset($_GET['product_no'])) {
        $project_id = $_GET['product_no'];
    }
    if (!empty($project_id)) {
        $deck = new Deck($project_id);
        $the_deck = $deck->the_deck();
        $post_id = $deck->get_project_postid();
        $project_desc = get_post_meta($post_id, "ign_project_description", true);
        $project_desc = get_post_meta($post_id, "ign_project_description", true);
        //GETTING the main settings of ignitiondeck
        $settings = getSettings();
        $logo_on = true;
        if (is_id_pro() && $settings->id_widget_logo_on !== '1') {
            $logo_on = false;
        }
        //GETTING project URL
        $product_url = getProjectURLfromType($project_id);
        require 'languages/text_variables.php';
        include 'templates/_embedWidget.php';
    }
    exit;
}