Exemplo n.º 1
0
function ign_meta_boxes(array $meta_boxes)
{
    require 'languages/text_variables.php';
    $prefix = 'ign_';
    $meta_boxes[] = array('id' => 'product_meta', 'title' => $tr_Project, 'pages' => array('ignition_product'), 'context' => 'normal', 'priority' => 'high', 'class' => $prefix . 'projectmeta', 'fields' => array(array('name' => __('Project Type', 'ignitiondeck'), 'desc' => __('Pledge what you want or level based campaign. If you choose pledge what you want, only the first level will be used. If you choose level based, you can create as many levels as you need.', 'ignitiondeck'), 'id' => $prefix . 'project_type', 'class' => $prefix . 'projectmeta_left', 'show_help' => true, 'options' => array(array('name' => __('Pledge what you want', 'ignitiondeck'), 'id' => 'pwyw', 'value' => 'pwyw'), array('name' => __('Level based', 'ignitiondeck'), 'id' => 'level-based', 'value' => 'level-based')), 'type' => 'radio'), array('name' => __('Campaign End Options', 'ignitiondeck'), 'desc' => __('Choose how to handle campaign end. Leave open to keep collecting payments, closed to remove pledge button.', 'ignitiondeck'), 'id' => $prefix . 'end_type', 'class' => $prefix . 'projectmeta_right', 'show_help' => true, 'options' => array(array('name' => __('Open', 'ignitiondeck'), 'id' => 'open', 'value' => 'open'), array('name' => __('Closed', 'ignitiondeck'), 'id' => 'closed', 'value' => 'closed')), 'type' => 'radio'), array('name' => __('Funding Goal', 'ignitiondeck'), 'desc' => __('Amount you are seeking to raise (required)', 'ignitiondeck'), 'id' => $prefix . 'fund_goal', 'class' => $prefix . 'projectmeta_left_third', 'show_help' => true, 'type' => 'text_money'), !(function_exists('is_id_pro') && is_id_pro()) ? array('type' => '') : array('name' => __('Proposed Start Date', 'ignitiondeck'), 'desc' => __('The date the project creator wishes to start funding', 'ignitiondeck'), 'id' => $prefix . 'start_date', 'class' => $prefix . 'projectmeta_third', 'show_help' => true, 'type' => 'text_date'), array('name' => __('Fundraising End Date', 'ignitiondeck'), 'desc' => __('Date funding will end (recommended)', 'ignitiondeck'), 'id' => $prefix . 'fund_end', 'class' => $prefix . 'projectmeta_third', 'show_help' => true, 'type' => 'text_date'), array('name' => __('Project Short Description', 'ignitiondeck'), 'desc' => __('Used in the grid, widget areas, and on the purchase form', 'ignitiondeck'), 'id' => $prefix . 'project_description', 'class' => $prefix . 'projectmeta_full', 'show_help' => true, 'type' => 'textarea_small'), array('name' => __('Project Long Description', 'ignitiondeck'), 'desc' => __('Supports HTML. Used on project pages', 'ignitiondeck'), 'id' => $prefix . 'project_long_description', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => true, 'type' => 'textarea_medium'), array('name' => __('Video Embed Code', 'ignitiondeck'), 'desc' => __('Video embed code using iframe or embed format (YouTube, Vimeo, etc)', 'ignitiondeck'), 'id' => $prefix . 'product_video', 'class' => $prefix . 'projectmeta_full', 'show_help' => true, 'type' => 'textarea_small'), array('type' => 'headline1', 'class' => $prefix . 'projectmeta_headline1'), array('type' => 'level1wraptop', 'class' => 'projectmeta_none'), array('name' => __('Level Title', 'ignitiondeck'), 'id' => $prefix . 'product_title', 'class' => $prefix . 'projectmeta_reward_title', 'show_help' => false, 'type' => 'text'), array('name' => __('Level Price', 'ignitiondeck'), 'id' => $prefix . 'product_price', 'class' => $prefix . 'projectmeta_reward_price', 'type' => 'text_money'), array('name' => __('Level Short Description', 'ignitiondeck'), 'desc' => __('Used in widgets sidebars, and in some cases, on the purchase form', 'ignitiondeck'), 'id' => $prefix . 'product_short_description', 'class' => $prefix . 'projectmeta_reward_desc', 'show_help' => true, 'type' => 'textarea_small'), array('name' => __('Level Long Description', 'ignitiondeck'), 'desc' => __('For use on the project page and in level shortcodes/widgets', 'ignitiondeck'), 'id' => $prefix . 'product_details', 'class' => $prefix . 'projectmeta_reward_desc tinymce', 'show_help' => true, 'type' => 'textarea_medium'), array('name' => __('Level Limit', 'ignitiondeck'), 'desc' => __('Restrict the number of buyers that can back this level', 'ignitiondeck'), 'id' => $prefix . 'product_limit', 'class' => $prefix . 'projectmeta_reward_limit', 'show_help' => true, 'type' => 'text_small'), array('name' => __('Level Order', 'ignitiondeck'), 'desc' => __('Enter a number of 0 (first) or higher if you wish to customize the placement of this level', 'ignitiondeck'), 'id' => $prefix . 'projectmeta_level_order', 'class' => $prefix . 'projectmeta_reward_limit', 'show_help' => true, 'type' => 'text_small'), array('type' => 'level1wrapbottom', 'class' => 'projectmeta_none'), array('name' => '<h4 class="ign_projectmeta_title">' . __('Additional Levels', 'ignitiondeck') . '</h4>', 'std' => '', 'id' => $prefix . 'level', 'class' => $prefix . 'projectmeta_full new_levels', 'show_help' => false, 'type' => 'product_levels'), array('name' => __('Add Level', 'ignitiondeck'), 'id' => $prefix . 'addlevels', 'class' => $prefix . 'projectmeta_full new_level', 'type' => 'add_levels'), array('type' => 'headline2', 'class' => $prefix . 'projectmeta_headline2'), array('name' => __('Image 2', 'ignitiondeck'), 'desc' => __('Image 2 - Shortcode: [project_image product="{product_number}" image="2"]', 'ignitiondeck'), 'id' => $prefix . 'product_image2', 'class' => $prefix . 'projectmeta_left', 'show_help' => true, 'type' => 'file'), array('name' => __('Image 3', 'ignitiondeck'), 'desc' => __('Image 3 - Shortcode: [project_image product="{product_number}" image="3"]', 'ignitiondeck'), 'id' => $prefix . 'product_image3', 'class' => $prefix . 'projectmeta_left', 'show_help' => true, 'type' => 'file'), array('name' => __('Image 4', 'ignitiondeck'), 'desc' => __('Image 4 - Shortcode: [project_image product="{product_number}" image="4"]', 'ignitiondeck'), 'id' => $prefix . 'product_image4', 'class' => $prefix . 'projectmeta_left', 'show_help' => true, 'type' => 'file'), array('name' => __('Project FAQs', 'ignitiondeck'), 'desc' => __('List Project FAQs here', 'ignitiondeck'), 'id' => $prefix . 'faqs', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => true, 'type' => 'textarea_medium'), array('name' => __('Project Updates', 'ignitiondeck'), 'desc' => __('List Project Updates here', 'ignitiondeck'), 'id' => $prefix . 'updates', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => true, 'type' => 'textarea_medium')));
    return apply_filters('id_postmeta_boxes', $meta_boxes);
}
Exemplo n.º 2
0
/**
 * Automatically adds complete project shortcode to the content when enabled via IDCF Project Settings
 * @param string $content passing through the filter
 */
