__('My Account Page Settings', 'galaxyfunder'), 'type' => 'title', 'desc' => '', 'id' => '_cf_my_campaign' ), array( 'name' => __('My Campaign Table Show/Hide', 'galaxyfunder'), 'desc' => __('This Controls the My Campaign Table Show or Hide', 'galaxyfunder'), 'id' => 'cf_display_mycampaign_table', 'css' => 'min-width:150px;', 'std' => 'on', // WooCommerce < 2.0 'default' => 'on', // WooCommerce >= 2.0 'newids' => 'cf_display_mycampaign_table', 'type' => 'select', 'options' => array( 'on' => __('Show', 'galaxyfunder'), 'off' => __('Hide', 'galaxyfunder'), ), ), array( 'name' => __('Title of My Campaign', 'galaxyfunder'), 'desc' => __('Change My Campaign Title in My Account Page', 'galaxyfunder'), 'tip' => '', 'id' => 'cf_mycampaign_title', 'css' => 'min-width:550px;', 'std' => 'My Campaigns', 'type' => 'text', 'newids' => 'cf_mycampaign_title', 'desc_tip' => true, ), array( 'name' => __('S.No Label', 'galaxyfunder'), 'desc' => __('Change S.No Caption in Single in My Campaign table by your Custom Words', 'galaxyfunder'), 'tip' => '', 'id' => 'cf_mycampaign_serial_number_label', 'css' => 'min-width:550px;', 'std' => 'S.No', 'type' => 'text', 'newids' => 'cf_mycampaign_serial_number_label', 'desc_tip' => true, ), array( 'name' => __('Campaign Label', 'galaxyfunder'), 'desc' => __('Change Campaign Caption in My Campaign table by your Custom Words', 'galaxyfunder'), 'tip' => '', 'css' => 'min-width:550px;', 'id' => 'cf_mycampaign_campaign_label', 'std' => 'Campaign', 'type' => 'text', 'newids' => 'cf_mycampaign_campaign_label', 'desc_tip' => true, ), array( 'name' => __('Date Label', 'galaxyfunder'), 'desc' => __('Change Date Caption in My Campaign table by your Custom Words', 'galaxyfunder'), 'tip' => '', 'css' => 'min-width:550px;', 'id' => 'cf_mycampaign_date_label', 'std' => 'Date', 'type' => 'text', 'newids' => 'cf_mycampaign_date_label', 'desc_tip' => true, ), array( 'name' => __('Goal Label', 'galaxyfunder'), 'desc' => __('Change Goal Caption in My Campaign table by your Custom Words', 'galaxyfunder'), 'tip' => '', 'css' => 'min-width:550px;', 'id' => 'cf_mycampaign_goal_label', 'std' => 'Goal', 'type' => 'text', 'newids' => 'cf_mycampaign_goal_label', 'desc_tip' => true, ), array( 'name' => __('Fund Raised Label', 'galaxyfunder'), 'desc' => __('Change Fund Raised Caption in My Campaign table by your Custom Words', 'galaxyfunder'), 'tip' => '', 'css' => 'min-width:550px;', 'id' => 'cf_mycampaign_raised_label', 'std' => 'Raised', 'type' => 'text', 'newids' => 'cf_mycampaign_raised_label', 'desc_tip' => true, ), array( 'name' => __('Fund Raised Percentage Label', 'galaxyfunder'), 'desc' => __('Change Fund Raised Percentage Caption in My Campaign table by your Custom Words', 'galaxyfunder'), 'tip' => '', 'css' => 'min-width:550px;', 'id' => 'cf_mycampaign_raised_percent_label', 'std' => 'Raised %', 'type' => 'text', 'newids' => 'cf_mycampaign_raised_percent_label', 'desc_tip' => true, ), array( 'name' => __('Funders Label', 'galaxyfunder'), 'desc' => __('Change Funders in My Campaign table by your Custom Words', 'galaxyfunder'), 'tip' => '', 'css' => 'min-width:550px;', 'id' => 'cf_mycampaign_funders_label', 'std' => 'Funders', 'type' => 'text', 'newids' => 'cf_mycampaign_funders_label', 'desc_tip' => true, ), array( 'name' => __('Status Label', 'galaxyfunder'), 'desc' => __('Change Funders in My Campaign table by your Custom Words', 'galaxyfunder'), 'tip' => '', 'css' => 'min-width:550px;', 'id' => 'cf_mycampaign_status_label', 'std' => 'Status', 'type' => 'text', 'newids' => 'cf_mycampaign_status_label', 'desc_tip' => true, ), array( 'name' => __('Campaign Table Position', 'galaxyfunder'), 'type' => 'radio', 'desc' => '', 'id' => 'cf_mycampaign_table_position', 'options' => array('1' => 'Start of My Account', '2' => 'End of My Account'), 'class' => 'cf_mycampaign_table_position', 'std' => '2', 'newids' => 'cf_mycampaign_table_position', ), array( 'name'=>__('Show/Hide Your Subscribe Link', 'galaxyfunder'), 'desc' => __('Show/Hide Your Subscribe Link if you want to display it in my account page', 'galaxyfunder'), 'id' => 'gf_show_hide_your_subscribe_link', 'newids' => 'gf_show_hide_your_subscribe_link', 'class' => 'gf_show_hide_your_subscribe_link', 'std' => '1', 'type' => 'select', 'options' => array( '1' => __('Show', 'galaxyfunder'), '2' => __('Hide', 'galaxyfunder'), ), ), array( 'name'=>__('Subscribe Link Message','galaxyfunder'), 'desc'=>__('This Message will be displayed on the option to Unsubscribe from Galaxy Funder Emails','galaxyfunder'), 'id'=>'gf_unsubscribe_message_myaccount_page', 'css' => 'min-width:550px;', 'std'=>'Unsubscribe here To Stop Receiving Email', 'type'=>'textarea', 'newids'=>'gf_unsubscribe_message_myaccount_page', 'class'=>'gf_unsubscribe_message_myaccount_page', 'desc_tip' => true, ), array('type' => 'sectionend', 'id' => '_cf_my_campaign'), )); } public static function cf_admin_my_campaign_settings() { woocommerce_admin_fields(FPCrowdFundingMycampaign::cf_admin_my_campaign_options()); } public static function cf_admin_my_campaign_update_settings() { woocommerce_update_options(FPCrowdFundingMycampaign::cf_admin_my_campaign_options()); } public static function cf_default_my_account_page() { global $woocommerce; foreach (FPCrowdFundingMycampaign::cf_admin_my_campaign_options() as $setting) { if (isset($setting['newids']) && ($setting['std'])) { if (get_option($setting['newids']) == FALSE) { add_option($setting['newids'], $setting['std']); } } } } public static function cf_my_account_campaign() { if (get_option('cf_display_mycampaign_table') == "on") { global $woocommerce; echo '

' . get_option("cf_mycampaign_title") . '

'; $user_ID = get_current_user_id(); $args = array('post_type' => 'product', 'posts_per_page' => '-1', 'author' => $user_ID, 'post_status' => 'draft,publish'); ?> have_posts()) { // echo ''; echo '

' . __('Search:', 'galaxyfunder') . ' ' . __('Page Size:', 'galaxyfunder') . '

'; echo '
'; echo ''; $i = 0; while ($listmycampaign->have_posts()) { $listmycampaign->the_post(); if (get_post_meta(get_the_ID(), '_crowdfundingcheckboxvalue', true) == 'yes') { $i++; echo ''; echo ''; echo ''; echo ''; echo ''; if (get_post_meta(get_the_ID(), '_crowdfundingtotalprice', true) == '') { $total_price = CrowdFunding::get_woocommerce_formatted_price(0); } else { $total_price = CrowdFunding::get_woocommerce_formatted_price(get_post_meta(get_the_ID(), '_crowdfundingtotalprice', true)); } echo ''; if (get_post_meta(get_the_ID(), '_crowdfundinggoalpercent', true) == '') { $percentage_value = 0; } else { $percentage_value = get_post_meta(get_the_ID(), '_crowdfundinggoalpercent', true); } echo ''; if (get_post_meta(get_the_ID(), '_update_total_funders', true) == '') { $total_funders = 0; } else { $total_funders = get_post_meta(get_the_ID(), '_update_total_funders', true); } echo ''; //same date function from backend echo ''; echo ''; } } echo '
' . get_option('cf_mycampaign_serial_number_label') . '' . get_option('cf_mycampaign_campaign_label') . '' . get_option('cf_mycampaign_date_label') . '' . get_option("cf_mycampaign_goal_label") . '' . get_option("cf_mycampaign_raised_label") . '' . get_option("cf_mycampaign_raised_percent_label") . '' . get_option("cf_mycampaign_funders_label") . '' . get_option("cf_mycampaign_status_label") . '
' . $i . '' . get_the_title() . '' . get_the_date() . '' . CrowdFunding::get_woocommerce_formatted_price(get_post_meta(get_the_ID(), '_crowdfundinggettargetprice', true)) . '' .$total_price . '' . $percentage_value . '%' . $total_funders . ''; $datestr = get_post_meta(get_the_ID(), '_crowdfundingtodatepicker', true) . " 23:59:59"; //Your date $date = strtotime($datestr); //Converted to a PHP date (a second count) //Calculate difference if (get_post_status(get_the_ID()) == 'publish') { if ($date >= time()) { $diff = $date - time(); //time returns current time in seconds $days = floor($diff / (60 * 60 * 24)); //seconds/minute*minutes/hour*hours/day) //$hours = round(($diff - $days * 60 * 60 * 24) / (60 * 60)); //Report if ($days > 1) { //_e($days . "days to go", "galaxyfunder"); echo $days . __('days to go', 'galaxyfunder'); } else { // _e($days . "day to go", "galaxyfunder"); echo $days . __('day to go', 'galaxyfunder'); } } else { //_e("Campaign Closed", "galaxyfunder"); echo __('Campaign Closed', 'galaxyfunder'); } } else { $chstatus = get_post_status(get_the_ID()); if ($chstatus == 'draft') { echo __('Pending Review', 'galaxyfunder'); } } echo '
'; } else { // no posts found } /* Restore original Post Data */ wp_reset_postdata(); } } public static function crowdfunding_enqueue_scripts() { wp_register_script('jqueryfootable', plugins_url('gf/js/footable.js')); wp_register_script('jqueryfootablesort', plugins_url('gf/js/footable.sort.js')); wp_register_script('jqueryfootablepaging', plugins_url('gf/js/footable.paginate.js')); wp_register_script('jqueryfootablefilter', plugins_url('gf/js/footable.filter.js')); wp_register_style('jqueryfootablecss', plugins_url('gf/css/footable.core.css')); wp_register_style('bootstrapnavigation', plugins_url('gf/css/bootstrap.css')); wp_register_style('progressstyle2css', plugins_url('gf/css/mystyle.css')); wp_enqueue_script('jquery'); wp_enqueue_script('jqueryfootable'); wp_enqueue_script('jqueryfootablepaging'); wp_enqueue_script('jqueryfootablefilter'); wp_enqueue_style('jqueryfootablecss'); wp_enqueue_style('bootstrapnavigation'); wp_enqueue_style('progressstyle2css'); wp_enqueue_script('jqueryfootablesort'); } public static function add_script_to_head() { if (!is_product()) { ?>