function idcf_auto_insert($content)
{
    global $post;
    global $theme_base;
    if ($post->post_type == 'ignition_product' && !in_array($theme_base, array('fivehundred', 'fundify', 'crowdpress'))) {
        $auto_insert = get_option('idcf_auto_insert');
        if ($auto_insert) {
            if (!is_id_pro()) {
                $post_id = $post->ID;
                $project_id = get_post_meta($post_id, 'ign_project_id', true);
                $content = do_shortcode('[project_page_complete product="' . $project_id . '"]');
            }
        }
    }
    return $content;
}
Exemplo n.º 3
0
function idf_set_roles()
{
    global $crowdfunding;
    global $current_user;
    if (is_multisite()) {
        require ABSPATH . WPINC . '/pluggable.php';
    }
    get_currentuserinfo();
    $user_id = $current_user->ID;
    $user = get_user_by('id', $user_id);
    // setup general roles for product suite
    if (current_user_can('administrator') && !current_user_can('create_edit_projects')) {
        $admin = get_role('administrator');
        $cap_array = array('create_edit_projects');
        foreach ($cap_array as $cap) {
            $admin->add_cap($cap);
        }
    }
    $creator = false;
    if ($crowdfunding) {
        // we know that IDC is set to commerce platform and IDCF is installed
        if (is_id_pro()) {
            $cperms = md_ide_creator_permissions();
            if ($cperms) {
                if (md_ide_opt_in_required()) {
                    $enable_creator = get_user_meta($user_id, 'enable_creator', true);
                    $user_projects = get_user_meta($user_id, 'ide_user_projects', true);
                    if ($enable_creator || !empty($user_projects)) {
                        $creator = true;
                    }
                } else {
                    $creator = true;
                }
            }
        }
    }
    if ($creator) {
        if (!current_user_can('create_edit_projects')) {
            if ($user_id > 0) {
                if (!empty($user)) {
                    $user->add_cap('create_edit_projects');
                }
            }
        }
    }
}
Exemplo n.º 4
0
function product_settings()
{
    require 'languages/text_variables.php';
    global $wpdb;
    if (is_id_pro()) {
        $project_default = get_option('id_project_default');
    }
    if (function_exists('idf_platform')) {
        $platform = idf_platform();
    } else {
        $platform = 'legacy';
    }
    $purchase_default = get_option('id_purchase_default');
    $ty_default = get_option('id_ty_default');
    $auto_insert = get_option('idcf_auto_insert');
    //============================================================================================================================================
    //	DEFAULT settings
    //============================================================================================================================================
    $sql_currency = "SELECT * FROM " . $wpdb->prefix . "ign_prod_default_settings WHERE id = '1'";
    $default_currency = $wpdb->get_row($sql_currency);
    if (isset($_POST['btnSubmitDefaultSettings'])) {
        if (!empty($_POST['ignitiondeck_form_default'])) {
            $serializedFormDefault = serialize($_POST['ignitiondeck_form_default']);
        } else {
            $serializedFormDefault = serialize(array());
        }
        if ($_POST['btnSubmitDefaultSettings'] == $tr_Save_Settings) {
            $default_currency->currency_code = $_POST['currency_code_default'];
            $sql_insert = "\tINSERT INTO " . $wpdb->prefix . "ign_prod_default_settings\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\tform_settings,\n\t\t\t\t\t\t\t\t\tcurrency_code\n\t\t\t\t\t\t\t\t) values (\n\t\t\t\t\t\t\t\t\t'" . $serializedFormDefault . "',\n\t\t\t\t\t\t\t\t\t'" . $default_currency->currency_code . "'\n\t\t\t\t\t\t\t\t)";
            $res = $wpdb->query($sql_insert);
            // first time we are setting defaults, so we're updating option to avoid future nags
            update_option('id_defaults_notice', 'off');
            $message = '<div class="updated fade below-h2" id="message" class="updated"><p>' . $tr_Save_Settings . '</p></div>';
        }
        if ($_POST['btnSubmitDefaultSettings'] == $tr_Update_Settings) {
            $default_currency->currency_code = isset($_POST['currency_code_default']) ? $_POST['currency_code_default'] : 'USD';
            $sql_update = "\tUPDATE " . $wpdb->prefix . "ign_prod_default_settings SET\n\t\t\t\t\t\t\t\tform_settings='" . $serializedFormDefault . "',\n\t\t\t\t\t\t\t\tcurrency_code = '" . $default_currency->currency_code . "'\n\t\t\t\t\t\t\t\tWHERE id='1'";
            $res = $wpdb->query($sql_update);
            update_option('id_defaults_notice', 'off');
            $message = '<div class="updated fade below-h2" id="message" class="updated"><p>' . $tr_Settings_updated . '</p></div>';
        }
        // purchase url
        $purl_sel = esc_attr($_POST['ign_option_purchase_url']);
        if ($purl_sel == 'page_or_post') {
            $purl = absint($_POST['ign_purchase_post_name']);
        } else {
            $purl = esc_attr($_POST['id_purchase_URL']);
        }
        $purchase_default = array('option' => $purl_sel, 'value' => $purl);
        update_option('id_purchase_default', $purchase_default);
        if (idf_exists() && idf_platform() == 'legacy') {
            // ty url
            $tyurl_sel = esc_attr($_POST['ign_option_ty_url']);
            if ($tyurl_sel == 'page_or_post') {
                $tyurl = absint($_POST['ign_ty_post_name']);
            } else {
                $tyurl = esc_attr($_POST['id_project_URL']);
            }
            $ty_default = array('option' => $tyurl_sel, 'value' => $tyurl);
            update_option('id_ty_default', $ty_default);
        }
        if (isset($_POST['auto_insert'])) {
            $auto_insert = absint($_POST['auto_insert']);
        } else {
            $auto_insert = 0;
        }
        update_option('idcf_auto_insert', $auto_insert);
    }
    $sql = "SELECT * FROM " . $wpdb->prefix . "ign_prod_default_settings WHERE id='1'";
    $res1 = $wpdb->query($sql);
    $rows = $wpdb->get_results($sql);
    $row =& $rows[0];
    if ($row != null) {
        $submit_default = $tr_Update_Settings;
        $form_default = unserialize($row->form_settings);
    } else {
        $submit_default = $tr_Save_Settings;
    }
    $products = ID_Project::get_all_projects();
    $args = array('orderby' => 'title', 'order' => 'ASC', 'post_type' => array('post', 'page'), 'posts_per_page' => -1);
    $list = new WP_Query($args);
    echo '<div class="wrap">
			' . admin_menu_html();
    include_once 'templates/admin/_productSettings.php';
    echo '</div>';
}
Exemplo n.º 5
0
}
idcf_get_project();
get_header();
?>
	<div id="site-description" class="project-single">
		<?php 
echo idcf_get_project_title();
?>
        <?php 
echo idcf_get_short_description();
?>
        <span class="product-author-details">
          <i class="fa fa-user"></i>
          <span>
			  <?php 
if (function_exists('is_id_pro') && is_id_pro()) {
    echo $profile['name'];
} else {
    the_author();
}
?>
          </span>
              <?php 
$terms = wp_get_post_terms($post->ID, 'project_category');
if (!empty($terms)) {
    ?>
                        <i class="fa fa-folder-open"></i>
                        <span class="project-tag-single">
                        <?php 
    $site_url = home_url();
    $cat_name = "";
function is_id_licensed()
{
    $is_pro = is_id_pro();
    $is_basic = is_id_basic();
    $was_licensed = was_id_licensed();
    if ($is_pro || $is_basic || $was_licensed) {
        return true;
    } else {
        return false;
    }
}
function ide_add_project_order_info($title, $last_order)
{
    $order_id = $last_order->id;
    $mdid_order = mdid_by_orderid($order_id);
    if (!empty($mdid_order)) {
        $pay_id = $mdid_order->pay_info_id;
        $id_order = new ID_Order($pay_id);
        $get_order = $id_order->get_order();
        if (!empty($get_order)) {
            $project_id = $get_order->product_id;
            $project = new ID_Project($project_id);
            $post_id = $project->get_project_postid();
            if ($post_id > 0 && !is_id_pro()) {
                $project_title = get_the_title($post_id);
                $title = $project_title . ': ' . $title;
            }
        }
    }
    return $title;
}
Exemplo n.º 8
0
             <?php 
if (!empty($profile['url'])) {
    ?>
		<span class="contact-link"><i class="icon-link"></i> 
			<?php 
    $string = '<a href="' . $profile['url'] . '" target="_blank">' . $profile['url'] . '</a>';
    echo make_clickable($string);
    ?>
        </span>
		<?php 
}
?>
    </div>
    <div class="author-bio-profile">
     <?php 
if (function_exists('is_id_pro') && is_id_pro() && !empty($profile['logo'])) {
    ?>
	  <?php 
    echo '<img class="avatar avatar-80 photo" width="64" height="64" src="' . $profile['logo'] . '"/>';
    ?>
      <?php 
} else {
    ?>
          <?php 
    echo get_avatar(get_the_author_meta('ID'), 64);
    ?>
      <?php 
}
?>
   </div>
</div>
    if ($list->have_posts()) {
        while ($list->have_posts()) {
            $list->the_post();
            $post_id = get_the_ID();
            echo '<option value="' . $post_id . '" ' . (!empty($ty_default['option']) && $ty_default['option'] == 'page_or_post' && isset($ty_default['value']) && $ty_default['value'] == $post_id ? 'selected="selected"' : '') . '>' . get_the_title() . '</option>';
        }
    }
    ?>
								            </select>
								        </td>
									</tr>
									<?php 
}
?>
									<?php 
if (!is_id_pro()) {
    ?>
									<tr>
										<td>
											<input type="checkbox" name="auto_insert" id="auto_insert" value="1" <?php 
    echo isset($auto_insert) && $auto_insert ? 'checked="checked"' : '';
    ?>
 /> <label for="auto_insert"><?php 
    _e('Automatically insert project template', 'ignitiondeck');
    ?>
</label>
										</td>
									</tr>
									<?php 
}
?>